help-bison
[Top][All Lists]
Advanced

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

Re: sticking custom meta informations to grammar rules


From: Christian Schoenebeck
Subject: Re: sticking custom meta informations to grammar rules
Date: Mon, 10 Feb 2014 15:51:51 +0100
User-agent: KMail

On Thursday 30 January 2014 19:11:11 Hans Aberg wrote:
> On 30 Jan 2014, at 17:55, Christian Schoenebeck <address@hidden> 
wrote:
> > On Thursday 30 January 2014 18:03:28 Hans Aberg wrote:
> >> I recall some others in the past that have written on interactive
> >> parsers showing completions. So it may be of interest integrating it
> >> into Bison.
> > 
> > I am sure this is a commonly requested feature. However my code is C++
> > and the algorithm is calling itself recursively. Advantage is that the
> > amount of code is very small, can easily be maintained, however it has
> > the potential to blow the program's memory stack, especially on complex
> > languages and on resource limited embedded devices. So these two points
> > already disqualify it from being accepted of becoming an internal part
> > of Bison itself.
> 
> The developers might chime in at some point. Akim has written most of the
> C++ parser.

I thought about it, but I am still not convinced that it makes sense to be 
integrated directly into Bison at this point. At least not without fundamental 
additions to Bison. Which I guess makes it even more unlikely to be adopted 
for Bison.

One thing is auto completion. That could probably even be integrated into 
Bison at this point. Because it will just resolve the uniquely expected, 
longest common sequence of tokens expected to follow next in current parser 
state.

But then there is also the other task: verbose syntax errors. That's more 
complicated, since it also depends on the grammar, implementation aspects and 
so on. For example I don't want to show the user always simply the next non-
terminal symbol name on syntax errors, but instead I sometimes might want to 
walk along the parse tree and reduce the non-terminal to some higher non-
terminal for the user being more "human readable". So these are things that 
the developer might want to adjust according to the use case of the parser.

Best regards,
Christian Schoenebeck



reply via email to

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