[antlr-interest] Segfault with very simple parser
John Gruenenfelder
johng at as.arizona.edu
Sat Aug 26 16:30:57 PDT 2006
On Sun, Aug 27, 2006 at 01:06:17AM +0200, Ric Klaren wrote:
>>
>>It's when I try to run this simple parser that I get a segfault. The C++
>>code
>>is:
>>
>> ...
>> OpCLexer lexer(cin);
>> OpCParser parser(lexer);
>>
>> parser.expr();
>> RefAST t = parser.getAST();
>> ...
>
>You probably forgot to set the ASTFactory:
>
> ASTFactory ast_factory;
>
> parser.initializeASTFactory(ast_factory);
> parser.setASTFactory(&ast_factory);
>
>Cheers,
>Ric
Ah, yes... perfect! Thank you very much for the quick response.
--
--John Gruenenfelder Research Assistant, UMass Amherst student
Systems Manager, MKS Imaging Technology, LLC.
Try Weasel Reader for PalmOS -- http://gutenpalm.sf.net
"This is the most fun I've had without being drenched in the blood
of my enemies!"
--Sam of Sam & Max
More information about the antlr-interest
mailing list