#50 Document how rule order matters.

closed-fixed
nobody
semantic (53)
5
2004-02-12
2003-04-10
Joseph Kiniry
No

In most grammar generators, the order of the matches in
a rule do not matter. E.g.,

RESULT : MATCH1 (optional-lambda-expression)
| MATCH2 (optional-lambda-expression)
;
and
RESULT : MATCH2 (optional-lambda-expression)
| MATCH1 (optional-lambda-expression)
;
mean the exact same thing. This is not the case for
semantic 1.4. This should be documented and the proper
order (long matches to short) should be documented.

Discussion

  • Joseph Kiniry
    Joseph Kiniry
    2003-04-10

    Logged In: YES
    user_id=42011

    I forgot to mention that this is particularly important when
    matches have common prefixes. E.g.,
    FOO : BAR semantic-list
    | BAR
    ;

     
  • Eric M. Ludlam
    Eric M. Ludlam
    2004-02-12

    Logged In: YES
    user_id=88537

    Added a section in the bovine manual about this.
    This should not be true for wisent.

     
  • Eric M. Ludlam
    Eric M. Ludlam
    2004-02-12

    • status: open --> closed-fixed