summaryrefslogtreecommitdiffstats
path: root/src/ast.h
Commit message (Collapse)AuthorAgeFilesLines
* process_{relop_expr, var_ref} -> check_{relop_expr, var_ref}kugwa2015-12-091-4/+0
|
* Write results to AST nodes when evaluating constant expressionsTing-Wei Lan2015-12-071-0/+31
| | | | This commit also add a macro to reduce duplicate code.
* Handle constant expressions with integer division by zeroTing-Wei Lan2015-12-071-1/+2
|
* Re-add line number fields in AST nodesTing-Wei Lan2015-12-071-5/+11
| | | | It is required to show line numbers in error messages.
* Fix typo in ast.hTing-Wei Lan2015-12-061-2/+2
|
* Drop all non-namespaced symbolsTing-Wei Lan2015-12-031-175/+152
| | | | | | | | | | | | | | 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.
* Drop tab usage in source filesTing-Wei Lan2015-11-301-16/+16
|
* All source files should include vim modelinesTing-Wei Lan2015-11-301-0/+1
|
* Fix the build with --enable-compile-warnings=errorTing-Wei Lan2015-11-131-0/+3
| | | | | | 1. Add missing 'const' keyword for string literals. 2. Add missing 'static' keyword for internal functions. 3. Add missing default cases for switch statements.
* Merge TA's codes to ourskugwa2015-11-111-0/+179
Delete tmp funtion used in HW2. Move AST functions into ast.c. CONST_INT, CONST_FLOAT, and CONST_STRING all return CONST.