解释器(Interpreter),自定义语法(类C)

时间:2014-03-05 07:54:10
【文件属性】:
文件名称:解释器(Interpreter),自定义语法(类C)
文件大小:591KB
文件格式:RAR
更新时间:2014-03-05 07:54:10
解释器 编译 自动机 剖析树 "程序语言"这门课的课程实验。 给一个自定义语法的语言写一个解释器(Interpreter),首先写了Parser,然后存入剖析树(Parse Tree)对象中,最后根据Parse Tree的结构执行程序,计算出结果。 语法如下: ::= program (1) begin end ::= | (2) ::= | (3) ::= int ; (4) ::= | , (5) ::= |||| (6) ::= = ; (7) ::= if then end; (8) |if then else end; ::= while loop end; (9) ::= read ; (10) ::= write ; (11) ::=|! (12) | [ && ] | [ or ] ::= ( ) (13) ::= |+|- (14) ::= | * (15) ::= | | () (16) ::= != | == | < | > | <= | >= (17) ::= | | (18) ::= A | B | C | ... | X | Y | Z (19) ::= | (20) ::= 0 | 1 | 2 | 3 | ... | 9 (21)
【文件预览】:
InterpreterVS
----InterpreterVS.ncb(1.55MB)
----InterpreterVS()
--------InterpreterVS.vcproj.tong-PC.tong.user(1KB)
--------documentation(2KB)
--------Tokenizer.h(753B)
--------InterpreterVS.vcproj(4KB)
--------Debug()
--------Tokenizer.cpp(7KB)
--------Interpreter.cpp(15KB)
--------output(0B)
--------coreProgram(323B)
--------inputData(7B)
--------README(722B)
--------Interpreter.h(3KB)
--------Makefile(198B)
----InterpreterVS.suo(28KB)
----Debug()
--------InterpreterVS.ilk(380KB)
--------InterpreterVS.pdb(571KB)
--------InterpreterVS.exe(64KB)
----InterpreterVS.sln(905B)

网友评论

  • 理解起来很复杂
  • 我主要参考一下代码的逻辑,感觉注释不多,理解稍微有点困难,但还是有帮助的