[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: shift/reduce and reduce/reduce conflicts
From: |
wim delvaux |
Subject: |
Re: shift/reduce and reduce/reduce conflicts |
Date: |
Fri, 23 Jan 2004 19:16:35 +0100 |
User-agent: |
KMail/1.5.4 |
On Friday 23 January 2004 18:52, Valter G. Nogueira Jr. wrote:
> I am developing a Visual Basic parser and since it was my first
> non-tutorial based work I was pretty happy about it.
>
> Since I was unaware of option -v I have got a mess of conflicts.
>
> Now, I have hundreds of conflicts which I have to purge out my code.
>
> I what make me asthonised gcc-java(v3.3.2)'s parse.y has NONE conflicts.
>
> Is that normal?
Normal ... well let's say preferrable
>
> Does have any tips about vanishing these conflicts away?
Conflicts occur when your parser cannot determine the next move to take
in a
presice manner
example
a : Token1 Token2
| Token1 Token3
;
when the scanner finds token1 what comes next a 2 or 3 token ? Answer
: it
depends on the input syntax. Bison does not like these situations. For each
token scanned, bison should be able to exactly determine the next state.
Solution : RTFM : there is a better description of these conflicts.
Solution 2 : produce the special output file (see -r) and check what
problems
there are
>
> May I run bison on a file without type checks and actions just to check the
> grammar (right before to put C code in it)?
sure ... it will do nothing just check for the first syntax error.
>
> Thanks
>
> Valter