[antlr-interest] C++ input

Ric Klaren klaren at cs.utwente.nl
Thu Mar 21 01:05:20 PST 2002

On Thu, Mar 21, 2002 at 08:36:19AM -0000, kordeul wrote:
> I'm new to the antlr and I have problem feeding the parser with some 
> input (like file or memory char* input). Or I get the 
> NoViableAltException exception or the InputBuffer fails during fill
> () call inside LA() function (when searching for lookahead).
> Can someone write me the code that will feed the parser (lexer) with 
> some input? I don't know java, so please use C++.

Look at Main2.cpp of examples/cpp/calc in the 2.7.2a1 distro. That shows
one way (with istringstream) the other way is to grab one of the
CharInputBuffers in the archives. For normal file streams it's just a
matter of instantiating the lexer with it.

    ---- Ric Klaren ----- klaren at cs.utwente.nl ----- +31 53 4893722  ----
Wit is cultured insolence. --- Aristotle


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

More information about the antlr-interest mailing list