jsoniq
Version:
JSONiq implementation for JavaScript
1,036 lines • 9.63 MB
JavaScript
// This file was generated on Sat May 2, 2015 23:07 (UTC+01) by REx v5.33 which is Copyright (c) 1979-2015 by Gunther Rademacher <grd@gmx.net>
// REx command line: JSONiqParser.ebnf -ll 2 -backtrack -tree -typescript
"use strict";
class ParseException {
constructor(b, e, s, o, x) {
this.begin = b;
this.end = e;
this.state = s;
this.offending = o;
this.expected = x;
}
getBegin() { return this.begin; }
getEnd() { return this.end; }
getState() { return this.state; }
getExpected() { return this.expected; }
getOffending() { return this.offending; }
getMessage() {
return this.offending < 0 ? "lexical analysis failed" : "syntax error";
}
}
exports.ParseException = ParseException;
class Parser {
constructor(source, parsingEventHandler) {
this.eventHandler = parsingEventHandler;
this.input = source;
this.size = source.length;
this.reset(0, 0, 0);
}
getInput() {
return this.input;
}
reset(l, b, e) {
this.b0 = b;
this.e0 = b;
this.l1 = l;
this.b1 = b;
this.e1 = e;
this.l2 = 0;
this.end = e;
this.ex = -1;
this.memo = {};
this.eventHandler.reset(this.input);
}
getOffendingToken(e) {
var o = e.getOffending();
return o >= 0 ? Parser.TOKEN[o] : null;
}
getExpectedTokenSet(e) {
var expected;
if (e.getExpected() < 0) {
expected = Parser.getTokenSet(-e.getState());
}
else {
expected = [Parser.TOKEN[e.getExpected()]];
}
return expected;
}
getErrorMessage(e) {
var tokenSet = this.getExpectedTokenSet(e);
var found = this.getOffendingToken(e);
var prefix = this.input.substring(0, e.getBegin());
var lines = prefix.split("\n");
var line = lines.length;
var column = lines[line - 1].length + 1;
var size = e.getEnd() - e.getBegin();
return e.getMessage()
+ (found == null ? "" : ", found " + found)
+ "\nwhile expecting "
+ (tokenSet.length == 1 ? tokenSet[0] : ("[" + tokenSet.join(", ") + "]"))
+ "\n"
+ (size == 0 || found != null ? "" : "after successfully scanning " + size + " characters beginning ")
+ "at line " + line + ", column " + column + ":\n..."
+ this.input.substring(e.getBegin(), Math.min(this.input.length, e.getBegin() + 64))
+ "...";
}
parse_XQuery() {
this.eventHandler.startNonterminal("XQuery", this.e0);
this.lookahead1W(277); // EQName^Token | IntegerLiteral | DecimalLiteral | DoubleLiteral | StringLiteral |
// S^WS | EOF | '$' | '$$' | '%' | '(' | '(#' | '(:' | '+' | '-' | '/' | '//' |
// ';' | '<' | '<!--' | '<?' | '[' | 'after' | 'allowing' | 'ancestor' |
// 'ancestor-or-self' | 'and' | 'append' | 'array' | 'as' | 'ascending' | 'at' |
// 'attribute' | 'base-uri' | 'before' | 'boundary-space' | 'break' | 'case' |
// 'cast' | 'castable' | 'catch' | 'child' | 'collation' | 'comment' |
// 'constraint' | 'construction' | 'context' | 'continue' | 'copy' |
// 'copy-namespaces' | 'count' | 'decimal-format' | 'declare' | 'default' |
// 'delete' | 'descendant' | 'descendant-or-self' | 'descending' | 'div' |
// 'document' | 'document-node' | 'element' | 'else' | 'empty' | 'empty-sequence' |
// 'encoding' | 'end' | 'eq' | 'every' | 'except' | 'exit' | 'external' | 'false' |
// 'first' | 'following' | 'following-sibling' | 'for' | 'from' | 'ft-option' |
// 'function' | 'ge' | 'group' | 'gt' | 'idiv' | 'if' | 'import' | 'in' | 'index' |
// 'insert' | 'instance' | 'integrity' | 'intersect' | 'into' | 'is' | 'item' |
// 'json' | 'json-item' | 'jsoniq' | 'last' | 'lax' | 'le' | 'let' | 'loop' | 'lt' |
// 'mod' | 'modify' | 'module' | 'namespace' | 'namespace-node' | 'ne' | 'node' |
// 'nodes' | 'not' | 'null' | 'object' | 'only' | 'option' | 'or' | 'order' |
// 'ordered' | 'ordering' | 'parent' | 'preceding' | 'preceding-sibling' |
// 'processing-instruction' | 'rename' | 'replace' | 'return' | 'returning' |
// 'revalidation' | 'satisfies' | 'schema' | 'schema-attribute' | 'schema-element' |
// 'score' | 'select' | 'self' | 'sliding' | 'some' | 'stable' | 'start' |
// 'strict' | 'structured-item' | 'switch' | 'text' | 'to' | 'treat' | 'true' |
// 'try' | 'tumbling' | 'type' | 'typeswitch' | 'union' | 'unordered' | 'updating' |
// 'validate' | 'value' | 'variable' | 'version' | 'where' | 'while' | 'with' |
// '{' | '{|'
this.whitespace();
this.parse_Module();
this.shift(25); // EOF
this.eventHandler.endNonterminal("XQuery", this.e0);
}
parse_Module() {
this.eventHandler.startNonterminal("Module", this.e0);
switch (this.l1) {
case 170:
this.lookahead2W(168); // S^WS | '#' | '(' | '(:' | 'encoding' | 'version'
break;
default:
this.lk = this.l1;
}
if (this.lk == 64682 // 'jsoniq' 'encoding'
|| this.lk == 137898) {
this.parse_VersionDecl();
}
this.lookahead1W(277); // EQName^Token | IntegerLiteral | DecimalLiteral | DoubleLiteral | StringLiteral |
// S^WS | EOF | '$' | '$$' | '%' | '(' | '(#' | '(:' | '+' | '-' | '/' | '//' |
// ';' | '<' | '<!--' | '<?' | '[' | 'after' | 'allowing' | 'ancestor' |
// 'ancestor-or-self' | 'and' | 'append' | 'array' | 'as' | 'ascending' | 'at' |
// 'attribute' | 'base-uri' | 'before' | 'boundary-space' | 'break' | 'case' |
// 'cast' | 'castable' | 'catch' | 'child' | 'collation' | 'comment' |
// 'constraint' | 'construction' | 'context' | 'continue' | 'copy' |
// 'copy-namespaces' | 'count' | 'decimal-format' | 'declare' | 'default' |
// 'delete' | 'descendant' | 'descendant-or-self' | 'descending' | 'div' |
// 'document' | 'document-node' | 'element' | 'else' | 'empty' | 'empty-sequence' |
// 'encoding' | 'end' | 'eq' | 'every' | 'except' | 'exit' | 'external' | 'false' |
// 'first' | 'following' | 'following-sibling' | 'for' | 'from' | 'ft-option' |
// 'function' | 'ge' | 'group' | 'gt' | 'idiv' | 'if' | 'import' | 'in' | 'index' |
// 'insert' | 'instance' | 'integrity' | 'intersect' | 'into' | 'is' | 'item' |
// 'json' | 'json-item' | 'jsoniq' | 'last' | 'lax' | 'le' | 'let' | 'loop' | 'lt' |
// 'mod' | 'modify' | 'module' | 'namespace' | 'namespace-node' | 'ne' | 'node' |
// 'nodes' | 'not' | 'null' | 'object' | 'only' | 'option' | 'or' | 'order' |
// 'ordered' | 'ordering' | 'parent' | 'preceding' | 'preceding-sibling' |
// 'processing-instruction' | 'rename' | 'replace' | 'return' | 'returning' |
// 'revalidation' | 'satisfies' | 'schema' | 'schema-attribute' | 'schema-element' |
// 'score' | 'select' | 'self' | 'sliding' | 'some' | 'stable' | 'start' |
// 'strict' | 'structured-item' | 'switch' | 'text' | 'to' | 'treat' | 'true' |
// 'try' | 'tumbling' | 'type' | 'typeswitch' | 'union' | 'unordered' | 'updating' |
// 'validate' | 'value' | 'variable' | 'version' | 'where' | 'while' | 'with' |
// '{' | '{|'
switch (this.l1) {
case 185:
this.lookahead2W(146); // S^WS | '#' | '(' | '(:' | 'namespace'
break;
default:
this.lk = this.l1;
}
switch (this.lk) {
case 95929:
this.whitespace();
this.parse_LibraryModule();
break;
default:
this.whitespace();
this.parse_MainModule();
}
this.eventHandler.endNonterminal("Module", this.e0);
}
parse_VersionDecl() {
this.eventHandler.startNonterminal("VersionDecl", this.e0);
this.shift(170); // 'jsoniq'
this.lookahead1W(120); // S^WS | '(:' | 'encoding' | 'version'
switch (this.l1) {
case 126:
this.shift(126); // 'encoding'
this.lookahead1W(17); // StringLiteral | S^WS | '(:'
this.shift(11); // StringLiteral
break;
default:
this.shift(269); // 'version'
this.lookahead1W(17); // StringLiteral | S^WS | '(:'
this.shift(11); // StringLiteral
this.lookahead1W(113); // S^WS | '(:' | ';' | 'encoding'
if (this.l1 == 126) {
this.shift(126); // 'encoding'
this.lookahead1W(17); // StringLiteral | S^WS | '(:'
this.shift(11); // StringLiteral
}
}
this.lookahead1W(29); // S^WS | '(:' | ';'
this.whitespace();
this.parse_Separator();
this.eventHandler.endNonterminal("VersionDecl", this.e0);
}
parse_LibraryModule() {
this.eventHandler.startNonterminal("LibraryModule", this.e0);
this.parse_ModuleDecl();
this.lookahead1W(142); // S^WS | EOF | '(:' | 'declare' | 'import'
this.whitespace();
this.parse_Prolog();
this.eventHandler.endNonterminal("LibraryModule", this.e0);
}
parse_ModuleDecl() {
this.eventHandler.startNonterminal("ModuleDecl", this.e0);
this.shift(185); // 'module'
this.lookahead1W(64); // S^WS | '(:' | 'namespace'
this.shift(187); // 'namespace'
this.lookahead1W(239); // NCName^Token | S^WS | '(:' | 'after' | 'allowing' | 'ancestor' |
// 'ancestor-or-self' | 'and' | 'append' | 'as' | 'ascending' | 'at' | 'attribute' |
// 'base-uri' | 'before' | 'boundary-space' | 'break' | 'case' | 'cast' |
// 'castable' | 'catch' | 'child' | 'collation' | 'comment' | 'constraint' |
// 'construction' | 'context' | 'continue' | 'copy' | 'copy-namespaces' | 'count' |
// 'decimal-format' | 'declare' | 'default' | 'delete' | 'descendant' |
// 'descendant-or-self' | 'descending' | 'div' | 'document' | 'document-node' |
// 'element' | 'else' | 'empty' | 'empty-sequence' | 'encoding' | 'end' | 'eq' |
// 'every' | 'except' | 'exit' | 'external' | 'false' | 'first' | 'following' |
// 'following-sibling' | 'for' | 'from' | 'ft-option' | 'function' | 'ge' |
// 'group' | 'gt' | 'idiv' | 'if' | 'import' | 'in' | 'index' | 'insert' |
// 'instance' | 'integrity' | 'intersect' | 'into' | 'is' | 'item' | 'json' |
// 'jsoniq' | 'last' | 'lax' | 'le' | 'let' | 'loop' | 'lt' | 'mod' | 'modify' |
// 'module' | 'namespace' | 'namespace-node' | 'ne' | 'node' | 'nodes' | 'null' |
// 'object' | 'only' | 'option' | 'or' | 'order' | 'ordered' | 'ordering' |
// 'parent' | 'preceding' | 'preceding-sibling' | 'processing-instruction' |
// 'rename' | 'replace' | 'return' | 'returning' | 'revalidation' | 'satisfies' |
// 'schema' | 'schema-attribute' | 'schema-element' | 'score' | 'select' | 'self' |
// 'sliding' | 'some' | 'stable' | 'start' | 'strict' | 'switch' | 'text' | 'to' |
// 'treat' | 'true' | 'try' | 'tumbling' | 'type' | 'typeswitch' | 'union' |
// 'unordered' | 'updating' | 'validate' | 'value' | 'variable' | 'version' |
// 'where' | 'while' | 'with'
this.whitespace();
this.parse_NCName();
this.lookahead1W(30); // S^WS | '(:' | '='
this.shift(61); // '='
this.lookahead1W(15); // URILiteral | S^WS | '(:'
this.shift(7); // URILiteral
this.lookahead1W(29); // S^WS | '(:' | ';'
this.whitespace();
this.parse_Separator();
this.eventHandler.endNonterminal("ModuleDecl", this.e0);
}
parse_Prolog() {
this.eventHandler.startNonterminal("Prolog", this.e0);
for (;;) {
this.lookahead1W(277); // EQName^Token | IntegerLiteral | DecimalLiteral | DoubleLiteral | StringLiteral |
// S^WS | EOF | '$' | '$$' | '%' | '(' | '(#' | '(:' | '+' | '-' | '/' | '//' |
// ';' | '<' | '<!--' | '<?' | '[' | 'after' | 'allowing' | 'ancestor' |
// 'ancestor-or-self' | 'and' | 'append' | 'array' | 'as' | 'ascending' | 'at' |
// 'attribute' | 'base-uri' | 'before' | 'boundary-space' | 'break' | 'case' |
// 'cast' | 'castable' | 'catch' | 'child' | 'collation' | 'comment' |
// 'constraint' | 'construction' | 'context' | 'continue' | 'copy' |
// 'copy-namespaces' | 'count' | 'decimal-format' | 'declare' | 'default' |
// 'delete' | 'descendant' | 'descendant-or-self' | 'descending' | 'div' |
// 'document' | 'document-node' | 'element' | 'else' | 'empty' | 'empty-sequence' |
// 'encoding' | 'end' | 'eq' | 'every' | 'except' | 'exit' | 'external' | 'false' |
// 'first' | 'following' | 'following-sibling' | 'for' | 'from' | 'ft-option' |
// 'function' | 'ge' | 'group' | 'gt' | 'idiv' | 'if' | 'import' | 'in' | 'index' |
// 'insert' | 'instance' | 'integrity' | 'intersect' | 'into' | 'is' | 'item' |
// 'json' | 'json-item' | 'jsoniq' | 'last' | 'lax' | 'le' | 'let' | 'loop' | 'lt' |
// 'mod' | 'modify' | 'module' | 'namespace' | 'namespace-node' | 'ne' | 'node' |
// 'nodes' | 'not' | 'null' | 'object' | 'only' | 'option' | 'or' | 'order' |
// 'ordered' | 'ordering' | 'parent' | 'preceding' | 'preceding-sibling' |
// 'processing-instruction' | 'rename' | 'replace' | 'return' | 'returning' |
// 'revalidation' | 'satisfies' | 'schema' | 'schema-attribute' | 'schema-element' |
// 'score' | 'select' | 'self' | 'sliding' | 'some' | 'stable' | 'start' |
// 'strict' | 'structured-item' | 'switch' | 'text' | 'to' | 'treat' | 'true' |
// 'try' | 'tumbling' | 'type' | 'typeswitch' | 'union' | 'unordered' | 'updating' |
// 'validate' | 'value' | 'variable' | 'version' | 'where' | 'while' | 'with' |
// '{' | '{|'
switch (this.l1) {
case 109:
this.lookahead2W(206); // S^WS | '#' | '%' | '(' | '(:' | 'base-uri' | 'boundary-space' | 'collection' |
// 'construction' | 'context' | 'copy-namespaces' | 'decimal-format' | 'default' |
// 'ft-option' | 'function' | 'index' | 'integrity' | 'namespace' | 'option' |
// 'ordering' | 'revalidation' | 'updating' | 'variable'
break;
case 155:
this.lookahead2W(169); // S^WS | '#' | '(' | '(:' | 'module' | 'schema'
break;
default:
this.lk = this.l1;
}
if (this.lk != 43117 // 'declare' 'base-uri'
&& this.lk != 44141 // 'declare' 'boundary-space'
&& this.lk != 50797 // 'declare' 'construction'
&& this.lk != 53869 // 'declare' 'copy-namespaces'
&& this.lk != 54893 // 'declare' 'decimal-format'
&& this.lk != 56429 // 'declare' 'default'
&& this.lk != 73325 // 'declare' 'ft-option'
&& this.lk != 94875 // 'import' 'module'
&& this.lk != 95853 // 'declare' 'namespace'
&& this.lk != 106093 // 'declare' 'ordering'
&& this.lk != 115821 // 'declare' 'revalidation'
&& this.lk != 117403) {
break;
}
switch (this.l1) {
case 109:
this.lookahead2W(200); // S^WS | '(:' | 'base-uri' | 'boundary-space' | 'construction' |
// 'copy-namespaces' | 'decimal-format' | 'default' | 'ft-option' | 'namespace' |
// 'ordering' | 'revalidation'
break;
default:
this.lk = this.l1;
}
if (this.lk == 56429) {
this.lk = this.memoized(0, this.e0);
if (this.lk == 0) {
var b0A = this.b0;
var e0A = this.e0;
var l1A = this.l1;
var b1A = this.b1;
var e1A = this.e1;
var l2A = this.l2;
var b2A = this.b2;
var e2A = this.e2;
try {
this.try_DefaultNamespaceDecl();
this.lk = -1;
}
catch (p1A) {
this.lk = -2;
}
this.b0 = b0A;
this.e0 = e0A;
this.l1 = l1A;
if (this.l1 == 0) {
this.end = e0A;
}
else {
this.b1 = b1A;
this.e1 = e1A;
this.l2 = l2A;
if (this.l2 == 0) {
this.end = e1A;
}
else {
this.b2 = b2A;
this.e2 = e2A;
this.end = e2A;
}
}
this.memoize(0, this.e0, this.lk);
}
}
switch (this.lk) {
case -1:
this.whitespace();
this.parse_DefaultNamespaceDecl();
break;
case 95853:
this.whitespace();
this.parse_NamespaceDecl();
break;
case 155:
this.whitespace();
this.parse_Import();
break;
case 73325:
this.whitespace();
this.parse_FTOptionDecl();
break;
default:
this.whitespace();
this.parse_Setter();
}
this.lookahead1W(29); // S^WS | '(:' | ';'
this.whitespace();
this.parse_Separator();
}
for (;;) {
this.lookahead1W(277); // EQName^Token | IntegerLiteral | DecimalLiteral | DoubleLiteral | StringLiteral |
// S^WS | EOF | '$' | '$$' | '%' | '(' | '(#' | '(:' | '+' | '-' | '/' | '//' |
// ';' | '<' | '<!--' | '<?' | '[' | 'after' | 'allowing' | 'ancestor' |
// 'ancestor-or-self' | 'and' | 'append' | 'array' | 'as' | 'ascending' | 'at' |
// 'attribute' | 'base-uri' | 'before' | 'boundary-space' | 'break' | 'case' |
// 'cast' | 'castable' | 'catch' | 'child' | 'collation' | 'comment' |
// 'constraint' | 'construction' | 'context' | 'continue' | 'copy' |
// 'copy-namespaces' | 'count' | 'decimal-format' | 'declare' | 'default' |
// 'delete' | 'descendant' | 'descendant-or-self' | 'descending' | 'div' |
// 'document' | 'document-node' | 'element' | 'else' | 'empty' | 'empty-sequence' |
// 'encoding' | 'end' | 'eq' | 'every' | 'except' | 'exit' | 'external' | 'false' |
// 'first' | 'following' | 'following-sibling' | 'for' | 'from' | 'ft-option' |
// 'function' | 'ge' | 'group' | 'gt' | 'idiv' | 'if' | 'import' | 'in' | 'index' |
// 'insert' | 'instance' | 'integrity' | 'intersect' | 'into' | 'is' | 'item' |
// 'json' | 'json-item' | 'jsoniq' | 'last' | 'lax' | 'le' | 'let' | 'loop' | 'lt' |
// 'mod' | 'modify' | 'module' | 'namespace' | 'namespace-node' | 'ne' | 'node' |
// 'nodes' | 'not' | 'null' | 'object' | 'only' | 'option' | 'or' | 'order' |
// 'ordered' | 'ordering' | 'parent' | 'preceding' | 'preceding-sibling' |
// 'processing-instruction' | 'rename' | 'replace' | 'return' | 'returning' |
// 'revalidation' | 'satisfies' | 'schema' | 'schema-attribute' | 'schema-element' |
// 'score' | 'select' | 'self' | 'sliding' | 'some' | 'stable' | 'start' |
// 'strict' | 'structured-item' | 'switch' | 'text' | 'to' | 'treat' | 'true' |
// 'try' | 'tumbling' | 'type' | 'typeswitch' | 'union' | 'unordered' | 'updating' |
// 'validate' | 'value' | 'variable' | 'version' | 'where' | 'while' | 'with' |
// '{' | '{|'
switch (this.l1) {
case 109:
this.lookahead2W(201); // S^WS | '#' | '%' | '(' | '(:' | 'collection' | 'context' | 'function' | 'index' |
// 'integrity' | 'option' | 'updating' | 'variable'
break;
default:
this.lk = this.l1;
}
if (this.lk != 17005 // 'declare' '%'
&& this.lk != 49261 // 'declare' 'collection'
&& this.lk != 52333 // 'declare' 'context'
&& this.lk != 75373 // 'declare' 'function'
&& this.lk != 80493 // 'declare' 'index'
&& this.lk != 83565 // 'declare' 'integrity'
&& this.lk != 104045 // 'declare' 'option'
&& this.lk != 134765 // 'declare' 'updating'
&& this.lk != 137325) {
break;
}
switch (this.l1) {
case 109:
this.lookahead2W(197); // S^WS | '%' | '(:' | 'collection' | 'context' | 'function' | 'index' |
// 'integrity' | 'option' | 'updating' | 'variable'
break;
default:
this.lk = this.l1;
}
switch (this.lk) {
case 52333:
this.whitespace();
this.parse_ContextItemDecl();
break;
case 104045:
this.whitespace();
this.parse_OptionDecl();
break;
default:
this.whitespace();
this.parse_AnnotatedDecl();
}
this.lookahead1W(29); // S^WS | '(:' | ';'
this.whitespace();
this.parse_Separator();
}
this.eventHandler.endNonterminal("Prolog", this.e0);
}
parse_Separator() {
this.eventHandler.startNonterminal("Separator", this.e0);
this.shift(54); // ';'
this.eventHandler.endNonterminal("Separator", this.e0);
}
parse_Setter() {
this.eventHandler.startNonterminal("Setter", this.e0);
switch (this.l1) {
case 109:
this.lookahead2W(194); // S^WS | '(:' | 'base-uri' | 'boundary-space' | 'construction' |
// 'copy-namespaces' | 'decimal-format' | 'default' | 'ordering' | 'revalidation'
break;
default:
this.lk = this.l1;
}
if (this.lk == 56429) {
this.lk = this.memoized(1, this.e0);
if (this.lk == 0) {
var b0A = this.b0;
var e0A = this.e0;
var l1A = this.l1;
var b1A = this.b1;
var e1A = this.e1;
var l2A = this.l2;
var b2A = this.b2;
var e2A = this.e2;
try {
this.try_DefaultCollationDecl();
this.lk = -2;
}
catch (p2A) {
try {
this.b0 = b0A;
this.e0 = e0A;
this.l1 = l1A;
if (this.l1 == 0) {
this.end = e0A;
}
else {
this.b1 = b1A;
this.e1 = e1A;
this.l2 = l2A;
if (this.l2 == 0) {
this.end = e1A;
}
else {
this.b2 = b2A;
this.e2 = e2A;
this.end = e2A;
}
}
this.try_EmptyOrderDecl();
this.lk = -6;
}
catch (p6A) {
this.lk = -9;
}
}
this.b0 = b0A;
this.e0 = e0A;
this.l1 = l1A;
if (this.l1 == 0) {
this.end = e0A;
}
else {
this.b1 = b1A;
this.e1 = e1A;
this.l2 = l2A;
if (this.l2 == 0) {
this.end = e1A;
}
else {
this.b2 = b2A;
this.e2 = e2A;
this.end = e2A;
}
}
this.memoize(1, this.e0, this.lk);
}
}
switch (this.lk) {
case 44141:
this.parse_BoundarySpaceDecl();
break;
case -2:
this.parse_DefaultCollationDecl();
break;
case 43117:
this.parse_BaseURIDecl();
break;
case 50797:
this.parse_ConstructionDecl();
break;
case 106093:
this.parse_OrderingModeDecl();
break;
case -6:
this.parse_EmptyOrderDecl();
break;
case 115821:
this.parse_RevalidationDecl();
break;
case 53869:
this.parse_CopyNamespacesDecl();
break;
default:
this.parse_DecimalFormatDecl();
}
this.eventHandler.endNonterminal("Setter", this.e0);
}
parse_BoundarySpaceDecl() {
this.eventHandler.startNonterminal("BoundarySpaceDecl", this.e0);
this.shift(109); // 'declare'
this.lookahead1W(36); // S^WS | '(:' | 'boundary-space'
this.shift(86); // 'boundary-space'
this.lookahead1W(137); // S^WS | '(:' | 'preserve' | 'strip'
switch (this.l1) {
case 218:
this.shift(218); // 'preserve'
break;
default:
this.shift(246); // 'strip'
}
this.eventHandler.endNonterminal("BoundarySpaceDecl", this.e0);
}
parse_DefaultCollationDecl() {
this.eventHandler.startNonterminal("DefaultCollationDecl", this.e0);
this.shift(109); // 'declare'
this.lookahead1W(49); // S^WS | '(:' | 'default'
this.shift(110); // 'default'
this.lookahead1W(41); // S^WS | '(:' | 'collation'
this.shift(95); // 'collation'
this.lookahead1W(15); // URILiteral | S^WS | '(:'
this.shift(7); // URILiteral
this.eventHandler.endNonterminal("DefaultCollationDecl", this.e0);
}
try_DefaultCollationDecl() {
this.shiftT(109); // 'declare'
this.lookahead1W(49); // S^WS | '(:' | 'default'
this.shiftT(110); // 'default'
this.lookahead1W(41); // S^WS | '(:' | 'collation'
this.shiftT(95); // 'collation'
this.lookahead1W(15); // URILiteral | S^WS | '(:'
this.shiftT(7); // URILiteral
}
parse_BaseURIDecl() {
this.eventHandler.startNonterminal("BaseURIDecl", this.e0);
this.shift(109); // 'declare'
this.lookahead1W(35); // S^WS | '(:' | 'base-uri'
this.shift(84); // 'base-uri'
this.lookahead1W(15); // URILiteral | S^WS | '(:'
this.shift(7); // URILiteral
this.eventHandler.endNonterminal("BaseURIDecl", this.e0);
}
parse_ConstructionDecl() {
this.eventHandler.startNonterminal("ConstructionDecl", this.e0);
this.shift(109); // 'declare'
this.lookahead1W(44); // S^WS | '(:' | 'construction'
this.shift(99); // 'construction'
this.lookahead1W(137); // S^WS | '(:' | 'preserve' | 'strip'
switch (this.l1) {
case 246:
this.shift(246); // 'strip'
break;
default:
this.shift(218); // 'preserve'
}
this.eventHandler.endNonterminal("ConstructionDecl", this.e0);
}
parse_OrderingModeDecl() {
this.eventHandler.startNonterminal("OrderingModeDecl", this.e0);
this.shift(109); // 'declare'
this.lookahead1W(71); // S^WS | '(:' | 'ordering'
this.shift(207); // 'ordering'
this.lookahead1W(135); // S^WS | '(:' | 'ordered' | 'unordered'
switch (this.l1) {
case 206:
this.shift(206); // 'ordered'
break;
default:
this.shift(262); // 'unordered'
}
this.eventHandler.endNonterminal("OrderingModeDecl", this.e0);
}
parse_EmptyOrderDecl() {
this.eventHandler.startNonterminal("EmptyOrderDecl", this.e0);
this.shift(109); // 'declare'
this.lookahead1W(49); // S^WS | '(:' | 'default'
this.shift(110); // 'default'
this.lookahead1W(70); // S^WS | '(:' | 'order'
this.shift(205); // 'order'
this.lookahead1W(52); // S^WS | '(:' | 'empty'
this.shift(124); // 'empty'
this.lookahead1W(125); // S^WS | '(:' | 'greatest' | 'least'
switch (this.l1) {
case 149:
this.shift(149); // 'greatest'
break;
default:
this.shift(176); // 'least'
}
this.eventHandler.endNonterminal("EmptyOrderDecl", this.e0);
}
try_EmptyOrderDecl() {
this.shiftT(109); // 'declare'
this.lookahead1W(49); // S^WS | '(:' | 'default'
this.shiftT(110); // 'default'
this.lookahead1W(70); // S^WS | '(:' | 'order'
this.shiftT(205); // 'order'
this.lookahead1W(52); // S^WS | '(:' | 'empty'
this.shiftT(124); // 'empty'
this.lookahead1W(125); // S^WS | '(:' | 'greatest' | 'least'
switch (this.l1) {
case 149:
this.shiftT(149); // 'greatest'
break;
default:
this.shiftT(176); // 'least'
}
}
parse_CopyNamespacesDecl() {
this.eventHandler.startNonterminal("CopyNamespacesDecl", this.e0);
this.shift(109); // 'declare'
this.lookahead1W(47); // S^WS | '(:' | 'copy-namespaces'
this.shift(105); // 'copy-namespaces'
this.lookahead1W(132); // S^WS | '(:' | 'no-preserve' | 'preserve'
this.whitespace();
this.parse_PreserveMode();
this.lookahead1W(25); // S^WS | '(:' | ','
this.shift(42); // ','
this.lookahead1W(127); // S^WS | '(:' | 'inherit' | 'no-inherit'
this.whitespace();
this.parse_InheritMode();
this.eventHandler.endNonterminal("CopyNamespacesDecl", this.e0);
}
parse_PreserveMode() {
this.eventHandler.startNonterminal("PreserveMode", this.e0);
switch (this.l1) {
case 218:
this.shift(218); // 'preserve'
break;
default:
this.shift(193); // 'no-preserve'
}
this.eventHandler.endNonterminal("PreserveMode", this.e0);
}
parse_InheritMode() {
this.eventHandler.startNonterminal("InheritMode", this.e0);
switch (this.l1) {
case 159:
this.shift(159); // 'inherit'
break;
default:
this.shift(192); // 'no-inherit'
}
this.eventHandler.endNonterminal("InheritMode", this.e0);
}
parse_DecimalFormatDecl() {
this.eventHandler.startNonterminal("DecimalFormatDecl", this.e0);
this.shift(109); // 'declare'
this.lookahead1W(118); // S^WS | '(:' | 'decimal-format' | 'default'
switch (this.l1) {
case 107:
this.shift(107); // 'decimal-format'
this.lookahead1W(245); // EQName^Token | S^WS | '(:' | 'after' | 'allowing' | 'ancestor' |
// 'ancestor-or-self' | 'and' | 'append' | 'array' | 'as' | 'ascending' | 'at' |
// 'attribute' | 'base-uri' | 'before' | 'boundary-space' | 'break' | 'case' |
// 'cast' | 'castable' | 'catch' | 'child' | 'collation' | 'comment' |
// 'constraint' | 'construction' | 'context' | 'continue' | 'copy' |
// 'copy-namespaces' | 'count' | 'decimal-format' | 'declare' | 'default' |
// 'delete' | 'descendant' | 'descendant-or-self' | 'descending' | 'div' |
// 'document' | 'document-node' | 'element' | 'else' | 'empty' | 'empty-sequence' |
// 'encoding' | 'end' | 'eq' | 'every' | 'except' | 'exit' | 'external' | 'false' |
// 'first' | 'following' | 'following-sibling' | 'for' | 'from' | 'ft-option' |
// 'function' | 'ge' | 'group' | 'gt' | 'idiv' | 'if' | 'import' | 'in' | 'index' |
// 'insert' | 'instance' | 'integrity' | 'intersect' | 'into' | 'is' | 'item' |
// 'json' | 'json-item' | 'jsoniq' | 'last' | 'lax' | 'le' | 'let' | 'loop' | 'lt' |
// 'mod' | 'modify' | 'module' | 'namespace' | 'namespace-node' | 'ne' | 'node' |
// 'nodes' | 'null' | 'object' | 'only' | 'option' | 'or' | 'order' | 'ordered' |
// 'ordering' | 'parent' | 'preceding' | 'preceding-sibling' |
// 'processing-instruction' | 'rename' | 'replace' | 'return' | 'returning' |
// 'revalidation' | 'satisfies' | 'schema' | 'schema-attribute' | 'schema-element' |
// 'score' | 'select' | 'self' | 'sliding' | 'some' | 'stable' | 'start' |
// 'strict' | 'structured-item' | 'switch' | 'text' | 'to' | 'treat' | 'true' |
// 'try' | 'tumbling' | 'type' | 'typeswitch' | 'union' | 'unordered' | 'updating' |
// 'validate' | 'value' | 'variable' | 'version' | 'where' | 'while' | 'with'
this.whitespace();
this.parse_EQName();
break;
default:
this.shift(110); // 'default'
this.lookahead1W(48); // S^WS | '(:' | 'decimal-format'
this.shift(107); // 'decimal-format'
}
for (;;) {
this.lookahead1W(203); // S^WS | '(:' | ';' | 'NaN' | 'decimal-separator' | 'digit' |
// 'grouping-separator' | 'infinity' | 'minus-sign' | 'pattern-separator' |
// 'per-mille' | 'percent' | 'zero-digit'
if (this.l1 == 54) {
break;
}
this.whitespace();
this.parse_DFPropertyName();
this.lookahead1W(30); // S^WS | '(:' | '='
this.shift(61); // '='
this.lookahead1W(17); // StringLiteral | S^WS | '(:'
this.shift(11); // StringLiteral
}
this.eventHandler.endNonterminal("DecimalFormatDecl", this.e0);
}
parse_DFPropertyName() {
this.eventHandler.startNonterminal("DFPropertyName", this.e0);
switch (this.l1) {
case 108:
this.shift(108); // 'decimal-separator'
break;
case 151:
this.shift(151); // 'grouping-separator'
break;
case 158:
this.shift(158); // 'infinity'
break;
case 182:
this.shift(182); // 'minus-sign'
break;
case 68:
this.shift(68); // 'NaN'
break;
case 213:
this.shift(213); // 'percent'
break;
case 212:
this.shift(212); // 'per-mille'
break;
case 280:
this.shift(280); // 'zero-digit'
break;
case 117:
this.shift(117); // 'digit'
break;
default:
this.shift(211); // 'pattern-separator'
}
this.eventHandler.endNonterminal("DFPropertyName", this.e0);
}
parse_Import() {
this.eventHandler.startNonterminal("Import", this.e0);
switch (this.l1) {
case 155:
this.lookahead2W(130); // S^WS | '(:' | 'module' | 'schema'
break;
default:
this.lk = this.l1;
}
switch (this.lk) {
case 117403:
this.parse_SchemaImport();
break;
default:
this.parse_ModuleImport();
}
this.eventHandler.endNonterminal("Import", this.e0);
}
parse_SchemaImport() {
this.eventHandler.startNonterminal("SchemaImport", this.e0);
this.shift(155); // 'import'
this.lookahead1W(76); // S^WS | '(:' | 'schema'
this.shift(229); // 'schema'
this.lookahead1W(141); // URILiteral | S^WS | '(:' | 'default' | 'namespace'
if (this.l1 != 7) {
this.whitespace();
this.parse_SchemaPrefix();
}
this.lookahead1W(15); // URILiteral | S^WS | '(:'
this.shift(7); // URILiteral
this.lookahead1W(112); // S^WS | '(:' | ';' | 'at'
if (this.l1 == 82) {
this.shift(82); // 'at'
this.lookahead1W(15); // URILiteral | S^WS | '(:'
this.shift(7); // URILiteral
for (;;) {
this.lookahead1W(107); // S^WS | '(:' | ',' | ';'
if (this.l1 != 42) {
break;
}
this.shift(42); // ','
this.lookahead1W(15); // URILiteral | S^WS | '(:'
this.shift(7); // URILiteral
}
}
this.eventHandler.endNonterminal("SchemaImport", this.e0);
}
parse_SchemaPrefix() {
this.eventHandler.startNonterminal("SchemaPrefix", this.e0);
switch (this.l1) {
case 187:
this.shift(187); // 'namespace'
this.lookahead1W(239); // NCName^Token | S^WS | '(:' | 'after' | 'allowing' | 'ancestor' |
// 'ancestor-or-self' | 'and' | 'append' | 'as' | 'ascending' | 'at' | 'attribute' |
// 'base-uri' | 'before' | 'boundary-space' | 'break' | 'case' | 'cast' |
// 'castable' | 'catch' | 'child' | 'collation' | 'comment' | 'constraint' |
// 'construction' | 'context' | 'continue' | 'copy' | 'copy-namespaces' | 'count' |
// 'decimal-format' | 'declare' | 'default' | 'delete' | 'descendant' |
// 'descendant-or-self' | 'descending' | 'div' | 'document' | 'document-node' |
// 'element' | 'else' | 'empty' | 'empty-sequence' | 'encoding' | 'end' | 'eq' |
// 'every' | 'except' | 'exit' | 'external' | 'false' | 'first' | 'following' |
// 'following-sibling' | 'for' | 'from' | 'ft-option' | 'function' | 'ge' |
// 'group' | 'gt' | 'idiv' | 'if' | 'import' | 'in' | 'index' | 'insert' |
// 'instance' | 'integrity' | 'intersect' | 'into' | 'is' | 'item' | 'json' |
// 'jsoniq' | 'last' | 'lax' | 'le' | 'let' | 'loop' | 'lt' | 'mod' | 'modify' |
// 'module' | 'namespace' | 'namespace-node' | 'ne' | 'node' | 'nodes' | 'null' |
// 'object' | 'only' | 'option' | 'or' | 'order' | 'ordered' | 'ordering' |
// 'parent' | 'preceding' | 'preceding-sibling' | 'processing-instruction' |
// 'rename' | 'replace' | 'return' | 'returning' | 'revalidation' | 'satisfies' |
// 'schema' | 'schema-attribute' | 'schema-element' | 'score' | 'select' | 'self' |
// 'sliding' | 'some' | 'stable' | 'start' | 'strict' | 'switch' | 'text' | 'to' |
// 'treat' | 'true' | 'try' | 'tumbling' | 'type' | 'typeswitch' | 'union' |
// 'unordered' | 'updating' | 'validate' | 'value' | 'variable' | 'version' |
// 'where' | 'while' | 'with'
this.whitespace();
this.parse_NCName();
this.lookahead1W(30); // S^WS | '(:' | '='
this.shift(61); // '='
break;
default:
this.shift(110); // 'default'
this.lookahead1W(50); // S^WS | '(:' | 'element'
this.shift(122); // 'element'
this.lookahead1W(64); // S^WS | '(:' | 'namespace'
this.shift(187); // 'namespace'
}
this.eventHandler.endNonterminal("SchemaPrefix", this.e0);
}
parse_ModuleImport() {
this.eventHandler.startNonterminal("ModuleImport", this.e0);
this.shift(155); // 'import'
this.lookahead1W(63); // S^WS | '(:' | 'module'
this.shift(185); // 'module'
this.lookahead1W(93); // URILiteral | S^WS | '(:' | 'namespace'
if (this.l1 == 187) {
this.shift(187); // 'namespace'
this.lookahead1W(239); // NCName^Token | S^WS | '(:' | 'after' | 'allowing' | 'ancestor' |
// 'ancestor-or-self' | 'and' | 'append' | 'as' | 'ascending' | 'at' | 'attribute' |
// 'base-uri' | 'before' | 'boundary-space' | 'break' | 'case' | 'cast' |
// 'castable' | 'catch' | 'child' | 'collation' | 'comment' | 'constraint' |
// 'construction' | 'context' | 'continue' | 'copy' | 'copy-namespaces' | 'count' |
// 'decimal-format' | 'declare' | 'default' | 'delete' | 'descendant' |
// 'descendant-or-self' | 'descending' | 'div' | 'document' | 'document-node' |
// 'element' | 'else' | 'empty' | 'empty-sequence' | 'encoding' | 'end' | 'eq' |
// 'every' | 'except' | 'exit' | 'external' | 'false' | 'first' | 'following' |
// 'following-sibling' | 'for' | 'from' | 'ft-option' | 'function' | 'ge' |
// 'group' | 'gt' | 'idiv' | 'if' | 'import' | 'in' | 'index' | 'insert' |
// 'instance' | 'integrity' | 'intersect' | 'into' | 'is' | 'item' | 'json' |
// 'jsoniq' | 'last' | 'lax' | 'le' | 'let' | 'loop' | 'lt' | 'mod' | 'modify' |
// 'module' | 'namespace' | 'namespace-node' | 'ne' | 'node' | 'nodes' | 'null' |
// 'object' | 'only' | 'option' | 'or' | 'order' | 'ordered' | 'ordering' |
// 'parent' | 'preceding' | 'preceding-sibling' | 'processing-instruction' |
// 'rename' | 'replace' | 'return' | 'returning' | 'revalidation' | 'satisfies' |
// 'schema' | 'schema-attribute' | 'schema-element' | 'score' | 'select' | 'self' |
// 'sliding' | 'some' | 'stable' | 'start' | 'strict' | 'switch' | 'text' | 'to' |
// 'treat' | 'true' | 'try' | 'tumbling' | 'type' | 'typeswitch' | 'union' |
// 'unordered' | 'updating' | 'validate' | 'value' | 'variable' | 'version' |
// 'where' | 'while' | 'with'
this.whitespace();
this.parse_NCName();
this.lookahead1W(30); // S^WS | '(:' | '='
this.shift(61); // '='
}
this.lookahead1W(15); // URILiteral | S^WS | '(:'
this.shift(7); // URILiteral
this.lookahead1W(112); // S^WS | '(:' | ';' | 'at'
if (this.l1 == 82) {
this.shift(82); // 'at'
this.lookahead1W(15); // URILiteral | S^WS | '(:'
this.shift(7); // URILiteral
for (;;) {
this.lookahead1W(107); // S^WS | '(:' | ',' | ';'
if (this.l1 != 42) {
break;
}
this.shift(42); // ','
this.lookahead1W(15); // URILiteral | S^WS | '(:'
this.shift(7); // URILiteral
}
}
this.eventHandler.endNonterminal("ModuleImport", this.e0);
}
parse_NamespaceDecl() {
this.eventHandler.startNonterminal("NamespaceDecl", this.e0);
this.shift(109); // 'declare'
this.lookahead1W(64); // S^WS | '(:' | 'namespace'
this.shift(187); // 'namespace'
this.lookahead1W(239); // NCName^Token | S^WS | '(:' | 'after' | 'allowing' | 'ancestor' |
// 'ancestor-or-self' | 'and' | 'append' | 'as' | 'ascending' | 'at' | 'attribute' |
// 'base-uri' | 'before' | 'boundary-space' | 'break' | 'case' | 'cast' |
// 'castable' | 'catch' | 'child' | 'collation' | 'comment' | 'constraint' |
// 'construction' | 'context' | 'continue' | 'copy' | 'copy-namespaces' | 'count' |
// 'decimal-format' | 'declare' | 'default' | 'delete' | 'descendant' |
// 'descendant-or-self' | 'descending' | 'div' | 'document' | 'document-node' |
// 'element' | 'else' | 'empty' | 'empty-sequence' | 'encoding' | 'end' | 'eq' |
// 'every' | 'except' | 'exit' | 'external' | 'false' | 'first' | 'following' |
// 'following-sibling' | 'for' | 'from' | 'ft-option' | 'function' | 'ge' |
// 'group' | 'gt' | 'idiv' | 'if' | 'import' | 'in' | 'index' | 'insert' |
// 'instance' | 'integrity' | 'intersect' | 'into' | 'is' | 'item' | 'json' |
// 'jsoniq' | 'last' | 'lax' | 'le' | 'let' | 'loop' | 'lt' | 'mod' | 'modify' |
// 'module' | 'namespace' | 'namespace-node' | 'ne' | 'node' | 'nodes' | 'null' |
// 'object' | 'only' | 'option' | 'or' | 'order' | 'ordered' | 'ordering' |
// 'parent' | 'preceding' | 'preceding-sibling' | 'processing-instruction' |
// 'rename' | 'replace' | 'return' | 'returning' | 'revalidation' | 'satisfies' |
// 'schema' | 'schema-attribute' | 'schema-element' | 'score' | 'select' | 'self' |
// 'sliding' | 'some' | 'stable' | 'start' | 'strict' | 'switch' | 'text' | 'to' |
// 'treat' | 'true' | 'try' | 'tumbling' | 'type' | 'typeswitch' | 'union' |
// 'unordered' | 'updating' | 'validate' | 'value' | 'variable' | 'version' |
// 'where' | 'while' | 'with'
this.whitespace();
this.parse_NCName();
this.lookahead1W(30); // S^WS | '(:' | '='
this.shift(61); // '='
this.lookahead1W(15); // URILiteral | S^WS | '(:'
this.shift(7); // URILiteral
this.eventHandler.endNonterminal("NamespaceDecl", this.e0);
}
parse_DefaultNamespaceDecl() {
this.eventHandler.startNonterminal("DefaultNamespaceDecl", this.e0);
this.shift(109); // 'declare'
this.lookahead1W(49); // S^WS | '(:' | 'default'
this.shift(110); // 'default'
this.lookahead1W(119); // S^WS | '(:' | 'element' | 'function'
switch (this.l1) {
case 122:
this.shift(122); // 'element'
break;
default:
this.shift(147); // 'function'
}
this.lookahead1W(64); // S^WS | '(:' | 'namespace'
this.shift(187); // 'namespace'
this.lookahead1W(15); // URILiteral | S^WS | '(:'
this.shift(7); // URILiteral
this.eventHandler.endNonterminal("DefaultNamespaceDecl", this.e0);
}
try_DefaultNamespaceDecl() {
this.shiftT(109); // 'declare'
this.lookahead1W(49); // S^WS | '(:' | 'default'
this.shiftT(110); // 'default'
this.lookahead1W(119); // S^WS | '(:' | 'element' | 'function'
switch (this.l1) {
case 122:
this.shiftT(122); // 'element'
break;
default:
this.shiftT(147); // 'function'
}
this.lookahead1W(64); // S^WS | '(:' | 'namespace'
this.shiftT(187); // 'namespace'
this.lookahead1W(15); // URILiteral | S^WS | '(:'
this.shiftT(7); // URILiteral
}
parse_FTOptionDecl() {
this.eventHandler.startNonterminal("FTOptionDecl", this.e0);
this.shift(109); // 'declare'
this.lookahead1W(55); // S^WS | '(:' | 'ft-option'
this.shift(143); // 'ft-option'
this.lookahead1W(84); // S^WS | '(:' | 'using'
this.whitespace();
this.parse_FTMatchOptions();
this.eventHandler.endNonterminal("FTOptionDecl", this.e0);
}
parse_AnnotatedDecl() {
this.eventHandler.startNonterminal("AnnotatedDecl", this.e0);
this.shift(109); // 'declare'
for (;;) {
this.lookahead1W(192); // S^WS | '%' | '(:' | 'collection' | 'function' | 'index' | 'integrity' |
// 'updating' | 'variable'
if (this.l1 != 33 // '%'
&& this.l1 != 263) {
break;
}
switch (this.l1) {
case 263:
this.whitespace();
this.parse_CompatibilityAnnotation();
break;
default:
this.whitespace();
this.parse_Annotation();
}
}
switch (this.l1) {
case 268:
this.whitespace();
this.parse_VarDecl();
break;
case 147:
this.whitespace();
this.parse_FunctionDecl();
break;
case 96:
this.whitespace();
this.parse_CollectionDec