Related articles |
---|
shift/reduce conflict issues a7244270@yahoo.com (2003-09-04) |
Re: shift/reduce conflict issues chief@ockhamstyle.com (Mykola Rabchevskiy) (2003-09-09) |
Re: shift/reduce conflict issues blackmarlin@asean-mail.com (2003-09-09) |
Re: shift/reduce conflict issues rkrayhawk@aol.com (2003-09-09) |
Re: shift/reduce conflict issues pjj@cs.man.ac.uk (Pete Jinks) (2003-09-09) |
From: | Mykola Rabchevskiy <chief@ockhamstyle.com> |
Newsgroups: | comp.compilers |
Date: | 9 Sep 2003 22:55:41 -0400 |
Organization: | Optimum Online |
References: | 03-09-027 |
Keywords: | parse |
Posted-Date: | 09 Sep 2003 22:55:41 EDT |
Maybe enough two rules:
declaration : list CHAR;
list : QUOTE identifier QUOTE COMMA | list QUOTE identifier QUOTE COMMA;
Alfonso Urdaneta wrote:
> I have trimmed my grammar down to as small as possible while still
> maintaining the error - I get shift/reduce conflicts that I can't get
> rid of no matter what I try. Basically I need to parse a line that
> may look like this. (a bunch of variable declarations).
>
> 'george', 'barney', 'wilma', 'pebbles', 25 CHAR
>
....
> lines: fred;
>
> fred: declaration MONTY_FD declare_length;
>
> declare_length: MONTY_UNSIGNED_INTEGER_NUMBER MONTY_CHAR;
>
> declaration: label_identifier_seq | MONTY_STORE MONTY_FD label_identifier_seq;
>
> label_identifier: MONTY_SINGLE_QUOTE MONTY_IDENTIFIER MONTY_SINGLE_QUOTE;
>
> label_identifier_seq: label_identifier;
....
Return to the
comp.compilers page.
Search the
comp.compilers archives again.