jhipster-rasha-core
Version:
JHipster's own domain language and core objects
1,449 lines (1,377 loc) • 175 kB
JavaScript
/*
* Generated by PEG.js 0.10.0.
*
* http://pegjs.org/
*/
"use strict";
function peg$subclass(child, parent) {
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor();
}
function peg$SyntaxError(message, expected, found, location) {
this.message = message;
this.expected = expected;
this.found = found;
this.location = location;
this.name = "SyntaxError";
if (typeof Error.captureStackTrace === "function") {
Error.captureStackTrace(this, peg$SyntaxError);
}
}
peg$subclass(peg$SyntaxError, Error);
peg$SyntaxError.buildMessage = function(expected, found) {
var DESCRIBE_EXPECTATION_FNS = {
literal: function(expectation) {
return "\"" + literalEscape(expectation.text) + "\"";
},
"class": function(expectation) {
var escapedParts = "",
i;
for (i = 0; i < expectation.parts.length; i++) {
escapedParts += expectation.parts[i] instanceof Array
? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1])
: classEscape(expectation.parts[i]);
}
return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]";
},
any: function(expectation) {
return "any character";
},
end: function(expectation) {
return "end of input";
},
other: function(expectation) {
return expectation.description;
}
};
function hex(ch) {
return ch.charCodeAt(0).toString(16).toUpperCase();
}
function literalEscape(s) {
return s
.replace(/\\/g, '\\\\')
.replace(/"/g, '\\"')
.replace(/\0/g, '\\0')
.replace(/\t/g, '\\t')
.replace(/\n/g, '\\n')
.replace(/\r/g, '\\r')
.replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); })
.replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); });
}
function classEscape(s) {
return s
.replace(/\\/g, '\\\\')
.replace(/\]/g, '\\]')
.replace(/\^/g, '\\^')
.replace(/-/g, '\\-')
.replace(/\0/g, '\\0')
.replace(/\t/g, '\\t')
.replace(/\n/g, '\\n')
.replace(/\r/g, '\\r')
.replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); })
.replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); });
}
function describeExpectation(expectation) {
return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
}
function describeExpected(expected) {
var descriptions = new Array(expected.length),
i, j;
for (i = 0; i < expected.length; i++) {
descriptions[i] = describeExpectation(expected[i]);
}
descriptions.sort();
if (descriptions.length > 0) {
for (i = 1, j = 1; i < descriptions.length; i++) {
if (descriptions[i - 1] !== descriptions[i]) {
descriptions[j] = descriptions[i];
j++;
}
}
descriptions.length = j;
}
switch (descriptions.length) {
case 1:
return descriptions[0];
case 2:
return descriptions[0] + " or " + descriptions[1];
default:
return descriptions.slice(0, -1).join(", ")
+ ", or "
+ descriptions[descriptions.length - 1];
}
}
function describeFound(found) {
return found ? "\"" + literalEscape(found) + "\"" : "end of input";
}
return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
};
function peg$parse(input, options) {
options = options !== void 0 ? options : {};
var peg$FAILED = {},
peg$startRuleFunctions = { start: peg$parsestart },
peg$startRuleFunction = peg$parsestart,
peg$c0 = function(p) { return p; },
peg$c1 = function(constantDecl, p) {
parsed.constants[constantDecl.name] = constantDecl.value;
return parsed;
},
peg$c2 = function(ed, p) {
parsed.entities = addUniqueElements([ed], parsed.entities);
return parsed;
},
peg$c3 = function(rd, p) {
parsed.relationships = flattenArray(addUniqueElements([rd], parsed.relationships));
return parsed;
},
peg$c4 = function(end, p) {
parsed.enums = addUniqueElements([end], parsed.enums);
return parsed;
},
peg$c5 = function(dto, p) {
parsed.dto = dto;
return parsed;
},
peg$c6 = function(pagination, p) {
parsed.pagination = pagination;
return parsed;
},
peg$c7 = function(service, p) {
parsed.service = service;
return parsed;
},
peg$c8 = function(p) { return parsed; },
peg$c9 = function(microservice, p) {
parsed.microservice = microservice;
return parsed;
},
peg$c10 = function(searchEngine, p) {
parsed.searchEngine = searchEngine;
return parsed;
},
peg$c11 = function(noClient, p) {
parsed.noClient = noClient;
return parsed;
},
peg$c12 = function(noServer, p) {
parsed.noServer = noServer;
return parsed;
},
peg$c13 = function(angularSuffix, p) {
parsed.angularSuffix = angularSuffix;
return parsed;
},
peg$c14 = function(noFluentMethod, p) {
parsed.noFluentMethod = noFluentMethod;
return parsed;
},
peg$c15 = "",
peg$c16 = function() { return parsed; },
peg$c17 = "=",
peg$c18 = peg$literalExpectation("=", false),
peg$c19 = function(name, value) { return { name: name, value: value }; },
peg$c20 = function(jd, e, tableName, eb) {
return { name: e, tableName: tableName ? tableName: e, body: eb, javadoc: jd };
},
peg$c21 = function(e, eb) { return { name: e, body: eb, javadoc: '' }; },
peg$c22 = "(",
peg$c23 = peg$literalExpectation("(", false),
peg$c24 = /^[A-z0-9_\-]/,
peg$c25 = peg$classExpectation([["A", "z"], ["0", "9"], "_", "-"], false, false),
peg$c26 = ")",
peg$c27 = peg$literalExpectation(")", false),
peg$c28 = function(name) { return name.join(''); },
peg$c29 = "{",
peg$c30 = peg$literalExpectation("{", false),
peg$c31 = "}",
peg$c32 = peg$literalExpectation("}", false),
peg$c33 = function(fdl) { return fdl; },
peg$c34 = function() { return []; },
peg$c35 = ",",
peg$c36 = peg$literalExpectation(",", false),
peg$c37 = function(com, f, t, vl, com2, fdl) {
return addUniqueElements([{ name: f, type: t, validations: vl, javadoc: com || com2 }], fdl );
},
peg$c38 = function(v, vl) { return addUniqueElements([v], vl); },
peg$c39 = function(rt, bodies) {
addCardinalityToRelationships(rt, bodies);
return addUniqueElements([], bodies);
},
peg$c40 = function(rb, morerb) { return addUniqueElements([rb], morerb); },
peg$c41 = function(rb) { return [rb]; },
peg$c42 = "to",
peg$c43 = peg$literalExpectation("to", false),
peg$c44 = function(from, to) {
return { from: from , to: to };
},
peg$c45 = "required",
peg$c46 = peg$literalExpectation("required", false),
peg$c47 = function(jd, e, i, required) {
return { name: e, injectedfield: i, javadoc: jd, required: required ? true : false };
},
peg$c48 = function(jd, e) {
return { name: e, injectedfield: null, javadoc: jd };
},
peg$c49 = function(e) { return { name: e, injectedfield: null, javadoc: '' }; },
peg$c50 = function(e, el) {
return { name: e, values: el };
},
peg$c51 = function(e, el) { return addUniqueElements([e], el); },
peg$c52 = function(e) { return [e]; },
peg$c53 = function(sub) { return sub; },
peg$c54 = function(e, sub) { return addUniqueElements([e], sub); },
peg$c55 = function(decl, ex) {
addUniqueElements(parsed.noFluentMethod.list, decl);
if (ex) {
addUniqueElements(parsed.noFluentMethod.excluded, ex);
}
return parsed.noFluentMethod;
},
peg$c56 = function() { return ['*']; },
peg$c57 = function(decl, ex) {
parsed.dto[decl[decl.length - 1]] = parsed.dto[decl[decl.length - 1]] || { list: [], excluded: [] };
addUniqueElements(parsed.dto[decl[decl.length - 1]].list, decl.slice(0, decl.length - 1));
if (ex) {
addUniqueElements(parsed.dto[decl[decl.length - 1]].excluded, ex);
}
return parsed.dto;
},
peg$c58 = function(decl, ex) {
parsed.pagination[decl[decl.length - 1]] =
parsed.pagination[decl[decl.length - 1]] || { list: [], excluded: [] };
addUniqueElements(parsed.pagination[decl[decl.length - 1]].list, decl.slice(0, decl.length - 1));
if (ex) {
addUniqueElements(parsed.pagination[decl[decl.length - 1]].excluded, ex);
}
return parsed.pagination;
},
peg$c59 = function(decl, ex) {
parsed.service[decl[decl.length - 1]] =
parsed.service[decl[decl.length - 1]] || { list: [], excluded: [] };
addUniqueElements(parsed.service[decl[decl.length - 1]].list, decl.slice(0, decl.length - 1));
if (ex) {
addUniqueElements(parsed.service[decl[decl.length - 1]].excluded, ex);
}
return parsed.service;
},
peg$c60 = function(decl, ex) {
parsed.microservice[decl[decl.length - 1]] =
parsed.microservice[decl[decl.length - 1]] || { list: [], excluded: [] };
addUniqueElements(parsed.microservice[decl[decl.length - 1]].list, decl.slice(0, decl.length - 1));
if (ex) {
addUniqueElements(parsed.microservice[decl[decl.length - 1]].excluded, ex);
}
return parsed.microservice;
},
peg$c61 = function(decl, ex) {
parsed.searchEngine[decl[decl.length - 1]] =
parsed.searchEngine[decl[decl.length - 1]] || { list: [], excluded: [] };
addUniqueElements(parsed.searchEngine[decl[decl.length - 1]].list, decl.slice(0, decl.length - 1));
if (ex) {
addUniqueElements(parsed.searchEngine[decl[decl.length - 1]].excluded, ex);
}
return parsed.searchEngine;
},
peg$c62 = function(decl, ex) {
addUniqueElements(parsed.noClient.list, decl);
if (ex) {
addUniqueElements(parsed.noClient.excluded, ex);
}
return parsed.noClient;
},
peg$c63 = function(decl, ex) {
addUniqueElements(parsed.noServer.list, decl);
if (ex) {
addUniqueElements(parsed.noServer.excluded, ex);
}
return parsed.noServer;
},
peg$c64 = function(decl, ex) {
parsed.angularSuffix[decl[decl.length - 1]] =
parsed.angularSuffix[decl[decl.length - 1]] || { list: [], excluded: [] };
addUniqueElements(parsed.angularSuffix[decl[decl.length - 1]].list, decl.slice(0, decl.length - 1));
if (ex) {
addUniqueElements(parsed.angularSuffix[decl[decl.length - 1]].excluded, ex);
}
return parsed.angularSuffix;
},
peg$c65 = /^[A-z0-9\-]/,
peg$c66 = peg$classExpectation([["A", "z"], ["0", "9"], "-"], false, false),
peg$c67 = function(method) { return ['*', method.toString().replace(/,/g,'')]; },
peg$c68 = function(e, method) { return [e, method.toString().replace(/,/g,'')]; },
peg$c69 = function() { return 'one-to-one'; },
peg$c70 = function() { return 'one-to-many'; },
peg$c71 = function() { return 'many-to-one'; },
peg$c72 = function() { return 'many-to-many'; },
peg$c73 = /^[A-Z]/,
peg$c74 = peg$classExpectation([["A", "Z"]], false, false),
peg$c75 = /^[A-z0-9]/,
peg$c76 = peg$classExpectation([["A", "z"], ["0", "9"]], false, false),
peg$c77 = function(head, tail) { return `${head}${tail.join('')}`; },
peg$c78 = function() { return { key: 'required', value: '' }; },
peg$c79 = function(int) { return { key: 'minlength', value: int }; },
peg$c80 = function(constantName) { return { key: 'minlength', value: constantName, constant: true }; },
peg$c81 = function(int) { return { key: 'maxlength', value: int }; },
peg$c82 = function(constantName) { return { key: 'maxlength', value: constantName, constant: true }; },
peg$c83 = function(int) { return { key: 'minbytes', value: int }; },
peg$c84 = function(constantName) { return { key: 'minbytes', value: constantName, constant: true }; },
peg$c85 = function(int) { return { key: 'maxbytes', value: int }; },
peg$c86 = function(constantName) { return { key: 'maxbytes', value: constantName, constant: true }; },
peg$c87 = function(int) { return { key: 'min', value: int };},
peg$c88 = function(constantName) { return { key: 'min', value: constantName, constant: true };},
peg$c89 = function(int) { return { key: 'max', value: int };},
peg$c90 = function(constantName) { return { key: 'max', value: constantName, constant: true };},
peg$c91 = function(regex) { return { key: 'pattern', value: regex }; },
peg$c92 = function(notAComment) { return notAComment.join(''); },
peg$c93 = "/*",
peg$c94 = peg$literalExpectation("/*", false),
peg$c95 = /^[*]/,
peg$c96 = peg$classExpectation(["*"], false, false),
peg$c97 = "/",
peg$c98 = peg$literalExpectation("/", false),
peg$c99 = peg$anyExpectation(),
peg$c100 = function(char) { return char; },
peg$c101 = "entity",
peg$c102 = peg$literalExpectation("entity", false),
peg$c103 = "relationship",
peg$c104 = peg$literalExpectation("relationship", false),
peg$c105 = "enum",
peg$c106 = peg$literalExpectation("enum", false),
peg$c107 = "OneToOne",
peg$c108 = peg$literalExpectation("OneToOne", false),
peg$c109 = "OneToMany",
peg$c110 = peg$literalExpectation("OneToMany", false),
peg$c111 = "ManyToOne",
peg$c112 = peg$literalExpectation("ManyToOne", false),
peg$c113 = "ManyToMany",
peg$c114 = peg$literalExpectation("ManyToMany", false),
peg$c115 = "all",
peg$c116 = peg$literalExpectation("all", false),
peg$c117 = "*",
peg$c118 = peg$literalExpectation("*", false),
peg$c119 = "for",
peg$c120 = peg$literalExpectation("for", false),
peg$c121 = "with",
peg$c122 = peg$literalExpectation("with", false),
peg$c123 = "except",
peg$c124 = peg$literalExpectation("except", false),
peg$c125 = "noFluentMethod",
peg$c126 = peg$literalExpectation("noFluentMethod", false),
peg$c127 = "dto",
peg$c128 = peg$literalExpectation("dto", false),
peg$c129 = "paginate",
peg$c130 = peg$literalExpectation("paginate", false),
peg$c131 = "service",
peg$c132 = peg$literalExpectation("service", false),
peg$c133 = "microservice",
peg$c134 = peg$literalExpectation("microservice", false),
peg$c135 = "search",
peg$c136 = peg$literalExpectation("search", false),
peg$c137 = "skipClient",
peg$c138 = peg$literalExpectation("skipClient", false),
peg$c139 = "skipServer",
peg$c140 = peg$literalExpectation("skipServer", false),
peg$c141 = "angularSuffix",
peg$c142 = peg$literalExpectation("angularSuffix", false),
peg$c143 = "minlength",
peg$c144 = peg$literalExpectation("minlength", false),
peg$c145 = "maxlength",
peg$c146 = peg$literalExpectation("maxlength", false),
peg$c147 = "minbytes",
peg$c148 = peg$literalExpectation("minbytes", false),
peg$c149 = "maxbytes",
peg$c150 = peg$literalExpectation("maxbytes", false),
peg$c151 = "max",
peg$c152 = peg$literalExpectation("max", false),
peg$c153 = "min",
peg$c154 = peg$literalExpectation("min", false),
peg$c155 = "pattern",
peg$c156 = peg$literalExpectation("pattern", false),
peg$c157 = /^[_]/,
peg$c158 = peg$classExpectation(["_"], false, false),
peg$c159 = /^[A-Z0-9]/,
peg$c160 = peg$classExpectation([["A", "Z"], ["0", "9"]], false, false),
peg$c161 = /^[A-Z0-9_]/,
peg$c162 = peg$classExpectation([["A", "Z"], ["0", "9"], "_"], false, false),
peg$c163 = function(underscore, head, tail) {
return `${underscore.join('')}${head}${tail.join('')}`;
},
peg$c164 = /^[A-Z_]/,
peg$c165 = peg$classExpectation([["A", "Z"], "_"], false, false),
peg$c166 = "-",
peg$c167 = peg$literalExpectation("-", false),
peg$c168 = /^[0-9]/,
peg$c169 = peg$classExpectation([["0", "9"]], false, false),
peg$c170 = function(negative, int) { return parseInt(`${(negative ? negative : '') + int.join('')}`, 10); },
peg$c171 = /^[a-zA-Z]/,
peg$c172 = peg$classExpectation([["a", "z"], ["A", "Z"]], false, false),
peg$c173 = /^[A-z0-9()]/,
peg$c174 = peg$classExpectation([["A", "z"], ["0", "9"], "(", ")"], false, false),
peg$c175 = /^['\n'|'\t'|'\r'|' '|\u2028|\u2029]/,
peg$c176 = peg$classExpectation(["'", "\n", "'", "|", "'", "\t", "'", "|", "'", "\r", "'", "|", "'", " ", "'", "|", "\u2028", "|", "\u2029"], false, false),
peg$c177 = /^['\t'|' '|\u2028|\u2029]/,
peg$c178 = peg$classExpectation(["'", "\t", "'", "|", "'", " ", "'", "|", "\u2028", "|", "\u2029"], false, false),
peg$c179 = /^[A-z0-9!@#$%\^&*()_+\-=[\]{};':\\|,.<>\/? ]/,
peg$c180 = peg$classExpectation([["A", "z"], ["0", "9"], "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "+", "-", "=", "[", "]", "{", "}", ";", "'", ":", "\\", "|", ",", ".", "<", ">", "/", "?", " "], false, false),
peg$c181 = function(word) { return word.join('') },
peg$c182 = /^["|']/,
peg$c183 = peg$classExpectation(["\"", "|", "'"], false, false),
peg$currPos = 0,
peg$savedPos = 0,
peg$posDetailsCache = [{ line: 1, column: 1 }],
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$savedPos, peg$currPos);
}
function location() {
return peg$computeLocation(peg$savedPos, peg$currPos);
}
function expected(description, location) {
location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)
throw peg$buildStructuredError(
[peg$otherExpectation(description)],
input.substring(peg$savedPos, peg$currPos),
location
);
}
function error(message, location) {
location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)
throw peg$buildSimpleError(message, location);
}
function peg$literalExpectation(text, ignoreCase) {
return { type: "literal", text: text, ignoreCase: ignoreCase };
}
function peg$classExpectation(parts, inverted, ignoreCase) {
return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };
}
function peg$anyExpectation() {
return { type: "any" };
}
function peg$endExpectation() {
return { type: "end" };
}
function peg$otherExpectation(description) {
return { type: "other", description: description };
}
function peg$computePosDetails(pos) {
var details = peg$posDetailsCache[pos], p;
if (details) {
return details;
} else {
p = pos - 1;
while (!peg$posDetailsCache[p]) {
p--;
}
details = peg$posDetailsCache[p];
details = {
line: details.line,
column: details.column
};
while (p < pos) {
if (input.charCodeAt(p) === 10) {
details.line++;
details.column = 1;
} else {
details.column++;
}
p++;
}
peg$posDetailsCache[pos] = details;
return details;
}
}
function peg$computeLocation(startPos, endPos) {
var startPosDetails = peg$computePosDetails(startPos),
endPosDetails = peg$computePosDetails(endPos);
return {
start: {
offset: startPos,
line: startPosDetails.line,
column: startPosDetails.column
},
end: {
offset: endPos,
line: endPosDetails.line,
column: endPosDetails.column
}
};
}
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$buildSimpleError(message, location) {
return new peg$SyntaxError(message, null, null, location);
}
function peg$buildStructuredError(expected, found, location) {
return new peg$SyntaxError(
peg$SyntaxError.buildMessage(expected, found),
expected,
found,
location
);
}
function peg$parsestart() {
var s0, s1;
s0 = peg$currPos;
s1 = peg$parseprog();
if (s1 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c0(s1);
}
s0 = s1;
return s0;
}
function peg$parseprog() {
var s0, s1, s2, s3, s4;
s0 = peg$currPos;
s1 = [];
s2 = peg$parseSPACE();
while (s2 !== peg$FAILED) {
s1.push(s2);
s2 = peg$parseSPACE();
}
if (s1 !== peg$FAILED) {
s2 = peg$parseconstantDecl();
if (s2 !== peg$FAILED) {
s3 = [];
s4 = peg$parseSPACE();
while (s4 !== peg$FAILED) {
s3.push(s4);
s4 = peg$parseSPACE();
}
if (s3 !== peg$FAILED) {
s4 = peg$parseprog();
if (s4 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c1(s2, s4);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
s1 = [];
s2 = peg$parseSPACE();
while (s2 !== peg$FAILED) {
s1.push(s2);
s2 = peg$parseSPACE();
}
if (s1 !== peg$FAILED) {
s2 = peg$parseentityDecl();
if (s2 !== peg$FAILED) {
s3 = [];
s4 = peg$parseSPACE();
while (s4 !== peg$FAILED) {
s3.push(s4);
s4 = peg$parseSPACE();
}
if (s3 !== peg$FAILED) {
s4 = peg$parseprog();
if (s4 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c2(s2, s4);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
s1 = [];
s2 = peg$parseSPACE();
while (s2 !== peg$FAILED) {
s1.push(s2);
s2 = peg$parseSPACE();
}
if (s1 !== peg$FAILED) {
s2 = peg$parserelationDecl();
if (s2 !== peg$FAILED) {
s3 = [];
s4 = peg$parseSPACE();
while (s4 !== peg$FAILED) {
s3.push(s4);
s4 = peg$parseSPACE();
}
if (s3 !== peg$FAILED) {
s4 = peg$parseprog();
if (s4 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c3(s2, s4);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
s1 = [];
s2 = peg$parseSPACE();
while (s2 !== peg$FAILED) {
s1.push(s2);
s2 = peg$parseSPACE();
}
if (s1 !== peg$FAILED) {
s2 = peg$parseenumDecl();
if (s2 !== peg$FAILED) {
s3 = [];
s4 = peg$parseSPACE();
while (s4 !== peg$FAILED) {
s3.push(s4);
s4 = peg$parseSPACE();
}
if (s3 !== peg$FAILED) {
s4 = peg$parseprog();
if (s4 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c4(s2, s4);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
s1 = [];
s2 = peg$parseSPACE();
while (s2 !== peg$FAILED) {
s1.push(s2);
s2 = peg$parseSPACE();
}
if (s1 !== peg$FAILED) {
s2 = peg$parsedtoDecl();
if (s2 !== peg$FAILED) {
s3 = [];
s4 = peg$parseSPACE();
while (s4 !== peg$FAILED) {
s3.push(s4);
s4 = peg$parseSPACE();
}
if (s3 !== peg$FAILED) {
s4 = peg$parseprog();
if (s4 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c5(s2, s4);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
s1 = [];
s2 = peg$parseSPACE();
while (s2 !== peg$FAILED) {
s1.push(s2);
s2 = peg$parseSPACE();
}
if (s1 !== peg$FAILED) {
s2 = peg$parsepagiDecl();
if (s2 !== peg$FAILED) {
s3 = [];
s4 = peg$parseSPACE();
while (s4 !== peg$FAILED) {
s3.push(s4);
s4 = peg$parseSPACE();
}
if (s3 !== peg$FAILED) {
s4 = peg$parseprog();
if (s4 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c6(s2, s4);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
s1 = [];
s2 = peg$parseSPACE();
while (s2 !== peg$FAILED) {
s1.push(s2);
s2 = peg$parseSPACE();
}
if (s1 !== peg$FAILED) {
s2 = peg$parseserviceDecl();
if (s2 !== peg$FAILED) {
s3 = [];
s4 = peg$parseSPACE();
while (s4 !== peg$FAILED) {
s3.push(s4);
s4 = peg$parseSPACE();
}
if (s3 !== peg$FAILED) {
s4 = peg$parseprog();
if (s4 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c7(s2, s4);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
s1 = [];
s2 = peg$parseSPACE();
while (s2 !== peg$FAILED) {
s1.push(s2);
s2 = peg$parseSPACE();
}
if (s1 !== peg$FAILED) {
s2 = peg$parsecomment();
if (s2 !== peg$FAILED) {
s3 = [];
s4 = peg$parseSPACE();
while (s4 !== peg$FAILED) {
s3.push(s4);
s4 = peg$parseSPACE();
}
if (s3 !== peg$FAILED) {
s4 = peg$parseprog();
if (s4 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c8(s4);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
s1 = [];
s2 = peg$parseSPACE();
while (s2 !== peg$FAILED) {
s1.push(s2);
s2 = peg$parseSPACE();
}
if (s1 !== peg$FAILED) {
s2 = peg$parsemicroserviceDecl1();
if (s2 !== peg$FAILED) {
s3 = [];
s4 = peg$parseSPACE();
while (s4 !== peg$FAILED) {
s3.push(s4);
s4 = peg$parseSPACE();
}
if (s3 !== peg$FAILED) {
s4 = peg$parseprog();
if (s4 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c9(s2, s4);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
s1 = [];
s2 = peg$parseSPACE();
while (s2 !== peg$FAILED) {
s1.push(s2);
s2 = peg$parseSPACE();
}
if (s1 !== peg$FAILED) {
s2 = peg$parsesearchEngineDecl();
if (s2 !== peg$FAILED) {
s3 = [];
s4 = peg$parseSPACE();
while (s4 !== peg$FAILED) {
s3.push(s4);
s4 = peg$parseSPACE();
}
if (s3 !== peg$FAILED) {
s4 = peg$parseprog();
if (s4 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c10(s2, s4);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
s1 = [];
s2 = peg$parseSPACE();
while (s2 !== peg$FAILED) {
s1.push(s2);
s2 = peg$parseSPACE();
}
if (s1 !== peg$FAILED) {
s2 = peg$parsenoClientDecl();
if (s2 !== peg$FAILED) {
s3 = [];
s4 = peg$parseSPACE();
while (s4 !== peg$FAILED) {
s3.push(s4);
s4 = peg$parseSPACE();
}
if (s3 !== peg$FAILED) {
s4 = peg$parseprog();
if (s4 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c11(s2, s4);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
s1 = [];
s2 = peg$parseSPACE();
while (s2 !== peg$FAILED) {
s1.push(s2);
s2 = peg$parseSPACE();
}
if (s1 !== peg$FAILED) {
s2 = peg$parsenoServerDecl();
if (s2 !== peg$FAILED) {
s3 = [];
s4 = peg$parseSPACE();
while (s4 !== peg$FAILED) {
s3.push(s4);
s4 = peg$parseSPACE();
}
if (s3 !== peg$FAILED) {
s4 = peg$parseprog();
if (s4 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c12(s2, s4);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
s1 = [];
s2 = peg$parseSPACE();
while (s2 !== peg$FAILED) {
s1.push(s2);
s2 = peg$parseSPACE();
}
if (s1 !== peg$FAILED) {
s2 = peg$parseangularSuffixDecl();
if (s2 !== peg$FAILED) {
s3 = [];
s4 = peg$parseSPACE();
while (s4 !== peg$FAILED) {
s3.push(s4);
s4 = peg$parseSPACE();
}
if (s3 !== peg$FAILED) {
s4 = peg$parseprog();
if (s4 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c13(s2, s4);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
s1 = [];
s2 = peg$parseSPACE();
while (s2 !== peg$FAILED) {
s1.push(s2);
s2 = peg$parseSPACE();
}
if (s1 !== peg$FAILED) {
s2 = peg$parsenoFluentMethod();
if (s2 !== peg$FAILED) {
s3 = [];
s4 = peg$parseSPACE();
while (s4 !== peg$FAILED) {
s3.push(s4);
s4 = peg$parseSPACE();
}
if (s3 !== peg$FAILED) {
s4 = peg$parseprog();
if (s4 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c14(s2, s4);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
s1 = peg$c15;
if (s1 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c16();
}
s0 = s1;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
return s0;
}
function peg$parseconstantDecl() {
var s0, s1, s2, s3, s4, s5;
s0 = peg$currPos;
s1 = peg$parseCONSTANT_NAME();
if (s1 !== peg$FAILED) {
s2 = [];
s3 = peg$parseSPACE();
while (s3 !== peg$FAILED) {
s2.push(s3);
s3 = peg$parseSPACE();
}
if (s2 !== peg$FAILED) {
if (input.charCodeAt(peg$currPos) === 61) {
s3 = peg$c17;
peg$currPos++;
} else {
s3 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c18); }
}
if (s3 !== peg$FAILED) {
s4 = [];
s5 = peg$parseSPACE();
while (s5 !== peg$FAILED) {
s4.push(s5);
s5 = peg$parseSPACE();
}
if (s4 !== peg$FAILED) {
s5 = peg$parseINTEGER();
if (s5 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c19(s1, s5);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
return s0;
}
function peg$parseentityDecl() {
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11;
s0 = peg$currPos;
s1 = peg$parsecomment();
if (s1 === peg$FAILED) {
s1 = null;
}
if (s1 !== peg$FAILED) {
s2 = [];
s3 = peg$parseSPACE();
while (s3 !== peg$FAILED) {
s2.push(s3);
s3 = peg$parseSPACE();
}
if (s2 !== peg$FAILED) {
s3 = peg$parseENTITY();
if (s3 !== peg$FAILED) {
s4 = [];
s5 = peg$parseSPACE();
while (s5 !== peg$FAILED) {
s4.push(s5);
s5 = peg$parseSPACE();
}
if (s4 !== peg$FAILED) {
s5 = peg$parseENTITY_NAME();
if (s5 !== peg$FAILED) {
s6 = [];
s7 = peg$parseSPACE();
while (s7 !== peg$FAILED) {
s6.push(s7);
s7 = peg$parseSPACE();
}
if (s6 !== peg$FAILED) {
s7 = peg$parseentityTableNameDecl();
if (s7 === peg$FAILED) {
s7 = null;
}
if (s7 !== peg$FAILED) {
s8 = [];
s9 = peg$parseSPACE();
while (s9 !== peg$FAILED) {
s8.push(s9);
s9 = peg$parseSPACE();
}
if (s8 !== peg$FAILED) {
s9 = peg$parseentityBody();
if (s9 === peg$FAILED) {
s9 = null;
}
if (s9 !== peg$FAILED) {
s10 = [];
s11 = peg$parseSPACE();
while (s11 !== peg$FAILED) {
s10.push(s11);
s11 = peg$parseSPACE();
}
if (s10 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c20(s1, s5, s7, s9);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
s1 = peg$parseENTITY();
if (s1 !== peg$FAILED) {
s2 = [];
s3 = peg$parseSPACE();
while (s3 !== peg$FAILED) {
s2.push(s3);
s3 = peg$parseSPACE();
}
if (s2 !== peg$FAILED) {
s3 = peg$parseENTITY_NAME();
if (s3 !== peg$FAILED) {
s4 = [];
s5 = peg$parseSPACE();
while (s5 !== peg$FAILED) {
s4.push(s5);
s5 = peg$parseSPACE();
}
if (s4 !== peg$FAILED) {
s5 = peg$parseentityBody();
if (s5 === peg$FAILED) {
s5 = null;
}
if (s5 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c21(s3, s5);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
}
return s0;
}
function peg$parseentityTableNameDecl() {
var s0, s1, s2, s3, s4, s5;
s0 = peg$currPos;
if (input.charCodeAt(peg$currPos) === 40) {
s1 = peg$c22;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c23); }
}
if (s1 !== peg$FAILED) {
s2 = [];
s3 = peg$parseSPACE();
while (s3 !== peg$FAILED) {
s2.push(s3);
s3 = peg$parseSPACE();
}
if (s2 !== peg$FAILED) {
s3 = [];
if (peg$c24.test(input.charAt(peg$currPos))) {
s4 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s4 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c25); }
}
if (s4 !== peg$FAILED) {
while (s4 !== peg$FAILED) {
s3.push(s4);
if (peg$c24.test(input.charAt(peg$currPos))) {
s4 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s4 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c25); }
}
}
} else {
s3 = peg$FAILED;
}
if (s3 !== peg$FAILED) {
s4 = [];
s5 = peg$parseSPACE();
while (s5 !== peg$FAILED) {
s4.push(s5);
s5 = peg$parseSPACE();
}
if (s4 !== peg$FAILED) {
if (input.charCodeAt(peg$currPos) === 41) {
s5 = peg$c26;
peg$currPos++;
} else {
s5 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c27); }
}
if (s5 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c28(s3);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}