Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Part 5
* Fix shift/reduce conflict
- Loading branch information
Showing
with
6 additions
and
2 deletions.
-
+1
−0
.gitignore
-
+3
−2
Makefile
-
+2
−0
parse.y
|
@@ -3,3 +3,4 @@ lex.yy.c |
|
|
ruby |
|
|
parse.tab.c |
|
|
parse.tab.h |
|
|
parse.output |
|
|
@@ -1,4 +1,5 @@ |
|
|
SRC=main.c parse.tab.c lex.yy.c |
|
|
|
|
|
all: ruby |
|
|
|
|
|
ruby: ${SRC} |
|
@@ -8,7 +9,7 @@ lex.yy.c: ruby.l |
|
|
flex ruby.l |
|
|
|
|
|
parse.tab.c: parse.y |
|
|
bison -d parse.y |
|
|
bison -v -d parse.y |
|
|
|
|
|
clean: |
|
|
rm -rf ruby lex.yy.c parse.tab.c parse.tab.h |
|
|
rm -rf ruby lex.yy.c parse.tab.c parse.tab.h parse.output |
|
@@ -4,6 +4,8 @@ |
|
|
void yyerror(char const *s) { fprintf(stderr, "%s\n", s); } |
|
|
%} |
|
|
|
|
|
%left tPLUS |
|
|
|
|
|
%token tNUMBER |
|
|
%token tPLUS |
|
|
%start program |
|
|
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.