
Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: clafer/unknown/extracted
Source used for this grammar: Source unknown, This grammar looks like it was copy-pasted from a PDF, 15 June 2012
Module, Declaration, Clafer, Constraint, Abstract, Elements, Element, Super, GCard, Card, GNCard, NCard, ExInteger, Name, LExp, LExp1, LExp2, LExp3, LExp4, LExp5, LExp6, Term, Iff, Implies, And, Xor, Or, Neg, CmpExp, Exp, Quant, ExQuant, SExp, SExp1, SExp2, SExp3, SExp4, SExp5, Decl, Disj, AExp, AExp1, AExp2, StrExp, EnumId, ModId, LocId, ListDeclaration, ListEnumId, ListElement, ListLExp, ListDecl, ListLocId, ListModId), 0 root (—), 1 top (Module), 3 bottom (Integer 4, String, Ident 7).Module ::= ListDeclaration
Declaration ::= "enum" Ident "=" ListEnumId Clafer Constraint
Clafer ::= Abstract GCard Ident Super Card Elements
Constraint ::= "[" ListLExp "]"
Abstract ::=
ε
"abstract"Elements ::= ε "{" ListElement "}"
Element ::=
Clafer
"‘" Name Card Elements
ConstraintSuper ::= ε ":" Name "extends" Name "−>" ListModId SExp
GCard ::= ε "xor" "or" "mux" "opt" "<" GNCard ">"
Card ::= ε "?" "+" "*" NCard
GNCard ::=
Integer "−" ExIntegerNCard ::=
Integer ".." ExIntegerExInteger ::=
"*"
IntegerName ::= ListModId Ident
LExp ::= LExp Iff LExp1 LExp1
LExp1 ::=
LExp1 Implies LExp2
LExp1 Implies LExp2 "else" LExp2
LExp2LExp2 ::= LExp2 Or LExp3 LExp3
LExp3 ::= LExp3 Xor LExp4 LExp4
LExp4 ::= LExp4 And LExp5 LExp5
LExp5 ::= Neg LExp6 LExp6
LExp6 ::= Term "(" LExp ")"
Term ::=
CmpExp
SExp
Quant SExp
ListDecl
"|"
LExpIff ::=
"<=>"Implies ::=
"=>"And ::=
"&&"Xor ::=
"xor"Or ::=
"||"Neg ::=
"~"CmpExp ::= Exp "<" Exp Exp ">" Exp Exp "=" Exp Exp "==" Exp Exp "<=" Exp Exp ">=" Exp Exp "!=" Exp Exp "/=" Exp Exp "in" Exp Exp "not" "in" Exp
Exp ::= AExp StrExp
Quant ::= "no" "lone" "one" "some"
ExQuant ::=
"all"
QuantSExp ::=
SExp "++" SExp1
SExp1SExp1 ::=
SExp1 "&" SExp2
SExp2SExp2 ::=
SExp2 "<:" SExp3
SExp3SExp3 ::=
SExp3 ":>" SExp4
SExp4SExp4 ::=
SExp4 "." SExp5
SExp5SExp5 ::= Ident "(" SExp ")"
Decl ::=
ExQuant Disj ListLocId ":" SExpDisj ::=
ε
"disj"AExp ::= AExp "+" AExp1 AExp "−" AExp1 AExp1
AExp1 ::=
AExp1 "*" AExp2
AExp2AExp2 ::= "#" SExp SExp Integer "(" AExp ")"
StrExp ::=
StrExp "++" StrExp
StringEnumId ::= Ident
ModId ::= Ident
LocId ::= Ident
ListDeclaration ::= ε Declaration ListDeclaration
ListEnumId ::=
EnumId
EnumId
EnumId "|" ListEnumIdListElement ::= ε Element ListElement
ListLExp ::= ε LExp ListLExp
ListDecl ::=
Decl
Decl "," ListDeclListLocId ::=
LocId
LocId "," ListLocIdListModId ::=
ε
ModId "/" ListModId