jhipster-domain-language
Version:
JHipster's own domain language
1,230 lines (1,178 loc) • 168 kB
JavaScript
module.exports = (function() {
"use strict";
/*
* Generated by PEG.js 0.9.0.
*
* http://pegjs.org/
*/
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);
function peg$parse(input) {
var options = arguments.length > 1 ? arguments[1] : {},
parser = this,
peg$FAILED = {},
peg$startRuleFunctions = { start: peg$parsestart },
peg$startRuleFunction = peg$parsestart,
peg$c0 = function(p) { return p; },
peg$c1 = function(ed, p) {return {"entities" : concat([ed],p.entities) , "relationships" : p.relationships, "enums" : p.enums, "dto": p.dto, "pagination": p.pagination, "service": service, "microservice": microservice, "searchEngine": searchEngine, "noClient": noClient, "noServer": noServer, "angularSuffixes": angularSuffixes};},
peg$c2 = function(rd, p) {return {"entities" : p.entities, "relationships" : flattenArray(concat([rd],p.relationships)), "enums" : p.enums, "dto": p.dto, "pagination": p.pagination, "service": service, "microservice": microservice, "searchEngine": searchEngine, "noClient": noClient, "noServer": noServer, "angularSuffixes": angularSuffixes};},
peg$c3 = function(end, p) {return {"entities" : p.entities, "relationships" : p.relationships, "enums": concat([end], p.enums), "dto": p.dto, "pagination": p.pagination, "service": service, "microservice": microservice, "searchEngine": searchEngine, "noClient": noClient, "noServer": noServer, "angularSuffixes": angularSuffixes};},
peg$c4 = function(dto, p) {return {"entities": p.entities, "relationships": p.relationships, "enums": p.enums, "dto": p.dto, "pagination": p.pagination, "service": service, "microservice": microservice, "searchEngine": searchEngine, "noClient": noClient, "noServer": noServer, "angularSuffixes": angularSuffixes};},
peg$c5 = function(pagination, p) {return {"entities" : p.entities, "relationships" : p.relationships, "enums": p.enums, "dto": p.dto, "pagination": p.pagination, "service": service, "microservice": microservice, "searchEngine": searchEngine, "noClient": noClient, "noServer": noServer, "angularSuffixes": angularSuffixes};},
peg$c6 = function(service, p) {return {"entities" : p.entities, "relationships" : p.relationships, "enums": p.enums, "dto": p.dto, "pagination": p.pagination, "service": service, "microservice": microservice, "searchEngine": searchEngine, "noClient": noClient, "noServer": noServer, "angularSuffixes": angularSuffixes};},
peg$c7 = function(p) {return {"entities" : p.entities,"relationships": p.relationships, "enums": p.enums, "dto": p.dto, "pagination": p.pagination, "service": service, "microservice": microservice, "searchEngine": searchEngine, "noClient": noClient, "noServer": noServer, "angularSuffixes": angularSuffixes};},
peg$c8 = function(microservice, p) {return {"entities" : p.entities, "relationships" : p.relationships, "enums": p.enums, "dto": p.dto, "pagination": p.pagination, "service": service, "microservice": microservice, "searchEngine": searchEngine, "noClient": noClient, "noServer": noServer, "angularSuffixes": angularSuffixes};},
peg$c9 = function(searchEngine, p) {return {"entities" : p.entities, "relationships" : p.relationships, "enums": p.enums, "dto": p.dto, "pagination": p.pagination, "service": service, "microservice": microservice, "searchEngine": searchEngine, "noClient": noClient, "noServer": noServer, "angularSuffixes": angularSuffixes};},
peg$c10 = function(noClient, p) {return {"entities" : p.entities, "relationships" : p.relationships, "enums": p.enums, "dto": p.dto, "pagination": p.pagination, "service": service, "microservice": microservice, "searchEngine": searchEngine, "noClient": noClient, "noServer": noServer, "angularSuffixes": angularSuffixes};},
peg$c11 = function(noServer, p) {return {"entities" : p.entities, "relationships" : p.relationships, "enums": p.enums, "dto": p.dto, "pagination": p.pagination, "service": service, "microservice": microservice, "searchEngine": searchEngine, "noClient": noClient, "noServer": noServer, "angularSuffixes": angularSuffixes};},
peg$c12 = function(angularSuffixes, p) {return {"entities" : p.entities, "relationships" : p.relationships, "enums": p.enums, "dto": p.dto, "pagination": p.pagination, "service": service, "microservice": microservice, "searchEngine": searchEngine, "noClient": noClient, "noServer": noServer, "angularSuffixes": angularSuffixes};},
peg$c13 = "",
peg$c14 = function() {return {"entities" : entities,"relationships": relationships, "enums": enums, "dto": dto, "pagination": pagination, "service": service, "microservice": microservice, "searchEngine": searchEngine, "noClient": noClient, "noServer": noServer, "angularSuffixes": angularSuffixes};},
peg$c15 = "entity",
peg$c16 = { type: "literal", value: "entity", description: "\"entity\"" },
peg$c17 = function(jd, e, tableName, eb) {return {"name" : e, tableName: tableName ? tableName : e, "body":eb, "javadoc":jd};},
peg$c18 = function(e, eb) {return {"name" : e, "body":eb, "javadoc":""};},
peg$c19 = "(",
peg$c20 = { type: "literal", value: "(", description: "\"(\"" },
peg$c21 = /^[A-z0..9_\-]/,
peg$c22 = { type: "class", value: "[A-z0..9_-]", description: "[A-z0..9_-]" },
peg$c23 = ")",
peg$c24 = { type: "literal", value: ")", description: "\")\"" },
peg$c25 = function(name) {return name.join('');},
peg$c26 = "{",
peg$c27 = { type: "literal", value: "{", description: "\"{\"" },
peg$c28 = "}",
peg$c29 = { type: "literal", value: "}", description: "\"}\"" },
peg$c30 = function(fdl) {return fdl;},
peg$c31 = function() {return [];},
peg$c32 = ",",
peg$c33 = { type: "literal", value: ",", description: "\",\"" },
peg$c34 = function(com, f, t, vl, fdl) {return concat([{"name" : f, "type" : t, "validations" : vl, "javadoc": com}], fdl );},
peg$c35 = function(com, f, t, vl) {return [{"name" : f, "type" : t, "validations" : vl, "javadoc": com}];},
peg$c36 = function(v, vl) {return concat([v], vl);},
peg$c37 = "relationship",
peg$c38 = { type: "literal", value: "relationship", description: "\"relationship\"" },
peg$c39 = function(rt, rb, subrb) {rb.cardinality = rt; addCardinalityToRelationships(rt, subrb); return concat([rb], subrb);},
peg$c40 = function(rb, morerb) { return concat([rb], morerb); },
peg$c41 = function(rb) { return rb; },
peg$c42 = "to",
peg$c43 = { type: "literal", value: "to", description: "\"to\"" },
peg$c44 = function(from, to) {return {"from" : from , "to" : to};},
peg$c45 = function(jd, e, i) {return {"name" :e, "injectedfield" : i, "javadoc": jd};},
peg$c46 = function(jd, e) {return {"name" :e, "injectedfield" : null, "javadoc": jd};},
peg$c47 = function(e) {return {"name" :e, "injectedfield" : null, "javadoc": ''};},
peg$c48 = "enum",
peg$c49 = { type: "literal", value: "enum", description: "\"enum\"" },
peg$c50 = function(e, el) {return {"name":e, "values" : el };},
peg$c51 = function(e, el) {return concat([e],el);},
peg$c52 = function(e) {return [e];},
peg$c53 = "except",
peg$c54 = { type: "literal", value: "except", description: "\"except\"" },
peg$c55 = function(sub) {return sub;},
peg$c56 = function(e, sub) {return concat([e], sub);},
peg$c57 = "dto",
peg$c58 = { type: "literal", value: "dto", description: "\"dto\"" },
peg$c59 = function(decl, ex) {
dto[decl[decl.length - 1]] = dto[decl[decl.length - 1]] || { list: [], excluded: [] };
concat(dto[decl[decl.length - 1]].list, decl.slice(0, decl.length - 1));
if (ex) {
concat(dto[decl[decl.length - 1]].excluded, ex);
}
},
peg$c60 = "paginate",
peg$c61 = { type: "literal", value: "paginate", description: "\"paginate\"" },
peg$c62 = function(decl, ex) {
pagination[decl[decl.length - 1]] = pagination[decl[decl.length - 1]] || { list: [], excluded: [] };
concat(pagination[decl[decl.length - 1]].list, decl.slice(0, decl.length - 1));
if (ex) {
concat(pagination[decl[decl.length - 1]].excluded, ex);
}
},
peg$c63 = "service",
peg$c64 = { type: "literal", value: "service", description: "\"service\"" },
peg$c65 = function(decl, ex) {
service[decl[decl.length - 1]] = service[decl[decl.length - 1]] || { list: [], excluded: [] };
concat(service[decl[decl.length - 1]].list, decl.slice(0, decl.length - 1));
if (ex) {
concat(service[decl[decl.length - 1]].excluded, ex);
}
},
peg$c66 = "microservice",
peg$c67 = { type: "literal", value: "microservice", description: "\"microservice\"" },
peg$c68 = function(decl, ex) {
microservice[decl[decl.length - 1]] = microservice[decl[decl.length - 1]] || { list: [], excluded: [] };
concat(microservice[decl[decl.length - 1]].list, decl.slice(0, decl.length - 1));
if (ex) {
concat(microservice[decl[decl.length - 1]].excluded, ex);
}
},
peg$c69 = "search",
peg$c70 = { type: "literal", value: "search", description: "\"search\"" },
peg$c71 = function(decl, ex) {
searchEngine[decl[decl.length - 1]] = searchEngine[decl[decl.length - 1]] || { list: [], excluded: [] };
concat(searchEngine[decl[decl.length - 1]].list, decl.slice(0, decl.length - 1));
if (ex) {
concat(searchEngine[decl[decl.length - 1]].excluded, ex);
}
},
peg$c72 = "skipClient for",
peg$c73 = { type: "literal", value: "skipClient for", description: "\"skipClient for\"" },
peg$c74 = function(decl, ex) {
concat(noClient.list, decl);
if (ex) {
concat(noClient.excluded, ex);
}
},
peg$c75 = "*",
peg$c76 = { type: "literal", value: "*", description: "\"*\"" },
peg$c77 = function() {return ['*'];},
peg$c78 = "all",
peg$c79 = { type: "literal", value: "all", description: "\"all\"" },
peg$c80 = "skipServer for",
peg$c81 = { type: "literal", value: "skipServer for", description: "\"skipServer for\"" },
peg$c82 = function(decl, ex) {
concat(noServer.list, decl);
if (ex) {
concat(noServer.excluded, ex);
}
},
peg$c83 = "angularSuffix",
peg$c84 = { type: "literal", value: "angularSuffix", description: "\"angularSuffix\"" },
peg$c85 = function(decl, ex) {
angularSuffixes[decl[decl.length - 1]] = angularSuffixes[decl[decl.length - 1]] || { list: [], excluded: [] };
concat(angularSuffixes[decl[decl.length - 1]].list, decl.slice(0, decl.length - 1));
if (ex) {
concat(angularSuffixes[decl[decl.length - 1]].excluded, ex);
}
},
peg$c86 = "with",
peg$c87 = { type: "literal", value: "with", description: "\"with\"" },
peg$c88 = /^[A-z0-9\-]/,
peg$c89 = { type: "class", value: "[A-z0-9-]", description: "[A-z0-9-]" },
peg$c90 = function(method) {return ['*', method.toString().replace(/,/g,'')];},
peg$c91 = function(e, method) {return [e, method.toString().replace(/,/g,'')];},
peg$c92 = "OneToOne",
peg$c93 = { type: "literal", value: "OneToOne", description: "\"OneToOne\"" },
peg$c94 = function() {return "one-to-one";},
peg$c95 = "OneToMany",
peg$c96 = { type: "literal", value: "OneToMany", description: "\"OneToMany\"" },
peg$c97 = function() {return "one-to-many";},
peg$c98 = "ManyToOne",
peg$c99 = { type: "literal", value: "ManyToOne", description: "\"ManyToOne\"" },
peg$c100 = function() {return "many-to-one";},
peg$c101 = "ManyToMany",
peg$c102 = { type: "literal", value: "ManyToMany", description: "\"ManyToMany\"" },
peg$c103 = function() {return "many-to-many";},
peg$c104 = { type: "other", description: "a type" },
peg$c105 = /^[A-Z]/,
peg$c106 = { type: "class", value: "[A-Z]", description: "[A-Z]" },
peg$c107 = /^[a-zA-Z0-9]/,
peg$c108 = { type: "class", value: "[a-zA-Z0-9]", description: "[a-zA-Z0-9]" },
peg$c109 = function(head, tail) {return head + tail.join('');},
peg$c110 = "required",
peg$c111 = { type: "literal", value: "required", description: "\"required\"" },
peg$c112 = function() {return {key:'required', value:''};},
peg$c113 = "minlength",
peg$c114 = { type: "literal", value: "minlength", description: "\"minlength\"" },
peg$c115 = function(int) {return {key:'minlength', value:int};},
peg$c116 = "maxlength",
peg$c117 = { type: "literal", value: "maxlength", description: "\"maxlength\"" },
peg$c118 = function(int) {return {key:'maxlength', value:int};},
peg$c119 = "minbytes",
peg$c120 = { type: "literal", value: "minbytes", description: "\"minbytes\"" },
peg$c121 = "maxbytes",
peg$c122 = { type: "literal", value: "maxbytes", description: "\"maxbytes\"" },
peg$c123 = "max",
peg$c124 = { type: "literal", value: "max", description: "\"max\"" },
peg$c125 = function(int) {return {key:'max', value:int};},
peg$c126 = "min",
peg$c127 = { type: "literal", value: "min", description: "\"min\"" },
peg$c128 = function(int) {return {key:'min', value:int};},
peg$c129 = "pattern",
peg$c130 = { type: "literal", value: "pattern", description: "\"pattern\"" },
peg$c131 = function(regexp) {return {key:'pattern' , value:regexp};},
peg$c132 = { type: "other", description: "apostrophe" },
peg$c133 = /^["|']/,
peg$c134 = { type: "class", value: "[\"|']", description: "[\"|']" },
peg$c135 = { type: "other", description: "a regular expression" },
peg$c136 = /^[a-zA-Z0-9!@#$%\^&*()_+\-=[\]{};':\\|,.<>\/? ]/,
peg$c137 = { type: "class", value: "[a-zA-Z0-9!@#$%^&*()_+\\-=\\[\\]{};':\\\\|,.<>\\/? ]", description: "[a-zA-Z0-9!@#$%^&*()_+\\-=\\[\\]{};':\\\\|,.<>\\/? ]" },
peg$c138 = function(word) {return makeString(word);},
peg$c139 = { type: "other", description: "an enum name" },
peg$c140 = { type: "other", description: "an enum property" },
peg$c141 = /^[_]/,
peg$c142 = { type: "class", value: "[_]", description: "[_]" },
peg$c143 = /^[A-Z0-9]/,
peg$c144 = { type: "class", value: "[A-Z0-9]", description: "[A-Z0-9]" },
peg$c145 = /^[A-Z0-9_]/,
peg$c146 = { type: "class", value: "[A-Z0-9_]", description: "[A-Z0-9_]" },
peg$c147 = function(underscore, head, tail) {
return underscore.join('') + head + tail.join('');
},
peg$c148 = { type: "other", description: "integer" },
peg$c149 = /^[0-9]/,
peg$c150 = { type: "class", value: "[0-9]", description: "[0-9]" },
peg$c151 = function(int) {return parseInt(int.join(""), 10);},
peg$c152 = { type: "other", description: "an injected field" },
peg$c153 = /^[a-zA-Z]/,
peg$c154 = { type: "class", value: "[a-zA-Z]", description: "[a-zA-Z]" },
peg$c155 = /^[a-zA-Z0-9()]/,
peg$c156 = { type: "class", value: "[a-zA-Z0-9()]", description: "[a-zA-Z0-9()]" },
peg$c157 = { type: "other", description: "an entity name" },
peg$c158 = { type: "other", description: "a field name" },
peg$c159 = { type: "other", description: "a space" },
peg$c160 = /^['\n'|'\t'|'\r'|' '|\u2028|\u2029]/,
peg$c161 = { type: "class", value: "['\\n'|'\\t'|'\\r'|' '|\\u2028|\\u2029]", description: "['\\n'|'\\t'|'\\r'|' '|\\u2028|\\u2029]" },
peg$c162 = function(nc) {return makeString(nc);},
peg$c163 = "/*",
peg$c164 = { type: "literal", value: "/*", description: "\"/*\"" },
peg$c165 = /^[*]/,
peg$c166 = { type: "class", value: "[*]", description: "[*]" },
peg$c167 = "/",
peg$c168 = { type: "literal", value: "/", description: "\"/\"" },
peg$c169 = "//",
peg$c170 = { type: "literal", value: "//", description: "\"//\"" },
peg$c171 = /^[^\n\r]/,
peg$c172 = { type: "class", value: "[^\\n\\r]", description: "[^\\n\\r]" },
peg$c173 = { type: "any", description: "any character" },
peg$c174 = function(char) {return char;},
peg$currPos = 0,
peg$savedPos = 0,
peg$posDetailsCache = [{ 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$savedPos, peg$currPos);
}
function location() {
return peg$computeLocation(peg$savedPos, peg$currPos);
}
function expected(description) {
throw peg$buildException(
null,
[{ type: "other", description: description }],
input.substring(peg$savedPos, peg$currPos),
peg$computeLocation(peg$savedPos, peg$currPos)
);
}
function error(message) {
throw peg$buildException(
message,
null,
input.substring(peg$savedPos, peg$currPos),
peg$computeLocation(peg$savedPos, peg$currPos)
);
}
function peg$computePosDetails(pos) {
var details = peg$posDetailsCache[pos],
p, ch;
if (details) {
return details;
} else {
p = pos - 1;
while (!peg$posDetailsCache[p]) {
p--;
}
details = peg$posDetailsCache[p];
details = {
line: details.line,
column: details.column,
seenCR: details.seenCR
};
while (p < pos) {
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;
}
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$buildException(message, expected, found, location) {
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(/[\u0100-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); })
.replace(/[\u1000-\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.";
}
if (expected !== null) {
cleanupExpected(expected);
}
return new peg$SyntaxError(
message !== null ? message : 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$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$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$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$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$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$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$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$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$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$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$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$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$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$c7(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$parseJDLComment();
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(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$c8(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$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$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$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$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$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$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$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 = peg$c13;
if (s1 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c14();
}
s0 = s1;
}
}
}
}
}
}
}
}
}
}
}
}
}
return s0;
}
function peg$parseentityDecl() {
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13;
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$parseJDLComment();
if (s3 === peg$FAILED) {
s3 = null;
}
if (s3 !== peg$FAILED) {
s4 = [];
s5 = peg$parsespace();
while (s5 !== peg$FAILED) {
s4.push(s5);
s5 = peg$parsespace();
}
if (s4 !== peg$FAILED) {
if (input.substr(peg$currPos, 6) === peg$c15) {
s5 = peg$c15;
peg$currPos += 6;
} else {
s5 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c16); }
}
if (s5 !== peg$FAILED) {
s6 = [];
s7 = peg$parsespace();
while (s7 !== peg$FAILED) {
s6.push(s7);
s7 = peg$parsespace();
}
if (s6 !== peg$FAILED) {
s7 = peg$parseENTITYNAME();
if (s7 !== peg$FAILED) {
s8 = [];
s9 = peg$parsespace();
while (s9 !== peg$FAILED) {
s8.push(s9);
s9 = peg$parsespace();
}
if (s8 !== peg$FAILED) {
s9 = peg$parseentityTableNameDecl();
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) {
s11 = peg$parseentityBody();
if (s11 === peg$FAILED) {
s11 = null;
}
if (s11 !== peg$FAILED) {
s12 = [];
s13 = peg$parsespace();
while (s13 !== peg$FAILED) {
s12.push(s13);
s13 = peg$parsespace();
}
if (s12 !== peg$FAILED) {
s13 = peg$parseJDLComment();
if (s13 === peg$FAILED) {
s13 = null;
}
if (s13 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c17(s1, s7, s9, s11);
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;
}
} 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;
if (input.substr(peg$currPos, 6) === peg$c15) {
s1 = peg$c15;
peg$currPos += 6;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c16); }
}
if (s1 !== peg$FAILED) {
s2 = [];
s3 = peg$parsespace();
while (s3 !== peg$FAILED) {
s2.push(s3);
s3 = peg$parsespace();
}
if (s2 !== peg$FAILED) {
s3 = peg$parseENTITYNAME();
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$c18(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$c19;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c20); }
}
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$c21.test(input.charAt(peg$currPos))) {
s4 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s4 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c22); }
}
if (s4 !== peg$FAILED) {
while (s4 !== peg$FAILED) {
s3.push(s4);
if (peg$c21.test(input.charAt(peg$currPos))) {
s4 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s4 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c22); }
}
}
} else {