help-flex
[Top][All Lists]
Advanced

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

Re: flex help


From: John Millaway
Subject: Re: flex help
Date: Mon, 15 Jul 2002 12:22:42 -0700 (PDT)

> I have trouble with the \n. When a \n occurs between rules, bison return an 
> error. What can I do for the \n to be valid between rules ???
> 
> SELECT STAR WhereClause OrderClause
> 
> "*"           return STAR;
> "SELECT"      return SELECT;
> 
> WhereClause: {
>               $$ = NULL;
>              }
>              ...
> OrderClause:
>              {
>                $$ = NULL;
>              }
>              ...
> Eg.:
> SELECT *
> WHERE ID = 5
> 

You have to skip whitespace in your scanner.

%%
"*"             return STAR;
"SELECT"        return SELECT
[[:space:]]+   /* eat whitespace */
%%

-John


__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com



reply via email to

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