[antlr-interest] C++ Segmentation Fault
hombre at gmail.com
Thu Jun 10 15:28:05 PDT 2004
You need to initialize the AST Factory. Have a look at
to see how it's done.
On Thu, 10 Jun 2004 21:51:29 -0000, Marx Gomes <ceticobr at yahoo.com.br> wrote:
> I'm starting to use ANTLR to generate C++ output. I've designed a
> simple grammar, and everything seems to work well, except that I can't
> set "buildAST = true" without getting "Segmentation fault" errors
> whenever I run my parser. Neither ANTLR nor the C++ compiler complain
> about anything in the source files, it compiles nicely, just does not
> work (unless I comment out the "buildAST = true" line, then it runs
> I was able to trace the problem back to this line:
> RefAST t = nodeFactories[tok->getType()]->second();
> inside method "RefAST ASTFactory::create(RefToken tok)"
> in file "AstFactory.cpp"
> Looks like the problem occurs because an invalid index
> ("tok->getType()") is acessed in "nodeFactories", but that's all I can
> say about it, since I'm not very much familiar with the generated
> Anybody knows where the problem could be? I could post parts of my
> grammar, if it helps.
> Thanks in advance,
Yahoo! Groups Links
<*> To visit your group on the web, go to:
<*> To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
More information about the antlr-interest