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