bug-bison
[Top][All Lists]
Advanced

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

Missing reduction in glr parser; Missing debug output


From: Florian Mayer
Subject: Missing reduction in glr parser; Missing debug output
Date: Mon, 21 Mar 2016 16:53:38 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

Hello,

I'm currently trying to use bison's GLR feature
to parse a non-deterministic language (VHDL).
In VHDL consider following variable assignment:

varfoo := foo(34)

According to the grammar, this could parse to one of
the following:
* Function call to function with id "foo" and Parameter "34",
* array subscript expression on array with id "foo" using subscript 34 or
* or array subscript expression on array returned by function with id "foo" using subscript 34.

The following code and picture are important to understand what I'm dealing with.
The Graph is a parse tree of the input token stream "I = I ( N ) ;"
Code: https://gist.github.com/anonymous/a4c34fd7c155e5ed6e51
Parse Tree: http://i.imgur.com/6lB02Ub.png

My Problem is now, that the nodes FCALL1 and ARRIDX1
share the same node EXPR1 which in turn points twice to N1.
What I want to have is, that FCALL1 and ARRIDX1 both have
their own node EXPR1 and EXPR2.
(Nodes PARO = (, PARC = ); Every node is made unique by appending a counter which
increments every thime a new node of the corresponding type is created)

It seems that N gets reduced only twice whereas three reductions
would be correct. The important line is here:
https://gist.github.com/anonymous/a4c34fd7c155e5ed6e51#file-parser-y-L55

I tried to read the debug messages, but using the --debug switch didn't change
the behaviour of the parser. Is the lack of debug tracing in
glr parsers a known limitation?

Do you know any possibilitie to work around the reduction problem from line 55?

Best regards



reply via email to

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