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


_______________________________________________
[email protected] http://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to