public NFAState getRuleStartState(String ruleName) { return getRuleStartState(null, ruleName); }
public NFAState getRuleStartState(String ruleName) { return getRuleStartState(null, ruleName); }
public NFAState getRuleStartState(String ruleName) { return getRuleStartState(null, ruleName); }
public NFAState getRuleStartState(String ruleName) { return getRuleStartState(null, ruleName); }
public void parse(String startRule, DebugEventListener actions, List<NFAState> visitedStates) throws RecognitionException { //System.out.println("parse("+startRule+")"); // Build NFAs/DFAs from the grammar AST if NFAs haven't been built yet if ( grammar.getRuleStartState(startRule)==null ) { grammar.buildNFA(); } if ( !grammar.allDecisionDFAHaveBeenCreated() ) { // Create the DFA predictors for each decision grammar.createLookaheadDFAs(); } // do the parse Stack<NFAState> ruleInvocationStack = new Stack<NFAState>(); NFAState start = grammar.getRuleStartState(startRule); NFAState stop = grammar.getRuleStopState(startRule); parseEngine(startRule, start, stop, input, ruleInvocationStack, actions, visitedStates); }
public void parse(String startRule, DebugEventListener actions, List visitedStates) throws RecognitionException { //System.out.println("parse("+startRule+")"); // Build NFAs/DFAs from the grammar AST if NFAs haven't been built yet if ( grammar.getRuleStartState(startRule)==null ) { grammar.buildNFA(); } if ( !grammar.allDecisionDFAHaveBeenCreated() ) { // Create the DFA predictors for each decision grammar.createLookaheadDFAs(); } // do the parse Stack ruleInvocationStack = new Stack(); NFAState start = grammar.getRuleStartState(startRule); NFAState stop = grammar.getRuleStopState(startRule); parseEngine(startRule, start, stop, input, ruleInvocationStack, actions, visitedStates); }
public void parse(String startRule, DebugEventListener actions, List<NFAState> visitedStates) throws RecognitionException { //System.out.println("parse("+startRule+")"); // Build NFAs/DFAs from the grammar AST if NFAs haven't been built yet if ( grammar.getRuleStartState(startRule)==null ) { grammar.buildNFA(); } if ( !grammar.allDecisionDFAHaveBeenCreated() ) { // Create the DFA predictors for each decision grammar.createLookaheadDFAs(); } // do the parse Stack<NFAState> ruleInvocationStack = new Stack<NFAState>(); NFAState start = grammar.getRuleStartState(startRule); NFAState stop = grammar.getRuleStopState(startRule); parseEngine(startRule, start, stop, input, ruleInvocationStack, actions, visitedStates); }
public void parse(String startRule, DebugEventListener actions, List visitedStates) throws RecognitionException { //System.out.println("parse("+startRule+")"); // Build NFAs/DFAs from the grammar AST if NFAs haven't been built yet if ( grammar.getRuleStartState(startRule)==null ) { grammar.buildNFA(); } if ( !grammar.allDecisionDFAHaveBeenCreated() ) { // Create the DFA predictors for each decision grammar.createLookaheadDFAs(); } // do the parse Stack ruleInvocationStack = new Stack(); NFAState start = grammar.getRuleStartState(startRule); NFAState stop = grammar.getRuleStopState(startRule); parseEngine(startRule, start, stop, input, ruleInvocationStack, actions, visitedStates); }
if ( grammar.getRuleStartState(startRule)==null ) { grammar.buildNFA(); NFAState start = grammar.getRuleStartState(startRule); NFAState stop = grammar.getRuleStopState(startRule); parseEngine(startRule, start, stop, in, ruleInvocationStack,
if ( grammar.getRuleStartState(startRule)==null ) { grammar.buildNFA(); NFAState start = grammar.getRuleStartState(startRule); NFAState stop = grammar.getRuleStopState(startRule); parseEngine(startRule, start, stop, input, ruleInvocationStack,
if ( grammar.getRuleStartState(startRule)==null ) { grammar.buildNFA(); NFAState start = grammar.getRuleStartState(startRule); NFAState stop = grammar.getRuleStopState(startRule); parseEngine(startRule, start, stop, in, ruleInvocationStack,
if ( grammar.getRuleStartState(startRule)==null ) { grammar.buildNFA(); NFAState start = grammar.getRuleStartState(startRule); NFAState stop = grammar.getRuleStopState(startRule); parseEngine(startRule, start, stop, input, ruleInvocationStack,
public NFAState getRuleStartState(String name) throws Exception { Grammar g; createGrammars(); if(ATEToken.isLexerName(name)) g = getLexerGrammar(); else g = getParserGrammar(); return g == null ? null:g.getRuleStartState(name); }
NFAState state = g.getRuleStartState(startRule); NFAState stopState = g.getRuleStopState(startRule);
NFAState state = g.getRuleStartState(startRule); NFAState stopState = g.getRuleStopState(startRule);
FAFactory factory = new FAFactory(grammar); for (String rule : error.rules) { NFAState startState = grammar.getRuleStartState(rule); FAState state = factory.buildNFA(startState, optimize);
public String toString() { GrammarAST decisionASTNode = probe.dfa.getDecisionASTNode(); line = decisionASTNode.getLine(); column = decisionASTNode.getColumn(); String fileName = probe.dfa.nfa.grammar.getFileName(); if ( fileName!=null ) { file = fileName; } StringTemplate st = getMessageTemplate(); if ( probe.dfa.isTokensRuleDecision() ) { // alts are token rules, convert to the names instead of numbers 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); } } else { // regular alt numbers, show the alts st.setAttribute("alts", alts); } return super.toString(st); }
public String toString() { GrammarAST decisionASTNode = probe.dfa.getDecisionASTNode(); line = decisionASTNode.getLine(); column = decisionASTNode.getColumn(); String fileName = probe.dfa.nfa.grammar.getFileName(); if ( fileName!=null ) { file = fileName; } StringTemplate st = getMessageTemplate(); if ( probe.dfa.isTokensRuleDecision() ) { // alts are token rules, convert to the names instead of numbers 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); } } else { // regular alt numbers, show the alts st.setAttribute("alts", alts); } return super.toString(st); }
@Override public String toString() { GrammarAST decisionASTNode = probe.dfa.getDecisionASTNode(); line = decisionASTNode.getLine(); column = decisionASTNode.getCharPositionInLine(); String fileName = probe.dfa.nfa.grammar.getFileName(); if ( fileName!=null ) { file = fileName; } ST st = getMessageTemplate(); if ( probe.dfa.isTokensRuleDecision() ) { // alts are token rules, convert to the names instead of numbers for (int i = 0; i < alts.size(); i++) { Integer altI = alts.get(i); String tokenName = probe.getTokenNameForTokensRuleAlt(altI); // reset the line/col to the token definition NFAState ruleStart = probe.dfa.nfa.grammar.getRuleStartState(tokenName); line = ruleStart.associatedASTNode.getLine(); column = ruleStart.associatedASTNode.getCharPositionInLine(); st.add("tokens", tokenName); } } else { // regular alt numbers, show the alts st.add("alts", alts); } return super.toString(st); }
@Override public String toString() { GrammarAST decisionASTNode = probe.dfa.getDecisionASTNode(); line = decisionASTNode.getLine(); column = decisionASTNode.getCharPositionInLine(); String fileName = probe.dfa.nfa.grammar.getFileName(); if ( fileName!=null ) { file = fileName; } ST st = getMessageTemplate(); if ( probe.dfa.isTokensRuleDecision() ) { // alts are token rules, convert to the names instead of numbers for (int i = 0; i < alts.size(); i++) { Integer altI = alts.get(i); String tokenName = probe.getTokenNameForTokensRuleAlt(altI); // reset the line/col to the token definition NFAState ruleStart = probe.dfa.nfa.grammar.getRuleStartState(tokenName); line = ruleStart.associatedASTNode.getLine(); column = ruleStart.associatedASTNode.getCharPositionInLine(); st.add("tokens", tokenName); } } else { // regular alt numbers, show the alts st.add("alts", alts); } return super.toString(st); }