if ( (LA2_0=='$') ) { int LA2_1 = input.LA(2); if ( (synpred1_ActionAnalysis()) ) { alt2=1; else if ( (synpred2_ActionAnalysis()) ) { alt2=2; mX_Y(); if (state.failed) return; mX(); if (state.failed) return; mY(); if (state.failed) return;
match('$'); if (state.failed) return; int xStart83 = getCharIndex(); int xStartLine83 = getLine(); int xStartCharPos83 = getCharPositionInLine(); mID(); if (state.failed) return; x = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, xStart83, getCharIndex()-1); x.setLine(xStartLine83); x.setCharPositionInLine(xStartCharPos83);
Token.DEFAULT_CHANNEL, input.index(),input.index()); eof.setLine(getLine()); eof.setCharPositionInLine(getCharPositionInLine()); return eof; state.backtracking=1; state.failed=false; mTokens(); state.backtracking=0; if ( state.failed ) { emit(); return state.token; reportError(re); recover(re);
state.backtracking=1; state.failed=false; mTokens(); state.backtracking=0; emit(); return state.token; reportError(re); recover(re);
/** Before generating code, we examine all actions that can have * $x.y and $y stuff in them because some code generation depends on * Rule.referencedPredefinedRuleAttributes. I need to remove unused * rule labels for example. */ protected void examineAllExecutableActions() { Collection<Rule> rules = getRules(); for (Rule r : rules) { // walk all actions within the rule elements, args, and exceptions List<GrammarAST> actions = r.getInlineActions(); for (int i = 0; i < actions.size(); i++) { GrammarAST actionAST = actions.get(i); ActionAnalysis sniffer = new ActionAnalysis(this, r.name, actionAST); sniffer.analyze(); } // walk any named actions like @init, @after Collection<? extends Object> namedActions = r.getActions().values(); for (Object namedAction : namedActions) { GrammarAST actionAST = (GrammarAST)namedAction; ActionAnalysis sniffer = new ActionAnalysis(this, r.name, actionAST); sniffer.analyze(); } } }
public final void mX() throws RecognitionException { try { int _type = X; int _channel = DEFAULT_TOKEN_CHANNEL; CommonToken x=null; // org/antlr/grammar/v3/ActionAnalysis.g:111:3: ( '$' x= ID {...}?) // org/antlr/grammar/v3/ActionAnalysis.g:111:5: '$' x= ID {...}? { match('$'); if (state.failed) return ; int xStart76 = getCharIndex(); mID(); if (state.failed) return ; x = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, xStart76, getCharIndex()-1); if ( !((enclosingRule!=null && enclosingRule.getRuleLabel((x!=null?x.getText():null))!=null)) ) { if (state.backtracking>0) {state.failed=true; return ;} throw new FailedPredicateException(input, "X", "enclosingRule!=null && enclosingRule.getRuleLabel($x.text)!=null"); } if ( state.backtracking==1 ) { Grammar.LabelElementPair pair = enclosingRule.getRuleLabel((x!=null?x.getText():null)); pair.actionReferencesLabel = true; } } state.type = _type; state.channel = _channel; } finally { } } // $ANTLR end "X"
public final void synpred2_ActionAnalysis_fragment() throws RecognitionException { // org/antlr/grammar/v3/ActionAnalysis.g:1:45: ( X ) // org/antlr/grammar/v3/ActionAnalysis.g:1:45: X { mX(); if (state.failed) return; } } // $ANTLR end synpred2_ActionAnalysis
public final void synpred1_ActionAnalysis_fragment() throws RecognitionException { // org/antlr/grammar/v3/ActionAnalysis.g:1:41: ( X_Y ) // org/antlr/grammar/v3/ActionAnalysis.g:1:41: X_Y { mX_Y(); if (state.failed) return; } } // $ANTLR end synpred1_ActionAnalysis
match('$'); if (state.failed) return; int xStart83 = getCharIndex(); int xStartLine83 = getLine(); int xStartCharPos83 = getCharPositionInLine(); mID(); if (state.failed) return; x = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, xStart83, getCharIndex()-1); x.setLine(xStartLine83); x.setCharPositionInLine(xStartCharPos83);
Token.DEFAULT_CHANNEL, input.index(),input.index()); eof.setLine(getLine()); eof.setCharPositionInLine(getCharPositionInLine()); return eof; state.backtracking=1; state.failed=false; mTokens(); state.backtracking=0; if ( state.failed ) { emit(); return state.token; reportError(re); recover(re);
/** Before generating code, we examine all actions that can have * $x.y and $y stuff in them because some code generation depends on * Rule.referencedPredefinedRuleAttributes. I need to remove unused * rule labels for example. */ protected void examineAllExecutableActions() { Collection<Rule> rules = getRules(); for (Rule r : rules) { // walk all actions within the rule elements, args, and exceptions List<GrammarAST> actions = r.getInlineActions(); for (int i = 0; i < actions.size(); i++) { GrammarAST actionAST = actions.get(i); ActionAnalysis sniffer = new ActionAnalysis(this, r.name, actionAST); sniffer.analyze(); } // walk any named actions like @init, @after Collection<? extends Object> namedActions = r.getActions().values(); for (Object namedAction : namedActions) { GrammarAST actionAST = (GrammarAST)namedAction; ActionAnalysis sniffer = new ActionAnalysis(this, r.name, actionAST); sniffer.analyze(); } } }
match('$'); if (state.failed) return ; int ID1Start97 = getCharIndex(); mID(); if (state.failed) return ; ID1 = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, ID1Start97, getCharIndex()-1); if ( !((enclosingRule!=null && enclosingRule.getLocalAttributeScope((ID1!=null?ID1.getText():null))!=null)) ) { if (state.backtracking>0) {state.failed=true; return ;}
public final void synpred2_ActionAnalysis_fragment() throws RecognitionException { // org/antlr/grammar/v3/ActionAnalysis.g:1:45: ( X ) // org/antlr/grammar/v3/ActionAnalysis.g:1:45: X { mX(); if (state.failed) return; } } // $ANTLR end synpred2_ActionAnalysis
public final void synpred1_ActionAnalysis_fragment() throws RecognitionException { // org/antlr/grammar/v3/ActionAnalysis.g:1:41: ( X_Y ) // org/antlr/grammar/v3/ActionAnalysis.g:1:41: X_Y { mX_Y(); if (state.failed) return; } } // $ANTLR end synpred1_ActionAnalysis
match('$'); if (state.failed) return; int ID1Start104 = getCharIndex(); int ID1StartLine104 = getLine(); int ID1StartCharPos104 = getCharPositionInLine(); mID(); if (state.failed) return; ID1 = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, ID1Start104, getCharIndex()-1); ID1.setLine(ID1StartLine104); ID1.setCharPositionInLine(ID1StartCharPos104);
if ( (LA2_0=='$') ) { int LA2_1 = input.LA(2); if ( (synpred1_ActionAnalysis()) ) { alt2=1; else if ( (synpred2_ActionAnalysis()) ) { alt2=2; mX_Y(); if (state.failed) return; mX(); if (state.failed) return; mY(); if (state.failed) return;
/** Before generating code, we examine all actions that can have * $x.y and $y stuff in them because some code generation depends on * Rule.referencedPredefinedRuleAttributes. I need to remove unused * rule labels for example. */ protected void examineAllExecutableActions() { Collection rules = getRules(); for (Iterator it = rules.iterator(); it.hasNext();) { Rule r = (Rule) it.next(); // walk all actions within the rule elements, args, and exceptions List<GrammarAST> actions = r.getInlineActions(); for (int i = 0; i < actions.size(); i++) { GrammarAST actionAST = (GrammarAST) actions.get(i); ActionAnalysis sniffer = new ActionAnalysis(this, r.name, actionAST); sniffer.analyze(); } // walk any named actions like @init, @after Collection<GrammarAST> namedActions = r.getActions().values(); for (Iterator it2 = namedActions.iterator(); it2.hasNext();) { GrammarAST actionAST = (GrammarAST) it2.next(); ActionAnalysis sniffer = new ActionAnalysis(this, r.name, actionAST); sniffer.analyze(); } } }
match('$'); if (state.failed) return ; int xStart48 = getCharIndex(); mID(); if (state.failed) return ; x = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, xStart48, getCharIndex()-1); match('.'); if (state.failed) return ; int yStart54 = getCharIndex(); mID(); if (state.failed) return ; y = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, yStart54, getCharIndex()-1); if ( !((enclosingRule!=null)) ) { if (state.backtracking>0) {state.failed=true; return ;}
public final void synpred2_ActionAnalysis_fragment() throws RecognitionException { // org/antlr/grammar/v3/ActionAnalysis.g:1:45: ( X ) // org/antlr/grammar/v3/ActionAnalysis.g:1:45: X { mX(); if (state.failed) return ; } } // $ANTLR end synpred2_ActionAnalysis
public final void synpred1_ActionAnalysis_fragment() throws RecognitionException { // org/antlr/grammar/v3/ActionAnalysis.g:1:41: ( X_Y ) // org/antlr/grammar/v3/ActionAnalysis.g:1:41: X_Y { mX_Y(); if (state.failed) return ; } } // $ANTLR end synpred1_ActionAnalysis