编译原理2017
2017年秋季在“编译原理”课程中进行的实验。
什么是C1语言?
本课程中的C1语言是C编程语言的子集。 它不包括整体类型系统。 仅支持array of integers和integer array of integers ,并且可以用const描述。 C1中的函数没有任何参数或返回值。
可以使用EBNF(扩展Backus-Naur形式)描述语法,如下所示:
CompUnit → [ CompUnit ] ( Decl | FuncDef )
Decl → ConstDecl | VarDecl
ConstDecl → const int ConstDef { , ConstDef } ';'
ConstDef → ident '=' Exp | ident '[' [ Exp ] ']' '=' '{' Exp { ',' Exp
评论0
最新资源