[antlr-interest] [C Target] Getting segmentation fault in isNilNode() from libatnlr3c.so

Jim Idle jimi at temporal-wave.com
Thu Dec 2 10:39:15 PST 2010


Please study the downloadable examples for using the C output, and it may
also be more reasonable to use the Java output until you are more familiar
with everything.

Jim

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of L. Rahyen
> Sent: Thursday, December 02, 2010 10:22 AM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] [C Target] Getting segmentation fault in
> isNilNode() from libatnlr3c.so
> 
> 	I'm trying to get working (for C target) very simple example from
> "The Definitive ANTLR Reference" book, page 73, "3.3 Evaluating
> Expressions Using an AST Intermediate Form". Of course, for Java target
> everything is fine. I'm trying to write the same thing using C target
> but it looks like I did something wrong because I get segmentation
> fault at this line in Test.cpp:
> 
>   walker->prog(walker); (in isNilNode() from libatnlr3c.so)
> 
> 	I'm just getting started with ANTLR. I would really appreciate if
> somebody suggest something that could help me to find where is the
> problem. To reproduce the problem, please use attached files:
> 
> 	0) Save all files in the same directory, cd to it and run "chmod
> +x compile"
> 	1) Open Expr.g in ANTLRWorks, generate code, then do the same with
> Eval.g
> 	2) Run (I'm using GNU C++ compiler): ./compile
> 	3) Run: ./Test input



More information about the antlr-interest mailing list