Related articles |
---|
reduce/reduce conflict in CSS2? schlpbch@iam.unibe.ch (Andreas Schlapbach) (2000-12-31) |
Re: reduce/reduce conflict in CSS2? schlpbch@iam.unibe.ch (Andreas Schlapbach) (2001-01-04) |
Re: reduce/reduce conflict in CSS2? loewis@informatik.hu-berlin.de (Martin von Loewis) (2001-01-04) |
Re: reduce/reduce conflict in CSS2? mike@dimmick.demon.co.uk (Mike Dimmick) (2001-01-04) |
From: | Martin von Loewis <loewis@informatik.hu-berlin.de> |
Newsgroups: | comp.compilers |
Date: | 4 Jan 2001 01:00:01 -0500 |
Organization: | Humboldt University Berlin, Department of Computer Science |
References: | 00-12-121 |
Keywords: | parse |
Posted-Date: | 04 Jan 2001 01:00:01 EST |
Andreas Schlapbach <schlpbch@iam.unibe.ch> writes:
> How do I resolve this conflict?
There is no conflict in your grammar, as posted. Bison reports a
conflict on the ',' token, yet your grammar does not include a ','
token.
I completed the posted fragment to a complete bison program, see
below. I declared simple_selector as a token, then I would get no
conflict.
Regards,
Martin
%token S simple_selector
%start selector
%%
s_0toN
: S s_0toN
| /* empty */
;
combinator
: '+' s_0toN
| '>' s_0toN
| /* empty */
;
selector
: simple_selector combinator_simple_selector_0toN
;
combinator_simple_selector_0toN
: /* empty */
| combinator simple_selector combinator_simple_selector_0toN
;
Return to the
comp.compilers page.
Search the
comp.compilers archives again.