Hi again, I derived my own token class from CommonToken fitting my needs. Now i wonder how i can get the lexer to use my class instead of CommonToken. I assume i should derive my own lexer and use the superclass option? Best greetings Joachim Lusiardi
Jim Idle schrieb: > Derive your own token from CommonToken and use that as the token type. > > Jim > > On Jun 25, 2009, at 9:51 AM, Joachim Lusiardi <[email protected]> wrote: > >> Hi, >> i have short question about org.antlr.runtime.Token instances in Java >> standard collections. Since (as far as i can see from the source) the >> mentioned class does not override hashCode and equals i have troubles to >> use this with standard containers like HashMap or Vector. >> >> What can i do to solve this problem? I expected that 2 CommonToken >> objects have the same tokenindex, start, stop, text, type, channel, line >> and charPosition in line they should be equal? and the hashCode also >> should be derived from this? >> >> Best greetings >> Joachim Lusiardi >> >> List: http://www.antlr.org/mailman/listinfo/antlr-interest >> Unsubscribe: >> http://www.antlr.org/mailman/options/antlr-interest/your-email-address List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
