Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
explore(ctx, indentation) {
let ruleName = ctx.parser.ruleNames[ctx.ruleIndex];
console.log(' '.repeat(indentation + 1) + ruleName + ' ' + ctx.getText());
for (let i = 0; i < ctx.getChildCount(); i++) {
let element = ctx.getChild(i);
if (element instanceof antlr4.ParserRuleContext) {
this.explore(element, indentation + 1);
} else {
console.log(' '.repeat(indentation + 2) + element.constructor.name + ' ' + element.getText());
}
}
}
listener.enterRoot(this);
}
}
exitRule(listener) {
if(listener instanceof PolicyListener ) {
listener.exitRoot(this);
}
}
}
class ExpressionContext extends antlr4.ParserRuleContext {
constructor(parser, parent, invokingState) {
if(parent===undefined) {
parent = null;
}
if(invokingState===undefined || invokingState===null) {
invokingState = -1;
}
super(parent, invokingState);
this.parser = parser;
this.ruleIndex = PolicyParser.RULE_expression;
}
copyFrom(ctx) {
listener.enterBooleanAndExpression(this);
}
}
exitRule(listener) {
if(listener instanceof PolicyListener ) {
listener.exitBooleanAndExpression(this);
}
}
}
PolicyParser.BooleanAndExpressionContext = BooleanAndExpressionContext;
class Count_expressionContext extends antlr4.ParserRuleContext {
constructor(parser, parent, invokingState) {
if(parent===undefined) {
parent = null;
}
if(invokingState===undefined || invokingState===null) {
invokingState = -1;
}
super(parent, invokingState);
this.parser = parser;
this.ruleIndex = PolicyParser.RULE_count_expression;
}
COUNT() {
return this.getToken(PolicyParser.COUNT, 0);
};
PolicyParser.COUNT = 2;
PolicyParser.INTLIT = 3;
PolicyParser.AND = 4;
PolicyParser.OR = 5;
PolicyParser.GREATER_THAN = 6;
PolicyParser.LESS_THAN = 7;
PolicyParser.EQUAL = 8;
PolicyParser.GREATER_THAN_EQUAL = 9;
PolicyParser.LESS_THAN_EQUAL = 10;
PolicyParser.ID = 11;
PolicyParser.RULE_root = 0;
PolicyParser.RULE_expression = 1;
PolicyParser.RULE_count_expression = 2;
class RootContext extends antlr4.ParserRuleContext {
constructor(parser, parent, invokingState) {
if(parent===undefined) {
parent = null;
}
if(invokingState===undefined || invokingState===null) {
invokingState = -1;
}
super(parent, invokingState);
this.parser = parser;
this.ruleIndex = PolicyParser.RULE_root;
}
expression() {
return this.getTypedRuleContext(ExpressionContext,0);
};