Program:
Program ::= Shebang? Statement*
no referencesShebang:
Shebang ::= '#!' restOfLine
referenced by:
Program
Statement:
Statement
::= ImportDeclaration
| TypeDeclaration
| ConstantDeclaration
| NativeConstantDeclaration
| ExtensionConstantDeclaration
| VariableDeclaration
| NativeVariableDeclaration
| LetDeclaration
| FunctionDeclaration
| ForeignFunctionDeclaration
| NativeFunctionDeclaration
| ExtensionFunctionDeclaration
| ExceptionDeclaration
| InterfaceDeclaration
| ExportDeclaration
| MainBlock
| AssertStatement
| AssignmentStatement
| CaseStatement
| CheckStatement
| ExecStatement
| ExitStatement
| ExpressionStatement
| ForStatement
| ForeachStatement
| IfStatement
| IncrementStatement
| LoopStatement
| NextStatement
| RaiseStatement
| RepeatStatement
| ReturnStatement
| TryStatement
| WhileStatement
referenced by:
CaseStatement
CheckStatement
ForStatement
ForeachStatement
FunctionDeclaration
IfStatement
LoopStatement
MainBlock
Program
RepeatStatement
TryExpression
TryStatement
WhileStatement
ImportDeclaration:
ImportDeclaration
::= 'IMPORT' ( ( Identifier '.' )? ( Identifier 'ALIAS' )? | StringLiteral 'ALIAS' ) Identifier
referenced by:
Statement
TypeDeclaration:
TypeDeclaration
::= 'TYPE' Identifier 'IS' Type
referenced by:
ExportDeclaration
Statement
Type:
Type ::= ParameterisedType
| RecordType
| ClassType
| EnumType
| PointerType
| FunctionPointerType
| Identifier ( '.' Identifier )?
referenced by:
ClassType
ConstantDeclaration
ExtensionConstantDeclaration
FunctionParameter
FunctionParameterList
LetDeclaration
NativeConstantDeclaration
NativeVariableDeclaration
ParameterisedType
PointerType
RecordType
TypeDeclaration
VariableDeclaration
ParameterisedType:
ParameterisedType
::= ( 'Array' | 'Dictionary' ) '<' Type '>'
referenced by:
Type
RecordType:
RecordType
::= 'RECORD' ( 'PRIVATE'? Identifier ':' Type )* 'END' 'RECORD'
referenced by:
Type
ClassType:
ClassType
::= 'CLASS' ( 'IMPLEMENTS' Identifier ( '.' Identifier )? ( ',' Identifier ( '.' Identifier )? )* )? ( 'PRIVATE'? Identifier ':' Type )* 'END' 'CLASS'
referenced by:
Type
EnumType:
EnumType ::= 'ENUM' Identifier* 'END' 'ENUM'
referenced by:
Type
PointerType:
PointerType
::= 'VALID'? 'POINTER' 'TO' Type
referenced by:
Type
FunctionPointerType:
FunctionPointerType
::= 'FUNCTION' FunctionParameterList
referenced by:
Type
ConstantDeclaration:
ConstantDeclaration
::= 'CONSTANT' Identifier ':' Type ':=' Expression
referenced by:
ExportDeclaration
Statement
NativeConstantDeclaration:
NativeConstantDeclaration
::= 'DECLARE' 'NATIVE' 'CONSTANT' Identifier ':' Type
referenced by:
ExportDeclaration
Statement
ExtensionConstantDeclaration:
ExtensionConstantDeclaration
::= 'DECLARE' 'EXTENSION' 'CONSTANT' Identifier ':' Type
referenced by:
ExportDeclaration
Statement
VariableDeclaration:
VariableDeclaration
::= 'VAR' Identifier ( ',' Identifier )* ':' Type ( ':=' Expression )?
referenced by:
ExportDeclaration
Statement
NativeVariableDeclaration:
NativeVariableDeclaration
::= 'DECLARE' 'NATIVE' 'VAR' Identifier ':' Type
referenced by:
Statement
LetDeclaration:
LetDeclaration
::= 'LET' Identifier ':' Type ':=' Expression
referenced by:
ExportDeclaration
Statement
FunctionDeclaration:
FunctionDeclaration
::= 'FUNCTION' FunctionHeader Statement* 'END' 'FUNCTION'
referenced by:
ExportDeclaration
Statement
ForeignFunctionDeclaration:
ForeignFunctionDeclaration
::= 'FOREIGN' 'FUNCTION' FunctionHeader DictionaryLiteral 'END' 'FUNCTION'
referenced by:
ExportDeclaration
Statement
NativeFunctionDeclaration:
NativeFunctionDeclaration
::= 'DECLARE' 'NATIVE' 'FUNCTION' FunctionHeader
referenced by:
ExportDeclaration
Statement
ExtensionFunctionDeclaration:
ExtensionFunctionDeclaration
::= 'DECLARE' 'EXTENSION' 'FUNCTION' FunctionHeader
referenced by:
ExportDeclaration
Statement
FunctionHeader:
FunctionHeader
::= Identifier ( '.' Identifier )? FunctionParameterList
referenced by:
ExtensionFunctionDeclaration
ForeignFunctionDeclaration
FunctionDeclaration
NativeFunctionDeclaration
FunctionParameterList:
FunctionParameterList
::= '(' ( FunctionParameter ( ',' FunctionParameter )* )? ')' ( ':' Type )?
referenced by:
FunctionHeader
FunctionPointerType
InterfaceDeclaration
FunctionParameter:
FunctionParameter
::= ( 'IN' | 'OUT' | 'INOUT' )? Identifier ( ',' Identifier )* ':' Type ( 'DEFAULT' ( Expression | '_' ) )?
referenced by:
FunctionParameterList
ExceptionDeclaration:
ExceptionDeclaration
::= 'EXCEPTION' Identifier ( '.' Identifier )*
referenced by:
ExportDeclaration
Statement
InterfaceDeclaration:
InterfaceDeclaration
::= 'INTERFACE' Identifier ( 'FUNCTION' Identifier FunctionParameterList )* 'END' 'INTERFACE'
referenced by:
ExportDeclaration
Statement
ExportDeclaration:
ExportDeclaration
::= 'EXPORT' ( TypeDeclaration | ConstantDeclaration | NativeConstantDeclaration | ExtensionConstantDeclaration | VariableDeclaration | LetDeclaration | FunctionDeclaration | ForeignFunctionDeclaration | NativeFunctionDeclaration | ExtensionFunctionDeclaration | ExceptionDeclaration | InterfaceDeclaration | Identifier )
referenced by:
Statement
MainBlock:
MainBlock
::= 'BEGIN' 'MAIN' Statement* 'END' 'MAIN'
referenced by:
Statement
AssertStatement:
AssertStatement
::= 'ASSERT' Expression ( ',' Expression )*
referenced by:
Statement
AssignmentStatement:
AssignmentStatement
::= ( CompoundExpression | '_' ) ':=' Expression
referenced by:
Statement
CaseStatement:
CaseStatement
::= 'CASE' Expression ( 'WHEN' WhenCondition ( ',' WhenCondition )* 'DO' Statement* )* ( 'WHEN' 'OTHERS' 'DO' Statement* )? 'END' 'CASE'
referenced by:
Statement
CheckStatement:
CheckStatement
::= 'CHECK' Expression 'ELSE' Statement* 'END' 'CHECK'
referenced by:
Statement
ExecStatement:
ExecStatement
::= 'EXEC' ExecBody
referenced by:
Statement
WhenCondition:
WhenCondition
::= ( '=' | '<>' | '<' | '>' | '<=' | '>=' | Expression 'TO' )? Expression
referenced by:
CaseStatement
ExitStatement:
ExitStatement
::= 'EXIT' ( 'FUNCTION' | 'WHILE' | 'FOR' | 'FOREACH' | 'LOOP' | 'REPEAT' | Identifier )
referenced by:
Statement
ExpressionStatement:
ExpressionStatement
::= Identifier CompoundExpressionTail+
referenced by:
Statement
ForStatement:
ForStatement
::= 'FOR' Identifier ':=' Expression 'TO' Expression ( 'STEP' Expression )? ( 'LABEL' Identifier )? 'DO' Statement* 'END' 'FOR'
referenced by:
Statement
ForeachStatement:
ForeachStatement
::= 'FOREACH' Identifier 'IN' Expression ( 'INDEX' Identifier )? ( 'LABEL' Identifier )? 'DO' Statement* 'END' 'FOREACH'
referenced by:
Statement
IfStatement:
IfStatement
::= 'IF' IfExpression 'THEN' Statement* ( 'ELSIF' IfExpression 'THEN' Statement* )* ( 'ELSE' Statement* )? 'END' 'IF'
referenced by:
Statement
IncrementStatement:
IncrementStatement
::= ( 'INC' | 'DEC' ) Expression
referenced by:
Statement
IfExpression:
IfExpression
::= Expression
| 'VALID' ( Expression 'AS' )? Identifier ( ',' ( Expression 'AS' )? Identifier )*
referenced by:
IfStatement
LoopStatement:
LoopStatement
::= 'LOOP' ( 'LABEL' Identifier )? Statement* 'END' 'LOOP'
referenced by:
Statement
NextStatement:
NextStatement
::= 'NEXT' ( 'WHILE' | 'FOR' | 'FOREACH' | 'LOOP' | 'REPEAT' | Identifier )
referenced by:
Statement
RaiseStatement:
RaiseStatement
::= 'RAISE' Identifier ( '.' Identifier )* ( '(' Identifier 'WITH' Expression ( ',' Identifier 'WITH' Expression )* ')' )?
referenced by:
Statement
RepeatStatement:
RepeatStatement
::= 'REPEAT' ( 'LABEL' Identifier )? Statement* 'UNTIL' Expression
referenced by:
Statement
ReturnStatement:
ReturnStatement
::= 'RETURN' Expression
referenced by:
Statement
TryStatement:
TryStatement
::= 'TRY' Statement* ( 'TRAP' Identifier ( '.' Identifier )* ( 'AS' Identifier )? 'DO' Statement* )* 'END' 'TRY'
referenced by:
Statement
WhileStatement:
WhileStatement
::= 'WHILE' WhileExpression ( 'LABEL' Identifier )? 'DO' Statement* 'END' 'WHILE'
referenced by:
Statement
WhileExpression:
WhileExpression
::= Expression
| 'VALID' ( Expression 'AS' )? Identifier ( ',' ( Expression 'AS' )? Identifier )*
referenced by:
WhileStatement
BracketedExpression:
BracketedExpression
::= ConditionalExpression
| TryExpression
| DisjunctionExpression
referenced by:
Atom
ConditionalExpression:
ConditionalExpression
::= 'IF' Expression 'THEN' Expression 'ELSE' Expression
referenced by:
BracketedExpression
TryExpression:
TryExpression
::= 'TRY' Expression ( 'TRAP' Identifier ( '.' Identifier )? ( 'AS' Identifier )? ( 'DO' Statement* | 'GIVES' Expression ) )*
referenced by:
BracketedExpression
Expression:
Expression
::= DisjunctionExpression
referenced by:
ArrayIndexExpression
ArrayLiteral
ArrayRangeLiteral
AssertStatement
AssignmentStatement
CaseStatement
CheckStatement
ConditionalExpression
ConstantDeclaration
DictionaryLiteral
ForStatement
ForeachStatement
FunctionArgument
FunctionParameter
IfExpression
IncrementStatement
LetDeclaration
RaiseStatement
RepeatStatement
ReturnStatement
TryExpression
VariableDeclaration
WhenCondition
WhileExpression
DisjunctionExpression:
DisjunctionExpression
::= ConjunctionExpression ( 'OR' ConjunctionExpression )*
referenced by:
BracketedExpression
Expression
ConjunctionExpression:
ConjunctionExpression
::= MembershipExpression ( 'AND' MembershipExpression )*
referenced by:
DisjunctionExpression
MembershipExpression:
MembershipExpression
::= ComparisonExpression ( 'NOT'? 'IN' ComparisonExpression )?
referenced by:
ConjunctionExpression
ComparisonExpression:
ComparisonExpression
::= AdditionExpression ( ( '=' | '<>' | '<' | '>' | '<=' | '>=' ) AdditionExpression )*
referenced by:
MembershipExpression
AdditionExpression:
AdditionExpression
::= MultiplicationExpression ( ( '+' | '-' | '&' ) MultiplicationExpression )*
referenced by:
ComparisonExpression
MultiplicationExpression:
MultiplicationExpression
::= ExponentiationExpression ( ( '*' | '/' | 'INTDIV' | 'MOD' ) ExponentiationExpression )*
referenced by:
AdditionExpression
ExponentiationExpression:
ExponentiationExpression
::= Atom ( '^' Atom )*
referenced by:
MultiplicationExpression
Atom:
Atom ::= ( '+' | '-' | 'NOT' )* ( '(' BracketedExpression ')' | ArrayLiteral | ArrayRangeLiteral | DictionaryLiteral | 'FALSE' | 'TRUE' | Number | ( 'EMBED' | 'HEXBYTES' )? StringLiteral | NewExpression | 'NIL' | 'NOWHERE' | CompoundExpression )
referenced by:
ExponentiationExpression
ArrayLiteral:
ArrayLiteral
::= '[' ( Expression ( ',' Expression )* ','? )? ']'
referenced by:
Atom
ArrayRangeLiteral:
ArrayRangeLiteral
::= '[' Expression 'TO' Expression ( 'STEP' Expression )? ']'
referenced by:
Atom
DictionaryLiteral:
DictionaryLiteral
::= '{' ( Expression ':' Expression ','? )* '}'
referenced by:
Atom
ForeignFunctionDeclaration
NewExpression:
NewExpression
::= 'NEW' Identifier ( '.' Identifier )? ( '(' ( FunctionArgument ( ',' FunctionArgument )* )? ')' )?
referenced by:
Atom
CompoundExpression:
CompoundExpression
::= Identifier CompoundExpressionTail*
referenced by:
AssignmentStatement
Atom
CompoundExpressionTail:
CompoundExpressionTail
::= '[' ArrayIndexExpression ( ',' ArrayIndexExpression )* ']'
| '(' ( FunctionArgument ( ',' FunctionArgument )* )? ')'
| ( '.' | '->' ) Identifier
referenced by:
CompoundExpression
ExpressionStatement
FunctionArgument:
FunctionArgument
::= ( 'IN' | 'INOUT' | 'OUT' )? ( Identifier 'WITH' )? ( Expression | '_' )
referenced by:
CompoundExpressionTail
NewExpression
ArrayIndexExpression:
ArrayIndexExpression
::= Expression ( 'TO' Expression )?
referenced by:
CompoundExpressionTail
... generated by Railroad Diagram Generator