[antlr-interest] C example error
Brian Catlin
BrianC at sannas.org
Tue Mar 30 00:24:03 PDT 2010
I tried to build the PolyDiff example from Examples-v3, using
ANTLR-3.1-2009-06-28 and libantlr3c-3.2 in Visual Studio 2008. The output
from the build:
1>------ Rebuild All started: Project: polydiff, Configuration: Debug Win32
------
1>Deleting intermediate and output files for project 'polydiff',
configuration 'Debug|Win32'
1>Translating to parser/lexer combination
1>Translating to parser/lexer combination
1>Translating to parser/lexer combination
1>Translating to parser/lexer combination
1>.\PolyDifferentiator.g(0,0) : warning 138 : grammar PolyDifferentiator: no
start rule (no rule can obviously be followed by EOF)
1>Compiling...
1>Simplifier.c
1>PolyPrinter.c
1>PolyParser.c
1>PolyLexer.c
1>PolyDifferentiator.c
1>main.c
1>Generating Code...
1>Compiling manifest to resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.1.7600.16385
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Linking...
1>LINK : C:\MIMOS\ANTLR\examples-v3\C\Debug\polydiff.exe not found or not
built by the last incremental link; performing full link
1> Creating library C:\MIMOS\ANTLR\examples-v3\C\Debug\polydiff.lib and
object C:\MIMOS\ANTLR\examples-v3\C\Debug\polydiff.exp
1>Embedding manifest...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.1.7600.16385
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Build log was saved at
"file://c:\MIMOS\ANTLR\examples-v3\C\polydiff\Debug\BuildLog.htm
<file:///c:\MIMOS\ANTLR\examples-v3\C\polydiff\Debug\BuildLog.htm> "
1>polydiff - 0 error(s), 1 warning(s)
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
As you can see, there is a warning generating PolyDifferentiator.g
When I run the resulting program, I get an access violation in addChild
(antlr3basetree.c) at the ->, because child has not been initialized
void
addChild (pANTLR3_BASE_TREE tree, pANTLR3_BASE_TREE child)
{
ANTLR3_UINT32 n;
ANTLR3_UINT32 i;
if (child == NULL)
{
return;
}
-> if (child->isNilNode(child) == ANTLR3_TRUE)
{
if (child->children != NULL && child->children ==
tree->children)
More information about the antlr-interest
mailing list