summaryrefslogtreecommitdiffstats
path: root/src/ast.c
Commit message (Collapse)AuthorAgeFilesLines
* Re-add line number fields in AST nodesTing-Wei Lan2015-12-071-9/+10
| | | | It is required to show line numbers in error messages.
* Drop all non-namespaced symbolsTing-Wei Lan2015-12-031-69/+67
| | | | | | | | | | | | | | 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 line_number and prog global variablesTing-Wei Lan2015-12-021-3/+0
| | | | | All important states should be stored in the local struct allocated in main function.
* All source files should include vim modelinesTing-Wei Lan2015-11-301-0/+2
|
* Include our headers before including system headersTing-Wei Lan2015-11-301-1/+3
|
* Enable POSIX extensionsTing-Wei Lan2015-11-131-0/+4
|
* Merge TA's codes to ourskugwa2015-11-111-0/+114
Delete tmp funtion used in HW2. Move AST functions into ast.c. CONST_INT, CONST_FLOAT, and CONST_STRING all return CONST.