use of org.antlr.v4.runtime.misc.NotNull in project antlr4 by tunnelvisionlabs.
the class LexerATNSimulator method match.
public int match(@NotNull CharStream input, int mode) {
match_calls++;
this.mode = mode;
int mark = input.mark();
try {
this.startIndex = input.index();
this.prevAccept.reset();
DFAState s0 = atn.modeToDFA[mode].s0.get();
if (s0 == null) {
return matchATN(input);
} else {
return execATN(input, s0);
}
} finally {
input.release(mark);
}
}
use of org.antlr.v4.runtime.misc.NotNull in project antlr4 by tunnelvisionlabs.
the class ATN method defineDecisionState.
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;
}
use of org.antlr.v4.runtime.misc.NotNull in project sqldelight by square.
the class AntlrParser method parse.
@NotNull
@Override
public ASTNode parse(IElementType root, PsiBuilder builder) {
TParser parser = createParser(root, builder);
ParseTree parseTree = parse(parser, root, builder);
AstBuilderListener listener = createListener(parser, root, builder);
walkParseTree(parseTree, listener, root, builder);
return builder.getTreeBuilt();
}
use of org.antlr.v4.runtime.misc.NotNull in project scheduler by btrplace.
the class MyCstrSpecVisitor method visitCstrCall.
@Override
public ConstraintCall visitCstrCall(@NotNull CstrSpecParser.CstrCallContext ctx) {
List<Term> ps = ctx.call().term().stream().map(t -> (Term<?>) visit(t)).collect(Collectors.toList());
Function f = resolveFunction(ctx.call().ID().getSymbol(), ps);
return new ConstraintCall(f, ps);
}
use of org.antlr.v4.runtime.misc.NotNull in project redsnake by Taken0711.
the class TestUtils method parseStatement.
public static Statement parseStatement(@NotNull String s) {
CharStream inputStream = CharStreams.fromString(s);
RedsnakeLexer redsnakeLexer = new RedsnakeLexer(inputStream);
TokenStream commonTokenStream = new CommonTokenStream(redsnakeLexer);
RedsnakeParser parser = new RedsnakeParser(commonTokenStream);
ParseTree t = parser.expression();
return (Expression) new ASTBuilder().visit(t);
}
Aggregations