(This page contains the files and commands that I used in the yacc example that I showed in class)
This page is located at http://www.cs.bc.edu/~alvarez/yacc/yaccexample.html
Script started on Wed 11 Nov 2009 05:56:12 PM EST [alvarez@cs yacc]$ ./parser aaaabb yydebug: state 0, reading 97 ('a') yydebug: state 0, shifting to state 1 yydebug: state 1, reading 97 ('a') yydebug: state 1, shifting to state 4 yydebug: state 4, reading 97 ('a') yydebug: state 4, shifting to state 1 yydebug: state 1, reading 97 ('a') yydebug: state 1, shifting to state 4 yydebug: state 4, reading 98 ('b') yydebug: state 4, shifting to state 7 yydebug: state 7, reducing by rule 3 (T : 'a' 'a' 'b') yydebug: after reduction, shifting from state 4 to state 8 yydebug: state 8, reading 98 ('b') yydebug: state 8, shifting to state 9 yydebug: state 9, reducing by rule 2 (T : 'a' 'a' T 'b') yydebug: after reduction, shifting from state 0 to state 3 yydebug: state 3, reading 10 ('\n') yydebug: state 3, shifting to state 5 yydebug: state 5, reducing by rule 4 (E : '\n') yydebug: after reduction, shifting from state 3 to state 6 yydebug: state 6, reducing by rule 1 (S : T E) yydebug: after reduction, shifting from state 0 to state 2 a yydebug: state 2, reading 97 ('a') syntax error yydebug: error recovery discarding state 2 yydebug: error recovery discarding state 0 [alvarez@cs yacc]$ exit exit Script done on Wed 11 Nov 2009 05:56:46 PM EST