[antlr-interest] C++ Segmentation Fault
Marx Gomes
ceticobr at yahoo.com.br
Thu Jun 10 14:51:29 PDT 2004
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