@Override public ATNState newState() { return newState(null); }
@NotNull @Override public ATNState newState() { return newState(null); }
/** Build what amounts to an epsilon transition with an action. * The action goes into ATN though it is ignored during prediction * if {@link ActionTransition#actionIndex actionIndex}{@code <0}. */ @Override public Handle action(ActionAST action) { //System.out.println("action: "+action); ATNState left = newState(action); ATNState right = newState(action); ActionTransition a = new ActionTransition(right, currentRule.index); left.addTransition(a); action.atnState = left; return new Handle(left, right); }
/** Build what amounts to an epsilon transition with an action. * The action goes into ATN though it is ignored during prediction * if {@link ActionTransition#actionIndex actionIndex}{@code <0}. */ @Override public Handle action(ActionAST action) { //System.out.println("action: "+action); ATNState left = newState(action); ATNState right = newState(action); ActionTransition a = new ActionTransition(right, currentRule.index); left.addTransition(a); action.atnState = left; return new Handle(left, right); }
/** Build what amounts to an epsilon transition with an action. * The action goes into ATN though it is ignored during prediction * if {@link ActionTransition#actionIndex actionIndex}{@code <0}. */ @Override public Handle action(ActionAST action) { //System.out.println("action: "+action); ATNState left = newState(action); ATNState right = newState(action); ActionTransition a = new ActionTransition(right, currentRule.index); left.addTransition(a); action.atnState = left; return new Handle(left, right); }
/** From label {@code A} build graph {@code o-A->o}. */ @Override public Handle tokenRef(TerminalAST node) { ATNState left = newState(node); ATNState right = newState(node); int ttype = g.getTokenType(node.getText()); left.addTransition(new AtomTransition(right, ttype)); node.atnState = left; return new Handle(left, right); }
/** From label {@code A} build graph {@code o-A->o}. */ @Override public Handle tokenRef(TerminalAST node) { ATNState left = newState(node); ATNState right = newState(node); int ttype = g.getTokenType(node.getText()); left.addTransition(new AtomTransition(right, ttype)); node.atnState = left; return new Handle(left, right); }
/** Build an atom with all possible values in its label. */ @NotNull @Override public Handle wildcard(@NotNull GrammarAST node) { ATNState left = newState(node); ATNState right = newState(node); left.addTransition(new WildcardTransition(right)); node.atnState = left; return new Handle(left, right); }
/** From label {@code A} build graph {@code o-A->o}. */ @Override public Handle tokenRef(TerminalAST node) { ATNState left = newState(node); ATNState right = newState(node); int ttype = g.getTokenType(node.getText()); left.addTransition(new AtomTransition(right, ttype)); node.atnState = left; return new Handle(left, right); }
/** From label {@code A} build graph {@code o-A->o}. */ @Override public Handle tokenRef(TerminalAST node) { ATNState left = newState(node); ATNState right = newState(node); int ttype = g.getTokenType(node.getText()); left.addTransition(new AtomTransition(right, ttype)); node.atnState = left; return new Handle(left, right); }
/** From label {@code A} build graph {@code o-A->o}. */ @NotNull @Override public Handle tokenRef(@NotNull TerminalAST node) { ATNState left = newState(node); ATNState right = newState(node); int ttype = g.getTokenType(node.getText()); left.addTransition(new AtomTransition(right, ttype)); node.atnState = left; return new Handle(left, right); }