[antlr-interest] C++ Segmentation Fault
Tom Verbeure
hombre at gmail.com
Thu Jun 10 15:28:05 PDT 2004
You need to initialize the AST Factory. Have a look at
antlr-2.7.4/examples/cpp/exprAST/Main.cpp
to see how it's done.
Tom
On Thu, 10 Jun 2004 21:51:29 -0000, Marx Gomes <ceticobr at yahoo.com.br> wrote:
>
> Hello,
>
> 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
> perfectly).
>
> 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
> code.
>
> Anybody knows where the problem could be? I could post parts of my
> grammar, if it helps.
>
> Thanks in advance,
> Marx
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/antlr-interest/
<*> To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list