// tslint:disable:only-arrow-functions // tslint:disable:object-literal-shorthand // tslint:disable:trailing-comma // tslint:disable:object-literal-sort-keys // tslint:disable:one-variable-per-declaration // tslint:disable:max-line-length // tslint:disable:no-consecutive-blank-lines // tslint:disable:align // Generated by PEG.js v. 0.10.0 (ts-pegjs plugin v. 0.2.6 ) // // https://pegjs.org/ https://github.com/metadevpro/ts-pegjs "use strict"; export interface IFilePosition { offset: number; line: number; column: number; } export interface IFileRange { start: IFilePosition; end: IFilePosition; } export interface ILiteralExpectation { type: "literal"; text: string; ignoreCase: boolean; } export interface IClassParts extends Array {} export interface IClassExpectation { type: "class"; parts: IClassParts; inverted: boolean; ignoreCase: boolean; } export interface IAnyExpectation { type: "any"; } export interface IEndExpectation { type: "end"; } export interface IOtherExpectation { type: "other"; description: string; } export type Expectation = ILiteralExpectation | IClassExpectation | IAnyExpectation | IEndExpectation | IOtherExpectation; export class SyntaxError extends Error { public static buildMessage(expected: Expectation[], found: string | null) { function hex(ch: string): string { return ch.charCodeAt(0).toString(16).toUpperCase(); } function literalEscape(s: string): string { 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, (ch) => "\\x0" + hex(ch) ) .replace(/[\x10-\x1F\x7F-\x9F]/g, (ch) => "\\x" + hex(ch) ); } function classEscape(s: string): string { 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, (ch) => "\\x0" + hex(ch) ) .replace(/[\x10-\x1F\x7F-\x9F]/g, (ch) => "\\x" + hex(ch) ); } function describeExpectation(expectation: Expectation) { switch (expectation.type) { case "literal": return "\"" + literalEscape(expectation.text) + "\""; case "class": const escapedParts = expectation.parts.map((part) => { return Array.isArray(part) ? classEscape(part[0] as string) + "-" + classEscape(part[1] as string) : classEscape(part); }); return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]"; case "any": return "any character"; case "end": return "end of input"; case "other": return expectation.description; } } function describeExpected(expected1: Expectation[]) { const descriptions = expected1.map(describeExpectation); let i: number; let j: number; 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(found1: string | null) { return found1 ? "\"" + literalEscape(found1) + "\"" : "end of input"; } return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found."; } public message: string; public expected: Expectation[]; public found: string | null; public location: IFileRange; public name: string; constructor(message: string, expected: Expectation[], found: string | null, location: IFileRange) { super(); this.message = message; this.expected = expected; this.found = found; this.location = location; this.name = "SyntaxError"; if (typeof (Error as any).captureStackTrace === "function") { (Error as any).captureStackTrace(this, SyntaxError); } } } function peg$parse(input: string, options?: IParseOptions) { options = options !== undefined ? options : {}; const peg$FAILED: Readonly<{}> = {}; const peg$startRuleFunctions: {[id: string]: any} = { start: peg$parsestart, declaration: peg$parsedeclaration, declarator: peg$parsedeclarator, function_definition: peg$parsefunction_definition }; let peg$startRuleFunction: () => any = peg$parsestart; const peg$c0 = function(d: any): any {return d}; const peg$c1 = function(decls: any): any {return {construct_type: "translation_unit", declarations: decls.filter((elem: any) => elem!=="comment")};}; const peg$c2 = function(): any {return "comment";}; const peg$c3 = "//@className="; const peg$c4 = peg$literalExpectation("//@className=", false); const peg$c5 = function(name: any): any { getUserTypeNames()[name.identifier]=true; }; const peg$c6 = /^[^\n]/; const peg$c7 = peg$classExpectation(["\n"], true, false); const peg$c8 = "\n"; const peg$c9 = peg$literalExpectation("\n", false); const peg$c10 = "//"; const peg$c11 = peg$literalExpectation("//", false); const peg$c12 = "/*"; const peg$c13 = peg$literalExpectation("/*", false); const peg$c14 = "*/"; const peg$c15 = peg$literalExpectation("*/", false); const peg$c16 = peg$anyExpectation(); const peg$c17 = ":"; const peg$c18 = peg$literalExpectation(":", false); const peg$c19 = function(label: any, stmt: any): any {return track({construct_type: "labeled_statement", label:label, statement: stmt}, location(), text()); }; const peg$c20 = "case"; const peg$c21 = peg$literalExpectation("case", false); const peg$c22 = function(c: any, stmt: any): any { return track({construct_type: "labeled_statement", case:c, statement:stmt}, location(), text()); }; const peg$c23 = "default"; const peg$c24 = peg$literalExpectation("default", false); const peg$c25 = function(stmt: any): any { return track({construct_type: "labeled_statement", default:true, stmt:stmt}, location(), text()); }; const peg$c26 = ";"; const peg$c27 = peg$literalExpectation(";", false); const peg$c28 = function(expr: any): any { return track({construct_type: "expression_statement", expression:expr}, location(), text()); }; const peg$c29 = function(): any { return track({construct_type: "null_statement"}, location(), text()); }; const peg$c30 = "{"; const peg$c31 = peg$literalExpectation("{", false); const peg$c32 = function(stmt: any): any {return stmt}; const peg$c33 = "}"; const peg$c34 = peg$literalExpectation("}", false); const peg$c35 = function(stmts: any): any { return track({construct_type: "block", statements: stmts}, location(), text()); }; const peg$c36 = "if"; const peg$c37 = peg$literalExpectation("if", false); const peg$c38 = "("; const peg$c39 = peg$literalExpectation("(", false); const peg$c40 = ")"; const peg$c41 = peg$literalExpectation(")", false); const peg$c42 = "else"; const peg$c43 = peg$literalExpectation("else", false); const peg$c44 = function(cond: any, then: any, e: any): any {return track({construct_type:"if_statement", condition:cond, then:then, otherwise:e}, location(), text()); }; const peg$c45 = function(cond: any, then: any): any {return track({construct_type:"if_statement", condition:cond, then:then}, location(), text()); }; const peg$c46 = "while"; const peg$c47 = peg$literalExpectation("while", false); const peg$c48 = function(cond: any, body: any): any { return track({construct_type:"while_statement", condition:cond, body:body}, location(), text()); }; const peg$c49 = "do"; const peg$c50 = peg$literalExpectation("do", false); const peg$c51 = function(body: any, cond: any): any { return track({construct_type:"dowhile_statement", condition:cond, body:body}, location(), text()); }; const peg$c52 = "for"; const peg$c53 = peg$literalExpectation("for", false); const peg$c54 = function(init: any, cond: any, post: any, body: any): any { return track({construct_type:"for_statement", condition:cond, initial:init, post:post, body:body}, location(), text()); }; const peg$c55 = "break"; const peg$c56 = peg$literalExpectation("break", false); const peg$c57 = function(): any { return track({construct_type:"break_statement"}, location(), text()); }; const peg$c58 = "continue"; const peg$c59 = peg$literalExpectation("continue", false); const peg$c60 = function(): any {return track({construct_type:"continue_statement"}, location(), text()); }; const peg$c61 = "return"; const peg$c62 = peg$literalExpectation("return", false); const peg$c63 = function(ret: any): any { return track({construct_type:"return_statement", expression:ret}, location(), text()); }; const peg$c64 = function(d: any): any {return track({construct_type:"declaration_statement", declaration: d}, location(), text()); }; const peg$c65 = function(specs: any): any {return specs.length === 0;}; const peg$c66 = function(specs: any, declarators: any): any { return track({construct_type: "simple_declaration", specs:specs, declarators:declarators}, location(), text()); }; const peg$c67 = ","; const peg$c68 = peg$literalExpectation(",", false); const peg$c69 = function(first: any, d: any): any {return d;}; const peg$c70 = function(first: any, rest: any): any {rest.unshift(first); return rest; }; const peg$c71 = function(spec: any): any { return spec; }; const peg$c72 = function(specs: any, declarator: any, init: any, body: any): any {return track({construct_type: "function_definition", specs:specs, declarator:declarator, ctor_initializer:init, body:body}, location(), text()); }; const peg$c73 = function(declarator: any, init: any, body: any): any {return track({construct_type: "function_definition", specs:emptyDeclSpecs, declarator:declarator, ctor_initializer:init, body:body}, location(), text()); }; const peg$c74 = function(first: any, m: any): any {return m;}; const peg$c75 = function(first: any, rest: any): any {rest.unshift(first); return track({construct_type: "ctor_initializer", initializers: rest}, location(), text());}; const peg$c76 = function(i: any, args: any): any {return track({construct_type: "member_initializer", member: i, args:args || []}, location(), text()); }; const peg$c77 = function(nonTypeDeclSpecs: any, firstTypeSpec: any, s: any): any {return s;}; const peg$c78 = function(nonTypeDeclSpecs: any, firstTypeSpec: any, rest: any): any { firstTypeSpec && rest.unshift(firstTypeSpec); rest = nonTypeDeclSpecs.concat(rest); var declSpecs : any = { typeSpecs: [], storageSpecs: [], length: 0 }; for(var i = 0; i < rest.length; ++i){ let spec = rest[i]; if (spec.typeSpec){ declSpecs.typeSpecs.push(spec.typeSpec); } else if (spec.storageSpec){ declSpecs.storageSpecs.push(spec.storageSpec); } else if (spec === "friend"){ declSpecs.friend = true; } else if (spec === "typedef"){ declSpecs.typedef = true; } else if (spec === "inline"){ declSpecs.inline = true; } else if (spec === "explicit"){ declSpecs.explicit = true; } else if (spec === "virtual"){ declSpecs.virtual = true; } ++declSpecs.length; } return track(declSpecs, location(), text()); }; const peg$c79 = function(first: any, s: any): any {return s;}; const peg$c80 = function(first: any, rest: any): any {first && rest.unshift(first); return rest;}; const peg$c81 = function(t: any): any { return {typeSpec:t}; }; const peg$c82 = function(s: any): any { return {storageSpec:s}; }; const peg$c83 = "typedef"; const peg$c84 = peg$literalExpectation("typedef", false); const peg$c85 = "friend"; const peg$c86 = peg$literalExpectation("friend", false); const peg$c87 = "const"; const peg$c88 = peg$literalExpectation("const", false); const peg$c89 = function(): any {return {typeSpec: "const"};}; const peg$c90 = "volatile"; const peg$c91 = peg$literalExpectation("volatile", false); const peg$c92 = function(): any {return {typeSpec: "volatile"};}; const peg$c93 = function(): any { prohibitOwnClassName = true; return true;}; const peg$c94 = function(d: any): any { prohibitOwnClassName = false; return d;}; const peg$c95 = function(): any { prohibitOwnClassName = false; return false;}; const peg$c96 = "PEG_doesnt_realize_we_never_get_to_here"; const peg$c97 = peg$literalExpectation("PEG_doesnt_realize_we_never_get_to_here", false); const peg$c98 = function(first: any, s: any): any {return s}; const peg$c99 = function(first: any, rest: any): any { rest.unshift(first); return track(rest, location(), text()); }; const peg$c100 = function(t: any): any { return prohibitOwnClassName && t === classNameStack[classNameStack.length - 1]; }; const peg$c101 = function(t: any): any { return t; }; const peg$c102 = function(name: any): any {track({construct_type: "elaborated_type_specifier", name:name}, location(), text());}; const peg$c103 = "register"; const peg$c104 = peg$literalExpectation("register", false); const peg$c105 = "static"; const peg$c106 = peg$literalExpectation("static", false); const peg$c107 = "thread_local"; const peg$c108 = peg$literalExpectation("thread_local", false); const peg$c109 = "extern"; const peg$c110 = peg$literalExpectation("extern", false); const peg$c111 = "mutable"; const peg$c112 = peg$literalExpectation("mutable", false); const peg$c113 = "inline"; const peg$c114 = peg$literalExpectation("inline", false); const peg$c115 = "explicit"; const peg$c116 = peg$literalExpectation("explicit", false); const peg$c117 = "virtual"; const peg$c118 = peg$literalExpectation("virtual", false); const peg$c119 = peg$otherExpectation("simple type name"); const peg$c120 = function(t: any): any {return t;}; const peg$c121 = "char"; const peg$c122 = peg$literalExpectation("char", false); const peg$c123 = "short"; const peg$c124 = peg$literalExpectation("short", false); const peg$c125 = "int"; const peg$c126 = peg$literalExpectation("int", false); const peg$c127 = "size_t"; const peg$c128 = peg$literalExpectation("size_t", false); const peg$c129 = "bool"; const peg$c130 = peg$literalExpectation("bool", false); const peg$c131 = "long"; const peg$c132 = peg$literalExpectation("long", false); const peg$c133 = "signed"; const peg$c134 = peg$literalExpectation("signed", false); const peg$c135 = "unsigned"; const peg$c136 = peg$literalExpectation("unsigned", false); const peg$c137 = "float"; const peg$c138 = peg$literalExpectation("float", false); const peg$c139 = "double"; const peg$c140 = peg$literalExpectation("double", false); const peg$c141 = "void"; const peg$c142 = peg$literalExpectation("void", false); const peg$c143 = function(n: any): any {return n.identifier;}; const peg$c144 = "enum"; const peg$c145 = peg$literalExpectation("enum", false); const peg$c146 = function(name: any, first: any, e: any): any {return e;}; const peg$c147 = function(name: any, first: any, rest: any): any { return "enum"; }; const peg$c148 = "="; const peg$c149 = peg$literalExpectation("=", false); const peg$c150 = function(name: any, e: any): any {return e;}; const peg$c151 = function(name: any, value: any): any {return {name:name, value:value}; }; const peg$c152 = "@library_unsupported@"; const peg$c153 = peg$literalExpectation("@library_unsupported@", false); const peg$c154 = function(d: any): any {return track(absorb(d, {library_unsupported: true}), location(), text());}; const peg$c155 = function(d: any, i: any): any {return track(absorb(d, {initializer: i}), location(), text());}; const peg$c156 = function(args: any): any { return track({construct_type:"direct_initializer", args:args}, location(), text()); }; const peg$c157 = function(init: any): any {return track({construct_type:"copy_initializer", args:[init]}, location(), text());}; const peg$c158 = function(init: any): any {return track({construct_type:"list_initializer", arg:init}, location(), text());}; const peg$c159 = function(first: any, op: any, e: any): any {return e;}; const peg$c160 = function(first: any, rest: any): any { rest.unshift(first); return track({construct_type:"initializer_list_expression", elements: rest}, location(), text()); }; const peg$c161 = function(d: any): any { var d2 = track(absorb({construct_type:"declarator"}, d), location(), text()); return d2; }; const peg$c162 = function(d: any): any { var d2 = track(absorb({construct_type:"declarator", abstract: true}, d), location(), text()); return d2; }; const peg$c163 = "*"; const peg$c164 = peg$literalExpectation("*", false); const peg$c165 = function(cv: any, decl: any): any { return absorb({pointer:decl}, cv); }; const peg$c166 = "&"; const peg$c167 = peg$literalExpectation("&", false); const peg$c168 = function(cv: any, decl: any): any { return absorb({reference:decl}, cv); }; const peg$c169 = function(decl: any, postfixes: any): any { return absorb(decl, {postfixes: postfixes}); }; const peg$c170 = function(p: any): any {return p}; const peg$c171 = function(args: any, cv: any): any { return absorb({kind:"function", args:args}, cv); }; const peg$c172 = "["; const peg$c173 = peg$literalExpectation("[", false); const peg$c174 = "]"; const peg$c175 = peg$literalExpectation("]", false); const peg$c176 = function(size: any): any { return {kind:"array", size:size}; }; const peg$c177 = function(d: any): any { return {name:d}; }; const peg$c178 = function(d: any): any {return {sub:d};}; const peg$c179 = ""; const peg$c180 = function(): any {return {};}; const peg$c181 = function(specs: any, decl: any): any { return track({specs:specs, declarator:decl}, location(), text()); }; const peg$c182 = function(): any { return {const: true, volatile: true}; }; const peg$c183 = function(): any { return {const: true}; }; const peg$c184 = function(): any { return {volatile: true}; }; const peg$c185 = function(first: any, arg: any): any {return arg;}; const peg$c186 = function(first: any, rest: any): any { rest.unshift(first); return rest; }; const peg$c187 = function(): any {return [];}; const peg$c188 = function(specs: any, decl: any, init: any): any {return track({construct_type:"parameter_declaration", declarator:decl, specs:specs, initializer:init}, location(), text()); }; const peg$c189 = function(specs: any, decl: any): any {return track({construct_type:"parameter_declaration", specs:specs, declarator:decl}, location(), text()); }; const peg$c190 = function(first: any, op: any, e: any): any {return [op,e];}; const peg$c191 = function(first: any, rest: any): any { return track(composeBinaryOp(first, rest, "left", "comma_expression"), location(), text()); }; const peg$c192 = function(lhs: any, op: any, rhs: any): any { return track({construct_type: "assignment_expression", lhs:lhs, operator:op, rhs:rhs}, location(), text()); }; const peg$c193 = function(lhs: any, op: any, rhs: any): any { return track({construct_type: "compound_assignment_expression", lhs:lhs, operator:op, rhs:rhs}, location(), text()); }; const peg$c194 = "*="; const peg$c195 = peg$literalExpectation("*=", false); const peg$c196 = "/="; const peg$c197 = peg$literalExpectation("/=", false); const peg$c198 = "%="; const peg$c199 = peg$literalExpectation("%=", false); const peg$c200 = "+="; const peg$c201 = peg$literalExpectation("+=", false); const peg$c202 = "-="; const peg$c203 = peg$literalExpectation("-=", false); const peg$c204 = ">>="; const peg$c205 = peg$literalExpectation(">>=", false); const peg$c206 = "<<="; const peg$c207 = peg$literalExpectation("<<=", false); const peg$c208 = "&="; const peg$c209 = peg$literalExpectation("&=", false); const peg$c210 = "and_eq"; const peg$c211 = peg$literalExpectation("and_eq", false); const peg$c212 = function(): any {return "&=";}; const peg$c213 = "^="; const peg$c214 = peg$literalExpectation("^=", false); const peg$c215 = "xor_eq"; const peg$c216 = peg$literalExpectation("xor_eq", false); const peg$c217 = function(): any {return "^=";}; const peg$c218 = "|="; const peg$c219 = peg$literalExpectation("|=", false); const peg$c220 = "or_eq"; const peg$c221 = peg$literalExpectation("or_eq", false); const peg$c222 = function(): any {return "|=";}; const peg$c223 = function(sub: any): any { sub.constant = true; return sub; }; const peg$c224 = "?"; const peg$c225 = peg$literalExpectation("?", false); const peg$c226 = function(condition: any, then: any, otherwise: any): any { return track({construct_type: "ternary_expression", condition:condition, then:then, otherwise:otherwise}, location(), text()); }; const peg$c227 = "||"; const peg$c228 = peg$literalExpectation("||", false); const peg$c229 = "or"; const peg$c230 = peg$literalExpectation("or", false); const peg$c231 = function(first: any, op: any, e: any): any {return ["||",e];}; const peg$c232 = function(first: any, rest: any): any { return track(composeBinaryOp(first, rest, "left", "logical_binary_operator_expression"), location(), text()); }; const peg$c233 = "&&"; const peg$c234 = peg$literalExpectation("&&", false); const peg$c235 = "and"; const peg$c236 = peg$literalExpectation("and", false); const peg$c237 = function(first: any, op: any, e: any): any {return ["&&",e];}; const peg$c238 = "|"; const peg$c239 = peg$literalExpectation("|", false); const peg$c240 = "bitor"; const peg$c241 = peg$literalExpectation("bitor", false); const peg$c242 = function(first: any, op: any, e: any): any {return ["|",e];}; const peg$c243 = function(first: any, rest: any): any { return track(composeBinaryOp(first, rest, "left", "arithmetic_binary_operator_expression"), location(), text()); }; const peg$c244 = "^"; const peg$c245 = peg$literalExpectation("^", false); const peg$c246 = "xor"; const peg$c247 = peg$literalExpectation("xor", false); const peg$c248 = function(first: any, op: any, e: any): any {return ["^",e];}; const peg$c249 = "bitand"; const peg$c250 = peg$literalExpectation("bitand", false); const peg$c251 = function(first: any, op: any, e: any): any {return ["&",e];}; const peg$c252 = "=="; const peg$c253 = peg$literalExpectation("==", false); const peg$c254 = "!="; const peg$c255 = peg$literalExpectation("!=", false); const peg$c256 = "not_eq"; const peg$c257 = peg$literalExpectation("not_eq", false); const peg$c258 = function(first: any): any {return "!=";}; const peg$c259 = function(first: any, rest: any): any { return track(composeBinaryOp(first, rest, "left", "relational_binary_operator_expression"), location(), text()); }; const peg$c260 = "<="; const peg$c261 = peg$literalExpectation("<=", false); const peg$c262 = ">="; const peg$c263 = peg$literalExpectation(">=", false); const peg$c264 = "<"; const peg$c265 = peg$literalExpectation("<", false); const peg$c266 = ">"; const peg$c267 = peg$literalExpectation(">", false); const peg$c268 = "<<"; const peg$c269 = peg$literalExpectation("<<", false); const peg$c270 = ">>"; const peg$c271 = peg$literalExpectation(">>", false); const peg$c272 = "+"; const peg$c273 = peg$literalExpectation("+", false); const peg$c274 = "-"; const peg$c275 = peg$literalExpectation("-", false); const peg$c276 = "/"; const peg$c277 = peg$literalExpectation("/", false); const peg$c278 = "%"; const peg$c279 = peg$literalExpectation("%", false); const peg$c280 = function(first: any, rest: any): any { return track(composeBinaryOp(first, rest, "left", "pointer_to_member_expression"), location(), text()); }; const peg$c281 = ".*"; const peg$c282 = peg$literalExpectation(".*", false); const peg$c283 = "->*"; const peg$c284 = peg$literalExpectation("->*", false); const peg$c285 = function(t: any, sub: any): any { return track({construct_type: "c_style_cast_expression", type:t, operand:sub}, location(), text()); }; const peg$c286 = "++"; const peg$c287 = peg$literalExpectation("++", false); const peg$c288 = function(op: any, sub: any): any { return track({construct_type: "prefix_increment_expression", operator:op, operand:sub}, location(), text()); }; const peg$c289 = "--"; const peg$c290 = peg$literalExpectation("--", false); const peg$c291 = function(op: any, sub: any): any { return track(absorb({operand:sub}, op), location(), text()); }; const peg$c292 = "sizeof"; const peg$c293 = peg$literalExpectation("sizeof", false); const peg$c294 = function(op: any, sub: any): any { return track({construct_type: "sizeof_expression", operator:"sizeof", operand:sub}, location(), text()); }; const peg$c295 = function(op: any, sub: any): any { return track({construct_type: "sizeof_type_expression", operator:"sizeof", operand:sub}, location(), text()); }; const peg$c296 = function(): any {return {construct_type: "dereference_expression", operator: "*"};}; const peg$c297 = function(): any {return {construct_type: "address_of_expression", operator: "&"};}; const peg$c298 = function(): any {return {construct_type: "unary_plus_expression", operator: "+"};}; const peg$c299 = function(): any {return {construct_type: "unary_minus_expression", operator: "-"};}; const peg$c300 = "!"; const peg$c301 = peg$literalExpectation("!", false); const peg$c302 = function(): any {return {construct_type: "logical_not_expression", operator: "!"};}; const peg$c303 = "not"; const peg$c304 = peg$literalExpectation("not", false); const peg$c305 = "~"; const peg$c306 = peg$literalExpectation("~", false); const peg$c307 = function(): any {return {construct_type: "bitwise_not_expression", operator: "~"};}; const peg$c308 = "compl"; const peg$c309 = peg$literalExpectation("compl", false); const peg$c310 = "new"; const peg$c311 = peg$literalExpectation("new", false); const peg$c312 = function(id: any, init: any): any { return track(absorb({construct_type: "new_expression", initializer: init}, id), location(), text()); }; const peg$c313 = function(id: any, init: any): any { return track(absorb({construct_type: "new_expression", initializer: init}, id), location(), text()); }; const peg$c314 = function(specs: any, id: any): any {return id;}; const peg$c315 = function(specs: any, decl: any): any { return track({specs:specs, declarator:decl}, location(), text()); }; const peg$c316 = function(d: any): any { var d2 = track(absorb({construct_type:"declarator"}, d), location(), text()); return d2; }; const peg$c317 = function(postfixes: any): any { return {postfixes: postfixes}; }; const peg$c318 = function(p: any): any {return p;}; const peg$c319 = function(): any {return {construct_type:"value_initializer"};}; const peg$c320 = function(args: any): any {return {construct_type:"direct_initializer", args:args || []};}; const peg$c321 = "delete"; const peg$c322 = peg$literalExpectation("delete", false); const peg$c323 = function(t: any): any { return track({construct_type: "delete_expression", operand: t}, location(), text()); }; const peg$c324 = function(t: any): any { return track({construct_type: "delete_array_expression", operand: t}, location(), text()); }; const peg$c325 = "static_cast"; const peg$c326 = peg$literalExpectation("static_cast", false); const peg$c327 = function(t: any, sub: any): any { return track({construct_type: "static_cast_expression", type: t, operand:sub}, location(), text());}; const peg$c328 = "dynamic_cast"; const peg$c329 = peg$literalExpectation("dynamic_cast", false); const peg$c330 = function(t: any, sub: any): any { return track({construct_type: "dynamic_cast_expression", type: t, operand:sub}, location(), text());}; const peg$c331 = "reinterpret_cast"; const peg$c332 = peg$literalExpectation("reinterpret_cast", false); const peg$c333 = function(t: any, sub: any): any { return track({construct_type: "reinterpret_cast_expression", type: t, operand:sub}, location(), text());}; const peg$c334 = "const_cast"; const peg$c335 = peg$literalExpectation("const_cast", false); const peg$c336 = function(t: any, sub: any): any { return track({construct_type: "const_cast_expression", type: t, operand:sub}, location(), text());}; const peg$c337 = function(sub: any, op: any): any {return op;}; const peg$c338 = function(sub: any, ops: any): any { return ops.length > 0 ? track(postfixExp(ops, sub), location(), text()) : sub;}; const peg$c339 = function(sub: any): any { return track({construct_type:"subscript_expression", offset:sub}, location(), text()); }; const peg$c340 = function(args: any): any { return track({construct_type: "function_call_expression", args: args || []}, location(), text()); }; const peg$c341 = "."; const peg$c342 = peg$literalExpectation(".", false); const peg$c343 = function(mem: any): any { return track({construct_type: "dot_expression", member: mem}, location(), text()); }; const peg$c344 = "->"; const peg$c345 = peg$literalExpectation("->", false); const peg$c346 = function(mem: any): any { return track({construct_type: "arrow_expression", member: mem}, location(), text()); }; const peg$c347 = function(): any { return track({construct_type: "postfix_increment_expression", operator: "++"}, location(), text()); }; const peg$c348 = function(): any { return track({construct_type: "postfix_increment_expression", operator: "--"}, location(), text()); }; const peg$c349 = function(type: any, args: any): any { return track({construct_type: "construct_expression", type:type, args:args || []}, location(), text()); }; const peg$c350 = function(first: any, e: any): any {return e;}; const peg$c351 = function(sub: any): any {return track({construct_type: "parentheses_expression", subexpression:sub}, location(), text());}; const peg$c352 = "this"; const peg$c353 = peg$literalExpectation("this", false); const peg$c354 = function(): any {return track({construct_type: "this_expression"}, location(), text()); }; const peg$c355 = "nullptr"; const peg$c356 = peg$literalExpectation("nullptr", false); const peg$c357 = function(): any {return track({construct_type: "nullptr_expression"}, location(), text()); }; const peg$c358 = "NULL"; const peg$c359 = peg$literalExpectation("NULL", false); const peg$c360 = function(id: any): any { return track({construct_type: "identifier_expression", identifier: id}, location(), text()); }; const peg$c361 = function(n: any): any { return KEYWORDS.has(n.identifier); }; const peg$c362 = function(n: any): any { return n; }; const peg$c363 = function(n: any): any { return {construct_type: "unqualified_identifier", identifier: "~"+n.identifier}; }; const peg$c364 = function(n: any, u: any): any { n.push(u); return {construct_type: "qualified_identifier", components: n}; }; const peg$c365 = "::"; const peg$c366 = peg$literalExpectation("::", false); const peg$c367 = function(id: any): any {return id;}; const peg$c368 = function(): any { return [];}; const peg$c369 = function(id: any): any {return track({identifier: id}, location(), text());}; const peg$c370 = "operator"; const peg$c371 = peg$literalExpectation("operator", false); const peg$c372 = function(op: any): any {return track({construct_type: "unqualified_identifier", identifier: "operator"+op, operator: op}, location(), text());}; const peg$c373 = "new[]"; const peg$c374 = peg$literalExpectation("new[]", false); const peg$c375 = "delete[]"; const peg$c376 = peg$literalExpectation("delete[]", false); const peg$c377 = "()"; const peg$c378 = peg$literalExpectation("()", false); const peg$c379 = "[]"; const peg$c380 = peg$literalExpectation("[]", false); const peg$c381 = "?:"; const peg$c382 = peg$literalExpectation("?:", false); const peg$c383 = function(lit: any): any {return track({construct_type: "numeric_literal_expression", type:"float", value:lit}, location(), text());}; const peg$c384 = function(lit: any): any {return track({construct_type: "numeric_literal_expression", type:"int", value:lit}, location(), text());}; const peg$c385 = function(lit: any): any {return track({construct_type: "numeric_literal_expression", type:"char", value:lit}, location(), text());}; const peg$c386 = function(lit: any): any {return track({construct_type: "string_literal_expression", type:"string", value:lit}, location(), text());}; const peg$c387 = function(lit: any): any {return track({construct_type: "numeric_literal_expression", type:"bool", value:lit}, location(), text());}; const peg$c388 = /^[0-9]/; const peg$c389 = peg$classExpectation([["0", "9"]], false, false); const peg$c390 = function(neg: any, digits: any): any { return parseInt((neg ? neg : "") + digits.join("")); }; const peg$c391 = /^[0-9.]/; const peg$c392 = peg$classExpectation([["0", "9"], "."], false, false); const peg$c393 = function(neg: any, digits: any): any {return digits.indexOf(".") == digits.lastIndexOf(".") && digits.indexOf(".") != -1;}; const peg$c394 = function(neg: any, digits: any): any { return parseFloat((neg ? neg : "") + digits.join("")); }; const peg$c395 = "'"; const peg$c396 = peg$literalExpectation("'", false); const peg$c397 = /^[^'\\\n]/; const peg$c398 = peg$classExpectation(["'", "\\", "\n"], true, false); const peg$c399 = function(char: any): any { return char; }; const peg$c400 = "\""; const peg$c401 = peg$literalExpectation("\"", false); const peg$c402 = /^[^"\\\n]/; const peg$c403 = peg$classExpectation(["\"", "\\", "\n"], true, false); const peg$c404 = function(chars: any): any { return chars.join(""); }; const peg$c405 = "true"; const peg$c406 = peg$literalExpectation("true", false); const peg$c407 = function(): any {return true;}; const peg$c408 = "false"; const peg$c409 = peg$literalExpectation("false", false); const peg$c410 = function(): any {return false;}; const peg$c411 = "\\\""; const peg$c412 = peg$literalExpectation("\\\"", false); const peg$c413 = "\\'"; const peg$c414 = peg$literalExpectation("\\'", false); const peg$c415 = "\\?"; const peg$c416 = peg$literalExpectation("\\?", false); const peg$c417 = "\\\\"; const peg$c418 = peg$literalExpectation("\\\\", false); const peg$c419 = "\\a"; const peg$c420 = peg$literalExpectation("\\a", false); const peg$c421 = "\\b"; const peg$c422 = peg$literalExpectation("\\b", false); const peg$c423 = "\\f"; const peg$c424 = peg$literalExpectation("\\f", false); const peg$c425 = "\\n"; const peg$c426 = peg$literalExpectation("\\n", false); const peg$c427 = "\\r"; const peg$c428 = peg$literalExpectation("\\r", false); const peg$c429 = "\\t"; const peg$c430 = peg$literalExpectation("\\t", false); const peg$c431 = "\\v"; const peg$c432 = peg$literalExpectation("\\v", false); const peg$c433 = "\\0"; const peg$c434 = peg$literalExpectation("\\0", false); const peg$c435 = /^[0-8]/; const peg$c436 = peg$classExpectation([["0", "8"]], false, false); const peg$c437 = peg$otherExpectation("identifier"); const peg$c438 = function(first: any, rest: any): any {return track({construct_type: "unqualified_identifier", identifier: first + rest.join("")}, location(), text());}; const peg$c439 = /^[a-zA-Z0-9_]/; const peg$c440 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"], "_"], false, false); const peg$c441 = /^[a-zA-Z_]/; const peg$c442 = peg$classExpectation([["a", "z"], ["A", "Z"], "_"], false, false); const peg$c443 = function(id: any, t: any): any { return {identifier: id.identifier + "<" + t.identifier + ">"}; }; const peg$c444 = "@"; const peg$c445 = peg$literalExpectation("@", false); const peg$c446 = /^[a-zA-Z_0-9~]/; const peg$c447 = peg$classExpectation([["a", "z"], ["A", "Z"], "_", ["0", "9"], "~"], false, false); const peg$c448 = function(id: any): any { return track({construct_type: "opaque_expression", id: id.join("")}, location(), text()); }; const peg$c449 = peg$otherExpectation("optional whitespace"); const peg$c450 = /^[ \t\n\r]/; const peg$c451 = peg$classExpectation([" ", "\t", "\n", "\r"], false, false); const peg$c452 = peg$otherExpectation("whitespace"); const peg$c453 = function(id: any): any {return isUserTypeName(id.identifier);}; const peg$c454 = function(head: any): any { classNameStack.push(head.name.identifier); getUserTypeNames()[head.name.identifier]=true; return true; }; const peg$c455 = function(head: any, mems: any): any { classNameStack.pop(); return track({construct_type: "class_definition", head: head, memberSpecs: mems}, location(), text()); }; const peg$c456 = function(head: any): any { classNameStack.pop(); return false; }; const peg$c457 = function(key: any, name: any, b: any): any {return b;}; const peg$c458 = function(key: any, name: any, bases: any): any { return track({construct_type: "class_head", classKey:key, name:name, bases:bases ?? []}, location(), text()); }; const peg$c459 = "class"; const peg$c460 = peg$literalExpectation("class", false); const peg$c461 = "struct"; const peg$c462 = peg$literalExpectation("struct", false); const peg$c463 = "union"; const peg$c464 = peg$literalExpectation("union", false); const peg$c465 = function(access: any, m: any): any {return m}; const peg$c466 = function(access: any, members: any): any { return track({construct_type: "member_specification", members: members, access: access}, location(), text()); }; const peg$c467 = function(m: any): any {return m}; const peg$c468 = function(members: any): any { return track({construct_type: "member_specification", members: members}, location(), text()); }; const peg$c469 = "private"; const peg$c470 = peg$literalExpectation("private", false); const peg$c471 = "protected"; const peg$c472 = peg$literalExpectation("protected", false); const peg$c473 = "public"; const peg$c474 = peg$literalExpectation("public", false); const peg$c475 = function(specs: any, declarators: any): any { return track({construct_type: "simple_member_declaration", specs:specs, declarators:declarators}, location(), text()); }; const peg$c476 = function(declarators: any): any { return track({construct_type: "simple_member_declaration", specs:emptyDeclSpecs, declarators:declarators}, location(), text()); }; const peg$c477 = function(f: any): any { return f; }; const peg$c478 = "0"; const peg$c479 = peg$literalExpectation("0", false); const peg$c480 = function(d: any): any {d.pureVirtual = true; return d;}; const peg$c481 = function(d: any): any {d.library_unsupported = true; return d;}; const peg$c482 = function(d: any, i: any): any {d.initializer = i; return d;}; const peg$c483 = function(d: any, v: any): any {return v;}; const peg$c484 = function(d: any, v: any, i: any): any { d[v] = true; d.initializer = i; return d; }; const peg$c485 = function(d: any, v: any): any {d[v] = true; return d;}; const peg$c486 = "override"; const peg$c487 = peg$literalExpectation("override", false); const peg$c488 = function(b: any): any {return b}; const peg$c489 = function(first: any, b: any): any {return b;}; const peg$c490 = function(a: any): any {return a;}; const peg$c491 = function(a: any, c: any): any { return track({construct_type: "base_specifier", name: c, virtual: true, access: a}, location(), text());}; const peg$c492 = function(a: any, c: any): any { return track({construct_type: "base_specifier", name: c, access: a}, location(), text());}; const peg$c493 = function(c: any): any { return track({construct_type: "base_specifier", name: c}, location(), text());}; const peg$c494 = function(n: any, c: any): any { n.push(c); return {construct_type: "qualified_identifier", components: n};}; const peg$c495 = "@anything@"; const peg$c496 = peg$literalExpectation("@anything@", false); const peg$c497 = function(): any { return track({construct_type: "anything_construct"}, location(), text()); }; let peg$currPos = 0; let peg$savedPos = 0; const peg$posDetailsCache = [{ line: 1, column: 1 }]; let peg$maxFailPos = 0; let peg$maxFailExpected: Expectation[] = []; let peg$silentFails = 0; let peg$result; if (options.startRule !== undefined) { 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(): string { return input.substring(peg$savedPos, peg$currPos); } function location(): IFileRange { return peg$computeLocation(peg$savedPos, peg$currPos); } function expected(description: string, location1?: IFileRange) { location1 = location1 !== undefined ? location1 : peg$computeLocation(peg$savedPos, peg$currPos); throw peg$buildStructuredError( [peg$otherExpectation(description)], input.substring(peg$savedPos, peg$currPos), location1 ); } function error(message: string, location1?: IFileRange) { location1 = location1 !== undefined ? location1 : peg$computeLocation(peg$savedPos, peg$currPos); throw peg$buildSimpleError(message, location1); } function peg$literalExpectation(text1: string, ignoreCase: boolean): ILiteralExpectation { return { type: "literal", text: text1, ignoreCase: ignoreCase }; } function peg$classExpectation(parts: IClassParts, inverted: boolean, ignoreCase: boolean): IClassExpectation { return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase }; } function peg$anyExpectation(): IAnyExpectation { return { type: "any" }; } function peg$endExpectation(): IEndExpectation { return { type: "end" }; } function peg$otherExpectation(description: string): IOtherExpectation { return { type: "other", description: description }; } function peg$computePosDetails(pos: number) { let details = peg$posDetailsCache[pos]; let 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: number, endPos: number): IFileRange { const startPosDetails = peg$computePosDetails(startPos); const 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(expected1: Expectation) { if (peg$currPos < peg$maxFailPos) { return; } if (peg$currPos > peg$maxFailPos) { peg$maxFailPos = peg$currPos; peg$maxFailExpected = []; } peg$maxFailExpected.push(expected1); } function peg$buildSimpleError(message: string, location1: IFileRange) { return new SyntaxError(message, [], "", location1); } function peg$buildStructuredError(expected1: Expectation[], found: string | null, location1: IFileRange) { return new SyntaxError( SyntaxError.buildMessage(expected1, found), expected1, found, location1 ); } function peg$parsestart(): any { let s0, s1, s2, s3, s4, s5; s0 = peg$currPos; s1 = peg$parsews(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$parsedecl_or_comment(); if (s4 !== peg$FAILED) { s5 = peg$parsews(); if (s5 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c0(s4); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$parsedecl_or_comment(); if (s4 !== peg$FAILED) { s5 = peg$parsews(); if (s5 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c0(s4); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c1(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsedecl_or_comment(): any { let s0, s1; s0 = peg$currPos; s1 = peg$parsecomment(); if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c2(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$parsedeclaration(); } return s0; } function peg$parsecomment(): any { let s0, s1, s2, s3, s4, s5; s0 = peg$currPos; if (input.substr(peg$currPos, 13) === peg$c3) { s1 = peg$c3; peg$currPos += 13; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c4); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; s3 = peg$parseclass_head_name(); if (s3 !== peg$FAILED) { peg$savedPos = s2; s3 = peg$c5(s3); } s2 = s3; if (s2 !== peg$FAILED) { s3 = []; if (peg$c6.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c7); } } while (s4 !== peg$FAILED) { s3.push(s4); if (peg$c6.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c7); } } } if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 10) { s4 = peg$c8; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c9); } } if (s4 !== peg$FAILED) { s1 = [s1, s2, s3, 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; if (input.substr(peg$currPos, 2) === peg$c10) { s1 = peg$c10; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c11); } } if (s1 !== peg$FAILED) { s2 = []; if (peg$c6.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c7); } } while (s3 !== peg$FAILED) { s2.push(s3); if (peg$c6.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c7); } } } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 10) { s3 = peg$c8; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c9); } } if (s3 !== peg$FAILED) { s1 = [s1, s2, s3]; s0 = s1; } 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, 2) === peg$c12) { s1 = peg$c12; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c13); } } if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$currPos; peg$silentFails++; if (input.substr(peg$currPos, 2) === peg$c14) { s5 = peg$c14; peg$currPos += 2; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c15); } } peg$silentFails--; if (s5 === peg$FAILED) { s4 = undefined; } else { peg$currPos = s4; s4 = peg$FAILED; } if (s4 !== peg$FAILED) { if (input.length > peg$currPos) { s5 = input.charAt(peg$currPos); peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c16); } } if (s5 !== peg$FAILED) { s4 = [s4, s5]; s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$currPos; peg$silentFails++; if (input.substr(peg$currPos, 2) === peg$c14) { s5 = peg$c14; peg$currPos += 2; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c15); } } peg$silentFails--; if (s5 === peg$FAILED) { s4 = undefined; } else { peg$currPos = s4; s4 = peg$FAILED; } if (s4 !== peg$FAILED) { if (input.length > peg$currPos) { s5 = input.charAt(peg$currPos); peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c16); } } if (s5 !== peg$FAILED) { s4 = [s4, s5]; s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } if (s2 !== peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c14) { s3 = peg$c14; peg$currPos += 2; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c15); } } if (s3 !== peg$FAILED) { s1 = [s1, s2, s3]; s0 = s1; } 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$parsestatement(): any { let s0; s0 = peg$parselabeled_statement(); if (s0 === peg$FAILED) { s0 = peg$parseblock(); if (s0 === peg$FAILED) { s0 = peg$parseselection_statement(); if (s0 === peg$FAILED) { s0 = peg$parseiteration_statement(); if (s0 === peg$FAILED) { s0 = peg$parsejump_statement(); if (s0 === peg$FAILED) { s0 = peg$parsedeclaration_statement(); if (s0 === peg$FAILED) { s0 = peg$parseexpression_statement(); if (s0 === peg$FAILED) { s0 = peg$parsenull_statement(); if (s0 === peg$FAILED) { s0 = peg$parseanything(); } } } } } } } } return s0; } function peg$parselabeled_statement(): any { let s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parseidentifier(); if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 58) { s3 = peg$c17; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c18); } } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parsestatement(); 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; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 4) === peg$c20) { s1 = peg$c20; peg$currPos += 4; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c21); } } if (s1 !== peg$FAILED) { s2 = peg$parseWS(); if (s2 !== peg$FAILED) { s3 = peg$parseexp_const(); if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 58) { s5 = peg$c17; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c18); } } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parsestatement(); if (s7 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c22(s3, s7); 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; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 7) === peg$c23) { s1 = peg$c23; peg$currPos += 7; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c24); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 58) { s3 = peg$c17; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c18); } } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parsestatement(); if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c25(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$parseexpression_statement(): any { let s0, s1, s2, s3; s0 = peg$currPos; s1 = peg$parseexpression(); if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 59) { s3 = peg$c26; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c27); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c28(s1); s0 = s1; } 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$parsenull_statement(): any { let s0, s1, s2; s0 = peg$currPos; s1 = peg$parsews(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 59) { s2 = peg$c26; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c27); } } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c29(); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseblock(): any { let s0, s1, s2, s3, s4, s5, s6; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 123) { s1 = peg$c30; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c31); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = []; s4 = peg$currPos; s5 = peg$parsestatement(); if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { peg$savedPos = s4; s5 = peg$c32(s5); s4 = s5; } else { peg$currPos = s4; s4 = peg$FAILED; } } else { peg$currPos = s4; s4 = peg$FAILED; } while (s4 !== peg$FAILED) { s3.push(s4); s4 = peg$currPos; s5 = peg$parsestatement(); if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { peg$savedPos = s4; s5 = peg$c32(s5); s4 = s5; } else { peg$currPos = s4; s4 = peg$FAILED; } } else { peg$currPos = s4; s4 = peg$FAILED; } } if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s4 = peg$c33; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c34); } } if (s4 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c35(s3); 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; } return s0; } function peg$parseselection_statement(): any { let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13; s0 = peg$currPos; if (input.substr(peg$currPos, 2) === peg$c36) { s1 = peg$c36; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c37); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 40) { s3 = peg$c38; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c39); } } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parseexpression(); if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { s7 = peg$c40; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c41); } } if (s7 !== peg$FAILED) { s8 = peg$parsews(); if (s8 !== peg$FAILED) { s9 = peg$parsestatement(); if (s9 !== peg$FAILED) { s10 = peg$parsews(); if (s10 !== peg$FAILED) { if (input.substr(peg$currPos, 4) === peg$c42) { s11 = peg$c42; peg$currPos += 4; } else { s11 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c43); } } if (s11 !== peg$FAILED) { s12 = peg$parsews(); if (s12 !== peg$FAILED) { s13 = peg$parsestatement(); if (s13 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c44(s5, s9, s13); 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, 2) === peg$c36) { s1 = peg$c36; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c37); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 40) { s3 = peg$c38; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c39); } } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parseexpression(); if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { s7 = peg$c40; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c41); } } if (s7 !== peg$FAILED) { s8 = peg$parsews(); if (s8 !== peg$FAILED) { s9 = peg$parsestatement(); if (s9 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c45(s5, 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; } } return s0; } function peg$parseiteration_statement(): any { let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15; s0 = peg$currPos; if (input.substr(peg$currPos, 5) === peg$c46) { s1 = peg$c46; peg$currPos += 5; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c47); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 40) { s3 = peg$c38; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c39); } } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parseexpression(); if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { s7 = peg$c40; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c41); } } if (s7 !== peg$FAILED) { s8 = peg$parsews(); if (s8 !== peg$FAILED) { s9 = peg$parsestatement(); if (s9 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c48(s5, 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; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 2) === peg$c49) { s1 = peg$c49; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c50); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; peg$silentFails++; s3 = peg$parseidentifierChar(); peg$silentFails--; if (s3 === peg$FAILED) { s2 = undefined; } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 !== peg$FAILED) { s3 = peg$parsews(); if (s3 !== peg$FAILED) { s4 = peg$parsestatement(); if (s4 !== peg$FAILED) { s5 = peg$parsews(); if (s5 !== peg$FAILED) { if (input.substr(peg$currPos, 5) === peg$c46) { s6 = peg$c46; peg$currPos += 5; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c47); } } if (s6 !== peg$FAILED) { s7 = peg$parsews(); if (s7 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 40) { s8 = peg$c38; peg$currPos++; } else { s8 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c39); } } if (s8 !== peg$FAILED) { s9 = peg$parsews(); if (s9 !== peg$FAILED) { s10 = peg$parseexpression(); if (s10 !== peg$FAILED) { s11 = peg$parsews(); if (s11 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { s12 = peg$c40; peg$currPos++; } else { s12 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c41); } } if (s12 !== peg$FAILED) { s13 = peg$parsews(); if (s13 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 59) { s14 = peg$c26; peg$currPos++; } else { s14 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c27); } } if (s14 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c51(s4, s10); 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; } } else { peg$currPos = s0; s0 = peg$FAILED; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 3) === peg$c52) { s1 = peg$c52; peg$currPos += 3; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c53); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 40) { s3 = peg$c38; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c39); } } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parsefor_init_statement(); if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexpression(); if (s7 !== peg$FAILED) { s8 = peg$parsews(); if (s8 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 59) { s9 = peg$c26; peg$currPos++; } else { s9 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c27); } } if (s9 !== peg$FAILED) { s10 = peg$parsews(); if (s10 !== peg$FAILED) { s11 = peg$parseexpression(); if (s11 === peg$FAILED) { s11 = null; } if (s11 !== peg$FAILED) { s12 = peg$parsews(); if (s12 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { s13 = peg$c40; peg$currPos++; } else { s13 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c41); } } if (s13 !== peg$FAILED) { s14 = peg$parsews(); if (s14 !== peg$FAILED) { s15 = peg$parsestatement(); if (s15 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c54(s5, s7, s11, s15); 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; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } } return s0; } function peg$parsefor_init_statement(): any { let s0; s0 = peg$parseexpression_statement(); if (s0 === peg$FAILED) { s0 = peg$parsenull_statement(); if (s0 === peg$FAILED) { s0 = peg$parsedeclaration_statement(); } } return s0; } function peg$parsejump_statement(): any { let s0, s1, s2, s3, s4, s5, s6; s0 = peg$currPos; if (input.substr(peg$currPos, 5) === peg$c55) { s1 = peg$c55; peg$currPos += 5; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c56); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; peg$silentFails++; s3 = peg$parseidentifierChar(); peg$silentFails--; if (s3 === peg$FAILED) { s2 = undefined; } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 !== peg$FAILED) { s3 = peg$parsews(); if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 59) { s4 = peg$c26; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c27); } } if (s4 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c57(); 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; if (input.substr(peg$currPos, 8) === peg$c58) { s1 = peg$c58; peg$currPos += 8; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c59); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; peg$silentFails++; s3 = peg$parseidentifierChar(); peg$silentFails--; if (s3 === peg$FAILED) { s2 = undefined; } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 !== peg$FAILED) { s3 = peg$parsews(); if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 59) { s4 = peg$c26; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c27); } } if (s4 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c60(); 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; if (input.substr(peg$currPos, 6) === peg$c61) { s1 = peg$c61; peg$currPos += 6; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c62); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; peg$silentFails++; s3 = peg$parseidentifierChar(); peg$silentFails--; if (s3 === peg$FAILED) { s2 = undefined; } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 !== peg$FAILED) { s3 = peg$parsews(); if (s3 !== peg$FAILED) { s4 = peg$parseexpression(); if (s4 === peg$FAILED) { s4 = null; } if (s4 !== peg$FAILED) { s5 = peg$parsews(); if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 59) { s6 = peg$c26; peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c27); } } if (s6 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c63(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; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } } return s0; } function peg$parsedeclaration_statement(): any { let s0, s1; s0 = peg$currPos; s1 = peg$parsedeclaration(); if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c64(s1); } s0 = s1; return s0; } function peg$parsedeclaration(): any { let s0; s0 = peg$parsesimple_declaration(); if (s0 === peg$FAILED) { s0 = peg$parseclass_definition(); if (s0 === peg$FAILED) { s0 = peg$parsefunction_definition(); } } return s0; } function peg$parsesimple_declaration(): any { let s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parsedecl_specifiers(); if (s1 !== peg$FAILED) { peg$savedPos = peg$currPos; s2 = peg$c65(s1); if (s2) { s2 = peg$FAILED; } else { s2 = undefined; } if (s2 !== peg$FAILED) { s3 = peg$currPos; peg$silentFails++; s4 = peg$parseid_expression(); peg$silentFails--; if (s4 === peg$FAILED) { s3 = undefined; } else { peg$currPos = s3; s3 = peg$FAILED; } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parsedeclarator_list(); if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 59) { s7 = peg$c26; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c27); } } if (s7 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c66(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; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsedeclarator_list(): any { let s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parsedeclarator_init(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s5 = peg$c67; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c68); } } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parsedeclarator_init(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c69(s1, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s5 = peg$c67; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c68); } } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parsedeclarator_init(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c69(s1, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c70(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseclass_definition(): any { let s0, s1, s2, s3; s0 = peg$currPos; s1 = peg$parseclass_specifier(); if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 59) { s3 = peg$c26; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c27); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c71(s1); s0 = s1; } 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$parsefunction_definition(): any { let s0, s1, s2, s3, s4, s5, s6, s7, s8; s0 = peg$currPos; s1 = peg$parsedecl_specifiers_prohibit_class_name(); if (s1 !== peg$FAILED) { s2 = peg$currPos; peg$silentFails++; s3 = peg$parseid_expression(); peg$silentFails--; if (s3 === peg$FAILED) { s2 = undefined; } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 !== peg$FAILED) { s3 = peg$parsews(); if (s3 !== peg$FAILED) { s4 = peg$parsedeclarator(); if (s4 !== peg$FAILED) { s5 = peg$parsews(); if (s5 !== peg$FAILED) { s6 = peg$parsector_initializer(); if (s6 === peg$FAILED) { s6 = null; } if (s6 !== peg$FAILED) { s7 = peg$parsews(); if (s7 !== peg$FAILED) { s8 = peg$parseblock(); if (s8 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c72(s1, s4, s6, s8); 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; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parsews(); if (s1 !== peg$FAILED) { s2 = peg$parsedeclarator(); if (s2 !== peg$FAILED) { s3 = peg$parsews(); if (s3 !== peg$FAILED) { s4 = peg$parsector_initializer(); if (s4 === peg$FAILED) { s4 = null; } if (s4 !== peg$FAILED) { s5 = peg$parsews(); if (s5 !== peg$FAILED) { s6 = peg$parseblock(); if (s6 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c73(s2, s4, s6); 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; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parsedecl_specifiers(); if (s1 !== peg$FAILED) { s2 = peg$currPos; peg$silentFails++; s3 = peg$parseid_expression(); peg$silentFails--; if (s3 === peg$FAILED) { s2 = undefined; } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 !== peg$FAILED) { s3 = peg$parsews(); if (s3 !== peg$FAILED) { s4 = peg$parsedeclarator(); if (s4 !== peg$FAILED) { s5 = peg$parsews(); if (s5 !== peg$FAILED) { s6 = peg$parsector_initializer(); if (s6 === peg$FAILED) { s6 = null; } if (s6 !== peg$FAILED) { s7 = peg$parsews(); if (s7 !== peg$FAILED) { s8 = peg$parseblock(); if (s8 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c72(s1, s4, s6, s8); 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; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parsedecl_specifiers(); if (s1 !== peg$FAILED) { s2 = peg$currPos; peg$silentFails++; s3 = peg$parseid_expression(); peg$silentFails--; if (s3 === peg$FAILED) { s2 = undefined; } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 !== peg$FAILED) { s3 = peg$parsews(); if (s3 !== peg$FAILED) { s4 = peg$parsemember_declarator(); if (s4 !== peg$FAILED) { s5 = peg$parsews(); if (s5 !== peg$FAILED) { s6 = peg$parsector_initializer(); if (s6 === peg$FAILED) { s6 = null; } if (s6 !== peg$FAILED) { s7 = peg$parsews(); if (s7 !== peg$FAILED) { s8 = peg$parseblock(); if (s8 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c72(s1, s4, s6, s8); 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; } } } } return s0; } function peg$parsector_initializer(): any { let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 58) { s1 = peg$c17; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c18); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parsemem_initializer(); if (s3 !== peg$FAILED) { s4 = []; s5 = peg$currPos; s6 = peg$parsews(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s7 = peg$c67; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c68); } } if (s7 !== peg$FAILED) { s8 = peg$parsews(); if (s8 !== peg$FAILED) { s9 = peg$parsemem_initializer(); if (s9 !== peg$FAILED) { peg$savedPos = s5; s6 = peg$c74(s3, s9); s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } while (s5 !== peg$FAILED) { s4.push(s5); s5 = peg$currPos; s6 = peg$parsews(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s7 = peg$c67; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c68); } } if (s7 !== peg$FAILED) { s8 = peg$parsews(); if (s8 !== peg$FAILED) { s9 = peg$parsemem_initializer(); if (s9 !== peg$FAILED) { peg$savedPos = s5; s6 = peg$c74(s3, s9); s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } if (s4 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c75(s3, 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; } return s0; } function peg$parsemem_initializer(): any { let s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parseidentifier(); if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 40) { s3 = peg$c38; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c39); } } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parseexp_list(); if (s5 === peg$FAILED) { s5 = null; } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { s7 = peg$c40; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c41); } } if (s7 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c76(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; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsedecl_specifiers(): any { let s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parse_decl_specifiers_non_type(); if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parsedecl_specifier(); if (s3 === peg$FAILED) { s3 = null; } if (s3 !== peg$FAILED) { s4 = []; s5 = peg$currPos; s6 = peg$parseWS(); if (s6 !== peg$FAILED) { s7 = peg$parsedecl_specifier_non_user_type_name(); if (s7 !== peg$FAILED) { peg$savedPos = s5; s6 = peg$c77(s1, s3, s7); s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } while (s5 !== peg$FAILED) { s4.push(s5); s5 = peg$currPos; s6 = peg$parseWS(); if (s6 !== peg$FAILED) { s7 = peg$parsedecl_specifier_non_user_type_name(); if (s7 !== peg$FAILED) { peg$savedPos = s5; s6 = peg$c77(s1, s3, s7); s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } if (s4 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c78(s1, s3, 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; } return s0; } function peg$parse_decl_specifiers_non_type(): any { let s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parsedecl_specifier_non_type(); if (s1 === peg$FAILED) { s1 = null; } if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$parseWS(); if (s4 !== peg$FAILED) { s5 = peg$parsedecl_specifier_non_type(); if (s5 !== peg$FAILED) { s6 = peg$currPos; peg$silentFails++; s7 = peg$parseid_expression(); peg$silentFails--; if (s7 === peg$FAILED) { s6 = undefined; } else { peg$currPos = s6; s6 = peg$FAILED; } if (s6 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c79(s1, s5); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$parseWS(); if (s4 !== peg$FAILED) { s5 = peg$parsedecl_specifier_non_type(); if (s5 !== peg$FAILED) { s6 = peg$currPos; peg$silentFails++; s7 = peg$parseid_expression(); peg$silentFails--; if (s7 === peg$FAILED) { s6 = undefined; } else { peg$currPos = s6; s6 = peg$FAILED; } if (s6 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c79(s1, s5); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c80(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parse_decl_specifiers_non_user_type_name(): any { let s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parsedecl_specifier_non_user_type_name(); if (s1 === peg$FAILED) { s1 = null; } if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$parseWS(); if (s4 !== peg$FAILED) { s5 = peg$parsedecl_specifier_non_user_type_name(); if (s5 !== peg$FAILED) { s6 = peg$currPos; peg$silentFails++; s7 = peg$parseid_expression(); peg$silentFails--; if (s7 === peg$FAILED) { s6 = undefined; } else { peg$currPos = s6; s6 = peg$FAILED; } if (s6 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c79(s1, s5); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$parseWS(); if (s4 !== peg$FAILED) { s5 = peg$parsedecl_specifier_non_user_type_name(); if (s5 !== peg$FAILED) { s6 = peg$currPos; peg$silentFails++; s7 = peg$parseid_expression(); peg$silentFails--; if (s7 === peg$FAILED) { s6 = undefined; } else { peg$currPos = s6; s6 = peg$FAILED; } if (s6 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c79(s1, s5); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c80(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsedecl_specifier(): any { let s0, s1; s0 = peg$currPos; s1 = peg$parsetype_specifier(); if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c81(s1); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parsestorage_class_specifier(); if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c82(s1); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$parsefunction_specifier(); if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 7) === peg$c83) { s0 = peg$c83; peg$currPos += 7; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c84); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 6) === peg$c85) { s0 = peg$c85; peg$currPos += 6; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c86); } } } } } } return s0; } function peg$parsedecl_specifier_non_type(): any { let s0, s1; s0 = peg$currPos; if (input.substr(peg$currPos, 5) === peg$c87) { s1 = peg$c87; peg$currPos += 5; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c88); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c89(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 8) === peg$c90) { s1 = peg$c90; peg$currPos += 8; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c91); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c92(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parsestorage_class_specifier(); if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c82(s1); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$parsefunction_specifier(); if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 7) === peg$c83) { s0 = peg$c83; peg$currPos += 7; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c84); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 6) === peg$c85) { s0 = peg$c85; peg$currPos += 6; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c86); } } } } } } } return s0; } function peg$parsedecl_specifier_non_user_type_name(): any { let s0, s1; s0 = peg$currPos; s1 = peg$parsesimple_type_name_non_user(); if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c81(s1); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parseelaborated_type_specifier(); if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c81(s1); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 5) === peg$c87) { s1 = peg$c87; peg$currPos += 5; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c88); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c89(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 8) === peg$c90) { s1 = peg$c90; peg$currPos += 8; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c91); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c92(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$parseclass_specifier(); if (s0 === peg$FAILED) { s0 = peg$parseenum_specifier(); if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parsestorage_class_specifier(); if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c82(s1); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$parsefunction_specifier(); if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 7) === peg$c83) { s0 = peg$c83; peg$currPos += 7; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c84); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 6) === peg$c85) { s0 = peg$c85; peg$currPos += 6; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c86); } } } } } } } } } } } return s0; } function peg$parsedecl_specifiers_prohibit_class_name(): any { let s0, s1, s2; s0 = peg$currPos; peg$savedPos = peg$currPos; s1 = peg$c93(); if (s1) { s1 = undefined; } else { s1 = peg$FAILED; } if (s1 !== peg$FAILED) { s2 = peg$parsedecl_specifiers(); if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c94(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } if (s0 === peg$FAILED) { s0 = peg$currPos; peg$savedPos = peg$currPos; s1 = peg$c95(); if (s1) { s1 = undefined; } else { s1 = peg$FAILED; } if (s1 !== peg$FAILED) { if (input.substr(peg$currPos, 39) === peg$c96) { s2 = peg$c96; peg$currPos += 39; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c97); } } if (s2 !== peg$FAILED) { s1 = [s1, s2]; s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } return s0; } function peg$parsetype_specifiers(): any { let s0, s1, s2, s3, s4, s5; s0 = peg$currPos; s1 = peg$parsetype_specifier(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$parseWS(); if (s4 !== peg$FAILED) { s5 = peg$parsetype_specifier(); if (s5 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c98(s1, s5); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$parseWS(); if (s4 !== peg$FAILED) { s5 = peg$parsetype_specifier(); if (s5 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c98(s1, s5); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c99(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsetype_specifier(): any { let s0; s0 = peg$parsetrailing_type_specifier(); if (s0 === peg$FAILED) { s0 = peg$parseclass_specifier(); if (s0 === peg$FAILED) { s0 = peg$parseenum_specifier(); } } return s0; } function peg$parsetrailing_type_specifier(): any { let s0, s1, s2; s0 = peg$currPos; s1 = peg$parsesimple_type_name(); if (s1 !== peg$FAILED) { peg$savedPos = peg$currPos; s2 = peg$c100(s1); if (s2) { s2 = peg$FAILED; } else { s2 = undefined; } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c101(s1); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } if (s0 === peg$FAILED) { s0 = peg$parseelaborated_type_specifier(); if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 5) === peg$c87) { s0 = peg$c87; peg$currPos += 5; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c88); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 8) === peg$c90) { s0 = peg$c90; peg$currPos += 8; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c91); } } } } } return s0; } function peg$parseelaborated_type_specifier(): any { let s0, s1, s2, s3; s0 = peg$currPos; s1 = peg$parseclass_key(); if (s1 !== peg$FAILED) { s2 = peg$parseWS(); if (s2 !== peg$FAILED) { s3 = peg$parseclass_name(); if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c102(s3); s0 = s1; } 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$parsestorage_class_specifier(): any { let s0; if (input.substr(peg$currPos, 8) === peg$c103) { s0 = peg$c103; peg$currPos += 8; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c104); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 6) === peg$c105) { s0 = peg$c105; peg$currPos += 6; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c106); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 12) === peg$c107) { s0 = peg$c107; peg$currPos += 12; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c108); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 6) === peg$c109) { s0 = peg$c109; peg$currPos += 6; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c110); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 7) === peg$c111) { s0 = peg$c111; peg$currPos += 7; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c112); } } } } } } return s0; } function peg$parsefunction_specifier(): any { let s0; if (input.substr(peg$currPos, 6) === peg$c113) { s0 = peg$c113; peg$currPos += 6; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c114); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 8) === peg$c115) { s0 = peg$c115; peg$currPos += 8; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c116); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 7) === peg$c117) { s0 = peg$c117; peg$currPos += 7; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c118); } } } } return s0; } function peg$parsesimple_type_name(): any { let s0, s1, s2, s3; peg$silentFails++; s0 = peg$currPos; s1 = peg$parse_simple_type_name(); if (s1 !== peg$FAILED) { s2 = peg$currPos; peg$silentFails++; s3 = peg$parseidentifierChar(); peg$silentFails--; if (s3 === peg$FAILED) { s2 = undefined; } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c120(s1); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c119); } } return s0; } function peg$parse_simple_type_name(): any { let s0, s1; if (input.substr(peg$currPos, 4) === peg$c121) { s0 = peg$c121; peg$currPos += 4; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c122); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 5) === peg$c123) { s0 = peg$c123; peg$currPos += 5; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c124); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c125) { s0 = peg$c125; peg$currPos += 3; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c126); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 6) === peg$c127) { s0 = peg$c127; peg$currPos += 6; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c128); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 4) === peg$c129) { s0 = peg$c129; peg$currPos += 4; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c130); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 4) === peg$c131) { s0 = peg$c131; peg$currPos += 4; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c132); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 6) === peg$c133) { s0 = peg$c133; peg$currPos += 6; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c134); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 8) === peg$c135) { s0 = peg$c135; peg$currPos += 8; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c136); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 5) === peg$c137) { s0 = peg$c137; peg$currPos += 5; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c138); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 6) === peg$c139) { s0 = peg$c139; peg$currPos += 6; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c140); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 4) === peg$c141) { s0 = peg$c141; peg$currPos += 4; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c142); } } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parseclass_name(); if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c143(s1); } s0 = s1; } } } } } } } } } } } return s0; } function peg$parsesimple_type_name_non_user(): any { let s0, s1, s2, s3; peg$silentFails++; s0 = peg$currPos; s1 = peg$parse_simple_type_name_non_user(); if (s1 !== peg$FAILED) { s2 = peg$currPos; peg$silentFails++; s3 = peg$parseidentifierChar(); peg$silentFails--; if (s3 === peg$FAILED) { s2 = undefined; } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c120(s1); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c119); } } return s0; } function peg$parse_simple_type_name_non_user(): any { let s0; if (input.substr(peg$currPos, 4) === peg$c121) { s0 = peg$c121; peg$currPos += 4; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c122); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 5) === peg$c123) { s0 = peg$c123; peg$currPos += 5; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c124); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c125) { s0 = peg$c125; peg$currPos += 3; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c126); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 4) === peg$c129) { s0 = peg$c129; peg$currPos += 4; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c130); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 4) === peg$c131) { s0 = peg$c131; peg$currPos += 4; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c132); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 6) === peg$c133) { s0 = peg$c133; peg$currPos += 6; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c134); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 8) === peg$c135) { s0 = peg$c135; peg$currPos += 8; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c136); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 5) === peg$c137) { s0 = peg$c137; peg$currPos += 5; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c138); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 6) === peg$c139) { s0 = peg$c139; peg$currPos += 6; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c140); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 4) === peg$c141) { s0 = peg$c141; peg$currPos += 4; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c142); } } } } } } } } } } } return s0; } function peg$parseenum_specifier(): any { let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12; s0 = peg$currPos; if (input.substr(peg$currPos, 4) === peg$c144) { s1 = peg$c144; peg$currPos += 4; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c145); } } if (s1 !== peg$FAILED) { s2 = peg$parseWS(); if (s2 !== peg$FAILED) { s3 = peg$parseidentifier(); if (s3 === peg$FAILED) { s3 = null; } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 123) { s5 = peg$c30; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c31); } } if (s5 !== peg$FAILED) { s6 = peg$parseenumerator(); if (s6 !== peg$FAILED) { s7 = []; s8 = peg$currPos; s9 = peg$parsews(); if (s9 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s10 = peg$c67; peg$currPos++; } else { s10 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c68); } } if (s10 !== peg$FAILED) { s11 = peg$parsews(); if (s11 !== peg$FAILED) { s12 = peg$parseenumerator(); if (s12 !== peg$FAILED) { peg$savedPos = s8; s9 = peg$c146(s3, s6, s12); s8 = s9; } else { peg$currPos = s8; s8 = peg$FAILED; } } else { peg$currPos = s8; s8 = peg$FAILED; } } else { peg$currPos = s8; s8 = peg$FAILED; } } else { peg$currPos = s8; s8 = peg$FAILED; } while (s8 !== peg$FAILED) { s7.push(s8); s8 = peg$currPos; s9 = peg$parsews(); if (s9 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s10 = peg$c67; peg$currPos++; } else { s10 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c68); } } if (s10 !== peg$FAILED) { s11 = peg$parsews(); if (s11 !== peg$FAILED) { s12 = peg$parseenumerator(); if (s12 !== peg$FAILED) { peg$savedPos = s8; s9 = peg$c146(s3, s6, s12); s8 = s9; } else { peg$currPos = s8; s8 = peg$FAILED; } } else { peg$currPos = s8; s8 = peg$FAILED; } } else { peg$currPos = s8; s8 = peg$FAILED; } } else { peg$currPos = s8; s8 = peg$FAILED; } } if (s7 !== peg$FAILED) { s8 = peg$parsews(); if (s8 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s9 = peg$c33; peg$currPos++; } else { s9 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c34); } } if (s9 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c147(s3, s6, s7); 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; } return s0; } function peg$parseenumerator(): any { let s0, s1, s2, s3, s4, s5, s6; s0 = peg$currPos; s1 = peg$parseidentifier(); if (s1 !== peg$FAILED) { s2 = peg$currPos; s3 = peg$parsews(); if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 61) { s4 = peg$c148; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c149); } } if (s4 !== peg$FAILED) { s5 = peg$parsews(); if (s5 !== peg$FAILED) { s6 = peg$parseexp_const(); if (s6 !== peg$FAILED) { peg$savedPos = s2; s3 = peg$c150(s1, s6); s2 = s3; } else { peg$currPos = s2; s2 = peg$FAILED; } } else { peg$currPos = s2; s2 = peg$FAILED; } } else { peg$currPos = s2; s2 = peg$FAILED; } } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c151(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsedeclarator_init(): any { let s0, s1, s2, s3, s4, s5; s0 = peg$currPos; s1 = peg$parsedeclarator(); if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 61) { s3 = peg$c148; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c149); } } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.substr(peg$currPos, 21) === peg$c152) { s5 = peg$c152; peg$currPos += 21; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c153); } } if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c154(s1); 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; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parsedeclarator(); if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parseinitializer(); if (s3 === peg$FAILED) { s3 = null; } if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c155(s1, s3); s0 = s1; } 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$parseinitializer(): any { let s0, s1, s2, s3, s4, s5; s0 = peg$parsebrace_or_equal_initializer(); if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 40) { s1 = peg$c38; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c39); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parseexp_list(); if (s3 === peg$FAILED) { s3 = null; } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { s5 = peg$c40; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c41); } } if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c156(s3); 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$parsebrace_or_equal_initializer(): any { let s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 61) { s1 = peg$c148; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c149); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parseexp_assn(); if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c157(s3); s0 = s1; } 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.charCodeAt(peg$currPos) === 61) { s1 = peg$c148; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c149); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 123) { s3 = peg$c30; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c31); } } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parseinitializer_list(); if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s7 = peg$c33; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c34); } } if (s7 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c158(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; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } return s0; } function peg$parseinitializer_list(): any { let s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parseexp_assn(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s5 = peg$c67; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c68); } } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_assn(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c159(s1, s5, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s5 = peg$c67; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c68); } } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_assn(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c159(s1, s5, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c160(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsedeclarator(): any { let s0, s1; s0 = peg$currPos; s1 = peg$parse_declarator(); if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c161(s1); } s0 = s1; return s0; } function peg$parseabstract_declarator(): any { let s0, s1; s0 = peg$currPos; s1 = peg$parse_abs_declarator(); if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c162(s1); } s0 = s1; return s0; } function peg$parse_declarator(): any { let s0, s1, s2, s3, s4, s5; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 42) { s1 = peg$c163; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c164); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parsecv_qualifier(); if (s3 === peg$FAILED) { s3 = null; } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parse_declarator(); if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c165(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; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 38) { s1 = peg$c166; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c167); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parsecv_qualifier(); if (s3 === peg$FAILED) { s3 = null; } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parse_declarator(); if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c168(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; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parsedeclarator_simple(); if (s1 !== peg$FAILED) { s2 = peg$parsedeclarator_postfixes(); if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c169(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } if (s0 === peg$FAILED) { s0 = peg$parsedeclarator_simple(); } } } return s0; } function peg$parse_abs_declarator(): any { let s0, s1, s2, s3, s4, s5; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 42) { s1 = peg$c163; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c164); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parsecv_qualifier(); if (s3 === peg$FAILED) { s3 = null; } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parse_abs_declarator(); if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c165(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; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 38) { s1 = peg$c166; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c167); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parsecv_qualifier(); if (s3 === peg$FAILED) { s3 = null; } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parse_abs_declarator(); if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c168(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; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parseabs_declarator_simple(); if (s1 !== peg$FAILED) { s2 = peg$parsedeclarator_postfixes(); if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c169(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } if (s0 === peg$FAILED) { s0 = peg$parseabs_declarator_simple(); } } } return s0; } function peg$parsedeclarator_postfixes(): any { let s0, s1, s2, s3; s0 = []; s1 = peg$currPos; s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parsedeclarator_postfix(); if (s3 !== peg$FAILED) { peg$savedPos = s1; s2 = peg$c170(s3); s1 = s2; } else { peg$currPos = s1; s1 = peg$FAILED; } } else { peg$currPos = s1; s1 = peg$FAILED; } if (s1 !== peg$FAILED) { while (s1 !== peg$FAILED) { s0.push(s1); s1 = peg$currPos; s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parsedeclarator_postfix(); if (s3 !== peg$FAILED) { peg$savedPos = s1; s2 = peg$c170(s3); s1 = s2; } else { peg$currPos = s1; s1 = peg$FAILED; } } else { peg$currPos = s1; s1 = peg$FAILED; } } } else { s0 = peg$FAILED; } return s0; } function peg$parsedeclarator_postfix(): any { let s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 40) { s1 = peg$c38; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c39); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parseargument_declaration_list(); if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { s5 = peg$c40; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c41); } } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parsecv_qualifier(); if (s7 === peg$FAILED) { s7 = null; } if (s7 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c171(s3, s7); 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; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 91) { s1 = peg$c172; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c173); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parseexp_const(); if (s3 === peg$FAILED) { s3 = null; } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 93) { s5 = peg$c174; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c175); } } if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c176(s3); 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$parsedeclarator_simple(): any { let s0, s1, s2, s3, s4, s5; s0 = peg$currPos; s1 = peg$parseid_expression(); if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c177(s1); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 40) { s1 = peg$c38; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c39); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parse_declarator(); if (s3 === peg$FAILED) { s3 = null; } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { s5 = peg$c40; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c41); } } if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c178(s3); 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$parseabs_declarator_simple(): any { let s0, s1, s2, s3, s4, s5; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 40) { s1 = peg$c38; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c39); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parse_abs_declarator(); if (s3 === peg$FAILED) { s3 = null; } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { s5 = peg$c40; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c41); } } if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c178(s3); 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; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$c179; if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c180(); } s0 = s1; } return s0; } function peg$parsetype_id(): any { let s0, s1, s2, s3; s0 = peg$currPos; s1 = peg$parsetype_specifiers(); if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parseabstract_declarator(); if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c181(s1, s3); s0 = s1; } 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$parsecv_qualifier(): any { let s0, s1, s2, s3; s0 = peg$currPos; if (input.substr(peg$currPos, 5) === peg$c87) { s1 = peg$c87; peg$currPos += 5; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c88); } } if (s1 !== peg$FAILED) { s2 = peg$parseWS(); if (s2 !== peg$FAILED) { if (input.substr(peg$currPos, 8) === peg$c90) { s3 = peg$c90; peg$currPos += 8; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c91); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c182(); s0 = s1; } 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, 8) === peg$c90) { s1 = peg$c90; peg$currPos += 8; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c91); } } if (s1 !== peg$FAILED) { s2 = peg$parseWS(); if (s2 !== peg$FAILED) { if (input.substr(peg$currPos, 5) === peg$c87) { s3 = peg$c87; peg$currPos += 5; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c88); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c182(); s0 = s1; } 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, 5) === peg$c87) { s1 = peg$c87; peg$currPos += 5; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c88); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c183(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 8) === peg$c90) { s1 = peg$c90; peg$currPos += 8; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c91); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c184(); } s0 = s1; } } } return s0; } function peg$parseargument_declaration_list(): any { let s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parseargument_declaration(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s5 = peg$c67; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c68); } } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseargument_declaration(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c185(s1, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s5 = peg$c67; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c68); } } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseargument_declaration(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c185(s1, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c186(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$c179; if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c187(); } s0 = s1; } return s0; } function peg$parseargument_declaration(): any { let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; s0 = peg$currPos; s1 = peg$parsedecl_specifiers(); if (s1 !== peg$FAILED) { peg$savedPos = peg$currPos; s2 = peg$c65(s1); if (s2) { s2 = peg$FAILED; } else { s2 = undefined; } if (s2 !== peg$FAILED) { s3 = peg$currPos; peg$silentFails++; s4 = peg$parseid_expression(); peg$silentFails--; if (s4 === peg$FAILED) { s3 = undefined; } else { peg$currPos = s3; s3 = peg$FAILED; } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parsedeclarator(); if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 61) { s7 = peg$c148; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c149); } } if (s7 !== peg$FAILED) { s8 = peg$parsews(); if (s8 !== peg$FAILED) { s9 = peg$parseexp_assn(); if (s9 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c188(s1, s5, 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; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parsedecl_specifiers(); if (s1 !== peg$FAILED) { peg$savedPos = peg$currPos; s2 = peg$c65(s1); if (s2) { s2 = peg$FAILED; } else { s2 = undefined; } if (s2 !== peg$FAILED) { s3 = peg$currPos; peg$silentFails++; s4 = peg$parseid_expression(); peg$silentFails--; if (s4 === peg$FAILED) { s3 = undefined; } else { peg$currPos = s3; s3 = peg$FAILED; } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parsedeclarator(); if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c189(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; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parsedecl_specifiers(); if (s1 !== peg$FAILED) { peg$savedPos = peg$currPos; s2 = peg$c65(s1); if (s2) { s2 = peg$FAILED; } else { s2 = undefined; } if (s2 !== peg$FAILED) { s3 = peg$currPos; peg$silentFails++; s4 = peg$parseid_expression(); peg$silentFails--; if (s4 === peg$FAILED) { s3 = undefined; } else { peg$currPos = s3; s3 = peg$FAILED; } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parseabstract_declarator(); if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 61) { s7 = peg$c148; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c149); } } if (s7 !== peg$FAILED) { s8 = peg$parsews(); if (s8 !== peg$FAILED) { s9 = peg$parseexp_assn(); if (s9 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c188(s1, s5, 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; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parsedecl_specifiers(); if (s1 !== peg$FAILED) { peg$savedPos = peg$currPos; s2 = peg$c65(s1); if (s2) { s2 = peg$FAILED; } else { s2 = undefined; } if (s2 !== peg$FAILED) { s3 = peg$currPos; peg$silentFails++; s4 = peg$parseid_expression(); peg$silentFails--; if (s4 === peg$FAILED) { s3 = undefined; } else { peg$currPos = s3; s3 = peg$FAILED; } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parseabstract_declarator(); if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c189(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$parseexpression(): any { let s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parseexp_assn(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s5 = peg$c67; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c68); } } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_assn(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c190(s1, s5, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s5 = peg$c67; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c68); } } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_assn(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c190(s1, s5, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c191(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } if (s0 === peg$FAILED) { s0 = peg$parseexp_assn(); } return s0; } function peg$parseexp_assn(): any { let s0, s1, s2, s3, s4, s5; s0 = peg$currPos; s1 = peg$parseexp_unary(); if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 61) { s3 = peg$c148; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c149); } } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parseexp_assn(); if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c192(s1, 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; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parseexp_unary(); if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parseop_comp_assn(); if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parseexp_assn(); if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c193(s1, 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; } if (s0 === peg$FAILED) { s0 = peg$parseexp_cond(); } } return s0; } function peg$parseop_comp_assn(): any { let s0, s1, s2, s3; if (input.substr(peg$currPos, 2) === peg$c194) { s0 = peg$c194; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c195); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c196) { s0 = peg$c196; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c197); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c198) { s0 = peg$c198; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c199); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c200) { s0 = peg$c200; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c201); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c202) { s0 = peg$c202; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c203); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c204) { s0 = peg$c204; peg$currPos += 3; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c205); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c206) { s0 = peg$c206; peg$currPos += 3; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c207); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c208) { s0 = peg$c208; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c209); } } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 6) === peg$c210) { s1 = peg$c210; peg$currPos += 6; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c211); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; peg$silentFails++; s3 = peg$parseidentifierChar(); peg$silentFails--; if (s3 === peg$FAILED) { s2 = undefined; } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c212(); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c213) { s0 = peg$c213; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c214); } } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 6) === peg$c215) { s1 = peg$c215; peg$currPos += 6; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c216); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; peg$silentFails++; s3 = peg$parseidentifierChar(); peg$silentFails--; if (s3 === peg$FAILED) { s2 = undefined; } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c217(); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c218) { s0 = peg$c218; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c219); } } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 5) === peg$c220) { s1 = peg$c220; peg$currPos += 5; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c221); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; peg$silentFails++; s3 = peg$parseidentifierChar(); peg$silentFails--; if (s3 === peg$FAILED) { s2 = undefined; } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c222(); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } } } } } } } } } } } } return s0; } function peg$parseexp_const(): any { let s0, s1; s0 = peg$currPos; s1 = peg$parseexp_cond(); if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c223(s1); } s0 = s1; return s0; } function peg$parseexp_cond(): any { let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; s0 = peg$currPos; s1 = peg$parseexp_or(); if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 63) { s3 = peg$c224; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c225); } } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parseexpression(); if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 58) { s7 = peg$c17; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c18); } } if (s7 !== peg$FAILED) { s8 = peg$parsews(); if (s8 !== peg$FAILED) { s9 = peg$parseexp_assn(); if (s9 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c226(s1, s5, 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; } if (s0 === peg$FAILED) { s0 = peg$parseexp_or(); } return s0; } function peg$parseexp_or(): any { let s0, s1, s2, s3, s4, s5, s6, s7, s8; s0 = peg$currPos; s1 = peg$parseexp_and(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c227) { s5 = peg$c227; peg$currPos += 2; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c228); } } if (s5 === peg$FAILED) { s5 = peg$currPos; if (input.substr(peg$currPos, 2) === peg$c229) { s6 = peg$c229; peg$currPos += 2; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c230); } } if (s6 !== peg$FAILED) { s7 = peg$currPos; peg$silentFails++; s8 = peg$parseidentifierChar(); peg$silentFails--; if (s8 === peg$FAILED) { s7 = undefined; } else { peg$currPos = s7; s7 = peg$FAILED; } if (s7 !== peg$FAILED) { s6 = [s6, s7]; s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_and(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c231(s1, s5, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c227) { s5 = peg$c227; peg$currPos += 2; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c228); } } if (s5 === peg$FAILED) { s5 = peg$currPos; if (input.substr(peg$currPos, 2) === peg$c229) { s6 = peg$c229; peg$currPos += 2; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c230); } } if (s6 !== peg$FAILED) { s7 = peg$currPos; peg$silentFails++; s8 = peg$parseidentifierChar(); peg$silentFails--; if (s8 === peg$FAILED) { s7 = undefined; } else { peg$currPos = s7; s7 = peg$FAILED; } if (s7 !== peg$FAILED) { s6 = [s6, s7]; s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_and(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c231(s1, s5, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c232(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseexp_and(): any { let s0, s1, s2, s3, s4, s5, s6, s7, s8; s0 = peg$currPos; s1 = peg$parseexp_or_bit(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c233) { s5 = peg$c233; peg$currPos += 2; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c234); } } if (s5 === peg$FAILED) { s5 = peg$currPos; if (input.substr(peg$currPos, 3) === peg$c235) { s6 = peg$c235; peg$currPos += 3; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c236); } } if (s6 !== peg$FAILED) { s7 = peg$currPos; peg$silentFails++; s8 = peg$parseidentifierChar(); peg$silentFails--; if (s8 === peg$FAILED) { s7 = undefined; } else { peg$currPos = s7; s7 = peg$FAILED; } if (s7 !== peg$FAILED) { s6 = [s6, s7]; s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_or_bit(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c237(s1, s5, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c233) { s5 = peg$c233; peg$currPos += 2; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c234); } } if (s5 === peg$FAILED) { s5 = peg$currPos; if (input.substr(peg$currPos, 3) === peg$c235) { s6 = peg$c235; peg$currPos += 3; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c236); } } if (s6 !== peg$FAILED) { s7 = peg$currPos; peg$silentFails++; s8 = peg$parseidentifierChar(); peg$silentFails--; if (s8 === peg$FAILED) { s7 = undefined; } else { peg$currPos = s7; s7 = peg$FAILED; } if (s7 !== peg$FAILED) { s6 = [s6, s7]; s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_or_bit(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c237(s1, s5, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c232(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseexp_or_bit(): any { let s0, s1, s2, s3, s4, s5, s6, s7, s8; s0 = peg$currPos; s1 = peg$parseexp_xor_bit(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 124) { s5 = peg$c238; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c239); } } if (s5 === peg$FAILED) { s5 = peg$currPos; if (input.substr(peg$currPos, 5) === peg$c240) { s6 = peg$c240; peg$currPos += 5; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c241); } } if (s6 !== peg$FAILED) { s7 = peg$currPos; peg$silentFails++; s8 = peg$parseidentifierChar(); peg$silentFails--; if (s8 === peg$FAILED) { s7 = undefined; } else { peg$currPos = s7; s7 = peg$FAILED; } if (s7 !== peg$FAILED) { s6 = [s6, s7]; s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_xor_bit(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c242(s1, s5, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 124) { s5 = peg$c238; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c239); } } if (s5 === peg$FAILED) { s5 = peg$currPos; if (input.substr(peg$currPos, 5) === peg$c240) { s6 = peg$c240; peg$currPos += 5; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c241); } } if (s6 !== peg$FAILED) { s7 = peg$currPos; peg$silentFails++; s8 = peg$parseidentifierChar(); peg$silentFails--; if (s8 === peg$FAILED) { s7 = undefined; } else { peg$currPos = s7; s7 = peg$FAILED; } if (s7 !== peg$FAILED) { s6 = [s6, s7]; s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_xor_bit(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c242(s1, s5, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c243(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseexp_xor_bit(): any { let s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parseexp_and_bit(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 94) { s5 = peg$c244; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c245); } } if (s5 === peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c246) { s5 = peg$c246; peg$currPos += 3; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c247); } } } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_and_bit(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c248(s1, s5, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 94) { s5 = peg$c244; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c245); } } if (s5 === peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c246) { s5 = peg$c246; peg$currPos += 3; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c247); } } } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_and_bit(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c248(s1, s5, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c243(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseexp_and_bit(): any { let s0, s1, s2, s3, s4, s5, s6, s7, s8; s0 = peg$currPos; s1 = peg$parseexp_eq(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$currPos; if (input.charCodeAt(peg$currPos) === 38) { s6 = peg$c166; peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c167); } } if (s6 !== peg$FAILED) { s7 = peg$currPos; peg$silentFails++; if (input.charCodeAt(peg$currPos) === 38) { s8 = peg$c166; peg$currPos++; } else { s8 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c167); } } peg$silentFails--; if (s8 === peg$FAILED) { s7 = undefined; } else { peg$currPos = s7; s7 = peg$FAILED; } if (s7 !== peg$FAILED) { s6 = [s6, s7]; s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } if (s5 === peg$FAILED) { s5 = peg$currPos; if (input.substr(peg$currPos, 6) === peg$c249) { s6 = peg$c249; peg$currPos += 6; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c250); } } if (s6 !== peg$FAILED) { s7 = peg$currPos; peg$silentFails++; s8 = peg$parseidentifierChar(); peg$silentFails--; if (s8 === peg$FAILED) { s7 = undefined; } else { peg$currPos = s7; s7 = peg$FAILED; } if (s7 !== peg$FAILED) { s6 = [s6, s7]; s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_eq(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c251(s1, s5, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$currPos; if (input.charCodeAt(peg$currPos) === 38) { s6 = peg$c166; peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c167); } } if (s6 !== peg$FAILED) { s7 = peg$currPos; peg$silentFails++; if (input.charCodeAt(peg$currPos) === 38) { s8 = peg$c166; peg$currPos++; } else { s8 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c167); } } peg$silentFails--; if (s8 === peg$FAILED) { s7 = undefined; } else { peg$currPos = s7; s7 = peg$FAILED; } if (s7 !== peg$FAILED) { s6 = [s6, s7]; s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } if (s5 === peg$FAILED) { s5 = peg$currPos; if (input.substr(peg$currPos, 6) === peg$c249) { s6 = peg$c249; peg$currPos += 6; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c250); } } if (s6 !== peg$FAILED) { s7 = peg$currPos; peg$silentFails++; s8 = peg$parseidentifierChar(); peg$silentFails--; if (s8 === peg$FAILED) { s7 = undefined; } else { peg$currPos = s7; s7 = peg$FAILED; } if (s7 !== peg$FAILED) { s6 = [s6, s7]; s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_eq(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c251(s1, s5, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c243(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseexp_eq(): any { let s0, s1, s2, s3, s4, s5, s6, s7, s8; s0 = peg$currPos; s1 = peg$parseexp_rel(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c252) { s5 = peg$c252; peg$currPos += 2; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c253); } } if (s5 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c254) { s5 = peg$c254; peg$currPos += 2; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c255); } } if (s5 === peg$FAILED) { s5 = peg$currPos; if (input.substr(peg$currPos, 6) === peg$c256) { s6 = peg$c256; peg$currPos += 6; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c257); } } if (s6 !== peg$FAILED) { s7 = peg$currPos; peg$silentFails++; s8 = peg$parseidentifierChar(); peg$silentFails--; if (s8 === peg$FAILED) { s7 = undefined; } else { peg$currPos = s7; s7 = peg$FAILED; } if (s7 !== peg$FAILED) { peg$savedPos = s5; s6 = peg$c258(s1); s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_rel(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c190(s1, s5, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c252) { s5 = peg$c252; peg$currPos += 2; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c253); } } if (s5 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c254) { s5 = peg$c254; peg$currPos += 2; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c255); } } if (s5 === peg$FAILED) { s5 = peg$currPos; if (input.substr(peg$currPos, 6) === peg$c256) { s6 = peg$c256; peg$currPos += 6; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c257); } } if (s6 !== peg$FAILED) { s7 = peg$currPos; peg$silentFails++; s8 = peg$parseidentifierChar(); peg$silentFails--; if (s8 === peg$FAILED) { s7 = undefined; } else { peg$currPos = s7; s7 = peg$FAILED; } if (s7 !== peg$FAILED) { peg$savedPos = s5; s6 = peg$c258(s1); s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_rel(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c190(s1, s5, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c259(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseexp_rel(): any { let s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parseexp_shift(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parseop_rel(); if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_shift(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c190(s1, s5, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parseop_rel(); if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_shift(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c190(s1, s5, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c259(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseop_rel(): any { let s0; if (input.substr(peg$currPos, 2) === peg$c260) { s0 = peg$c260; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c261); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c262) { s0 = peg$c262; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c263); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 60) { s0 = peg$c264; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c265); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 62) { s0 = peg$c266; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c267); } } } } } return s0; } function peg$parseexp_shift(): any { let s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parseexp_add(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parseop_shift(); if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_add(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c190(s1, s5, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parseop_shift(); if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_add(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c190(s1, s5, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c243(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseop_shift(): any { let s0; if (input.substr(peg$currPos, 2) === peg$c268) { s0 = peg$c268; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c269); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c270) { s0 = peg$c270; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c271); } } } return s0; } function peg$parseexp_add(): any { let s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parseexp_mult(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parseop_add(); if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_mult(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c190(s1, s5, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parseop_add(); if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_mult(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c190(s1, s5, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c243(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseop_add(): any { let s0; if (input.charCodeAt(peg$currPos) === 43) { s0 = peg$c272; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c273); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 45) { s0 = peg$c274; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c275); } } } return s0; } function peg$parseexp_mult(): any { let s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parseexp_pm(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parseop_mult(); if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_pm(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c190(s1, s5, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parseop_mult(); if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_pm(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c190(s1, s5, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c243(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseop_mult(): any { let s0; if (input.charCodeAt(peg$currPos) === 42) { s0 = peg$c163; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c164); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 47) { s0 = peg$c276; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c277); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 37) { s0 = peg$c278; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c279); } } } } return s0; } function peg$parseexp_pm(): any { let s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parseexp_cast(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parseop_pm(); if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_cast(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c190(s1, s5, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parseop_pm(); if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_cast(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c190(s1, s5, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c280(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseop_pm(): any { let s0; if (input.substr(peg$currPos, 2) === peg$c281) { s0 = peg$c281; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c282); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c283) { s0 = peg$c283; peg$currPos += 3; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c284); } } } return s0; } function peg$parseexp_cast(): any { let s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 40) { s1 = peg$c38; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c39); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parsetype_id(); if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { s5 = peg$c40; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c41); } } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_cast(); if (s7 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c285(s3, s7); 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; } if (s0 === peg$FAILED) { s0 = peg$parseexp_unary(); } return s0; } function peg$parseexp_unary(): any { let s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; if (input.substr(peg$currPos, 2) === peg$c286) { s1 = peg$c286; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c287); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parseexp_unary(); if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c288(s1, s3); s0 = s1; } 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, 2) === peg$c289) { s1 = peg$c289; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c290); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parseexp_unary(); if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c288(s1, s3); s0 = s1; } 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$parseop_unary(); if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parseexp_cast(); if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c291(s1, s3); s0 = s1; } 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$c292) { s1 = peg$c292; peg$currPos += 6; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c293); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parseexp_unary(); if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c294(s1, s3); s0 = s1; } 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$c292) { s1 = peg$c292; peg$currPos += 6; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c293); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 40) { s3 = peg$c38; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c39); } } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parsesimple_type_name(); if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { s7 = peg$c40; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c41); } } if (s7 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c295(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; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } if (s0 === peg$FAILED) { s0 = peg$parseexp_new(); if (s0 === peg$FAILED) { s0 = peg$parseexp_delete(); } } } } } } return s0; } function peg$parseop_unary(): any { let s0, s1, s2, s3; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 42) { s1 = peg$c163; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c164); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c296(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 38) { s1 = peg$c166; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c167); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c297(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 43) { s1 = peg$c272; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c273); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c298(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 45) { s1 = peg$c274; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c275); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c299(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 33) { s1 = peg$c300; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c301); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c302(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 3) === peg$c303) { s1 = peg$c303; peg$currPos += 3; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c304); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; peg$silentFails++; s3 = peg$parseidentifierChar(); peg$silentFails--; if (s3 === peg$FAILED) { s2 = undefined; } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c302(); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 126) { s1 = peg$c305; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c306); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c307(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 5) === peg$c308) { s1 = peg$c308; peg$currPos += 5; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c309); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c307(); } s0 = s1; } } } } } } } return s0; } function peg$parseexp_new(): any { let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; s0 = peg$currPos; if (input.substr(peg$currPos, 3) === peg$c310) { s1 = peg$c310; peg$currPos += 3; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c311); } } if (s1 !== peg$FAILED) { s2 = peg$parseWS(); if (s2 !== peg$FAILED) { s3 = peg$parsenew_type_id(); if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parsenew_initializer(); if (s5 === peg$FAILED) { s5 = null; } if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c312(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; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 3) === peg$c310) { s1 = peg$c310; peg$currPos += 3; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c311); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 40) { s3 = peg$c38; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c39); } } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parsetype_id(); if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { s7 = peg$c40; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c41); } } if (s7 !== peg$FAILED) { s8 = peg$parsews(); if (s8 !== peg$FAILED) { s9 = peg$parsenew_initializer(); if (s9 === peg$FAILED) { s9 = null; } if (s9 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c313(s5, 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; } } return s0; } function peg$parsenew_type_id(): any { let s0, s1, s2, s3, s4; s0 = peg$currPos; s1 = peg$parsetype_specifiers(); if (s1 !== peg$FAILED) { s2 = peg$currPos; s3 = peg$parsews(); if (s3 !== peg$FAILED) { s4 = peg$parsenew_declarator(); if (s4 !== peg$FAILED) { peg$savedPos = s2; s3 = peg$c314(s1, s4); s2 = s3; } else { peg$currPos = s2; s2 = peg$FAILED; } } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 === peg$FAILED) { s2 = null; } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c315(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsenew_declarator(): any { let s0, s1; s0 = peg$currPos; s1 = peg$parse_new_declarator(); if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c316(s1); } s0 = s1; return s0; } function peg$parse_new_declarator(): any { let s0, s1, s2, s3, s4, s5; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 42) { s1 = peg$c163; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c164); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parsecv_qualifier(); if (s3 === peg$FAILED) { s3 = null; } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parse_new_declarator(); if (s5 === peg$FAILED) { s5 = null; } if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c165(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; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 38) { s1 = peg$c166; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c167); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parsecv_qualifier(); if (s3 === peg$FAILED) { s3 = null; } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parse_new_declarator(); if (s5 === peg$FAILED) { s5 = null; } if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c168(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; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parsenew_declarator_postfixes(); if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c317(s1); } s0 = s1; } } return s0; } function peg$parsenew_declarator_postfixes(): any { let s0, s1, s2, s3; s0 = []; s1 = peg$currPos; s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parsenew_declarator_postfix(); if (s3 !== peg$FAILED) { peg$savedPos = s1; s2 = peg$c318(s3); s1 = s2; } else { peg$currPos = s1; s1 = peg$FAILED; } } else { peg$currPos = s1; s1 = peg$FAILED; } if (s1 !== peg$FAILED) { while (s1 !== peg$FAILED) { s0.push(s1); s1 = peg$currPos; s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parsenew_declarator_postfix(); if (s3 !== peg$FAILED) { peg$savedPos = s1; s2 = peg$c318(s3); s1 = s2; } else { peg$currPos = s1; s1 = peg$FAILED; } } else { peg$currPos = s1; s1 = peg$FAILED; } } } else { s0 = peg$FAILED; } return s0; } function peg$parsenew_declarator_postfix(): any { let s0, s1, s2, s3, s4, s5; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 91) { s1 = peg$c172; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c173); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parseexp_assn(); if (s3 === peg$FAILED) { s3 = null; } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 93) { s5 = peg$c174; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c175); } } if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c176(s3); 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$parsenew_initializer(): any { let s0, s1, s2, s3, s4, s5; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 40) { s1 = peg$c38; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c39); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { s3 = peg$c40; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c41); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c319(); s0 = s1; } 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.charCodeAt(peg$currPos) === 40) { s1 = peg$c38; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c39); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parseexp_list(); if (s3 === peg$FAILED) { s3 = null; } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { s5 = peg$c40; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c41); } } if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c320(s3); 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$parseexp_delete(): any { let s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; if (input.substr(peg$currPos, 6) === peg$c321) { s1 = peg$c321; peg$currPos += 6; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c322); } } if (s1 !== peg$FAILED) { s2 = peg$parseWS(); if (s2 !== peg$FAILED) { s3 = peg$parseexp_cast(); if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c323(s3); s0 = s1; } 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$c321) { s1 = peg$c321; peg$currPos += 6; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c322); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 91) { s3 = peg$c172; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c173); } } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 93) { s5 = peg$c174; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c175); } } if (s5 !== peg$FAILED) { s6 = peg$parseWS(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_cast(); if (s7 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c324(s7); 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; } if (s0 === peg$FAILED) { s0 = peg$parseexp_postfix(); } } return s0; } function peg$parseexp_postfix(): any { let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13; s0 = peg$currPos; if (input.substr(peg$currPos, 11) === peg$c325) { s1 = peg$c325; peg$currPos += 11; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c326); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 60) { s3 = peg$c264; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c265); } } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parsesimple_type_name(); if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 62) { s7 = peg$c266; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c267); } } if (s7 !== peg$FAILED) { s8 = peg$parsews(); if (s8 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 40) { s9 = peg$c38; peg$currPos++; } else { s9 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c39); } } if (s9 !== peg$FAILED) { s10 = peg$parsews(); if (s10 !== peg$FAILED) { s11 = peg$parseexp_cast(); if (s11 !== peg$FAILED) { s12 = peg$parsews(); if (s12 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { s13 = peg$c40; peg$currPos++; } else { s13 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c41); } } if (s13 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c327(s5, 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, 12) === peg$c328) { s1 = peg$c328; peg$currPos += 12; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c329); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 60) { s3 = peg$c264; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c265); } } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parsesimple_type_name(); if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 62) { s7 = peg$c266; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c267); } } if (s7 !== peg$FAILED) { s8 = peg$parsews(); if (s8 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 40) { s9 = peg$c38; peg$currPos++; } else { s9 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c39); } } if (s9 !== peg$FAILED) { s10 = peg$parsews(); if (s10 !== peg$FAILED) { s11 = peg$parseexp_cast(); if (s11 !== peg$FAILED) { s12 = peg$parsews(); if (s12 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { s13 = peg$c40; peg$currPos++; } else { s13 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c41); } } if (s13 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c330(s5, 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, 16) === peg$c331) { s1 = peg$c331; peg$currPos += 16; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c332); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 60) { s3 = peg$c264; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c265); } } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parsesimple_type_name(); if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 62) { s7 = peg$c266; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c267); } } if (s7 !== peg$FAILED) { s8 = peg$parsews(); if (s8 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 40) { s9 = peg$c38; peg$currPos++; } else { s9 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c39); } } if (s9 !== peg$FAILED) { s10 = peg$parsews(); if (s10 !== peg$FAILED) { s11 = peg$parseexp_cast(); if (s11 !== peg$FAILED) { s12 = peg$parsews(); if (s12 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { s13 = peg$c40; peg$currPos++; } else { s13 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c41); } } if (s13 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c333(s5, 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, 10) === peg$c334) { s1 = peg$c334; peg$currPos += 10; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c335); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 60) { s3 = peg$c264; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c265); } } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parsesimple_type_name(); if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 62) { s7 = peg$c266; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c267); } } if (s7 !== peg$FAILED) { s8 = peg$parsews(); if (s8 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 40) { s9 = peg$c38; peg$currPos++; } else { s9 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c39); } } if (s9 !== peg$FAILED) { s10 = peg$parsews(); if (s10 !== peg$FAILED) { s11 = peg$parseexp_cast(); if (s11 !== peg$FAILED) { s12 = peg$parsews(); if (s12 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { s13 = peg$c40; peg$currPos++; } else { s13 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c41); } } if (s13 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c336(s5, 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; s1 = peg$parseexp_construct(); if (s1 === peg$FAILED) { s1 = peg$parseexp_primary(); } if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parseop_postfix(); if (s5 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c337(s1, s5); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parseop_postfix(); if (s5 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c337(s1, s5); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c338(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } } } } return s0; } function peg$parseop_postfix(): any { let s0, s1, s2, s3, s4, s5; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 91) { s1 = peg$c172; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c173); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parseexpression(); if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 93) { s5 = peg$c174; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c175); } } if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c339(s3); 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; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 40) { s1 = peg$c38; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c39); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parseexp_list(); if (s3 === peg$FAILED) { s3 = null; } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { s5 = peg$c40; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c41); } } if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c340(s3); 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; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 46) { s1 = peg$c341; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c342); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parseid_expression(); if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c343(s3); s0 = s1; } 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, 2) === peg$c344) { s1 = peg$c344; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c345); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parseid_expression(); if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c346(s3); s0 = s1; } 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, 2) === peg$c286) { s1 = peg$c286; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c287); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c347(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 2) === peg$c289) { s1 = peg$c289; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c290); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c348(); } s0 = s1; } } } } } return s0; } function peg$parseexp_construct(): any { let s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parsesimple_type_name(); if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 40) { s3 = peg$c38; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c39); } } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parseexp_list(); if (s5 === peg$FAILED) { s5 = null; } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { s7 = peg$c40; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c41); } } if (s7 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c349(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; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseexp_list(): any { let s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parseexp_assn(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s5 = peg$c67; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c68); } } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_assn(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c350(s1, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s5 = peg$c67; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c68); } } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parseexp_assn(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c350(s1, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c186(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseexp_primary(): any { let s0, s1, s2, s3, s4, s5; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 40) { s1 = peg$c38; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c39); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parseexpression(); if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { s5 = peg$c40; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c41); } } if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c351(s3); 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; } if (s0 === peg$FAILED) { s0 = peg$parseliteral(); if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 4) === peg$c352) { s1 = peg$c352; peg$currPos += 4; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c353); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; peg$silentFails++; s3 = peg$parseidentifierChar(); peg$silentFails--; if (s3 === peg$FAILED) { s2 = undefined; } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c354(); s0 = s1; } 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, 7) === peg$c355) { s1 = peg$c355; peg$currPos += 7; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c356); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; peg$silentFails++; s3 = peg$parseidentifierChar(); peg$silentFails--; if (s3 === peg$FAILED) { s2 = undefined; } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c357(); s0 = s1; } 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, 4) === peg$c358) { s1 = peg$c358; peg$currPos += 4; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c359); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; peg$silentFails++; s3 = peg$parseidentifierChar(); peg$silentFails--; if (s3 === peg$FAILED) { s2 = undefined; } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c357(); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parseid_expression(); if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c360(s1); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$parseanything(); if (s0 === peg$FAILED) { s0 = peg$parseopaque_expression(); } } } } } } } return s0; } function peg$parseid_expression(): any { let s0, s1, s2; s0 = peg$parsequalified_id(); if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parseunqualified_id(); if (s1 !== peg$FAILED) { peg$savedPos = peg$currPos; s2 = peg$c361(s1); if (s2) { s2 = peg$FAILED; } else { s2 = undefined; } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c362(s1); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } return s0; } function peg$parseunqualified_id(): any { let s0, s1, s2, s3; s0 = peg$parseoperator_function_id(); if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 126) { s1 = peg$c305; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c306); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parseclass_name(); if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c363(s3); s0 = s1; } 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$parseidentifier(); } } return s0; } function peg$parsequalified_id(): any { let s0, s1, s2, s3; s0 = peg$currPos; s1 = peg$parsenested_name_specifier(); if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parseunqualified_id(); if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c364(s1, s3); s0 = s1; } 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$parsenested_name_specifier(): any { let s0, s1, s2, s3, s4, s5; s0 = []; s1 = peg$currPos; s2 = peg$parsetype_name_id(); if (s2 === peg$FAILED) { s2 = peg$parseidentifier(); } if (s2 !== peg$FAILED) { s3 = peg$parsews(); if (s3 !== peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c365) { s4 = peg$c365; peg$currPos += 2; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c366); } } if (s4 !== peg$FAILED) { s5 = peg$parsews(); if (s5 !== peg$FAILED) { peg$savedPos = s1; s2 = peg$c367(s2); s1 = s2; } else { peg$currPos = s1; s1 = peg$FAILED; } } else { peg$currPos = s1; s1 = peg$FAILED; } } else { peg$currPos = s1; s1 = peg$FAILED; } } else { peg$currPos = s1; s1 = peg$FAILED; } if (s1 !== peg$FAILED) { while (s1 !== peg$FAILED) { s0.push(s1); s1 = peg$currPos; s2 = peg$parsetype_name_id(); if (s2 === peg$FAILED) { s2 = peg$parseidentifier(); } if (s2 !== peg$FAILED) { s3 = peg$parsews(); if (s3 !== peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c365) { s4 = peg$c365; peg$currPos += 2; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c366); } } if (s4 !== peg$FAILED) { s5 = peg$parsews(); if (s5 !== peg$FAILED) { peg$savedPos = s1; s2 = peg$c367(s2); s1 = s2; } else { peg$currPos = s1; s1 = peg$FAILED; } } else { peg$currPos = s1; s1 = peg$FAILED; } } else { peg$currPos = s1; s1 = peg$FAILED; } } else { peg$currPos = s1; s1 = peg$FAILED; } } } else { s0 = peg$FAILED; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 2) === peg$c365) { s1 = peg$c365; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c366); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c368(); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } return s0; } function peg$parsetype_name_id(): any { let s0, s1; s0 = peg$currPos; s1 = peg$parsesimple_type_name(); if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c369(s1); } s0 = s1; return s0; } function peg$parsename(): any { let s0; s0 = peg$parseoperator_function_id(); if (s0 === peg$FAILED) { s0 = peg$parseidentifier(); } return s0; } function peg$parseoperator_function_id(): any { let s0, s1, s2, s3; s0 = peg$currPos; if (input.substr(peg$currPos, 8) === peg$c370) { s1 = peg$c370; peg$currPos += 8; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c371); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parseoverloadable_op(); if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c372(s3); s0 = s1; } 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$parseoverloadable_op(): any { let s0; if (input.substr(peg$currPos, 5) === peg$c373) { s0 = peg$c373; peg$currPos += 5; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c374); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 8) === peg$c375) { s0 = peg$c375; peg$currPos += 8; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c376); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c310) { s0 = peg$c310; peg$currPos += 3; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c311); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 6) === peg$c321) { s0 = peg$c321; peg$currPos += 6; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c322); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c283) { s0 = peg$c283; peg$currPos += 3; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c284); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c204) { s0 = peg$c204; peg$currPos += 3; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c205); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c206) { s0 = peg$c206; peg$currPos += 3; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c207); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c200) { s0 = peg$c200; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c201); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c202) { s0 = peg$c202; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c203); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c194) { s0 = peg$c194; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c195); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c196) { s0 = peg$c196; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c197); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c198) { s0 = peg$c198; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c199); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c213) { s0 = peg$c213; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c214); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c208) { s0 = peg$c208; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c209); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c218) { s0 = peg$c218; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c219); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c268) { s0 = peg$c268; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c269); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c270) { s0 = peg$c270; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c271); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c252) { s0 = peg$c252; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c253); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c254) { s0 = peg$c254; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c255); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c260) { s0 = peg$c260; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c261); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c262) { s0 = peg$c262; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c263); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c233) { s0 = peg$c233; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c234); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c227) { s0 = peg$c227; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c228); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c286) { s0 = peg$c286; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c287); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c289) { s0 = peg$c289; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c290); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c344) { s0 = peg$c344; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c345); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c377) { s0 = peg$c377; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c378); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c379) { s0 = peg$c379; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c380); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 43) { s0 = peg$c272; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c273); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 45) { s0 = peg$c274; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c275); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 42) { s0 = peg$c163; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c164); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 47) { s0 = peg$c276; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c277); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 37) { s0 = peg$c278; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c279); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 94) { s0 = peg$c244; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c245); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 38) { s0 = peg$c166; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c167); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 124) { s0 = peg$c238; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c239); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 126) { s0 = peg$c305; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c306); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 33) { s0 = peg$c300; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c301); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 61) { s0 = peg$c148; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c149); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 60) { s0 = peg$c264; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c265); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 62) { s0 = peg$c266; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c267); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s0 = peg$c67; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c68); } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } return s0; } function peg$parseunoverloadable_op(): any { let s0; if (input.charCodeAt(peg$currPos) === 46) { s0 = peg$c341; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c342); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c281) { s0 = peg$c281; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c282); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c365) { s0 = peg$c365; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c366); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c381) { s0 = peg$c381; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c382); } } } } } return s0; } function peg$parseliteral(): any { let s0, s1; s0 = peg$currPos; s1 = peg$parseliteral_float(); if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c383(s1); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parseliteral_int(); if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c384(s1); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parseliteral_char(); if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c385(s1); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parseliteral_string(); if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c386(s1); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parseliteral_boolean(); if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c387(s1); } s0 = s1; } } } } return s0; } function peg$parseliteral_int(): any { let s0, s1, s2, s3; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 45) { s1 = peg$c274; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c275); } } if (s1 === peg$FAILED) { s1 = null; } if (s1 !== peg$FAILED) { s2 = []; if (peg$c388.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c389); } } if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); if (peg$c388.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c389); } } } } else { s2 = peg$FAILED; } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c390(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseliteral_float(): any { let s0, s1, s2, s3; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 45) { s1 = peg$c274; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c275); } } if (s1 === peg$FAILED) { s1 = null; } if (s1 !== peg$FAILED) { s2 = []; if (peg$c391.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c392); } } if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); if (peg$c391.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c392); } } } } else { s2 = peg$FAILED; } if (s2 !== peg$FAILED) { peg$savedPos = peg$currPos; s3 = peg$c393(s1, s2); if (s3) { s3 = undefined; } else { s3 = peg$FAILED; } if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c394(s1, s2); s0 = s1; } 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$parseliteral_char(): any { let s0, s1, s2, s3; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 39) { s1 = peg$c395; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c396); } } if (s1 !== peg$FAILED) { if (peg$c397.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c398); } } if (s2 === peg$FAILED) { s2 = peg$parseescape(); } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 39) { s3 = peg$c395; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c396); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c399(s2); s0 = s1; } 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$parseliteral_string(): any { let s0, s1, s2, s3; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 34) { s1 = peg$c400; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c401); } } if (s1 !== peg$FAILED) { s2 = []; if (peg$c402.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c403); } } if (s3 === peg$FAILED) { s3 = peg$parseescape(); } while (s3 !== peg$FAILED) { s2.push(s3); if (peg$c402.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c403); } } if (s3 === peg$FAILED) { s3 = peg$parseescape(); } } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 34) { s3 = peg$c400; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c401); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c404(s2); s0 = s1; } 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$parseliteral_boolean(): any { let s0, s1, s2, s3; s0 = peg$currPos; if (input.substr(peg$currPos, 4) === peg$c405) { s1 = peg$c405; peg$currPos += 4; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c406); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; peg$silentFails++; s3 = peg$parseidentifierChar(); peg$silentFails--; if (s3 === peg$FAILED) { s2 = undefined; } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c407(); s0 = s1; } 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, 5) === peg$c408) { s1 = peg$c408; peg$currPos += 5; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c409); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; peg$silentFails++; s3 = peg$parseidentifierChar(); peg$silentFails--; if (s3 === peg$FAILED) { s2 = undefined; } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c410(); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } return s0; } function peg$parseescape(): any { let s0; s0 = peg$parsesimple_escape(); if (s0 === peg$FAILED) { s0 = peg$parseoctal_escape(); } return s0; } function peg$parsesimple_escape(): any { let s0; if (input.substr(peg$currPos, 2) === peg$c411) { s0 = peg$c411; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c412); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c413) { s0 = peg$c413; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c414); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c415) { s0 = peg$c415; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c416); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c417) { s0 = peg$c417; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c418); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c419) { s0 = peg$c419; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c420); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c421) { s0 = peg$c421; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c422); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c423) { s0 = peg$c423; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c424); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c425) { s0 = peg$c425; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c426); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c427) { s0 = peg$c427; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c428); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c429) { s0 = peg$c429; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c430); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c431) { s0 = peg$c431; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c432); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c433) { s0 = peg$c433; peg$currPos += 2; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c434); } } } } } } } } } } } } } return s0; } function peg$parseoctal_escape(): any { let s0, s1, s2, s3; if (peg$c435.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c436); } } if (s0 === peg$FAILED) { s0 = peg$currPos; if (peg$c435.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c436); } } if (s1 !== peg$FAILED) { if (peg$c435.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c436); } } if (s2 !== peg$FAILED) { s1 = [s1, s2]; s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (peg$c435.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c436); } } if (s1 !== peg$FAILED) { if (peg$c435.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c436); } } if (s2 !== peg$FAILED) { if (peg$c435.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c436); } } if (s3 !== peg$FAILED) { s1 = [s1, s2, s3]; s0 = s1; } 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$parseidentifier(): any { let s0, s1, s2, s3; peg$silentFails++; s0 = peg$currPos; s1 = peg$parseidentifierFirstChar(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$parseidentifierChar(); while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parseidentifierChar(); } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c438(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c437); } } return s0; } function peg$parseidentifierChar(): any { let s0; if (peg$c439.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c440); } } return s0; } function peg$parseidentifierFirstChar(): any { let s0; if (peg$c441.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c442); } } return s0; } function peg$parsetemplate_identifier(): any { let s0, s1, s2, s3, s4; s0 = peg$currPos; s1 = peg$parseidentifier(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 60) { s2 = peg$c264; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c265); } } if (s2 !== peg$FAILED) { s3 = peg$parseidentifier(); if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 62) { s4 = peg$c266; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c267); } } if (s4 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c443(s1, s3); 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; } return s0; } function peg$parseopaque_expression(): any { let s0, s1, s2, s3; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 64) { s1 = peg$c444; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c445); } } if (s1 !== peg$FAILED) { s2 = []; if (peg$c446.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c447); } } if (s3 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c365) { s3 = peg$c365; peg$currPos += 2; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c366); } } if (s3 === peg$FAILED) { s3 = peg$parseoverloadable_op(); } } if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); if (peg$c446.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c447); } } if (s3 === peg$FAILED) { if (input.substr(peg$currPos, 2) === peg$c365) { s3 = peg$c365; peg$currPos += 2; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c366); } } if (s3 === peg$FAILED) { s3 = peg$parseoverloadable_op(); } } } } else { s2 = peg$FAILED; } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c448(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsews(): any { let s0, s1, s2, s3; peg$silentFails++; s0 = peg$currPos; s1 = []; if (peg$c450.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c451); } } while (s2 !== peg$FAILED) { s1.push(s2); if (peg$c450.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c451); } } } if (s1 !== peg$FAILED) { s2 = peg$parsecomment(); if (s2 !== peg$FAILED) { s3 = peg$parsews(); if (s3 !== peg$FAILED) { s1 = [s1, s2, s3]; s0 = s1; } 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 = []; if (peg$c450.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c451); } } while (s1 !== peg$FAILED) { s0.push(s1); if (peg$c450.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c451); } } } } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c449); } } return s0; } function peg$parseWS(): any { let s0, s1, s2, s3; peg$silentFails++; s0 = peg$currPos; s1 = peg$parsecomment(); if (s1 !== peg$FAILED) { s2 = peg$parseWS(); if (s2 !== peg$FAILED) { s1 = [s1, s2]; s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = []; if (peg$c450.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c451); } } if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { s1.push(s2); if (peg$c450.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c451); } } } } else { s1 = peg$FAILED; } if (s1 !== peg$FAILED) { s2 = peg$parsecomment(); if (s2 !== peg$FAILED) { s3 = peg$parsews(); if (s3 !== peg$FAILED) { s1 = [s1, s2, s3]; s0 = s1; } 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 = []; if (peg$c450.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c451); } } if (s1 !== peg$FAILED) { while (s1 !== peg$FAILED) { s0.push(s1); if (peg$c450.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c451); } } } } else { s0 = peg$FAILED; } } } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c452); } } return s0; } function peg$parseclass_name(): any { let s0, s1, s2; s0 = peg$currPos; s1 = peg$parsetemplate_identifier(); if (s1 !== peg$FAILED) { peg$savedPos = peg$currPos; s2 = peg$c453(s1); if (s2) { s2 = undefined; } else { s2 = peg$FAILED; } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c367(s1); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parseidentifier(); if (s1 !== peg$FAILED) { peg$savedPos = peg$currPos; s2 = peg$c453(s1); if (s2) { s2 = undefined; } else { s2 = peg$FAILED; } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c367(s1); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } return s0; } function peg$parseclass_specifier(): any { let s0, s1, s2, s3, s4, s5, s6, s7, s8; s0 = peg$currPos; s1 = peg$parseclass_head(); if (s1 !== peg$FAILED) { peg$savedPos = peg$currPos; s2 = peg$c454(s1); if (s2) { s2 = undefined; } else { s2 = peg$FAILED; } if (s2 !== peg$FAILED) { s3 = peg$parsews(); if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 123) { s4 = peg$c30; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c31); } } if (s4 !== peg$FAILED) { s5 = peg$parsews(); if (s5 !== peg$FAILED) { s6 = []; s7 = peg$parsemember_specification(); while (s7 !== peg$FAILED) { s6.push(s7); s7 = peg$parsemember_specification(); } if (s6 !== peg$FAILED) { s7 = peg$parsews(); if (s7 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s8 = peg$c33; peg$currPos++; } else { s8 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c34); } } if (s8 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c455(s1, s6); 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; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parseclass_head(); if (s1 !== peg$FAILED) { peg$savedPos = peg$currPos; s2 = peg$c456(s1); if (s2) { s2 = undefined; } else { s2 = peg$FAILED; } if (s2 !== peg$FAILED) { s1 = [s1, s2]; s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } return s0; } function peg$parseclass_head(): any { let s0, s1, s2, s3, s4, s5, s6; s0 = peg$currPos; s1 = peg$parseclass_key(); if (s1 !== peg$FAILED) { s2 = peg$parseWS(); if (s2 !== peg$FAILED) { s3 = peg$parseclass_head_name(); if (s3 !== peg$FAILED) { s4 = peg$currPos; s5 = peg$parseWS(); if (s5 !== peg$FAILED) { s6 = peg$parsebase_clause(); if (s6 !== peg$FAILED) { peg$savedPos = s4; s5 = peg$c457(s1, s3, s6); s4 = s5; } else { peg$currPos = s4; s4 = peg$FAILED; } } else { peg$currPos = s4; s4 = peg$FAILED; } if (s4 === peg$FAILED) { s4 = null; } if (s4 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c458(s1, s3, 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; } return s0; } function peg$parseclass_head_name(): any { let s0; s0 = peg$parsetemplate_identifier(); if (s0 === peg$FAILED) { s0 = peg$parseidentifier(); } return s0; } function peg$parseclass_key(): any { let s0; if (input.substr(peg$currPos, 5) === peg$c459) { s0 = peg$c459; peg$currPos += 5; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c460); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 6) === peg$c461) { s0 = peg$c461; peg$currPos += 6; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c462); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 5) === peg$c463) { s0 = peg$c463; peg$currPos += 5; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c464); } } } } return s0; } function peg$parsemember_specification(): any { let s0, s1, s2, s3, s4, s5, s6, s7, s8; s0 = peg$currPos; s1 = peg$parseaccess_specifier(); if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 58) { s3 = peg$c17; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c18); } } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = []; s6 = peg$currPos; s7 = peg$parsemember_declaration(); if (s7 !== peg$FAILED) { s8 = peg$parsews(); if (s8 !== peg$FAILED) { peg$savedPos = s6; s7 = peg$c465(s1, s7); s6 = s7; } else { peg$currPos = s6; s6 = peg$FAILED; } } else { peg$currPos = s6; s6 = peg$FAILED; } while (s6 !== peg$FAILED) { s5.push(s6); s6 = peg$currPos; s7 = peg$parsemember_declaration(); if (s7 !== peg$FAILED) { s8 = peg$parsews(); if (s8 !== peg$FAILED) { peg$savedPos = s6; s7 = peg$c465(s1, s7); s6 = s7; } else { peg$currPos = s6; s6 = peg$FAILED; } } else { peg$currPos = s6; s6 = peg$FAILED; } } if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c466(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; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = []; s2 = peg$currPos; s3 = peg$parsemember_declaration(); if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { peg$savedPos = s2; s3 = peg$c467(s3); s2 = s3; } else { peg$currPos = s2; s2 = peg$FAILED; } } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$currPos; s3 = peg$parsemember_declaration(); if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { peg$savedPos = s2; s3 = peg$c467(s3); s2 = s3; } else { peg$currPos = s2; s2 = peg$FAILED; } } else { peg$currPos = s2; s2 = peg$FAILED; } } } else { s1 = peg$FAILED; } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c468(s1); } s0 = s1; } return s0; } function peg$parseaccess_specifier(): any { let s0; if (input.substr(peg$currPos, 7) === peg$c469) { s0 = peg$c469; peg$currPos += 7; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c470); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 9) === peg$c471) { s0 = peg$c471; peg$currPos += 9; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c472); } } if (s0 === peg$FAILED) { if (input.substr(peg$currPos, 6) === peg$c473) { s0 = peg$c473; peg$currPos += 6; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c474); } } } } return s0; } function peg$parsemember_declaration(): any { let s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parsedecl_specifiers_prohibit_class_name(); if (s1 !== peg$FAILED) { s2 = peg$currPos; peg$silentFails++; s3 = peg$parseid_expression(); peg$silentFails--; if (s3 === peg$FAILED) { s2 = undefined; } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 !== peg$FAILED) { s3 = peg$parsews(); if (s3 !== peg$FAILED) { s4 = peg$parsemember_declarator_list(); if (s4 !== peg$FAILED) { s5 = peg$parsews(); if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 59) { s6 = peg$c26; peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c27); } } if (s6 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c475(s1, 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; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parsews(); if (s1 !== peg$FAILED) { s2 = peg$parsemember_declarator_list(); if (s2 !== peg$FAILED) { s3 = peg$parsews(); if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 59) { s4 = peg$c26; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c27); } } if (s4 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c476(s2); 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$parsedecl_specifiers(); if (s1 !== peg$FAILED) { peg$savedPos = peg$currPos; s2 = peg$c65(s1); if (s2) { s2 = peg$FAILED; } else { s2 = undefined; } if (s2 !== peg$FAILED) { s3 = peg$currPos; peg$silentFails++; s4 = peg$parseid_expression(); peg$silentFails--; if (s4 === peg$FAILED) { s3 = undefined; } else { peg$currPos = s3; s3 = peg$FAILED; } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { s5 = peg$parsemember_declarator_list(); if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 59) { s7 = peg$c26; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c27); } } if (s7 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c475(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; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parsefunction_definition(); if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 59) { s3 = peg$c26; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c27); } } if (s3 === peg$FAILED) { s3 = null; } if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c477(s1); s0 = s1; } 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$parsemember_declarator_list(): any { let s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parsemember_declarator(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s5 = peg$c67; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c68); } } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parsemember_declarator(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c69(s1, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s5 = peg$c67; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c68); } } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parsemember_declarator(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c69(s1, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c70(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsemember_declarator(): any { let s0, s1, s2, s3, s4, s5; s0 = peg$currPos; s1 = peg$parsedeclarator(); if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 61) { s3 = peg$c148; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c149); } } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 48) { s5 = peg$c478; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c479); } } if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c480(s1); 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; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parsedeclarator(); if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 61) { s3 = peg$c148; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c149); } } if (s3 !== peg$FAILED) { s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.substr(peg$currPos, 21) === peg$c152) { s5 = peg$c152; peg$currPos += 21; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c153); } } if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c481(s1); 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; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parsedeclarator(); if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parsebrace_or_equal_initializer(); if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c482(s1, s3); s0 = s1; } 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$parsedeclarator(); if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$currPos; s4 = peg$parsevirt_specifier(); if (s4 !== peg$FAILED) { s5 = peg$parsews(); if (s5 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c483(s1, s4); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } if (s3 !== peg$FAILED) { s4 = peg$parsebrace_or_equal_initializer(); if (s4 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c484(s1, s3, 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$parsedeclarator(); if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parsevirt_specifier(); if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c485(s1, s3); s0 = s1; } 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$parsedeclarator(); } } } } } return s0; } function peg$parsevirt_specifier(): any { let s0; if (input.substr(peg$currPos, 8) === peg$c486) { s0 = peg$c486; peg$currPos += 8; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c487); } } return s0; } function peg$parsebase_clause(): any { let s0, s1, s2, s3; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 58) { s1 = peg$c17; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c18); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parsebase_specifier_list(); if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c488(s3); s0 = s1; } 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$parsebase_specifier_list(): any { let s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; s1 = peg$parsebase_specifier(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s5 = peg$c67; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c68); } } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parsebase_specifier(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c489(s1, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$parsews(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s5 = peg$c67; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c68); } } if (s5 !== peg$FAILED) { s6 = peg$parsews(); if (s6 !== peg$FAILED) { s7 = peg$parsebase_specifier(); if (s7 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c489(s1, s7); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c70(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsebase_specifier(): any { let s0, s1, s2, s3, s4, s5; s0 = peg$currPos; if (input.substr(peg$currPos, 7) === peg$c117) { s1 = peg$c117; peg$currPos += 7; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c118); } } if (s1 !== peg$FAILED) { s2 = peg$parseWS(); if (s2 !== peg$FAILED) { s3 = peg$currPos; s4 = peg$parseaccess_specifier(); if (s4 !== peg$FAILED) { s5 = peg$parseWS(); if (s5 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c490(s4); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } if (s3 !== peg$FAILED) { s4 = peg$parsequalified_class_name(); if (s4 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c491(s3, 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$currPos; s2 = peg$parseaccess_specifier(); if (s2 !== peg$FAILED) { s3 = peg$parseWS(); if (s3 !== peg$FAILED) { peg$savedPos = s1; s2 = peg$c490(s2); s1 = s2; } else { peg$currPos = s1; s1 = peg$FAILED; } } else { peg$currPos = s1; s1 = peg$FAILED; } if (s1 !== peg$FAILED) { if (input.substr(peg$currPos, 7) === peg$c117) { s2 = peg$c117; peg$currPos += 7; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c118); } } if (s2 !== peg$FAILED) { s3 = peg$parseWS(); if (s3 !== peg$FAILED) { s4 = peg$parsequalified_class_name(); if (s4 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c491(s1, 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$parseaccess_specifier(); if (s1 !== peg$FAILED) { s2 = peg$parseWS(); if (s2 !== peg$FAILED) { s3 = peg$parsequalified_class_name(); if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c492(s1, s3); s0 = s1; } 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$parsequalified_class_name(); if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c493(s1); } s0 = s1; } } } return s0; } function peg$parsequalified_class_name(): any { let s0, s1, s2, s3; s0 = peg$currPos; s1 = peg$parsenested_name_specifier(); if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (s2 !== peg$FAILED) { s3 = peg$parseclass_name(); if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c494(s1, s3); s0 = s1; } 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$parseclass_name(); } return s0; } function peg$parseanything(): any { let s0, s1; s0 = peg$currPos; if (input.substr(peg$currPos, 10) === peg$c495) { s1 = peg$c495; peg$currPos += 10; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c496); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c497(); } s0 = s1; return s0; } const KEYWORDS = new Set([ "alignas", "continue", "friend", "register", "true", "alignof", "decltype", "goto", "reinterpret_cast", "try", "asm", "default", "if", "return", "typedef", "auto", "delete", "inline", "short", "typeid", "bool", "do", "int", "signed", "typename", "break", "double", "long", "sizeof", "union", "case", "dynamic_cast", "mutable", "static", "unsigned", "catch", "else", "namespace", "static_assert", "using", "char", "enum", "new", "static_cast", "virtual", "char16_t", "explicit", "noexcept", "struct", "void", "char32_t", "export", "nullptr", "switch", "volatile", "class", "extern", "operator", "template", "wchar_t", "const", "false", "private", "this", "while", "constexpr", "float", "protected", "thread_local", "const_cast", "for", "public", "throw" ]); function composeBinaryOp(first: any, rest: any, assoc: "left" | "right", exprType: string) : any { if(!rest || rest.length === 0){ return first; } if (assoc === "left"){ let right = rest.pop(); return { construct_type: exprType, operator: right[0], left: track(composeBinaryOp(first, rest, assoc, exprType), location(), text()), right: right[1], associativity: assoc } } else{ let left = rest.shift(); return { construct_type: exprType, operator: left[0], left: first, right: track(composeBinaryOp(left[1], rest, assoc, exprType), location(), text()), associativity: assoc } } } function absorb(eater: any, eaten: any){ if (!eaten){ return eater; } for (let attr in eaten){ if(attr != "start" && attr != "end"){ eater[attr] = eaten[attr]; } } return eater; } function track(obj: any, location: any, text: string) { for(let key in obj) { if (obj[key] === null) { obj[key] = undefined; } } obj.source = { location : location, start : location.start.offset, text : text, line : location.start.line, column : location.start.column, end : location.start.offset + text.length }; return obj; } function postfixExp(ops: any, sub: any){ if(ops.length == 0){ return sub; } else{ let op = ops.pop(); op.operand = postfixExp(ops, sub); return op; } } let _userTypeNames = { "initializer_list": true, "initializer_list": true, "initializer_list": true, "initializer_list": true }; function getUserTypeNames() : any { //if (typeof Types !== "undefined"){ // return Types.userTypeNames; //} //else{ return _userTypeNames; //} } function isUserTypeName(name: string) { return getUserTypeNames()[name]; } var _type_specifier_user_type_allowed_stack = true; var emptyDeclSpecs = { typeSpecs: [], storageSpecs: [], length: 0 }; var classNameStack: string[] = []; var prohibitOwnClassName: boolean = false; 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(peg$endExpectation()); } throw peg$buildStructuredError( peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos) ); } } export interface IParseOptions { filename?: string; startRule?: string; tracer?: any; [key: string]: any; } export type ParseFunction = (input: string, options?: IParseOptions) => any; export const parse: ParseFunction = peg$parse;