[antlr-interest] Reading from stdin (C backend)

Foust javafoust at gmail.com
Sun Aug 3 17:23:14 PDT 2008


> Hello all,
> 
> Sorry if this question is ridiculously simple but how does one read a 
> stream from standard input?

It's in the bootstrap code. So where you create the ANTLRxxxStream that you
pass to the Lexer, create an input stream that reads from stdio, instead:

	yourLexer lexer = new YourLexer();
	lexer.setCharStream(new ANTLRInputStream(System.in));
	
Brent



More information about the antlr-interest mailing list