Hey All,

I have this state in my gram.out:
State 6:
          mem ::= idlist ptr idlist * SEMI
          idlist ::= idlist * IDENT

                         IDENT shift-reduce 3      idlist ::= idlist IDENT
                          SEMI shift-reduce 2      mem ::= idlist ptr
idlist SEMI

The numbers above, 3 and 2, refer to rules listed at the bottom of the
file. I am learning about lemon and compared this to tables found online
about parsers but cannot understand where the DFA will go after the
reduction.

Other states within lemon show a shift AND the number is the state where it
is going to next instead of a rule number. Here is the trace output from
the parser when using the rule. It shows we would reduce by rule 2 and then
go to state 3.

debug:Shift 'SEMI', pending reduce 2
debug:Return. Stack=[typelist TYPEDEF STRUCT IDENT LBLOCK memlist idlist
ptr idlist SEMI]
debug:Input 'RBLOCK' with pending reduce 2
debug:Reduce 2 [mem ::= idlist ptr idlist SEMI], go to state 3.
debug:... then shift 'mem', pending reduce 7
debug:Reduce 7 [memlist ::= memlist mem], go to state 1.
debug:... then shift 'memlist', go to state 3
debug:Shift 'RBLOCK', go to state 9
debug:Return. Stack=[typelist TYPEDEF STRUCT IDENT LBLOCK memlist RBLOCK]

Thank you for any help of insight.
-Alex
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to