Gmail wrote:
hi
everyone,
I
have a question about storing the position information(start/end line
and start/end column for every token) in Antlr grammar. I searched the
internet and it seemed that a common approach was to extend an existing
Antlr token class to add some extra fields, such as endLine and
endColumn. However, to do this, the method setTokenObjectClass(String)
must be called to let the lexer know that we want to use a customized
token class. My question is, I can't find this method in the Lexer
class. And since the generated class extends Lexer, I can't call the
setTokenObjectClass method from the generated Lexer class. Did I make
any mistake or miss anything I should know? If anyone can share some
ideas about this issue, I would be grateful. Thanks!
Are you using ANTLR 2.7 or 3.x (this information is already part of
tokens in 3.x, at least in an easily calculable form)? Java presumably?
Jim
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---
|
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address