[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Semantic Predicates (Bison)
From: |
Cleverson Ledur |
Subject: |
Re: Semantic Predicates (Bison) |
Date: |
Mon, 2 May 2016 19:55:30 -0300 |
Hello Hans,
Thank you very much for the help.
My initial idea was to save all declarations in a list and consult this
during parsing to decide if a rule must construct the three as a type_name
or as an unknown identifier.
In this case, I think I can't use semantic predicates to solve my problem.
Actually, I am doing a C++ parser and this presents a set of ambiguities (I
am using the standard C++ grammar 14). Do you indicate any technique for
solving these ambiguities in C++ grammar using Bison? I observed that most
ambiguities happen due to type_name parsing.
Thank you in advance.
*Cleverson Ledur*
Ph.D. Student in Computer Science
GMAP - Grupo de Modelagem de Aplicações Paralelas
<http://www.inf.pucrs.br/gmap/>
PUCRS - Pontifícia Universidade Católica do Rio grande do sul
<http://www.pucrs.br/>
e-mail: address@hidden
website: http://gmap.pucrs.br/cleversonledur/
Skype: cleversonledur <address@hidden>
"
2016-05-02 16:08 GMT-03:00 Hans Åberg <address@hidden>:
>
> > On 2 May 2016, at 19:13, Cleverson Ledur <address@hidden>
> wrote:
>
> > I am using arbitrary predicates to verify semantically the previous
> > declarations and decide which rule use in Bison (GLR parser).
> >
> > My question is: Is it possible to access a value ($1,$2...) inside the
> > arbitrary predicate? Or, is it possible to access the stack to perform
> > semantic analysis?
>
> When the GLR parser splits, the actions are not executed until the merge,
> so that is not currently possible. It has been discussed to implement as
> well actions that are executed immediately, but that was long ago.
>
>
>