/** Walk all accept states and find the manually-specified synpreds. * Gated preds are not always hoisted * I used to do this in the code generator, but that is too late. * This converter tries to avoid computing DFA for decisions in * syntactic predicates that are not ever used such as those * created by autobacktrack mode. */ public void findAllGatedSynPredsUsedInDFAAcceptStates() { int nAlts = getNumberOfAlts(); for (int i=1; i<=nAlts; i++) { DFAState a = getAcceptState(i); //System.out.println("alt "+i+": "+a); if ( a!=null ) { Set synpreds = a.getGatedSyntacticPredicatesInNFAConfigurations(); if ( synpreds!=null ) { // add all the predicates we find (should be just one, right?) for (Iterator it = synpreds.iterator(); it.hasNext();) { SemanticContext semctx = (SemanticContext) it.next(); // System.out.println("synpreds: "+semctx); nfa.grammar.synPredUsedInDFA(this, semctx); } } } } }
/** Walk all accept states and find the manually-specified synpreds. * Gated preds are not always hoisted * I used to do this in the code generator, but that is too late. * This converter tries to avoid computing DFA for decisions in * syntactic predicates that are not ever used such as those * created by autobacktrack mode. */ public void findAllGatedSynPredsUsedInDFAAcceptStates() { int nAlts = getNumberOfAlts(); for (int i=1; i<=nAlts; i++) { DFAState a = getAcceptState(i); //System.out.println("alt "+i+": "+a); if ( a!=null ) { Set synpreds = a.getGatedSyntacticPredicatesInNFAConfigurations(); if ( synpreds!=null ) { // add all the predicates we find (should be just one, right?) for (Iterator it = synpreds.iterator(); it.hasNext();) { SemanticContext semctx = (SemanticContext) it.next(); // System.out.println("synpreds: "+semctx); nfa.grammar.synPredUsedInDFA(this, semctx); } } } } }
/** Walk all accept states and find the manually-specified synpreds. * Gated preds are not always hoisted * I used to do this in the code generator, but that is too late. * This converter tries to avoid computing DFA for decisions in * syntactic predicates that are not ever used such as those * created by autobacktrack mode. */ public void findAllGatedSynPredsUsedInDFAAcceptStates() { int nAlts = getNumberOfAlts(); for (int i=1; i<=nAlts; i++) { DFAState a = getAcceptState(i); //System.out.println("alt "+i+": "+a); if ( a!=null ) { Set<? extends SemanticContext> synpreds = a.getGatedSyntacticPredicatesInNFAConfigurations(); if ( synpreds!=null ) { // add all the predicates we find (should be just one, right?) for (SemanticContext semctx : synpreds) { // System.out.println("synpreds: "+semctx); nfa.grammar.synPredUsedInDFA(this, semctx); } } } } }
/** Walk all accept states and find the manually-specified synpreds. * Gated preds are not always hoisted * I used to do this in the code generator, but that is too late. * This converter tries to avoid computing DFA for decisions in * syntactic predicates that are not ever used such as those * created by autobacktrack mode. */ public void findAllGatedSynPredsUsedInDFAAcceptStates() { int nAlts = getNumberOfAlts(); for (int i=1; i<=nAlts; i++) { DFAState a = getAcceptState(i); //System.out.println("alt "+i+": "+a); if ( a!=null ) { Set<? extends SemanticContext> synpreds = a.getGatedSyntacticPredicatesInNFAConfigurations(); if ( synpreds!=null ) { // add all the predicates we find (should be just one, right?) for (SemanticContext semctx : synpreds) { // System.out.println("synpreds: "+semctx); nfa.grammar.synPredUsedInDFA(this, semctx); } } } } }
DFAState predDFATarget = d.dfa.getAcceptState(c.alt); if ( predDFATarget==null ) {
DFAState predDFATarget = d.dfa.getAcceptState(c.alt); if ( predDFATarget==null ) {
DFAState predDFATarget = d.dfa.getAcceptState(c.alt); if ( predDFATarget==null ) {
DFAState predDFATarget = d.dfa.getAcceptState(c.alt); if ( predDFATarget==null ) {
DFAState acceptStateForAlt = dfa.getAcceptState(alt); if ( acceptStateForAlt!=null ) {
DFAState acceptStateForAlt = dfa.getAcceptState(alt); if ( acceptStateForAlt!=null ) {
DFAState acceptStateForAlt = dfa.getAcceptState(alt); if ( acceptStateForAlt!=null ) {
DFAState acceptStateForAlt = dfa.getAcceptState(alt); if ( acceptStateForAlt!=null ) {