Parser compiles from .y and .lex files
This commit is contained in:
10
grammar.y
10
grammar.y
@ -5,8 +5,10 @@
|
||||
%{
|
||||
#include <stdio.h>
|
||||
#include "symbol_table.c"
|
||||
extern int yylex(void);
|
||||
void yyerror(const char *err);
|
||||
%}
|
||||
|
||||
/*
|
||||
%token ID 101
|
||||
%token T_INTEGER 201
|
||||
%token T_ADDRESS 202
|
||||
@ -52,7 +54,7 @@
|
||||
%token DOT 612
|
||||
%token RESERVE 613
|
||||
%token RELEASE 614
|
||||
%token COMMENT 700
|
||||
%token COMMENT 700 */
|
||||
%%
|
||||
|
||||
start: /*empty for now*/
|
||||
@ -67,7 +69,9 @@ start: /*empty for now*/
|
||||
|
||||
%%
|
||||
|
||||
void yyerror(const char *err) {
|
||||
fprintf(stderr, "Error: %s\n", err);
|
||||
}
|
||||
int main() {
|
||||
return yyparse();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user