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: Sat, 19 Jul 2003 18:27:50 +0200

At 03:33 +0000 2003/07/19, John R. Levine wrote:
>> 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.
>
>It is indeed, e.g.:
>
>      foo bar = 'zip zap';
>
>The six spaces before foo and the space between zip and zap are
>significant, the rest aren't.  It gets worse.

Clearly, one needs some context switches.

Perhaps it is implementable in Flex (if now Flex would want to support that
language :-)):

Some rules in Flex can be marked down as "pre-scan", that is, they will zip
out whatever as though it does not exist to the other rules. Then one can
use regular Flex start-conditions to turn that on and off.

But Fortran had some additional quirks, I recall (even though I do not
recall exactly what).

  Hans Aberg






reply via email to

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