help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parsing a strange list


From: Joris Esch
Subject: Re: Parsing a strange list
Date: Tue, 14 Aug 2001 15:23:19 -0700 (PDT)

Hello all:

I cannot use 
%left name or %left <probe> name
because name is in fact a non-terminal symbol, for
which i define a rule. 

Thanks for all the suggestions so far...
joris
----------
Hans Aberg wrote:
> >I have a problem writing a parser for a list.
> >
> >The list contains the token name and the literal
> character '-'
> >Whenever a '-' is seen, the two names should be
> >combined.
> 
> Have you tried say:
> 
> %left name
> %left '-'
> 
> %%
> sentence:
>     sentence name         { }
>   | sentence '-' sentence { }
>   | name                  { }
> %%
> 
> -- As in the calculator example in the Bison manual.
> 
>   Hans Aberg
> 
> 


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]