help-bison
[Top][All Lists]
Advanced

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

Re: How to make Bison disregard tokens?


From: henrik . sorensen
Subject: Re: How to make Bison disregard tokens?
Date: Fri, 2 Mar 2007 14:59:13 +0100
User-agent: KMail/1.9.5

On Friday 02 March 2007 14:50, Tim Van Holder wrote:
> To me this seems like  the same problem as preserving comments in a
> parse-process-generate system (which is a pain in the ass).
not really a problem.
If using the location tracking feature, it would be trivial to add some fields 
to keep track of a comment associated with a token.
With in the scanner, instead of just discarding the comments, copy them to a 
string, and add it the location structure, when the next token is returned to 
the parser.

> You could have the lexer tally empty lines and set that count as a
> property of the semantic value of "real" tokens.
At least with Bison parsers you can use the location tracking.


Henrik




reply via email to

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