added initial block rules

This commit is contained in:
Partho Bhattacharya
2025-02-25 01:43:22 -05:00
parent cf25a1d7a4
commit 987a086dae
4 changed files with 2108 additions and 1 deletions

View File

@ -53,5 +53,12 @@
%token RELEASE 614 %token RELEASE 614
%token COMMENT 700 %token COMMENT 700
%% %%
B : '{' E '}'; //Braced Expressions can have braces removed to get regular expressions
D : '[' l ']'; //Declaration Lists Brackets can be taken out to get a list of Declarations
E : Maybe_D U; //An expression can start with an optional D followed by an undeclared segment
Maybe_D : D
| ; //Either D or not
l : A ';' l;
| ; //a declaration list can either be empty or be an assignment followed by a semi-colon and another list
%% %%

2100
lex.yy.c Normal file

File diff suppressed because it is too large Load Diff

BIN
runner Executable file

Binary file not shown.

View File

@ -81,7 +81,7 @@ int run(FILE *alpha) {
} }
if(token == 1999){ if(token == 1999){
printf("On line number %d and column number %d we have an invalid character:%s\n",line_number,column_number,yytext); printf("On line number %d and column number %d we have an invalid character:%s\n",line_number,column_number,yytext);
} return -1;}
column_number += yyleng; column_number += yyleng;
} }