Skip to content

Commit

Permalink
Part 5
Browse files Browse the repository at this point in the history
* Fix shift/reduce conflict
  • Loading branch information
halogenandtoast committed Dec 8, 2014
1 parent 4a4ce7e commit f5c10a1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -3,3 +3,4 @@ lex.yy.c
ruby
parse.tab.c
parse.tab.h
parse.output
5 changes: 3 additions & 2 deletions Makefile
@@ -1,4 +1,5 @@
SRC=main.c parse.tab.c lex.yy.c

all: ruby

ruby: ${SRC}
Expand All @@ -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
2 changes: 2 additions & 0 deletions parse.y
Expand Up @@ -4,6 +4,8 @@
void yyerror(char const *s) { fprintf(stderr, "%s\n", s); }
%}

%left tPLUS

%token tNUMBER
%token tPLUS
%start program
Expand Down

0 comments on commit f5c10a1

Please sign in to comment.