help-bison
[Top][All Lists]
Advanced

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

Re: How to ignore a token if it doesn't fit in with a rule?


From: Akim Demaille
Subject: Re: How to ignore a token if it doesn't fit in with a rule?
Date: Tue, 26 Jul 2011 13:20:42 +0200

Le 23 juil. 2011 à 20:17, uclacasey a écrit :

> 
> Perhaps is there any way to get feedback from the parser?  For example, if it
> is about to output a specific error message, I could intercept that error
> message, revert, and pass a different token? 
> 
> p.s: if anything sounds outlandish, it's because I'm relatively new to this

That does ring any bell to me, I wouldn't know how to do that.  Maybe you could 
try another way: the scanner ignores the comments (in the sense that it does 
not return a token for them), but stores them somewhere.  Then your parser 
actions read that place to check if some comment was left for it.  You could 
even have a nonterminal symbol in charge of checking for this comment and do 
something about it.




reply via email to

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