|
|
@@ -0,0 +1,4363 @@
|
|
|
+mp2 = (function() {
|
|
|
+ /*
|
|
|
+ * Generated by PEG.js 0.8.0.
|
|
|
+ *
|
|
|
+ * http://pegjs.majda.cz/
|
|
|
+ */
|
|
|
+
|
|
|
+ function peg$subclass(child, parent) {
|
|
|
+ function ctor() { this.constructor = child; }
|
|
|
+ ctor.prototype = parent.prototype;
|
|
|
+ child.prototype = new ctor();
|
|
|
+ }
|
|
|
+
|
|
|
+ function SyntaxError(message, expected, found, offset, line, column) {
|
|
|
+ this.message = message;
|
|
|
+ this.expected = expected;
|
|
|
+ this.found = found;
|
|
|
+ this.offset = offset;
|
|
|
+ this.line = line;
|
|
|
+ this.column = column;
|
|
|
+
|
|
|
+ this.name = "SyntaxError";
|
|
|
+ }
|
|
|
+
|
|
|
+ peg$subclass(SyntaxError, Error);
|
|
|
+
|
|
|
+ function parse(input) {
|
|
|
+ var options = arguments.length > 1 ? arguments[1] : {},
|
|
|
+
|
|
|
+ peg$FAILED = {},
|
|
|
+
|
|
|
+ peg$startRuleFunctions = { start: peg$parsestart },
|
|
|
+ peg$startRuleFunction = peg$parsestart,
|
|
|
+
|
|
|
+ peg$c0 = peg$FAILED,
|
|
|
+ peg$c1 = function() { ast.errors = []; },
|
|
|
+ peg$c2 = void 0,
|
|
|
+ peg$c3 = function(m) {
|
|
|
+ m.errors = ast.errors;
|
|
|
+ return m;
|
|
|
+ },
|
|
|
+ peg$c4 = null,
|
|
|
+ peg$c5 = [],
|
|
|
+ peg$c6 = function(includes, statements) { return new ast.Schema(includes, statements); },
|
|
|
+ peg$c7 = { type: "other", description: "INCLUDE statement" },
|
|
|
+ peg$c8 = function(id) { return new ast.Include(id); },
|
|
|
+ peg$c9 = function(s) { return s },
|
|
|
+ peg$c10 = function(r, id) { ast.ruleId = id.id; },
|
|
|
+ peg$c11 = function(r, id, pl) {
|
|
|
+ var rule = new (r ? ast.RootRule : ast.CompositeRule)(id, pl);
|
|
|
+ if (id.id in ast.rulesById) ast.errors.push(err(20, id.id));
|
|
|
+ ast.rulesById[rule.id.id] = rule;
|
|
|
+ return rule;
|
|
|
+ },
|
|
|
+ peg$c12 = function(list) { return new ast.Sequence(list); },
|
|
|
+ peg$c13 = function(id) {
|
|
|
+ if (id.id === ast.ruleId) ast.errors.push(err(5,id));
|
|
|
+ return id;
|
|
|
+ },
|
|
|
+ peg$c14 = function(item) {return item},
|
|
|
+ peg$c15 = function(item, tail) { return new ast.Alternative([item].concat(tail)); },
|
|
|
+ peg$c16 = function(f) { return new ast.Probability(f); },
|
|
|
+ peg$c17 = function(a, b) { return new ast.MinMax(a !== null ? a[0] : b, b); },
|
|
|
+ peg$c18 = function(s, pl) { return new ast.Iterator(s !== null ? s : new ast.MinMax(0, null), pl); },
|
|
|
+ peg$c19 = function(s, pl) { return new ast.Iterator(s !== null ? s : new ast.MinMax(1, null), pl); },
|
|
|
+ peg$c20 = function(pl) { return new ast.Set(pl); },
|
|
|
+ peg$c21 = function(item) { return item; },
|
|
|
+ peg$c22 = function(item, tail) { return [item].concat(tail); },
|
|
|
+ peg$c23 = function(s, pl) { return new ast.SetIterator(s !== null ? s : new ast.MinMax(0, null), pl); },
|
|
|
+ peg$c24 = function(s, pl) { return new ast.SetIterator(s !== null ? s : new ast.MinMax(1, null), pl); },
|
|
|
+ peg$c25 = function(pl) { return new ast.Optional(pl); },
|
|
|
+ peg$c26 = function(share, on) { return new ast.ShareAll(share, on); },
|
|
|
+ peg$c27 = function(id) {
|
|
|
+ if (!(id.id in ast.rulesById)) ast.errors.push(err(21, id.id)); //TODO: move to errors
|
|
|
+ else if (ast.rulesById[id.id].ruleType !== "RootRule") ast.errors.push(err(22, id.id)); //TODO: move to errors
|
|
|
+ return id;
|
|
|
+ },
|
|
|
+ peg$c28 = function(async, srcs, body) { return new ast.Coordinate(Boolean(async), srcs, body); },
|
|
|
+ peg$c29 = function(item) {
|
|
|
+ ast._srcs = {};
|
|
|
+ ast._srcs[item.id] = 1;
|
|
|
+ return [item];
|
|
|
+ },
|
|
|
+ peg$c30 = function(item) {
|
|
|
+ if (item.id in ast._srcs) ast.errors.push(err(19, item.id));
|
|
|
+ ast._srcs[item.id] = 1;
|
|
|
+ return item;
|
|
|
+ },
|
|
|
+ peg$c31 = function(head, tail) { return head.concat(tail); },
|
|
|
+ peg$c32 = function(item) { return item },
|
|
|
+ peg$c33 = function(v, s, f) {
|
|
|
+ var frm = f ? f[1] : null;
|
|
|
+ if (frm && frm[0] === "$" && !(frm in ast._srcs)) ast.errors.push(err(17, frm));
|
|
|
+ return new ast.CoordinateSource(v, s, frm);
|
|
|
+ },
|
|
|
+ peg$c34 = function(rels) { return new ast.AddOperation(rels); },
|
|
|
+ peg$c35 = function(item) {
|
|
|
+ if (!(item.src in ast._srcs)) ast.errors.push(err(17, item.src));
|
|
|
+ if (!(item.dst in ast._srcs)) ast.errors.push(err(17, item.dst));
|
|
|
+ return [item];
|
|
|
+ },
|
|
|
+ peg$c36 = function(item) {
|
|
|
+ if (!(item.src in ast._srcs)) ast.errors.push(err(17, item.src));
|
|
|
+ if (!(item.dst in ast._srcs)) ast.errors.push(err(17, item.dst));
|
|
|
+ return item;
|
|
|
+ },
|
|
|
+ peg$c37 = function(start, relType, second) { return new ast.Relationship(start, relType, second); },
|
|
|
+ peg$c38 = function(alts) { return new ast.Alternative(alts); },
|
|
|
+ peg$c39 = function(item) {return item;},
|
|
|
+ peg$c40 = { type: "other", description: "SCHEMA identifier" },
|
|
|
+ peg$c41 = "WHEN",
|
|
|
+ peg$c42 = { type: "literal", value: "WHEN", description: "\"WHEN\"" },
|
|
|
+ peg$c43 = "COORDINATE",
|
|
|
+ peg$c44 = { type: "literal", value: "COORDINATE", description: "\"COORDINATE\"" },
|
|
|
+ peg$c45 = "ENSURE",
|
|
|
+ peg$c46 = { type: "literal", value: "ENSURE", description: "\"ENSURE\"" },
|
|
|
+ peg$c47 = "DO",
|
|
|
+ peg$c48 = { type: "literal", value: "DO", description: "\"DO\"" },
|
|
|
+ peg$c49 = "OD",
|
|
|
+ peg$c50 = { type: "literal", value: "OD", description: "\"OD\"" },
|
|
|
+ peg$c51 = "FROM",
|
|
|
+ peg$c52 = { type: "literal", value: "FROM", description: "\"FROM\"" },
|
|
|
+ peg$c53 = { type: "other", description: "ROOT identifier" },
|
|
|
+ peg$c54 = function(id) { return new ast.Event(id); },
|
|
|
+ peg$c55 = { type: "other", description: "EVENT identifier" },
|
|
|
+ peg$c56 = { type: "other", description: "VARIABLE" },
|
|
|
+ peg$c57 = "$",
|
|
|
+ peg$c58 = { type: "literal", value: "$", description: "\"$\"" },
|
|
|
+ peg$c59 = function(id) { return "$" + id; },
|
|
|
+ peg$c60 = /^[A-Za-z]/,
|
|
|
+ peg$c61 = { type: "class", value: "[A-Za-z]", description: "[A-Za-z]" },
|
|
|
+ peg$c62 = /^[a-zA-Z0-9_]/,
|
|
|
+ peg$c63 = { type: "class", value: "[a-zA-Z0-9_]", description: "[a-zA-Z0-9_]" },
|
|
|
+ peg$c64 = function(a, b) { return a + b.join(""); },
|
|
|
+ peg$c65 = /^[0-9]/,
|
|
|
+ peg$c66 = { type: "class", value: "[0-9]", description: "[0-9]" },
|
|
|
+ peg$c67 = function(a) { return a.join(""); },
|
|
|
+ peg$c68 = /^[1-9]/,
|
|
|
+ peg$c69 = { type: "class", value: "[1-9]", description: "[1-9]" },
|
|
|
+ peg$c70 = ".",
|
|
|
+ peg$c71 = { type: "literal", value: ".", description: "\".\"" },
|
|
|
+ peg$c72 = function(a, b) { return parseFloat(b ? a.join("") + "." + b[1].join("") : a.join("")); },
|
|
|
+ peg$c73 = function(b) { return parseFloat("." + b.join("")); },
|
|
|
+ peg$c74 = "(*",
|
|
|
+ peg$c75 = { type: "literal", value: "(*", description: "\"(*\"" },
|
|
|
+ peg$c76 = "*)",
|
|
|
+ peg$c77 = { type: "literal", value: "*)", description: "\"*)\"" },
|
|
|
+ peg$c78 = "(+",
|
|
|
+ peg$c79 = { type: "literal", value: "(+", description: "\"(+\"" },
|
|
|
+ peg$c80 = "+)",
|
|
|
+ peg$c81 = { type: "literal", value: "+)", description: "\"+)\"" },
|
|
|
+ peg$c82 = "{*",
|
|
|
+ peg$c83 = { type: "literal", value: "{*", description: "\"{*\"" },
|
|
|
+ peg$c84 = "*}",
|
|
|
+ peg$c85 = { type: "literal", value: "*}", description: "\"*}\"" },
|
|
|
+ peg$c86 = "{+",
|
|
|
+ peg$c87 = { type: "literal", value: "{+", description: "\"{+\"" },
|
|
|
+ peg$c88 = "+}",
|
|
|
+ peg$c89 = { type: "literal", value: "+}", description: "\"+}\"" },
|
|
|
+ peg$c90 = "<!>",
|
|
|
+ peg$c91 = { type: "literal", value: "<!>", description: "\"<!>\"" },
|
|
|
+ peg$c92 = "|+|",
|
|
|
+ peg$c93 = { type: "literal", value: "|+|", description: "\"|+|\"" },
|
|
|
+ peg$c94 = "..",
|
|
|
+ peg$c95 = { type: "literal", value: "..", description: "\"..\"" },
|
|
|
+ peg$c96 = "(",
|
|
|
+ peg$c97 = { type: "literal", value: "(", description: "\"(\"" },
|
|
|
+ peg$c98 = ")",
|
|
|
+ peg$c99 = { type: "literal", value: ")", description: "\")\"" },
|
|
|
+ peg$c100 = "{",
|
|
|
+ peg$c101 = { type: "literal", value: "{", description: "\"{\"" },
|
|
|
+ peg$c102 = "}",
|
|
|
+ peg$c103 = { type: "literal", value: "}", description: "\"}\"" },
|
|
|
+ peg$c104 = "[",
|
|
|
+ peg$c105 = { type: "literal", value: "[", description: "\"[\"" },
|
|
|
+ peg$c106 = "]",
|
|
|
+ peg$c107 = { type: "literal", value: "]", description: "\"]\"" },
|
|
|
+ peg$c108 = "<",
|
|
|
+ peg$c109 = { type: "literal", value: "<", description: "\"<\"" },
|
|
|
+ peg$c110 = ">",
|
|
|
+ peg$c111 = { type: "literal", value: ">", description: "\">\"" },
|
|
|
+ peg$c112 = "<<",
|
|
|
+ peg$c113 = { type: "literal", value: "<<", description: "\"<<\"" },
|
|
|
+ peg$c114 = ">>",
|
|
|
+ peg$c115 = { type: "literal", value: ">>", description: "\">>\"" },
|
|
|
+ peg$c116 = ":",
|
|
|
+ peg$c117 = { type: "literal", value: ":", description: "\":\"" },
|
|
|
+ peg$c118 = ";",
|
|
|
+ peg$c119 = { type: "literal", value: ";", description: "\";\"" },
|
|
|
+ peg$c120 = ",",
|
|
|
+ peg$c121 = { type: "literal", value: ",", description: "\",\"" },
|
|
|
+ peg$c122 = "|",
|
|
|
+ peg$c123 = { type: "literal", value: "|", description: "\"|\"" },
|
|
|
+ peg$c124 = "SCHEMA",
|
|
|
+ peg$c125 = { type: "literal", value: "SCHEMA", description: "\"SCHEMA\"" },
|
|
|
+ peg$c126 = "INCLUDE",
|
|
|
+ peg$c127 = { type: "literal", value: "INCLUDE", description: "\"INCLUDE\"" },
|
|
|
+ peg$c128 = "ROOT",
|
|
|
+ peg$c129 = { type: "literal", value: "ROOT", description: "\"ROOT\"" },
|
|
|
+ peg$c130 = "SHARE",
|
|
|
+ peg$c131 = { type: "literal", value: "SHARE", description: "\"SHARE\"" },
|
|
|
+ peg$c132 = "ALL",
|
|
|
+ peg$c133 = { type: "literal", value: "ALL", description: "\"ALL\"" },
|
|
|
+ peg$c134 = "ADD",
|
|
|
+ peg$c135 = { type: "literal", value: "ADD", description: "\"ADD\"" },
|
|
|
+ peg$c136 = "IN",
|
|
|
+ peg$c137 = { type: "literal", value: "IN", description: "\"IN\"" },
|
|
|
+ peg$c138 = function() { return "IN"; },
|
|
|
+ peg$c139 = "CONTAINS",
|
|
|
+ peg$c140 = { type: "literal", value: "CONTAINS", description: "\"CONTAINS\"" },
|
|
|
+ peg$c141 = function() { return "CONTAINS"; },
|
|
|
+ peg$c142 = "PRECEDES",
|
|
|
+ peg$c143 = { type: "literal", value: "PRECEDES", description: "\"PRECEDES\"" },
|
|
|
+ peg$c144 = function() { return "PRECEDES"; },
|
|
|
+ peg$c145 = "FOLLOWS",
|
|
|
+ peg$c146 = { type: "literal", value: "FOLLOWS", description: "\"FOLLOWS\"" },
|
|
|
+ peg$c147 = function() { return "FOLLOWS"; },
|
|
|
+ peg$c148 = "this",
|
|
|
+ peg$c149 = { type: "literal", value: "this", description: "\"this\"" },
|
|
|
+ peg$c150 = function() { return "this"; },
|
|
|
+ peg$c151 = "BUILD",
|
|
|
+ peg$c152 = { type: "literal", value: "BUILD", description: "\"BUILD\"" },
|
|
|
+ peg$c153 = "NEW",
|
|
|
+ peg$c154 = { type: "literal", value: "NEW", description: "\"NEW\"" },
|
|
|
+ peg$c155 = "MAP",
|
|
|
+ peg$c156 = { type: "literal", value: "MAP", description: "\"MAP\"" },
|
|
|
+ peg$c157 = { type: "any", description: "any character" },
|
|
|
+ peg$c158 = { type: "other", description: "optional whitespace" },
|
|
|
+ peg$c159 = /^[ \t\n\r]/,
|
|
|
+ peg$c160 = { type: "class", value: "[ \\t\\n\\r]", description: "[ \\t\\n\\r]" },
|
|
|
+ peg$c161 = function() { return null; },
|
|
|
+ peg$c162 = { type: "other", description: "required whitespace" },
|
|
|
+ peg$c163 = { type: "other", description: "newline" },
|
|
|
+ peg$c164 = /^[\n]/,
|
|
|
+ peg$c165 = { type: "class", value: "[\\n]", description: "[\\n]" },
|
|
|
+ peg$c166 = function(c) { return c },
|
|
|
+ peg$c167 = { type: "other", description: "comment line" },
|
|
|
+ peg$c168 = "//",
|
|
|
+ peg$c169 = { type: "literal", value: "//", description: "\"//\"" },
|
|
|
+ peg$c170 = /^[^\n]/,
|
|
|
+ peg$c171 = { type: "class", value: "[^\\n]", description: "[^\\n]" },
|
|
|
+ peg$c172 = function(c) { return new ast.Comment(false, c.join("")); },
|
|
|
+ peg$c173 = { type: "other", description: "comment block" },
|
|
|
+ peg$c174 = "/*",
|
|
|
+ peg$c175 = { type: "literal", value: "/*", description: "\"/*\"" },
|
|
|
+ peg$c176 = "*/",
|
|
|
+ peg$c177 = { type: "literal", value: "*/", description: "\"*/\"" },
|
|
|
+ peg$c178 = function(c) { return new ast.Comment(true, c.join("")); },
|
|
|
+ peg$c179 = function(c) { return c; },
|
|
|
+
|
|
|
+ peg$currPos = 0,
|
|
|
+ peg$reportedPos = 0,
|
|
|
+ peg$cachedPos = 0,
|
|
|
+ peg$cachedPosDetails = { line: 1, column: 1, seenCR: false },
|
|
|
+ peg$maxFailPos = 0,
|
|
|
+ peg$maxFailExpected = [],
|
|
|
+ peg$silentFails = 0,
|
|
|
+
|
|
|
+ peg$result;
|
|
|
+
|
|
|
+ if ("startRule" in options) {
|
|
|
+ if (!(options.startRule in peg$startRuleFunctions)) {
|
|
|
+ throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
|
|
|
+ }
|
|
|
+
|
|
|
+ peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
|
|
|
+ }
|
|
|
+
|
|
|
+ function text() {
|
|
|
+ return input.substring(peg$reportedPos, peg$currPos);
|
|
|
+ }
|
|
|
+
|
|
|
+ function offset() {
|
|
|
+ return peg$reportedPos;
|
|
|
+ }
|
|
|
+
|
|
|
+ function line() {
|
|
|
+ return peg$computePosDetails(peg$reportedPos).line;
|
|
|
+ }
|
|
|
+
|
|
|
+ function column() {
|
|
|
+ return peg$computePosDetails(peg$reportedPos).column;
|
|
|
+ }
|
|
|
+
|
|
|
+ function expected(description) {
|
|
|
+ throw peg$buildException(
|
|
|
+ null,
|
|
|
+ [{ type: "other", description: description }],
|
|
|
+ peg$reportedPos
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ function error(message) {
|
|
|
+ throw peg$buildException(message, null, peg$reportedPos);
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$computePosDetails(pos) {
|
|
|
+ function advance(details, startPos, endPos) {
|
|
|
+ var p, ch;
|
|
|
+
|
|
|
+ for (p = startPos; p < endPos; p++) {
|
|
|
+ ch = input.charAt(p);
|
|
|
+ if (ch === "\n") {
|
|
|
+ if (!details.seenCR) { details.line++; }
|
|
|
+ details.column = 1;
|
|
|
+ details.seenCR = false;
|
|
|
+ } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") {
|
|
|
+ details.line++;
|
|
|
+ details.column = 1;
|
|
|
+ details.seenCR = true;
|
|
|
+ } else {
|
|
|
+ details.column++;
|
|
|
+ details.seenCR = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (peg$cachedPos !== pos) {
|
|
|
+ if (peg$cachedPos > pos) {
|
|
|
+ peg$cachedPos = 0;
|
|
|
+ peg$cachedPosDetails = { line: 1, column: 1, seenCR: false };
|
|
|
+ }
|
|
|
+ advance(peg$cachedPosDetails, peg$cachedPos, pos);
|
|
|
+ peg$cachedPos = pos;
|
|
|
+ }
|
|
|
+
|
|
|
+ return peg$cachedPosDetails;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$fail(expected) {
|
|
|
+ if (peg$currPos < peg$maxFailPos) { return; }
|
|
|
+
|
|
|
+ if (peg$currPos > peg$maxFailPos) {
|
|
|
+ peg$maxFailPos = peg$currPos;
|
|
|
+ peg$maxFailExpected = [];
|
|
|
+ }
|
|
|
+
|
|
|
+ peg$maxFailExpected.push(expected);
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$buildException(message, expected, pos) {
|
|
|
+ function cleanupExpected(expected) {
|
|
|
+ var i = 1;
|
|
|
+
|
|
|
+ expected.sort(function(a, b) {
|
|
|
+ if (a.description < b.description) {
|
|
|
+ return -1;
|
|
|
+ } else if (a.description > b.description) {
|
|
|
+ return 1;
|
|
|
+ } else {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ while (i < expected.length) {
|
|
|
+ if (expected[i - 1] === expected[i]) {
|
|
|
+ expected.splice(i, 1);
|
|
|
+ } else {
|
|
|
+ i++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function buildMessage(expected, found) {
|
|
|
+ function stringEscape(s) {
|
|
|
+ function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); }
|
|
|
+
|
|
|
+ return s
|
|
|
+ .replace(/\\/g, '\\\\')
|
|
|
+ .replace(/"/g, '\\"')
|
|
|
+ .replace(/\x08/g, '\\b')
|
|
|
+ .replace(/\t/g, '\\t')
|
|
|
+ .replace(/\n/g, '\\n')
|
|
|
+ .replace(/\f/g, '\\f')
|
|
|
+ .replace(/\r/g, '\\r')
|
|
|
+ .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); })
|
|
|
+ .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); })
|
|
|
+ .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); })
|
|
|
+ .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); });
|
|
|
+ }
|
|
|
+
|
|
|
+ var expectedDescs = new Array(expected.length),
|
|
|
+ expectedDesc, foundDesc, i;
|
|
|
+
|
|
|
+ for (i = 0; i < expected.length; i++) {
|
|
|
+ expectedDescs[i] = expected[i].description;
|
|
|
+ }
|
|
|
+
|
|
|
+ expectedDesc = expected.length > 1
|
|
|
+ ? expectedDescs.slice(0, -1).join(", ")
|
|
|
+ + " or "
|
|
|
+ + expectedDescs[expected.length - 1]
|
|
|
+ : expectedDescs[0];
|
|
|
+
|
|
|
+ foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input";
|
|
|
+
|
|
|
+ return "Expected " + expectedDesc + " but " + foundDesc + " found.";
|
|
|
+ }
|
|
|
+
|
|
|
+ var posDetails = peg$computePosDetails(pos),
|
|
|
+ found = pos < input.length ? input.charAt(pos) : null;
|
|
|
+
|
|
|
+ if (expected !== null) {
|
|
|
+ cleanupExpected(expected);
|
|
|
+ }
|
|
|
+
|
|
|
+ return new SyntaxError(
|
|
|
+ message !== null ? message : buildMessage(expected, found),
|
|
|
+ expected,
|
|
|
+ found,
|
|
|
+ pos,
|
|
|
+ posDetails.line,
|
|
|
+ posDetails.column
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsestart() {
|
|
|
+ var s0, s1, s2;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ peg$reportedPos = peg$currPos;
|
|
|
+ s1 = peg$c1();
|
|
|
+ if (s1) {
|
|
|
+ s1 = peg$c0;
|
|
|
+ } else {
|
|
|
+ s1 = peg$c2;
|
|
|
+ }
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = peg$parseschema();
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c3(s2);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseschema() {
|
|
|
+ var s0, s1, s2, s3, s4;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$currPos;
|
|
|
+ s2 = peg$parseSCHEMA();
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parseschema_id();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s4 = peg$parsesemi();
|
|
|
+ if (s4 === peg$FAILED) {
|
|
|
+ s4 = peg$c4;
|
|
|
+ }
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ s2 = [s2, s3, s4];
|
|
|
+ s1 = s2;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s1;
|
|
|
+ s1 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s1;
|
|
|
+ s1 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s1;
|
|
|
+ s1 = peg$c0;
|
|
|
+ }
|
|
|
+ if (s1 === peg$FAILED) {
|
|
|
+ s1 = peg$c4;
|
|
|
+ }
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = [];
|
|
|
+ s3 = peg$parseschema_include();
|
|
|
+ while (s3 !== peg$FAILED) {
|
|
|
+ s2.push(s3);
|
|
|
+ s3 = peg$parseschema_include();
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = [];
|
|
|
+ s4 = peg$parseschema_statement();
|
|
|
+ while (s4 !== peg$FAILED) {
|
|
|
+ s3.push(s4);
|
|
|
+ s4 = peg$parseschema_statement();
|
|
|
+ }
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s4 = peg$parseEOF();
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c6(s2, s3);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseschema_include() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ peg$silentFails++;
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parseINCLUDE();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = peg$parseschema_id();
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parsesemi();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c8(s2);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ peg$silentFails--;
|
|
|
+ if (s0 === peg$FAILED) {
|
|
|
+ s1 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c7); }
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseschema_statement() {
|
|
|
+ var s0, s1, s2;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parserule();
|
|
|
+ if (s1 === peg$FAILED) {
|
|
|
+ s1 = peg$parsecomposition_operation();
|
|
|
+ }
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = peg$parsesemi();
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c9(s1);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parserule() {
|
|
|
+ var s0, s1, s2, s3, s4, s5;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parseROOT();
|
|
|
+ if (s1 === peg$FAILED) {
|
|
|
+ s1 = peg$c4;
|
|
|
+ }
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = peg$parseroot_id();
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = peg$currPos;
|
|
|
+ s3 = peg$c10(s1, s2);
|
|
|
+ if (s3) {
|
|
|
+ s3 = peg$c0;
|
|
|
+ } else {
|
|
|
+ s3 = peg$c2;
|
|
|
+ }
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s4 = peg$parsecolon();
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ s5 = peg$parsepattern_list();
|
|
|
+ if (s5 === peg$FAILED) {
|
|
|
+ s5 = peg$c4;
|
|
|
+ }
|
|
|
+ if (s5 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c11(s1, s2, s5);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsepattern_list() {
|
|
|
+ var s0, s1, s2;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = [];
|
|
|
+ s2 = peg$parsepattern_unit();
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ while (s2 !== peg$FAILED) {
|
|
|
+ s1.push(s2);
|
|
|
+ s2 = peg$parsepattern_unit();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ s1 = peg$c0;
|
|
|
+ }
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c12(s1);
|
|
|
+ }
|
|
|
+ s0 = s1;
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsepattern_unit() {
|
|
|
+ var s0, s1;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parseevent_id();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c13(s1);
|
|
|
+ }
|
|
|
+ s0 = s1;
|
|
|
+ if (s0 === peg$FAILED) {
|
|
|
+ s0 = peg$parsealternative();
|
|
|
+ if (s0 === peg$FAILED) {
|
|
|
+ s0 = peg$parseiterator();
|
|
|
+ if (s0 === peg$FAILED) {
|
|
|
+ s0 = peg$parseiterator_plus();
|
|
|
+ if (s0 === peg$FAILED) {
|
|
|
+ s0 = peg$parseset();
|
|
|
+ if (s0 === peg$FAILED) {
|
|
|
+ s0 = peg$parseset_iterator();
|
|
|
+ if (s0 === peg$FAILED) {
|
|
|
+ s0 = peg$parseset_iterator_plus();
|
|
|
+ if (s0 === peg$FAILED) {
|
|
|
+ s0 = peg$parseoptional();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsealternative() {
|
|
|
+ var s0, s1, s2, s3, s4, s5, s6;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parseparenL();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = peg$parsepattern_list();
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = [];
|
|
|
+ s4 = peg$currPos;
|
|
|
+ s5 = peg$parsepipe();
|
|
|
+ if (s5 !== peg$FAILED) {
|
|
|
+ s6 = peg$parsepattern_list();
|
|
|
+ if (s6 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s4;
|
|
|
+ s5 = peg$c14(s6);
|
|
|
+ s4 = s5;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s4;
|
|
|
+ s4 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s4;
|
|
|
+ s4 = peg$c0;
|
|
|
+ }
|
|
|
+ while (s4 !== peg$FAILED) {
|
|
|
+ s3.push(s4);
|
|
|
+ s4 = peg$currPos;
|
|
|
+ s5 = peg$parsepipe();
|
|
|
+ if (s5 !== peg$FAILED) {
|
|
|
+ s6 = peg$parsepattern_list();
|
|
|
+ if (s6 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s4;
|
|
|
+ s5 = peg$c14(s6);
|
|
|
+ s4 = s5;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s4;
|
|
|
+ s4 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s4;
|
|
|
+ s4 = peg$c0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s4 = peg$parseparenR();
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c15(s2, s3);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseprobability() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parseltlt();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = peg$parsefloat();
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parsegtgt();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c16(s2);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseiterator_scope_any() {
|
|
|
+ var s0, s1, s2, s3, s4;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parselt();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = peg$currPos;
|
|
|
+ s3 = peg$parseinteger();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s4 = peg$parseto();
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ s3 = [s3, s4];
|
|
|
+ s2 = s3;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s2;
|
|
|
+ s2 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s2;
|
|
|
+ s2 = peg$c0;
|
|
|
+ }
|
|
|
+ if (s2 === peg$FAILED) {
|
|
|
+ s2 = peg$c4;
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parseinteger();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s4 = peg$parsegt();
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c17(s2, s3);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseiterator_scope_some() {
|
|
|
+ var s0, s1, s2, s3, s4;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parselt();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = peg$currPos;
|
|
|
+ s3 = peg$parseinteger_gt0();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s4 = peg$parseto();
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ s3 = [s3, s4];
|
|
|
+ s2 = s3;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s2;
|
|
|
+ s2 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s2;
|
|
|
+ s2 = peg$c0;
|
|
|
+ }
|
|
|
+ if (s2 === peg$FAILED) {
|
|
|
+ s2 = peg$c4;
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parseinteger_gt0();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s4 = peg$parsegt();
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c17(s2, s3);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseiterator() {
|
|
|
+ var s0, s1, s2, s3, s4;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parsebegin_iter();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = peg$parseiterator_scope_any();
|
|
|
+ if (s2 === peg$FAILED) {
|
|
|
+ s2 = peg$c4;
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parsepattern_list();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s4 = peg$parseend_iter();
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c18(s2, s3);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseiterator_plus() {
|
|
|
+ var s0, s1, s2, s3, s4;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parsebegin_itpl();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = peg$parseiterator_scope_some();
|
|
|
+ if (s2 === peg$FAILED) {
|
|
|
+ s2 = peg$c4;
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parsepattern_list();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s4 = peg$parseend_itpl();
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c19(s2, s3);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseset() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parsebraceL();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = peg$parsepattern_lists_by_comma();
|
|
|
+ if (s2 === peg$FAILED) {
|
|
|
+ s2 = peg$c4;
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parsebraceR();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c20(s2);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsepattern_lists_by_comma() {
|
|
|
+ var s0, s1, s2, s3, s4, s5;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parsepattern_list();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = [];
|
|
|
+ s3 = peg$currPos;
|
|
|
+ s4 = peg$parsecomma();
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ s5 = peg$parsepattern_list();
|
|
|
+ if (s5 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s3;
|
|
|
+ s4 = peg$c21(s5);
|
|
|
+ s3 = s4;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ while (s3 !== peg$FAILED) {
|
|
|
+ s2.push(s3);
|
|
|
+ s3 = peg$currPos;
|
|
|
+ s4 = peg$parsecomma();
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ s5 = peg$parsepattern_list();
|
|
|
+ if (s5 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s3;
|
|
|
+ s4 = peg$c21(s5);
|
|
|
+ s3 = s4;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c22(s1, s2);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseset_iterator() {
|
|
|
+ var s0, s1, s2, s3, s4;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parsebegin_seti();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = peg$parseiterator_scope_any();
|
|
|
+ if (s2 === peg$FAILED) {
|
|
|
+ s2 = peg$c4;
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parsepattern_list();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s4 = peg$parseend_seti();
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c23(s2, s3);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseset_iterator_plus() {
|
|
|
+ var s0, s1, s2, s3, s4;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parsebegin_setp();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = peg$parseiterator_scope_some();
|
|
|
+ if (s2 === peg$FAILED) {
|
|
|
+ s2 = peg$c4;
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parsepattern_list();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s4 = peg$parseend_setp();
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c24(s2, s3);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseoptional() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parsebracketL();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = peg$parsepattern_list();
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parsebracketR();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c25(s2);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsecomposition_operation() {
|
|
|
+ var s0;
|
|
|
+
|
|
|
+ s0 = peg$parseshared_composition();
|
|
|
+ if (s0 === peg$FAILED) {
|
|
|
+ s0 = peg$parsecoordinate_composition();
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseshared_composition() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parseroot_or_var_by_exunionstr_by_comma();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = peg$parseSHARE_ALL();
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parseevent_id_by_comma();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c26(s1, s3);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseroot_or_var() {
|
|
|
+ var s0, s1;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parseroot_id();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c27(s1);
|
|
|
+ }
|
|
|
+ s0 = s1;
|
|
|
+ if (s0 === peg$FAILED) {
|
|
|
+ s0 = peg$parsevariable();
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseroot_or_var_by_exunionstr() {
|
|
|
+ var s0, s1, s2, s3, s4, s5;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parseroot_or_var();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = [];
|
|
|
+ s3 = peg$currPos;
|
|
|
+ s4 = peg$parseexunionstr();
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ s5 = peg$parseroot_or_var();
|
|
|
+ if (s5 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s3;
|
|
|
+ s4 = peg$c21(s5);
|
|
|
+ s3 = s4;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ while (s3 !== peg$FAILED) {
|
|
|
+ s2.push(s3);
|
|
|
+ s3 = peg$currPos;
|
|
|
+ s4 = peg$parseexunionstr();
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ s5 = peg$parseroot_or_var();
|
|
|
+ if (s5 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s3;
|
|
|
+ s4 = peg$c21(s5);
|
|
|
+ s3 = s4;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c22(s1, s2);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseroot_or_var_by_exunionstr_by_comma() {
|
|
|
+ var s0, s1, s2, s3, s4, s5;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parseroot_or_var_by_exunionstr();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = [];
|
|
|
+ s3 = peg$currPos;
|
|
|
+ s4 = peg$parsecomma();
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ s5 = peg$parseroot_or_var_by_exunionstr();
|
|
|
+ if (s5 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s3;
|
|
|
+ s4 = peg$c21(s5);
|
|
|
+ s3 = s4;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ while (s3 !== peg$FAILED) {
|
|
|
+ s2.push(s3);
|
|
|
+ s3 = peg$currPos;
|
|
|
+ s4 = peg$parsecomma();
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ s5 = peg$parseroot_or_var_by_exunionstr();
|
|
|
+ if (s5 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s3;
|
|
|
+ s4 = peg$c21(s5);
|
|
|
+ s3 = s4;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c22(s1, s2);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseevent_id_by_comma() {
|
|
|
+ var s0, s1, s2, s3, s4, s5;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parseevent_id();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = [];
|
|
|
+ s3 = peg$currPos;
|
|
|
+ s4 = peg$parsecomma();
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ s5 = peg$parseevent_id();
|
|
|
+ if (s5 !== peg$FAILED) {
|
|
|
+ s4 = [s4, s5];
|
|
|
+ s3 = s4;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ while (s3 !== peg$FAILED) {
|
|
|
+ s2.push(s3);
|
|
|
+ s3 = peg$currPos;
|
|
|
+ s4 = peg$parsecomma();
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ s5 = peg$parseevent_id();
|
|
|
+ if (s5 !== peg$FAILED) {
|
|
|
+ s4 = [s4, s5];
|
|
|
+ s3 = s4;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c22(s1, s2);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsecoordinate_composition() {
|
|
|
+ var s0, s1, s2, s3, s4, s5, s6;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parseCOORDINATE();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = peg$parseasyncstr();
|
|
|
+ if (s2 === peg$FAILED) {
|
|
|
+ s2 = peg$c4;
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parsecoordination_source_by_comma();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s4 = peg$parseDO();
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ s5 = [];
|
|
|
+ s6 = peg$parsedo_body_statement();
|
|
|
+ if (s6 !== peg$FAILED) {
|
|
|
+ while (s6 !== peg$FAILED) {
|
|
|
+ s5.push(s6);
|
|
|
+ s6 = peg$parsedo_body_statement();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ s5 = peg$c0;
|
|
|
+ }
|
|
|
+ if (s5 !== peg$FAILED) {
|
|
|
+ s6 = peg$parseOD();
|
|
|
+ if (s6 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c28(s2, s3, s5);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsecoordination_source_by_comma() {
|
|
|
+ var s0, s1, s2, s3, s4, s5;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$currPos;
|
|
|
+ s2 = peg$parsecoordination_source();
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s1;
|
|
|
+ s2 = peg$c29(s2);
|
|
|
+ }
|
|
|
+ s1 = s2;
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = [];
|
|
|
+ s3 = peg$currPos;
|
|
|
+ s4 = peg$parsecomma();
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ s5 = peg$parsecoordination_source();
|
|
|
+ if (s5 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s3;
|
|
|
+ s4 = peg$c30(s5);
|
|
|
+ s3 = s4;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ while (s3 !== peg$FAILED) {
|
|
|
+ s2.push(s3);
|
|
|
+ s3 = peg$currPos;
|
|
|
+ s4 = peg$parsecomma();
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ s5 = peg$parsecoordination_source();
|
|
|
+ if (s5 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s3;
|
|
|
+ s4 = peg$c30(s5);
|
|
|
+ s3 = s4;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c31(s1, s2);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsedo_body_statement() {
|
|
|
+ var s0, s1, s2;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parseadd_relation();
|
|
|
+ if (s1 === peg$FAILED) {
|
|
|
+ s1 = peg$parseshared_composition();
|
|
|
+ if (s1 === peg$FAILED) {
|
|
|
+ s1 = peg$parsecoordinate_composition();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = peg$parsesemi();
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c32(s1);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsecoordination_source() {
|
|
|
+ var s0, s1, s2, s3, s4, s5, s6;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parsevariable();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = peg$parsecolon();
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parseselection_pattern();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s4 = peg$currPos;
|
|
|
+ s5 = peg$parseFROM();
|
|
|
+ if (s5 !== peg$FAILED) {
|
|
|
+ s6 = peg$parseTHIS();
|
|
|
+ if (s6 === peg$FAILED) {
|
|
|
+ s6 = peg$parseroot_or_var();
|
|
|
+ }
|
|
|
+ if (s6 !== peg$FAILED) {
|
|
|
+ s5 = [s5, s6];
|
|
|
+ s4 = s5;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s4;
|
|
|
+ s4 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s4;
|
|
|
+ s4 = peg$c0;
|
|
|
+ }
|
|
|
+ if (s4 === peg$FAILED) {
|
|
|
+ s4 = peg$c4;
|
|
|
+ }
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c33(s1, s3, s4);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseadd_relation() {
|
|
|
+ var s0, s1, s2;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parseADD();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = peg$parserelationships_by_comma();
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c34(s2);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parserelationships_by_comma() {
|
|
|
+ var s0, s1, s2, s3, s4, s5;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$currPos;
|
|
|
+ s2 = peg$parserelationship();
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s1;
|
|
|
+ s2 = peg$c35(s2);
|
|
|
+ }
|
|
|
+ s1 = s2;
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = [];
|
|
|
+ s3 = peg$currPos;
|
|
|
+ s4 = peg$parsecomma();
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ s5 = peg$parserelationship();
|
|
|
+ if (s5 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s3;
|
|
|
+ s4 = peg$c36(s5);
|
|
|
+ s3 = s4;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ while (s3 !== peg$FAILED) {
|
|
|
+ s2.push(s3);
|
|
|
+ s3 = peg$currPos;
|
|
|
+ s4 = peg$parsecomma();
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ s5 = peg$parserelationship();
|
|
|
+ if (s5 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s3;
|
|
|
+ s4 = peg$c36(s5);
|
|
|
+ s3 = s4;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c31(s1, s2);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parserelationship() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parsevariable();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = peg$parseIN();
|
|
|
+ if (s2 === peg$FAILED) {
|
|
|
+ s2 = peg$parsePRECEDES();
|
|
|
+ if (s2 === peg$FAILED) {
|
|
|
+ s2 = peg$parseCONTAINS();
|
|
|
+ if (s2 === peg$FAILED) {
|
|
|
+ s2 = peg$parseFOLLOWS();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parsevariable();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c37(s1, s2, s3);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseselection_pattern() {
|
|
|
+ var s0;
|
|
|
+
|
|
|
+ s0 = peg$parseevent_id();
|
|
|
+ if (s0 === peg$FAILED) {
|
|
|
+ s0 = peg$parsealternative_of_event_names();
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsealternative_of_event_names() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parseparenL();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = peg$parseevent_id_by_pipe();
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parseparenR();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c38(s2);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseevent_id_by_pipe() {
|
|
|
+ var s0, s1, s2, s3, s4, s5;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parseevent_id();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = [];
|
|
|
+ s3 = peg$currPos;
|
|
|
+ s4 = peg$parsepipe();
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ s5 = peg$parseevent_id();
|
|
|
+ if (s5 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s3;
|
|
|
+ s4 = peg$c39(s5);
|
|
|
+ s3 = s4;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ while (s3 !== peg$FAILED) {
|
|
|
+ s2.push(s3);
|
|
|
+ s3 = peg$currPos;
|
|
|
+ s4 = peg$parsepipe();
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ s5 = peg$parseevent_id();
|
|
|
+ if (s5 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s3;
|
|
|
+ s4 = peg$c39(s5);
|
|
|
+ s3 = s4;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c22(s1, s2);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseschema_id() {
|
|
|
+ var s0, s1;
|
|
|
+
|
|
|
+ peg$silentFails++;
|
|
|
+ s0 = peg$parseid();
|
|
|
+ peg$silentFails--;
|
|
|
+ if (s0 === peg$FAILED) {
|
|
|
+ s1 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c40); }
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsekeyword() {
|
|
|
+ var s0;
|
|
|
+
|
|
|
+ if (input.substr(peg$currPos, 4) === peg$c41) {
|
|
|
+ s0 = peg$c41;
|
|
|
+ peg$currPos += 4;
|
|
|
+ } else {
|
|
|
+ s0 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c42); }
|
|
|
+ }
|
|
|
+ if (s0 === peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 10) === peg$c43) {
|
|
|
+ s0 = peg$c43;
|
|
|
+ peg$currPos += 10;
|
|
|
+ } else {
|
|
|
+ s0 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c44); }
|
|
|
+ }
|
|
|
+ if (s0 === peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 6) === peg$c45) {
|
|
|
+ s0 = peg$c45;
|
|
|
+ peg$currPos += 6;
|
|
|
+ } else {
|
|
|
+ s0 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c46); }
|
|
|
+ }
|
|
|
+ if (s0 === peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 2) === peg$c47) {
|
|
|
+ s0 = peg$c47;
|
|
|
+ peg$currPos += 2;
|
|
|
+ } else {
|
|
|
+ s0 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c48); }
|
|
|
+ }
|
|
|
+ if (s0 === peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 2) === peg$c49) {
|
|
|
+ s0 = peg$c49;
|
|
|
+ peg$currPos += 2;
|
|
|
+ } else {
|
|
|
+ s0 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c50); }
|
|
|
+ }
|
|
|
+ if (s0 === peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 4) === peg$c51) {
|
|
|
+ s0 = peg$c51;
|
|
|
+ peg$currPos += 4;
|
|
|
+ } else {
|
|
|
+ s0 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c52); }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseroot_id() {
|
|
|
+ var s0, s1, s2;
|
|
|
+
|
|
|
+ peg$silentFails++;
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$currPos;
|
|
|
+ peg$silentFails++;
|
|
|
+ s2 = peg$parsekeyword();
|
|
|
+ peg$silentFails--;
|
|
|
+ if (s2 === peg$FAILED) {
|
|
|
+ s1 = peg$c2;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s1;
|
|
|
+ s1 = peg$c0;
|
|
|
+ }
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = peg$parseid();
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c54(s2);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ peg$silentFails--;
|
|
|
+ if (s0 === peg$FAILED) {
|
|
|
+ s1 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c53); }
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseevent_id() {
|
|
|
+ var s0, s1, s2;
|
|
|
+
|
|
|
+ peg$silentFails++;
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$currPos;
|
|
|
+ peg$silentFails++;
|
|
|
+ s2 = peg$parsekeyword();
|
|
|
+ peg$silentFails--;
|
|
|
+ if (s2 === peg$FAILED) {
|
|
|
+ s1 = peg$c2;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s1;
|
|
|
+ s1 = peg$c0;
|
|
|
+ }
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = peg$parseid();
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c54(s2);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ peg$silentFails--;
|
|
|
+ if (s0 === peg$FAILED) {
|
|
|
+ s1 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c55); }
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsevariable() {
|
|
|
+ var s0, s1, s2, s3, s4;
|
|
|
+
|
|
|
+ peg$silentFails++;
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.charCodeAt(peg$currPos) === 36) {
|
|
|
+ s2 = peg$c57;
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c58); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parseid();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s4 = peg$parse_();
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c59(s3);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ peg$silentFails--;
|
|
|
+ if (s0 === peg$FAILED) {
|
|
|
+ s1 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c56); }
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseid() {
|
|
|
+ var s0, s1, s2, s3, s4;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (peg$c60.test(input.charAt(peg$currPos))) {
|
|
|
+ s2 = input.charAt(peg$currPos);
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c61); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = [];
|
|
|
+ if (peg$c62.test(input.charAt(peg$currPos))) {
|
|
|
+ s4 = input.charAt(peg$currPos);
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s4 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c63); }
|
|
|
+ }
|
|
|
+ while (s4 !== peg$FAILED) {
|
|
|
+ s3.push(s4);
|
|
|
+ if (peg$c62.test(input.charAt(peg$currPos))) {
|
|
|
+ s4 = input.charAt(peg$currPos);
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s4 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c63); }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s4 = peg$parse_();
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c64(s2, s3);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseinteger() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = [];
|
|
|
+ if (peg$c65.test(input.charAt(peg$currPos))) {
|
|
|
+ s3 = input.charAt(peg$currPos);
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s3 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c66); }
|
|
|
+ }
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ while (s3 !== peg$FAILED) {
|
|
|
+ s2.push(s3);
|
|
|
+ if (peg$c65.test(input.charAt(peg$currPos))) {
|
|
|
+ s3 = input.charAt(peg$currPos);
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s3 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c66); }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ s2 = peg$c0;
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c67(s2);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseinteger_gt0() {
|
|
|
+ var s0, s1, s2, s3, s4;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (peg$c68.test(input.charAt(peg$currPos))) {
|
|
|
+ s2 = input.charAt(peg$currPos);
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c69); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = [];
|
|
|
+ if (peg$c65.test(input.charAt(peg$currPos))) {
|
|
|
+ s4 = input.charAt(peg$currPos);
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s4 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c66); }
|
|
|
+ }
|
|
|
+ while (s4 !== peg$FAILED) {
|
|
|
+ s3.push(s4);
|
|
|
+ if (peg$c65.test(input.charAt(peg$currPos))) {
|
|
|
+ s4 = input.charAt(peg$currPos);
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s4 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c66); }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s4 = peg$parse_();
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c64(s2, s3);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsefloat() {
|
|
|
+ var s0, s1, s2, s3, s4, s5, s6;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = [];
|
|
|
+ if (peg$c65.test(input.charAt(peg$currPos))) {
|
|
|
+ s3 = input.charAt(peg$currPos);
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s3 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c66); }
|
|
|
+ }
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ while (s3 !== peg$FAILED) {
|
|
|
+ s2.push(s3);
|
|
|
+ if (peg$c65.test(input.charAt(peg$currPos))) {
|
|
|
+ s3 = input.charAt(peg$currPos);
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s3 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c66); }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ s2 = peg$c0;
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$currPos;
|
|
|
+ if (input.charCodeAt(peg$currPos) === 46) {
|
|
|
+ s4 = peg$c70;
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s4 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c71); }
|
|
|
+ }
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ s5 = [];
|
|
|
+ if (peg$c65.test(input.charAt(peg$currPos))) {
|
|
|
+ s6 = input.charAt(peg$currPos);
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s6 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c66); }
|
|
|
+ }
|
|
|
+ if (s6 !== peg$FAILED) {
|
|
|
+ while (s6 !== peg$FAILED) {
|
|
|
+ s5.push(s6);
|
|
|
+ if (peg$c65.test(input.charAt(peg$currPos))) {
|
|
|
+ s6 = input.charAt(peg$currPos);
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s6 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c66); }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ s5 = peg$c0;
|
|
|
+ }
|
|
|
+ if (s5 !== peg$FAILED) {
|
|
|
+ s4 = [s4, s5];
|
|
|
+ s3 = s4;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s3;
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ if (s3 === peg$FAILED) {
|
|
|
+ s3 = peg$c4;
|
|
|
+ }
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c72(s2, s3);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ if (s0 === peg$FAILED) {
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.charCodeAt(peg$currPos) === 46) {
|
|
|
+ s2 = peg$c70;
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c71); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = [];
|
|
|
+ if (peg$c65.test(input.charAt(peg$currPos))) {
|
|
|
+ s4 = input.charAt(peg$currPos);
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s4 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c66); }
|
|
|
+ }
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ while (s4 !== peg$FAILED) {
|
|
|
+ s3.push(s4);
|
|
|
+ if (peg$c65.test(input.charAt(peg$currPos))) {
|
|
|
+ s4 = input.charAt(peg$currPos);
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s4 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c66); }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ s3 = peg$c0;
|
|
|
+ }
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c73(s3);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsebegin_iter() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 2) === peg$c74) {
|
|
|
+ s2 = peg$c74;
|
|
|
+ peg$currPos += 2;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c75); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseend_iter() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 2) === peg$c76) {
|
|
|
+ s2 = peg$c76;
|
|
|
+ peg$currPos += 2;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c77); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsebegin_itpl() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 2) === peg$c78) {
|
|
|
+ s2 = peg$c78;
|
|
|
+ peg$currPos += 2;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c79); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseend_itpl() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 2) === peg$c80) {
|
|
|
+ s2 = peg$c80;
|
|
|
+ peg$currPos += 2;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c81); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsebegin_seti() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 2) === peg$c82) {
|
|
|
+ s2 = peg$c82;
|
|
|
+ peg$currPos += 2;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c83); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseend_seti() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 2) === peg$c84) {
|
|
|
+ s2 = peg$c84;
|
|
|
+ peg$currPos += 2;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c85); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsebegin_setp() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 2) === peg$c86) {
|
|
|
+ s2 = peg$c86;
|
|
|
+ peg$currPos += 2;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c87); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseend_setp() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 2) === peg$c88) {
|
|
|
+ s2 = peg$c88;
|
|
|
+ peg$currPos += 2;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c89); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseasyncstr() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 3) === peg$c90) {
|
|
|
+ s2 = peg$c90;
|
|
|
+ peg$currPos += 3;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c91); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseexunionstr() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 3) === peg$c92) {
|
|
|
+ s2 = peg$c92;
|
|
|
+ peg$currPos += 3;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c93); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseto() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 2) === peg$c94) {
|
|
|
+ s2 = peg$c94;
|
|
|
+ peg$currPos += 2;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c95); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseparenL() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.charCodeAt(peg$currPos) === 40) {
|
|
|
+ s2 = peg$c96;
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c97); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseparenR() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.charCodeAt(peg$currPos) === 41) {
|
|
|
+ s2 = peg$c98;
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c99); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsebraceL() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.charCodeAt(peg$currPos) === 123) {
|
|
|
+ s2 = peg$c100;
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c101); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsebraceR() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.charCodeAt(peg$currPos) === 125) {
|
|
|
+ s2 = peg$c102;
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c103); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsebracketL() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.charCodeAt(peg$currPos) === 91) {
|
|
|
+ s2 = peg$c104;
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c105); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsebracketR() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.charCodeAt(peg$currPos) === 93) {
|
|
|
+ s2 = peg$c106;
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c107); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parselt() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.charCodeAt(peg$currPos) === 60) {
|
|
|
+ s2 = peg$c108;
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c109); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsegt() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.charCodeAt(peg$currPos) === 62) {
|
|
|
+ s2 = peg$c110;
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c111); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseltlt() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 2) === peg$c112) {
|
|
|
+ s2 = peg$c112;
|
|
|
+ peg$currPos += 2;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c113); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsegtgt() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 2) === peg$c114) {
|
|
|
+ s2 = peg$c114;
|
|
|
+ peg$currPos += 2;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c115); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsecolon() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.charCodeAt(peg$currPos) === 58) {
|
|
|
+ s2 = peg$c116;
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c117); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsesemi() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.charCodeAt(peg$currPos) === 59) {
|
|
|
+ s2 = peg$c118;
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c119); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsecomma() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.charCodeAt(peg$currPos) === 44) {
|
|
|
+ s2 = peg$c120;
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c121); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsepipe() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.charCodeAt(peg$currPos) === 124) {
|
|
|
+ s2 = peg$c122;
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c123); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseSCHEMA() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 6) === peg$c124) {
|
|
|
+ s2 = peg$c124;
|
|
|
+ peg$currPos += 6;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c125); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse__();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseINCLUDE() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 7) === peg$c126) {
|
|
|
+ s2 = peg$c126;
|
|
|
+ peg$currPos += 7;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c127); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse__();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseROOT() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 4) === peg$c128) {
|
|
|
+ s2 = peg$c128;
|
|
|
+ peg$currPos += 4;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c129); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse__();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseSHARE_ALL() {
|
|
|
+ var s0, s1, s2, s3, s4, s5;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 5) === peg$c130) {
|
|
|
+ s2 = peg$c130;
|
|
|
+ peg$currPos += 5;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c131); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse__();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 3) === peg$c132) {
|
|
|
+ s4 = peg$c132;
|
|
|
+ peg$currPos += 3;
|
|
|
+ } else {
|
|
|
+ s4 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c133); }
|
|
|
+ }
|
|
|
+ if (s4 !== peg$FAILED) {
|
|
|
+ s5 = peg$parse__();
|
|
|
+ if (s5 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3, s4, s5];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseCOORDINATE() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 10) === peg$c43) {
|
|
|
+ s2 = peg$c43;
|
|
|
+ peg$currPos += 10;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c44); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse__();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseFROM() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 4) === peg$c51) {
|
|
|
+ s2 = peg$c51;
|
|
|
+ peg$currPos += 4;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c52); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse__();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseADD() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 3) === peg$c134) {
|
|
|
+ s2 = peg$c134;
|
|
|
+ peg$currPos += 3;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c135); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse__();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseIN() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 2) === peg$c136) {
|
|
|
+ s2 = peg$c136;
|
|
|
+ peg$currPos += 2;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c137); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse__();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c138();
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseCONTAINS() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 8) === peg$c139) {
|
|
|
+ s2 = peg$c139;
|
|
|
+ peg$currPos += 8;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c140); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse__();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c141();
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsePRECEDES() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 8) === peg$c142) {
|
|
|
+ s2 = peg$c142;
|
|
|
+ peg$currPos += 8;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c143); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse__();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c144();
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseFOLLOWS() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 7) === peg$c145) {
|
|
|
+ s2 = peg$c145;
|
|
|
+ peg$currPos += 7;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c146); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse__();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c147();
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseTHIS() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 4) === peg$c148) {
|
|
|
+ s2 = peg$c148;
|
|
|
+ peg$currPos += 4;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c149); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c150();
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseDO() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 2) === peg$c47) {
|
|
|
+ s2 = peg$c47;
|
|
|
+ peg$currPos += 2;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c48); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseOD() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 2) === peg$c49) {
|
|
|
+ s2 = peg$c49;
|
|
|
+ peg$currPos += 2;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c50); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseBUILD() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 5) === peg$c151) {
|
|
|
+ s2 = peg$c151;
|
|
|
+ peg$currPos += 5;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c152); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseNEW() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 3) === peg$c153) {
|
|
|
+ s2 = peg$c153;
|
|
|
+ peg$currPos += 3;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c154); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseMAP() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 3) === peg$c155) {
|
|
|
+ s2 = peg$c155;
|
|
|
+ peg$currPos += 3;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c156); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseENSURE() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parse_();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 6) === peg$c45) {
|
|
|
+ s2 = peg$c45;
|
|
|
+ peg$currPos += 6;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c46); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ s3 = peg$parse_();
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ s1 = [s1, s2, s3];
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parseEOF() {
|
|
|
+ var s0, s1;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ peg$silentFails++;
|
|
|
+ if (input.length > peg$currPos) {
|
|
|
+ s1 = input.charAt(peg$currPos);
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s1 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c157); }
|
|
|
+ }
|
|
|
+ peg$silentFails--;
|
|
|
+ if (s1 === peg$FAILED) {
|
|
|
+ s0 = peg$c2;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parse_() {
|
|
|
+ var s0, s1, s2;
|
|
|
+
|
|
|
+ peg$silentFails++;
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = [];
|
|
|
+ if (peg$c159.test(input.charAt(peg$currPos))) {
|
|
|
+ s2 = input.charAt(peg$currPos);
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c160); }
|
|
|
+ }
|
|
|
+ if (s2 === peg$FAILED) {
|
|
|
+ s2 = peg$parsecomment();
|
|
|
+ }
|
|
|
+ while (s2 !== peg$FAILED) {
|
|
|
+ s1.push(s2);
|
|
|
+ if (peg$c159.test(input.charAt(peg$currPos))) {
|
|
|
+ s2 = input.charAt(peg$currPos);
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c160); }
|
|
|
+ }
|
|
|
+ if (s2 === peg$FAILED) {
|
|
|
+ s2 = peg$parsecomment();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c161();
|
|
|
+ }
|
|
|
+ s0 = s1;
|
|
|
+ peg$silentFails--;
|
|
|
+ if (s0 === peg$FAILED) {
|
|
|
+ s1 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c158); }
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parse__() {
|
|
|
+ var s0, s1, s2;
|
|
|
+
|
|
|
+ peg$silentFails++;
|
|
|
+ s0 = peg$currPos;
|
|
|
+ if (peg$c159.test(input.charAt(peg$currPos))) {
|
|
|
+ s1 = input.charAt(peg$currPos);
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s1 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c160); }
|
|
|
+ }
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = peg$parse_();
|
|
|
+ if (s2 === peg$FAILED) {
|
|
|
+ s2 = peg$c4;
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c161();
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ peg$silentFails--;
|
|
|
+ if (s0 === peg$FAILED) {
|
|
|
+ s1 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c162); }
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsenl() {
|
|
|
+ var s0, s1;
|
|
|
+
|
|
|
+ peg$silentFails++;
|
|
|
+ s0 = peg$currPos;
|
|
|
+ if (peg$c164.test(input.charAt(peg$currPos))) {
|
|
|
+ s1 = input.charAt(peg$currPos);
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s1 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c165); }
|
|
|
+ }
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c161();
|
|
|
+ }
|
|
|
+ s0 = s1;
|
|
|
+ peg$silentFails--;
|
|
|
+ if (s0 === peg$FAILED) {
|
|
|
+ s1 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c163); }
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsecomment() {
|
|
|
+ var s0, s1, s2;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parsecomment_line();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = peg$parsenl();
|
|
|
+ if (s2 === peg$FAILED) {
|
|
|
+ s2 = peg$c4;
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c166(s1);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ if (s0 === peg$FAILED) {
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$parsecomment_block();
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = peg$parsenl();
|
|
|
+ if (s2 === peg$FAILED) {
|
|
|
+ s2 = peg$c4;
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c166(s1);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsecomment_line() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ peg$silentFails++;
|
|
|
+ s0 = peg$currPos;
|
|
|
+ if (input.substr(peg$currPos, 2) === peg$c168) {
|
|
|
+ s1 = peg$c168;
|
|
|
+ peg$currPos += 2;
|
|
|
+ } else {
|
|
|
+ s1 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c169); }
|
|
|
+ }
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = [];
|
|
|
+ if (peg$c170.test(input.charAt(peg$currPos))) {
|
|
|
+ s3 = input.charAt(peg$currPos);
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s3 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c171); }
|
|
|
+ }
|
|
|
+ while (s3 !== peg$FAILED) {
|
|
|
+ s2.push(s3);
|
|
|
+ if (peg$c170.test(input.charAt(peg$currPos))) {
|
|
|
+ s3 = input.charAt(peg$currPos);
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s3 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c171); }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c172(s2);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ peg$silentFails--;
|
|
|
+ if (s0 === peg$FAILED) {
|
|
|
+ s1 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c167); }
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsecomment_block() {
|
|
|
+ var s0, s1, s2, s3;
|
|
|
+
|
|
|
+ peg$silentFails++;
|
|
|
+ s0 = peg$currPos;
|
|
|
+ if (input.substr(peg$currPos, 2) === peg$c174) {
|
|
|
+ s1 = peg$c174;
|
|
|
+ peg$currPos += 2;
|
|
|
+ } else {
|
|
|
+ s1 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c175); }
|
|
|
+ }
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ s2 = [];
|
|
|
+ s3 = peg$parsecomment_block_char();
|
|
|
+ while (s3 !== peg$FAILED) {
|
|
|
+ s2.push(s3);
|
|
|
+ s3 = peg$parsecomment_block_char();
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ if (input.substr(peg$currPos, 2) === peg$c176) {
|
|
|
+ s3 = peg$c176;
|
|
|
+ peg$currPos += 2;
|
|
|
+ } else {
|
|
|
+ s3 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c177); }
|
|
|
+ }
|
|
|
+ if (s3 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c178(s2);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ peg$silentFails--;
|
|
|
+ if (s0 === peg$FAILED) {
|
|
|
+ s1 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c173); }
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function peg$parsecomment_block_char() {
|
|
|
+ var s0, s1, s2;
|
|
|
+
|
|
|
+ s0 = peg$currPos;
|
|
|
+ s1 = peg$currPos;
|
|
|
+ peg$silentFails++;
|
|
|
+ if (input.substr(peg$currPos, 2) === peg$c176) {
|
|
|
+ s2 = peg$c176;
|
|
|
+ peg$currPos += 2;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c177); }
|
|
|
+ }
|
|
|
+ peg$silentFails--;
|
|
|
+ if (s2 === peg$FAILED) {
|
|
|
+ s1 = peg$c2;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s1;
|
|
|
+ s1 = peg$c0;
|
|
|
+ }
|
|
|
+ if (s1 !== peg$FAILED) {
|
|
|
+ if (input.length > peg$currPos) {
|
|
|
+ s2 = input.charAt(peg$currPos);
|
|
|
+ peg$currPos++;
|
|
|
+ } else {
|
|
|
+ s2 = peg$FAILED;
|
|
|
+ if (peg$silentFails === 0) { peg$fail(peg$c157); }
|
|
|
+ }
|
|
|
+ if (s2 !== peg$FAILED) {
|
|
|
+ peg$reportedPos = s0;
|
|
|
+ s1 = peg$c179(s2);
|
|
|
+ s0 = s1;
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ peg$currPos = s0;
|
|
|
+ s0 = peg$c0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return s0;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /*global parse, options, offset, line, column, text, SyntaxError*/
|
|
|
+ //TODO: the 'MP2-parser.rig' takes a scope and bakes it into the output we will do that elsewhere
|
|
|
+ //TODO: the 'MP2-parser.rig' checks for various error scenarios that we might bake into this
|
|
|
+ //TODO: when we get to bool_expr might look into using the `ast-types` npm to make any code generation easier (escodegen)
|
|
|
+ var opts = arguments[2] || options,
|
|
|
+ fileName = opts.fileName || "NOFILENAME",
|
|
|
+ locations = opts.locations !== undefined ? opts.locations : false,
|
|
|
+ comments = opts.comments !== undefined ? opts.comments : false;
|
|
|
+
|
|
|
+ var uniqueNumber = 0,
|
|
|
+ getUniqueNumber = function getUniqueNumber() {
|
|
|
+ return uniqueNumber++;
|
|
|
+ };
|
|
|
+
|
|
|
+ var err = function err(msg, suffix) {
|
|
|
+ if (typeof msg === "number") msg = "ERR" + msg + ": " + errors[msg];
|
|
|
+ if (suffix) msg += suffix;
|
|
|
+ return new SyntaxError(msg, null, null, offset(), line(), column());
|
|
|
+ };
|
|
|
+
|
|
|
+ var ast = {
|
|
|
+
|
|
|
+ errors: [], // tracks all of the non-grammatical errors
|
|
|
+
|
|
|
+ rulesById: {}, // track all of the rules by their ID
|
|
|
+
|
|
|
+ Base: function Base(type) {
|
|
|
+ this.type = type;
|
|
|
+ if (locations) {
|
|
|
+ this.location = {
|
|
|
+ pos: offset(),
|
|
|
+ line: line(),
|
|
|
+ col: column(),
|
|
|
+ len: text().length,
|
|
|
+ };
|
|
|
+ }
|
|
|
+ if (comments && type !== "Comment") {
|
|
|
+ //TODO: not attached in right place
|
|
|
+ this.comments = ast._comments;
|
|
|
+ ast._comments = [];
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ _comments: [],
|
|
|
+ Comment: function Comment(block, text) {
|
|
|
+ ast.Base.call(this, "Comment");
|
|
|
+ this.block = block;
|
|
|
+ this.text = text;
|
|
|
+ ast._comments.push(this);
|
|
|
+ },
|
|
|
+
|
|
|
+ Id: function Id(type, id) {
|
|
|
+ ast.Base.call(this, type);
|
|
|
+ this.id = id;
|
|
|
+ },
|
|
|
+
|
|
|
+ Schema: function Schema(includes, statements) {
|
|
|
+ ast.Id.call(this, "Schema", fileName);
|
|
|
+ this.includes = includes;
|
|
|
+ this.statements = statements;
|
|
|
+ },
|
|
|
+
|
|
|
+ Include: function Include(id) {
|
|
|
+ throw err(12, "INCLUDE");
|
|
|
+ ast.Id.call(this, "Include", id);
|
|
|
+ },
|
|
|
+
|
|
|
+ Rule: function Rule(id, ruleType, patterns, buildBlock) {
|
|
|
+ ast.Id.call(this, "Rule", id);
|
|
|
+ this.ruleType = ruleType;
|
|
|
+ // this.refId = "Comp_" + getUniqueNumber(); // aka "work_name" in RIGAL code
|
|
|
+ this.patterns = patterns;
|
|
|
+ // this.buildBlock = buildBlock;
|
|
|
+ },
|
|
|
+
|
|
|
+ RootRule: function RootRule(id, patterns, buildBlock) {
|
|
|
+ ast.Rule.call(this, id, "RootRule", patterns, buildBlock);
|
|
|
+ },
|
|
|
+
|
|
|
+ CompositeRule: function CompositeRule(id, patterns, buildBlock) {
|
|
|
+ ast.Rule.call(this, id, "CompositeRule", patterns, buildBlock);
|
|
|
+ },
|
|
|
+
|
|
|
+ Event: function Event(id) {
|
|
|
+ ast.Id.call(this, "Event", id);
|
|
|
+ },
|
|
|
+
|
|
|
+ Sequence: function Sequence(body) { // aka pattern_list
|
|
|
+ ast.Base.call(this, "Sequence");
|
|
|
+ // this.refId = "Sq_" + getUniqueNumber(); // aka "name" in RIGAL code
|
|
|
+ this.body = body;
|
|
|
+ },
|
|
|
+
|
|
|
+ Alternative: function Alternative(body) {
|
|
|
+ ast.Base.call(this, "Alternative");
|
|
|
+ // this.refId = "Alt_" + getUniqueNumber(); // aka "name" in RIGAL code
|
|
|
+ this.body = body; // aka "patterns" in the RIGAL codye
|
|
|
+ },
|
|
|
+
|
|
|
+ Probability: function Probability(p) {
|
|
|
+ throw err(12, "PROBABILITY");
|
|
|
+ ast.Base.call(this, "Probability");
|
|
|
+ this.p = p;
|
|
|
+ },
|
|
|
+
|
|
|
+ MinMax: function MinMax(min, max) {
|
|
|
+ ast.Base.call(this, "MinMax");
|
|
|
+ this.min = min;
|
|
|
+ this.max = max;
|
|
|
+ },
|
|
|
+
|
|
|
+ Iterator: function Iterator(scope, body) {
|
|
|
+ ast.Base.call(this, "Iterator");
|
|
|
+ // this.refId = "Itr_" + getUniqueNumber(); // aka "name" in RIGAL code
|
|
|
+ this.scope = scope;
|
|
|
+ this.body = body;
|
|
|
+ },
|
|
|
+
|
|
|
+ Set: function Set(body) {
|
|
|
+ ast.Base.call(this, "Set");
|
|
|
+ // this.refId = "Set_" + getUniqueNumber(); // aka "name" in RIGAL code
|
|
|
+ this.body = body;
|
|
|
+ },
|
|
|
+
|
|
|
+ SetIterator: function SetIterator(scope, body) {
|
|
|
+ ast.Base.call(this, "SetIterator");
|
|
|
+ // this.refId = "SetIterator_" + getUniqueNumber(); // aka "name" in RIGAL code
|
|
|
+ this.scope = scope;
|
|
|
+ this.body = body;
|
|
|
+ },
|
|
|
+
|
|
|
+ Optional: function Optional(body) {
|
|
|
+ ast.Base.call(this, "Optional");
|
|
|
+ // this.refId = "Opt_" + getUniqueNumber(); // aka "name" in RIGAL code
|
|
|
+ this.body = body;
|
|
|
+ },
|
|
|
+
|
|
|
+ Coordinate: function Coordinate(async, srcs, body) {
|
|
|
+ ast.Base.call(this, "Coordinate");
|
|
|
+ // this.refId = "Coordinate_" + getUniqueNumber(); // aka "work" in RIGAL code
|
|
|
+ this.async = async;
|
|
|
+ this.srcs = srcs;
|
|
|
+ this.body = body;
|
|
|
+ },
|
|
|
+
|
|
|
+ CoordinateSource: function CoordinateSource(id, select, from) {
|
|
|
+ ast.Id.call(this, "CoordinateSource", id);
|
|
|
+ this.select = select;
|
|
|
+ this.from = from || "<this>";
|
|
|
+ },
|
|
|
+
|
|
|
+ ShareAll: function ShareAll(hosts, events) {
|
|
|
+ ast.Base.call(this, "ShareAll");
|
|
|
+ // this.refId = "ShareAll_" + getUniqueNumber(); // aka "work" in RIGAL code
|
|
|
+ this.hosts = hosts;
|
|
|
+ this.events = events;
|
|
|
+ },
|
|
|
+
|
|
|
+ Relationship: function Relationship(src, relType, dst) {
|
|
|
+ ast.Base.call(this, "Relationship");
|
|
|
+ this.relType = relType;
|
|
|
+ this.src = src;
|
|
|
+ this.dst = dst;
|
|
|
+ },
|
|
|
+
|
|
|
+ AddOperation: function AddOperation(rels) {
|
|
|
+ ast.Base.call(this, "Add");
|
|
|
+ this.relationships = rels;
|
|
|
+ },
|
|
|
+
|
|
|
+ };
|
|
|
+
|
|
|
+ parse.ast = ast;
|
|
|
+
|
|
|
+ if (opts.ast) {
|
|
|
+ /*TODO: setup overrides from opts.ast on top of ast*/
|
|
|
+ }
|
|
|
+
|
|
|
+ var errors = {
|
|
|
+ // 1: "wrong schema name $a identifier expected/ !", //NOTE: probably not applicable if we make SCHEMA go away (or at least optional silliness)
|
|
|
+ // 2: "wrong event pattern $a / !", //NOTE: errors handled by our generated parser
|
|
|
+ 3: "trigger event $a should not appear in WHEN pattern list / !",
|
|
|
+ //// 4: "detected around token $a/ !", //NOTE: errors handled by our generated parser
|
|
|
+ 5: "defined event name should not appear in rule body: ",
|
|
|
+ //TODO: 6: "recursion for event $a is detected/ !", //TODO: check for this
|
|
|
+ // 7: "syntax error in probability definition detected at $a/ !", //NOTE: just took out of parser for now
|
|
|
+ // 8: "schema name $a should be the same as input parameter/ !", //NOTE: disabled this restriction
|
|
|
+ // 9: "keyword 'DO' is expected in COORDINATE when actual token is $a / !", //NOTE: errors handled by our generated parser
|
|
|
+ // 10: "keyword 'OD' is expected in COORDINATE when actual token is $a / !", //NOTE: errors handled by our generated parser
|
|
|
+ // 11: "semicolon is expected when actual token is $a / !", //NOTE: errors handled by our generated parser
|
|
|
+ 12: "not implemented yet: ",
|
|
|
+ // 13: "':' is expected when actual token is $a / !", //NOTE: errors handled by our generated parser
|
|
|
+ // 14: "incorrect variable name $a in the COORDINATE source / !", //NOTE: errors handled by our generated parser
|
|
|
+ // 15: "derivation for root $a should be completed before composition/ !", //NOTE: handled by 21
|
|
|
+ // 16: "wrong relation name $a in the ADD composition/ !", //NOTE: errors handled by our generated parser
|
|
|
+ 17: "variable is not defined: ",
|
|
|
+ //TODO: 18: "shared event $a has not been defined in any grammar rule / !", //TODO: not sure how to recreate to test this
|
|
|
+ 19: "variable has been defined twice: ",
|
|
|
+ //NOTE: additional errors added by us
|
|
|
+ 20: "rule defined more than once: ",
|
|
|
+ 21: "reference to undefined item: ",
|
|
|
+ 22: "reference to non-root event: ",
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ peg$result = peg$startRuleFunction();
|
|
|
+
|
|
|
+ if (peg$result !== peg$FAILED && peg$currPos === input.length) {
|
|
|
+ return peg$result;
|
|
|
+ } else {
|
|
|
+ if (peg$result !== peg$FAILED && peg$currPos < input.length) {
|
|
|
+ peg$fail({ type: "end", description: "end of input" });
|
|
|
+ }
|
|
|
+
|
|
|
+ throw peg$buildException(null, peg$maxFailExpected, peg$maxFailPos);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return {
|
|
|
+ SyntaxError: SyntaxError,
|
|
|
+ parse: parse
|
|
|
+ };
|
|
|
+})();
|