>> "SIGOURE" == SIGOURE Benoit
<sigoure.benoit(a)lrde.epita.fr> writes:
+ %% FIXME: Some priorities are probably missing
here
+ context-free priorities
+ {
+ Property "=>" Property -> Property
+ }
+ > {
+ Property "|" Property -> Property
+ }
+ > {
+ Property "&" Property -> Property
+ }
+ > {
+ "!" Property -> Property
+ }
+ > {
+ Expression -> Property
+ }
I thought it was mandatory to keep the annotations in the rules here?
It isn't the case? For instance, in some old Tiger.sdf modules, I
read:
module Tiger-Statements
imports Tiger-Expressions
exports
context-free syntax
LValue ":=" Exp -> Exp {cons("Assign")}
"Label" IntConst Exp -> Exp {cons("ExpLabel")}
"(" {Exp ";"}* ")" -> Exp
{cons("Seq")}
"if" Exp "then" Exp "else" Exp -> Exp
{cons("If")}
"if" Exp "then" Exp -> Exp
{cons("IfThen")}
"while" Exp "do" Exp -> Exp
{cons("While")}
"repeat" Exp "whilst" Exp -> Exp
{cons("DoWhile")}
"for" Var ":=" Exp "to" Exp "do" Exp -> Exp
{cons("For")}
"break" -> Exp {cons("Break")}
"for" Var ":=" Exp "to" Exp
"in" Exp "do" Exp -> Exp
{cons("ForStride")}
"[" {LValue ","}* "]"
":=" "[" {Exp ","}* "]" -> Exp
{cons("ParAssign")}
"label" Id -> Exp {cons("Label")}
"goto" Id -> Exp {cons("Goto")}
"if" Exp "goto" Id -> Exp
{cons("IfGoto")}
%% "(" {Exp "||"}2+ ")" -> Exp
{cons("Par")}
context-free priorities
Exp "|" Exp -> Exp {left,cons("Or")}
LValue ":=" Exp ->
Exp {cons("Assign")}
"Label" IntConst Exp -> Exp {cons("ExpLabel")}
{right:
"if" Exp "then" Exp "else" Exp
-> Exp {cons("If")}
"if" Exp "then" Exp -> Exp
{cons("If")}
"while" Exp "do" Exp -> Exp
{cons("While")}
"repeat" Exp "whilst" Exp -> Exp
{cons("DoWhile")}
"for" Var ":=" Exp "to" Exp "do" Exp ->
Exp {cons("For")}
}
{Exp ";"}+ ";" {Exp
";"}+ -> {Exp ";"}+
Note that they preciously kept the annotations.