How to use the antlr4/index.PredictionContextCache 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 cancerberoSgx / univac / univac / src / grammar / r / RLexer.js View on Github external
function RLexer(input) {
	antlr4.Lexer.call(this, input);
    this._interp = new antlr4.atn.LexerATNSimulator(this, atn, decisionsToDFA, new antlr4.PredictionContextCache());
    return this;
}
github merklejerk / solpp / src / antlr / ExprParser.js View on Github external
"\u0002\u0002\u0083\u0085\u0007\u0017\u0002\u0002\u0084\u0083\u0003\u0002",
    "\u0002\u0002\u0084\u0085\u0003\u0002\u0002\u0002\u0085\u0086\u0003\u0002",
    "\u0002\u0002\u0086\u0087\u0007\u0012\u0002\u0002\u0087\u0089\u0005\u0004",
    "\u0003\u0002\u0088}\u0003\u0002\u0002\u0002\u0088\u0084\u0003\u0002",
    "\u0002\u0002\u0089\u0015\u0003\u0002\u0002\u0002\u008a\u008d\u0007\u0017",
    "\u0002\u0002\u008b\u008c\u0007\u0010\u0002\u0002\u008c\u008e\u0005\u0016",
    "\f\u0002\u008d\u008b\u0003\u0002\u0002\u0002\u008d\u008e\u0003\u0002",
    "\u0002\u0002\u008e\u0017\u0003\u0002\u0002\u0002\r5Y\\^eqv{\u0084\u0088",
    "\u008d"].join("");


var atn = new antlr4.atn.ATNDeserializer().deserialize(serializedATN);

var decisionsToDFA = atn.decisionToState.map( function(ds, index) { return new antlr4.dfa.DFA(ds, index); });

var sharedContextCache = new antlr4.PredictionContextCache();

var literalNames = [ null, null, null, null, null, null, null, null, null, 
                     null, "'('", "')'", "'['", "']'", "','", "'.'", "'=>'", 
                     null, "'defined'", "'peek'", null, null, "'+'", "'-'", 
                     "'*'", "'/'", "'%'", "'!'", "'**'", "'~'", null, null, 
                     "'?'", "':'" ];

var symbolicNames = [ null, "BLOCK_COMMENT", "LINE_COMMENT", "WS", "STRING_LITERAL", 
                      "FSTRING_LITERAL", "OCTAL_LITERAL", "HEX_LITERAL", 
                      "BINARY_LITERAL", "DECIMAL_LITERAL", "LPAREN", "RPAREN", 
                      "LBRACKET", "RBRACKET", "COMMA", "DOT", "LAMBDA_ARROW", 
                      "BOOLEAN_LITERAL", "DEFINED_KW", "PEEK_KW", "UNIT_KW", 
                      "IDENTIFIER", "ADD_OP", "SUB_OP", "MUL_OP", "DIV_OP", 
                      "MOD_OP", "NOT_OP", "POW_OP", "BITWISE_INVERT_OP", 
                      "BITWISE_OP", "LOGICAL_OP", "TERNARY_OP", "TERNARY_SEPARATOR" ];
github stencila / mini / parser / MiniLexer.js View on Github external
function MiniLexer(input) {
	antlr4.Lexer.call(this, input);
    this._interp = new antlr4.atn.LexerATNSimulator(this, atn, decisionsToDFA, new antlr4.PredictionContextCache());
    return this;
}
github stencila / mini / parser / MiniLexer.js View on Github external
function MiniLexer(input) {
	antlr4.Lexer.call(this, input);
    this._interp = new antlr4.atn.LexerATNSimulator(this, atn, decisionsToDFA, new antlr4.PredictionContextCache());
    return this;
}
github cancerberoSgx / univac / univac / src / grammar / abnf / AbnfParser.js View on Github external
"B\u000f\u0003\u0002\u0002\u0002CJ\u0007\f\u0002\u0002DJ\u0005\u0012",
    "\n\u0002EJ\u0005\u0014\u000b\u0002FJ\u0007\u0010\u0002\u0002GJ\u0007",
    "\n\u0002\u0002HJ\u0007\u000b\u0002\u0002IC\u0003\u0002\u0002\u0002I",
    "D\u0003\u0002\u0002\u0002IE\u0003\u0002\u0002\u0002IF\u0003\u0002\u0002",
    "\u0002IG\u0003\u0002\u0002\u0002IH\u0003\u0002\u0002\u0002J\u0011\u0003",
    "\u0002\u0002\u0002KL\u0007\u0006\u0002\u0002LM\u0005\b\u0005\u0002M",
    "N\u0007\u0007\u0002\u0002N\u0013\u0003\u0002\u0002\u0002OP\u0007\b\u0002",
    "\u0002PQ\u0005\b\u0005\u0002QR\u0007\t\u0002\u0002R\u0015\u0003\u0002",
    "\u0002\u0002\u000b\u0019!,25;?AI"].join("");


var atn = new antlr4.atn.ATNDeserializer().deserialize(serializedATN);

var decisionsToDFA = atn.decisionToState.map( function(ds, index) { return new antlr4.dfa.DFA(ds, index); });

var sharedContextCache = new antlr4.PredictionContextCache();

var literalNames = [ null, "'='", "'/'", "'*'", "'('", "')'", "'['", "']'" ];

var symbolicNames = [ null, null, null, null, null, null, null, null, "NumberValue", 
                      "ProseValue", "ID", "INT", "COMMENT", "WS", "STRING" ];

var ruleNames =  [ "rulelist", "rule_", "elements", "alternation", "concatenation", 
                   "repetition", "repeat", "element", "group", "option" ];

function AbnfParser (input) {
	antlr4.Parser.call(this, input);
    this._interp = new antlr4.atn.ParserATNSimulator(this, atn, decisionsToDFA, sharedContextCache);
    this.ruleNames = ruleNames;
    this.literalNames = literalNames;
    this.symbolicNames = symbolicNames;
    return this;
github cancerberoSgx / univac / univac / src / grammar / python3 / Python3Lexer.js View on Github external
function Python3Lexer(input) {
	antlr4.Lexer.call(this, input);
    this._interp = new antlr4.atn.LexerATNSimulator(this, atn, decisionsToDFA, new antlr4.PredictionContextCache());
    return this;
}
github cancerberoSgx / univac / univac / src / grammar / sexpression / sexpressionLexer.js View on Github external
function sexpressionLexer(input) {
	antlr4.Lexer.call(this, input);
    this._interp = new antlr4.atn.LexerATNSimulator(this, atn, decisionsToDFA, new antlr4.PredictionContextCache());
    return this;
}
github stencila / mini / parser / MiniParser.js View on Github external
"\u0007\u0019\u0002\u0002\u00d0\u00d1\u0007\u001e\u0002\u0002\u00d1\u00d2",
    "\u0007\u001b\u0002\u0002\u00d2\u00d4\u0005\u0006\u0004\u0002\u00d3\u00cf",
    "\u0003\u0002\u0002\u0002\u00d4\u00d7\u0003\u0002\u0002\u0002\u00d5\u00d3",
    "\u0003\u0002\u0002\u0002\u00d5\u00d6\u0003\u0002\u0002\u0002\u00d6\u00d9",
    "\u0003\u0002\u0002\u0002\u00d7\u00d5\u0003\u0002\u0002\u0002\u00d8\u00cc",
    "\u0003\u0002\u0002\u0002\u00d8\u00d9\u0003\u0002\u0002\u0002\u00d9\u00da",
    "\u0003\u0002\u0002\u0002\u00da\u00db\u0007\u001c\u0002\u0002\u00db\u00dc",
    "\b\u000e\u0001\u0002\u00dc\u001b\u0003\u0002\u0002\u0002\u0012&H|~\u008a",
    "\u0090\u0097\u009f\u00a9\u00ae\u00b2\u00b8\u00bc\u00c6\u00d5\u00d8"].join("");


var atn = new antlr4.atn.ATNDeserializer().deserialize(serializedATN);

var decisionsToDFA = atn.decisionToState.map( function(ds, index) { return new antlr4.dfa.DFA(ds, index); });

var sharedContextCache = new antlr4.PredictionContextCache();

var literalNames = [ null, "'.'", "'['", "']'", "'!'", "'+'", "'-'", "'^'", 
                     "'*'", "'/'", "'%'", "'<'", "'<='", "'>'", "'>='", 
                     "'=='", "'!='", "'&&'", "'||'", "'|'", "'('", "')'", 
                     "'()'", "','", "'{'", "':'", "'}'", null, null, null, 
                     null, null, "'='" ];

var symbolicNames = [ null, null, null, null, null, null, null, null, null, 
                      null, null, null, null, null, null, null, null, null, 
                      null, null, null, null, null, null, null, null, null, 
                      "BOOLEAN", "ID", "INT", "FLOAT", "STRING", "EQ", "WS" ];

var ruleNames =  [ "mini", "mainExpr", "expr", "function_call", "number", 
                   "seq", "id_seq", "call_arguments", "positional_arguments", 
                   "named_arguments", "named_argument", "array", "object" ];
github cancerberoSgx / univac / univac / src / grammar / wat / WatLexer.js View on Github external
function WatLexer(input) {
	antlr4.Lexer.call(this, input);
    this._interp = new antlr4.atn.LexerATNSimulator(this, atn, decisionsToDFA, new antlr4.PredictionContextCache());
    return this;
}
github cancerberoSgx / univac / univac / src / grammar / dart2 / Dart2Lexer.js View on Github external
function Dart2Lexer(input) {
	antlr4.Lexer.call(this, input);
    this._interp = new antlr4.atn.LexerATNSimulator(this, atn, decisionsToDFA, new antlr4.PredictionContextCache());
    return this;
}