[antlr-interest] Token doesn't minimally need a type

thrutchy eric_mahurin at yahoo.com
Mon Aug 2 09:01:15 PDT 2004


If you make a Token class that is specific to a particular type, then
I see no reason that "int type" is needed (it is a constant).  I'm
overriding it with "static int type".  I'm hoping that this will
allocate a type an underlying non-static "int type" per object of this
new class - I don't know enough about java to answer that question.

Next time around it would probably be better to have Token as an
interface rather than a base class.

It sure would be nice if we had multiple inheritance in java.  I would
like to make a class that inherits from a Token and an AST.  Since I'm
mainly concerned about efficiency with AST's maybe I'll make all my
Token classes also implement AST and then use them for both.  We'll
see how it turns out...

Eric




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list