help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help me to eliminate the reduce/shift confliction


From: Tim Van Holder
Subject: Re: Help me to eliminate the reduce/shift confliction
Date: 06 Jun 2002 08:53:48 +0200

On Thu, 2002-06-06 at 02:56, address@hidden wrote:
> 
> sxmlElement                        : sxmlSTag      sxmlContent sxmlETag
>                                    | sxmlEmptyElement
>                                    ;

You're asking bison to decide between a starting tag and an empty
element - which it can't do.  It only sees one token in advance, and to
decide this it would have to see the slash or the ending bracket.
Instead, try to express an element as

element
: '<' element-name element-attributes rest-of-element
;

element-data
: '/' '>'
| '>' element-contents end-tag
;

(the above is pseudo-code, obviously).





reply via email to

[Prev in Thread] Current Thread [Next in Thread]