@Override public void clearDFA() { for (int d = 0; d < decisionToDFA.length; d++) { decisionToDFA[d] = new DFA(atn.getDecisionState(d), d); } }
@Override public void clearDFA() { for (int d = 0; d < decisionToDFA.length; d++) { decisionToDFA[d] = new DFA(atn.getDecisionState(d), d); } }
public LexerInterpreter(String grammarFileName, Vocabulary vocabulary, Collection<String> ruleNames, Collection<String> channelNames, Collection<String> modeNames, ATN atn, CharStream input) { super(input); if (atn.grammarType != ATNType.LEXER) { throw new IllegalArgumentException("The ATN must be a lexer ATN."); } this.grammarFileName = grammarFileName; this.atn = atn; this.tokenNames = new String[atn.maxTokenType]; for (int i = 0; i < tokenNames.length; i++) { tokenNames[i] = vocabulary.getDisplayName(i); } this.ruleNames = ruleNames.toArray(new String[ruleNames.size()]); this.channelNames = channelNames.toArray(new String[channelNames.size()]); this.modeNames = modeNames.toArray(new String[modeNames.size()]); this.vocabulary = vocabulary; this._decisionToDFA = new DFA[atn.getNumberOfDecisions()]; for (int i = 0; i < _decisionToDFA.length; i++) { _decisionToDFA[i] = new DFA(atn.getDecisionState(i), i); } this._interp = new LexerATNSimulator(this,atn,_decisionToDFA,_sharedContextCache); }
public ParserInterpreter(String grammarFileName, Vocabulary vocabulary, Collection<String> ruleNames, ATN atn, TokenStream input) { super(input); this.grammarFileName = grammarFileName; this.atn = atn; this.tokenNames = new String[atn.maxTokenType]; for (int i = 0; i < tokenNames.length; i++) { tokenNames[i] = vocabulary.getDisplayName(i); } this.ruleNames = ruleNames.toArray(new String[ruleNames.size()]); this.vocabulary = vocabulary; // init decision DFA int numberOfDecisions = atn.getNumberOfDecisions(); this.decisionToDFA = new DFA[numberOfDecisions]; for (int i = 0; i < numberOfDecisions; i++) { DecisionState decisionState = atn.getDecisionState(i); decisionToDFA[i] = new DFA(decisionState, i); } // get atn simulator that knows how to do predictions setInterpreter(new ParserATNSimulator(this, atn, decisionToDFA, sharedContextCache)); }
public final void clearDFA() { decisionToDFA = new DFA[decisionToState.size()]; for (int i = 0; i < decisionToDFA.length; i++) { decisionToDFA[i] = new DFA(decisionToState.get(i), i); } modeToDFA = new DFA[modeToStartState.size()]; for (int i = 0; i < modeToDFA.length; i++) { modeToDFA[i] = new DFA(modeToStartState.get(i)); } contextCache.clear(); LL1Table.clear(); }
@Override public void clearDFA() { for (int d = 0; d < decisionToDFA.length; d++) { decisionToDFA[d] = new DFA(atn.getDecisionState(d), d); } }
@Override public void clearDFA() { for (int d = 0; d < decisionToDFA.length; d++) { decisionToDFA[d] = new DFA(atn.getDecisionState(d), d); } }
@Override public void clearDFA() { for (int d = 0; d < decisionToDFA.length; d++) { decisionToDFA[d] = new DFA(atn.getDecisionState(d), d); } }
@Override public void clearDFA() { for (int d = 0; d < decisionToDFA.length; d++) { decisionToDFA[d] = new DFA(atn.getDecisionState(d), d); } }
@Override public void clearDFA() { for (int d = 0; d < decisionToDFA.length; d++) { decisionToDFA[d] = new DFA(atn.getDecisionState(d), d); } }
public int defineDecisionState(@NotNull DecisionState s) { decisionToState.add(s); s.decision = decisionToState.size()-1; decisionToDFA = Arrays.copyOf(decisionToDFA, decisionToState.size()); decisionToDFA[decisionToDFA.length - 1] = new DFA(s, s.decision); return s.decision; }
@Override public void clearDFA() { for (int d = 0; d < decisionToDFA.length; d++) { decisionToDFA[d] = new DFA(atn.getDecisionState(d), d); } }
public void defineMode(@NotNull String name, @NotNull TokensStartState s) { modeNameToStartState.put(name, s); modeToStartState.add(s); modeToDFA = Arrays.copyOf(modeToDFA, modeToStartState.size()); modeToDFA[modeToDFA.length - 1] = new DFA(s); defineDecisionState(s); }
public LexerInterpreter(String grammarFileName, Vocabulary vocabulary, Collection<String> ruleNames, Collection<String> channelNames, Collection<String> modeNames, ATN atn, CharStream input) { super(input); if (atn.grammarType != ATNType.LEXER) { throw new IllegalArgumentException("The ATN must be a lexer ATN."); } this.grammarFileName = grammarFileName; this.atn = atn; this.tokenNames = new String[atn.maxTokenType]; for (int i = 0; i < tokenNames.length; i++) { tokenNames[i] = vocabulary.getDisplayName(i); } this.ruleNames = ruleNames.toArray(new String[ruleNames.size()]); this.channelNames = channelNames.toArray(new String[channelNames.size()]); this.modeNames = modeNames.toArray(new String[modeNames.size()]); this.vocabulary = vocabulary; this._decisionToDFA = new DFA[atn.getNumberOfDecisions()]; for (int i = 0; i < _decisionToDFA.length; i++) { _decisionToDFA[i] = new DFA(atn.getDecisionState(i), i); } this._interp = new LexerATNSimulator(this,atn,_decisionToDFA,_sharedContextCache); }
public LexerInterpreter(String grammarFileName, Vocabulary vocabulary, Collection<String> ruleNames, Collection<String> modeNames, ATN atn, CharStream input) { super(input); if (atn.grammarType != ATNType.LEXER) { throw new IllegalArgumentException("The ATN must be a lexer ATN."); } this.grammarFileName = grammarFileName; this.atn = atn; this.tokenNames = new String[atn.maxTokenType]; for (int i = 0; i < tokenNames.length; i++) { tokenNames[i] = vocabulary.getDisplayName(i); } this.ruleNames = ruleNames.toArray(new String[ruleNames.size()]); this.modeNames = modeNames.toArray(new String[modeNames.size()]); this.vocabulary = vocabulary; this._decisionToDFA = new DFA[atn.getNumberOfDecisions()]; for (int i = 0; i < _decisionToDFA.length; i++) { _decisionToDFA[i] = new DFA(atn.getDecisionState(i), i); } this._interp = new LexerATNSimulator(this,atn,_decisionToDFA,_sharedContextCache); }
public LexerInterpreter(String grammarFileName, Vocabulary vocabulary, Collection<String> ruleNames, Collection<String> modeNames, ATN atn, CharStream input) { super(input); if (atn.grammarType != ATNType.LEXER) { throw new IllegalArgumentException("The ATN must be a lexer ATN."); } this.grammarFileName = grammarFileName; this.atn = atn; this.tokenNames = new String[atn.maxTokenType]; for (int i = 0; i < tokenNames.length; i++) { tokenNames[i] = vocabulary.getDisplayName(i); } this.ruleNames = ruleNames.toArray(new String[ruleNames.size()]); this.modeNames = modeNames.toArray(new String[modeNames.size()]); this.vocabulary = vocabulary; this._decisionToDFA = new DFA[atn.getNumberOfDecisions()]; for (int i = 0; i < _decisionToDFA.length; i++) { _decisionToDFA[i] = new DFA(atn.getDecisionState(i), i); } this._interp = new LexerATNSimulator(this,atn,_decisionToDFA,_sharedContextCache); }
private DFA[] getDFA() { DFA[] result = new DFA[_ATN.getNumberOfDecisions()]; for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { result[i] = new DFA(_ATN.getDecisionState(i), i); } return result; } }
public ParserInterpreter(String grammarFileName, Vocabulary vocabulary, Collection<String> ruleNames, ATN atn, TokenStream input) { super(input); this.grammarFileName = grammarFileName; this.atn = atn; this.tokenNames = new String[atn.maxTokenType]; for (int i = 0; i < tokenNames.length; i++) { tokenNames[i] = vocabulary.getDisplayName(i); } this.ruleNames = ruleNames.toArray(new String[ruleNames.size()]); this.vocabulary = vocabulary; // init decision DFA int numberOfDecisions = atn.getNumberOfDecisions(); this.decisionToDFA = new DFA[numberOfDecisions]; for (int i = 0; i < numberOfDecisions; i++) { DecisionState decisionState = atn.getDecisionState(i); decisionToDFA[i] = new DFA(decisionState, i); } // get atn simulator that knows how to do predictions setInterpreter(new ParserATNSimulator(this, atn, decisionToDFA, sharedContextCache)); }
public ParserInterpreter(String grammarFileName, Vocabulary vocabulary, Collection<String> ruleNames, ATN atn, TokenStream input) { super(input); this.grammarFileName = grammarFileName; this.atn = atn; this.tokenNames = new String[atn.maxTokenType]; for (int i = 0; i < tokenNames.length; i++) { tokenNames[i] = vocabulary.getDisplayName(i); } this.ruleNames = ruleNames.toArray(new String[ruleNames.size()]); this.vocabulary = vocabulary; // init decision DFA int numberOfDecisions = atn.getNumberOfDecisions(); this.decisionToDFA = new DFA[numberOfDecisions]; for (int i = 0; i < numberOfDecisions; i++) { DecisionState decisionState = atn.getDecisionState(i); decisionToDFA[i] = new DFA(decisionState, i); } // get atn simulator that knows how to do predictions setInterpreter(new ParserATNSimulator(this, atn, decisionToDFA, sharedContextCache)); }
decisionToDFA[i] = new DFA(parser.getATN().getDecisionState(i), i);