📄 readme
字号:
This is a compiler for the Asterix language. It consists of a front-endcompiler and a run time system (RTS).Both the compiler and the generated code are ANSI-C. The lexical analyzeris written in Flex, the parser in Bison. Use gmake to compile. The use ofgcc is highly encouraged, because gcc is able to automatically generate .dfiles with file dependencies.The structure of the compiler is simple: there are declarations, expressions,statements, and types. Each of these types has a field "subtype" whichstates the exact nature of the object.There is also a generic list type. It is implemented as an infinitelygrowable array of void *. C lacks generic types, so it is not possible tospecify the exact type of an element. All elements of a list are pointersto the same type; for example a list of formal parameters containsDeclaration *, while a list of actual arguments contains Expression *.Be careful using pointers. Whenever something goes wrong due to bad input,null pointers are used for missing expressions, unresolved types, and so on.During semantic analyses do not expect a pointer to be non-null. The onlyexception is a pointer to a token, and to token->name, which always pointsto something valid. If there are no lexical, parse, and semantic errors,the compiler starts generating code; in this phase one can safely assumeno null-pointers.Finally, be sure to read the comments in the header files!
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -