Package org.antlr.analysis

Examples of org.antlr.analysis.NFAState


      for (Iterator it = disabledAlts.iterator(); it.hasNext();) {
        Integer altI = (Integer) it.next();
        String tokenName =
          probe.getTokenNameForTokensRuleAlt(altI.intValue());
        // reset the line/col to the token definition (pick last one)
        NFAState ruleStart =
          probe.dfa.nfa.grammar.getRuleStartState(tokenName);
        line = ruleStart.associatedASTNode.getLine();
        column = ruleStart.associatedASTNode.getColumn();
        st.setAttribute("disabled", tokenName);
      }
    }
    else {
      st.setAttribute("disabled", probe.getDisabledAlternatives(problemState));
    }

    List nondetAlts = probe.getNonDeterministicAltsForState(problemState);
    NFAState nfaStart = probe.dfa.getNFADecisionStartState();
    // all state paths have to begin with same NFA state
    int firstAlt = 0;
    if ( nondetAlts!=null ) {
      for (Iterator iter = nondetAlts.iterator(); iter.hasNext();) {
        Integer displayAltI = (Integer) iter.next();
        if ( DecisionProbe.verbose ) {
          int tracePathAlt =
            nfaStart.translateDisplayAltToWalkAlt(displayAltI.intValue());
          if ( firstAlt == 0 ) {
            firstAlt = tracePathAlt;
          }
          List path =
            probe.getNFAPathStatesForAlt(firstAlt,
View Full Code Here


      for (int i = 0; i < alts.size(); i++) {
        Integer altI = (Integer) alts.get(i);
        String tokenName =
          probe.getTokenNameForTokensRuleAlt(altI.intValue());
        // reset the line/col to the token definition
        NFAState ruleStart =
          probe.dfa.nfa.grammar.getRuleStartState(tokenName);
        line = ruleStart.associatedASTNode.getLine();
        column = ruleStart.associatedASTNode.getColumn();
        st.setAttribute("tokens", tokenName);
      }
View Full Code Here

TOP

Related Classes of org.antlr.analysis.NFAState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.