Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
),
);
// parenthesisExpression has the highest precedence and thus it appears
// in the "lowest" leaf in the expression ParseTree.
this.RULE('parenthesisExpression', () => {
this.CONSUME(LeftBracket);
const expValue = this.SUBRULE(this.parse);
this.CONSUME(RightBracket);
return expValue;
});
// very important to call this after all the rules have been defined.
// otherwise the parser may not work correctly as it will lack information
// derived during the self analysis phase.
Parser.performSelfAnalysis(this);
}
constructor() {
super(lexer.tokenList, {
errorMessageProvider: errorMessageProvider,
recoveryEnabled: true,
outputCst: false
});
// very important to call this after all the rules have been defined.
// otherwise the parser may not work correctly as it will lack information
// derived during the self analysis phase.
Parser.performSelfAnalysis(this);
}
//caches
$.freestyleText = $.RULE("freestyleText", () => {
let children = [];
$.AT_LEAST_ONE(() => $.OR([{
ALT: () => children.push($.CONSUME(lexer.Freestyle))
}, {
ALT: () => children.push($.CONSUME(lexer.UnusedControlChar))
}]));
return {
name: "freestyleText",
children: children
};
});
// very important to call this after all the rules have been defined.
// otherwise the parser may not work correctly as it will lack information
// derived during the self analysis phase.
Parser.performSelfAnalysis(this);
}
$.SUBRULE($.entityList);
$.OPTION(() => {
$.SUBRULE($.exclusion);
});
});
$.RULE('comment', () => {
$.OPTION(() => {
$.CONSUME(t.COMMENT);
});
});
// very important to call this after all the rules have been defined.
// otherwise the parser may not work correctly as it will lack information
// derived during the self analysis phase.
Parser.performSelfAnalysis(this);
}
}
} },
{ ALT: () => {
const scopes = $.OR4([
{ ALT: () => {
$.CONSUME2(OpenParens);
const innerScopes = $.SUBRULE3($.scopes);
$.CONSUME2(CloseParens);
return innerScopes;
} },
{ ALT: () => $.SUBRULE($.scopes) },
]);
return ['@', scopes];
} },
]));
Parser.performSelfAnalysis(this);
}
}
const $ = this
$.RULE("array", () => {
$.CONSUME(LSquare)
$.OPTION(() => {
$.CONSUME(Integer)
$.MANY(() => {
$.CONSUME(Comma)
$.CONSUME2(Integer)
})
})
$.CONSUME(RSquare)
})
Parser.performSelfAnalysis(this)
}
}
super(input, tokens.allTokens)
const $ = this
$.RULE("array", () => {
$.CONSUME(tokens.LSquare)
$.OPTION(() => {
$.CONSUME(tokens.Integer)
$.MANY(() => {
$.CONSUME(tokens.Comma)
$.CONSUME2(tokens.Integer)
})
})
$.CONSUME(tokens.RSquare)
})
Parser.performSelfAnalysis(this)
}
}
this.statement = $.RULE('statement', () => {
return $.OR([
{ALT: () => $.SUBRULE($.return)}
])
})
this.block = $.RULE('block', () => {
const statements = $.MANY(() => {
const statement = $.SUBRULE($.statement)
$.OPTION(() => { $.CONSUME(Semicolon) })
return statement
})
return statements.reduceRight(cons, empty)
})
Parser.performSelfAnalysis(this)
}
}
constructor(input:IToken[]) {
super(input, allTokens)
Parser.performSelfAnalysis(this)
}
constructor(input: IToken[]) {
super(input, ALL_TOKENS, {
outputCst: true,
recoveryEnabled: false
})
Parser.performSelfAnalysis(this)
}
}