0001: // $ANTLR 3.0b5 ActionTranslator.g 2006-11-23 01:51:22
0002:
0003: package org.antlr.codegen;
0004:
0005: import org.antlr.runtime.*;
0006: import org.antlr.stringtemplate.StringTemplate;
0007: import org.antlr.tool.*;
0008:
0009: import java.util.ArrayList;
0010: import java.util.HashMap;
0011: import java.util.List;
0012:
0013: public class ActionTranslatorLexer extends Lexer {
0014: public static final int LOCAL_ATTR = 17;
0015: public static final int SET_DYNAMIC_SCOPE_ATTR = 18;
0016: public static final int ISOLATED_DYNAMIC_SCOPE = 24;
0017: public static final int WS = 5;
0018: public static final int UNKNOWN_SYNTAX = 35;
0019: public static final int DYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR = 23;
0020: public static final int SCOPE_INDEX_EXPR = 21;
0021: public static final int DYNAMIC_SCOPE_ATTR = 19;
0022: public static final int ISOLATED_TOKEN_REF = 14;
0023: public static final int SET_ATTRIBUTE = 30;
0024: public static final int SET_EXPR_ATTRIBUTE = 29;
0025: public static final int ACTION = 27;
0026: public static final int ERROR_X = 34;
0027: public static final int TEMPLATE_INSTANCE = 26;
0028: public static final int TOKEN_SCOPE_ATTR = 10;
0029: public static final int ISOLATED_LEXER_RULE_REF = 15;
0030: public static final int ESC = 32;
0031: public static final int SET_ENCLOSING_RULE_SCOPE_ATTR = 7;
0032: public static final int ATTR_VALUE_EXPR = 6;
0033: public static final int RULE_SCOPE_ATTR = 12;
0034: public static final int LABEL_REF = 13;
0035: public static final int INT = 37;
0036: public static final int ARG = 25;
0037: public static final int EOF = -1;
0038: public static final int SET_LOCAL_ATTR = 16;
0039: public static final int TEXT = 36;
0040: public static final int Tokens = 38;
0041: public static final int DYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR = 22;
0042: public static final int SET_TOKEN_SCOPE_ATTR = 9;
0043: public static final int ERROR_SCOPED_XY = 20;
0044: public static final int SET_RULE_SCOPE_ATTR = 11;
0045: public static final int ENCLOSING_RULE_SCOPE_ATTR = 8;
0046: public static final int ERROR_XY = 33;
0047: public static final int TEMPLATE_EXPR = 31;
0048: public static final int INDIRECT_TEMPLATE_INSTANCE = 28;
0049: public static final int ID = 4;
0050:
0051: public List chunks = new ArrayList();
0052: Rule enclosingRule;
0053: int outerAltNum;
0054: Grammar grammar;
0055: CodeGenerator generator;
0056: antlr.Token actionToken;
0057:
0058: int ruleNestingLevel = 0;
0059:
0060: public Token emit(int tokenType, int line, int charPosition,
0061: int channel, int start, int stop) {
0062: Token t = new CommonToken(input, tokenType, channel, start,
0063: stop);
0064: t.setLine(line);
0065: t.setText(text);
0066: t.setCharPositionInLine(charPosition);
0067: emit(t);
0068: return t;
0069: }
0070:
0071: public ActionTranslatorLexer(CodeGenerator generator,
0072: String ruleName, GrammarAST actionAST) {
0073: this (new ANTLRStringStream(actionAST.token.getText()));
0074: this .generator = generator;
0075: this .grammar = generator.grammar;
0076: this .enclosingRule = grammar.getRule(ruleName);
0077: this .actionToken = actionAST.token;
0078: this .outerAltNum = actionAST.outerAltNum;
0079: }
0080:
0081: public ActionTranslatorLexer(CodeGenerator generator,
0082: String ruleName, antlr.Token actionToken, int outerAltNum) {
0083: this (new ANTLRStringStream(actionToken.getText()));
0084: this .generator = generator;
0085: grammar = generator.grammar;
0086: this .enclosingRule = grammar.getRule(ruleName);
0087: this .actionToken = actionToken;
0088: this .outerAltNum = outerAltNum;
0089: }
0090:
0091: /*
0092: public ActionTranslatorLexer(CharStream input, CodeGenerator generator,
0093: Grammar grammar, Rule enclosingRule,
0094: antlr.Token actionToken, int outerAltNum)
0095: {
0096: this(input);
0097: this.grammar = grammar;
0098: this.generator = generator;
0099: this.enclosingRule = enclosingRule;
0100: this.actionToken = actionToken;
0101: this.outerAltNum = outerAltNum;
0102: }
0103: */
0104:
0105: /** Return a list of strings and StringTemplate objects that
0106: * represent the translated action.
0107: */
0108: public List translateToChunks() {
0109: // System.out.println("###\naction="+action);
0110: Token t;
0111: do {
0112: t = nextToken();
0113: } while (t.getType() != Token.EOF);
0114: return chunks;
0115: }
0116:
0117: public String translate() {
0118: List theChunks = translateToChunks();
0119: //System.out.println("chunks="+a.chunks);
0120: StringBuffer buf = new StringBuffer();
0121: for (int i = 0; i < theChunks.size(); i++) {
0122: Object o = (Object) theChunks.get(i);
0123: buf.append(o);
0124: }
0125: //System.out.println("translated: "+buf.toString());
0126: return buf.toString();
0127: }
0128:
0129: public List translateAction(String action) {
0130: ActionTranslatorLexer translator = new ActionTranslatorLexer(
0131: generator, enclosingRule.name, new antlr.CommonToken(
0132: ANTLRParser.ACTION, action), outerAltNum);
0133: return translator.translateToChunks();
0134: }
0135:
0136: public boolean isTokenRefInAlt(String id) {
0137: return enclosingRule.getTokenRefsInAlt(id, outerAltNum) != null;
0138: }
0139:
0140: public boolean isRuleRefInAlt(String id) {
0141: return enclosingRule.getRuleRefsInAlt(id, outerAltNum) != null;
0142: }
0143:
0144: public Grammar.LabelElementPair getElementLabel(String id) {
0145: return enclosingRule.getLabel(id);
0146: }
0147:
0148: public void checkElementRefUniqueness(String ref, boolean isToken) {
0149: List refs = null;
0150: if (isToken) {
0151: refs = enclosingRule.getTokenRefsInAlt(ref, outerAltNum);
0152: } else {
0153: refs = enclosingRule.getRuleRefsInAlt(ref, outerAltNum);
0154: }
0155: if (refs != null && refs.size() > 1) {
0156: ErrorManager.grammarError(ErrorManager.MSG_NONUNIQUE_REF,
0157: grammar, actionToken, ref);
0158: }
0159: }
0160:
0161: /** For $rulelabel.name, return the Attribute found for name. It
0162: * will be a predefined property or a return value.
0163: */
0164: public Attribute getRuleLabelAttribute(String ruleName,
0165: String attrName) {
0166: Rule r = grammar.getRule(ruleName);
0167: AttributeScope scope = r.getLocalAttributeScope(attrName);
0168: if (scope != null && !scope.isParameterScope) {
0169: return scope.getAttribute(attrName);
0170: }
0171: return null;
0172: }
0173:
0174: AttributeScope resolveDynamicScope(String scopeName) {
0175: if (grammar.getGlobalScope(scopeName) != null) {
0176: return grammar.getGlobalScope(scopeName);
0177: }
0178: Rule scopeRule = grammar.getRule(scopeName);
0179: if (scopeRule != null) {
0180: return scopeRule.ruleScope;
0181: }
0182: return null; // not a valid dynamic scope
0183: }
0184:
0185: protected StringTemplate template(String name) {
0186: StringTemplate st = generator.getTemplates()
0187: .getInstanceOf(name);
0188: chunks.add(st);
0189: return st;
0190: }
0191:
0192: public ActionTranslatorLexer() {
0193: ;
0194: }
0195:
0196: public ActionTranslatorLexer(CharStream input) {
0197: super (input);
0198: ruleMemo = new HashMap[62 + 1];
0199: }
0200:
0201: public String getGrammarFileName() {
0202: return "ActionTranslator.g";
0203: }
0204:
0205: public Token nextToken() {
0206: while (true) {
0207: if (input.LA(1) == CharStream.EOF) {
0208: return Token.EOF_TOKEN;
0209: }
0210: token = null;
0211: tokenStartCharIndex = getCharIndex();
0212: text = null;
0213: try {
0214: int m = input.mark();
0215: backtracking = 1;
0216: failed = false;
0217: mTokens();
0218: backtracking = 0;
0219:
0220: if (failed) {
0221: input.rewind(m);
0222: input.consume();
0223: } else {
0224: return token;
0225: }
0226: } catch (RecognitionException re) {
0227: // shouldn't happen in backtracking mode, but...
0228: reportError(re);
0229: recover(re);
0230: }
0231: }
0232: }
0233:
0234: public void memoize(IntStream input, int ruleIndex,
0235: int ruleStartIndex) {
0236: if (backtracking > 1)
0237: super .memoize(input, ruleIndex, ruleStartIndex);
0238: }
0239:
0240: public boolean alreadyParsedRule(IntStream input, int ruleIndex) {
0241: if (backtracking > 1)
0242: return super .alreadyParsedRule(input, ruleIndex);
0243: return false;
0244: }// $ANTLR start SET_ENCLOSING_RULE_SCOPE_ATTR
0245:
0246: public void mSET_ENCLOSING_RULE_SCOPE_ATTR()
0247: throws RecognitionException {
0248: try {
0249: ruleNestingLevel++;
0250: int _type = SET_ENCLOSING_RULE_SCOPE_ATTR;
0251: int _start = getCharIndex();
0252: int _line = getLine();
0253: int _charPosition = getCharPositionInLine();
0254: int _channel = Token.DEFAULT_CHANNEL;
0255: // ActionTranslator.g:201:4: ( '$' x= ID '.' y= ID ( WS )? '=' expr= ATTR_VALUE_EXPR ';' {...}?)
0256: // ActionTranslator.g:201:4: '$' x= ID '.' y= ID ( WS )? '=' expr= ATTR_VALUE_EXPR ';' {...}?
0257: {
0258: match('$');
0259: if (failed)
0260: return;
0261: int xStart = getCharIndex();
0262: mID();
0263: if (failed)
0264: return;
0265: Token x = new CommonToken(input,
0266: Token.INVALID_TOKEN_TYPE,
0267: Token.DEFAULT_CHANNEL, xStart,
0268: getCharIndex() - 1);
0269: match('.');
0270: if (failed)
0271: return;
0272: int yStart = getCharIndex();
0273: mID();
0274: if (failed)
0275: return;
0276: Token y = new CommonToken(input,
0277: Token.INVALID_TOKEN_TYPE,
0278: Token.DEFAULT_CHANNEL, yStart,
0279: getCharIndex() - 1);
0280: // ActionTranslator.g:201:22: ( WS )?
0281: int alt1 = 2;
0282: int LA1_0 = input.LA(1);
0283: if (((LA1_0 >= '\t' && LA1_0 <= '\n') || LA1_0 == ' ')) {
0284: alt1 = 1;
0285: }
0286: switch (alt1) {
0287: case 1:
0288: // ActionTranslator.g:201:22: WS
0289: {
0290: mWS();
0291: if (failed)
0292: return;
0293:
0294: }
0295: break;
0296:
0297: }
0298:
0299: match('=');
0300: if (failed)
0301: return;
0302: int exprStart = getCharIndex();
0303: mATTR_VALUE_EXPR();
0304: if (failed)
0305: return;
0306: Token expr = new CommonToken(input,
0307: Token.INVALID_TOKEN_TYPE,
0308: Token.DEFAULT_CHANNEL, exprStart,
0309: getCharIndex() - 1);
0310: match(';');
0311: if (failed)
0312: return;
0313: if (!(enclosingRule != null
0314: && x.getText().equals(enclosingRule.name) && enclosingRule
0315: .getLocalAttributeScope(y.getText()) != null)) {
0316: if (backtracking > 0) {
0317: failed = true;
0318: return;
0319: }
0320: throw new FailedPredicateException(
0321: input,
0322: "SET_ENCLOSING_RULE_SCOPE_ATTR",
0323: "enclosingRule!=null &&\n\t $x.text.equals(enclosingRule.name) &&\n\t enclosingRule.getLocalAttributeScope($y.text)!=null");
0324: }
0325: if (backtracking == 1) {
0326:
0327: StringTemplate st = null;
0328: AttributeScope scope = enclosingRule
0329: .getLocalAttributeScope(y.getText());
0330: if (scope.isPredefinedRuleScope) {
0331: if (y.getText().equals("st")
0332: || y.getText().equals("tree")) {
0333: st = template("ruleSetPropertyRef_"
0334: + y.getText());
0335: grammar
0336: .referenceRuleLabelPredefinedAttribute(x
0337: .getText());
0338: st.setAttribute("scope", x.getText());
0339: st.setAttribute("attr", y.getText());
0340: st.setAttribute("expr",
0341: translateAction(expr.getText()));
0342: } else {
0343: ErrorManager
0344: .grammarError(
0345: ErrorManager.MSG_WRITE_TO_READONLY_ATTR,
0346: grammar, actionToken, x
0347: .getText(), y
0348: .getText());
0349: }
0350: } else if (scope.isPredefinedLexerRuleScope) {
0351: // this is a better message to emit than the previous one...
0352: ErrorManager
0353: .grammarError(
0354: ErrorManager.MSG_WRITE_TO_READONLY_ATTR,
0355: grammar, actionToken, x
0356: .getText(), y.getText());
0357: } else if (scope.isParameterScope) {
0358: st = template("parameterSetAttributeRef");
0359: st.setAttribute("attr", scope.getAttribute(y
0360: .getText()));
0361: st.setAttribute("expr", translateAction(expr
0362: .getText()));
0363: } else { // must be return value
0364: st = template("returnSetAttributeRef");
0365: st
0366: .setAttribute("ruleDescriptor",
0367: enclosingRule);
0368: st.setAttribute("attr", scope.getAttribute(y
0369: .getText()));
0370: st.setAttribute("expr", translateAction(expr
0371: .getText()));
0372: }
0373:
0374: }
0375:
0376: }
0377:
0378: if (backtracking == 1) {
0379:
0380: if (token == null && ruleNestingLevel == 1) {
0381: emit(_type, _line, _charPosition, _channel, _start,
0382: getCharIndex() - 1);
0383: }
0384:
0385: }
0386: } finally {
0387: ruleNestingLevel--;
0388: }
0389: }
0390:
0391: // $ANTLR end SET_ENCLOSING_RULE_SCOPE_ATTR
0392:
0393: // $ANTLR start ENCLOSING_RULE_SCOPE_ATTR
0394: public void mENCLOSING_RULE_SCOPE_ATTR()
0395: throws RecognitionException {
0396: try {
0397: ruleNestingLevel++;
0398: int _type = ENCLOSING_RULE_SCOPE_ATTR;
0399: int _start = getCharIndex();
0400: int _line = getLine();
0401: int _charPosition = getCharPositionInLine();
0402: int _channel = Token.DEFAULT_CHANNEL;
0403: // ActionTranslator.g:246:4: ( '$' x= ID '.' y= ID {...}?)
0404: // ActionTranslator.g:246:4: '$' x= ID '.' y= ID {...}?
0405: {
0406: match('$');
0407: if (failed)
0408: return;
0409: int xStart = getCharIndex();
0410: mID();
0411: if (failed)
0412: return;
0413: Token x = new CommonToken(input,
0414: Token.INVALID_TOKEN_TYPE,
0415: Token.DEFAULT_CHANNEL, xStart,
0416: getCharIndex() - 1);
0417: match('.');
0418: if (failed)
0419: return;
0420: int yStart = getCharIndex();
0421: mID();
0422: if (failed)
0423: return;
0424: Token y = new CommonToken(input,
0425: Token.INVALID_TOKEN_TYPE,
0426: Token.DEFAULT_CHANNEL, yStart,
0427: getCharIndex() - 1);
0428: if (!(enclosingRule != null
0429: && x.getText().equals(enclosingRule.name) && enclosingRule
0430: .getLocalAttributeScope(y.getText()) != null)) {
0431: if (backtracking > 0) {
0432: failed = true;
0433: return;
0434: }
0435: throw new FailedPredicateException(
0436: input,
0437: "ENCLOSING_RULE_SCOPE_ATTR",
0438: "enclosingRule!=null &&\n\t $x.text.equals(enclosingRule.name) &&\n\t enclosingRule.getLocalAttributeScope($y.text)!=null");
0439: }
0440: if (backtracking == 1) {
0441:
0442: StringTemplate st = null;
0443: AttributeScope scope = enclosingRule
0444: .getLocalAttributeScope(y.getText());
0445: if (scope.isPredefinedRuleScope) {
0446: st = template("rulePropertyRef_" + y.getText());
0447: grammar.referenceRuleLabelPredefinedAttribute(x
0448: .getText());
0449: st.setAttribute("scope", x.getText());
0450: st.setAttribute("attr", y.getText());
0451: } else if (scope.isPredefinedLexerRuleScope) {
0452: // perhaps not the most precise error message to use, but...
0453: ErrorManager.grammarError(
0454: ErrorManager.MSG_RULE_HAS_NO_ARGS,
0455: grammar, actionToken, x.getText());
0456: } else if (scope.isParameterScope) {
0457: st = template("parameterAttributeRef");
0458: st.setAttribute("attr", scope.getAttribute(y
0459: .getText()));
0460: } else { // must be return value
0461: st = template("returnAttributeRef");
0462: st
0463: .setAttribute("ruleDescriptor",
0464: enclosingRule);
0465: st.setAttribute("attr", scope.getAttribute(y
0466: .getText()));
0467: }
0468:
0469: }
0470:
0471: }
0472:
0473: if (backtracking == 1) {
0474:
0475: if (token == null && ruleNestingLevel == 1) {
0476: emit(_type, _line, _charPosition, _channel, _start,
0477: getCharIndex() - 1);
0478: }
0479:
0480: }
0481: } finally {
0482: ruleNestingLevel--;
0483: }
0484: }
0485:
0486: // $ANTLR end ENCLOSING_RULE_SCOPE_ATTR
0487:
0488: // $ANTLR start SET_TOKEN_SCOPE_ATTR
0489: public void mSET_TOKEN_SCOPE_ATTR() throws RecognitionException {
0490: try {
0491: ruleNestingLevel++;
0492: int _type = SET_TOKEN_SCOPE_ATTR;
0493: int _start = getCharIndex();
0494: int _line = getLine();
0495: int _charPosition = getCharPositionInLine();
0496: int _channel = Token.DEFAULT_CHANNEL;
0497: // ActionTranslator.g:280:4: ( '$' x= ID '.' y= ID ( WS )? '=' {...}?)
0498: // ActionTranslator.g:280:4: '$' x= ID '.' y= ID ( WS )? '=' {...}?
0499: {
0500: match('$');
0501: if (failed)
0502: return;
0503: int xStart = getCharIndex();
0504: mID();
0505: if (failed)
0506: return;
0507: Token x = new CommonToken(input,
0508: Token.INVALID_TOKEN_TYPE,
0509: Token.DEFAULT_CHANNEL, xStart,
0510: getCharIndex() - 1);
0511: match('.');
0512: if (failed)
0513: return;
0514: int yStart = getCharIndex();
0515: mID();
0516: if (failed)
0517: return;
0518: Token y = new CommonToken(input,
0519: Token.INVALID_TOKEN_TYPE,
0520: Token.DEFAULT_CHANNEL, yStart,
0521: getCharIndex() - 1);
0522: // ActionTranslator.g:280:22: ( WS )?
0523: int alt2 = 2;
0524: int LA2_0 = input.LA(1);
0525: if (((LA2_0 >= '\t' && LA2_0 <= '\n') || LA2_0 == ' ')) {
0526: alt2 = 1;
0527: }
0528: switch (alt2) {
0529: case 1:
0530: // ActionTranslator.g:280:22: WS
0531: {
0532: mWS();
0533: if (failed)
0534: return;
0535:
0536: }
0537: break;
0538:
0539: }
0540:
0541: match('=');
0542: if (failed)
0543: return;
0544: if (!(enclosingRule != null
0545: && input.LA(1) != '='
0546: && (enclosingRule.getTokenLabel(x.getText()) != null || isTokenRefInAlt(x
0547: .getText())) && AttributeScope.tokenScope
0548: .getAttribute(y.getText()) != null)) {
0549: if (backtracking > 0) {
0550: failed = true;
0551: return;
0552: }
0553: throw new FailedPredicateException(
0554: input,
0555: "SET_TOKEN_SCOPE_ATTR",
0556: "enclosingRule!=null && input.LA(1)!='=' &&\n\t (enclosingRule.getTokenLabel($x.text)!=null||\n\t isTokenRefInAlt($x.text)) &&\n\t AttributeScope.tokenScope.getAttribute($y.text)!=null");
0557: }
0558: if (backtracking == 1) {
0559:
0560: ErrorManager.grammarError(
0561: ErrorManager.MSG_WRITE_TO_READONLY_ATTR,
0562: grammar, actionToken, x.getText(), y
0563: .getText());
0564:
0565: }
0566:
0567: }
0568:
0569: if (backtracking == 1) {
0570:
0571: if (token == null && ruleNestingLevel == 1) {
0572: emit(_type, _line, _charPosition, _channel, _start,
0573: getCharIndex() - 1);
0574: }
0575:
0576: }
0577: } finally {
0578: ruleNestingLevel--;
0579: }
0580: }
0581:
0582: // $ANTLR end SET_TOKEN_SCOPE_ATTR
0583:
0584: // $ANTLR start TOKEN_SCOPE_ATTR
0585: public void mTOKEN_SCOPE_ATTR() throws RecognitionException {
0586: try {
0587: ruleNestingLevel++;
0588: int _type = TOKEN_SCOPE_ATTR;
0589: int _start = getCharIndex();
0590: int _line = getLine();
0591: int _charPosition = getCharPositionInLine();
0592: int _channel = Token.DEFAULT_CHANNEL;
0593: // ActionTranslator.g:299:4: ( '$' x= ID '.' y= ID {...}?)
0594: // ActionTranslator.g:299:4: '$' x= ID '.' y= ID {...}?
0595: {
0596: match('$');
0597: if (failed)
0598: return;
0599: int xStart = getCharIndex();
0600: mID();
0601: if (failed)
0602: return;
0603: Token x = new CommonToken(input,
0604: Token.INVALID_TOKEN_TYPE,
0605: Token.DEFAULT_CHANNEL, xStart,
0606: getCharIndex() - 1);
0607: match('.');
0608: if (failed)
0609: return;
0610: int yStart = getCharIndex();
0611: mID();
0612: if (failed)
0613: return;
0614: Token y = new CommonToken(input,
0615: Token.INVALID_TOKEN_TYPE,
0616: Token.DEFAULT_CHANNEL, yStart,
0617: getCharIndex() - 1);
0618: if (!(enclosingRule != null
0619: && (enclosingRule.getTokenLabel(x.getText()) != null || isTokenRefInAlt(x
0620: .getText()))
0621: && AttributeScope.tokenScope.getAttribute(y
0622: .getText()) != null && (grammar.type != Grammar.LEXER
0623: || getElementLabel(x.getText()).elementRef.token
0624: .getType() == ANTLRParser.TOKEN_REF || getElementLabel(x
0625: .getText()).elementRef.token.getType() == ANTLRParser.STRING_LITERAL))) {
0626: if (backtracking > 0) {
0627: failed = true;
0628: return;
0629: }
0630: throw new FailedPredicateException(
0631: input,
0632: "TOKEN_SCOPE_ATTR",
0633: "enclosingRule!=null &&\n\t (enclosingRule.getTokenLabel($x.text)!=null||\n\t isTokenRefInAlt($x.text)) &&\n\t AttributeScope.tokenScope.getAttribute($y.text)!=null &&\n\t (grammar.type!=Grammar.LEXER ||\n\t getElementLabel($x.text).elementRef.token.getType()==ANTLRParser.TOKEN_REF ||\n\t getElementLabel($x.text).elementRef.token.getType()==ANTLRParser.STRING_LITERAL)");
0634: }
0635: if (backtracking == 1) {
0636:
0637: String label = x.getText();
0638: if (enclosingRule.getTokenLabel(x.getText()) == null) {
0639: // $tokenref.attr gotta get old label or compute new one
0640: checkElementRefUniqueness(x.getText(), true);
0641: label = enclosingRule.getElementLabel(x
0642: .getText(), outerAltNum, generator);
0643: if (label == null) {
0644: ErrorManager
0645: .grammarError(
0646: ErrorManager.MSG_FORWARD_ELEMENT_REF,
0647: grammar, actionToken, "$"
0648: + x.getText() + "."
0649: + y.getText());
0650: label = x.getText();
0651: }
0652: }
0653: StringTemplate st = template("tokenLabelPropertyRef_"
0654: + y.getText());
0655: st.setAttribute("scope", label);
0656: st.setAttribute("attr", AttributeScope.tokenScope
0657: .getAttribute(y.getText()));
0658:
0659: }
0660:
0661: }
0662:
0663: if (backtracking == 1) {
0664:
0665: if (token == null && ruleNestingLevel == 1) {
0666: emit(_type, _line, _charPosition, _channel, _start,
0667: getCharIndex() - 1);
0668: }
0669:
0670: }
0671: } finally {
0672: ruleNestingLevel--;
0673: }
0674: }
0675:
0676: // $ANTLR end TOKEN_SCOPE_ATTR
0677:
0678: // $ANTLR start SET_RULE_SCOPE_ATTR
0679: public void mSET_RULE_SCOPE_ATTR() throws RecognitionException {
0680: try {
0681: ruleNestingLevel++;
0682: int _type = SET_RULE_SCOPE_ATTR;
0683: int _start = getCharIndex();
0684: int _line = getLine();
0685: int _charPosition = getCharPositionInLine();
0686: int _channel = Token.DEFAULT_CHANNEL;
0687:
0688: Grammar.LabelElementPair pair = null;
0689: String refdRuleName = null;
0690:
0691: // ActionTranslator.g:337:4: ( '$' x= ID '.' y= ID ( WS )? '=' {...}?{...}?)
0692: // ActionTranslator.g:337:4: '$' x= ID '.' y= ID ( WS )? '=' {...}?{...}?
0693: {
0694: match('$');
0695: if (failed)
0696: return;
0697: int xStart = getCharIndex();
0698: mID();
0699: if (failed)
0700: return;
0701: Token x = new CommonToken(input,
0702: Token.INVALID_TOKEN_TYPE,
0703: Token.DEFAULT_CHANNEL, xStart,
0704: getCharIndex() - 1);
0705: match('.');
0706: if (failed)
0707: return;
0708: int yStart = getCharIndex();
0709: mID();
0710: if (failed)
0711: return;
0712: Token y = new CommonToken(input,
0713: Token.INVALID_TOKEN_TYPE,
0714: Token.DEFAULT_CHANNEL, yStart,
0715: getCharIndex() - 1);
0716: // ActionTranslator.g:337:22: ( WS )?
0717: int alt3 = 2;
0718: int LA3_0 = input.LA(1);
0719: if (((LA3_0 >= '\t' && LA3_0 <= '\n') || LA3_0 == ' ')) {
0720: alt3 = 1;
0721: }
0722: switch (alt3) {
0723: case 1:
0724: // ActionTranslator.g:337:22: WS
0725: {
0726: mWS();
0727: if (failed)
0728: return;
0729:
0730: }
0731: break;
0732:
0733: }
0734:
0735: match('=');
0736: if (failed)
0737: return;
0738: if (!(enclosingRule != null && input.LA(1) != '=')) {
0739: if (backtracking > 0) {
0740: failed = true;
0741: return;
0742: }
0743: throw new FailedPredicateException(input,
0744: "SET_RULE_SCOPE_ATTR",
0745: "enclosingRule!=null && input.LA(1)!='='");
0746: }
0747: if (backtracking == 1) {
0748:
0749: pair = enclosingRule.getRuleLabel(x.getText());
0750: refdRuleName = x.getText();
0751: if (pair != null) {
0752: refdRuleName = pair.referencedRuleName;
0753: }
0754:
0755: }
0756: if (!((enclosingRule.getRuleLabel(x.getText()) != null || isRuleRefInAlt(x
0757: .getText())) && getRuleLabelAttribute(
0758: enclosingRule.getRuleLabel(x.getText()) != null ? enclosingRule
0759: .getRuleLabel(x.getText()).referencedRuleName
0760: : x.getText(), y.getText()) != null)) {
0761: if (backtracking > 0) {
0762: failed = true;
0763: return;
0764: }
0765: throw new FailedPredicateException(
0766: input,
0767: "SET_RULE_SCOPE_ATTR",
0768: "(enclosingRule.getRuleLabel($x.text)!=null || isRuleRefInAlt($x.text)) &&\n\t getRuleLabelAttribute(enclosingRule.getRuleLabel($x.text)!=null?enclosingRule.getRuleLabel($x.text).referencedRuleName:$x.text,$y.text)!=null");
0769: }
0770: if (backtracking == 1) {
0771:
0772: ErrorManager.grammarError(
0773: ErrorManager.MSG_WRITE_TO_READONLY_ATTR,
0774: grammar, actionToken, x.getText(), y
0775: .getText());
0776:
0777: }
0778:
0779: }
0780:
0781: if (backtracking == 1) {
0782:
0783: if (token == null && ruleNestingLevel == 1) {
0784: emit(_type, _line, _charPosition, _channel, _start,
0785: getCharIndex() - 1);
0786: }
0787:
0788: }
0789: } finally {
0790: ruleNestingLevel--;
0791: }
0792: }
0793:
0794: // $ANTLR end SET_RULE_SCOPE_ATTR
0795:
0796: // $ANTLR start RULE_SCOPE_ATTR
0797: public void mRULE_SCOPE_ATTR() throws RecognitionException {
0798: try {
0799: ruleNestingLevel++;
0800: int _type = RULE_SCOPE_ATTR;
0801: int _start = getCharIndex();
0802: int _line = getLine();
0803: int _charPosition = getCharPositionInLine();
0804: int _channel = Token.DEFAULT_CHANNEL;
0805:
0806: Grammar.LabelElementPair pair = null;
0807: String refdRuleName = null;
0808:
0809: // ActionTranslator.g:366:4: ( '$' x= ID '.' y= ID {...}?{...}?)
0810: // ActionTranslator.g:366:4: '$' x= ID '.' y= ID {...}?{...}?
0811: {
0812: match('$');
0813: if (failed)
0814: return;
0815: int xStart = getCharIndex();
0816: mID();
0817: if (failed)
0818: return;
0819: Token x = new CommonToken(input,
0820: Token.INVALID_TOKEN_TYPE,
0821: Token.DEFAULT_CHANNEL, xStart,
0822: getCharIndex() - 1);
0823: match('.');
0824: if (failed)
0825: return;
0826: int yStart = getCharIndex();
0827: mID();
0828: if (failed)
0829: return;
0830: Token y = new CommonToken(input,
0831: Token.INVALID_TOKEN_TYPE,
0832: Token.DEFAULT_CHANNEL, yStart,
0833: getCharIndex() - 1);
0834: if (!(enclosingRule != null)) {
0835: if (backtracking > 0) {
0836: failed = true;
0837: return;
0838: }
0839: throw new FailedPredicateException(input,
0840: "RULE_SCOPE_ATTR", "enclosingRule!=null");
0841: }
0842: if (backtracking == 1) {
0843:
0844: pair = enclosingRule.getRuleLabel(x.getText());
0845: refdRuleName = x.getText();
0846: if (pair != null) {
0847: refdRuleName = pair.referencedRuleName;
0848: }
0849:
0850: }
0851: if (!((enclosingRule.getRuleLabel(x.getText()) != null || isRuleRefInAlt(x
0852: .getText())) && getRuleLabelAttribute(
0853: enclosingRule.getRuleLabel(x.getText()) != null ? enclosingRule
0854: .getRuleLabel(x.getText()).referencedRuleName
0855: : x.getText(), y.getText()) != null)) {
0856: if (backtracking > 0) {
0857: failed = true;
0858: return;
0859: }
0860: throw new FailedPredicateException(
0861: input,
0862: "RULE_SCOPE_ATTR",
0863: "(enclosingRule.getRuleLabel($x.text)!=null || isRuleRefInAlt($x.text)) &&\n\t getRuleLabelAttribute(enclosingRule.getRuleLabel($x.text)!=null?enclosingRule.getRuleLabel($x.text).referencedRuleName:$x.text,$y.text)!=null");
0864: }
0865: if (backtracking == 1) {
0866:
0867: String label = x.getText();
0868: if (pair == null) {
0869: // $ruleref.attr gotta get old label or compute new one
0870: checkElementRefUniqueness(x.getText(), false);
0871: label = enclosingRule.getElementLabel(x
0872: .getText(), outerAltNum, generator);
0873: if (label == null) {
0874: ErrorManager
0875: .grammarError(
0876: ErrorManager.MSG_FORWARD_ELEMENT_REF,
0877: grammar, actionToken, "$"
0878: + x.getText() + "."
0879: + y.getText());
0880: label = x.getText();
0881: }
0882: }
0883: StringTemplate st;
0884: Rule refdRule = grammar.getRule(refdRuleName);
0885: AttributeScope scope = refdRule
0886: .getLocalAttributeScope(y.getText());
0887: if (scope.isPredefinedRuleScope) {
0888: st = template("ruleLabelPropertyRef_"
0889: + y.getText());
0890: grammar
0891: .referenceRuleLabelPredefinedAttribute(refdRuleName);
0892: st.setAttribute("scope", label);
0893: st.setAttribute("attr", y.getText());
0894: } else if (scope.isPredefinedLexerRuleScope) {
0895: st = template("lexerRuleLabelPropertyRef_"
0896: + y.getText());
0897: grammar
0898: .referenceRuleLabelPredefinedAttribute(refdRuleName);
0899: st.setAttribute("scope", label);
0900: st.setAttribute("attr", y.getText());
0901: } else if (scope.isParameterScope) {
0902: // TODO: error!
0903: } else {
0904: st = template("ruleLabelRef");
0905: st.setAttribute("referencedRule", refdRule);
0906: st.setAttribute("scope", label);
0907: st.setAttribute("attr", scope.getAttribute(y
0908: .getText()));
0909: }
0910:
0911: }
0912:
0913: }
0914:
0915: if (backtracking == 1) {
0916:
0917: if (token == null && ruleNestingLevel == 1) {
0918: emit(_type, _line, _charPosition, _channel, _start,
0919: getCharIndex() - 1);
0920: }
0921:
0922: }
0923: } finally {
0924: ruleNestingLevel--;
0925: }
0926: }
0927:
0928: // $ANTLR end RULE_SCOPE_ATTR
0929:
0930: // $ANTLR start LABEL_REF
0931: public void mLABEL_REF() throws RecognitionException {
0932: try {
0933: ruleNestingLevel++;
0934: int _type = LABEL_REF;
0935: int _start = getCharIndex();
0936: int _line = getLine();
0937: int _charPosition = getCharPositionInLine();
0938: int _channel = Token.DEFAULT_CHANNEL;
0939: // ActionTranslator.g:424:4: ( '$' ID {...}?)
0940: // ActionTranslator.g:424:4: '$' ID {...}?
0941: {
0942: match('$');
0943: if (failed)
0944: return;
0945: int ID1Start = getCharIndex();
0946: mID();
0947: if (failed)
0948: return;
0949: Token ID1 = new CommonToken(input,
0950: Token.INVALID_TOKEN_TYPE,
0951: Token.DEFAULT_CHANNEL, ID1Start,
0952: getCharIndex() - 1);
0953: if (!(enclosingRule != null
0954: && getElementLabel(ID1.getText()) != null && enclosingRule
0955: .getRuleLabel(ID1.getText()) == null)) {
0956: if (backtracking > 0) {
0957: failed = true;
0958: return;
0959: }
0960: throw new FailedPredicateException(
0961: input,
0962: "LABEL_REF",
0963: "enclosingRule!=null &&\n\t getElementLabel($ID.text)!=null &&\n\t\t enclosingRule.getRuleLabel($ID.text)==null");
0964: }
0965: if (backtracking == 1) {
0966:
0967: StringTemplate st;
0968: Grammar.LabelElementPair pair = getElementLabel(ID1
0969: .getText());
0970: if (pair.type == Grammar.TOKEN_LABEL
0971: || pair.type == Grammar.CHAR_LABEL) {
0972: st = template("tokenLabelRef");
0973: } else {
0974: st = template("listLabelRef");
0975: }
0976: st.setAttribute("label", ID1.getText());
0977:
0978: }
0979:
0980: }
0981:
0982: if (backtracking == 1) {
0983:
0984: if (token == null && ruleNestingLevel == 1) {
0985: emit(_type, _line, _charPosition, _channel, _start,
0986: getCharIndex() - 1);
0987: }
0988:
0989: }
0990: } finally {
0991: ruleNestingLevel--;
0992: }
0993: }
0994:
0995: // $ANTLR end LABEL_REF
0996:
0997: // $ANTLR start ISOLATED_TOKEN_REF
0998: public void mISOLATED_TOKEN_REF() throws RecognitionException {
0999: try {
1000: ruleNestingLevel++;
1001: int _type = ISOLATED_TOKEN_REF;
1002: int _start = getCharIndex();
1003: int _line = getLine();
1004: int _charPosition = getCharPositionInLine();
1005: int _channel = Token.DEFAULT_CHANNEL;
1006: // ActionTranslator.g:443:4: ( '$' ID {...}?)
1007: // ActionTranslator.g:443:4: '$' ID {...}?
1008: {
1009: match('$');
1010: if (failed)
1011: return;
1012: int ID2Start = getCharIndex();
1013: mID();
1014: if (failed)
1015: return;
1016: Token ID2 = new CommonToken(input,
1017: Token.INVALID_TOKEN_TYPE,
1018: Token.DEFAULT_CHANNEL, ID2Start,
1019: getCharIndex() - 1);
1020: if (!(grammar.type != Grammar.LEXER
1021: && enclosingRule != null && isTokenRefInAlt(ID2
1022: .getText()))) {
1023: if (backtracking > 0) {
1024: failed = true;
1025: return;
1026: }
1027: throw new FailedPredicateException(
1028: input,
1029: "ISOLATED_TOKEN_REF",
1030: "grammar.type!=Grammar.LEXER && enclosingRule!=null && isTokenRefInAlt($ID.text)");
1031: }
1032: if (backtracking == 1) {
1033:
1034: String label = enclosingRule.getElementLabel(ID2
1035: .getText(), outerAltNum, generator);
1036: checkElementRefUniqueness(ID2.getText(), true);
1037: if (label == null) {
1038: ErrorManager.grammarError(
1039: ErrorManager.MSG_FORWARD_ELEMENT_REF,
1040: grammar, actionToken, ID2.getText());
1041: } else {
1042: StringTemplate st = template("tokenLabelRef");
1043: st.setAttribute("label", label);
1044: }
1045:
1046: }
1047:
1048: }
1049:
1050: if (backtracking == 1) {
1051:
1052: if (token == null && ruleNestingLevel == 1) {
1053: emit(_type, _line, _charPosition, _channel, _start,
1054: getCharIndex() - 1);
1055: }
1056:
1057: }
1058: } finally {
1059: ruleNestingLevel--;
1060: }
1061: }
1062:
1063: // $ANTLR end ISOLATED_TOKEN_REF
1064:
1065: // $ANTLR start ISOLATED_LEXER_RULE_REF
1066: public void mISOLATED_LEXER_RULE_REF() throws RecognitionException {
1067: try {
1068: ruleNestingLevel++;
1069: int _type = ISOLATED_LEXER_RULE_REF;
1070: int _start = getCharIndex();
1071: int _line = getLine();
1072: int _charPosition = getCharPositionInLine();
1073: int _channel = Token.DEFAULT_CHANNEL;
1074: // ActionTranslator.g:463:4: ( '$' ID {...}?)
1075: // ActionTranslator.g:463:4: '$' ID {...}?
1076: {
1077: match('$');
1078: if (failed)
1079: return;
1080: int ID3Start = getCharIndex();
1081: mID();
1082: if (failed)
1083: return;
1084: Token ID3 = new CommonToken(input,
1085: Token.INVALID_TOKEN_TYPE,
1086: Token.DEFAULT_CHANNEL, ID3Start,
1087: getCharIndex() - 1);
1088: if (!(grammar.type == Grammar.LEXER
1089: && enclosingRule != null && isRuleRefInAlt(ID3
1090: .getText()))) {
1091: if (backtracking > 0) {
1092: failed = true;
1093: return;
1094: }
1095: throw new FailedPredicateException(
1096: input,
1097: "ISOLATED_LEXER_RULE_REF",
1098: "grammar.type==Grammar.LEXER &&\n\t enclosingRule!=null &&\n\t isRuleRefInAlt($ID.text)");
1099: }
1100: if (backtracking == 1) {
1101:
1102: String label = enclosingRule.getElementLabel(ID3
1103: .getText(), outerAltNum, generator);
1104: checkElementRefUniqueness(ID3.getText(), false);
1105: if (label == null) {
1106: ErrorManager.grammarError(
1107: ErrorManager.MSG_FORWARD_ELEMENT_REF,
1108: grammar, actionToken, ID3.getText());
1109: } else {
1110: StringTemplate st = template("lexerRuleLabel");
1111: st.setAttribute("label", label);
1112: }
1113:
1114: }
1115:
1116: }
1117:
1118: if (backtracking == 1) {
1119:
1120: if (token == null && ruleNestingLevel == 1) {
1121: emit(_type, _line, _charPosition, _channel, _start,
1122: getCharIndex() - 1);
1123: }
1124:
1125: }
1126: } finally {
1127: ruleNestingLevel--;
1128: }
1129: }
1130:
1131: // $ANTLR end ISOLATED_LEXER_RULE_REF
1132:
1133: // $ANTLR start SET_LOCAL_ATTR
1134: public void mSET_LOCAL_ATTR() throws RecognitionException {
1135: try {
1136: ruleNestingLevel++;
1137: int _type = SET_LOCAL_ATTR;
1138: int _start = getCharIndex();
1139: int _line = getLine();
1140: int _charPosition = getCharPositionInLine();
1141: int _channel = Token.DEFAULT_CHANNEL;
1142: // ActionTranslator.g:495:4: ( '$' ID ( WS )? '=' expr= ATTR_VALUE_EXPR ';' {...}?)
1143: // ActionTranslator.g:495:4: '$' ID ( WS )? '=' expr= ATTR_VALUE_EXPR ';' {...}?
1144: {
1145: match('$');
1146: if (failed)
1147: return;
1148: int ID4Start = getCharIndex();
1149: mID();
1150: if (failed)
1151: return;
1152: Token ID4 = new CommonToken(input,
1153: Token.INVALID_TOKEN_TYPE,
1154: Token.DEFAULT_CHANNEL, ID4Start,
1155: getCharIndex() - 1);
1156: // ActionTranslator.g:495:11: ( WS )?
1157: int alt4 = 2;
1158: int LA4_0 = input.LA(1);
1159: if (((LA4_0 >= '\t' && LA4_0 <= '\n') || LA4_0 == ' ')) {
1160: alt4 = 1;
1161: }
1162: switch (alt4) {
1163: case 1:
1164: // ActionTranslator.g:495:11: WS
1165: {
1166: mWS();
1167: if (failed)
1168: return;
1169:
1170: }
1171: break;
1172:
1173: }
1174:
1175: match('=');
1176: if (failed)
1177: return;
1178: int exprStart = getCharIndex();
1179: mATTR_VALUE_EXPR();
1180: if (failed)
1181: return;
1182: Token expr = new CommonToken(input,
1183: Token.INVALID_TOKEN_TYPE,
1184: Token.DEFAULT_CHANNEL, exprStart,
1185: getCharIndex() - 1);
1186: match(';');
1187: if (failed)
1188: return;
1189: if (!(enclosingRule != null
1190: && enclosingRule.getLocalAttributeScope(ID4
1191: .getText()) != null && !enclosingRule
1192: .getLocalAttributeScope(ID4.getText()).isPredefinedLexerRuleScope)) {
1193: if (backtracking > 0) {
1194: failed = true;
1195: return;
1196: }
1197: throw new FailedPredicateException(
1198: input,
1199: "SET_LOCAL_ATTR",
1200: "enclosingRule!=null\n\t\t\t\t\t\t\t\t\t\t\t\t\t&& enclosingRule.getLocalAttributeScope($ID.text)!=null\n\t\t\t\t\t\t\t\t\t\t\t\t\t&& !enclosingRule.getLocalAttributeScope($ID.text).isPredefinedLexerRuleScope");
1201: }
1202: if (backtracking == 1) {
1203:
1204: StringTemplate st;
1205: AttributeScope scope = enclosingRule
1206: .getLocalAttributeScope(ID4.getText());
1207: if (scope.isPredefinedRuleScope) {
1208: if (ID4.getText().equals("tree")
1209: || ID4.getText().equals("st")) {
1210: st = template("ruleSetPropertyRef_"
1211: + ID4.getText());
1212: grammar
1213: .referenceRuleLabelPredefinedAttribute(enclosingRule.name);
1214: st
1215: .setAttribute("scope",
1216: enclosingRule.name);
1217: st.setAttribute("attr", ID4.getText());
1218: st.setAttribute("expr",
1219: translateAction(expr.getText()));
1220: } else {
1221: ErrorManager
1222: .grammarError(
1223: ErrorManager.MSG_WRITE_TO_READONLY_ATTR,
1224: grammar, actionToken, ID4
1225: .getText(), "");
1226: }
1227: } else if (scope.isParameterScope) {
1228: st = template("parameterSetAttributeRef");
1229: st.setAttribute("attr", scope.getAttribute(ID4
1230: .getText()));
1231: st.setAttribute("expr", translateAction(expr
1232: .getText()));
1233: } else {
1234: st = template("returnSetAttributeRef");
1235: st
1236: .setAttribute("ruleDescriptor",
1237: enclosingRule);
1238: st.setAttribute("attr", scope.getAttribute(ID4
1239: .getText()));
1240: st.setAttribute("expr", translateAction(expr
1241: .getText()));
1242: }
1243:
1244: }
1245:
1246: }
1247:
1248: if (backtracking == 1) {
1249:
1250: if (token == null && ruleNestingLevel == 1) {
1251: emit(_type, _line, _charPosition, _channel, _start,
1252: getCharIndex() - 1);
1253: }
1254:
1255: }
1256: } finally {
1257: ruleNestingLevel--;
1258: }
1259: }
1260:
1261: // $ANTLR end SET_LOCAL_ATTR
1262:
1263: // $ANTLR start LOCAL_ATTR
1264: public void mLOCAL_ATTR() throws RecognitionException {
1265: try {
1266: ruleNestingLevel++;
1267: int _type = LOCAL_ATTR;
1268: int _start = getCharIndex();
1269: int _line = getLine();
1270: int _charPosition = getCharPositionInLine();
1271: int _channel = Token.DEFAULT_CHANNEL;
1272: // ActionTranslator.g:531:4: ( '$' ID {...}?)
1273: // ActionTranslator.g:531:4: '$' ID {...}?
1274: {
1275: match('$');
1276: if (failed)
1277: return;
1278: int ID5Start = getCharIndex();
1279: mID();
1280: if (failed)
1281: return;
1282: Token ID5 = new CommonToken(input,
1283: Token.INVALID_TOKEN_TYPE,
1284: Token.DEFAULT_CHANNEL, ID5Start,
1285: getCharIndex() - 1);
1286: if (!(enclosingRule != null && enclosingRule
1287: .getLocalAttributeScope(ID5.getText()) != null)) {
1288: if (backtracking > 0) {
1289: failed = true;
1290: return;
1291: }
1292: throw new FailedPredicateException(input,
1293: "LOCAL_ATTR",
1294: "enclosingRule!=null && enclosingRule.getLocalAttributeScope($ID.text)!=null");
1295: }
1296: if (backtracking == 1) {
1297:
1298: StringTemplate st;
1299: AttributeScope scope = enclosingRule
1300: .getLocalAttributeScope(ID5.getText());
1301: if (scope.isPredefinedRuleScope) {
1302: st = template("rulePropertyRef_"
1303: + ID5.getText());
1304: grammar
1305: .referenceRuleLabelPredefinedAttribute(enclosingRule.name);
1306: st.setAttribute("scope", enclosingRule.name);
1307: st.setAttribute("attr", ID5.getText());
1308: } else if (scope.isPredefinedLexerRuleScope) {
1309: st = template("lexerRulePropertyRef_"
1310: + ID5.getText());
1311: st.setAttribute("scope", enclosingRule.name);
1312: st.setAttribute("attr", ID5.getText());
1313: } else if (scope.isParameterScope) {
1314: st = template("parameterAttributeRef");
1315: st.setAttribute("attr", scope.getAttribute(ID5
1316: .getText()));
1317: } else {
1318: st = template("returnAttributeRef");
1319: st
1320: .setAttribute("ruleDescriptor",
1321: enclosingRule);
1322: st.setAttribute("attr", scope.getAttribute(ID5
1323: .getText()));
1324: }
1325:
1326: }
1327:
1328: }
1329:
1330: if (backtracking == 1) {
1331:
1332: if (token == null && ruleNestingLevel == 1) {
1333: emit(_type, _line, _charPosition, _channel, _start,
1334: getCharIndex() - 1);
1335: }
1336:
1337: }
1338: } finally {
1339: ruleNestingLevel--;
1340: }
1341: }
1342:
1343: // $ANTLR end LOCAL_ATTR
1344:
1345: // $ANTLR start SET_DYNAMIC_SCOPE_ATTR
1346: public void mSET_DYNAMIC_SCOPE_ATTR() throws RecognitionException {
1347: try {
1348: ruleNestingLevel++;
1349: int _type = SET_DYNAMIC_SCOPE_ATTR;
1350: int _start = getCharIndex();
1351: int _line = getLine();
1352: int _charPosition = getCharPositionInLine();
1353: int _channel = Token.DEFAULT_CHANNEL;
1354: // ActionTranslator.g:572:4: ( '$' x= ID '::' y= ID ( WS )? '=' expr= ATTR_VALUE_EXPR ';' {...}?)
1355: // ActionTranslator.g:572:4: '$' x= ID '::' y= ID ( WS )? '=' expr= ATTR_VALUE_EXPR ';' {...}?
1356: {
1357: match('$');
1358: if (failed)
1359: return;
1360: int xStart = getCharIndex();
1361: mID();
1362: if (failed)
1363: return;
1364: Token x = new CommonToken(input,
1365: Token.INVALID_TOKEN_TYPE,
1366: Token.DEFAULT_CHANNEL, xStart,
1367: getCharIndex() - 1);
1368: match("::");
1369: if (failed)
1370: return;
1371:
1372: int yStart = getCharIndex();
1373: mID();
1374: if (failed)
1375: return;
1376: Token y = new CommonToken(input,
1377: Token.INVALID_TOKEN_TYPE,
1378: Token.DEFAULT_CHANNEL, yStart,
1379: getCharIndex() - 1);
1380: // ActionTranslator.g:572:23: ( WS )?
1381: int alt5 = 2;
1382: int LA5_0 = input.LA(1);
1383: if (((LA5_0 >= '\t' && LA5_0 <= '\n') || LA5_0 == ' ')) {
1384: alt5 = 1;
1385: }
1386: switch (alt5) {
1387: case 1:
1388: // ActionTranslator.g:572:23: WS
1389: {
1390: mWS();
1391: if (failed)
1392: return;
1393:
1394: }
1395: break;
1396:
1397: }
1398:
1399: match('=');
1400: if (failed)
1401: return;
1402: int exprStart = getCharIndex();
1403: mATTR_VALUE_EXPR();
1404: if (failed)
1405: return;
1406: Token expr = new CommonToken(input,
1407: Token.INVALID_TOKEN_TYPE,
1408: Token.DEFAULT_CHANNEL, exprStart,
1409: getCharIndex() - 1);
1410: match(';');
1411: if (failed)
1412: return;
1413: if (!(resolveDynamicScope(x.getText()) != null && resolveDynamicScope(
1414: x.getText()).getAttribute(y.getText()) != null)) {
1415: if (backtracking > 0) {
1416: failed = true;
1417: return;
1418: }
1419: throw new FailedPredicateException(
1420: input,
1421: "SET_DYNAMIC_SCOPE_ATTR",
1422: "resolveDynamicScope($x.text)!=null &&\n\t\t\t\t\t\t resolveDynamicScope($x.text).getAttribute($y.text)!=null");
1423: }
1424: if (backtracking == 1) {
1425:
1426: AttributeScope scope = resolveDynamicScope(x
1427: .getText());
1428: if (scope != null) {
1429: StringTemplate st = template("scopeSetAttributeRef");
1430: st.setAttribute("scope", x.getText());
1431: st.setAttribute("attr", scope.getAttribute(y
1432: .getText()));
1433: st.setAttribute("expr", translateAction(expr
1434: .getText()));
1435: } else {
1436: // error: invalid dynamic attribute
1437: }
1438:
1439: }
1440:
1441: }
1442:
1443: if (backtracking == 1) {
1444:
1445: if (token == null && ruleNestingLevel == 1) {
1446: emit(_type, _line, _charPosition, _channel, _start,
1447: getCharIndex() - 1);
1448: }
1449:
1450: }
1451: } finally {
1452: ruleNestingLevel--;
1453: }
1454: }
1455:
1456: // $ANTLR end SET_DYNAMIC_SCOPE_ATTR
1457:
1458: // $ANTLR start DYNAMIC_SCOPE_ATTR
1459: public void mDYNAMIC_SCOPE_ATTR() throws RecognitionException {
1460: try {
1461: ruleNestingLevel++;
1462: int _type = DYNAMIC_SCOPE_ATTR;
1463: int _start = getCharIndex();
1464: int _line = getLine();
1465: int _charPosition = getCharPositionInLine();
1466: int _channel = Token.DEFAULT_CHANNEL;
1467: // ActionTranslator.g:591:4: ( '$' x= ID '::' y= ID {...}?)
1468: // ActionTranslator.g:591:4: '$' x= ID '::' y= ID {...}?
1469: {
1470: match('$');
1471: if (failed)
1472: return;
1473: int xStart = getCharIndex();
1474: mID();
1475: if (failed)
1476: return;
1477: Token x = new CommonToken(input,
1478: Token.INVALID_TOKEN_TYPE,
1479: Token.DEFAULT_CHANNEL, xStart,
1480: getCharIndex() - 1);
1481: match("::");
1482: if (failed)
1483: return;
1484:
1485: int yStart = getCharIndex();
1486: mID();
1487: if (failed)
1488: return;
1489: Token y = new CommonToken(input,
1490: Token.INVALID_TOKEN_TYPE,
1491: Token.DEFAULT_CHANNEL, yStart,
1492: getCharIndex() - 1);
1493: if (!(resolveDynamicScope(x.getText()) != null && resolveDynamicScope(
1494: x.getText()).getAttribute(y.getText()) != null)) {
1495: if (backtracking > 0) {
1496: failed = true;
1497: return;
1498: }
1499: throw new FailedPredicateException(
1500: input,
1501: "DYNAMIC_SCOPE_ATTR",
1502: "resolveDynamicScope($x.text)!=null &&\n\t\t\t\t\t\t resolveDynamicScope($x.text).getAttribute($y.text)!=null");
1503: }
1504: if (backtracking == 1) {
1505:
1506: AttributeScope scope = resolveDynamicScope(x
1507: .getText());
1508: if (scope != null) {
1509: StringTemplate st = template("scopeAttributeRef");
1510: st.setAttribute("scope", x.getText());
1511: st.setAttribute("attr", scope.getAttribute(y
1512: .getText()));
1513: } else {
1514: // error: invalid dynamic attribute
1515: }
1516:
1517: }
1518:
1519: }
1520:
1521: if (backtracking == 1) {
1522:
1523: if (token == null && ruleNestingLevel == 1) {
1524: emit(_type, _line, _charPosition, _channel, _start,
1525: getCharIndex() - 1);
1526: }
1527:
1528: }
1529: } finally {
1530: ruleNestingLevel--;
1531: }
1532: }
1533:
1534: // $ANTLR end DYNAMIC_SCOPE_ATTR
1535:
1536: // $ANTLR start ERROR_SCOPED_XY
1537: public void mERROR_SCOPED_XY() throws RecognitionException {
1538: try {
1539: ruleNestingLevel++;
1540: int _type = ERROR_SCOPED_XY;
1541: int _start = getCharIndex();
1542: int _line = getLine();
1543: int _charPosition = getCharPositionInLine();
1544: int _channel = Token.DEFAULT_CHANNEL;
1545: // ActionTranslator.g:610:4: ( '$' x= ID '::' y= ID )
1546: // ActionTranslator.g:610:4: '$' x= ID '::' y= ID
1547: {
1548: match('$');
1549: if (failed)
1550: return;
1551: int xStart = getCharIndex();
1552: mID();
1553: if (failed)
1554: return;
1555: Token x = new CommonToken(input,
1556: Token.INVALID_TOKEN_TYPE,
1557: Token.DEFAULT_CHANNEL, xStart,
1558: getCharIndex() - 1);
1559: match("::");
1560: if (failed)
1561: return;
1562:
1563: int yStart = getCharIndex();
1564: mID();
1565: if (failed)
1566: return;
1567: Token y = new CommonToken(input,
1568: Token.INVALID_TOKEN_TYPE,
1569: Token.DEFAULT_CHANNEL, yStart,
1570: getCharIndex() - 1);
1571: if (backtracking == 1) {
1572:
1573: chunks.add(getText());
1574: generator.issueInvalidScopeError(x.getText(), y
1575: .getText(), enclosingRule, actionToken,
1576: outerAltNum);
1577:
1578: }
1579:
1580: }
1581:
1582: if (backtracking == 1) {
1583:
1584: if (token == null && ruleNestingLevel == 1) {
1585: emit(_type, _line, _charPosition, _channel, _start,
1586: getCharIndex() - 1);
1587: }
1588:
1589: }
1590: } finally {
1591: ruleNestingLevel--;
1592: }
1593: }
1594:
1595: // $ANTLR end ERROR_SCOPED_XY
1596:
1597: // $ANTLR start DYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR
1598: public void mDYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR()
1599: throws RecognitionException {
1600: try {
1601: ruleNestingLevel++;
1602: int _type = DYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR;
1603: int _start = getCharIndex();
1604: int _line = getLine();
1605: int _charPosition = getCharPositionInLine();
1606: int _channel = Token.DEFAULT_CHANNEL;
1607: // ActionTranslator.g:628:4: ( '$' x= ID '[' '-' expr= SCOPE_INDEX_EXPR ']' '::' y= ID )
1608: // ActionTranslator.g:628:4: '$' x= ID '[' '-' expr= SCOPE_INDEX_EXPR ']' '::' y= ID
1609: {
1610: match('$');
1611: if (failed)
1612: return;
1613: int xStart = getCharIndex();
1614: mID();
1615: if (failed)
1616: return;
1617: Token x = new CommonToken(input,
1618: Token.INVALID_TOKEN_TYPE,
1619: Token.DEFAULT_CHANNEL, xStart,
1620: getCharIndex() - 1);
1621: match('[');
1622: if (failed)
1623: return;
1624: match('-');
1625: if (failed)
1626: return;
1627: int exprStart = getCharIndex();
1628: mSCOPE_INDEX_EXPR();
1629: if (failed)
1630: return;
1631: Token expr = new CommonToken(input,
1632: Token.INVALID_TOKEN_TYPE,
1633: Token.DEFAULT_CHANNEL, exprStart,
1634: getCharIndex() - 1);
1635: match(']');
1636: if (failed)
1637: return;
1638: match("::");
1639: if (failed)
1640: return;
1641:
1642: int yStart = getCharIndex();
1643: mID();
1644: if (failed)
1645: return;
1646: Token y = new CommonToken(input,
1647: Token.INVALID_TOKEN_TYPE,
1648: Token.DEFAULT_CHANNEL, yStart,
1649: getCharIndex() - 1);
1650: if (backtracking == 1) {
1651:
1652: StringTemplate st = template("scopeAttributeRef");
1653: st.setAttribute("scope", x.getText());
1654: st.setAttribute("attr", resolveDynamicScope(
1655: x.getText()).getAttribute(y.getText()));
1656: st.setAttribute("negIndex", expr.getText());
1657:
1658: }
1659:
1660: }
1661:
1662: if (backtracking == 1) {
1663:
1664: if (token == null && ruleNestingLevel == 1) {
1665: emit(_type, _line, _charPosition, _channel, _start,
1666: getCharIndex() - 1);
1667: }
1668:
1669: }
1670: } finally {
1671: ruleNestingLevel--;
1672: }
1673: }
1674:
1675: // $ANTLR end DYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR
1676:
1677: // $ANTLR start DYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR
1678: public void mDYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR()
1679: throws RecognitionException {
1680: try {
1681: ruleNestingLevel++;
1682: int _type = DYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR;
1683: int _start = getCharIndex();
1684: int _line = getLine();
1685: int _charPosition = getCharPositionInLine();
1686: int _channel = Token.DEFAULT_CHANNEL;
1687: // ActionTranslator.g:639:4: ( '$' x= ID '[' expr= SCOPE_INDEX_EXPR ']' '::' y= ID )
1688: // ActionTranslator.g:639:4: '$' x= ID '[' expr= SCOPE_INDEX_EXPR ']' '::' y= ID
1689: {
1690: match('$');
1691: if (failed)
1692: return;
1693: int xStart = getCharIndex();
1694: mID();
1695: if (failed)
1696: return;
1697: Token x = new CommonToken(input,
1698: Token.INVALID_TOKEN_TYPE,
1699: Token.DEFAULT_CHANNEL, xStart,
1700: getCharIndex() - 1);
1701: match('[');
1702: if (failed)
1703: return;
1704: int exprStart = getCharIndex();
1705: mSCOPE_INDEX_EXPR();
1706: if (failed)
1707: return;
1708: Token expr = new CommonToken(input,
1709: Token.INVALID_TOKEN_TYPE,
1710: Token.DEFAULT_CHANNEL, exprStart,
1711: getCharIndex() - 1);
1712: match(']');
1713: if (failed)
1714: return;
1715: match("::");
1716: if (failed)
1717: return;
1718:
1719: int yStart = getCharIndex();
1720: mID();
1721: if (failed)
1722: return;
1723: Token y = new CommonToken(input,
1724: Token.INVALID_TOKEN_TYPE,
1725: Token.DEFAULT_CHANNEL, yStart,
1726: getCharIndex() - 1);
1727: if (backtracking == 1) {
1728:
1729: StringTemplate st = template("scopeAttributeRef");
1730: st.setAttribute("scope", x.getText());
1731: st.setAttribute("attr", resolveDynamicScope(
1732: x.getText()).getAttribute(y.getText()));
1733: st.setAttribute("index", expr.getText());
1734:
1735: }
1736:
1737: }
1738:
1739: if (backtracking == 1) {
1740:
1741: if (token == null && ruleNestingLevel == 1) {
1742: emit(_type, _line, _charPosition, _channel, _start,
1743: getCharIndex() - 1);
1744: }
1745:
1746: }
1747: } finally {
1748: ruleNestingLevel--;
1749: }
1750: }
1751:
1752: // $ANTLR end DYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR
1753:
1754: // $ANTLR start SCOPE_INDEX_EXPR
1755: public void mSCOPE_INDEX_EXPR() throws RecognitionException {
1756: try {
1757: ruleNestingLevel++;
1758: // ActionTranslator.g:651:4: ( (~ ']' )+ )
1759: // ActionTranslator.g:651:4: (~ ']' )+
1760: {
1761: // ActionTranslator.g:651:4: (~ ']' )+
1762: int cnt6 = 0;
1763: loop6: do {
1764: int alt6 = 2;
1765: int LA6_0 = input.LA(1);
1766: if (((LA6_0 >= '\u0000' && LA6_0 <= '\\') || (LA6_0 >= '^' && LA6_0 <= '\uFFFE'))) {
1767: alt6 = 1;
1768: }
1769:
1770: switch (alt6) {
1771: case 1:
1772: // ActionTranslator.g:651:5: ~ ']'
1773: {
1774: if ((input.LA(1) >= '\u0000' && input.LA(1) <= '\\')
1775: || (input.LA(1) >= '^' && input.LA(1) <= '\uFFFE')) {
1776: input.consume();
1777: failed = false;
1778: } else {
1779: if (backtracking > 0) {
1780: failed = true;
1781: return;
1782: }
1783: MismatchedSetException mse = new MismatchedSetException(
1784: null, input);
1785: recover(mse);
1786: throw mse;
1787: }
1788:
1789: }
1790: break;
1791:
1792: default:
1793: if (cnt6 >= 1)
1794: break loop6;
1795: if (backtracking > 0) {
1796: failed = true;
1797: return;
1798: }
1799: EarlyExitException eee = new EarlyExitException(
1800: 6, input);
1801: throw eee;
1802: }
1803: cnt6++;
1804: } while (true);
1805:
1806: }
1807:
1808: } finally {
1809: ruleNestingLevel--;
1810: }
1811: }
1812:
1813: // $ANTLR end SCOPE_INDEX_EXPR
1814:
1815: // $ANTLR start ISOLATED_DYNAMIC_SCOPE
1816: public void mISOLATED_DYNAMIC_SCOPE() throws RecognitionException {
1817: try {
1818: ruleNestingLevel++;
1819: int _type = ISOLATED_DYNAMIC_SCOPE;
1820: int _start = getCharIndex();
1821: int _line = getLine();
1822: int _charPosition = getCharPositionInLine();
1823: int _channel = Token.DEFAULT_CHANNEL;
1824: // ActionTranslator.g:660:4: ( '$' ID {...}?)
1825: // ActionTranslator.g:660:4: '$' ID {...}?
1826: {
1827: match('$');
1828: if (failed)
1829: return;
1830: int ID6Start = getCharIndex();
1831: mID();
1832: if (failed)
1833: return;
1834: Token ID6 = new CommonToken(input,
1835: Token.INVALID_TOKEN_TYPE,
1836: Token.DEFAULT_CHANNEL, ID6Start,
1837: getCharIndex() - 1);
1838: if (!(resolveDynamicScope(ID6.getText()) != null)) {
1839: if (backtracking > 0) {
1840: failed = true;
1841: return;
1842: }
1843: throw new FailedPredicateException(input,
1844: "ISOLATED_DYNAMIC_SCOPE",
1845: "resolveDynamicScope($ID.text)!=null");
1846: }
1847: if (backtracking == 1) {
1848:
1849: StringTemplate st = template("isolatedDynamicScopeRef");
1850: st.setAttribute("scope", ID6.getText());
1851:
1852: }
1853:
1854: }
1855:
1856: if (backtracking == 1) {
1857:
1858: if (token == null && ruleNestingLevel == 1) {
1859: emit(_type, _line, _charPosition, _channel, _start,
1860: getCharIndex() - 1);
1861: }
1862:
1863: }
1864: } finally {
1865: ruleNestingLevel--;
1866: }
1867: }
1868:
1869: // $ANTLR end ISOLATED_DYNAMIC_SCOPE
1870:
1871: // $ANTLR start TEMPLATE_INSTANCE
1872: public void mTEMPLATE_INSTANCE() throws RecognitionException {
1873: try {
1874: ruleNestingLevel++;
1875: int _type = TEMPLATE_INSTANCE;
1876: int _start = getCharIndex();
1877: int _line = getLine();
1878: int _charPosition = getCharPositionInLine();
1879: int _channel = Token.DEFAULT_CHANNEL;
1880: // ActionTranslator.g:673:4: ( '%' ID '(' ( ( WS )? ARG ( ',' ( WS )? ARG )* ( WS )? )? ')' )
1881: // ActionTranslator.g:673:4: '%' ID '(' ( ( WS )? ARG ( ',' ( WS )? ARG )* ( WS )? )? ')'
1882: {
1883: match('%');
1884: if (failed)
1885: return;
1886: mID();
1887: if (failed)
1888: return;
1889: match('(');
1890: if (failed)
1891: return;
1892: // ActionTranslator.g:673:15: ( ( WS )? ARG ( ',' ( WS )? ARG )* ( WS )? )?
1893: int alt11 = 2;
1894: int LA11_0 = input.LA(1);
1895: if (((LA11_0 >= '\t' && LA11_0 <= '\n')
1896: || LA11_0 == ' '
1897: || (LA11_0 >= 'A' && LA11_0 <= 'Z')
1898: || LA11_0 == '_' || (LA11_0 >= 'a' && LA11_0 <= 'z'))) {
1899: alt11 = 1;
1900: }
1901: switch (alt11) {
1902: case 1:
1903: // ActionTranslator.g:673:17: ( WS )? ARG ( ',' ( WS )? ARG )* ( WS )?
1904: {
1905: // ActionTranslator.g:673:17: ( WS )?
1906: int alt7 = 2;
1907: int LA7_0 = input.LA(1);
1908: if (((LA7_0 >= '\t' && LA7_0 <= '\n') || LA7_0 == ' ')) {
1909: alt7 = 1;
1910: }
1911: switch (alt7) {
1912: case 1:
1913: // ActionTranslator.g:673:17: WS
1914: {
1915: mWS();
1916: if (failed)
1917: return;
1918:
1919: }
1920: break;
1921:
1922: }
1923:
1924: mARG();
1925: if (failed)
1926: return;
1927: // ActionTranslator.g:673:25: ( ',' ( WS )? ARG )*
1928: loop9: do {
1929: int alt9 = 2;
1930: int LA9_0 = input.LA(1);
1931: if ((LA9_0 == ',')) {
1932: alt9 = 1;
1933: }
1934:
1935: switch (alt9) {
1936: case 1:
1937: // ActionTranslator.g:673:26: ',' ( WS )? ARG
1938: {
1939: match(',');
1940: if (failed)
1941: return;
1942: // ActionTranslator.g:673:30: ( WS )?
1943: int alt8 = 2;
1944: int LA8_0 = input.LA(1);
1945: if (((LA8_0 >= '\t' && LA8_0 <= '\n') || LA8_0 == ' ')) {
1946: alt8 = 1;
1947: }
1948: switch (alt8) {
1949: case 1:
1950: // ActionTranslator.g:673:30: WS
1951: {
1952: mWS();
1953: if (failed)
1954: return;
1955:
1956: }
1957: break;
1958:
1959: }
1960:
1961: mARG();
1962: if (failed)
1963: return;
1964:
1965: }
1966: break;
1967:
1968: default:
1969: break loop9;
1970: }
1971: } while (true);
1972:
1973: // ActionTranslator.g:673:40: ( WS )?
1974: int alt10 = 2;
1975: int LA10_0 = input.LA(1);
1976: if (((LA10_0 >= '\t' && LA10_0 <= '\n') || LA10_0 == ' ')) {
1977: alt10 = 1;
1978: }
1979: switch (alt10) {
1980: case 1:
1981: // ActionTranslator.g:673:40: WS
1982: {
1983: mWS();
1984: if (failed)
1985: return;
1986:
1987: }
1988: break;
1989:
1990: }
1991:
1992: }
1993: break;
1994:
1995: }
1996:
1997: match(')');
1998: if (failed)
1999: return;
2000: if (backtracking == 1) {
2001:
2002: String action = getText().substring(1,
2003: getText().length());
2004: String ruleName = "<outside-of-rule>";
2005: if (enclosingRule != null) {
2006: ruleName = enclosingRule.name;
2007: }
2008: StringTemplate st = generator
2009: .translateTemplateConstructor(ruleName,
2010: outerAltNum, actionToken, action);
2011: if (st != null) {
2012: chunks.add(st);
2013: }
2014:
2015: }
2016:
2017: }
2018:
2019: if (backtracking == 1) {
2020:
2021: if (token == null && ruleNestingLevel == 1) {
2022: emit(_type, _line, _charPosition, _channel, _start,
2023: getCharIndex() - 1);
2024: }
2025:
2026: }
2027: } finally {
2028: ruleNestingLevel--;
2029: }
2030: }
2031:
2032: // $ANTLR end TEMPLATE_INSTANCE
2033:
2034: // $ANTLR start INDIRECT_TEMPLATE_INSTANCE
2035: public void mINDIRECT_TEMPLATE_INSTANCE()
2036: throws RecognitionException {
2037: try {
2038: ruleNestingLevel++;
2039: int _type = INDIRECT_TEMPLATE_INSTANCE;
2040: int _start = getCharIndex();
2041: int _line = getLine();
2042: int _charPosition = getCharPositionInLine();
2043: int _channel = Token.DEFAULT_CHANNEL;
2044: // ActionTranslator.g:694:4: ( '%' '(' ACTION ')' '(' ( ( WS )? ARG ( ',' ( WS )? ARG )* ( WS )? )? ')' )
2045: // ActionTranslator.g:694:4: '%' '(' ACTION ')' '(' ( ( WS )? ARG ( ',' ( WS )? ARG )* ( WS )? )? ')'
2046: {
2047: match('%');
2048: if (failed)
2049: return;
2050: match('(');
2051: if (failed)
2052: return;
2053: mACTION();
2054: if (failed)
2055: return;
2056: match(')');
2057: if (failed)
2058: return;
2059: match('(');
2060: if (failed)
2061: return;
2062: // ActionTranslator.g:694:27: ( ( WS )? ARG ( ',' ( WS )? ARG )* ( WS )? )?
2063: int alt16 = 2;
2064: int LA16_0 = input.LA(1);
2065: if (((LA16_0 >= '\t' && LA16_0 <= '\n')
2066: || LA16_0 == ' '
2067: || (LA16_0 >= 'A' && LA16_0 <= 'Z')
2068: || LA16_0 == '_' || (LA16_0 >= 'a' && LA16_0 <= 'z'))) {
2069: alt16 = 1;
2070: }
2071: switch (alt16) {
2072: case 1:
2073: // ActionTranslator.g:694:29: ( WS )? ARG ( ',' ( WS )? ARG )* ( WS )?
2074: {
2075: // ActionTranslator.g:694:29: ( WS )?
2076: int alt12 = 2;
2077: int LA12_0 = input.LA(1);
2078: if (((LA12_0 >= '\t' && LA12_0 <= '\n') || LA12_0 == ' ')) {
2079: alt12 = 1;
2080: }
2081: switch (alt12) {
2082: case 1:
2083: // ActionTranslator.g:694:29: WS
2084: {
2085: mWS();
2086: if (failed)
2087: return;
2088:
2089: }
2090: break;
2091:
2092: }
2093:
2094: mARG();
2095: if (failed)
2096: return;
2097: // ActionTranslator.g:694:37: ( ',' ( WS )? ARG )*
2098: loop14: do {
2099: int alt14 = 2;
2100: int LA14_0 = input.LA(1);
2101: if ((LA14_0 == ',')) {
2102: alt14 = 1;
2103: }
2104:
2105: switch (alt14) {
2106: case 1:
2107: // ActionTranslator.g:694:38: ',' ( WS )? ARG
2108: {
2109: match(',');
2110: if (failed)
2111: return;
2112: // ActionTranslator.g:694:42: ( WS )?
2113: int alt13 = 2;
2114: int LA13_0 = input.LA(1);
2115: if (((LA13_0 >= '\t' && LA13_0 <= '\n') || LA13_0 == ' ')) {
2116: alt13 = 1;
2117: }
2118: switch (alt13) {
2119: case 1:
2120: // ActionTranslator.g:694:42: WS
2121: {
2122: mWS();
2123: if (failed)
2124: return;
2125:
2126: }
2127: break;
2128:
2129: }
2130:
2131: mARG();
2132: if (failed)
2133: return;
2134:
2135: }
2136: break;
2137:
2138: default:
2139: break loop14;
2140: }
2141: } while (true);
2142:
2143: // ActionTranslator.g:694:52: ( WS )?
2144: int alt15 = 2;
2145: int LA15_0 = input.LA(1);
2146: if (((LA15_0 >= '\t' && LA15_0 <= '\n') || LA15_0 == ' ')) {
2147: alt15 = 1;
2148: }
2149: switch (alt15) {
2150: case 1:
2151: // ActionTranslator.g:694:52: WS
2152: {
2153: mWS();
2154: if (failed)
2155: return;
2156:
2157: }
2158: break;
2159:
2160: }
2161:
2162: }
2163: break;
2164:
2165: }
2166:
2167: match(')');
2168: if (failed)
2169: return;
2170: if (backtracking == 1) {
2171:
2172: String action = getText().substring(1,
2173: getText().length());
2174: StringTemplate st = generator
2175: .translateTemplateConstructor(
2176: enclosingRule.name, outerAltNum,
2177: actionToken, action);
2178: chunks.add(st);
2179:
2180: }
2181:
2182: }
2183:
2184: if (backtracking == 1) {
2185:
2186: if (token == null && ruleNestingLevel == 1) {
2187: emit(_type, _line, _charPosition, _channel, _start,
2188: getCharIndex() - 1);
2189: }
2190:
2191: }
2192: } finally {
2193: ruleNestingLevel--;
2194: }
2195: }
2196:
2197: // $ANTLR end INDIRECT_TEMPLATE_INSTANCE
2198:
2199: // $ANTLR start ARG
2200: public void mARG() throws RecognitionException {
2201: try {
2202: ruleNestingLevel++;
2203: // ActionTranslator.g:708:7: ( ID '=' ACTION )
2204: // ActionTranslator.g:708:7: ID '=' ACTION
2205: {
2206: mID();
2207: if (failed)
2208: return;
2209: match('=');
2210: if (failed)
2211: return;
2212: mACTION();
2213: if (failed)
2214: return;
2215:
2216: }
2217:
2218: } finally {
2219: ruleNestingLevel--;
2220: }
2221: }
2222:
2223: // $ANTLR end ARG
2224:
2225: // $ANTLR start SET_EXPR_ATTRIBUTE
2226: public void mSET_EXPR_ATTRIBUTE() throws RecognitionException {
2227: try {
2228: ruleNestingLevel++;
2229: int _type = SET_EXPR_ATTRIBUTE;
2230: int _start = getCharIndex();
2231: int _line = getLine();
2232: int _charPosition = getCharPositionInLine();
2233: int _channel = Token.DEFAULT_CHANNEL;
2234: // ActionTranslator.g:713:4: ( '%' a= ACTION '.' ID ( WS )? '=' expr= ATTR_VALUE_EXPR ';' )
2235: // ActionTranslator.g:713:4: '%' a= ACTION '.' ID ( WS )? '=' expr= ATTR_VALUE_EXPR ';'
2236: {
2237: match('%');
2238: if (failed)
2239: return;
2240: int aStart = getCharIndex();
2241: mACTION();
2242: if (failed)
2243: return;
2244: Token a = new CommonToken(input,
2245: Token.INVALID_TOKEN_TYPE,
2246: Token.DEFAULT_CHANNEL, aStart,
2247: getCharIndex() - 1);
2248: match('.');
2249: if (failed)
2250: return;
2251: int ID7Start = getCharIndex();
2252: mID();
2253: if (failed)
2254: return;
2255: Token ID7 = new CommonToken(input,
2256: Token.INVALID_TOKEN_TYPE,
2257: Token.DEFAULT_CHANNEL, ID7Start,
2258: getCharIndex() - 1);
2259: // ActionTranslator.g:713:24: ( WS )?
2260: int alt17 = 2;
2261: int LA17_0 = input.LA(1);
2262: if (((LA17_0 >= '\t' && LA17_0 <= '\n') || LA17_0 == ' ')) {
2263: alt17 = 1;
2264: }
2265: switch (alt17) {
2266: case 1:
2267: // ActionTranslator.g:713:24: WS
2268: {
2269: mWS();
2270: if (failed)
2271: return;
2272:
2273: }
2274: break;
2275:
2276: }
2277:
2278: match('=');
2279: if (failed)
2280: return;
2281: int exprStart = getCharIndex();
2282: mATTR_VALUE_EXPR();
2283: if (failed)
2284: return;
2285: Token expr = new CommonToken(input,
2286: Token.INVALID_TOKEN_TYPE,
2287: Token.DEFAULT_CHANNEL, exprStart,
2288: getCharIndex() - 1);
2289: match(';');
2290: if (failed)
2291: return;
2292: if (backtracking == 1) {
2293:
2294: StringTemplate st = template("actionSetAttribute");
2295: String action = a.getText();
2296: action = action.substring(1, action.length() - 1); // stuff inside {...}
2297: st.setAttribute("st", translateAction(action));
2298: st.setAttribute("attrName", ID7.getText());
2299: st.setAttribute("expr", translateAction(expr
2300: .getText()));
2301:
2302: }
2303:
2304: }
2305:
2306: if (backtracking == 1) {
2307:
2308: if (token == null && ruleNestingLevel == 1) {
2309: emit(_type, _line, _charPosition, _channel, _start,
2310: getCharIndex() - 1);
2311: }
2312:
2313: }
2314: } finally {
2315: ruleNestingLevel--;
2316: }
2317: }
2318:
2319: // $ANTLR end SET_EXPR_ATTRIBUTE
2320:
2321: // $ANTLR start SET_ATTRIBUTE
2322: public void mSET_ATTRIBUTE() throws RecognitionException {
2323: try {
2324: ruleNestingLevel++;
2325: int _type = SET_ATTRIBUTE;
2326: int _start = getCharIndex();
2327: int _line = getLine();
2328: int _charPosition = getCharPositionInLine();
2329: int _channel = Token.DEFAULT_CHANNEL;
2330: // ActionTranslator.g:730:4: ( '%' x= ID '.' y= ID ( WS )? '=' expr= ATTR_VALUE_EXPR ';' )
2331: // ActionTranslator.g:730:4: '%' x= ID '.' y= ID ( WS )? '=' expr= ATTR_VALUE_EXPR ';'
2332: {
2333: match('%');
2334: if (failed)
2335: return;
2336: int xStart = getCharIndex();
2337: mID();
2338: if (failed)
2339: return;
2340: Token x = new CommonToken(input,
2341: Token.INVALID_TOKEN_TYPE,
2342: Token.DEFAULT_CHANNEL, xStart,
2343: getCharIndex() - 1);
2344: match('.');
2345: if (failed)
2346: return;
2347: int yStart = getCharIndex();
2348: mID();
2349: if (failed)
2350: return;
2351: Token y = new CommonToken(input,
2352: Token.INVALID_TOKEN_TYPE,
2353: Token.DEFAULT_CHANNEL, yStart,
2354: getCharIndex() - 1);
2355: // ActionTranslator.g:730:22: ( WS )?
2356: int alt18 = 2;
2357: int LA18_0 = input.LA(1);
2358: if (((LA18_0 >= '\t' && LA18_0 <= '\n') || LA18_0 == ' ')) {
2359: alt18 = 1;
2360: }
2361: switch (alt18) {
2362: case 1:
2363: // ActionTranslator.g:730:22: WS
2364: {
2365: mWS();
2366: if (failed)
2367: return;
2368:
2369: }
2370: break;
2371:
2372: }
2373:
2374: match('=');
2375: if (failed)
2376: return;
2377: int exprStart = getCharIndex();
2378: mATTR_VALUE_EXPR();
2379: if (failed)
2380: return;
2381: Token expr = new CommonToken(input,
2382: Token.INVALID_TOKEN_TYPE,
2383: Token.DEFAULT_CHANNEL, exprStart,
2384: getCharIndex() - 1);
2385: match(';');
2386: if (failed)
2387: return;
2388: if (backtracking == 1) {
2389:
2390: StringTemplate st = template("actionSetAttribute");
2391: st.setAttribute("st", x.getText());
2392: st.setAttribute("attrName", y.getText());
2393: st.setAttribute("expr", translateAction(expr
2394: .getText()));
2395:
2396: }
2397:
2398: }
2399:
2400: if (backtracking == 1) {
2401:
2402: if (token == null && ruleNestingLevel == 1) {
2403: emit(_type, _line, _charPosition, _channel, _start,
2404: getCharIndex() - 1);
2405: }
2406:
2407: }
2408: } finally {
2409: ruleNestingLevel--;
2410: }
2411: }
2412:
2413: // $ANTLR end SET_ATTRIBUTE
2414:
2415: // $ANTLR start ATTR_VALUE_EXPR
2416: public void mATTR_VALUE_EXPR() throws RecognitionException {
2417: try {
2418: ruleNestingLevel++;
2419: // ActionTranslator.g:743:4: (~ '=' (~ ';' )* )
2420: // ActionTranslator.g:743:4: ~ '=' (~ ';' )*
2421: {
2422: if ((input.LA(1) >= '\u0000' && input.LA(1) <= '<')
2423: || (input.LA(1) >= '>' && input.LA(1) <= '\uFFFE')) {
2424: input.consume();
2425: failed = false;
2426: } else {
2427: if (backtracking > 0) {
2428: failed = true;
2429: return;
2430: }
2431: MismatchedSetException mse = new MismatchedSetException(
2432: null, input);
2433: recover(mse);
2434: throw mse;
2435: }
2436:
2437: // ActionTranslator.g:743:9: (~ ';' )*
2438: loop19: do {
2439: int alt19 = 2;
2440: int LA19_0 = input.LA(1);
2441: if (((LA19_0 >= '\u0000' && LA19_0 <= ':') || (LA19_0 >= '<' && LA19_0 <= '\uFFFE'))) {
2442: alt19 = 1;
2443: }
2444:
2445: switch (alt19) {
2446: case 1:
2447: // ActionTranslator.g:743:10: ~ ';'
2448: {
2449: if ((input.LA(1) >= '\u0000' && input.LA(1) <= ':')
2450: || (input.LA(1) >= '<' && input.LA(1) <= '\uFFFE')) {
2451: input.consume();
2452: failed = false;
2453: } else {
2454: if (backtracking > 0) {
2455: failed = true;
2456: return;
2457: }
2458: MismatchedSetException mse = new MismatchedSetException(
2459: null, input);
2460: recover(mse);
2461: throw mse;
2462: }
2463:
2464: }
2465: break;
2466:
2467: default:
2468: break loop19;
2469: }
2470: } while (true);
2471:
2472: }
2473:
2474: } finally {
2475: ruleNestingLevel--;
2476: }
2477: }
2478:
2479: // $ANTLR end ATTR_VALUE_EXPR
2480:
2481: // $ANTLR start TEMPLATE_EXPR
2482: public void mTEMPLATE_EXPR() throws RecognitionException {
2483: try {
2484: ruleNestingLevel++;
2485: int _type = TEMPLATE_EXPR;
2486: int _start = getCharIndex();
2487: int _line = getLine();
2488: int _charPosition = getCharPositionInLine();
2489: int _channel = Token.DEFAULT_CHANNEL;
2490: // ActionTranslator.g:748:4: ( '%' a= ACTION )
2491: // ActionTranslator.g:748:4: '%' a= ACTION
2492: {
2493: match('%');
2494: if (failed)
2495: return;
2496: int aStart = getCharIndex();
2497: mACTION();
2498: if (failed)
2499: return;
2500: Token a = new CommonToken(input,
2501: Token.INVALID_TOKEN_TYPE,
2502: Token.DEFAULT_CHANNEL, aStart,
2503: getCharIndex() - 1);
2504: if (backtracking == 1) {
2505:
2506: StringTemplate st = template("actionStringConstructor");
2507: String action = a.getText();
2508: action = action.substring(1, action.length() - 1); // stuff inside {...}
2509: st.setAttribute("stringExpr",
2510: translateAction(action));
2511:
2512: }
2513:
2514: }
2515:
2516: if (backtracking == 1) {
2517:
2518: if (token == null && ruleNestingLevel == 1) {
2519: emit(_type, _line, _charPosition, _channel, _start,
2520: getCharIndex() - 1);
2521: }
2522:
2523: }
2524: } finally {
2525: ruleNestingLevel--;
2526: }
2527: }
2528:
2529: // $ANTLR end TEMPLATE_EXPR
2530:
2531: // $ANTLR start ACTION
2532: public void mACTION() throws RecognitionException {
2533: try {
2534: ruleNestingLevel++;
2535: // ActionTranslator.g:760:4: ( '{' ( options {greedy=false; } : . )* '}' )
2536: // ActionTranslator.g:760:4: '{' ( options {greedy=false; } : . )* '}'
2537: {
2538: match('{');
2539: if (failed)
2540: return;
2541: // ActionTranslator.g:760:8: ( options {greedy=false; } : . )*
2542: loop20: do {
2543: int alt20 = 2;
2544: int LA20_0 = input.LA(1);
2545: if ((LA20_0 == '}')) {
2546: alt20 = 2;
2547: } else if (((LA20_0 >= '\u0000' && LA20_0 <= '|') || (LA20_0 >= '~' && LA20_0 <= '\uFFFE'))) {
2548: alt20 = 1;
2549: }
2550:
2551: switch (alt20) {
2552: case 1:
2553: // ActionTranslator.g:760:33: .
2554: {
2555: matchAny();
2556: if (failed)
2557: return;
2558:
2559: }
2560: break;
2561:
2562: default:
2563: break loop20;
2564: }
2565: } while (true);
2566:
2567: match('}');
2568: if (failed)
2569: return;
2570:
2571: }
2572:
2573: } finally {
2574: ruleNestingLevel--;
2575: }
2576: }
2577:
2578: // $ANTLR end ACTION
2579:
2580: // $ANTLR start ESC
2581: public void mESC() throws RecognitionException {
2582: try {
2583: ruleNestingLevel++;
2584: int _type = ESC;
2585: int _start = getCharIndex();
2586: int _line = getLine();
2587: int _charPosition = getCharPositionInLine();
2588: int _channel = Token.DEFAULT_CHANNEL;
2589: // ActionTranslator.g:763:9: ( '\\\\' '$' | '\\\\' '%' | '\\\\' ~ ('$'|'%'))
2590: int alt21 = 3;
2591: int LA21_0 = input.LA(1);
2592: if ((LA21_0 == '\\')) {
2593: int LA21_1 = input.LA(2);
2594: if ((LA21_1 == '%')) {
2595: alt21 = 2;
2596: } else if ((LA21_1 == '$')) {
2597: alt21 = 1;
2598: } else if (((LA21_1 >= '\u0000' && LA21_1 <= '#') || (LA21_1 >= '&' && LA21_1 <= '\uFFFE'))) {
2599: alt21 = 3;
2600: } else {
2601: if (backtracking > 0) {
2602: failed = true;
2603: return;
2604: }
2605: NoViableAltException nvae = new NoViableAltException(
2606: "763:1: ESC : ( '\\\\' '$' | '\\\\' '%' | '\\\\' ~ ('$'|'%'));",
2607: 21, 1, input);
2608:
2609: throw nvae;
2610: }
2611: } else {
2612: if (backtracking > 0) {
2613: failed = true;
2614: return;
2615: }
2616: NoViableAltException nvae = new NoViableAltException(
2617: "763:1: ESC : ( '\\\\' '$' | '\\\\' '%' | '\\\\' ~ ('$'|'%'));",
2618: 21, 0, input);
2619:
2620: throw nvae;
2621: }
2622: switch (alt21) {
2623: case 1:
2624: // ActionTranslator.g:763:9: '\\\\' '$'
2625: {
2626: match('\\');
2627: if (failed)
2628: return;
2629: match('$');
2630: if (failed)
2631: return;
2632: if (backtracking == 1) {
2633: chunks.add("$");
2634: }
2635:
2636: }
2637: break;
2638: case 2:
2639: // ActionTranslator.g:764:4: '\\\\' '%'
2640: {
2641: match('\\');
2642: if (failed)
2643: return;
2644: match('%');
2645: if (failed)
2646: return;
2647: if (backtracking == 1) {
2648: chunks.add("%");
2649: }
2650:
2651: }
2652: break;
2653: case 3:
2654: // ActionTranslator.g:765:4: '\\\\' ~ ('$'|'%')
2655: {
2656: match('\\');
2657: if (failed)
2658: return;
2659: if ((input.LA(1) >= '\u0000' && input.LA(1) <= '#')
2660: || (input.LA(1) >= '&' && input.LA(1) <= '\uFFFE')) {
2661: input.consume();
2662: failed = false;
2663: } else {
2664: if (backtracking > 0) {
2665: failed = true;
2666: return;
2667: }
2668: MismatchedSetException mse = new MismatchedSetException(
2669: null, input);
2670: recover(mse);
2671: throw mse;
2672: }
2673:
2674: if (backtracking == 1) {
2675: chunks.add(getText());
2676: }
2677:
2678: }
2679: break;
2680:
2681: }
2682:
2683: if (backtracking == 1) {
2684:
2685: if (token == null && ruleNestingLevel == 1) {
2686: emit(_type, _line, _charPosition, _channel, _start,
2687: getCharIndex() - 1);
2688: }
2689:
2690: }
2691: } finally {
2692: ruleNestingLevel--;
2693: }
2694: }
2695:
2696: // $ANTLR end ESC
2697:
2698: // $ANTLR start ERROR_XY
2699: public void mERROR_XY() throws RecognitionException {
2700: try {
2701: ruleNestingLevel++;
2702: int _type = ERROR_XY;
2703: int _start = getCharIndex();
2704: int _line = getLine();
2705: int _charPosition = getCharPositionInLine();
2706: int _channel = Token.DEFAULT_CHANNEL;
2707: // ActionTranslator.g:769:4: ( '$' x= ID '.' y= ID )
2708: // ActionTranslator.g:769:4: '$' x= ID '.' y= ID
2709: {
2710: match('$');
2711: if (failed)
2712: return;
2713: int xStart = getCharIndex();
2714: mID();
2715: if (failed)
2716: return;
2717: Token x = new CommonToken(input,
2718: Token.INVALID_TOKEN_TYPE,
2719: Token.DEFAULT_CHANNEL, xStart,
2720: getCharIndex() - 1);
2721: match('.');
2722: if (failed)
2723: return;
2724: int yStart = getCharIndex();
2725: mID();
2726: if (failed)
2727: return;
2728: Token y = new CommonToken(input,
2729: Token.INVALID_TOKEN_TYPE,
2730: Token.DEFAULT_CHANNEL, yStart,
2731: getCharIndex() - 1);
2732: if (backtracking == 1) {
2733:
2734: chunks.add(getText());
2735: generator.issueInvalidAttributeError(x.getText(), y
2736: .getText(), enclosingRule, actionToken,
2737: outerAltNum);
2738:
2739: }
2740:
2741: }
2742:
2743: if (backtracking == 1) {
2744:
2745: if (token == null && ruleNestingLevel == 1) {
2746: emit(_type, _line, _charPosition, _channel, _start,
2747: getCharIndex() - 1);
2748: }
2749:
2750: }
2751: } finally {
2752: ruleNestingLevel--;
2753: }
2754: }
2755:
2756: // $ANTLR end ERROR_XY
2757:
2758: // $ANTLR start ERROR_X
2759: public void mERROR_X() throws RecognitionException {
2760: try {
2761: ruleNestingLevel++;
2762: int _type = ERROR_X;
2763: int _start = getCharIndex();
2764: int _line = getLine();
2765: int _charPosition = getCharPositionInLine();
2766: int _channel = Token.DEFAULT_CHANNEL;
2767: // ActionTranslator.g:779:4: ( '$' x= ID )
2768: // ActionTranslator.g:779:4: '$' x= ID
2769: {
2770: match('$');
2771: if (failed)
2772: return;
2773: int xStart = getCharIndex();
2774: mID();
2775: if (failed)
2776: return;
2777: Token x = new CommonToken(input,
2778: Token.INVALID_TOKEN_TYPE,
2779: Token.DEFAULT_CHANNEL, xStart,
2780: getCharIndex() - 1);
2781: if (backtracking == 1) {
2782:
2783: chunks.add(getText());
2784: generator.issueInvalidAttributeError(x.getText(),
2785: enclosingRule, actionToken, outerAltNum);
2786:
2787: }
2788:
2789: }
2790:
2791: if (backtracking == 1) {
2792:
2793: if (token == null && ruleNestingLevel == 1) {
2794: emit(_type, _line, _charPosition, _channel, _start,
2795: getCharIndex() - 1);
2796: }
2797:
2798: }
2799: } finally {
2800: ruleNestingLevel--;
2801: }
2802: }
2803:
2804: // $ANTLR end ERROR_X
2805:
2806: // $ANTLR start UNKNOWN_SYNTAX
2807: public void mUNKNOWN_SYNTAX() throws RecognitionException {
2808: try {
2809: ruleNestingLevel++;
2810: int _type = UNKNOWN_SYNTAX;
2811: int _start = getCharIndex();
2812: int _line = getLine();
2813: int _charPosition = getCharPositionInLine();
2814: int _channel = Token.DEFAULT_CHANNEL;
2815: // ActionTranslator.g:789:4: ( '$' | '%' ( ID | '.' | '(' | ')' | ',' | '{' | '}' | '\"' )* )
2816: int alt23 = 2;
2817: int LA23_0 = input.LA(1);
2818: if ((LA23_0 == '$')) {
2819: alt23 = 1;
2820: } else if ((LA23_0 == '%')) {
2821: alt23 = 2;
2822: } else {
2823: if (backtracking > 0) {
2824: failed = true;
2825: return;
2826: }
2827: NoViableAltException nvae = new NoViableAltException(
2828: "788:1: UNKNOWN_SYNTAX : ( '$' | '%' ( ID | '.' | '(' | ')' | ',' | '{' | '}' | '\"' )* );",
2829: 23, 0, input);
2830:
2831: throw nvae;
2832: }
2833: switch (alt23) {
2834: case 1:
2835: // ActionTranslator.g:789:4: '$'
2836: {
2837: match('$');
2838: if (failed)
2839: return;
2840: if (backtracking == 1) {
2841:
2842: chunks.add(getText());
2843: // shouldn't need an error here. Just accept $ if it doesn't look like anything
2844:
2845: }
2846:
2847: }
2848: break;
2849: case 2:
2850: // ActionTranslator.g:794:4: '%' ( ID | '.' | '(' | ')' | ',' | '{' | '}' | '\"' )*
2851: {
2852: match('%');
2853: if (failed)
2854: return;
2855: // ActionTranslator.g:794:8: ( ID | '.' | '(' | ')' | ',' | '{' | '}' | '\"' )*
2856: loop22: do {
2857: int alt22 = 9;
2858: switch (input.LA(1)) {
2859: case 'A':
2860: case 'B':
2861: case 'C':
2862: case 'D':
2863: case 'E':
2864: case 'F':
2865: case 'G':
2866: case 'H':
2867: case 'I':
2868: case 'J':
2869: case 'K':
2870: case 'L':
2871: case 'M':
2872: case 'N':
2873: case 'O':
2874: case 'P':
2875: case 'Q':
2876: case 'R':
2877: case 'S':
2878: case 'T':
2879: case 'U':
2880: case 'V':
2881: case 'W':
2882: case 'X':
2883: case 'Y':
2884: case 'Z':
2885: case '_':
2886: case 'a':
2887: case 'b':
2888: case 'c':
2889: case 'd':
2890: case 'e':
2891: case 'f':
2892: case 'g':
2893: case 'h':
2894: case 'i':
2895: case 'j':
2896: case 'k':
2897: case 'l':
2898: case 'm':
2899: case 'n':
2900: case 'o':
2901: case 'p':
2902: case 'q':
2903: case 'r':
2904: case 's':
2905: case 't':
2906: case 'u':
2907: case 'v':
2908: case 'w':
2909: case 'x':
2910: case 'y':
2911: case 'z':
2912: alt22 = 1;
2913: break;
2914: case '.':
2915: alt22 = 2;
2916: break;
2917: case '(':
2918: alt22 = 3;
2919: break;
2920: case ')':
2921: alt22 = 4;
2922: break;
2923: case ',':
2924: alt22 = 5;
2925: break;
2926: case '{':
2927: alt22 = 6;
2928: break;
2929: case '}':
2930: alt22 = 7;
2931: break;
2932: case '\"':
2933: alt22 = 8;
2934: break;
2935:
2936: }
2937:
2938: switch (alt22) {
2939: case 1:
2940: // ActionTranslator.g:794:9: ID
2941: {
2942: mID();
2943: if (failed)
2944: return;
2945:
2946: }
2947: break;
2948: case 2:
2949: // ActionTranslator.g:794:12: '.'
2950: {
2951: match('.');
2952: if (failed)
2953: return;
2954:
2955: }
2956: break;
2957: case 3:
2958: // ActionTranslator.g:794:16: '('
2959: {
2960: match('(');
2961: if (failed)
2962: return;
2963:
2964: }
2965: break;
2966: case 4:
2967: // ActionTranslator.g:794:20: ')'
2968: {
2969: match(')');
2970: if (failed)
2971: return;
2972:
2973: }
2974: break;
2975: case 5:
2976: // ActionTranslator.g:794:24: ','
2977: {
2978: match(',');
2979: if (failed)
2980: return;
2981:
2982: }
2983: break;
2984: case 6:
2985: // ActionTranslator.g:794:28: '{'
2986: {
2987: match('{');
2988: if (failed)
2989: return;
2990:
2991: }
2992: break;
2993: case 7:
2994: // ActionTranslator.g:794:32: '}'
2995: {
2996: match('}');
2997: if (failed)
2998: return;
2999:
3000: }
3001: break;
3002: case 8:
3003: // ActionTranslator.g:794:36: '\"'
3004: {
3005: match('\"');
3006: if (failed)
3007: return;
3008:
3009: }
3010: break;
3011:
3012: default:
3013: break loop22;
3014: }
3015: } while (true);
3016:
3017: if (backtracking == 1) {
3018:
3019: chunks.add(getText());
3020: ErrorManager.grammarError(
3021: ErrorManager.MSG_INVALID_TEMPLATE_ACTION,
3022: grammar, actionToken, getText());
3023:
3024: }
3025:
3026: }
3027: break;
3028:
3029: }
3030:
3031: if (backtracking == 1) {
3032:
3033: if (token == null && ruleNestingLevel == 1) {
3034: emit(_type, _line, _charPosition, _channel, _start,
3035: getCharIndex() - 1);
3036: }
3037:
3038: }
3039: } finally {
3040: ruleNestingLevel--;
3041: }
3042: }
3043:
3044: // $ANTLR end UNKNOWN_SYNTAX
3045:
3046: // $ANTLR start TEXT
3047: public void mTEXT() throws RecognitionException {
3048: try {
3049: ruleNestingLevel++;
3050: int _type = TEXT;
3051: int _start = getCharIndex();
3052: int _line = getLine();
3053: int _charPosition = getCharPositionInLine();
3054: int _channel = Token.DEFAULT_CHANNEL;
3055: // ActionTranslator.g:804:7: ( (~ ('$'|'%'|'\\\\'))+ )
3056: // ActionTranslator.g:804:7: (~ ('$'|'%'|'\\\\'))+
3057: {
3058: // ActionTranslator.g:804:7: (~ ('$'|'%'|'\\\\'))+
3059: int cnt24 = 0;
3060: loop24: do {
3061: int alt24 = 2;
3062: int LA24_0 = input.LA(1);
3063: if (((LA24_0 >= '\u0000' && LA24_0 <= '#')
3064: || (LA24_0 >= '&' && LA24_0 <= '[') || (LA24_0 >= ']' && LA24_0 <= '\uFFFE'))) {
3065: alt24 = 1;
3066: }
3067:
3068: switch (alt24) {
3069: case 1:
3070: // ActionTranslator.g:804:7: ~ ('$'|'%'|'\\\\')
3071: {
3072: if ((input.LA(1) >= '\u0000' && input.LA(1) <= '#')
3073: || (input.LA(1) >= '&' && input.LA(1) <= '[')
3074: || (input.LA(1) >= ']' && input.LA(1) <= '\uFFFE')) {
3075: input.consume();
3076: failed = false;
3077: } else {
3078: if (backtracking > 0) {
3079: failed = true;
3080: return;
3081: }
3082: MismatchedSetException mse = new MismatchedSetException(
3083: null, input);
3084: recover(mse);
3085: throw mse;
3086: }
3087:
3088: }
3089: break;
3090:
3091: default:
3092: if (cnt24 >= 1)
3093: break loop24;
3094: if (backtracking > 0) {
3095: failed = true;
3096: return;
3097: }
3098: EarlyExitException eee = new EarlyExitException(
3099: 24, input);
3100: throw eee;
3101: }
3102: cnt24++;
3103: } while (true);
3104:
3105: if (backtracking == 1) {
3106: chunks.add(getText());
3107: }
3108:
3109: }
3110:
3111: if (backtracking == 1) {
3112:
3113: if (token == null && ruleNestingLevel == 1) {
3114: emit(_type, _line, _charPosition, _channel, _start,
3115: getCharIndex() - 1);
3116: }
3117:
3118: }
3119: } finally {
3120: ruleNestingLevel--;
3121: }
3122: }
3123:
3124: // $ANTLR end TEXT
3125:
3126: // $ANTLR start ID
3127: public void mID() throws RecognitionException {
3128: try {
3129: ruleNestingLevel++;
3130: // ActionTranslator.g:808:9: ( ('a'..'z'|'A'..'Z'|'_') ( ('a'..'z'|'A'..'Z'|'_'|'0'..'9'))* )
3131: // ActionTranslator.g:808:9: ('a'..'z'|'A'..'Z'|'_') ( ('a'..'z'|'A'..'Z'|'_'|'0'..'9'))*
3132: {
3133: if ((input.LA(1) >= 'A' && input.LA(1) <= 'Z')
3134: || input.LA(1) == '_'
3135: || (input.LA(1) >= 'a' && input.LA(1) <= 'z')) {
3136: input.consume();
3137: failed = false;
3138: } else {
3139: if (backtracking > 0) {
3140: failed = true;
3141: return;
3142: }
3143: MismatchedSetException mse = new MismatchedSetException(
3144: null, input);
3145: recover(mse);
3146: throw mse;
3147: }
3148:
3149: // ActionTranslator.g:808:33: ( ('a'..'z'|'A'..'Z'|'_'|'0'..'9'))*
3150: loop25: do {
3151: int alt25 = 2;
3152: int LA25_0 = input.LA(1);
3153: if (((LA25_0 >= '0' && LA25_0 <= '9')
3154: || (LA25_0 >= 'A' && LA25_0 <= 'Z')
3155: || LA25_0 == '_' || (LA25_0 >= 'a' && LA25_0 <= 'z'))) {
3156: alt25 = 1;
3157: }
3158:
3159: switch (alt25) {
3160: case 1:
3161: // ActionTranslator.g:808:34: ('a'..'z'|'A'..'Z'|'_'|'0'..'9')
3162: {
3163: if ((input.LA(1) >= '0' && input.LA(1) <= '9')
3164: || (input.LA(1) >= 'A' && input.LA(1) <= 'Z')
3165: || input.LA(1) == '_'
3166: || (input.LA(1) >= 'a' && input.LA(1) <= 'z')) {
3167: input.consume();
3168: failed = false;
3169: } else {
3170: if (backtracking > 0) {
3171: failed = true;
3172: return;
3173: }
3174: MismatchedSetException mse = new MismatchedSetException(
3175: null, input);
3176: recover(mse);
3177: throw mse;
3178: }
3179:
3180: }
3181: break;
3182:
3183: default:
3184: break loop25;
3185: }
3186: } while (true);
3187:
3188: }
3189:
3190: } finally {
3191: ruleNestingLevel--;
3192: }
3193: }
3194:
3195: // $ANTLR end ID
3196:
3197: // $ANTLR start INT
3198: public void mINT() throws RecognitionException {
3199: try {
3200: ruleNestingLevel++;
3201: // ActionTranslator.g:812:7: ( ( '0' .. '9' )+ )
3202: // ActionTranslator.g:812:7: ( '0' .. '9' )+
3203: {
3204: // ActionTranslator.g:812:7: ( '0' .. '9' )+
3205: int cnt26 = 0;
3206: loop26: do {
3207: int alt26 = 2;
3208: int LA26_0 = input.LA(1);
3209: if (((LA26_0 >= '0' && LA26_0 <= '9'))) {
3210: alt26 = 1;
3211: }
3212:
3213: switch (alt26) {
3214: case 1:
3215: // ActionTranslator.g:812:7: '0' .. '9'
3216: {
3217: matchRange('0', '9');
3218: if (failed)
3219: return;
3220:
3221: }
3222: break;
3223:
3224: default:
3225: if (cnt26 >= 1)
3226: break loop26;
3227: if (backtracking > 0) {
3228: failed = true;
3229: return;
3230: }
3231: EarlyExitException eee = new EarlyExitException(
3232: 26, input);
3233: throw eee;
3234: }
3235: cnt26++;
3236: } while (true);
3237:
3238: }
3239:
3240: } finally {
3241: ruleNestingLevel--;
3242: }
3243: }
3244:
3245: // $ANTLR end INT
3246:
3247: // $ANTLR start WS
3248: public void mWS() throws RecognitionException {
3249: try {
3250: ruleNestingLevel++;
3251: // ActionTranslator.g:816:6: ( ( (' '|'\\t'|'\\n'))+ )
3252: // ActionTranslator.g:816:6: ( (' '|'\\t'|'\\n'))+
3253: {
3254: // ActionTranslator.g:816:6: ( (' '|'\\t'|'\\n'))+
3255: int cnt27 = 0;
3256: loop27: do {
3257: int alt27 = 2;
3258: int LA27_0 = input.LA(1);
3259: if (((LA27_0 >= '\t' && LA27_0 <= '\n') || LA27_0 == ' ')) {
3260: alt27 = 1;
3261: }
3262:
3263: switch (alt27) {
3264: case 1:
3265: // ActionTranslator.g:816:7: (' '|'\\t'|'\\n')
3266: {
3267: if ((input.LA(1) >= '\t' && input.LA(1) <= '\n')
3268: || input.LA(1) == ' ') {
3269: input.consume();
3270: failed = false;
3271: } else {
3272: if (backtracking > 0) {
3273: failed = true;
3274: return;
3275: }
3276: MismatchedSetException mse = new MismatchedSetException(
3277: null, input);
3278: recover(mse);
3279: throw mse;
3280: }
3281:
3282: }
3283: break;
3284:
3285: default:
3286: if (cnt27 >= 1)
3287: break loop27;
3288: if (backtracking > 0) {
3289: failed = true;
3290: return;
3291: }
3292: EarlyExitException eee = new EarlyExitException(
3293: 27, input);
3294: throw eee;
3295: }
3296: cnt27++;
3297: } while (true);
3298:
3299: }
3300:
3301: } finally {
3302: ruleNestingLevel--;
3303: }
3304: }
3305:
3306: // $ANTLR end WS
3307:
3308: public void mTokens() throws RecognitionException {
3309: // ActionTranslator.g:1:25: ( ( SET_ENCLOSING_RULE_SCOPE_ATTR )=> SET_ENCLOSING_RULE_SCOPE_ATTR | ( ENCLOSING_RULE_SCOPE_ATTR )=> ENCLOSING_RULE_SCOPE_ATTR | ( SET_TOKEN_SCOPE_ATTR )=> SET_TOKEN_SCOPE_ATTR | ( TOKEN_SCOPE_ATTR )=> TOKEN_SCOPE_ATTR | ( SET_RULE_SCOPE_ATTR )=> SET_RULE_SCOPE_ATTR | ( RULE_SCOPE_ATTR )=> RULE_SCOPE_ATTR | ( LABEL_REF )=> LABEL_REF | ( ISOLATED_TOKEN_REF )=> ISOLATED_TOKEN_REF | ( ISOLATED_LEXER_RULE_REF )=> ISOLATED_LEXER_RULE_REF | ( SET_LOCAL_ATTR )=> SET_LOCAL_ATTR | ( LOCAL_ATTR )=> LOCAL_ATTR | ( SET_DYNAMIC_SCOPE_ATTR )=> SET_DYNAMIC_SCOPE_ATTR | ( DYNAMIC_SCOPE_ATTR )=> DYNAMIC_SCOPE_ATTR | ( ERROR_SCOPED_XY )=> ERROR_SCOPED_XY | ( DYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR )=> DYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR | ( DYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR )=> DYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR | ( ISOLATED_DYNAMIC_SCOPE )=> ISOLATED_DYNAMIC_SCOPE | ( TEMPLATE_INSTANCE )=> TEMPLATE_INSTANCE | ( INDIRECT_TEMPLATE_INSTANCE )=> INDIRECT_TEMPLATE_INSTANCE | ( SET_EXPR_ATTRIBUTE )=> SET_EXPR_ATTRIBUTE | ( SET_ATTRIBUTE )=> SET_ATTRIBUTE | ( TEMPLATE_EXPR )=> TEMPLATE_EXPR | ( ESC )=> ESC | ( ERROR_XY )=> ERROR_XY | ( ERROR_X )=> ERROR_X | ( UNKNOWN_SYNTAX )=> UNKNOWN_SYNTAX | ( TEXT )=> TEXT )
3310: int alt28 = 27;
3311: int LA28_0 = input.LA(1);
3312: if ((LA28_0 == '$')) {
3313: if ((synpred1())) {
3314: alt28 = 1;
3315: } else if ((synpred2())) {
3316: alt28 = 2;
3317: } else if ((synpred3())) {
3318: alt28 = 3;
3319: } else if ((synpred4())) {
3320: alt28 = 4;
3321: } else if ((synpred5())) {
3322: alt28 = 5;
3323: } else if ((synpred6())) {
3324: alt28 = 6;
3325: } else if ((synpred7())) {
3326: alt28 = 7;
3327: } else if ((synpred8())) {
3328: alt28 = 8;
3329: } else if ((synpred9())) {
3330: alt28 = 9;
3331: } else if ((synpred10())) {
3332: alt28 = 10;
3333: } else if ((synpred11())) {
3334: alt28 = 11;
3335: } else if ((synpred12())) {
3336: alt28 = 12;
3337: } else if ((synpred13())) {
3338: alt28 = 13;
3339: } else if ((synpred14())) {
3340: alt28 = 14;
3341: } else if ((synpred15())) {
3342: alt28 = 15;
3343: } else if ((synpred16())) {
3344: alt28 = 16;
3345: } else if ((synpred17())) {
3346: alt28 = 17;
3347: } else if ((synpred24())) {
3348: alt28 = 24;
3349: } else if ((synpred25())) {
3350: alt28 = 25;
3351: } else if ((synpred26())) {
3352: alt28 = 26;
3353: } else {
3354: if (backtracking > 0) {
3355: failed = true;
3356: return;
3357: }
3358: NoViableAltException nvae = new NoViableAltException(
3359: "1:1: Tokens options {k=1; } : ( ( SET_ENCLOSING_RULE_SCOPE_ATTR )=> SET_ENCLOSING_RULE_SCOPE_ATTR | ( ENCLOSING_RULE_SCOPE_ATTR )=> ENCLOSING_RULE_SCOPE_ATTR | ( SET_TOKEN_SCOPE_ATTR )=> SET_TOKEN_SCOPE_ATTR | ( TOKEN_SCOPE_ATTR )=> TOKEN_SCOPE_ATTR | ( SET_RULE_SCOPE_ATTR )=> SET_RULE_SCOPE_ATTR | ( RULE_SCOPE_ATTR )=> RULE_SCOPE_ATTR | ( LABEL_REF )=> LABEL_REF | ( ISOLATED_TOKEN_REF )=> ISOLATED_TOKEN_REF | ( ISOLATED_LEXER_RULE_REF )=> ISOLATED_LEXER_RULE_REF | ( SET_LOCAL_ATTR )=> SET_LOCAL_ATTR | ( LOCAL_ATTR )=> LOCAL_ATTR | ( SET_DYNAMIC_SCOPE_ATTR )=> SET_DYNAMIC_SCOPE_ATTR | ( DYNAMIC_SCOPE_ATTR )=> DYNAMIC_SCOPE_ATTR | ( ERROR_SCOPED_XY )=> ERROR_SCOPED_XY | ( DYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR )=> DYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR | ( DYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR )=> DYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR | ( ISOLATED_DYNAMIC_SCOPE )=> ISOLATED_DYNAMIC_SCOPE | ( TEMPLATE_INSTANCE )=> TEMPLATE_INSTANCE | ( INDIRECT_TEMPLATE_INSTANCE )=> INDIRECT_TEMPLATE_INSTANCE | ( SET_EXPR_ATTRIBUTE )=> SET_EXPR_ATTRIBUTE | ( SET_ATTRIBUTE )=> SET_ATTRIBUTE | ( TEMPLATE_EXPR )=> TEMPLATE_EXPR | ( ESC )=> ESC | ( ERROR_XY )=> ERROR_XY | ( ERROR_X )=> ERROR_X | ( UNKNOWN_SYNTAX )=> UNKNOWN_SYNTAX | ( TEXT )=> TEXT );",
3360: 28, 1, input);
3361:
3362: throw nvae;
3363: }
3364: } else if ((LA28_0 == '%')) {
3365: if ((synpred18())) {
3366: alt28 = 18;
3367: } else if ((synpred19())) {
3368: alt28 = 19;
3369: } else if ((synpred20())) {
3370: alt28 = 20;
3371: } else if ((synpred21())) {
3372: alt28 = 21;
3373: } else if ((synpred22())) {
3374: alt28 = 22;
3375: } else if ((synpred26())) {
3376: alt28 = 26;
3377: } else {
3378: if (backtracking > 0) {
3379: failed = true;
3380: return;
3381: }
3382: NoViableAltException nvae = new NoViableAltException(
3383: "1:1: Tokens options {k=1; } : ( ( SET_ENCLOSING_RULE_SCOPE_ATTR )=> SET_ENCLOSING_RULE_SCOPE_ATTR | ( ENCLOSING_RULE_SCOPE_ATTR )=> ENCLOSING_RULE_SCOPE_ATTR | ( SET_TOKEN_SCOPE_ATTR )=> SET_TOKEN_SCOPE_ATTR | ( TOKEN_SCOPE_ATTR )=> TOKEN_SCOPE_ATTR | ( SET_RULE_SCOPE_ATTR )=> SET_RULE_SCOPE_ATTR | ( RULE_SCOPE_ATTR )=> RULE_SCOPE_ATTR | ( LABEL_REF )=> LABEL_REF | ( ISOLATED_TOKEN_REF )=> ISOLATED_TOKEN_REF | ( ISOLATED_LEXER_RULE_REF )=> ISOLATED_LEXER_RULE_REF | ( SET_LOCAL_ATTR )=> SET_LOCAL_ATTR | ( LOCAL_ATTR )=> LOCAL_ATTR | ( SET_DYNAMIC_SCOPE_ATTR )=> SET_DYNAMIC_SCOPE_ATTR | ( DYNAMIC_SCOPE_ATTR )=> DYNAMIC_SCOPE_ATTR | ( ERROR_SCOPED_XY )=> ERROR_SCOPED_XY | ( DYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR )=> DYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR | ( DYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR )=> DYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR | ( ISOLATED_DYNAMIC_SCOPE )=> ISOLATED_DYNAMIC_SCOPE | ( TEMPLATE_INSTANCE )=> TEMPLATE_INSTANCE | ( INDIRECT_TEMPLATE_INSTANCE )=> INDIRECT_TEMPLATE_INSTANCE | ( SET_EXPR_ATTRIBUTE )=> SET_EXPR_ATTRIBUTE | ( SET_ATTRIBUTE )=> SET_ATTRIBUTE | ( TEMPLATE_EXPR )=> TEMPLATE_EXPR | ( ESC )=> ESC | ( ERROR_XY )=> ERROR_XY | ( ERROR_X )=> ERROR_X | ( UNKNOWN_SYNTAX )=> UNKNOWN_SYNTAX | ( TEXT )=> TEXT );",
3384: 28, 2, input);
3385:
3386: throw nvae;
3387: }
3388: } else if ((LA28_0 == '\\')) {
3389: alt28 = 23;
3390: } else if (((LA28_0 >= '\u0000' && LA28_0 <= '#')
3391: || (LA28_0 >= '&' && LA28_0 <= '[') || (LA28_0 >= ']' && LA28_0 <= '\uFFFE'))) {
3392: alt28 = 27;
3393: } else {
3394: if (backtracking > 0) {
3395: failed = true;
3396: return;
3397: }
3398: NoViableAltException nvae = new NoViableAltException(
3399: "1:1: Tokens options {k=1; } : ( ( SET_ENCLOSING_RULE_SCOPE_ATTR )=> SET_ENCLOSING_RULE_SCOPE_ATTR | ( ENCLOSING_RULE_SCOPE_ATTR )=> ENCLOSING_RULE_SCOPE_ATTR | ( SET_TOKEN_SCOPE_ATTR )=> SET_TOKEN_SCOPE_ATTR | ( TOKEN_SCOPE_ATTR )=> TOKEN_SCOPE_ATTR | ( SET_RULE_SCOPE_ATTR )=> SET_RULE_SCOPE_ATTR | ( RULE_SCOPE_ATTR )=> RULE_SCOPE_ATTR | ( LABEL_REF )=> LABEL_REF | ( ISOLATED_TOKEN_REF )=> ISOLATED_TOKEN_REF | ( ISOLATED_LEXER_RULE_REF )=> ISOLATED_LEXER_RULE_REF | ( SET_LOCAL_ATTR )=> SET_LOCAL_ATTR | ( LOCAL_ATTR )=> LOCAL_ATTR | ( SET_DYNAMIC_SCOPE_ATTR )=> SET_DYNAMIC_SCOPE_ATTR | ( DYNAMIC_SCOPE_ATTR )=> DYNAMIC_SCOPE_ATTR | ( ERROR_SCOPED_XY )=> ERROR_SCOPED_XY | ( DYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR )=> DYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR | ( DYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR )=> DYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR | ( ISOLATED_DYNAMIC_SCOPE )=> ISOLATED_DYNAMIC_SCOPE | ( TEMPLATE_INSTANCE )=> TEMPLATE_INSTANCE | ( INDIRECT_TEMPLATE_INSTANCE )=> INDIRECT_TEMPLATE_INSTANCE | ( SET_EXPR_ATTRIBUTE )=> SET_EXPR_ATTRIBUTE | ( SET_ATTRIBUTE )=> SET_ATTRIBUTE | ( TEMPLATE_EXPR )=> TEMPLATE_EXPR | ( ESC )=> ESC | ( ERROR_XY )=> ERROR_XY | ( ERROR_X )=> ERROR_X | ( UNKNOWN_SYNTAX )=> UNKNOWN_SYNTAX | ( TEXT )=> TEXT );",
3400: 28, 0, input);
3401:
3402: throw nvae;
3403: }
3404: switch (alt28) {
3405: case 1:
3406: // ActionTranslator.g:1:25: ( SET_ENCLOSING_RULE_SCOPE_ATTR )=> SET_ENCLOSING_RULE_SCOPE_ATTR
3407: {
3408: mSET_ENCLOSING_RULE_SCOPE_ATTR();
3409: if (failed)
3410: return;
3411:
3412: }
3413: break;
3414: case 2:
3415: // ActionTranslator.g:1:88: ( ENCLOSING_RULE_SCOPE_ATTR )=> ENCLOSING_RULE_SCOPE_ATTR
3416: {
3417: mENCLOSING_RULE_SCOPE_ATTR();
3418: if (failed)
3419: return;
3420:
3421: }
3422: break;
3423: case 3:
3424: // ActionTranslator.g:1:143: ( SET_TOKEN_SCOPE_ATTR )=> SET_TOKEN_SCOPE_ATTR
3425: {
3426: mSET_TOKEN_SCOPE_ATTR();
3427: if (failed)
3428: return;
3429:
3430: }
3431: break;
3432: case 4:
3433: // ActionTranslator.g:1:188: ( TOKEN_SCOPE_ATTR )=> TOKEN_SCOPE_ATTR
3434: {
3435: mTOKEN_SCOPE_ATTR();
3436: if (failed)
3437: return;
3438:
3439: }
3440: break;
3441: case 5:
3442: // ActionTranslator.g:1:225: ( SET_RULE_SCOPE_ATTR )=> SET_RULE_SCOPE_ATTR
3443: {
3444: mSET_RULE_SCOPE_ATTR();
3445: if (failed)
3446: return;
3447:
3448: }
3449: break;
3450: case 6:
3451: // ActionTranslator.g:1:268: ( RULE_SCOPE_ATTR )=> RULE_SCOPE_ATTR
3452: {
3453: mRULE_SCOPE_ATTR();
3454: if (failed)
3455: return;
3456:
3457: }
3458: break;
3459: case 7:
3460: // ActionTranslator.g:1:303: ( LABEL_REF )=> LABEL_REF
3461: {
3462: mLABEL_REF();
3463: if (failed)
3464: return;
3465:
3466: }
3467: break;
3468: case 8:
3469: // ActionTranslator.g:1:326: ( ISOLATED_TOKEN_REF )=> ISOLATED_TOKEN_REF
3470: {
3471: mISOLATED_TOKEN_REF();
3472: if (failed)
3473: return;
3474:
3475: }
3476: break;
3477: case 9:
3478: // ActionTranslator.g:1:367: ( ISOLATED_LEXER_RULE_REF )=> ISOLATED_LEXER_RULE_REF
3479: {
3480: mISOLATED_LEXER_RULE_REF();
3481: if (failed)
3482: return;
3483:
3484: }
3485: break;
3486: case 10:
3487: // ActionTranslator.g:1:418: ( SET_LOCAL_ATTR )=> SET_LOCAL_ATTR
3488: {
3489: mSET_LOCAL_ATTR();
3490: if (failed)
3491: return;
3492:
3493: }
3494: break;
3495: case 11:
3496: // ActionTranslator.g:1:451: ( LOCAL_ATTR )=> LOCAL_ATTR
3497: {
3498: mLOCAL_ATTR();
3499: if (failed)
3500: return;
3501:
3502: }
3503: break;
3504: case 12:
3505: // ActionTranslator.g:1:476: ( SET_DYNAMIC_SCOPE_ATTR )=> SET_DYNAMIC_SCOPE_ATTR
3506: {
3507: mSET_DYNAMIC_SCOPE_ATTR();
3508: if (failed)
3509: return;
3510:
3511: }
3512: break;
3513: case 13:
3514: // ActionTranslator.g:1:525: ( DYNAMIC_SCOPE_ATTR )=> DYNAMIC_SCOPE_ATTR
3515: {
3516: mDYNAMIC_SCOPE_ATTR();
3517: if (failed)
3518: return;
3519:
3520: }
3521: break;
3522: case 14:
3523: // ActionTranslator.g:1:566: ( ERROR_SCOPED_XY )=> ERROR_SCOPED_XY
3524: {
3525: mERROR_SCOPED_XY();
3526: if (failed)
3527: return;
3528:
3529: }
3530: break;
3531: case 15:
3532: // ActionTranslator.g:1:601: ( DYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR )=> DYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR
3533: {
3534: mDYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR();
3535: if (failed)
3536: return;
3537:
3538: }
3539: break;
3540: case 16:
3541: // ActionTranslator.g:1:676: ( DYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR )=> DYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR
3542: {
3543: mDYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR();
3544: if (failed)
3545: return;
3546:
3547: }
3548: break;
3549: case 17:
3550: // ActionTranslator.g:1:751: ( ISOLATED_DYNAMIC_SCOPE )=> ISOLATED_DYNAMIC_SCOPE
3551: {
3552: mISOLATED_DYNAMIC_SCOPE();
3553: if (failed)
3554: return;
3555:
3556: }
3557: break;
3558: case 18:
3559: // ActionTranslator.g:1:800: ( TEMPLATE_INSTANCE )=> TEMPLATE_INSTANCE
3560: {
3561: mTEMPLATE_INSTANCE();
3562: if (failed)
3563: return;
3564:
3565: }
3566: break;
3567: case 19:
3568: // ActionTranslator.g:1:839: ( INDIRECT_TEMPLATE_INSTANCE )=> INDIRECT_TEMPLATE_INSTANCE
3569: {
3570: mINDIRECT_TEMPLATE_INSTANCE();
3571: if (failed)
3572: return;
3573:
3574: }
3575: break;
3576: case 20:
3577: // ActionTranslator.g:1:896: ( SET_EXPR_ATTRIBUTE )=> SET_EXPR_ATTRIBUTE
3578: {
3579: mSET_EXPR_ATTRIBUTE();
3580: if (failed)
3581: return;
3582:
3583: }
3584: break;
3585: case 21:
3586: // ActionTranslator.g:1:937: ( SET_ATTRIBUTE )=> SET_ATTRIBUTE
3587: {
3588: mSET_ATTRIBUTE();
3589: if (failed)
3590: return;
3591:
3592: }
3593: break;
3594: case 22:
3595: // ActionTranslator.g:1:968: ( TEMPLATE_EXPR )=> TEMPLATE_EXPR
3596: {
3597: mTEMPLATE_EXPR();
3598: if (failed)
3599: return;
3600:
3601: }
3602: break;
3603: case 23:
3604: // ActionTranslator.g:1:999: ( ESC )=> ESC
3605: {
3606: mESC();
3607: if (failed)
3608: return;
3609:
3610: }
3611: break;
3612: case 24:
3613: // ActionTranslator.g:1:1010: ( ERROR_XY )=> ERROR_XY
3614: {
3615: mERROR_XY();
3616: if (failed)
3617: return;
3618:
3619: }
3620: break;
3621: case 25:
3622: // ActionTranslator.g:1:1031: ( ERROR_X )=> ERROR_X
3623: {
3624: mERROR_X();
3625: if (failed)
3626: return;
3627:
3628: }
3629: break;
3630: case 26:
3631: // ActionTranslator.g:1:1050: ( UNKNOWN_SYNTAX )=> UNKNOWN_SYNTAX
3632: {
3633: mUNKNOWN_SYNTAX();
3634: if (failed)
3635: return;
3636:
3637: }
3638: break;
3639: case 27:
3640: // ActionTranslator.g:1:1083: ( TEXT )=> TEXT
3641: {
3642: mTEXT();
3643: if (failed)
3644: return;
3645:
3646: }
3647: break;
3648:
3649: }
3650:
3651: }
3652:
3653: // $ANTLR start synpred1
3654: public void synpred1_fragment() throws RecognitionException {
3655: // ActionTranslator.g:1:25: ( SET_ENCLOSING_RULE_SCOPE_ATTR )
3656: // ActionTranslator.g:1:26: SET_ENCLOSING_RULE_SCOPE_ATTR
3657: {
3658: mSET_ENCLOSING_RULE_SCOPE_ATTR();
3659: if (failed)
3660: return;
3661:
3662: }
3663: }
3664:
3665: // $ANTLR end synpred1
3666:
3667: // $ANTLR start synpred2
3668: public void synpred2_fragment() throws RecognitionException {
3669: // ActionTranslator.g:1:88: ( ENCLOSING_RULE_SCOPE_ATTR )
3670: // ActionTranslator.g:1:89: ENCLOSING_RULE_SCOPE_ATTR
3671: {
3672: mENCLOSING_RULE_SCOPE_ATTR();
3673: if (failed)
3674: return;
3675:
3676: }
3677: }
3678:
3679: // $ANTLR end synpred2
3680:
3681: // $ANTLR start synpred3
3682: public void synpred3_fragment() throws RecognitionException {
3683: // ActionTranslator.g:1:143: ( SET_TOKEN_SCOPE_ATTR )
3684: // ActionTranslator.g:1:144: SET_TOKEN_SCOPE_ATTR
3685: {
3686: mSET_TOKEN_SCOPE_ATTR();
3687: if (failed)
3688: return;
3689:
3690: }
3691: }
3692:
3693: // $ANTLR end synpred3
3694:
3695: // $ANTLR start synpred4
3696: public void synpred4_fragment() throws RecognitionException {
3697: // ActionTranslator.g:1:188: ( TOKEN_SCOPE_ATTR )
3698: // ActionTranslator.g:1:189: TOKEN_SCOPE_ATTR
3699: {
3700: mTOKEN_SCOPE_ATTR();
3701: if (failed)
3702: return;
3703:
3704: }
3705: }
3706:
3707: // $ANTLR end synpred4
3708:
3709: // $ANTLR start synpred5
3710: public void synpred5_fragment() throws RecognitionException {
3711: // ActionTranslator.g:1:225: ( SET_RULE_SCOPE_ATTR )
3712: // ActionTranslator.g:1:226: SET_RULE_SCOPE_ATTR
3713: {
3714: mSET_RULE_SCOPE_ATTR();
3715: if (failed)
3716: return;
3717:
3718: }
3719: }
3720:
3721: // $ANTLR end synpred5
3722:
3723: // $ANTLR start synpred6
3724: public void synpred6_fragment() throws RecognitionException {
3725: // ActionTranslator.g:1:268: ( RULE_SCOPE_ATTR )
3726: // ActionTranslator.g:1:269: RULE_SCOPE_ATTR
3727: {
3728: mRULE_SCOPE_ATTR();
3729: if (failed)
3730: return;
3731:
3732: }
3733: }
3734:
3735: // $ANTLR end synpred6
3736:
3737: // $ANTLR start synpred7
3738: public void synpred7_fragment() throws RecognitionException {
3739: // ActionTranslator.g:1:303: ( LABEL_REF )
3740: // ActionTranslator.g:1:304: LABEL_REF
3741: {
3742: mLABEL_REF();
3743: if (failed)
3744: return;
3745:
3746: }
3747: }
3748:
3749: // $ANTLR end synpred7
3750:
3751: // $ANTLR start synpred8
3752: public void synpred8_fragment() throws RecognitionException {
3753: // ActionTranslator.g:1:326: ( ISOLATED_TOKEN_REF )
3754: // ActionTranslator.g:1:327: ISOLATED_TOKEN_REF
3755: {
3756: mISOLATED_TOKEN_REF();
3757: if (failed)
3758: return;
3759:
3760: }
3761: }
3762:
3763: // $ANTLR end synpred8
3764:
3765: // $ANTLR start synpred9
3766: public void synpred9_fragment() throws RecognitionException {
3767: // ActionTranslator.g:1:367: ( ISOLATED_LEXER_RULE_REF )
3768: // ActionTranslator.g:1:368: ISOLATED_LEXER_RULE_REF
3769: {
3770: mISOLATED_LEXER_RULE_REF();
3771: if (failed)
3772: return;
3773:
3774: }
3775: }
3776:
3777: // $ANTLR end synpred9
3778:
3779: // $ANTLR start synpred10
3780: public void synpred10_fragment() throws RecognitionException {
3781: // ActionTranslator.g:1:418: ( SET_LOCAL_ATTR )
3782: // ActionTranslator.g:1:419: SET_LOCAL_ATTR
3783: {
3784: mSET_LOCAL_ATTR();
3785: if (failed)
3786: return;
3787:
3788: }
3789: }
3790:
3791: // $ANTLR end synpred10
3792:
3793: // $ANTLR start synpred11
3794: public void synpred11_fragment() throws RecognitionException {
3795: // ActionTranslator.g:1:451: ( LOCAL_ATTR )
3796: // ActionTranslator.g:1:452: LOCAL_ATTR
3797: {
3798: mLOCAL_ATTR();
3799: if (failed)
3800: return;
3801:
3802: }
3803: }
3804:
3805: // $ANTLR end synpred11
3806:
3807: // $ANTLR start synpred12
3808: public void synpred12_fragment() throws RecognitionException {
3809: // ActionTranslator.g:1:476: ( SET_DYNAMIC_SCOPE_ATTR )
3810: // ActionTranslator.g:1:477: SET_DYNAMIC_SCOPE_ATTR
3811: {
3812: mSET_DYNAMIC_SCOPE_ATTR();
3813: if (failed)
3814: return;
3815:
3816: }
3817: }
3818:
3819: // $ANTLR end synpred12
3820:
3821: // $ANTLR start synpred13
3822: public void synpred13_fragment() throws RecognitionException {
3823: // ActionTranslator.g:1:525: ( DYNAMIC_SCOPE_ATTR )
3824: // ActionTranslator.g:1:526: DYNAMIC_SCOPE_ATTR
3825: {
3826: mDYNAMIC_SCOPE_ATTR();
3827: if (failed)
3828: return;
3829:
3830: }
3831: }
3832:
3833: // $ANTLR end synpred13
3834:
3835: // $ANTLR start synpred14
3836: public void synpred14_fragment() throws RecognitionException {
3837: // ActionTranslator.g:1:566: ( ERROR_SCOPED_XY )
3838: // ActionTranslator.g:1:567: ERROR_SCOPED_XY
3839: {
3840: mERROR_SCOPED_XY();
3841: if (failed)
3842: return;
3843:
3844: }
3845: }
3846:
3847: // $ANTLR end synpred14
3848:
3849: // $ANTLR start synpred15
3850: public void synpred15_fragment() throws RecognitionException {
3851: // ActionTranslator.g:1:601: ( DYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR )
3852: // ActionTranslator.g:1:602: DYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR
3853: {
3854: mDYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR();
3855: if (failed)
3856: return;
3857:
3858: }
3859: }
3860:
3861: // $ANTLR end synpred15
3862:
3863: // $ANTLR start synpred16
3864: public void synpred16_fragment() throws RecognitionException {
3865: // ActionTranslator.g:1:676: ( DYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR )
3866: // ActionTranslator.g:1:677: DYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR
3867: {
3868: mDYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR();
3869: if (failed)
3870: return;
3871:
3872: }
3873: }
3874:
3875: // $ANTLR end synpred16
3876:
3877: // $ANTLR start synpred17
3878: public void synpred17_fragment() throws RecognitionException {
3879: // ActionTranslator.g:1:751: ( ISOLATED_DYNAMIC_SCOPE )
3880: // ActionTranslator.g:1:752: ISOLATED_DYNAMIC_SCOPE
3881: {
3882: mISOLATED_DYNAMIC_SCOPE();
3883: if (failed)
3884: return;
3885:
3886: }
3887: }
3888:
3889: // $ANTLR end synpred17
3890:
3891: // $ANTLR start synpred18
3892: public void synpred18_fragment() throws RecognitionException {
3893: // ActionTranslator.g:1:800: ( TEMPLATE_INSTANCE )
3894: // ActionTranslator.g:1:801: TEMPLATE_INSTANCE
3895: {
3896: mTEMPLATE_INSTANCE();
3897: if (failed)
3898: return;
3899:
3900: }
3901: }
3902:
3903: // $ANTLR end synpred18
3904:
3905: // $ANTLR start synpred19
3906: public void synpred19_fragment() throws RecognitionException {
3907: // ActionTranslator.g:1:839: ( INDIRECT_TEMPLATE_INSTANCE )
3908: // ActionTranslator.g:1:840: INDIRECT_TEMPLATE_INSTANCE
3909: {
3910: mINDIRECT_TEMPLATE_INSTANCE();
3911: if (failed)
3912: return;
3913:
3914: }
3915: }
3916:
3917: // $ANTLR end synpred19
3918:
3919: // $ANTLR start synpred20
3920: public void synpred20_fragment() throws RecognitionException {
3921: // ActionTranslator.g:1:896: ( SET_EXPR_ATTRIBUTE )
3922: // ActionTranslator.g:1:897: SET_EXPR_ATTRIBUTE
3923: {
3924: mSET_EXPR_ATTRIBUTE();
3925: if (failed)
3926: return;
3927:
3928: }
3929: }
3930:
3931: // $ANTLR end synpred20
3932:
3933: // $ANTLR start synpred21
3934: public void synpred21_fragment() throws RecognitionException {
3935: // ActionTranslator.g:1:937: ( SET_ATTRIBUTE )
3936: // ActionTranslator.g:1:938: SET_ATTRIBUTE
3937: {
3938: mSET_ATTRIBUTE();
3939: if (failed)
3940: return;
3941:
3942: }
3943: }
3944:
3945: // $ANTLR end synpred21
3946:
3947: // $ANTLR start synpred22
3948: public void synpred22_fragment() throws RecognitionException {
3949: // ActionTranslator.g:1:968: ( TEMPLATE_EXPR )
3950: // ActionTranslator.g:1:969: TEMPLATE_EXPR
3951: {
3952: mTEMPLATE_EXPR();
3953: if (failed)
3954: return;
3955:
3956: }
3957: }
3958:
3959: // $ANTLR end synpred22
3960:
3961: // $ANTLR start synpred24
3962: public void synpred24_fragment() throws RecognitionException {
3963: // ActionTranslator.g:1:1010: ( ERROR_XY )
3964: // ActionTranslator.g:1:1011: ERROR_XY
3965: {
3966: mERROR_XY();
3967: if (failed)
3968: return;
3969:
3970: }
3971: }
3972:
3973: // $ANTLR end synpred24
3974:
3975: // $ANTLR start synpred25
3976: public void synpred25_fragment() throws RecognitionException {
3977: // ActionTranslator.g:1:1031: ( ERROR_X )
3978: // ActionTranslator.g:1:1032: ERROR_X
3979: {
3980: mERROR_X();
3981: if (failed)
3982: return;
3983:
3984: }
3985: }
3986:
3987: // $ANTLR end synpred25
3988:
3989: // $ANTLR start synpred26
3990: public void synpred26_fragment() throws RecognitionException {
3991: // ActionTranslator.g:1:1050: ( UNKNOWN_SYNTAX )
3992: // ActionTranslator.g:1:1051: UNKNOWN_SYNTAX
3993: {
3994: mUNKNOWN_SYNTAX();
3995: if (failed)
3996: return;
3997:
3998: }
3999: }
4000:
4001: // $ANTLR end synpred26
4002:
4003: public boolean synpred25() {
4004: backtracking++;
4005: int start = input.mark();
4006: try {
4007: synpred25_fragment(); // can never throw exception
4008: } catch (RecognitionException re) {
4009: System.err.println("impossible: " + re);
4010: }
4011: boolean success = !failed;
4012: input.rewind(start);
4013: backtracking--;
4014: failed = false;
4015: return success;
4016: }
4017:
4018: public boolean synpred7() {
4019: backtracking++;
4020: int start = input.mark();
4021: try {
4022: synpred7_fragment(); // can never throw exception
4023: } catch (RecognitionException re) {
4024: System.err.println("impossible: " + re);
4025: }
4026: boolean success = !failed;
4027: input.rewind(start);
4028: backtracking--;
4029: failed = false;
4030: return success;
4031: }
4032:
4033: public boolean synpred14() {
4034: backtracking++;
4035: int start = input.mark();
4036: try {
4037: synpred14_fragment(); // can never throw exception
4038: } catch (RecognitionException re) {
4039: System.err.println("impossible: " + re);
4040: }
4041: boolean success = !failed;
4042: input.rewind(start);
4043: backtracking--;
4044: failed = false;
4045: return success;
4046: }
4047:
4048: public boolean synpred15() {
4049: backtracking++;
4050: int start = input.mark();
4051: try {
4052: synpred15_fragment(); // can never throw exception
4053: } catch (RecognitionException re) {
4054: System.err.println("impossible: " + re);
4055: }
4056: boolean success = !failed;
4057: input.rewind(start);
4058: backtracking--;
4059: failed = false;
4060: return success;
4061: }
4062:
4063: public boolean synpred22() {
4064: backtracking++;
4065: int start = input.mark();
4066: try {
4067: synpred22_fragment(); // can never throw exception
4068: } catch (RecognitionException re) {
4069: System.err.println("impossible: " + re);
4070: }
4071: boolean success = !failed;
4072: input.rewind(start);
4073: backtracking--;
4074: failed = false;
4075: return success;
4076: }
4077:
4078: public boolean synpred12() {
4079: backtracking++;
4080: int start = input.mark();
4081: try {
4082: synpred12_fragment(); // can never throw exception
4083: } catch (RecognitionException re) {
4084: System.err.println("impossible: " + re);
4085: }
4086: boolean success = !failed;
4087: input.rewind(start);
4088: backtracking--;
4089: failed = false;
4090: return success;
4091: }
4092:
4093: public boolean synpred4() {
4094: backtracking++;
4095: int start = input.mark();
4096: try {
4097: synpred4_fragment(); // can never throw exception
4098: } catch (RecognitionException re) {
4099: System.err.println("impossible: " + re);
4100: }
4101: boolean success = !failed;
4102: input.rewind(start);
4103: backtracking--;
4104: failed = false;
4105: return success;
4106: }
4107:
4108: public boolean synpred9() {
4109: backtracking++;
4110: int start = input.mark();
4111: try {
4112: synpred9_fragment(); // can never throw exception
4113: } catch (RecognitionException re) {
4114: System.err.println("impossible: " + re);
4115: }
4116: boolean success = !failed;
4117: input.rewind(start);
4118: backtracking--;
4119: failed = false;
4120: return success;
4121: }
4122:
4123: public boolean synpred1() {
4124: backtracking++;
4125: int start = input.mark();
4126: try {
4127: synpred1_fragment(); // can never throw exception
4128: } catch (RecognitionException re) {
4129: System.err.println("impossible: " + re);
4130: }
4131: boolean success = !failed;
4132: input.rewind(start);
4133: backtracking--;
4134: failed = false;
4135: return success;
4136: }
4137:
4138: public boolean synpred20() {
4139: backtracking++;
4140: int start = input.mark();
4141: try {
4142: synpred20_fragment(); // can never throw exception
4143: } catch (RecognitionException re) {
4144: System.err.println("impossible: " + re);
4145: }
4146: boolean success = !failed;
4147: input.rewind(start);
4148: backtracking--;
4149: failed = false;
4150: return success;
4151: }
4152:
4153: public boolean synpred17() {
4154: backtracking++;
4155: int start = input.mark();
4156: try {
4157: synpred17_fragment(); // can never throw exception
4158: } catch (RecognitionException re) {
4159: System.err.println("impossible: " + re);
4160: }
4161: boolean success = !failed;
4162: input.rewind(start);
4163: backtracking--;
4164: failed = false;
4165: return success;
4166: }
4167:
4168: public boolean synpred2() {
4169: backtracking++;
4170: int start = input.mark();
4171: try {
4172: synpred2_fragment(); // can never throw exception
4173: } catch (RecognitionException re) {
4174: System.err.println("impossible: " + re);
4175: }
4176: boolean success = !failed;
4177: input.rewind(start);
4178: backtracking--;
4179: failed = false;
4180: return success;
4181: }
4182:
4183: public boolean synpred18() {
4184: backtracking++;
4185: int start = input.mark();
4186: try {
4187: synpred18_fragment(); // can never throw exception
4188: } catch (RecognitionException re) {
4189: System.err.println("impossible: " + re);
4190: }
4191: boolean success = !failed;
4192: input.rewind(start);
4193: backtracking--;
4194: failed = false;
4195: return success;
4196: }
4197:
4198: public boolean synpred3() {
4199: backtracking++;
4200: int start = input.mark();
4201: try {
4202: synpred3_fragment(); // can never throw exception
4203: } catch (RecognitionException re) {
4204: System.err.println("impossible: " + re);
4205: }
4206: boolean success = !failed;
4207: input.rewind(start);
4208: backtracking--;
4209: failed = false;
4210: return success;
4211: }
4212:
4213: public boolean synpred11() {
4214: backtracking++;
4215: int start = input.mark();
4216: try {
4217: synpred11_fragment(); // can never throw exception
4218: } catch (RecognitionException re) {
4219: System.err.println("impossible: " + re);
4220: }
4221: boolean success = !failed;
4222: input.rewind(start);
4223: backtracking--;
4224: failed = false;
4225: return success;
4226: }
4227:
4228: public boolean synpred26() {
4229: backtracking++;
4230: int start = input.mark();
4231: try {
4232: synpred26_fragment(); // can never throw exception
4233: } catch (RecognitionException re) {
4234: System.err.println("impossible: " + re);
4235: }
4236: boolean success = !failed;
4237: input.rewind(start);
4238: backtracking--;
4239: failed = false;
4240: return success;
4241: }
4242:
4243: public boolean synpred8() {
4244: backtracking++;
4245: int start = input.mark();
4246: try {
4247: synpred8_fragment(); // can never throw exception
4248: } catch (RecognitionException re) {
4249: System.err.println("impossible: " + re);
4250: }
4251: boolean success = !failed;
4252: input.rewind(start);
4253: backtracking--;
4254: failed = false;
4255: return success;
4256: }
4257:
4258: public boolean synpred10() {
4259: backtracking++;
4260: int start = input.mark();
4261: try {
4262: synpred10_fragment(); // can never throw exception
4263: } catch (RecognitionException re) {
4264: System.err.println("impossible: " + re);
4265: }
4266: boolean success = !failed;
4267: input.rewind(start);
4268: backtracking--;
4269: failed = false;
4270: return success;
4271: }
4272:
4273: public boolean synpred21() {
4274: backtracking++;
4275: int start = input.mark();
4276: try {
4277: synpred21_fragment(); // can never throw exception
4278: } catch (RecognitionException re) {
4279: System.err.println("impossible: " + re);
4280: }
4281: boolean success = !failed;
4282: input.rewind(start);
4283: backtracking--;
4284: failed = false;
4285: return success;
4286: }
4287:
4288: public boolean synpred16() {
4289: backtracking++;
4290: int start = input.mark();
4291: try {
4292: synpred16_fragment(); // can never throw exception
4293: } catch (RecognitionException re) {
4294: System.err.println("impossible: " + re);
4295: }
4296: boolean success = !failed;
4297: input.rewind(start);
4298: backtracking--;
4299: failed = false;
4300: return success;
4301: }
4302:
4303: public boolean synpred19() {
4304: backtracking++;
4305: int start = input.mark();
4306: try {
4307: synpred19_fragment(); // can never throw exception
4308: } catch (RecognitionException re) {
4309: System.err.println("impossible: " + re);
4310: }
4311: boolean success = !failed;
4312: input.rewind(start);
4313: backtracking--;
4314: failed = false;
4315: return success;
4316: }
4317:
4318: public boolean synpred24() {
4319: backtracking++;
4320: int start = input.mark();
4321: try {
4322: synpred24_fragment(); // can never throw exception
4323: } catch (RecognitionException re) {
4324: System.err.println("impossible: " + re);
4325: }
4326: boolean success = !failed;
4327: input.rewind(start);
4328: backtracking--;
4329: failed = false;
4330: return success;
4331: }
4332:
4333: public boolean synpred5() {
4334: backtracking++;
4335: int start = input.mark();
4336: try {
4337: synpred5_fragment(); // can never throw exception
4338: } catch (RecognitionException re) {
4339: System.err.println("impossible: " + re);
4340: }
4341: boolean success = !failed;
4342: input.rewind(start);
4343: backtracking--;
4344: failed = false;
4345: return success;
4346: }
4347:
4348: public boolean synpred6() {
4349: backtracking++;
4350: int start = input.mark();
4351: try {
4352: synpred6_fragment(); // can never throw exception
4353: } catch (RecognitionException re) {
4354: System.err.println("impossible: " + re);
4355: }
4356: boolean success = !failed;
4357: input.rewind(start);
4358: backtracking--;
4359: failed = false;
4360: return success;
4361: }
4362:
4363: public boolean synpred13() {
4364: backtracking++;
4365: int start = input.mark();
4366: try {
4367: synpred13_fragment(); // can never throw exception
4368: } catch (RecognitionException re) {
4369: System.err.println("impossible: " + re);
4370: }
4371: boolean success = !failed;
4372: input.rewind(start);
4373: backtracking--;
4374: failed = false;
4375: return success;
4376: }
4377:
4378: }
|