jsoniq
Version:
JSONiq implementation for JavaScript
1,008 lines • 7.68 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: XQueryParser.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(274); // Wildcard | 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' | 'first' | 'following' | 'following-sibling' | 'for' |
// 'ft-option' | 'function' | 'ge' | 'group' | 'gt' | 'idiv' | 'if' | 'import' |
// 'in' | 'index' | 'insert' | 'instance' | 'integrity' | 'intersect' | 'into' |
// 'is' | 'item' | 'json' | 'json-item' | 'last' | 'lax' | 'le' | 'let' | 'loop' |
// 'lt' | 'mod' | 'modify' | 'module' | 'namespace' | 'namespace-node' | 'ne' |
// 'node' | 'nodes' | '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' | 'self' | 'sliding' | 'some' | 'stable' | 'start' | 'strict' |
// 'structured-item' | 'switch' | 'text' | 'to' | 'treat' | 'try' | 'tumbling' |
// 'type' | 'typeswitch' | 'union' | 'unordered' | 'updating' | 'validate' |
// 'value' | 'variable' | 'version' | 'where' | 'while' | 'with' | 'xquery' | '{' |
// '{|'
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 274:
this.lookahead2W(198); // S^WS | EOF | '!' | '!=' | '#' | '(' | '(:' | '*' | '+' | ',' | '-' | '/' | '//' |
// ';' | '<' | '<<' | '<=' | '=' | '>' | '>=' | '>>' | '[' | 'and' | 'cast' |
// 'castable' | 'contains' | 'div' | 'encoding' | 'eq' | 'except' | 'ge' | 'gt' |
// 'idiv' | 'instance' | 'intersect' | 'is' | 'le' | 'lt' | 'mod' | 'ne' | 'or' |
// 'to' | 'treat' | 'union' | 'version' | '|' | '||'
break;
default:
this.lk = this.l1;
}
if (this.lk == 64274 // 'xquery' 'encoding'
|| this.lk == 134930) {
this.parse_VersionDecl();
}
this.lookahead1W(274); // Wildcard | 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' | 'first' | 'following' | 'following-sibling' | 'for' |
// 'ft-option' | 'function' | 'ge' | 'group' | 'gt' | 'idiv' | 'if' | 'import' |
// 'in' | 'index' | 'insert' | 'instance' | 'integrity' | 'intersect' | 'into' |
// 'is' | 'item' | 'json' | 'json-item' | 'last' | 'lax' | 'le' | 'let' | 'loop' |
// 'lt' | 'mod' | 'modify' | 'module' | 'namespace' | 'namespace-node' | 'ne' |
// 'node' | 'nodes' | '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' | 'self' | 'sliding' | 'some' | 'stable' | 'start' | 'strict' |
// 'structured-item' | 'switch' | 'text' | 'to' | 'treat' | 'try' | 'tumbling' |
// 'type' | 'typeswitch' | 'union' | 'unordered' | 'updating' | 'validate' |
// 'value' | 'variable' | 'version' | 'where' | 'while' | 'with' | 'xquery' | '{' |
// '{|'
switch (this.l1) {
case 182:
this.lookahead2W(193); // S^WS | EOF | '!' | '!=' | '#' | '(' | '(:' | '*' | '+' | ',' | '-' | '/' | '//' |
// ';' | '<' | '<<' | '<=' | '=' | '>' | '>=' | '>>' | '[' | 'and' | 'cast' |
// 'castable' | 'contains' | 'div' | 'eq' | 'except' | 'ge' | 'gt' | 'idiv' |
// 'instance' | 'intersect' | 'is' | 'le' | 'lt' | 'mod' | 'namespace' | 'ne' |
// 'or' | 'to' | 'treat' | 'union' | '|' | '||'
break;
default:
this.lk = this.l1;
}
switch (this.lk) {
case 94390:
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(274); // 'xquery'
this.lookahead1W(116); // S^WS | '(:' | 'encoding' | 'version'
switch (this.l1) {
case 125:
this.shift(125); // 'encoding'
this.lookahead1W(17); // StringLiteral | S^WS | '(:'
this.shift(11); // StringLiteral
break;
default:
this.shift(263); // 'version'
this.lookahead1W(17); // StringLiteral | S^WS | '(:'
this.shift(11); // StringLiteral
this.lookahead1W(109); // S^WS | '(:' | ';' | 'encoding'
if (this.l1 == 125) {
this.shift(125); // 'encoding'
this.lookahead1W(17); // StringLiteral | S^WS | '(:'
this.shift(11); // StringLiteral
}
}
this.lookahead1W(28); // 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(138); // 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(182); // 'module'
this.lookahead1W(61); // S^WS | '(:' | 'namespace'
this.shift(184); // 'namespace'
this.lookahead1W(248); // 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' | 'first' | 'following' |
// 'following-sibling' | 'for' | 'ft-option' | 'function' | 'ge' | 'group' | 'gt' |
// 'idiv' | 'if' | 'import' | 'in' | 'index' | 'insert' | 'instance' | 'integrity' |
// 'intersect' | 'into' | 'is' | 'item' | 'json' | 'last' | 'lax' | 'le' | 'let' |
// 'loop' | 'lt' | 'mod' | 'modify' | 'module' | 'namespace' | 'namespace-node' |
// 'ne' | 'node' | 'nodes' | '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' | 'self' | 'sliding' | 'some' | 'stable' | 'start' | 'strict' |
// 'switch' | 'text' | 'to' | 'treat' | 'try' | 'tumbling' | 'type' | 'typeswitch' |
// 'union' | 'unordered' | 'updating' | 'validate' | 'value' | 'variable' |
// 'version' | 'where' | 'while' | 'with' | 'xquery'
this.whitespace();
this.parse_NCName();
this.lookahead1W(29); // S^WS | '(:' | '='
this.shift(60); // '='
this.lookahead1W(15); // URILiteral | S^WS | '(:'
this.shift(7); // URILiteral
this.lookahead1W(28); // S^WS | '(:' | ';'
this.whitespace();
this.parse_Separator();
this.eventHandler.endNonterminal("ModuleDecl", this.e0);
}
parse_Prolog() {
this.eventHandler.startNonterminal("Prolog", this.e0);
for (;;) {
this.lookahead1W(274); // Wildcard | 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' | 'first' | 'following' | 'following-sibling' | 'for' |
// 'ft-option' | 'function' | 'ge' | 'group' | 'gt' | 'idiv' | 'if' | 'import' |
// 'in' | 'index' | 'insert' | 'instance' | 'integrity' | 'intersect' | 'into' |
// 'is' | 'item' | 'json' | 'json-item' | 'last' | 'lax' | 'le' | 'let' | 'loop' |
// 'lt' | 'mod' | 'modify' | 'module' | 'namespace' | 'namespace-node' | 'ne' |
// 'node' | 'nodes' | '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' | 'self' | 'sliding' | 'some' | 'stable' | 'start' | 'strict' |
// 'structured-item' | 'switch' | 'text' | 'to' | 'treat' | 'try' | 'tumbling' |
// 'type' | 'typeswitch' | 'union' | 'unordered' | 'updating' | 'validate' |
// 'value' | 'variable' | 'version' | 'where' | 'while' | 'with' | 'xquery' | '{' |
// '{|'
switch (this.l1) {
case 108:
this.lookahead2W(213); // S^WS | EOF | '!' | '!=' | '#' | '%' | '(' | '(:' | '*' | '+' | ',' | '-' | '/' |
// '//' | ';' | '<' | '<<' | '<=' | '=' | '>' | '>=' | '>>' | '[' | 'and' |
// 'base-uri' | 'boundary-space' | 'cast' | 'castable' | 'collection' |
// 'construction' | 'contains' | 'context' | 'copy-namespaces' | 'decimal-format' |
// 'default' | 'div' | 'eq' | 'except' | 'ft-option' | 'function' | 'ge' | 'gt' |
// 'idiv' | 'index' | 'instance' | 'integrity' | 'intersect' | 'is' | 'le' | 'lt' |
// 'mod' | 'namespace' | 'ne' | 'option' | 'or' | 'ordering' | 'revalidation' |
// 'to' | 'treat' | 'union' | 'updating' | 'variable' | '|' | '||'
break;
case 153:
this.lookahead2W(201); // S^WS | EOF | '!' | '!=' | '#' | '(' | '(:' | '*' | '+' | ',' | '-' | '/' | '//' |
// ';' | '<' | '<<' | '<=' | '=' | '>' | '>=' | '>>' | '[' | 'and' | 'cast' |
// 'castable' | 'contains' | 'div' | 'eq' | 'except' | 'ge' | 'gt' | 'idiv' |
// 'instance' | 'intersect' | 'is' | 'le' | 'lt' | 'mod' | 'module' | 'ne' | 'or' |
// 'schema' | 'to' | 'treat' | 'union' | '|' | '||'
break;
default:
this.lk = this.l1;
}
if (this.lk != 42604 // 'declare' 'base-uri'
&& this.lk != 43628 // 'declare' 'boundary-space'
&& this.lk != 50284 // 'declare' 'construction'
&& this.lk != 53356 // 'declare' 'copy-namespaces'
&& this.lk != 54380 // 'declare' 'decimal-format'
&& this.lk != 55916 // 'declare' 'default'
&& this.lk != 72300 // 'declare' 'ft-option'
&& this.lk != 93337 // 'import' 'module'
&& this.lk != 94316 // 'declare' 'namespace'
&& this.lk != 104044 // 'declare' 'ordering'
&& this.lk != 113772 // 'declare' 'revalidation'
&& this.lk != 115353) {
break;
}
switch (this.l1) {
case 108:
this.lookahead2W(178); // 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 == 55916) {
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 94316:
this.whitespace();
this.parse_NamespaceDecl();
break;
case 153:
this.whitespace();
this.parse_Import();
break;
case 72300:
this.whitespace();
this.parse_FTOptionDecl();
break;
default:
this.whitespace();
this.parse_Setter();
}
this.lookahead1W(28); // S^WS | '(:' | ';'
this.whitespace();
this.parse_Separator();
}
for (;;) {
this.lookahead1W(274); // Wildcard | 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' | 'first' | 'following' | 'following-sibling' | 'for' |
// 'ft-option' | 'function' | 'ge' | 'group' | 'gt' | 'idiv' | 'if' | 'import' |
// 'in' | 'index' | 'insert' | 'instance' | 'integrity' | 'intersect' | 'into' |
// 'is' | 'item' | 'json' | 'json-item' | 'last' | 'lax' | 'le' | 'let' | 'loop' |
// 'lt' | 'mod' | 'modify' | 'module' | 'namespace' | 'namespace-node' | 'ne' |
// 'node' | 'nodes' | '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' | 'self' | 'sliding' | 'some' | 'stable' | 'start' | 'strict' |
// 'structured-item' | 'switch' | 'text' | 'to' | 'treat' | 'try' | 'tumbling' |
// 'type' | 'typeswitch' | 'union' | 'unordered' | 'updating' | 'validate' |
// 'value' | 'variable' | 'version' | 'where' | 'while' | 'with' | 'xquery' | '{' |
// '{|'
switch (this.l1) {
case 108:
this.lookahead2W(210); // S^WS | EOF | '!' | '!=' | '#' | '%' | '(' | '(:' | '*' | '+' | ',' | '-' | '/' |
// '//' | ';' | '<' | '<<' | '<=' | '=' | '>' | '>=' | '>>' | '[' | 'and' | 'cast' |
// 'castable' | 'collection' | 'contains' | 'context' | 'div' | 'eq' | 'except' |
// 'function' | 'ge' | 'gt' | 'idiv' | 'index' | 'instance' | 'integrity' |
// 'intersect' | 'is' | 'le' | 'lt' | 'mod' | 'ne' | 'option' | 'or' | 'to' |
// 'treat' | 'union' | 'updating' | 'variable' | '|' | '||'
break;
default:
this.lk = this.l1;
}
if (this.lk != 16492 // 'declare' '%'
&& this.lk != 48748 // 'declare' 'collection'
&& this.lk != 51820 // 'declare' 'context'
&& this.lk != 74348 // 'declare' 'function'
&& this.lk != 79468 // 'declare' 'index'
&& this.lk != 82540 // 'declare' 'integrity'
&& this.lk != 101996 // 'declare' 'option'
&& this.lk != 131692 // 'declare' 'updating'
&& this.lk != 134252) {
break;
}
switch (this.l1) {
case 108:
this.lookahead2W(175); // S^WS | '%' | '(:' | 'collection' | 'context' | 'function' | 'index' |
// 'integrity' | 'option' | 'updating' | 'variable'
break;
default:
this.lk = this.l1;
}
switch (this.lk) {
case 51820:
this.whitespace();
this.parse_ContextItemDecl();
break;
case 101996:
this.whitespace();
this.parse_OptionDecl();
break;
default:
this.whitespace();
this.parse_AnnotatedDecl();
}
this.lookahead1W(28); // S^WS | '(:' | ';'
this.whitespace();
this.parse_Separator();
}
this.eventHandler.endNonterminal("Prolog", this.e0);
}
parse_Separator() {
this.eventHandler.startNonterminal("Separator", this.e0);
this.shift(53); // ';'
this.eventHandler.endNonterminal("Separator", this.e0);
}
parse_Setter() {
this.eventHandler.startNonterminal("Setter", this.e0);
switch (this.l1) {
case 108:
this.lookahead2W(172); // S^WS | '(:' | 'base-uri' | 'boundary-space' | 'construction' |
// 'copy-namespaces' | 'decimal-format' | 'default' | 'ordering' | 'revalidation'
break;
default:
this.lk = this.l1;
}
if (this.lk == 55916) {
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 43628:
this.parse_BoundarySpaceDecl();
break;
case -2:
this.parse_DefaultCollationDecl();
break;
case 42604:
this.parse_BaseURIDecl();
break;
case 50284:
this.parse_ConstructionDecl();
break;
case 104044:
this.parse_OrderingModeDecl();
break;
case -6:
this.parse_EmptyOrderDecl();
break;
case 113772:
this.parse_RevalidationDecl();
break;
case 53356:
this.parse_CopyNamespacesDecl();
break;
default:
this.parse_DecimalFormatDecl();
}
this.eventHandler.endNonterminal("Setter", this.e0);
}
parse_BoundarySpaceDecl() {
this.eventHandler.startNonterminal("BoundarySpaceDecl", this.e0);
this.shift(108); // 'declare'
this.lookahead1W(33); // S^WS | '(:' | 'boundary-space'
this.shift(85); // 'boundary-space'
this.lookahead1W(133); // S^WS | '(:' | 'preserve' | 'strip'
switch (this.l1) {
case 214:
this.shift(214); // 'preserve'
break;
default:
this.shift(241); // 'strip'
}
this.eventHandler.endNonterminal("BoundarySpaceDecl", this.e0);
}
parse_DefaultCollationDecl() {
this.eventHandler.startNonterminal("DefaultCollationDecl", this.e0);
this.shift(108); // 'declare'
this.lookahead1W(46); // S^WS | '(:' | 'default'
this.shift(109); // 'default'
this.lookahead1W(38); // S^WS | '(:' | 'collation'
this.shift(94); // 'collation'
this.lookahead1W(15); // URILiteral | S^WS | '(:'
this.shift(7); // URILiteral
this.eventHandler.endNonterminal("DefaultCollationDecl", this.e0);
}
try_DefaultCollationDecl() {
this.shiftT(108); // 'declare'
this.lookahead1W(46); // S^WS | '(:' | 'default'
this.shiftT(109); // 'default'
this.lookahead1W(38); // S^WS | '(:' | 'collation'
this.shiftT(94); // 'collation'
this.lookahead1W(15); // URILiteral | S^WS | '(:'
this.shiftT(7); // URILiteral
}
parse_BaseURIDecl() {
this.eventHandler.startNonterminal("BaseURIDecl", this.e0);
this.shift(108); // 'declare'
this.lookahead1W(32); // S^WS | '(:' | 'base-uri'
this.shift(83); // '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(108); // 'declare'
this.lookahead1W(41); // S^WS | '(:' | 'construction'
this.shift(98); // 'construction'
this.lookahead1W(133); // S^WS | '(:' | 'preserve' | 'strip'
switch (this.l1) {
case 241:
this.shift(241); // 'strip'
break;
default:
this.shift(214); // 'preserve'
}
this.eventHandler.endNonterminal("ConstructionDecl", this.e0);
}
parse_OrderingModeDecl() {
this.eventHandler.startNonterminal("OrderingModeDecl", this.e0);
this.shift(108); // 'declare'
this.lookahead1W(68); // S^WS | '(:' | 'ordering'
this.shift(203); // 'ordering'
this.lookahead1W(131); // S^WS | '(:' | 'ordered' | 'unordered'
switch (this.l1) {
case 202:
this.shift(202); // 'ordered'
break;
default:
this.shift(256); // 'unordered'
}
this.eventHandler.endNonterminal("OrderingModeDecl", this.e0);
}
parse_EmptyOrderDecl() {
this.eventHandler.startNonterminal("EmptyOrderDecl", this.e0);
this.shift(108); // 'declare'
this.lookahead1W(46); // S^WS | '(:' | 'default'
this.shift(109); // 'default'
this.lookahead1W(67); // S^WS | '(:' | 'order'
this.shift(201); // 'order'
this.lookahead1W(49); // S^WS | '(:' | 'empty'
this.shift(123); // 'empty'
this.lookahead1W(121); // S^WS | '(:' | 'greatest' | 'least'
switch (this.l1) {
case 147:
this.shift(147); // 'greatest'
break;
default:
this.shift(173); // 'least'
}
this.eventHandler.endNonterminal("EmptyOrderDecl", this.e0);
}
try_EmptyOrderDecl() {
this.shiftT(108); // 'declare'
this.lookahead1W(46); // S^WS | '(:' | 'default'
this.shiftT(109); // 'default'
this.lookahead1W(67); // S^WS | '(:' | 'order'
this.shiftT(201); // 'order'
this.lookahead1W(49); // S^WS | '(:' | 'empty'
this.shiftT(123); // 'empty'
this.lookahead1W(121); // S^WS | '(:' | 'greatest' | 'least'
switch (this.l1) {
case 147:
this.shiftT(147); // 'greatest'
break;
default:
this.shiftT(173); // 'least'
}
}
parse_CopyNamespacesDecl() {
this.eventHandler.startNonterminal("CopyNamespacesDecl", this.e0);
this.shift(108); // 'declare'
this.lookahead1W(44); // S^WS | '(:' | 'copy-namespaces'
this.shift(104); // 'copy-namespaces'
this.lookahead1W(128); // S^WS | '(:' | 'no-preserve' | 'preserve'
this.whitespace();
this.parse_PreserveMode();
this.lookahead1W(25); // S^WS | '(:' | ','
this.shift(41); // ','
this.lookahead1W(123); // 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 214:
this.shift(214); // 'preserve'
break;
default:
this.shift(190); // 'no-preserve'
}
this.eventHandler.endNonterminal("PreserveMode", this.e0);
}
parse_InheritMode() {
this.eventHandler.startNonterminal("InheritMode", this.e0);
switch (this.l1) {
case 157:
this.shift(157); // 'inherit'
break;
default:
this.shift(189); // 'no-inherit'
}
this.eventHandler.endNonterminal("InheritMode", this.e0);
}
parse_DecimalFormatDecl() {
this.eventHandler.startNonterminal("DecimalFormatDecl", this.e0);
this.shift(108); // 'declare'
this.lookahead1W(114); // S^WS | '(:' | 'decimal-format' | 'default'
switch (this.l1) {
case 106:
this.shift(106); // 'decimal-format'
this.lookahead1W(254); // 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' | 'first' |
// 'following' | 'following-sibling' | 'for' | 'ft-option' | 'function' | 'ge' |
// 'group' | 'gt' | 'idiv' | 'if' | 'import' | 'in' | 'index' | 'insert' |
// 'instance' | 'integrity' | 'intersect' | 'into' | 'is' | 'item' | 'json' |
// 'json-item' | 'last' | 'lax' | 'le' | 'let' | 'loop' | 'lt' | 'mod' | 'modify' |
// 'module' | 'namespace' | 'namespace-node' | 'ne' | 'node' | 'nodes' | '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' | 'self' | 'sliding' | 'some' |
// 'stable' | 'start' | 'strict' | 'structured-item' | 'switch' | 'text' | 'to' |
// 'treat' | 'try' | 'tumbling' | 'type' | 'typeswitch' | 'union' | 'unordered' |
// 'updating' | 'validate' | 'value' | 'variable' | 'version' | 'where' | 'while' |
// 'with' | 'xquery'
this.whitespace();
this.parse_EQName();
break;
default:
this.shift(109); // 'default'
this.lookahead1W(45); // S^WS | '(:' | 'decimal-format'
this.shift(106); // 'decimal-format'
}
for (;;) {
this.lookahead1W(180); // S^WS | '(:' | ';' | 'NaN' | 'decimal-separator' | 'digit' |
// 'grouping-separator' | 'infinity' | 'minus-sign' | 'pattern-separator' |
// 'per-mille' | 'percent' | 'zero-digit'
if (this.l1 == 53) {
break;
}
this.whitespace();
this.parse_DFPropertyName();
this.lookahead1W(29); // S^WS | '(:' | '='
this.shift(60); // '='
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 107:
this.shift(107); // 'decimal-separator'
break;
case 149:
this.shift(149); // 'grouping-separator'
break;
case 156:
this.shift(156); // 'infinity'
break;
case 179:
this.shift(179); // 'minus-sign'
break;
case 67:
this.shift(67); // 'NaN'
break;
case 209:
this.shift(209); // 'percent'
break;
case 208:
this.shift(208); // 'per-mille'
break;
case 275:
this.shift(275); // 'zero-digit'
break;
case 116:
this.shift(116); // 'digit'
break;
default:
this.shift(207); // 'pattern-separator'
}
this.eventHandler.endNonterminal("DFPropertyName", this.e0);
}
parse_Import() {
this.eventHandler.startNonterminal("Import", this.e0);
switch (this.l1) {
case 153:
this.lookahead2W(126); // S^WS | '(:' | 'module' | 'schema'
break;
default:
this.lk = this.l1;
}
switch (this.lk) {
case 115353:
this.parse_SchemaImport();
break;
default:
this.parse_ModuleImport();
}
this.eventHandler.endNonterminal("Import", this.e0);
}
parse_SchemaImport() {
this.eventHandler.startNonterminal("SchemaImport", this.e0);
this.shift(153); // 'import'
this.lookahead1W(73); // S^WS | '(:' | 'schema'
this.shift(225); // 'schema'
this.lookahead1W(137); // 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(108); // S^WS | '(:' | ';' | 'at'
if (this.l1 == 81) {
this.shift(81); // 'at'
this.lookahead1W(15); // URILiteral | S^WS | '(:'
this.shift(7); // URILiteral
for (;;) {
this.lookahead1W(103); // S^WS | '(:' | ',' | ';'
if (this.l1 != 41) {
break;
}
this.shift(41); // ','
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 184:
this.shift(184); // 'namespace'
this.lookahead1W(248); // 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' | 'first' | 'following' |
// 'following-sibling' | 'for' | 'ft-option' | 'function' | 'ge' | 'group' | 'gt' |
// 'idiv' | 'if' | 'import' | 'in' | 'index' | 'insert' | 'instance' | 'integrity' |
// 'intersect' | 'into' | 'is' | 'item' | 'json' | 'last' | 'lax' | 'le' | 'let' |
// 'loop' | 'lt' | 'mod' | 'modify' | 'module' | 'namespace' | 'namespace-node' |
// 'ne' | 'node' | 'nodes' | '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' | 'self' | 'sliding' | 'some' | 'stable' | 'start' | 'strict' |
// 'switch' | 'text' | 'to' | 'treat' | 'try' | 'tumbling' | 'type' | 'typeswitch' |
// 'union' | 'unordered' | 'updating' | 'validate' | 'value' | 'variable' |
// 'version' | 'where' | 'while' | 'with' | 'xquery'
this.whitespace();
this.parse_NCName();
this.lookahead1W(29); // S^WS | '(:' | '='
this.shift(60); // '='
break;
default:
this.shift(109); // 'default'
this.lookahead1W(47); // S^WS | '(:' | 'element'
this.shift(121); // 'element'
this.lookahead1W(61); // S^WS | '(:' | 'namespace'
this.shift(184); // 'namespace'
}
this.eventHandler.endNonterminal("SchemaPrefix", this.e0);
}
parse_ModuleImport() {
this.eventHandler.startNonterminal("ModuleImport", this.e0);
this.shift(153); // 'import'
this.lookahead1W(60); // S^WS | '(:' | 'module'
this.shift(182); // 'module'
this.lookahead1W(90); // URILiteral | S^WS | '(:' | 'namespace'
if (this.l1 == 184) {
this.shift(184); // 'namespace'
this.lookahead1W(248); // 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' | 'first' | 'following' |
// 'following-sibling' | 'for' | 'ft-option' | 'function' | 'ge' | 'group' | 'gt' |
// 'idiv' | 'if' | 'import' | 'in' | 'index' | 'insert' | 'instance' | 'integrity' |
// 'intersect' | 'into' | 'is' | 'item' | 'json' | 'last' | 'lax' | 'le' | 'let' |
// 'loop' | 'lt' | 'mod' | 'modify' | 'module' | 'namespace' | 'namespace-node' |
// 'ne' | 'node' | 'nodes' | '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' | 'self' | 'sliding' | 'some' | 'stable' | 'start' | 'strict' |
// 'switch' | 'text' | 'to' | 'treat' | 'try' | 'tumbling' | 'type' | 'typeswitch' |
// 'union' | 'unordered' | 'updating' | 'validate' | 'value' | 'variable' |
// 'version' | 'where' | 'while' | 'with' | 'xquery'
this.whitespace();
this.parse_NCName();
this.lookahead1W(29); // S^WS | '(:' | '='
this.shift(60); // '='
}
this.lookahead1W(15); // URILiteral | S^WS | '(:'
this.shift(7); // URILiteral
this.lookahead1W(108); // S^WS | '(:' | ';' | 'at'
if (this.l1 == 81) {
this.shift(81); // 'at'
this.lookahead1W(15); // URILiteral | S^WS | '(:'
this.shift(7); // URILiteral
for (;;) {
this.lookahead1W(103); // S^WS | '(:' | ',' | ';'
if (this.l1 != 41) {
break;
}
this.shift(41); // ','
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(108); // 'declare'
this.lookahead1W(61); // S^WS | '(:' | 'namespace'
this.shift(184); // 'namespace'
this.lookahead1W(248); // 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' | 'first' | 'following' |
// 'following-sibling' | 'for' | 'ft-option' | 'function' | 'ge' | 'group' | 'gt' |
// 'idiv' | 'if' | 'import' | 'in' | 'index' | 'insert' | 'instance' | 'integrity' |
// 'intersect' | 'into' | 'is' | 'item' | 'json' | 'last' | 'lax' | 'le' | 'let' |
// 'loop' | 'lt' | 'mod' | 'modify' | 'module' | 'namespace' | 'namespace-node' |
// 'ne' | 'node' | 'nodes' | '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' | 'self' | 'sliding' | 'some' | 'stable' | 'start' | 'strict' |
// 'switch' | 'text' | 'to' | 'treat' | 'try' | 'tumbling' | 'type' | 'typeswitch' |
// 'union' | 'unordered' | 'updating' | 'validate' | 'value' | 'variable' |
// 'version' | 'where' | 'while' | 'with' | 'xquery'
this.whitespace();
this.parse_NCName();
this.lookahead1W(29); // S^WS | '(:' | '='
this.shift(60); // '='
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(108); // 'declare'
this.lookahead1W(46); // S^WS | '(:' | 'default'
this.shift(109); // 'default'
this.lookahead1W(115); // S^WS | '(:' | 'element' | 'function'
switch (this.l1) {
case 121:
this.shift(121); // 'element'
break;
default:
this.shift(145); // 'function'
}
this.lookahead1W(61); // S^WS | '(:' | 'namespace'
this.shift(184); // 'namespace'
this.lookahead1W(15); // URILiteral | S^WS | '(:'
this.shift(7); // URILiteral
this.eventHandler.endNonterminal("DefaultNamespaceDecl", this.e0);
}
try_DefaultNamespaceDecl() {
this.shiftT(108); // 'declare'
this.lookahead1W(46); // S^WS | '(:' | 'default'
this.shiftT(109); // 'default'
this.lookahead1W(115); // S^WS | '(:' | 'element' | 'function'
switch (this.l1) {
case 121:
this.shiftT(121); // 'element'
break;
default:
this.shiftT(145); // 'function'
}
this.lookahead1W(61); // S^WS | '(:' | 'namespace'
this.shiftT(184); // 'namespace'
this.lookahead1W(15); // URILite