Module:
Module ::= ( 'jsoniq' ( 'encoding' StringLiteral | 'version' StringLiteral ( 'encoding' StringLiteral )? ) ';' )? ( LibraryModule | MainModule )
no referencesMainModule:
MainModule
::= Prolog Expr
referenced by:
Module
LibraryModule:
LibraryModule
::= 'module' 'namespace' NCName '=' URILiteral ';' Prolog
referenced by:
Module
Prolog:
Prolog ::= ( ( DefaultCollationDecl | OrderingModeDecl | EmptyOrderDecl | DecimalFormatDecl | ModuleImport ) ';' )* ( ( FunctionDecl | VariableDecl ) ';' )*
referenced by:
LibraryModule
MainModule
DefaultCollationDecl:
DefaultCollationDecl
::= 'declare' 'default' 'collation' URILiteral
referenced by:
Prolog
OrderingModeDecl:
OrderingModeDecl
::= 'declare' 'ordering' ( 'ordered' | 'unordered' )
referenced by:
Prolog
EmptyOrderDecl:
EmptyOrderDecl
::= 'declare' 'default' 'order' 'empty' ( 'greatest' | 'least' )
referenced by:
Prolog
DecimalFormatDecl:
DecimalFormatDecl
::= 'declare' ( 'decimal-format' ( NCName ':' )? NCName | 'default' 'decimal-format' ) ( DFPropertyName '=' StringLiteral )*
referenced by:
Prolog
DFPropertyName:
DFPropertyName
::= 'decimal-separator'
| 'grouping-separator'
| 'infinity'
| 'minus-sign'
| 'NaN'
| 'percent'
| 'per-mille'
| 'zero-digit'
| 'digit'
| 'pattern-separator'
referenced by:
DecimalFormatDecl
ModuleImport:
ModuleImport
::= 'import' 'module' ( 'namespace' NCName '=' )? URILiteral ( 'at' URILiteral ( ',' URILiteral )* )?
referenced by:
Prolog
VarDecl:
VarDecl ::= 'declare' 'variable' VarRef ( 'as' SequenceType )? ( ':=' ExprSingle | 'external' ( ':=' ExprSingle )? )
no referencesFunctionDecl:
FunctionDecl
::= 'declare' 'function' ( NCName ':' )? NCName '(' ParamList? ')' ( 'as' SequenceType )? ( '{' Expr '}' | 'external' )
referenced by:
Prolog
ParamList:
ParamList
::= '$' NCName ( 'as' SequenceType )? ( ',' '$' NCName ( 'as' SequenceType )? )*
referenced by:
FunctionDecl
Expr:
Expr ::= ExprSingle ( ',' ExprSingle )*
referenced by:
ArrayConstructor
ArrayLookup
FunctionDecl
IfExpr
MainModule
ObjectConstructor
OrderedExpr
ParenthesizedExpr
Predicate
SwitchExpr
TryCatchExpr
TypeswitchExpr
UnorderedExpr
ExprSingle:
ExprSingle
::= FLWORExpr
| QuantifiedExpr
| SwitchExpr
| TypeswitchExpr
| IfExpr
| TryCatchExpr
| OrExpr
referenced by:
Argument
CaseClause
Expr
FLWORExpr
ForClause
GroupByClause
IfExpr
LetClause
OrderByClause
PairConstructor
QuantifiedExpr
SwitchCaseClause
SwitchExpr
TypeswitchExpr
VarDecl
WhereClause
FLWORExpr:
FLWORExpr
::= ( ForClause | LetClause ) ( ForClause | LetClause | WhereClause | GroupByClause | OrderByClause | CountClause )* 'return' ExprSingle
referenced by:
ExprSingle
ForClause:
ForClause
::= 'for' VarRef ( 'as' SequenceType )? ( 'allowing' 'empty' )? ( 'at' VarRef )? 'in' ExprSingle ( ',' VarRef ( 'as' SequenceType )? ( 'allowing' 'empty' )? ( 'at' VarRef )? 'in' ExprSingle )*
referenced by:
FLWORExpr
LetClause:
LetClause
::= 'let' VarRef ( 'as' SequenceType )? ':=' ExprSingle ( ',' VarRef ( 'as' SequenceType )? ':=' ExprSingle )*
referenced by:
FLWORExpr
CountClause:
CountClause
::= 'count' VarRef
referenced by:
FLWORExpr
WhereClause:
WhereClause
::= 'where' ExprSingle
referenced by:
FLWORExpr
GroupByClause:
GroupByClause
::= 'group' 'by' VarRef ( ( 'as' SequenceType )? ':=' ExprSingle )? ( 'collation' URILiteral )? ( ',' VarRef ( ( 'as' SequenceType )? ':=' ExprSingle )? ( 'collation' URILiteral )? )*
referenced by:
FLWORExpr
OrderByClause:
OrderByClause
::= ( 'order' 'by' | 'stable' 'order' 'by' ) ExprSingle ( 'ascending' | 'descending' )? ( 'empty' ( 'greatest' | 'least' ) )? ( 'collation' URILiteral )? ( ',' ExprSingle ( 'ascending' | 'descending' )? ( 'empty' ( 'greatest' | 'least' ) )? ( 'collation' URILiteral )? )*
referenced by:
FLWORExpr
QuantifiedExpr:
QuantifiedExpr
::= ( 'some' | 'every' ) VarRef ( 'as' SequenceType )? 'in' ExprSingle ( ',' VarRef ( 'as' SequenceType )? 'in' ExprSingle )* 'satisfies' ExprSingle
referenced by:
ExprSingle
SwitchExpr:
SwitchExpr
::= 'switch' '(' Expr ')' SwitchCaseClause+ 'default' 'return' ExprSingle
referenced by:
ExprSingle
SwitchCaseClause:
SwitchCaseClause
::= ( 'case' ExprSingle )+ 'return' ExprSingle
referenced by:
SwitchExpr
TypeswitchExpr:
TypeswitchExpr
::= 'typeswitch' '(' Expr ')' CaseClause+ 'default' VarRef? 'return' ExprSingle
referenced by:
ExprSingle
CaseClause:
CaseClause
::= 'case' ( VarRef 'as' )? SequenceType ( '|' SequenceType )* 'return' ExprSingle
referenced by:
TypeswitchExpr
IfExpr:
IfExpr ::= 'if' '(' Expr ')' 'then' ExprSingle 'else' ExprSingle
referenced by:
ExprSingle
TryCatchExpr:
TryCatchExpr
::= 'try' '{' Expr '}' 'catch' '*' '{' Expr '}'
referenced by:
ExprSingle
OrExpr:
OrExpr ::= AndExpr ( 'or' AndExpr )*
referenced by:
ExprSingle
AndExpr:
AndExpr ::= NotExpr ( 'and' NotExpr )*
referenced by:
OrExpr
NotExpr:
NotExpr ::= 'not'? ComparisonExpr
referenced by:
AndExpr
ComparisonExpr:
ComparisonExpr
::= StringConcatExpr ( ( 'eq' | 'ne' | 'lt' | 'le' | 'gt' | 'ge' ) StringConcatExpr )?
referenced by:
NotExpr
StringConcatExpr:
StringConcatExpr
::= RangeExpr ( '||' RangeExpr )*
referenced by:
ComparisonExpr
RangeExpr:
RangeExpr
::= AdditiveExpr ( 'to' AdditiveExpr )?
referenced by:
StringConcatExpr
AdditiveExpr:
AdditiveExpr
::= MultiplicativeExpr ( ( '+' | '-' ) MultiplicativeExpr )*
referenced by:
RangeExpr
MultiplicativeExpr:
MultiplicativeExpr
::= InstanceofExpr ( ( '*' | 'div' | 'idiv' | 'mod' ) InstanceofExpr )*
referenced by:
AdditiveExpr
InstanceofExpr:
InstanceofExpr
::= TreatExpr ( 'instance' 'of' SequenceType )?
referenced by:
MultiplicativeExpr
TreatExpr:
TreatExpr
::= CastableExpr ( 'treat' 'as' SequenceType )?
referenced by:
InstanceofExpr
CastableExpr:
CastableExpr
::= CastExpr ( 'castable' 'as' AtomicType '?'? )?
referenced by:
TreatExpr
CastExpr:
CastExpr ::= UnaryExpr ( 'cast' 'as' AtomicType '?'? )?
referenced by:
CastableExpr
UnaryExpr:
UnaryExpr
::= ( '-' | '+' )* SimpleMapExpr
referenced by:
CastExpr
SimpleMapExpr:
SimpleMapExpr
::= PostfixExpr ( '!' PostfixExpr )*
referenced by:
UnaryExpr
PostfixExpr:
PostfixExpr
::= PrimaryExpr ( Predicate | ObjectLookup | ArrayLookup | ArrayUnboxing )*
referenced by:
SimpleMapExpr
Predicate:
Predicate
::= '[' Expr ']'
referenced by:
PostfixExpr
ObjectLookup:
ObjectLookup
::= '.' ( StringLiteral | NCName | ParenthesizedExpr | VarRef | ContextItemExpr )
referenced by:
PostfixExpr
ArrayLookup:
ArrayLookup
::= '[' '[' Expr ']' ']'
referenced by:
PostfixExpr
ArrayUnboxing:
ArrayUnboxing
::= '[' ']'
referenced by:
PostfixExpr
PrimaryExpr:
PrimaryExpr
::= Literal
| VarRef
| ParenthesizedExpr
| ContextItemExpr
| FunctionCall
| OrderedExpr
| UnorderedExpr
| ObjectConstructor
| ArrayConstructor
referenced by:
PostfixExpr
Literal:
Literal ::= NumericLiteral
| StringLiteral
| BooleanLiteral
| NullLiteral
referenced by:
PrimaryExpr
NumericLiteral:
NumericLiteral
::= IntegerLiteral
| DecimalLiteral
| DoubleLiteral
referenced by:
Literal
BooleanLiteral:
BooleanLiteral
::= 'true'
| 'false'
referenced by:
Literal
NullLiteral:
NullLiteral
::= 'null'
referenced by:
Literal
VarRef:
VarRef ::= '$' ( NCName ':' )? NCName
referenced by:
CaseClause
CountClause
ForClause
GroupByClause
LetClause
ObjectLookup
PrimaryExpr
QuantifiedExpr
TypeswitchExpr
VarDecl
ParenthesizedExpr:
ParenthesizedExpr
::= '(' Expr? ')'
referenced by:
ObjectLookup
PrimaryExpr
ContextItemExpr:
ContextItemExpr
::= '$$'
referenced by:
ObjectLookup
PrimaryExpr
OrderedExpr:
OrderedExpr
::= 'ordered' '{' Expr '}'
referenced by:
PrimaryExpr
UnorderedExpr:
UnorderedExpr
::= 'unordered' '{' Expr '}'
referenced by:
PrimaryExpr
FunctionCall:
FunctionCall
::= ( NCName ':' )? NCName ArgumentList
referenced by:
PrimaryExpr
Argument:
Argument ::= ExprSingle
| '?'
no referencesObjectConstructor:
ObjectConstructor
::= '{' ( PairConstructor ( ',' PairConstructor )* )? '}'
| '{|' Expr '|}'
referenced by:
PrimaryExpr
PairConstructor:
PairConstructor
::= ( ExprSingle | NCName ) ( ':' | '?' ) ExprSingle
referenced by:
ObjectConstructor
ArrayConstructor:
ArrayConstructor
::= '[' Expr? ']'
referenced by:
PrimaryExpr
SequenceType:
SequenceType
::= '(' ')'
| ItemType ( '?' | '*' | '+' )?
referenced by:
CaseClause
ForClause
FunctionDecl
GroupByClause
InstanceofExpr
LetClause
ParamList
QuantifiedExpr
TreatExpr
VarDecl
ItemType:
ItemType ::= 'item'
| JSONItemTest
| AtomicType
referenced by:
SequenceType
JSONItemTest:
JSONItemTest
::= 'object'
| 'array'
| 'json-item'
referenced by:
ItemType
AtomicType:
AtomicType
::= 'atomic'
| 'string'
| 'integer'
| 'decimal'
| 'double'
| 'boolean'
| 'null'
| 'etc (other builtin atomic types)'
referenced by:
CastExpr
CastableExpr
ItemType
URILiteral:
URILiteral
::= StringLiteral
referenced by:
DefaultCollationDecl
GroupByClause
LibraryModule
ModuleImport
OrderByClause
IntegerLiteral:
IntegerLiteral
::= Digits
referenced by:
NumericLiteral
DecimalLiteral:
DecimalLiteral
::= '.' Digits
| Digits '.' [0-9]*
/* ws: explicit */
referenced by:
NumericLiteral
DoubleLiteral:
DoubleLiteral
::= ( '.' Digits | Digits ( '.' [0-9]* )? ) [eE] [+#x2D]? Digits
/* ws: explicit */
referenced by:
NumericLiteral
StringLiteral:
StringLiteral
::= '"' ( PredefinedCharRef | CharRef | [^"\] )* '"'
/* ws: explicit */
referenced by:
DecimalFormatDecl
Literal
Module
ObjectLookup
URILiteral
PredefinedCharRef:
PredefinedCharRef
::= '\' ( '\' | '/' | '"' | "'" | 'b' | 'f' | 'n' | 'r' | 't' )
/* ws: explicit */
referenced by:
StringLiteral
CharRef:
CharRef ::= '\' 'u' [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]
referenced by:
StringLiteral
Comment:
Comment ::= '(:' ( CommentContents | Comment )* ':)'
/* ws: explicit */
referenced by:
Comment
NCName:
NCName ::= [http://www.w3.org/TR/REC-xml-names/#NT-NCName-w-o-dot-and-keywords]
referenced by:
DecimalFormatDecl
FunctionCall
FunctionDecl
LibraryModule
ModuleImport
ObjectLookup
PairConstructor
ParamList
VarRef
S:
S ::= [http://www.w3.org/TR/REC-xml#NT-S]
no referencesChar:
Char ::= [http://www.w3.org/TR/REC-xml#NT-Char]
referenced by:
CommentContents
Digits:
Digits ::= [0-9]+
referenced by:
DecimalLiteral
DoubleLiteral
IntegerLiteral
CommentContents:
CommentContents
::= Char+ - ( Char* ( '(:' | ':)' ) Char* )
referenced by:
Comment
... generated by Railroad Diagram Generator