[antlr-interest] something like @lexer::init
Kay Roepke
kroepke at dolphin-services.de
Sun Jun 11 04:59:14 PDT 2006
Hi!
Do we already have support for something like
lexer grammar foo;
@lexer::members {
NSMutableDictionary *packetDict; // this goes into header file
}
@lexer::init { // (naming?)
// do this stuff in the constructor/initializer
// maybe setup the packetDict instance var...
packetDict = [[NSMutableDictionary alloc] init];
}
or do I have to subclass the generated lexer? (I'd rather not...)
For extra credit I'd like to have a action scope for the dealloc/
destructor phase, too. Maybe @lexer::finally?
Happy hacking,
-k
More information about the antlr-interest
mailing list