Re: flex default rule

Dimitri Maziuk <>
8 Apr 2006 17:09:31 -0400

          From comp.compilers

Related articles
flex default rule (Dimitri Maziuk) (2006-04-01)
Re: flex default rule (John Millaway) (2006-04-03)
Re: flex default rule (Dimitri Maziuk) (2006-04-03)
Re: flex default rule (Chris Dodd) (2006-04-03)
Re: flex default rule (Dimitri Maziuk) (2006-04-08)
| List of all articles for this month |

From: Dimitri Maziuk <>
Newsgroups: comp.compilers
Date: 8 Apr 2006 17:09:31 -0400
Organization: only myself
References: 06-04-001 06-04-023
Keywords: lex
Posted-Date: 08 Apr 2006 17:09:31 EDT

Dimitri Maziuk sez:
> Dimitri Maziuk sez:
>> Hi all,
>> here's what I can't quite figure out:
> Scratch that. I've been staring at my screen too long.
> This is a backport from Java, and JFlex has a couple of differences
> from flex. Most importantly, when more than one rule matches, JFlex
> will apply the first rule in the set whereas flex applies the longest
> matching one.

Or, rather, JFlex has a "[^]" that's equivalent to ".|\n" -- I initially
replaced it with "." in flex specs and it stopped matching tokens with
newlines it 'em. Surprise, surprise.

There was a braino in my OP, too: the 3rd rule was supposed to be in
<SEMI>, not <INITIAL>.

      Double d = new Double(2.0);
      d = new Double(d.doubleValue() * d.doubleValue());
I regard Double variables as mutable, considering this one started as 2.0 and
ended up as 4.0. -- Brendan Guild

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.