parsing w spark

Vassilis Virvilis vasvir at iit.demokritos.gr
Wed Nov 22 14:53:17 EST 2000


Skip Montanaro wrote:
> 
> I've never used spark before but something jumps to mind.  It looks like you
> tried to parse
> 
>     VERSION=1.23p12

That's right.

> 
> 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

Yes this is required by the mini language I am trying to implement.

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

Nice try... It didn't work. However John Aycock had help me find the
error. The __cmp__ function in the Token class was not defined (my
mistake), so there was no correlation between tokens and terminals such
as IDENTIFIER.

Anyway thank you very much for your concern.

	.Bill




More information about the Python-list mailing list