How to use the antlr4/index.ParserRuleContext function in antlr4

To help you get started, we’ve selected a few antlr4 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github merklejerk / solpp / src / antlr / ExprParser.js View on Github external
function LambdaExpressionContext(parser, parent, invokingState) {
	if(parent===undefined) {
	    parent = null;
	}
	if(invokingState===undefined || invokingState===null) {
		invokingState = -1;
	}
	antlr4.ParserRuleContext.call(this, parent, invokingState);
    this.parser = parser;
    this.ruleIndex = ExprParser.RULE_lambdaExpression;
    this.args = null; // IdListContext
    this.body = null; // ExpressionContext
    this.arg = null; // Token
    return this;
}
github merklejerk / solpp / src / antlr / ExprParser.js View on Github external
parent = null;
	}
	if(invokingState===undefined || invokingState===null) {
		invokingState = -1;
	}
	antlr4.ParserRuleContext.call(this, parent, invokingState);
    this.parser = parser;
    this.ruleIndex = ExprParser.RULE_literal;
    this.str = null; // StringLiteralContext
    this.fstr = null; // FstringLiteralContext
    this.num = null; // NumberLiteralContext
    this.bool = null; // BooleanLiteralContext
    return this;
}

LiteralContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);
LiteralContext.prototype.constructor = LiteralContext;

LiteralContext.prototype.stringLiteral = function() {
    return this.getTypedRuleContext(StringLiteralContext,0);
};

LiteralContext.prototype.fstringLiteral = function() {
    return this.getTypedRuleContext(FstringLiteralContext,0);
};

LiteralContext.prototype.numberLiteral = function() {
    return this.getTypedRuleContext(NumberLiteralContext,0);
};

LiteralContext.prototype.booleanLiteral = function() {
    return this.getTypedRuleContext(BooleanLiteralContext,0);
github maiermic / antlr4-ace-ext / parser / TokenWithLineFeed / TokenWithLineFeedParser.js View on Github external
function StartContext(parser, parent, invokingState) {
	if(parent===undefined) {
	    parent = null;
	}
	if(invokingState===undefined || invokingState===null) {
		invokingState = -1;
	}
	antlr4.ParserRuleContext.call(this, parent, invokingState);
    this.parser = parser;
    this.ruleIndex = TokenWithLineFeedParser.RULE_start;
    return this;
}
github cancerberoSgx / univac / univac / src / grammar / sexpression / sexpressionParser.js View on Github external
function ListContext(parser, parent, invokingState) {
	if(parent===undefined) {
	    parent = null;
	}
	if(invokingState===undefined || invokingState===null) {
		invokingState = -1;
	}
	antlr4.ParserRuleContext.call(this, parent, invokingState);
    this.parser = parser;
    this.ruleIndex = sexpressionParser.RULE_list;
    return this;
}

ListContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);
ListContext.prototype.constructor = ListContext;

ListContext.prototype.LPAREN = function() {
    return this.getToken(sexpressionParser.LPAREN, 0);
};

ListContext.prototype.RPAREN = function() {
    return this.getToken(sexpressionParser.RPAREN, 0);
};

ListContext.prototype.item = function(i) {
    if(i===undefined) {
        i = null;
    }
    if(i===null) {
        return this.getTypedRuleContexts(ItemContext);
github cancerberoSgx / univac / univac / src / grammar / r / RParser.js View on Github external
function FormContext(parser, parent, invokingState) {
	if(parent===undefined) {
	    parent = null;
	}
	if(invokingState===undefined || invokingState===null) {
		invokingState = -1;
	}
	antlr4.ParserRuleContext.call(this, parent, invokingState);
    this.parser = parser;
    this.ruleIndex = RParser.RULE_form;
    return this;
}

FormContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);
FormContext.prototype.constructor = FormContext;

FormContext.prototype.ID = function() {
    return this.getToken(RParser.ID, 0);
};

FormContext.prototype.expr = function() {
    return this.getTypedRuleContext(ExprContext,0);
};

FormContext.prototype.enterRule = function(listener) {
    if(listener instanceof RListener ) {
        listener.enterForm(this);
	}
};
github merklejerk / solpp / src / antlr / SolParser.js View on Github external
};

function EndifDirectiveContext(parser, parent, invokingState) {
	if(parent===undefined) {
	    parent = null;
	}
	if(invokingState===undefined || invokingState===null) {
		invokingState = -1;
	}
	antlr4.ParserRuleContext.call(this, parent, invokingState);
    this.parser = parser;
    this.ruleIndex = SolParser.RULE_endifDirective;
    return this;
}

EndifDirectiveContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);
EndifDirectiveContext.prototype.constructor = EndifDirectiveContext;

EndifDirectiveContext.prototype.ENDIF_KW = function() {
    return this.getToken(SolParser.ENDIF_KW, 0);
};

EndifDirectiveContext.prototype.endDirective = function() {
    return this.getTypedRuleContext(EndDirectiveContext,0);
};

EndifDirectiveContext.prototype.enterRule = function(listener) {
    if(listener instanceof SolParserListener ) {
        listener.enterEndifDirective(this);
	}
};
github ShibaJS / Shiba / React / src / parser / ShibaParser.js View on Github external
ShibaParser.RULE_identifier = 8;

function ViewContext(parser, parent, invokingState) {
	if(parent===undefined) {
	    parent = null;
	}
	if(invokingState===undefined || invokingState===null) {
		invokingState = -1;
	}
	antlr4.ParserRuleContext.call(this, parent, invokingState);
    this.parser = parser;
    this.ruleIndex = ShibaParser.RULE_view;
    return this;
}

ViewContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);
ViewContext.prototype.constructor = ViewContext;

ViewContext.prototype.identifier = function() {
    return this.getTypedRuleContext(IdentifierContext,0);
};

ViewContext.prototype.LeftBrace = function() {
    return this.getToken(ShibaParser.LeftBrace, 0);
};

ViewContext.prototype.RightBrace = function() {
    return this.getToken(ShibaParser.RightBrace, 0);
};

ViewContext.prototype.Arrow = function() {
    return this.getToken(ShibaParser.Arrow, 0);
github quantastica / quantum-circuit / lib / qasm_import / QASMParser.js View on Github external
};

function GoplistContext(parser, parent, invokingState) {
	if(parent===undefined) {
	    parent = null;
	}
	if(invokingState===undefined || invokingState===null) {
		invokingState = -1;
	}
	antlr4.ParserRuleContext.call(this, parent, invokingState);
    this.parser = parser;
    this.ruleIndex = QASMParser.RULE_goplist;
    return this;
}

GoplistContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);
GoplistContext.prototype.constructor = GoplistContext;

GoplistContext.prototype.uop = function(i) {
    if(i===undefined) {
        i = null;
    }
    if(i===null) {
        return this.getTypedRuleContexts(UopContext);
    } else {
        return this.getTypedRuleContext(UopContext,i);
    }
};

GoplistContext.prototype.idlist = function(i) {
    if(i===undefined) {
        i = null;
github cancerberoSgx / univac / univac / src / grammar / less / LessParser.js View on Github external
function PseudoContext(parser, parent, invokingState) {
	if(parent===undefined) {
	    parent = null;
	}
	if(invokingState===undefined || invokingState===null) {
		invokingState = -1;
	}
	antlr4.ParserRuleContext.call(this, parent, invokingState);
    this.parser = parser;
    this.ruleIndex = LessParser.RULE_pseudo;
    return this;
}

PseudoContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);
PseudoContext.prototype.constructor = PseudoContext;

PseudoContext.prototype.Identifier = function() {
    return this.getToken(LessParser.Identifier, 0);
};

PseudoContext.prototype.COLON = function() {
    return this.getToken(LessParser.COLON, 0);
};

PseudoContext.prototype.COLONCOLON = function() {
    return this.getToken(LessParser.COLONCOLON, 0);
};

PseudoContext.prototype.enterRule = function(listener) {
    if(listener instanceof LessParserListener ) {
github microsoft / botbuilder-tools / packages / Ludown / lib / generated / LUFileParser.js View on Github external
function NormalIntentBodyContext(parser, parent, invokingState) {
	if(parent===undefined) {
	    parent = null;
	}
	if(invokingState===undefined || invokingState===null) {
		invokingState = -1;
	}
	antlr4.ParserRuleContext.call(this, parent, invokingState);
    this.parser = parser;
    this.ruleIndex = LUFileParser.RULE_normalIntentBody;
    return this;
}