DXRSNCOD5N6GRTVSO7FEJXSWOAXVZRUBIX4NGOP4ODBM2DFZTG4QC
%{
/* definitions */
#include <stdio.h>
int yylex();
int yyerror(char *);
%}
%token EOL
/* rules */
%%
input: EOL;
%%
int yyerror(char* s){
printf("error: %s\n", s);
return 0;
}
//driver
int main(int argc, char** argv){
printf("hello, world!\n");
yyparse();
return 0;
}
int yywrap(){
printf("yywrap is called!\n");
}
hello: hello.yy.c
gcc -o hello hello.yy.c -ll
hello-lexer: hello.yy.c hello.tab.h
gcc -o hello-lexer hello.yy.c -ll
hello-parser: hello.yy.c hello.tab.h hello.tab.c
gcc -o hello-parser hello.yy.c hello.tab.c
run-hello-parser: hello-parser
./hello-parser < input/newline
clean:
rm -f hello.tab.h hello.tab.c hello.yy.c hello-lexer hello-parser