updated testing for parser

This commit is contained in:
Partho Bhattacharya committed 2025-02-27 15:22:02 -05:00
1 parent 5626a5c371
commit c85540afdf
3 files changed
+2108 -8

No files matched your search

+8 -8
View File
@@ -7,6 +7,8 @@
#include "symbol_table.c"
extern int yylex(void);
void yyerror(const char *err);
extern char* yytext;
extern int yychar;
%}
%token ID 101
@@ -59,15 +61,9 @@
input: /*empty for now*/
OPTIONAL;
OPTIONAL_OPTIONAL:
OPTIONAL
| OPTIONAL_OPTIONAL OPTIONAL {printf("expansion\n");};
OPTIONAL:
'[' {printf("success");}
|%empty
;
'[' {printf("success");};
// B : '{'{CreateScope(cur,line,column)} 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
@@ -82,5 +78,9 @@ void yyerror(const char *err) {
fprintf(stderr, "Error: %s\n", err);
}
int main() {
return yyparse();
int a;
while (a = yyparse()){
printf("%d = a: yytext = %s: yychar = %d\n", a, yytext, yychar);
}
return 0;
}
+2100
View File
File diff suppressed because it is too large. Load diff
BIN
View File
Binary file not shown.