[4suite-dev] Problems with BisonGen - LEXER_START_STATE

Chimezie Ogbuji chimezie at gmail.com
Fri May 5 09:55:19 MDT 2006


I've gotten further in my attempts to write a SPARQL parser in
BisonGen (even had to resolve some shift/reduce errors), however
running into a problem I never had before when I try to build the
generated Python / C extension:

chimezie at Zion:~/devel/4Suite/Ft/Rdf/Parsers/SPARQL$ rm
SPARQLParser.c;BisonGen -e --mode=c SPARQL.bgen;python setup.py
buildGenerate parser SPARQLParser.c
Skipping SPARQLParser.ebnf (up-to-date)
running build
running build_py
running build_ext
building 'SPARQL.SPARQLParser' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -fPIC -I/usr/include/python2.4 -c SPARQLParser.c
-o build/temp.linux-i686-2.4/SPARQLParser.o
SPARQLParser.c: In function 'lexer_new':
SPARQLParser.c:6158: error: 'LEXER_START_STATE' undeclared (first use
in this function)
SPARQLParser.c:6158: error: (Each undeclared identifier is reported only once
SPARQLParser.c:6158: error: for each function it appears in.)
error: command 'gcc' failed with exit status 1

I've checked the other BisonGen examples (XPath,XPointer,etc..) and
there doesn't seem to be any extra directive in the lexer section that
I need to add.  I'm not doing any state trickery (like in the Versa
bgen for example).  My BisonGen files are attached but the general
outline is below:

<?xml version='1.0'?>
<!--

    Experimental BisonGen Implementation of W3C DAWG's SPARQL Grammar

    Author: Chimezie Ogbuji

   -->
<bisongen version='1.0' name='SPARQLParser' project='SPARQL'>

    <!-- Python modules to import -->
    <modules>
     .. modules ..
    </modules>

    <!-- Token declarations -->
    <tokens>
        <?include SPARQLTokens.bgen.frag?>
    </tokens>

   <grammar start="Query">
        .. productions ..

   <lexer>
        <defines>
            <?include SPARQLLexerDefines.bgen.frag?>
        </defines>
        <?include SPARQLLexerPatterns.bgen.frag?>
        <?include SPARQLLiteralLexerPatterns.bgen.frag?>
    </lexer>

   </grammar>
</bisongen>

I'm using BisonGen from CVS.  Any hints would be helpful as I have no
documentation to work with
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SPARQL-BisonGen.tar.bzip2
Type: application/octet-stream
Size: 7355 bytes
Desc: not available
Url : http://lists.fourthought.com/pipermail/4suite-dev/attachments/20060505/56fe96fb/SPARQL-BisonGen.tar.obj


More information about the 4suite-dev mailing list