In the following, we denote with ( exp )* zero or more repetitions of exp, while with ( exp )+ one or more repetitions of exp. Furthermore, [ exp ] represents an optional occurrence of exp, while exp1 | exp2 stands for either exp1 or exp2.
Program ::= ( TypeDeclaration )* ( Device [
has
RuleIdList ] )+ ( ECARule )*
TypeDeclaration ::=define
CompoundTypeas {
FieldDeclaration}
FieldDeclaration ::= ( ResourceId:
(physical input
PrimitiveType |physical output
PrimitiveType |logical
PrimitiveType ) )+
Device ::= DeviceId:
Description{
ResourceDeclaration [where
BooleanExpression ]}
ResourceDeclaration ::= ( PhysicalResource | LogicalResource | CompoundResource )+
PhysicalResource ::=physical output
PrimitiveType ResourceId=
Value |physical input
PrimitiveType ResourceId
LogicalResource ::=logical
PrimitiveType ResourceId=
Value
CompoundResource ::= CompoundType ResourceId= (
[ Constructor ])
Constructor ::= ResourceId=
Value (,
ResourceId=
Value )*
RuleIdList ::= ( RuleId )+
ECARule ::=rule
RuleIdon
Event ( Task )+
|rule
RuleIdon
Eventdefault
Action ( Task )*
|rule
RuleIdon
Eventfor
[all
] Conditiondo
Actionowise
Action
|rule
RuleIdon
Eventlet
LetDeclarationin
( Task )+
Event ::= ( ResourceId | *ResourceId[
ResourceId]
)+
Task ::=for
[all
] Conditiondo
Action
Action ::= Assignment (,
Assignment ) *
Assignment ::= LocalResourceAccess=
Expression | RemoteResourceAccess=
Expression
LocalResourceAccess ::= [this.
] ResourceId | [this.
] ResourceId[
ResourceId]
RemoteResourceAccess ::=ext.
ResourceId |ext.
ResourceId[
ResourceId]
LetDeclaration ::= ResourceId:=
Expression (;
ResourceId:=
Expression ) *
Expression ::= BooleanExpression | NonBooleanExpression
Condition ::= BooleanExpression
BooleanExpression ::= BooleanValue
| LocalResourceAccess
| RemoteResourceAccess
| ForeignFunction
|(
BooleanExpression)
|not
BooleanExpression
| BooleanExpressionand
BooleanExpression
| BooleanExpressionor
BooleanExpression
| NonBooleanExpression==
NonBooleanExpression
| NonBooleanExpression!=
NonBooleanExpression
| NonBooleanExpression<
NonBooleanExpression
| NonBooleanExpression<=
NonBooleanExpression
| NonBooleanExpression>
NonBooleanExpression
| NonBooleanExpression>=
NonBooleanExpression
NonBooleanExpression ::= NumericExpression | StringExpression
NumericExpression ::= NumericValue
| LocalResourceAccess
| RemoteResourceAccess
| ForeignFunction
|(
NumericExpression)
|absint
NumericExpression
|absdec
NumericExpression
| NumericExpression+
NumericExpression
| NumericExpression-
NumericExpression
| NumericExpression*
NumericExpression
| NumericExpression/
NumericExpression
| NumericExpression%
NumericExpression
StringExpression ::= StringValue
| LocalResourceAccess
| RemoteResourceAccess
| ForeignFunction
| StringExpression::
StringExpression
ForeignFunction ::=foreign (
StringValue)
|foreign (
StringValue (,
Param )+)
Param ::= Value | LocalResourceAccess
ResourceId ::= Identifier
Identifier ::= Character ( Character | Digit )*
Character ::=a
|b
... |z
|A
|B
... |Z
SpecialCharacter ::=|
!
|#
| ... |~
Digit ::=0
|1
| ... |9
Value ::= BooleanValue | NumericValue | StringValue
BooleanValue ::=true
|false
NumericValue ::= IntegerValue | DecimalValue
IntegerValue ::= [-
] ( Digit )+
DecimalValue ::= IntegerValue.
( Digit )+
StringValue ::="
( Character | SpecialCharacter | Digit )*"
Type ::= PrimitiveType | CompoundType
PrimitiveType ::=boolean
|integer
|decimal
|string
CompoundType ::= Identifier
DeviceId ::= Identifier
Description ::= StringValue
RuleId ::= Identifier
Inline comments keyword: #
Multi-line comments start delimiter: \@
Multi-line comments end delimiter: @\