Ivy Language BNF
April 9, 2018•155 words
Contract ::= contract Identifier ( Parameters) {
Clause+
}
Clause ::= clause Identifier ( Parameters) {
Statement+
}
Statement ::= Assertion | Unlock
Assertion ::= verify Expression1
Unlock ::= unlock VariableExpression
Expression1 ::= ComparisonExpression | Expression2
Expression2 ::= CallExpression | Literal | VariableExpression
| ( Expression1 )
Literal ::= ListLiteral | BooleanLiteral | IntegerLiteral
IntegerLiteral ::= n | -n
ComparisonExpression ::= Expression2 ComparisonOperator Expressions2
ComparisonOperator ::= Operator
CallExpression ::= FunctionIdentifier ( Expressions )
VariableExpression ::= Identifier
Expressions ::= Expression1, Expressions | Expression | Nothing
ListLiteral ::= [ Expressions ]
BooleanLiteral ::= true | false
Identifiers ::= Identifier, Identifiers | Identifier | Nothing
Parameters ::= Parameter, Parameters | Parameter | Nothing
Parameter ::= Identifier : Type
Type ::= PrimitiveType | HashType
PrimitiveType ::= Identifier
HashFunctionType ::= Identifier
HashType ::= HashFunctionType ( HashableType )
HashableType ::= "Bytes" | "PublicKey" | HashType
Identifier ::= s
FunctionIdentifier ::= Identifier . Identifier
Nothing ::= $$\epsilon$$
Operator ::= != | ==