xqlint
Version:
XQuery & JSONiq Quality Checker
1,012 lines (975 loc) • 2.95 MB
JavaScript
// This file was generated on Fri Apr 10, 2015 00:54 (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 -javascript -a xqlint
// line 2 "JSONiqParser.ebnf"
var JSONiqParser = exports.JSONiqParser = function JSONiqParser(string, parsingEventHandler)
{
init(string, parsingEventHandler);
// line 9 "JSONiqParser.js"
var self = this;
this.ParseException = function(b, e, s, o, x)
{
var
begin = b,
end = e,
state = s,
offending = o,
expected = x;
this.getBegin = function() {return begin;};
this.getEnd = function() {return end;};
this.getState = function() {return state;};
this.getExpected = function() {return expected;};
this.getOffending = function() {return offending;};
this.getMessage = function()
{
return offending < 0 ? "lexical analysis failed" : "syntax error";
};
};
function init(string, parsingEventHandler)
{
eventHandler = parsingEventHandler;
input = string;
size = string.length;
reset(0, 0, 0);
}
this.getInput = function()
{
return input;
};
function reset(l, b, e)
{
b0 = b; e0 = b;
l1 = l; b1 = b; e1 = e;
l2 = 0;
end = e;
ex = -1;
memo = {};
eventHandler.reset(input);
}
this.getOffendingToken = function(e)
{
var o = e.getOffending();
return o >= 0 ? JSONiqParser.TOKEN[o] : null;
};
this.getExpectedTokenSet = function(e)
{
var expected;
if (e.getExpected() < 0)
{
expected = JSONiqParser.getTokenSet(- e.getState());
}
else
{
expected = [JSONiqParser.TOKEN[e.getExpected()]];
}
return expected;
};
this.getErrorMessage = function(e)
{
var tokenSet = this.getExpectedTokenSet(e);
var found = this.getOffendingToken(e);
var prefix = 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..."
+ input.substring(e.getBegin(), Math.min(input.length, e.getBegin() + 64))
+ "...";
};
this.parse_XQuery = function()
{
eventHandler.startNonterminal("XQuery", e0);
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' |
// '{' | '{|'
whitespace();
parse_Module();
shift(25); // EOF
eventHandler.endNonterminal("XQuery", e0);
};
function parse_Module()
{
eventHandler.startNonterminal("Module", e0);
switch (l1)
{
case 170: // 'jsoniq'
lookahead2W(168); // S^WS | '#' | '(' | '(:' | 'encoding' | 'version'
break;
default:
lk = l1;
}
if (lk == 64682 // 'jsoniq' 'encoding'
|| lk == 137898) // 'jsoniq' 'version'
{
parse_VersionDecl();
}
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 (l1)
{
case 185: // 'module'
lookahead2W(146); // S^WS | '#' | '(' | '(:' | 'namespace'
break;
default:
lk = l1;
}
switch (lk)
{
case 95929: // 'module' 'namespace'
whitespace();
parse_LibraryModule();
break;
default:
whitespace();
parse_MainModule();
}
eventHandler.endNonterminal("Module", e0);
}
function parse_VersionDecl()
{
eventHandler.startNonterminal("VersionDecl", e0);
shift(170); // 'jsoniq'
lookahead1W(120); // S^WS | '(:' | 'encoding' | 'version'
switch (l1)
{
case 126: // 'encoding'
shift(126); // 'encoding'
lookahead1W(17); // StringLiteral | S^WS | '(:'
shift(11); // StringLiteral
break;
default:
shift(269); // 'version'
lookahead1W(17); // StringLiteral | S^WS | '(:'
shift(11); // StringLiteral
lookahead1W(113); // S^WS | '(:' | ';' | 'encoding'
if (l1 == 126) // 'encoding'
{
shift(126); // 'encoding'
lookahead1W(17); // StringLiteral | S^WS | '(:'
shift(11); // StringLiteral
}
}
lookahead1W(29); // S^WS | '(:' | ';'
whitespace();
parse_Separator();
eventHandler.endNonterminal("VersionDecl", e0);
}
function parse_LibraryModule()
{
eventHandler.startNonterminal("LibraryModule", e0);
parse_ModuleDecl();
lookahead1W(142); // S^WS | EOF | '(:' | 'declare' | 'import'
whitespace();
parse_Prolog();
eventHandler.endNonterminal("LibraryModule", e0);
}
function parse_ModuleDecl()
{
eventHandler.startNonterminal("ModuleDecl", e0);
shift(185); // 'module'
lookahead1W(64); // S^WS | '(:' | 'namespace'
shift(187); // 'namespace'
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'
whitespace();
parse_NCName();
lookahead1W(30); // S^WS | '(:' | '='
shift(61); // '='
lookahead1W(15); // URILiteral | S^WS | '(:'
shift(7); // URILiteral
lookahead1W(29); // S^WS | '(:' | ';'
whitespace();
parse_Separator();
eventHandler.endNonterminal("ModuleDecl", e0);
}
function parse_Prolog()
{
eventHandler.startNonterminal("Prolog", e0);
for (;;)
{
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 (l1)
{
case 109: // 'declare'
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: // 'import'
lookahead2W(169); // S^WS | '#' | '(' | '(:' | 'module' | 'schema'
break;
default:
lk = l1;
}
if (lk != 43117 // 'declare' 'base-uri'
&& lk != 44141 // 'declare' 'boundary-space'
&& lk != 50797 // 'declare' 'construction'
&& lk != 53869 // 'declare' 'copy-namespaces'
&& lk != 54893 // 'declare' 'decimal-format'
&& lk != 56429 // 'declare' 'default'
&& lk != 73325 // 'declare' 'ft-option'
&& lk != 94875 // 'import' 'module'
&& lk != 95853 // 'declare' 'namespace'
&& lk != 106093 // 'declare' 'ordering'
&& lk != 115821 // 'declare' 'revalidation'
&& lk != 117403) // 'import' 'schema'
{
break;
}
switch (l1)
{
case 109: // 'declare'
lookahead2W(200); // S^WS | '(:' | 'base-uri' | 'boundary-space' | 'construction' |
// 'copy-namespaces' | 'decimal-format' | 'default' | 'ft-option' | 'namespace' |
// 'ordering' | 'revalidation'
break;
default:
lk = l1;
}
if (lk == 56429) // 'declare' 'default'
{
lk = memoized(0, e0);
if (lk == 0)
{
var b0A = b0; var e0A = e0; var l1A = l1;
var b1A = b1; var e1A = e1; var l2A = l2;
var b2A = b2; var e2A = e2;
try
{
try_DefaultNamespaceDecl();
lk = -1;
}
catch (p1A)
{
lk = -2;
}
b0 = b0A; e0 = e0A; l1 = l1A; if (l1 == 0) {end = e0A;} else {
b1 = b1A; e1 = e1A; l2 = l2A; if (l2 == 0) {end = e1A;} else {
b2 = b2A; e2 = e2A; end = e2A; }}
memoize(0, e0, lk);
}
}
switch (lk)
{
case -1:
whitespace();
parse_DefaultNamespaceDecl();
break;
case 95853: // 'declare' 'namespace'
whitespace();
parse_NamespaceDecl();
break;
case 155: // 'import'
whitespace();
parse_Import();
break;
case 73325: // 'declare' 'ft-option'
whitespace();
parse_FTOptionDecl();
break;
default:
whitespace();
parse_Setter();
}
lookahead1W(29); // S^WS | '(:' | ';'
whitespace();
parse_Separator();
}
for (;;)
{
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 (l1)
{
case 109: // 'declare'
lookahead2W(201); // S^WS | '#' | '%' | '(' | '(:' | 'collection' | 'context' | 'function' | 'index' |
// 'integrity' | 'option' | 'updating' | 'variable'
break;
default:
lk = l1;
}
if (lk != 17005 // 'declare' '%'
&& lk != 49261 // 'declare' 'collection'
&& lk != 52333 // 'declare' 'context'
&& lk != 75373 // 'declare' 'function'
&& lk != 80493 // 'declare' 'index'
&& lk != 83565 // 'declare' 'integrity'
&& lk != 104045 // 'declare' 'option'
&& lk != 134765 // 'declare' 'updating'
&& lk != 137325) // 'declare' 'variable'
{
break;
}
switch (l1)
{
case 109: // 'declare'
lookahead2W(197); // S^WS | '%' | '(:' | 'collection' | 'context' | 'function' | 'index' |
// 'integrity' | 'option' | 'updating' | 'variable'
break;
default:
lk = l1;
}
switch (lk)
{
case 52333: // 'declare' 'context'
whitespace();
parse_ContextItemDecl();
break;
case 104045: // 'declare' 'option'
whitespace();
parse_OptionDecl();
break;
default:
whitespace();
parse_AnnotatedDecl();
}
lookahead1W(29); // S^WS | '(:' | ';'
whitespace();
parse_Separator();
}
eventHandler.endNonterminal("Prolog", e0);
}
function parse_Separator()
{
eventHandler.startNonterminal("Separator", e0);
shift(54); // ';'
eventHandler.endNonterminal("Separator", e0);
}
function parse_Setter()
{
eventHandler.startNonterminal("Setter", e0);
switch (l1)
{
case 109: // 'declare'
lookahead2W(194); // S^WS | '(:' | 'base-uri' | 'boundary-space' | 'construction' |
// 'copy-namespaces' | 'decimal-format' | 'default' | 'ordering' | 'revalidation'
break;
default:
lk = l1;
}
if (lk == 56429) // 'declare' 'default'
{
lk = memoized(1, e0);
if (lk == 0)
{
var b0A = b0; var e0A = e0; var l1A = l1;
var b1A = b1; var e1A = e1; var l2A = l2;
var b2A = b2; var e2A = e2;
try
{
try_DefaultCollationDecl();
lk = -2;
}
catch (p2A)
{
try
{
b0 = b0A; e0 = e0A; l1 = l1A; if (l1 == 0) {end = e0A;} else {
b1 = b1A; e1 = e1A; l2 = l2A; if (l2 == 0) {end = e1A;} else {
b2 = b2A; e2 = e2A; end = e2A; }}
try_EmptyOrderDecl();
lk = -6;
}
catch (p6A)
{
lk = -9;
}
}
b0 = b0A; e0 = e0A; l1 = l1A; if (l1 == 0) {end = e0A;} else {
b1 = b1A; e1 = e1A; l2 = l2A; if (l2 == 0) {end = e1A;} else {
b2 = b2A; e2 = e2A; end = e2A; }}
memoize(1, e0, lk);
}
}
switch (lk)
{
case 44141: // 'declare' 'boundary-space'
parse_BoundarySpaceDecl();
break;
case -2:
parse_DefaultCollationDecl();
break;
case 43117: // 'declare' 'base-uri'
parse_BaseURIDecl();
break;
case 50797: // 'declare' 'construction'
parse_ConstructionDecl();
break;
case 106093: // 'declare' 'ordering'
parse_OrderingModeDecl();
break;
case -6:
parse_EmptyOrderDecl();
break;
case 115821: // 'declare' 'revalidation'
parse_RevalidationDecl();
break;
case 53869: // 'declare' 'copy-namespaces'
parse_CopyNamespacesDecl();
break;
default:
parse_DecimalFormatDecl();
}
eventHandler.endNonterminal("Setter", e0);
}
function parse_BoundarySpaceDecl()
{
eventHandler.startNonterminal("BoundarySpaceDecl", e0);
shift(109); // 'declare'
lookahead1W(36); // S^WS | '(:' | 'boundary-space'
shift(86); // 'boundary-space'
lookahead1W(137); // S^WS | '(:' | 'preserve' | 'strip'
switch (l1)
{
case 218: // 'preserve'
shift(218); // 'preserve'
break;
default:
shift(246); // 'strip'
}
eventHandler.endNonterminal("BoundarySpaceDecl", e0);
}
function parse_DefaultCollationDecl()
{
eventHandler.startNonterminal("DefaultCollationDecl", e0);
shift(109); // 'declare'
lookahead1W(49); // S^WS | '(:' | 'default'
shift(110); // 'default'
lookahead1W(41); // S^WS | '(:' | 'collation'
shift(95); // 'collation'
lookahead1W(15); // URILiteral | S^WS | '(:'
shift(7); // URILiteral
eventHandler.endNonterminal("DefaultCollationDecl", e0);
}
function try_DefaultCollationDecl()
{
shiftT(109); // 'declare'
lookahead1W(49); // S^WS | '(:' | 'default'
shiftT(110); // 'default'
lookahead1W(41); // S^WS | '(:' | 'collation'
shiftT(95); // 'collation'
lookahead1W(15); // URILiteral | S^WS | '(:'
shiftT(7); // URILiteral
}
function parse_BaseURIDecl()
{
eventHandler.startNonterminal("BaseURIDecl", e0);
shift(109); // 'declare'
lookahead1W(35); // S^WS | '(:' | 'base-uri'
shift(84); // 'base-uri'
lookahead1W(15); // URILiteral | S^WS | '(:'
shift(7); // URILiteral
eventHandler.endNonterminal("BaseURIDecl", e0);
}
function parse_ConstructionDecl()
{
eventHandler.startNonterminal("ConstructionDecl", e0);
shift(109); // 'declare'
lookahead1W(44); // S^WS | '(:' | 'construction'
shift(99); // 'construction'
lookahead1W(137); // S^WS | '(:' | 'preserve' | 'strip'
switch (l1)
{
case 246: // 'strip'
shift(246); // 'strip'
break;
default:
shift(218); // 'preserve'
}
eventHandler.endNonterminal("ConstructionDecl", e0);
}
function parse_OrderingModeDecl()
{
eventHandler.startNonterminal("OrderingModeDecl", e0);
shift(109); // 'declare'
lookahead1W(71); // S^WS | '(:' | 'ordering'
shift(207); // 'ordering'
lookahead1W(135); // S^WS | '(:' | 'ordered' | 'unordered'
switch (l1)
{
case 206: // 'ordered'
shift(206); // 'ordered'
break;
default:
shift(262); // 'unordered'
}
eventHandler.endNonterminal("OrderingModeDecl", e0);
}
function parse_EmptyOrderDecl()
{
eventHandler.startNonterminal("EmptyOrderDecl", e0);
shift(109); // 'declare'
lookahead1W(49); // S^WS | '(:' | 'default'
shift(110); // 'default'
lookahead1W(70); // S^WS | '(:' | 'order'
shift(205); // 'order'
lookahead1W(52); // S^WS | '(:' | 'empty'
shift(124); // 'empty'
lookahead1W(125); // S^WS | '(:' | 'greatest' | 'least'
switch (l1)
{
case 149: // 'greatest'
shift(149); // 'greatest'
break;
default:
shift(176); // 'least'
}
eventHandler.endNonterminal("EmptyOrderDecl", e0);
}
function try_EmptyOrderDecl()
{
shiftT(109); // 'declare'
lookahead1W(49); // S^WS | '(:' | 'default'
shiftT(110); // 'default'
lookahead1W(70); // S^WS | '(:' | 'order'
shiftT(205); // 'order'
lookahead1W(52); // S^WS | '(:' | 'empty'
shiftT(124); // 'empty'
lookahead1W(125); // S^WS | '(:' | 'greatest' | 'least'
switch (l1)
{
case 149: // 'greatest'
shiftT(149); // 'greatest'
break;
default:
shiftT(176); // 'least'
}
}
function parse_CopyNamespacesDecl()
{
eventHandler.startNonterminal("CopyNamespacesDecl", e0);
shift(109); // 'declare'
lookahead1W(47); // S^WS | '(:' | 'copy-namespaces'
shift(105); // 'copy-namespaces'
lookahead1W(132); // S^WS | '(:' | 'no-preserve' | 'preserve'
whitespace();
parse_PreserveMode();
lookahead1W(25); // S^WS | '(:' | ','
shift(42); // ','
lookahead1W(127); // S^WS | '(:' | 'inherit' | 'no-inherit'
whitespace();
parse_InheritMode();
eventHandler.endNonterminal("CopyNamespacesDecl", e0);
}
function parse_PreserveMode()
{
eventHandler.startNonterminal("PreserveMode", e0);
switch (l1)
{
case 218: // 'preserve'
shift(218); // 'preserve'
break;
default:
shift(193); // 'no-preserve'
}
eventHandler.endNonterminal("PreserveMode", e0);
}
function parse_InheritMode()
{
eventHandler.startNonterminal("InheritMode", e0);
switch (l1)
{
case 159: // 'inherit'
shift(159); // 'inherit'
break;
default:
shift(192); // 'no-inherit'
}
eventHandler.endNonterminal("InheritMode", e0);
}
function parse_DecimalFormatDecl()
{
eventHandler.startNonterminal("DecimalFormatDecl", e0);
shift(109); // 'declare'
lookahead1W(118); // S^WS | '(:' | 'decimal-format' | 'default'
switch (l1)
{
case 107: // 'decimal-format'
shift(107); // 'decimal-format'
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'
whitespace();
parse_EQName();
break;
default:
shift(110); // 'default'
lookahead1W(48); // S^WS | '(:' | 'decimal-format'
shift(107); // 'decimal-format'
}
for (;;)
{
lookahead1W(203); // S^WS | '(:' | ';' | 'NaN' | 'decimal-separator' | 'digit' |
// 'grouping-separator' | 'infinity' | 'minus-sign' | 'pattern-separator' |
// 'per-mille' | 'percent' | 'zero-digit'
if (l1 == 54) // ';'
{
break;
}
whitespace();
parse_DFPropertyName();
lookahead1W(30); // S^WS | '(:' | '='
shift(61); // '='
lookahead1W(17); // StringLiteral | S^WS | '(:'
shift(11); // StringLiteral
}
eventHandler.endNonterminal("DecimalFormatDecl", e0);
}
function parse_DFPropertyName()
{
eventHandler.startNonterminal("DFPropertyName", e0);
switch (l1)
{
case 108: // 'decimal-separator'
shift(108); // 'decimal-separator'
break;
case 151: // 'grouping-separator'
shift(151); // 'grouping-separator'
break;
case 158: // 'infinity'
shift(158); // 'infinity'
break;
case 182: // 'minus-sign'
shift(182); // 'minus-sign'
break;
case 68: // 'NaN'
shift(68); // 'NaN'
break;
case 213: // 'percent'
shift(213); // 'percent'
break;
case 212: // 'per-mille'
shift(212); // 'per-mille'
break;
case 280: // 'zero-digit'
shift(280); // 'zero-digit'
break;
case 117: // 'digit'
shift(117); // 'digit'
break;
default:
shift(211); // 'pattern-separator'
}
eventHandler.endNonterminal("DFPropertyName", e0);
}
function parse_Import()
{
eventHandler.startNonterminal("Import", e0);
switch (l1)
{
case 155: // 'import'
lookahead2W(130); // S^WS | '(:' | 'module' | 'schema'
break;
default:
lk = l1;
}
switch (lk)
{
case 117403: // 'import' 'schema'
parse_SchemaImport();
break;
default:
parse_ModuleImport();
}
eventHandler.endNonterminal("Import", e0);
}
function parse_SchemaImport()
{
eventHandler.startNonterminal("SchemaImport", e0);
shift(155); // 'import'
lookahead1W(76); // S^WS | '(:' | 'schema'
shift(229); // 'schema'
lookahead1W(141); // URILiteral | S^WS | '(:' | 'default' | 'namespace'
if (l1 != 7) // URILiteral
{
whitespace();
parse_SchemaPrefix();
}
lookahead1W(15); // URILiteral | S^WS | '(:'
shift(7); // URILiteral
lookahead1W(112); // S^WS | '(:' | ';' | 'at'
if (l1 == 82) // 'at'
{
shift(82); // 'at'
lookahead1W(15); // URILiteral | S^WS | '(:'
shift(7); // URILiteral
for (;;)
{
lookahead1W(107); // S^WS | '(:' | ',' | ';'
if (l1 != 42) // ','
{
break;
}
shift(42); // ','
lookahead1W(15); // URILiteral | S^WS | '(:'
shift(7); // URILiteral
}
}
eventHandler.endNonterminal("SchemaImport", e0);
}
function parse_SchemaPrefix()
{
eventHandler.startNonterminal("SchemaPrefix", e0);
switch (l1)
{
case 187: // 'namespace'
shift(187); // 'namespace'
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'
whitespace();
parse_NCName();
lookahead1W(30); // S^WS | '(:' | '='
shift(61); // '='
break;
default:
shift(110); // 'default'
lookahead1W(50); // S^WS | '(:' | 'element'
shift(122); // 'element'
lookahead1W(64); // S^WS | '(:' | 'namespace'
shift(187); // 'namespace'
}
eventHandler.endNonterminal("SchemaPrefix", e0);
}
function parse_ModuleImport()
{
eventHandler.startNonterminal("ModuleImport", e0);
shift(155); // 'import'
lookahead1W(63); // S^WS | '(:' | 'module'
shift(185); // 'module'
lookahead1W(93); // URILiteral | S^WS | '(:' | 'namespace'
if (l1 == 187) // 'namespace'
{
shift(187); // 'namespace'
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'
whitespace();
parse_NCName();
lookahead1W(30); // S^WS | '(:' | '='
shift(61); // '='
}
lookahead1W(15); // URILiteral | S^WS | '(:'
shift(7); // URILiteral
lookahead1W(112); // S^WS | '(:' | ';' | 'at'
if (l1 == 82) // 'at'
{
shift(82); // 'at'
lookahead1W(15); // URILiteral | S^WS | '(:'
shift(7); // URILiteral
for (;;)
{
lookahead1W(107); // S^WS | '(:' | ',' | ';'
if (l1 != 42) // ','
{
break;
}
shift(42); // ','
lookahead1W(15); // URILiteral | S^WS | '(:'
shift(7); // URILiteral
}
}
eventHandler.endNonterminal("ModuleImport", e0);
}
function parse_NamespaceDecl()
{
eventHandler.startNonterminal("NamespaceDecl", e0);
shift(109); // 'declare'
lookahead1W(64); // S^WS | '(:' | 'namespace'
shift(187); // 'namespace'
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' |