[antlr-interest] C Target AST Debug Compile Error
Jim Idle
jimi at temporal-wave.com
Tue Mar 10 14:42:13 PDT 2009
William H. Schultz wrote:
> Hello all! I just signed up to this list as I was unable to find any
> mention of this issue anywhere on the internet, so I don't know if
> it's just me.
>
> I'm getting the following compile errors:
>
> SimpleCWalker.c: In function ‘SimpleCWalker_Ctx_struct*
> SimpleCWalkerNewSSD(ANTLR3_COMMON_TREE_NODE_STREAM_struct*,
> ANTLR3_RECOGNIZER_SHARED_STATE_struct*)’:
> SimpleCWalker.c:358: error: ‘struct
> ANTLR3_COMMON_TREE_NODE_STREAM_struct’ has no member named ‘tokenSource’
> SimpleCWalker.c:358: error: ‘struct
> ANTLR3_COMMON_TREE_NODE_STREAM_struct’ has no member named ‘tokenSource’
> SimpleCWalker.c:360: error: ‘struct ANTLR3_TREE_PARSER_struct’ has no
> member named ‘setDebugListener’
>
>
> I'm attaching my modifications to the C Target Makefile that I had to
> do in order to get the samples to build a binary under Mac OS X.
There are no changes you need to make to the Makefile for MAC. Perhaps
you did not configure/build correctly?
> There are a couple paths hard-coded into it, so you'll have to do
> minor tweaks to get it to work for you, but otherwise, it should be
> generic enough to compile any of the C Target samples (I'm definitely
> no expert on GNU Make). The above compile errors do NOT happen when
> compiling the grammars without ANTLR's "-debug" flag, and it also only
> happens with tree grammars. I figured finding the issue in a sample
> would seem to imply a bug... unless I'm doing something completely
> wrong.
Have you:
a) Downloaded the latest ANTLR and C runtime?
b) Downloaded the latest samples?
c) run ./configure in the C runtime directory taht is created when you
untar the C runtime;
d) Run make all after ./configure
e) Run sudo make install
d) Compiled as:
gcc -o sample *.c -I. -I/usr/local/include
(assuming that you did a make install to /usr/local
Please check the online documentation on building the runtime and so
on.. Take the Runtime API link from the home page.
Jim
More information about the antlr-interest
mailing list