[antlr-interest] Can my parser evaluate more than one expression?

OJAY78 at gmx.de OJAY78 at gmx.de
Thu Nov 22 06:58:25 PST 2007


Hi,

maybe I do not understand it right but now I am a bit confused. I have developed a small evaluation language which check values inside a database and returns booleans for the different functions. Inside my parser I am usind a map which I use as a data buffer, I can write values into that map an get values from it. So my problem is that if I have a new expression which I want to evaluate I have to generate a new parser so that a new empty buffer map for this parser will be generated. Is there a way that I can hold my parser object but can change the expression. Or is my understanding of this wrong and every expression has its own parser?

here is the code how I create my parser


	private FELParser createParser(String expression){
		ANTLRStringStream input =  new   ANTLRStringStream(expression);
		FELLexer lexer = new FELLexer(input);
		CommonTokenStream tokens = new CommonTokenStream(lexer);
		FELParser parser = new FELParser(tokens);
		return parser;
	}


thanks
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer


More information about the antlr-interest mailing list