Elvira ::= NetworkDeclaration()
NetworkDeclaration() ::= NetworkClass() <WORD> "{" NetworkContent() "}"
NetworkClass() ::= <NETWORK>|<BNET>|<IDIAGRAM>
NetworkContent() ::= ((Property()|DefaultDeclaration())";")* (ElementDeclaration())*
DefaultDeclaration() ::= (<DEFVALUE>|<EVERY>) (<NODE><NODETYPE><EQUAL><FINITE>) | (<NODE>(NodeProperty() | FiniteProperty())) | (<NODE><NODETYPE><EQUAL><CONTINUOUS>) | (<NODE>(NodeProperty() | ContinuousProperty())) | (<NODE>"("<FINITE>")"(NodeProperty()|FiniteProperty())) | (<NODE>"("<CONTINUOUS>")"(NodeProperty()|Continuousproperty())) | (<RELATION> RelationProperty() )
Property() ::= (<TITLE><EQUAL><STRING>) | (<COMMENT><EQUAL><STRING>)| (<CONSISTENCY><EQUAL><OPEN_PAREN><CLOSE_PAREN>)| (<CONSISTENCY><EQUAL><OPEN_PAREN>ListWords()<CLOSE_PAREN>)| (<AUTHOR><EQUAL><STRING>)| (<WHOCHANGED><EQUAL><STRING>)| (<WHENCHANGED><EQUAL><STRING>)| (<LOCKED><EQUAL><BOOLEAN>)| (<VERSION><EQUAL><FLOAT>)| (<WORD><EQUAL> (<BOOLEAN>|<WORD>|<STRING>|<STRING_DECIMAL>|<DECIMAL_LITERAL>) )
ElementDeclaration() ::= NodeDeclaration()| LinkDeclaration()| RelationDeclaration()
NodeDeclaration() ::= <NODE> ( <WORD> | (T=<STRING>) | <PARAMETER_WORD> ) ( DefaultNodeDeclaration() | ( "(" ((FiniteDeclaration() | ContinuousDeclaration() ) ) )
DefaultNodeDeclaration() ::= FiniteBody() | ContinuousBody()
FiniteDeclaration() ::= <FINITE> ")" FiniteBody()
ContinuousDeclaration() ::= <CONTINUOUS> ")" ContinuousBody()
FiniteBody() ::= ( "{" FiniteNodeProperties() "}" ) | ";"
ContinuousBody() ::= ( "{" ContinuousNodeProperties() "}" ) | ";"
FiniteNodeProperties() ::= ( (NodeProperty()|FiniteProperty()) ";")*
ContinuousNodeProperties() ::= ( (NodeProperty()| ContinuousProperty()) ";")*
NodeProperty() ::= (<TITLE><EQUAL><STRING>)| (<COMMENT><EQUAL><STRING>)| (<NODEKIND><EQUAL>(<CHANCE>|<DECISION>|<UTILITY>))| (<NODETYPE><EQUAL><FINITE>)| (<POSX><EQUAL> (<INTEGER>|<DECIMAL_LITERAL>) )| (<POSY><EQUAL> (<INTEGER>|<DECIMAL_LITERAL>) )| (<RELEVANCE><EQUAL><FLOAT>)| (<WORD><EQUAL> (<STRING>|<STRING_DECIMAL>|<DECIMAL_LITERAL>) )
FiniteProperty() ::= ( <STATES><EQUAL> "(" ListWords() ")" ) | (<NODETYPE> <EQUAL> <FINITE>)| (<NUMSTATES> <EQUAL> <DECIMAL_LITERAL>)
ContinuousProperty() ::= (<NODETYPE><EQUAL><CONTINUOUS>) | (<MIN><EQUAL><FLOAT>) | (<MAX><EQUAL><FLOAT>)
LinkDeclaration() ::= <LINK> (<WORD> | <PARAMETER_WORD>) (<WORD> | <PARAMETER_WORD>) ( ( "{" LinkProperties() "}" ) | ";" )
LinkProperties() ::= ( LinkProperty() (";") )*
LinkProperty() ::= (<DIRECTED><EQUAL><BOOLEAN>) | (<COMMENT><EQUAL><STRING>)
RelationDeclaration() ::= <RELATION> ListWords() (";" | ("{" RelationProperties() "}") )
RelationProperties() ::= (RelationProperty()";")*| ";"
RelationProperty() ::= (<COMMENT><EQUAL><STRING>) | (<VALUES><EQUAL> (TableDeclaration()| TreeDeclaration()| ConvexSetDeclaration()| FunctionDeclaration() | ContinuousTreeDeclaration()) ) | (<ACTIVE><EQUAL><BOOLEAN>) | (<RELATIONNAME><EQUAL><WORD>) | (<RELATIONKIND><EQUAL><WORD>)
FunctionDeclaration() ::= <FUNCTION><WORD>"(" ( (ArgumentInclusion() (",")? )*) ")"
ArgumentInclusion() ::= <FLOAT> | <WORD>
TableDeclaration() ::= <TABLE> "(" (ListAssignments() | ListFloats()) ")"
ConvexSetDeclaration() ::= <CONVEXSET> "(" ( table=TableDeclaration())+ ")"
ListAssignments() ::= ((Assignment() (",")?)+ DefaultAssignment()? (Assignment() (",")?)* ) | (DefaultAssignment()) (Assignment() (",")?)*
Assignment() ::= "[" ListWordIntegers() "]" <EQUAL><FLOAT>
ListFloats() ::= (<FLOAT> (",")?)*
FloatsToVector() ::= ( (<DECIMAL_LITERAL>|<INTEGER>|<FLOAT>|<FLOATSCI>) (",")? )*
Vector ListWordIntegers() ::= ( (<DECIMAL_LITERAL>| <WORD>|<STRINGDECIMAL>) (",")?)*
DefaultAssignment() ::= <DEFVALUE><EQUAL><FLOAT>
TreeDeclaration() ::= <TREE> "(" BodyTree() ")"
ContinuousTreeDeclaration() ::= <CONTINUOUS_TREE> "(" BodyContinuousTree() ")"
BodyContinuousTree() ::= FinalCT() | ExpansionCT()
FinalCT() ::= DensityDeclaration() ";"
ExpansionCT() ::= <CASE> ( <WORD> | <STRING> ) ( ( "(" FloatsToVector() ")" "{" ListContinuousOptions(T) "}" ) | ( "{" ListDiscreteOptions(T) "}" ) )
BodyTree() ::= (<FLOAT>";") | (<CASE> <WORD> "{" ListOptions() "}" )
ListOptions() ::= (Option())* (DefaultAssignment()";")? (Option())*
ListContinuousOptions() ::= (ContinuousOption(T))*
ListDiscreteOptions() ::= (DiscreteOption(T))*
DiscreteOption() ::= (<WORD>|<STRING>|<BOOLEAN>|Q=<DECIMAL_LITERAL>) <EQUAL> BodyContinuousTree()
ContinuousOption() ::= <DECIMAL_LITERAL><EQUAL> BodyContinuousTree()
Option() ::= (<WORD>|<DECIMAL_LITERAL>) <EQUAL> BodyTree()
DensityDeclaration() ::= DensityElement() (("+"|"-")? DensityElement())*
DensityElement() ::= ( (<FLOAT>|<FLOATSCI>|<INTEGER>) ("*")? <EXP> "(" LinearFunctionDeclaration() ")" ) | ( <EXP> "(" LinearFunctionDeclaration() ")" ) | ( <FLOAT>|<FLOATSCI>|<INTEGER> )
LinearFunctionDeclaration() ::= ("-")? ElementLinear() ( ("+"|"-")? ElementLinear() )*
ElementLinear() ::= ( (Q=<FLOAT>|Q=<FLOATSCI>|Q=<INTEGER>) ( "*")? ( Q=<WORD>|Q=<STRING> ) ) | ( (Q=<WORD>|Q=<STRING>) )
ListWords() ::= ((<WORD>|<DECIMAL_LITERAL>|<PARAMETER_WORD>) <COMMA> ListWords())| ((<WORD>|<DECIMAL_LITERAL>|<PARAMETER_WORD>) ListWords())| (<WORD>|<DECIMAL_LITERAL>|<PARAMETER_WORD>)