[antlr-interest] Re: Skipping grammar

jagad jagad at enciety.com
Wed Oct 8 10:47:50 PDT 2003


I'm just wondering,

> class MyLexer extends Lexer;
> 
> tokens { OPEN_PACKET; CLOSE_PACKET; OPEN_MODEL; CLOSE_MODEL;
> OPEN_METHOD; CLOSE_METHOD; }
> 
> {
> 	stack braces = new stack();
> 	int nextBrace = OPEN_PACKET;
> 	bool readingMethodBody = false;
> 
> 	int getMatchingToken(int open) {
> 		if (open == OPEN_PACKET) return CLOSE_PACKET;
> 		if (open == OPEN_MODEL) reutrn CLOSE_MODE;
> 		// etc.
> 	}
> }

ANTLR should be generate the declaration above at class declaration and
that's not allowed to initialize the class member, right?

Cheers

jagad



 

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




More information about the antlr-interest mailing list