help-flex
[Top][All Lists]
Advanced

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

Re: Flex vs. POSIX 1003.2-1992 repeat operator {} precedence


From: Hans Aberg
Subject: Re: Flex vs. POSIX 1003.2-1992 repeat operator {} precedence
Date: Sat, 27 Apr 2002 11:53:43 +0200

At 13:37 -0700 2002/04/26, Vern Paxson wrote:
>> It appears that Vern's intent was
>> to conform to POSIX, giving priority to POSIX conformance in cases where lex
>> and POSIX diverge.
>
>It was more like, (1) I thought lex's precedence rule was really a bad
>idea, and (2) I was delighted when the POSIX interpretation appeared to
>align with the more rational precedence rule used by flex.  Had I realized
>it didn't, I would've fought against it while the POSIX standard was being
>finalized (as I did for a number of other issues).

Skimming through the posts, I also got the impression that the POSIX
interpretation of ab{n} as (ab){n} is really bad and invites mistakes. --
The reason is that concatenation is really an implicit multiplication that
has dropped out, and interpreting a*b{n} as (a*b){n} would be strange in
math.

Might one not resolve the issue, as the matter now stands, by introducing a
new option that selects the POSIX precedence rules? Then the lex -l option
will select that option. If one has selected -l and wants Flex precedence
rules, one should be able to de-select this option.

  Hans Aberg





reply via email to

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