/** Used for debugging in adaptivePredict around execATN but I cut * it out for clarity now that alg. works well. We can leave this * "dead" code for a bit. */ public void dumpDeadEndConfigs(NoViableAltException nvae) { System.err.println("dead end configs: "); for (ATNConfig c : nvae.getDeadEndConfigs()) { String trans = "no edges"; if ( c.state.getNumberOfTransitions()>0 ) { Transition t = c.state.transition(0); if ( t instanceof AtomTransition) { AtomTransition at = (AtomTransition)t; trans = "Atom "+getTokenName(at.label); } else if ( t instanceof SetTransition ) { SetTransition st = (SetTransition)t; boolean not = st instanceof NotSetTransition; trans = (not?"~":"")+"Set "+st.set.toString(); } } System.err.println(c.toString(parser, true)+":"+trans); } }
/** Used for debugging in adaptivePredict around execATN but I cut * it out for clarity now that alg. works well. We can leave this * "dead" code for a bit. */ public void dumpDeadEndConfigs(NoViableAltException nvae) { System.err.println("dead end configs: "); for (ATNConfig c : nvae.getDeadEndConfigs()) { String trans = "no edges"; if ( c.state.getNumberOfTransitions()>0 ) { Transition t = c.state.transition(0); if ( t instanceof AtomTransition) { AtomTransition at = (AtomTransition)t; trans = "Atom "+getTokenName(at.label); } else if ( t instanceof SetTransition ) { SetTransition st = (SetTransition)t; boolean not = st instanceof NotSetTransition; trans = (not?"~":"")+"Set "+st.set.toString(); } } System.err.println(c.toString(parser, true)+":"+trans); } }
/** Used for debugging in adaptivePredict around execATN but I cut * it out for clarity now that alg. works well. We can leave this * "dead" code for a bit. */ public void dumpDeadEndConfigs(NoViableAltException nvae) { System.err.println("dead end configs: "); for (ATNConfig c : nvae.getDeadEndConfigs()) { String trans = "no edges"; if ( c.state.getNumberOfTransitions()>0 ) { Transition t = c.state.transition(0); if ( t instanceof AtomTransition) { AtomTransition at = (AtomTransition)t; trans = "Atom "+getTokenName(at.label); } else if ( t instanceof SetTransition ) { SetTransition st = (SetTransition)t; boolean not = st instanceof NotSetTransition; trans = (not?"~":"")+"Set "+st.set.toString(); } } System.err.println(c.toString(parser, true)+":"+trans); } }
/** Used for debugging in adaptivePredict around execATN but I cut * it out for clarity now that alg. works well. We can leave this * "dead" code for a bit. */ public void dumpDeadEndConfigs(NoViableAltException nvae) { System.err.println("dead end configs: "); for (ATNConfig c : nvae.getDeadEndConfigs()) { String trans = "no edges"; if ( c.state.getNumberOfTransitions()>0 ) { Transition t = c.state.transition(0); if ( t instanceof AtomTransition) { AtomTransition at = (AtomTransition)t; trans = "Atom "+getTokenName(at.label); } else if ( t instanceof SetTransition ) { SetTransition st = (SetTransition)t; boolean not = st instanceof NotSetTransition; trans = (not?"~":"")+"Set "+st.set.toString(); } } System.err.println(c.toString(parser, true)+":"+trans); } }
public void dumpDeadEndConfigs(@NotNull NoViableAltException nvae) { System.err.println("dead end configs: "); for (ATNConfig c : nvae.getDeadEndConfigs()) { String trans = "no edges"; if ( c.getState().getNumberOfOptimizedTransitions()>0 ) { Transition t = c.getState().getOptimizedTransition(0); if ( t instanceof AtomTransition) { AtomTransition at = (AtomTransition)t; trans = "Atom "+getTokenName(at.label); } else if ( t instanceof SetTransition ) { SetTransition st = (SetTransition)t; boolean not = st instanceof NotSetTransition; trans = (not?"~":"")+"Set "+st.set.toString(); } } System.err.println(c.toString(parser, true)+":"+trans); } }