diff options
author | Tucker Evans <tuckerevans24@gmail.com> | 2019-07-14 13:16:56 -0400 |
---|---|---|
committer | Tucker Evans <tuckerevans24@gmail.com> | 2019-07-14 13:16:56 -0400 |
commit | bedb3a6cd7e22f4cde0969e8d2e1f2596efd8c8d (patch) | |
tree | 77b7778809376e9ba556a1c1fba966768f21c4a3 | |
parent | 100832ec16c4cb7c4dc50e0e8946f72b6fca4c05 (diff) |
Add tokens/types for yacc
-rw-r--r-- | pc.y | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -23,10 +23,12 @@ TODO: %token VAR %token PROC FUNC %token BEG END +%token <sval> ID %token <opval> ADDOP %token <opval> MULOP %token <opval> RELOP +%token ASSIGNOP %token ADD SUB %token MUL DIV @@ -55,6 +57,25 @@ TODO: %token LIST + +%type <tval> factor +%type <tval> term +%type <tval> expr +%type <tval> simple_expr + +%type <tval> id_list +%type <tval> expr_list + +%type <tval> statement +%type <tval> statement_list +%type <tval> compound_statement +%type <tval> opt_statements +%type <tval> proc_statement + +%type <tval> var +%type <ival> type +%type <ival> standard_type + %% program |