Skip to content

Commit

Permalink
1. Select 集删除了 printf、scanf 语句冗杂部分,简化用法为:scanf(<identifier>),相应改变了语法分…
Browse files Browse the repository at this point in the history
…析子函数

2. 定义了 SupportTable(map 实现)、CodeSequence,用于中间变量的存储、综合属性 code 的表示
3. 符号表加入了 offset 一列,表示变量的偏移地址
4. MatchToken 修改了只有标识符符号表才会有操作
5. 实现了 ShowTree 方法
6. 新的综合属性表示类,表示返回值为 op、value 的类
7. 因为生成的树不是抽象语法树,所以遍历时不方便产生完整的四元式,在 CodeTerm 类中新增三个变量暂存一个不完整的四元式
8. 用一个全局变量 total 表示当前共生成了多少四元式,供定义 Label 时确定此 Label 的行数
  • Loading branch information
IceCapriccio committed Dec 9, 2018
1 parent 45e3826 commit e7d74de
Show file tree
Hide file tree
Showing 30 changed files with 1,712 additions and 470 deletions.
6 changes: 6 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

479 changes: 340 additions & 139 deletions .idea/workspace.xml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ project(Compiler)

set(CMAKE_CXX_STANDARD 14)

add_executable(Compiler main.cpp LexAnalyse.cpp LexAnalyse.h SyntaxAnalyse.cpp SyntaxAnalyse.h SemanticAnalyse.cpp SemanticAnalyse.h)
#add_executable(Compiler main.cpp LexAnalyse.cpp LexAnalyse.h SyntaxAnalyse.cpp SyntaxAnalyse.h SemanticAnalyse.cpp SemanticAnalyse.h)
add_executable(Compiler main.cpp LexAnalyse.cpp LexAnalyse.h SyntaxAnalyse.cpp SyntaxAnalyse.h SemanticAnalyse.cpp SemanticAnalyse.h IntermediateCodeGenerate.cpp IntermediateCodeGenerate.h)
Loading

0 comments on commit e7d74de

Please sign in to comment.