| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
ccmmc_ast_new_id() is not needed for the rule
|
| |
|
|
|
|
| |
It is required to show line numbers in error messages.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. All data types and macros in headers, global variables and functions
that have external linkage are namespaced. The only two files that
allow non-namespaced symbols are main.c and common.h. common.h should
not be included by any other headers.
2. Coding style is fixed when possible.
3. Drop unused variables or struct members.
4. 'name' macro is renamed to 'prog_name' to prevent conflicts with ast.h.
5. %union includes a CON_Type (now CcmmcValueConst) instead of a pointer
to it. This prevents an unnecessary malloc.
6. Fix buffer overflow in draw.c. draw.c should not modify the input AST
while generating the graph.
|
|
|
|
|
| |
All important states should be stored in the local struct allocated in
main function.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
1. Use "%right DL_RPAREN ELSE" to solve SR conflict.
2. Fix a bug in assign_expr: token ID is not an AST_NODE.
|
|
|
|
|
|
| |
1. Actions for binary operators are completed.
2. Rules and actions for unary operators are added.
3. Arrays can be used in expressions now.
|
|
|
|
|
| |
if and if-then-else have not been implemented.
Some actions after relop_expr is done for the test of for loop.
|
|
|
|
|
|
|
|
| |
1. dim_fn should be the child of ID
2. decl_list should be the child of VARIABLE_DECL_LIST_NODE
3. stmt_list should be the child of STMT_LIST_NODE
4. Add actions for decl_list
5. ID with initial value should use WITH_INIT_ID instead of NORMAL_ID
|
|
|
|
| |
Complete actions of some nonterminals derived from global_decl.
|
|
Delete tmp funtion used in HW2.
Move AST functions into ast.c.
CONST_INT, CONST_FLOAT, and CONST_STRING all return CONST.
|