aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-07-14 13:16:56 -0400
committerTucker Evans <tuckerevans24@gmail.com>2019-07-14 13:16:56 -0400
commitbedb3a6cd7e22f4cde0969e8d2e1f2596efd8c8d (patch)
tree77b7778809376e9ba556a1c1fba966768f21c4a3
parent100832ec16c4cb7c4dc50e0e8946f72b6fca4c05 (diff)
Add tokens/types for yacc
-rw-r--r--pc.y21
1 files changed, 21 insertions, 0 deletions
diff --git a/pc.y b/pc.y
index 36ea663..05d7a2e 100644
--- a/pc.y
+++ b/pc.y
@@ -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