資源簡介
Duke University graduate student, Chinese, this is one of my project in compile course. 本人編譯原理課的代碼
代碼片段和文件信息
‘‘‘
Created?on?1511-9-6
@author:?Jenny
‘‘‘
def?foo():
????“this?is?a?document“
????return
#save?the?reserved?words
reservedWord?=?[‘If‘?‘Else‘?‘Then‘?‘End‘?‘Program‘?‘Declare‘?‘Real‘?‘Integer‘
??????????????‘Procedure‘?‘Value‘?‘Reference‘?‘Main‘?‘Input‘?‘Output‘?‘Call‘?‘Do‘?‘Until‘]
codeDict?=?{‘If‘:1?‘Else‘:2?‘Then‘:3?‘End‘:4?‘Program‘:5?‘Declare‘:6?‘Real‘:7?‘Integer‘:8
??????????????‘Procedure‘:9?‘Value‘:10?‘Reference‘:11?‘Main‘:12?‘Input‘:13?‘Output‘:14
??????????????‘Call‘:30?‘Do‘:16?‘Until‘:17?‘Identifier‘:18?‘IntegerNum‘:19?‘RealNum‘:15?‘Strings‘:21
??????????????‘;‘:22?‘=‘:23?‘‘:24?‘[‘:25?‘]‘:26?‘(‘:27?‘)‘:28?‘<‘:29?‘>‘:30?‘!‘:31?‘:‘:31?‘+‘:32?‘-‘:33?‘*‘:34?‘/‘:36?‘{‘:37?‘}‘:38
??????????????‘==‘:39?‘!=‘:15?‘<=‘:41?‘>=‘:42?‘<-‘:43?‘||‘:44?‘&&‘:45?‘::‘:46?}
stringasc1?=?set([‘;‘?‘=‘?‘‘?‘[‘?‘]‘?‘(‘?‘)‘?‘<‘?‘>‘?‘!‘?‘:‘?‘-‘?‘*‘?‘/‘?‘{‘?‘}‘?‘+‘?‘=‘?‘|‘?‘&‘?‘:‘])
flags?=?{‘0‘:‘-‘?
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????5809??2011-10-20?04:42??Analyser.py
?????文件????????4544??2011-10-07?06:14??grammarout.txt
?????文件????????7395??2011-10-07?12:28??Matrix.txt
?????文件?????????571??2011-10-07?07:31??Parser?Test?Data?Error.txt
?????文件????????1637??2011-10-07?07:30??Parser?Test?Data.txt
?????文件????????8407??2011-10-24?01:27??parser.py
?????文件???????21523??2011-10-06?09:33??precedence.txt
?????文件????????2790??2011-10-06?13:00??ProductionArray.txt
?????文件????????1443??2011-10-24?01:54??wpfile.txt
評論
共有 條評論