[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Extended BNF?
From: |
Paul Hilfinger |
Subject: |
Extended BNF? |
Date: |
Thu, 25 Jun 2009 15:20:00 -0700 |
Has anyone considered adding extended BNF to Bison? I refer to things
like
A. p : a? ;
B. p : a ( b | c ) d ;
C. p : a ( ',' a )*
D. p : a+
and so forth. There are numerous questions to answer, mostly involving
semantic actions and including:
1. How do we specify the semantic types of such constructs?
2. How do we refer to, e.g., the values of b and c from example B in actions?
Presumably this would only be legal inside the parentheses.
3. Assuming we translate * and + into equivalent non-extended
productions, how do we specify left vs. right-recursive lists?
4. How do we specify list constructors for * and +?
5. How do we supply a value for the empty case in A?
6. How do we supply a value for the ( ... ) construct in B?
Paul Hilfinger
- Extended BNF?,
Paul Hilfinger <=