Search in sources :

Example 76 with NotNull

use of org.antlr.v4.runtime.misc.NotNull in project antlr4 by tunnelvisionlabs.

the class ATN method nextTokens.

/**
 * Compute the set of valid tokens that can occur starting in state {@code s}.
 *  If {@code ctx} is {@link PredictionContext#EMPTY_LOCAL}, the set of tokens will not include what can follow
 *  the rule surrounding {@code s}. In other words, the set will be
 *  restricted to tokens reachable staying within {@code s}'s rule.
 */
@NotNull
public IntervalSet nextTokens(ATNState s, @NotNull PredictionContext ctx) {
    Args.notNull("ctx", ctx);
    LL1Analyzer anal = new LL1Analyzer(this);
    IntervalSet next = anal.LOOK(s, ctx);
    return next;
}
Also used : IntervalSet(org.antlr.v4.runtime.misc.IntervalSet) NotNull(org.antlr.v4.runtime.misc.NotNull)

Example 77 with NotNull

use of org.antlr.v4.runtime.misc.NotNull in project antlr4 by tunnelvisionlabs.

the class ATN method defineMode.

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);
}
Also used : DFA(org.antlr.v4.runtime.dfa.DFA)

Aggregations

NotNull (org.antlr.v4.runtime.misc.NotNull)40 ATNState (org.antlr.v4.runtime.atn.ATNState)14 IntervalSet (org.antlr.v4.runtime.misc.IntervalSet)14 DFAState (org.antlr.v4.runtime.dfa.DFAState)12 ParseTree (org.antlr.v4.runtime.tree.ParseTree)9 ParserRuleContext (org.antlr.v4.runtime.ParserRuleContext)8 ArrayList (java.util.ArrayList)7 Token (org.antlr.v4.runtime.Token)7 RuleTransition (org.antlr.v4.runtime.atn.RuleTransition)4 DFA (org.antlr.v4.runtime.dfa.DFA)4 TerminalNode (org.antlr.v4.runtime.tree.TerminalNode)4 GrammarAST (org.antlr.v4.tool.ast.GrammarAST)4 QuantifierAST (org.antlr.v4.tool.ast.QuantifierAST)4 List (java.util.List)3 ATN (org.antlr.v4.runtime.atn.ATN)3 BlockEndState (org.antlr.v4.runtime.atn.BlockEndState)3 Transition (org.antlr.v4.runtime.atn.Transition)3 WildcardTransition (org.antlr.v4.runtime.atn.WildcardTransition)3 Interval (org.antlr.v4.runtime.misc.Interval)3 Nullable (org.antlr.v4.runtime.misc.Nullable)3