From f899a5fcbc4653d39f18efb30aa1092cc66c3cdf Mon Sep 17 00:00:00 2001 From: Josh Date: Thu, 31 Oct 2024 11:46:29 -0700 Subject: [PATCH] added parser text --- lab-4/parser.bison | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lab-4/parser.bison b/lab-4/parser.bison index e4c4b6f..95eab98 100644 --- a/lab-4/parser.bison +++ b/lab-4/parser.bison @@ -68,6 +68,7 @@ statements : statements statement statement : section | sect_data | simple_stmt + | data_space ; section : type TOKEN_KEYWORD_DIVISION TOKEN_DOT | type TOKEN_RUN TOKEN_DOT @@ -80,11 +81,28 @@ type : TOKEN_IDENTIFICATION | TOKEN_KEYWORD_DATA ; simple_stmt : function + | TOKEN_KEYWORD_FUNCTION cbl_function + ; +cbl_function : TOKEN_KEYWORD_COMPUTE parms ; function : TOKEN_DISPLAY parms + | function simple_stmt + | if_branch ; parms : TOKEN_STRING ; +if_branch : if_branch parms if_branch + | TOKEN_IF + | TOKEN_ELSE_IF + | TOKEN_ELSE + | TOKEN_END_IF + ; +data_space : TOKEN_WORKING_STORAGE TOKEN_KEYWORD_SECTION TOKEN_DOT + ; + + + + %%