This website works better with JavaScript.
Explore
Help
Sign In
ppxf25tqu
/
nudt-compiler-cpp
forked from
NUDT-compiler/nudt-compiler-cpp
Watch
1
Star
0
Fork
You've already forked nudt-compiler-cpp
1
Code
Issues
Pull Requests
Packages
Projects
Releases
Wiki
Activity
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
da4e8fd860
develop
master
Branches
Tags
${ item.name }
Create tag
${ searchTerm }
Create branch
${ searchTerm }
from 'da4e8fd860'
${ noResults }
nudt-compiler-cpp
/
To_do_list
/
lab2.md
664 B
Raw
Blame
History
Unescape
Escape
lab2主要分为3个阶段
:
sema
。 检查语义约束。通过修改
sem文件夹
中的SemaVisitor实现。具体来说
,
SemaVisitor继承自SysYBaseVisitor类。而antlr4依据SysY.g4生成的这个SysYBaseVisitor类里面已经对各种规则
(
比如
,
规则compUnit
)
实现了visitor方法
(
比如visitCompUnit
)
。为了达到我们的目的
,
即检查各种语义约束
,
我们需要利用虚函数的多态
,
重写这个方法。具体来说
,
这一阶段需要实现的各种约束见
SysY语义约束
。
ir
。
irgen
。