CLite ECFG
The ECFG for the CLite language of Tucker & Noonan. Terminals are bold, so non-bold curly and squre brackets are the extension quantifiers.
Programintmain(){DeclarationsStatements}
Declarations{Declaration}
DeclarationTypeIdentifier[[Integer]] {,Identifier[[Integer]]};
Typeint|bool|float|char
Statements{Statement}
Statement;|Block|Assignment|IfStatement|WhileStatement
Block{Statements}
AssignmentIdentifier[[Expression]]=Expression
IfStatementif(Expression)Statment[elseStatement]
WhileStatementwhile(Expression)Statement
ExpressionConjunction{||Conjuction}
ConjunctionEquality{&&Equality}
EqualityRelation[EquOpRelation]
EquOp==|!=
RelationAddition[RelOpAddition]
RelOp<|<=|>|>=
AdditionTerm{AddOpTerm}
AddOp+|-
TermFactor{MulOpFactor}
MulOp*|/|%
Factor[UnaryOp]Primary
UnaryOp-|!
PrimaryIdentifier[[Expression]]|Literal |(Expression) |Type(Expression)
IdentifierLetter{Letter|Digit}
Lettera|b||z|A|B||Z
Digit0|1||9
LiteralInteger|Boolean|Float|Char
IntegerDigit{Digit}
Booleantrue|false
FloatInteger.Integer
Char'ASCIIChar'