From bedb3a6cd7e22f4cde0969e8d2e1f2596efd8c8d Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Sun, 14 Jul 2019 13:16:56 -0400 Subject: Add tokens/types for yacc --- pc.y | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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 ID %token ADDOP %token MULOP %token RELOP +%token ASSIGNOP %token ADD SUB %token MUL DIV @@ -55,6 +57,25 @@ TODO: %token LIST + +%type factor +%type term +%type expr +%type simple_expr + +%type id_list +%type expr_list + +%type statement +%type statement_list +%type compound_statement +%type opt_statements +%type proc_statement + +%type var +%type type +%type standard_type + %% program -- cgit v1.1