help-flex
[Top][All Lists]
Advanced

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

Re: flex help


From: Fred 24
Subject: Re: flex help
Date: Mon, 15 Jul 2002 19:50:53 +0000

(Please reply to my email address)

It works but when no space occurs it throws an error. Let me show you what I'm talking about. Suppose I write the statement in an editor like this:

SELECT'space''\n'
*

it works !!!


SELECT'\n'
*

doesn't works !!!

Any suggestion to make it works ???
Thanks in advance :)


From: John Millaway <address@hidden>
To: Fred 24 <address@hidden>
CC: address@hidden
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




_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com




reply via email to

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