help-flex
[Top][All Lists]
Advanced

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

Re: Flex recognition of "split" keywords


From: Hans Aberg
Subject: Re: Flex recognition of "split" keywords
Date: Fri, 18 Jul 2003 19:34:16 +0200

At 15:40 +0000 2003/07/18, John R. Levine wrote:
>>I'm writing a Fortran Scanner in flex
>
>Like everyone's been telling you, it's still a bad idea.
>
>>Is there any way that flex can recognise a keyword
>>which is split into several words such as:
>>
>>GO TO
>>
>>as 1 keyword?
>
>Not in any useful way.  Even if you made a special case for GO TO,
>you'd still miss these:
>
>     G OTO
>     GO T O
>     GOT O
>     G OTO
>     G OT O
>     G O T O
>etc.

Under C++, one might write a stream that zips out the whitespace before the
characters are handed over to the Flex scanner. -- But Fortran is perhaps
more complex than that.

Perhaps it is better to write a scanner for a different language. :-)

  Hans Aberg






reply via email to

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