Email List: Xaustin-group-lX
[All Lists]

Re: RE-ASSOC: a question about the associativity of RE concatenation

To: yyyyyy@xxxxxxxxxxx
Subject: Re: RE-ASSOC: a question about the associativity of RE concatenation
From: Tom Lord <yyyy@xxxxxxxxxxx>
Date: Tue, 9 Apr 2002 15:54:24 -0700 (PDT)
Cc: yyyyyyyyyyyyyy@xxxxxxxxxxxxx, yyyyyyyyyyyyyy@xxxxxxxxxxxxx, yyyyy@xxxxxxxxxxxxxx, yyyyy@xxxxxxxxxx
References: <200204091857.OAA35259@raptor.research.att.com> <200204092229.g39MTeX00802@shade.twinsun.com>
        However, I see that Andrew Hume writes that RE-ASSOC(1b) was
        the intended meaning.  If so, the simplest fix is to modify
        the POSIX grammar so that RE concatenation is
        right-associative, as suggested at the end of RE-ASSOC.

I don't mean to be a broken record, so please forgive me for repeating
that I favor the left-associative interpretation because:

        1. It's what the grammar says.

        2. Perhaps it's a cultural bias, but given a regexp to
           parse "by eye", I find left-associativity natural.
           When I add additional parentheses to an expression
           that reinforce left-associativity, I don't expect
           the substring positions to change -- when I add
           parentheses that override left-associativity, I am
           not surprised when substring positions change.

        3. It has the property that additional subexpressions
           to the right, which don't extend the match, have
           no effect on what is matched by the subexpressions
           to the left.  I think this is a nice "algebraic" 
           property for Posix regexps to have.


-t

<Prev in Thread] Current Thread [Next in Thread>