parsing w spark

Skip Montanaro skip at mojam.com
Tue Nov 21 03:47:18 EST 2000


    Bill> And here is the grammar I am feeding spark.

    Bill> bcfile ::= bcfile_cont
    Bill> bcfile_cont ::= bcfile_cont NL  
    Bill> bcfile_cont ::= bcfile_cont stmt
    Bill> bcfile_cont ::=
    Bill> stmt ::= IDENTIFIER OPERATOR IDENTIFIER NL

I've never used spark before but something jumps to mind.  It looks like you
tried to parse

    VERSION=1.23p12

but you defined statement as IDENTIFIER OPERATOR IDENTIFIER.  While you
didn't tell us how an IDENTIFIER is constructed, I'd be hard-pressed to find
a common definition where it starts with a digit.  Perhaps your stmt
definition needs to be something like

    stmt ::= IDENTIFIER OPERATOR STRING NL

for some suitable definition of STRING.  To test my hypothesis, try parsing

    VERSION=VERSION

-- 
Skip Montanaro (skip at mojam.com)
Support the Mojam.com Affiliates Program: http://www.mojam.com/affl/
(847)971-7098




More information about the Python-list mailing list