0001: /*
0002: * Licensed to the Apache Software Foundation (ASF) under one or more
0003: * contributor license agreements. See the NOTICE file distributed with
0004: * this work for additional information regarding copyright ownership.
0005: * The ASF licenses this file to You under the Apache License, Version 2.0
0006: * (the "License"); you may not use this file except in compliance with
0007: * the License. You may obtain a copy of the License at
0008: *
0009: * http://www.apache.org/licenses/LICENSE-2.0
0010: *
0011: * Unless required by applicable law or agreed to in writing, software
0012: * distributed under the License is distributed on an "AS IS" BASIS,
0013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0014: * See the License for the specific language governing permissions and
0015: * limitations under the License.
0016: */
0017:
0018: // $ANTLR 2.7.5 (20050128): "signature.g" -> "SignatureParser.java"$
0019: package org.apache.harmony.lang.reflect.parser;
0020:
0021: import java.util.ArrayList;
0022: import java.lang.reflect.GenericSignatureFormatError;
0023:
0024: import antlr.TokenBuffer;
0025: import antlr.TokenStreamException;
0026: import antlr.Token;
0027: import antlr.TokenStream;
0028: import antlr.RecognitionException;
0029: import antlr.NoViableAltException;
0030: import antlr.ParserSharedInputState;
0031: import antlr.collections.impl.BitSet;
0032:
0033: /**
0034: * @author Serguei S. Zapreyev
0035: * @version $Revision: 1.1.2.3 $
0036: *
0037: * NOTE 1. This signature.g was created and debugged using
0038: * -bash-3.00$ uname -a
0039: * Linux nstdrlel8.ins.intel.com 2.6.9-11.ELsmp #1 SMP Fri May 20 18:25:30 EDT 2005 x86_64 x86_64 x86_64 GNU/Linux
0040: * -bash-3.00$ which yacc
0041: * /usr/bin/yacc
0042: * -bash-3.00$ which lex
0043: * /usr/bin/lex
0044: * -bash-3.00$ lex --version
0045: * lex version 2.5.4
0046: *
0047: * then it was rewritten for ANTLR 2.7.5
0048: *
0049: *
0050: * To generate java code of signature syntax parser (consisting of SignatureParser.java and SignatureParserTokenTypes.java)
0051: * you should
0052: * - enter to ...\tiger-dev\vm\vmcore\src\kernel_classes\javasrc\org\apache\harmony\lang\reflect\parser directory:
0053: * cd C:\IJE\tiger-dev\vm\vmcore\src\kernel_classes\javasrc\org\apache\harmony\lang\reflect\parser
0054: * - set pointer to ANTLR:
0055: * set CLASSPATH=C:\Documents and Settings\szapreye\My Documents\ANTLR\antlr-2.7.5.jar;.
0056: * - start 1.5 java VM:
0057: * java antlr.Tool signature.g
0058: *
0059: * It provides the creation of SignatureParser.java and SignatureParserTokenTypes.java which in joining with lexer (SignatureLexer2.java)
0060: * arrange the generic signature attribute parser.
0061: *
0062: */
0063: public class SignatureParser extends antlr.LLkParser implements
0064: SignatureParserTokenTypes {
0065:
0066: private SignatureLexer2 lexer;
0067: private int declType; // prescribed (predefined in parser's args) type of the parsered declaration
0068: private static final int CLASSoDECL = 1; //Parser.SignatureKind.CLASS_SIGNATURE.value();
0069: private static final int FIELDoDECL = 2; //Parser.SignatureKind.FIELD_SIGNATURE.value();
0070: private static final int METHODoDECL = 3; //Parser.SignatureKind.METHOD_SIGNATURE.value();
0071: private static final int CONSTRUCTORoDECL = 4; //Parser.SignatureKind.CONSTRUCTOR_SIGNATURE.value();
0072:
0073: private ArrayList<InterimTypeParameter> genParamList = null; // to accumulate generic parameters
0074: private ArrayList<InterimType> boundList = null; // to accumulate bounds of a generic parameter
0075: private ArrayList<InterimType> methParamList = null; // to accumulate method's or constructor's parameters
0076: private ArrayList<InterimType> thrownList = null; // to accumulate exceptions thrown by a method/constructor
0077: private ArrayList<InterimType> implList = null; // to accumulate implements-clauses of a class decl
0078:
0079: private InterimClassGenericDecl classDecl = null;
0080: private InterimFieldGenericDecl fieldDecl = null;
0081: private InterimMethodGenericDecl methodDecl = null;
0082: private InterimConstructorGenericDecl constructorDecl = null;
0083:
0084: private InterimTypeParameter currentTypeParameter = null;
0085: private int Yflag1 = 0; // to mark the start of generic type parameters processing
0086: private int Yflag2 = 0; // to mark the start of method's/constructor's throws-part processing
0087:
0088: class PTStack { // stack of parsered nested parameterized types
0089: String gatheredStr; // packageSpecifier / packageSpecifier + ID / packageSpecifier + ID {+ "$"ID}
0090: int gthrdStrLen; // length of the allocated gatheredStr;
0091: int wrappInWildcard; // -1 - not to wrapp; 1 - lower; 0 - upper
0092: int typeKind; // previous level type kind: 1 - InterimParameterizedType; 0 - InterimClassType
0093: InterimClassType rawType; // InterimClassType
0094: InterimType owner; // InterimParameterizedType or InterimClassType
0095: ArrayList<InterimType> args; // InterimParameterizedType or InterimClassType or InterimTypeVariable or InterimWildcardType
0096: int sigBegin; // start of the signature of the current nested parameterized type within CTPTsignature
0097: int sigEnd; // finish of the signature of the current nested parameterized type within CTPTsignature
0098: int dim; // to indicate the number of consequent "[" symbols. ATTENTION: it used for all types: TVAR, TBASE, RETURN_BASE_TYPE, class type, parameterized type
0099: PTStack nextLevel;
0100: };
0101:
0102: private PTStack stack;
0103: private PTStack currentStackElem; // points to the current processed level element of the nested parameterized types chain
0104:
0105: private String CTPTsignature; // accumulated signature of the current parsered parameterized type, it's used for parameterized types repository
0106: private int sigInd;
0107:
0108: private InterimType/*InterimGenericType*/highLevelType; // the rolled up reference (InterimParameterizedType or InterimClassType)
0109:
0110: private int i;
0111: private InterimType prsrT;
0112: private int len;
0113: private PTStack p1, p2, currentStackElemCopy;
0114: private InterimClassType upper;
0115:
0116: //////////////////////////////////////////////////////////////////////////////////////////////////////
0117: private void throwGenericSignatureFormatError()
0118: throws GenericSignatureFormatError {
0119:
0120: prntS(" throwGenericSignatureFormatError");
0121:
0122: clean();
0123: throw new GenericSignatureFormatError();
0124: }
0125:
0126: private void clean() {
0127: int i;
0128: PTStack p1 = null;
0129: PTStack p2 = null;
0130:
0131: prntS(" clean");
0132:
0133: genParamList = null;
0134: boundList = null;
0135: methParamList = null;
0136: thrownList = null;
0137: for (i = 0; i <= lexer.stackDepth; i++) {
0138: if (i == 0) {
0139: p1 = stack;
0140: } else {
0141: p1 = p1.nextLevel;
0142: }
0143: p1.args = null;
0144: }
0145: for (i = 0; i <= lexer.stackDepth; i++) {
0146: if (i == 0) {
0147: p1 = stack;
0148: }
0149: p2 = p1.nextLevel;
0150: p1.nextLevel = null;
0151: p1 = p2;
0152: }
0153: stack = null;
0154: // XXX: How can we clear the memory allocated for currentStackElem.rawType and currentStackElem.owner?
0155: // Will it be done by VM's gc somehow later or should we invoke some JNI's method
0156: // or should we just invoke System.gc through JNI?
0157: CTPTsignature = null;
0158: }
0159:
0160: private void addElemToGenParamList(InterimTypeParameter ref) { //XXX: maybe, use genParamList.add(ref) everywhere instead of addElemToGenParamList(ref), remove addElemToGenParamList at all
0161: prntS(" addElemToGenParamList");
0162:
0163: if (genParamList == null) {
0164: genParamList = new ArrayList<InterimTypeParameter>();
0165: }
0166: genParamList.add(ref);
0167: }
0168:
0169: private void addElemToBoundList(InterimType ref) {
0170: prntS(" addElemToBoundList");
0171:
0172: if (boundList == null) {
0173: boundList = new ArrayList<InterimType>();
0174: }
0175: boundList.add(ref);
0176: }
0177:
0178: private void addElemToMethParamList(Object ref) {
0179: prntSO(" addElemToMethParamList", ref);
0180:
0181: if (methParamList == null) {
0182: methParamList = new ArrayList<InterimType>();
0183: }
0184: methParamList.add((InterimType) ref);
0185: }
0186:
0187: private void addElemToTypeArgsList(InterimType ref) {
0188: prntS(" addElemToTypeArgsList");
0189:
0190: // find the previous element for the current stack's element:
0191: PTStack p1 = stack, p2 = null;
0192:
0193: while (p1 != currentStackElem) {
0194: p2 = p1;
0195: p1 = p1.nextLevel;
0196: }
0197:
0198: // add the value to the args list of the found stack's element:
0199: if (p2.args == null) {
0200: p2.args = new ArrayList<InterimType>();
0201: }
0202: p2.args.add(ref);
0203:
0204: // clean the current stack's element to be ready for new reference parsering:
0205: currentStackElem.gatheredStr = null;
0206: currentStackElem.args = null;
0207: currentStackElem.wrappInWildcard = -1;
0208: currentStackElem.typeKind = 0;
0209: currentStackElem.rawType = null; // value should not be myfreed because a pointer to the later used java object was there
0210: currentStackElem.owner = null; // value should not be myfreed because a pointer to the later used java object was there
0211: currentStackElem.sigBegin = -1;
0212: currentStackElem.sigEnd = -1;
0213: currentStackElem.dim = 0;
0214: currentStackElem.nextLevel = null;
0215: }
0216:
0217: private void addElemToThrownList(InterimType ref) {
0218: prntS(" addElemToThrownList");
0219:
0220: if (thrownList == null) {
0221: thrownList = new ArrayList<InterimType>();
0222: }
0223: thrownList.add(ref);
0224: }
0225:
0226: private void addElemToImplList(InterimType ref) {
0227: prntS(" addElemToImplList");
0228:
0229: if (implList == null) {
0230: implList = new ArrayList<InterimType>();
0231: }
0232: implList.add(ref);
0233: }
0234:
0235: private void addToGatheredStr(PTStack stackElem, String part) {
0236: if (stackElem.gatheredStr != null) {
0237: prntSSS(" addToGatheredStr", stackElem.gatheredStr,
0238: part);
0239: } else {
0240: prntSS(" addToGatheredStr", part);
0241: }
0242:
0243: if (stackElem.gatheredStr == null) {
0244: stackElem.gatheredStr = "";
0245: }
0246: stackElem.gatheredStr = stackElem.gatheredStr + part;
0247: prntSS(">->->->-> ", stackElem.gatheredStr);
0248: }
0249:
0250: private int addToSignature(String part) {
0251: int res = sigInd;
0252:
0253: prntS(" start addToSignature");
0254: if (CTPTsignature == null) {
0255: CTPTsignature = "";
0256: }
0257: res = CTPTsignature.length();
0258: CTPTsignature = CTPTsignature + part;
0259: sigInd += part.length();
0260:
0261: prntS(" end addToSignature");
0262: return res;
0263: }
0264:
0265: private void createTypeParameterName(String name) {
0266: prntS(" createTypeParameterName");
0267:
0268: currentTypeParameter = new InterimTypeParameter();
0269: currentTypeParameter.typeParameterName = name;
0270: }
0271:
0272: private InterimClassType createInterimClassType(String reference) {
0273: InterimClassType res;
0274:
0275: prntS(" createInterimClassType");
0276:
0277: res = new InterimClassType();
0278: res.classTypeName = reference;
0279: return res;
0280: }
0281:
0282: private InterimTypeVariable createInterimTypeVariable(
0283: String tVariableName) {
0284: prntSS(" createInterimTypeVariable", tVariableName);
0285:
0286: InterimTypeVariable obj;
0287:
0288: obj = new InterimTypeVariable();
0289: obj.typeVariableName = tVariableName;
0290: return obj;
0291: }
0292:
0293: private InterimParameterizedType createInterimParameterizedType(
0294: String signature, PTStack stackElem) {
0295: InterimParameterizedType obj;
0296:
0297: prntS(" createInterimParameterizedType");
0298:
0299: obj = new InterimParameterizedType();
0300: obj.signature = signature;
0301: obj.rawType = stackElem.rawType;
0302: obj.ownerType = stackElem.owner;
0303: if (stackElem.args != null) {
0304: obj.parameters = stackElem.args
0305: .toArray(new InterimType[stackElem.args.size()]);
0306: } else {
0307: obj.parameters = new InterimType[0];
0308: }
0309:
0310: return obj;
0311: }
0312:
0313: private InterimWildcardType createInterimWildcardType(
0314: int boundsType, InterimType[] bounds, int boundsInd) {
0315: InterimWildcardType obj;
0316:
0317: prntS(" createInterimWildcardType");
0318:
0319: obj = new InterimWildcardType();
0320: obj.boundsType = boundsType == 0;
0321: obj.bounds = bounds;
0322:
0323: return obj;
0324: }
0325:
0326: private InterimGenericArrayType createInterimGenericArrayType(
0327: InterimType nextL) {
0328: InterimGenericArrayType obj;
0329:
0330: prntS(" createInterimGenericArrayType");
0331:
0332: obj = new InterimGenericArrayType();
0333: obj.nextLayer = /*(InterimGenericType)*/nextL;
0334:
0335: return obj;
0336: }
0337:
0338: private String getBaseTypeName(char c) {
0339: switch (c) {
0340: case 'I':
0341: return "int";
0342: case 'F':
0343: return "float";
0344: case 'D':
0345: return "double";
0346: case 'J':
0347: return "long";
0348: case 'S':
0349: return "short";
0350: case 'Z':
0351: return "boolean";
0352: case 'B':
0353: return "byte";
0354: case 'C':
0355: return "char";
0356: }
0357: throwGenericSignatureFormatError();
0358: return "UNKNOWN";
0359: }
0360:
0361: private void prntS(String str) {
0362: if (lexer.DEBUGGING) {
0363: System.out.println("|" + str + "|");
0364: }
0365: }
0366:
0367: void prntSS(String str1, String str2) {
0368: if (lexer.DEBUGGING) {
0369: System.out.println("|" + str1 + "|" + str2 + "|");
0370: }
0371: }
0372:
0373: void prntSSS(String str1, String str2, String str3) {
0374: if (lexer.DEBUGGING) {
0375: System.out.println("|" + str1 + "|" + str2 + "|" + str3
0376: + "|");
0377: }
0378: }
0379:
0380: void prntSD(String str1, long num) {
0381: if (lexer.DEBUGGING) {
0382: System.out.println("|" + str1 + "|" + num + "|");
0383: }
0384: }
0385:
0386: void prntSO(String str1, Object o) {
0387: if (lexer.DEBUGGING) {
0388: System.out.println("|" + str1 + "|" + o + "|");
0389: }
0390: }
0391:
0392: //////////////////////////////////////////////////////////////////////////////////////////////////////
0393: public static InterimGenericDeclaration parseSignature(String st,
0394: int kind) {
0395: InterimGenericDeclaration res = null;
0396: SignatureLexer2 lexer = new SignatureLexer2(st); //?StringReader
0397: SignatureParser parser = new SignatureParser(lexer);
0398: // Parse the input
0399: try {
0400: parser.pr__DECL(kind, lexer);
0401: } catch (RecognitionException e) {
0402: e.printStackTrace();
0403: System.err.println("signature syntax error: " + e);
0404: parser.throwGenericSignatureFormatError(); // signature syntax error!
0405: } catch (antlr.TokenStreamException e) {
0406: e.printStackTrace();
0407: System.err.println("TokenStreamException: " + e);
0408: parser.throwGenericSignatureFormatError();
0409: }
0410: parser.prntS("zzzzzzzzzzzzzzzzzz3");
0411:
0412: switch (kind) {
0413: case CLASSoDECL:
0414: res = (InterimGenericDeclaration) parser.classDecl;
0415: break;
0416: case FIELDoDECL:
0417: res = (InterimGenericDeclaration) parser.fieldDecl;
0418: break;
0419: case METHODoDECL:
0420: res = (InterimGenericDeclaration) parser.methodDecl;
0421: break;
0422: case CONSTRUCTORoDECL:
0423: res = (InterimGenericDeclaration) parser.constructorDecl;
0424: break;
0425: }
0426: parser.clean();
0427: parser.prntSO("zzzzzzzzzzzzzzzzzz4", res);
0428:
0429: return res;
0430: }
0431:
0432: protected SignatureParser(TokenBuffer tokenBuf, int k) {
0433: super (tokenBuf, k);
0434: tokenNames = _tokenNames;
0435: }
0436:
0437: public SignatureParser(TokenBuffer tokenBuf) {
0438: this (tokenBuf, 1);
0439: }
0440:
0441: protected SignatureParser(TokenStream lexer, int k) {
0442: super (lexer, k);
0443: tokenNames = _tokenNames;
0444: }
0445:
0446: public SignatureParser(TokenStream lexer) {
0447: this (lexer, 1);
0448: }
0449:
0450: public SignatureParser(ParserSharedInputState state) {
0451: super (state, 1);
0452: tokenNames = _tokenNames;
0453: }
0454:
0455: public final void pr__DECL(int kind, Object lex)
0456: throws RecognitionException, TokenStreamException {
0457:
0458: lexer = (SignatureLexer2) lex;
0459: //lexer.DEBUGGING = true;
0460: declType = kind;
0461: stack = new PTStack();
0462: stack.gatheredStr = null;
0463: stack.gthrdStrLen = 0;
0464: stack.typeKind = 0;
0465: stack.wrappInWildcard = -1;
0466: stack.rawType = null;
0467: stack.owner = null;
0468: stack.args = null;
0469: stack.sigBegin = -1;
0470: stack.sigEnd = -1;
0471: stack.dim = 0;
0472: stack.nextLevel = null;
0473:
0474: // to be reenterable:
0475: CTPTsignature = null;
0476: sigInd = 0;
0477: currentStackElem = stack;
0478: genParamList = null;
0479: boundList = null;
0480: methParamList = null;
0481: thrownList = null;
0482: implList = null;
0483: Yflag2 = 0;
0484: currentTypeParameter = null;
0485:
0486: // Clean lex's environment to provide reenterability:
0487: lexer.prevLexeme = -1;
0488: lexer.Lflag2 = 0;
0489: lexer.Lflag3 = 0;
0490: lexer.stackDepth = 0;
0491: lexer.ident = null;
0492:
0493: try { // for error handling
0494: if (((LA(1) == TRIANGLEOPEN_SIGN || LA(1) == ID || LA(1) == PACKAGE_SPECIFIER))
0495: && (declType == CLASSoDECL)) {
0496: pr__CLASS_DECL();
0497: if (inputState.guessing == 0) {
0498: prntSS(" pr__DECL 1 :", "m1.getText()");
0499: }
0500: } else if (((_tokenSet_0.member(LA(1))))
0501: && (declType == FIELDoDECL)) {
0502: pr__FIELD_DECL();
0503: if (inputState.guessing == 0) {
0504:
0505: // it's time to create InterimFieldGenericDecl and to fill fieldDecl
0506: fieldDecl = new InterimFieldGenericDecl();
0507:
0508: // set fieldType field of InterimFieldGenericDecl object:
0509: fieldDecl.fieldType = (InterimGenericType) highLevelType;
0510:
0511: highLevelType = null;
0512:
0513: prntSS(" pr__DECL 2 :", "m2.getText()");
0514:
0515: }
0516: } else if (((LA(1) == TRIANGLEOPEN_SIGN || LA(1) == RINGOPEN_SIGN))
0517: && (declType == METHODoDECL)) {
0518: pr__METHOD_DECL();
0519: if (inputState.guessing == 0) {
0520: prntSS(" pr__DECL 3:", "m3.getText()");
0521: }
0522: } else if (((LA(1) == TRIANGLEOPEN_SIGN || LA(1) == RINGOPEN_SIGN))
0523: && (declType == CONSTRUCTORoDECL)) {
0524: pr__CONSTRUCTOR_DECL();
0525: if (inputState.guessing == 0) {
0526: prntSS(" pr__DECL 4 :", "m4.getText()");
0527: }
0528: } else {
0529: throw new NoViableAltException(LT(1), getFilename());
0530: }
0531:
0532: } catch (RecognitionException ex) {
0533: if (inputState.guessing == 0) {
0534: reportError(ex);
0535: recover(ex, _tokenSet_1);
0536: } else {
0537: throw ex;
0538: }
0539: }
0540: }
0541:
0542: public final void pr__CLASS_DECL() throws RecognitionException,
0543: TokenStreamException {
0544:
0545: try { // for error handling
0546: switch (LA(1)) {
0547: case TRIANGLEOPEN_SIGN: {
0548: pr__FORMAL_TYPE_PARAMETERS_DECL();
0549: if (inputState.guessing == 0) {
0550: prntSS(" ### 1:", "m6.getText()");
0551: }
0552: pr__CLASS_TYPE_SIGNATURE();
0553: if (inputState.guessing == 0) {
0554:
0555: prntS(" ===1===");
0556: // actually, it's pr__SUPERCLASSoSIGNATURE
0557:
0558: // it's time to create InterimClassGenericDecl and to fill classDecl
0559: classDecl = new InterimClassGenericDecl();
0560:
0561: // set superClass field of InterimClassGenericDecl object:
0562: classDecl.super Class = (InterimType) highLevelType;
0563:
0564: highLevelType = null;
0565:
0566: // set typeParameters field of InterimClassGenericDecl object:
0567: classDecl.typeParameters = genParamList
0568: .toArray(new InterimTypeParameter[genParamList
0569: .size()]);
0570:
0571: // clean the genParamList:
0572: genParamList = null;
0573:
0574: prntSS(" ### 2:", "m7.getText()");
0575:
0576: }
0577: pr__SUPERINTERFACE_SIGNATURES();
0578: if (inputState.guessing == 0) {
0579:
0580: prntS(" ===2===");
0581: // set superInterfaces field of InterimClassGenericDecl object:
0582: classDecl.super Interfaces = (implList == null ? new InterimType[0]
0583: : implList.toArray(new InterimType[implList
0584: .size()]));
0585:
0586: // clean the implList:
0587: implList = null;
0588:
0589: prntSS(" pr__CLASS_DECL 1 :", "m8.getText()");
0590:
0591: }
0592: break;
0593: }
0594: case ID:
0595: case PACKAGE_SPECIFIER: {
0596: pr__CLASS_TYPE_SIGNATURE();
0597: if (inputState.guessing == 0) {
0598:
0599: if (declType == CLASSoDECL) {
0600: prntS(" ===3.1===");
0601: // actually, it's pr__SUPERCLASSoSIGNATURE
0602:
0603: // it's time to create InterimClassGenericDecl and to fill classDecl
0604: classDecl = new InterimClassGenericDecl();
0605:
0606: // set superClass field of InterimClassGenericDecl object:
0607: classDecl.super Class = (InterimType) highLevelType;
0608:
0609: highLevelType = null;
0610: } else { // it's FIELDoDECL
0611: prntS(" ===3.2===");
0612: // actually, it's field type signature (instead the pr__FIELD_DECL which does not work really)
0613:
0614: // it's time to create InterimFieldGenericDecl and to fill fieldDecl
0615: fieldDecl = new InterimFieldGenericDecl();
0616:
0617: // set superClass field of InterimFieldGenericDecl object:
0618: fieldDecl.fieldType = (InterimGenericType) highLevelType;
0619:
0620: highLevelType = null;
0621: }
0622:
0623: prntSS(" ### 3:", "m9.getText()");
0624:
0625: }
0626: pr__SUPERINTERFACE_SIGNATURES();
0627: if (inputState.guessing == 0) {
0628:
0629: if (declType == CLASSoDECL) {
0630: // set superInterfaces field of InterimClassGenericDecl object:
0631: classDecl.super Interfaces = (implList == null ? new InterimType[0]
0632: : implList
0633: .toArray(new InterimType[implList
0634: .size()]));
0635:
0636: // clean the implList:
0637: implList = null;
0638:
0639: prntSS(" pr__CLASS_DECL 2 :", "m10.getText()");
0640: } else {
0641: prntSS(
0642: " pr__CLASS_DECL 2 (+++ for FIELDoDECL +++) :",
0643: "m10.getText()");
0644: }
0645:
0646: }
0647: break;
0648: }
0649: default: {
0650: throw new NoViableAltException(LT(1), getFilename());
0651: }
0652: }
0653: } catch (RecognitionException ex) {
0654: if (inputState.guessing == 0) {
0655: reportError(ex);
0656: recover(ex, _tokenSet_1);
0657: } else {
0658: throw ex;
0659: }
0660: }
0661: }
0662:
0663: public final void pr__FIELD_DECL() throws RecognitionException,
0664: TokenStreamException {
0665:
0666: try { // for error handling
0667: pr__FIELD_TYPE_SIGNATURE();
0668: if (inputState.guessing == 0) {
0669: prntSS(" pr__FIELD_DECL:", "m5.getText()");
0670: }
0671: } catch (RecognitionException ex) {
0672: if (inputState.guessing == 0) {
0673: reportError(ex);
0674: recover(ex, _tokenSet_1);
0675: } else {
0676: throw ex;
0677: }
0678: }
0679: }
0680:
0681: public final void pr__METHOD_DECL() throws RecognitionException,
0682: TokenStreamException {
0683:
0684: try { // for error handling
0685: boolean synPredMatched48 = false;
0686: if (((LA(1) == RINGOPEN_SIGN))) {
0687: int _m48 = mark();
0688: synPredMatched48 = true;
0689: inputState.guessing++;
0690: try {
0691: {
0692: pr__M_P_AND_R_T();
0693: pr__THROWN_SIGNATURE();
0694: }
0695: } catch (RecognitionException pe) {
0696: synPredMatched48 = false;
0697: }
0698: rewind(_m48);
0699: inputState.guessing--;
0700: }
0701: if (synPredMatched48) {
0702: pr__M_P_AND_R_T();
0703: if (inputState.guessing == 0) {
0704: prntSS(" ### 25:", "m59.getText()");
0705: }
0706: pr__THROWN_SIGNATURE();
0707: if (inputState.guessing == 0) {
0708: prntSS(" pr__METHOD_DECL 2 :prntSS",
0709: "m60.getText()");
0710: }
0711: } else if ((LA(1) == RINGOPEN_SIGN)) {
0712: pr__M_P_AND_R_T();
0713: if (inputState.guessing == 0) {
0714: prntSS(" pr__METHOD_DECL 1 :", "m58.getText()");
0715: }
0716: } else {
0717: boolean synPredMatched50 = false;
0718: if (((LA(1) == TRIANGLEOPEN_SIGN))) {
0719: int _m50 = mark();
0720: synPredMatched50 = true;
0721: inputState.guessing++;
0722: try {
0723: {
0724: pr__F_T_P_AND_M_P_AND_R_T();
0725: pr__THROWN_SIGNATURE();
0726: }
0727: } catch (RecognitionException pe) {
0728: synPredMatched50 = false;
0729: }
0730: rewind(_m50);
0731: inputState.guessing--;
0732: }
0733: if (synPredMatched50) {
0734: pr__F_T_P_AND_M_P_AND_R_T();
0735: if (inputState.guessing == 0) {
0736: prntSS(" ### 26:", "m62.getText()");
0737: }
0738: pr__THROWN_SIGNATURE();
0739: if (inputState.guessing == 0) {
0740: prntSS(" pr__METHOD_DECL 4 :",
0741: "m63.getText()");
0742: }
0743: } else if ((LA(1) == TRIANGLEOPEN_SIGN)) {
0744: pr__F_T_P_AND_M_P_AND_R_T();
0745: if (inputState.guessing == 0) {
0746: prntSS(" pr__METHOD_DECL 3 :",
0747: "m61.getText()");
0748: }
0749: } else {
0750: throw new NoViableAltException(LT(1), getFilename());
0751: }
0752: }
0753: } catch (RecognitionException ex) {
0754: if (inputState.guessing == 0) {
0755: reportError(ex);
0756: recover(ex, _tokenSet_1);
0757: } else {
0758: throw ex;
0759: }
0760: }
0761: }
0762:
0763: public final void pr__CONSTRUCTOR_DECL()
0764: throws RecognitionException, TokenStreamException {
0765:
0766: try { // for error handling
0767: boolean synPredMatched41 = false;
0768: if (((LA(1) == RINGOPEN_SIGN))) {
0769: int _m41 = mark();
0770: synPredMatched41 = true;
0771: inputState.guessing++;
0772: try {
0773: {
0774: pr__C_P_AND_R_T();
0775: pr__THROWN_SIGNATURE();
0776: }
0777: } catch (RecognitionException pe) {
0778: synPredMatched41 = false;
0779: }
0780: rewind(_m41);
0781: inputState.guessing--;
0782: }
0783: if (synPredMatched41) {
0784: pr__C_P_AND_R_T();
0785: if (inputState.guessing == 0) {
0786: prntSS(" ### 23:", "m53.getText()");
0787: }
0788: pr__THROWN_SIGNATURE();
0789: if (inputState.guessing == 0) {
0790: prntSS(" pr__CONSTRUCTOR_DECL 2 :prntSS",
0791: "m54.getText()");
0792: }
0793: } else if ((LA(1) == RINGOPEN_SIGN)) {
0794: pr__C_P_AND_R_T();
0795: if (inputState.guessing == 0) {
0796: prntSS(" pr__CONSTRUCTOR_DECL 1 :",
0797: "m52.getText()");
0798: }
0799: } else {
0800: boolean synPredMatched43 = false;
0801: if (((LA(1) == TRIANGLEOPEN_SIGN))) {
0802: int _m43 = mark();
0803: synPredMatched43 = true;
0804: inputState.guessing++;
0805: try {
0806: {
0807: pr__F_T_P_AND_C_P_AND_R_T();
0808: pr__THROWN_SIGNATURE();
0809: }
0810: } catch (RecognitionException pe) {
0811: synPredMatched43 = false;
0812: }
0813: rewind(_m43);
0814: inputState.guessing--;
0815: }
0816: if (synPredMatched43) {
0817: pr__F_T_P_AND_C_P_AND_R_T();
0818: if (inputState.guessing == 0) {
0819: prntSS(" ### 24:", "m56.getText()");
0820: }
0821: pr__THROWN_SIGNATURE();
0822: if (inputState.guessing == 0) {
0823: prntSS(" pr__CONSTRUCTOR_DECL 4 :",
0824: "m57.getText()");
0825: }
0826: } else if ((LA(1) == TRIANGLEOPEN_SIGN)) {
0827: pr__F_T_P_AND_C_P_AND_R_T();
0828: if (inputState.guessing == 0) {
0829: prntSS(" pr__CONSTRUCTOR_DECL 3 :",
0830: "m55getText()");
0831: }
0832: } else {
0833: throw new NoViableAltException(LT(1), getFilename());
0834: }
0835: }
0836: } catch (RecognitionException ex) {
0837: if (inputState.guessing == 0) {
0838: reportError(ex);
0839: recover(ex, _tokenSet_1);
0840: } else {
0841: throw ex;
0842: }
0843: }
0844: }
0845:
0846: public final void pr__FIELD_TYPE_SIGNATURE()
0847: throws RecognitionException, TokenStreamException {
0848:
0849: Token m23 = null;
0850:
0851: try { // for error handling
0852: switch (LA(1)) {
0853: case ID:
0854: case PACKAGE_SPECIFIER: {
0855: pr__CLASS_TYPE_SIGNATURE();
0856: if (inputState.guessing == 0) {
0857: prntSS(" pr__FIELD_TYPE_SIGNATURE 1 :",
0858: "m21.getText()");
0859: }
0860: break;
0861: }
0862: case SQUAREOPEN_SIGN: {
0863: pr__ARRAY_TYPE_SIGNATURE();
0864: if (inputState.guessing == 0) {
0865:
0866: prntS(" ===9===");
0867: if (Yflag1 == 1) {
0868: throwGenericSignatureFormatError(); // array type is not permissible within a generic params decl
0869: }
0870: if (currentStackElem.wrappInWildcard != -1) {
0871: throwGenericSignatureFormatError(); // array type is not permissible within a wild card
0872: }
0873: prntSS(" pr__FIELD_TYPE_SIGNATURE 2 :",
0874: "m22.getText()");
0875:
0876: }
0877: break;
0878: }
0879: case TVAR: {
0880: m23 = LT(1);
0881: match(TVAR);
0882: if (inputState.guessing == 0) {
0883:
0884: prntS(" ===10===");
0885: // grow the signature if it needs:
0886: if (CTPTsignature != null) {
0887: currentStackElem.sigEnd = addToSignature(m23
0888: .getText())
0889: + m23.getText().length();
0890: }
0891:
0892: // to exclude first (official) "T" symbol (and last ";" symbol):
0893: prsrT = (InterimType) createInterimTypeVariable(m23
0894: .getText().substring(1,
0895: m23.getText().length() - 1));
0896:
0897: // if there is wildcard indicator then InterimTypeVariable should be "rolled up" by InterimWildcardType
0898: if (currentStackElem.wrappInWildcard != -1) {
0899: prsrT = (InterimType) createInterimWildcardType(
0900: currentStackElem.wrappInWildcard,
0901: new InterimType[] { (InterimType) prsrT },
0902: 1);
0903: }
0904:
0905: // if there is dimention indicator then InterimTypeVariable should be "rolled up" by InterimGenericArrayType
0906: if (currentStackElem.dim > 0) {
0907: for (i = 0; i < currentStackElem.dim; i++) {
0908: prsrT = createInterimGenericArrayType(prsrT);
0909: }
0910: }
0911: currentStackElem.dim = 0;
0912:
0913: if (Yflag1 == 1) { // within generic params decl (class'/method's/constructor's)
0914: if (lexer.stackDepth == 0) { // not within parameterized type
0915: if (boundList == null) {
0916: addElemToBoundList(prsrT); // first (i.e. "extends") bound, consequently, TVAR is permissible here
0917: } else {
0918: throwGenericSignatureFormatError(); // non-first (i.e. "implements") bound, consequently, TVAR is not permissible as such bound
0919: }
0920: } else { // within parameterized type which appears within gen params decl
0921: // put the InterimTypeVariable on the layer above of the stack of parsered nested parameterized types:
0922: addElemToTypeArgsList(prsrT);
0923: }
0924: } else {
0925: // so, for other places of using ...
0926: if (lexer.stackDepth == 0) { // not within parameterized type
0927: highLevelType = /*(InterimGenericType)*/(InterimType) prsrT;
0928: } else { // within parameterized type which appears not within gen params decl
0929: // put the InterimTypeVariable on the layer above of the stack of parsered nested parameterized types:
0930: addElemToTypeArgsList(prsrT);
0931: }
0932: }
0933: prntSS(" pr__FIELD_TYPE_SIGNATURE 3 :", m23
0934: .getText());
0935:
0936: }
0937: break;
0938: }
0939: default: {
0940: throw new NoViableAltException(LT(1), getFilename());
0941: }
0942: }
0943: } catch (RecognitionException ex) {
0944: if (inputState.guessing == 0) {
0945: reportError(ex);
0946: recover(ex, _tokenSet_2);
0947: } else {
0948: throw ex;
0949: }
0950: }
0951: }
0952:
0953: public final void pr__FORMAL_TYPE_PARAMETERS_DECL()
0954: throws RecognitionException, TokenStreamException {
0955:
0956: Token m11 = null;
0957: Token m13 = null;
0958:
0959: try { // for error handling
0960: m11 = LT(1);
0961: match(TRIANGLEOPEN_SIGN);
0962: if (inputState.guessing == 0) {
0963:
0964: prntS(" ===4===");
0965: Yflag1 = 1; // start of generic parameters parsing
0966: prntSS(" ### 4:", m11.getText());
0967:
0968: }
0969: pr__FORMAL_TYPE_PARAMETERS();
0970: if (inputState.guessing == 0) {
0971: prntSS(" ### 5:", "m12.getText()");
0972: }
0973: m13 = LT(1);
0974: match(TRIANGLECLOSE_SIGN);
0975: if (inputState.guessing == 0) {
0976:
0977: prntS(" ===5===");
0978: Yflag1 = 0; // finish of generic parameters parsing
0979: prntSS(" pr__FORMAL_TYPE_PARAMETERS_DECL:", m13
0980: .getText());
0981:
0982: }
0983: } catch (RecognitionException ex) {
0984: if (inputState.guessing == 0) {
0985: reportError(ex);
0986: recover(ex, _tokenSet_3);
0987: } else {
0988: throw ex;
0989: }
0990: }
0991: }
0992:
0993: public final void pr__CLASS_TYPE_SIGNATURE()
0994: throws RecognitionException, TokenStreamException {
0995:
0996: Token m25 = null;
0997:
0998: try { // for error handling
0999: pr__REFERENCE();
1000: if (inputState.guessing == 0) {
1001: prntSS(" ### 10:", "m24.getText()");
1002: }
1003: m25 = LT(1);
1004: match(SEMICOLON_SIGN);
1005: if (inputState.guessing == 0) {
1006:
1007: prntS(" ===11===");
1008: // XXX: seems, the entire code fragment below can be easily simplified
1009:
1010: // roll up the reference (InterimClassType or InterimParameterizedType) to put on the layer above or to return as a final result:
1011: if (lexer.stackDepth == 0) {
1012: prntS(" ===111===");
1013: if (currentStackElem.typeKind == 0) { // InterimClassType
1014: // return the InterimClassType as a result of a reference rolling up:
1015: prsrT = (InterimType) createInterimClassType(currentStackElem.gatheredStr);
1016:
1017: // if there is dimention indicator then InterimTypeVariable should be "rolled up" by InterimGenericArrayType
1018: if (currentStackElem.dim > 0) {
1019: for (i = 0; i < currentStackElem.dim; i++) {
1020: prsrT = (InterimType) createInterimGenericArrayType(prsrT);
1021: }
1022: }
1023: currentStackElem.dim = 0;
1024:
1025: highLevelType = /*(InterimGenericType)*/(InterimType) prsrT;
1026: } else { //InterimParameterizedType
1027: if (Yflag2 == 1) { // within the throws
1028: throwGenericSignatureFormatError(); // here InterimParameterizedType is prohibited.
1029: }
1030:
1031: // return the InterimParameterizedType as a result of a reference rolling up:
1032: addToSignature(";");
1033: currentStackElem.sigEnd += 1;
1034: len = sigInd - currentStackElem.sigBegin - 1; //to eliminate everywhere the last semicolon sign
1035: prsrT = (InterimType) createInterimParameterizedType(
1036: CTPTsignature
1037: .substring(
1038: currentStackElem.sigBegin,
1039: currentStackElem.sigBegin
1040: + len),
1041: currentStackElem);
1042: currentStackElem.args = null;
1043:
1044: // if there is dimention indicator then InterimTypeVariable should be "rolled up" by InterimGenericArrayType
1045: if (currentStackElem.dim > 0) {
1046: for (i = 0; i < currentStackElem.dim; i++) {
1047: prsrT = (InterimType) createInterimGenericArrayType(prsrT);
1048: }
1049: }
1050: currentStackElem.dim = 0;
1051:
1052: highLevelType = /*(InterimGenericType)*/(InterimType) prsrT;
1053: }
1054:
1055: // it's time to clean entire CTPTsignature for finally rolled up high level reference:
1056: if (CTPTsignature != null) {
1057: CTPTsignature = null;
1058: sigInd = 0;
1059: }
1060:
1061: // clean the current stack's element to be ready for new reference parsering:
1062: currentStackElem.gatheredStr = null;
1063: currentStackElem.args = null;
1064: currentStackElem.wrappInWildcard = -1;
1065: currentStackElem.typeKind = 0;
1066: currentStackElem.rawType = null; //value should not be mefreed because a pointer to the later used java object was there
1067: currentStackElem.owner = null; //value should not be mefreed because a pointer to the later used java object was there
1068: currentStackElem.sigBegin = -1;
1069: currentStackElem.sigEnd = -1;
1070: currentStackElem.dim = 0;
1071: currentStackElem.nextLevel = null;
1072: } else {
1073: prntS(" ===112===");
1074: if (currentStackElem.typeKind == 0) { // InterimClassType
1075: addToSignature(";");
1076: currentStackElem.sigEnd += 1;
1077: prsrT = createInterimClassType(currentStackElem.gatheredStr);
1078:
1079: // if there is wildcard indicator then InterimClassType should be "rolled up" by InterimWildcardType
1080: if (currentStackElem.wrappInWildcard != -1) {
1081: prsrT = (InterimType) createInterimWildcardType(
1082: currentStackElem.wrappInWildcard,
1083: new InterimType[] { (InterimType) prsrT },
1084: 1);
1085: }
1086:
1087: // if there is dimention indicator then InterimTypeVariable should be "rolled up" by InterimGenericArrayType
1088: if (currentStackElem.dim > 0) {
1089: for (i = 0; i < currentStackElem.dim; i++) {
1090: prsrT = (InterimType) createInterimGenericArrayType(prsrT);
1091: }
1092: }
1093: currentStackElem.dim = 0;
1094:
1095: // put the InterimClassType/InterimWildcardType on the layer above of the stack of parsered nested parameterized types:
1096: addElemToTypeArgsList(prsrT);
1097: } else { // InterimParameterizedType
1098: addToSignature(";");
1099: currentStackElem.sigEnd += 1;
1100: len = sigInd - currentStackElem.sigBegin - 1; //to eliminate everywhere the last semicolon sign
1101: prsrT = (InterimType) createInterimParameterizedType(
1102: CTPTsignature
1103: .substring(
1104: currentStackElem.sigBegin,
1105: currentStackElem.sigBegin
1106: + len),
1107: currentStackElem);
1108: currentStackElem.args = null;
1109:
1110: // if there is wildcard indicator then InterimParameterizedType should be "rolled up" by InterimWildcardType
1111: if (currentStackElem.wrappInWildcard != -1) {
1112: prsrT = (InterimType) createInterimWildcardType(
1113: currentStackElem.wrappInWildcard,
1114: new InterimType[] { (InterimType) prsrT },
1115: 1);
1116: }
1117:
1118: // if there is dimention indicator then InterimTypeVariable should be "rolled up" by InterimGenericArrayType
1119: if (currentStackElem.dim > 0) {
1120: for (i = 0; i < currentStackElem.dim; i++) {
1121: prsrT = (InterimType) createInterimGenericArrayType(prsrT);
1122: }
1123: }
1124: currentStackElem.dim = 0;
1125: // put the InterimParameterizedType/InterimWildcardType on the layer above of the stack of parsered nested parameterized types:
1126: addElemToTypeArgsList(prsrT);
1127: }
1128: }
1129:
1130: // It's time to clear currentStackElem.gatheredStr:
1131: currentStackElem.gatheredStr = null;
1132: // It's time also to clear currentStackElem.rawType:
1133: currentStackElem.rawType = null;
1134:
1135: prntSS(" pr__CLASS_TYPE_SIGNATURE:", m25.getText());
1136:
1137: }
1138: } catch (RecognitionException ex) {
1139: if (inputState.guessing == 0) {
1140: reportError(ex);
1141: recover(ex, _tokenSet_2);
1142: } else {
1143: throw ex;
1144: }
1145: }
1146: }
1147:
1148: public final void pr__SUPERINTERFACE_SIGNATURES()
1149: throws RecognitionException, TokenStreamException {
1150:
1151: try { // for error handling
1152: {
1153: _loop37: do {
1154: if ((LA(1) == ID || LA(1) == PACKAGE_SPECIFIER)) {
1155: pr__SUPERINTERFACE_SIGNATURE();
1156: if (inputState.guessing == 0) {
1157: prntSS(
1158: " pr__SUPERINTERFACE_SIGNATURES 1 :",
1159: "m50.getText()");
1160: }
1161: } else {
1162: break _loop37;
1163: }
1164:
1165: } while (true);
1166: }
1167: } catch (RecognitionException ex) {
1168: if (inputState.guessing == 0) {
1169: reportError(ex);
1170: recover(ex, _tokenSet_1);
1171: } else {
1172: throw ex;
1173: }
1174: }
1175: }
1176:
1177: public final void pr__FORMAL_TYPE_PARAMETERS()
1178: throws RecognitionException, TokenStreamException {
1179:
1180: try { // for error handling
1181: {
1182: int _cnt7 = 0;
1183: _loop7: do {
1184: if ((LA(1) == ID_COLON || LA(1) == ID)) {
1185: pr__FORMAL_TYPE_PARAMETER();
1186: if (inputState.guessing == 0) {
1187: prntSS(" pr__FORMAL_TYPE_PARAMETERS 1 :",
1188: "m14.getText()");
1189: }
1190: } else {
1191: if (_cnt7 >= 1) {
1192: break _loop7;
1193: } else {
1194: throw new NoViableAltException(LT(1),
1195: getFilename());
1196: }
1197: }
1198:
1199: _cnt7++;
1200: } while (true);
1201: }
1202: } catch (RecognitionException ex) {
1203: if (inputState.guessing == 0) {
1204: reportError(ex);
1205: recover(ex, _tokenSet_4);
1206: } else {
1207: throw ex;
1208: }
1209: }
1210: }
1211:
1212: public final void pr__FORMAL_TYPE_PARAMETER()
1213: throws RecognitionException, TokenStreamException {
1214:
1215: try { // for error handling
1216: pr__ID_WITH_COLON();
1217: if (inputState.guessing == 0) {
1218: prntSS(" ### 7:", /*lexer.ident*/"m141.getText()");
1219: }
1220: pr__CLASS_OR_INTERFACE_BOUNDS();
1221: if (inputState.guessing == 0) {
1222:
1223: prntS(" ===6===");
1224: // set classBound field of InterimTypeParameter object:
1225: currentTypeParameter.classBound = (InterimType) boundList
1226: .get(0); // the first elem is extends-clause
1227: boundList.remove(0);
1228:
1229: // set interfaceBounds field of InterimTypeParameter object:
1230: currentTypeParameter.interfaceBounds = boundList
1231: .toArray(new InterimType[boundList.size()]);
1232:
1233: // clean the boundList before a possible re-using:
1234: boundList = null;
1235:
1236: // add the prepared InterimTypeParameter object to genParamList:
1237: addElemToGenParamList(currentTypeParameter);
1238:
1239: prntSS(" pr__FORMAL_TYPE_PARAMETER:", "m15.getText()");
1240:
1241: }
1242: } catch (RecognitionException ex) {
1243: if (inputState.guessing == 0) {
1244: reportError(ex);
1245: recover(ex, _tokenSet_5);
1246: } else {
1247: throw ex;
1248: }
1249: }
1250: }
1251:
1252: public final void pr__ID_WITH_COLON() throws RecognitionException,
1253: TokenStreamException {
1254:
1255: Token m151 = null;
1256: Token m16 = null;
1257:
1258: try { // for error handling
1259: switch (LA(1)) {
1260: case ID_COLON: {
1261: m151 = LT(1);
1262: match(ID_COLON);
1263: if (inputState.guessing == 0) {
1264:
1265: prntS(" ===7===");
1266: String ts1 = m151.getText();
1267: String ts2 = ts1.substring(0, ts1.length() - 2);
1268:
1269: createTypeParameterName(ts2);
1270: addElemToBoundList(createInterimClassType("Ljava/lang/Object")); // Object is supposed if extends clause is empty (example: PARAMNAME::...;)
1271:
1272: prntSS(" pr__ID_WITH_COLON 1 :", ts2);
1273:
1274: }
1275: break;
1276: }
1277: case ID: {
1278: m16 = LT(1);
1279: match(ID);
1280: if (inputState.guessing == 0) {
1281:
1282: prntS(" ===8===");
1283: createTypeParameterName(m16.getText());
1284:
1285: prntSS(" pr__ID_WITH_COLON 2 :", m16.getText());
1286:
1287: }
1288: break;
1289: }
1290: default: {
1291: throw new NoViableAltException(LT(1), getFilename());
1292: }
1293: }
1294: } catch (RecognitionException ex) {
1295: if (inputState.guessing == 0) {
1296: reportError(ex);
1297: recover(ex, _tokenSet_6);
1298: } else {
1299: throw ex;
1300: }
1301: }
1302: }
1303:
1304: public final void pr__CLASS_OR_INTERFACE_BOUNDS()
1305: throws RecognitionException, TokenStreamException {
1306:
1307: try { // for error handling
1308: {
1309: int _cnt12 = 0;
1310: _loop12: do {
1311: if ((LA(1) == COLON_SIGN)) {
1312: pr__BOUND();
1313: if (inputState.guessing == 0) {
1314: prntSS(
1315: " pr__CLASS_OR_INTERFACE_BOUNDS 1 :",
1316: "m18.getText()");
1317: }
1318: } else {
1319: if (_cnt12 >= 1) {
1320: break _loop12;
1321: } else {
1322: throw new NoViableAltException(LT(1),
1323: getFilename());
1324: }
1325: }
1326:
1327: _cnt12++;
1328: } while (true);
1329: }
1330: } catch (RecognitionException ex) {
1331: if (inputState.guessing == 0) {
1332: reportError(ex);
1333: recover(ex, _tokenSet_5);
1334: } else {
1335: throw ex;
1336: }
1337: }
1338: }
1339:
1340: public final void pr__BOUND() throws RecognitionException,
1341: TokenStreamException {
1342:
1343: Token m19 = null;
1344:
1345: try { // for error handling
1346: m19 = LT(1);
1347: match(COLON_SIGN);
1348: if (inputState.guessing == 0) {
1349: prntSS(" ### 9:", m19.getText());
1350: }
1351: pr__FIELD_TYPE_SIGNATURE();
1352: if (inputState.guessing == 0) {
1353:
1354: prntS(" ===8.1===");
1355: addElemToBoundList((InterimType) highLevelType); // add the gathered regular type to bounds-list
1356:
1357: highLevelType = null;
1358:
1359: prntSS(" pr__BOUND:", "m20.getText()");
1360:
1361: }
1362: } catch (RecognitionException ex) {
1363: if (inputState.guessing == 0) {
1364: reportError(ex);
1365: recover(ex, _tokenSet_7);
1366: } else {
1367: throw ex;
1368: }
1369: }
1370: }
1371:
1372: public final void pr__ARRAY_TYPE_SIGNATURE()
1373: throws RecognitionException, TokenStreamException {
1374:
1375: Token m46 = null;
1376:
1377: try { // for error handling
1378: m46 = LT(1);
1379: match(SQUAREOPEN_SIGN);
1380: if (inputState.guessing == 0) {
1381:
1382: currentStackElem.dim += 1;
1383:
1384: prntSS(" ### 21:", m46.getText());
1385:
1386: }
1387: pr__TYPE_SIGNATURE();
1388: if (inputState.guessing == 0) {
1389: prntSS(" pr__ARRAY_TYPE_SIGNATURE:", "m47.getText()");
1390: }
1391: } catch (RecognitionException ex) {
1392: if (inputState.guessing == 0) {
1393: reportError(ex);
1394: recover(ex, _tokenSet_2);
1395: } else {
1396: throw ex;
1397: }
1398: }
1399: }
1400:
1401: public final void pr__REFERENCE() throws RecognitionException,
1402: TokenStreamException {
1403:
1404: try { // for error handling
1405: boolean synPredMatched18 = false;
1406: if (((LA(1) == ID))) {
1407: int _m18 = mark();
1408: synPredMatched18 = true;
1409: inputState.guessing++;
1410: try {
1411: {
1412: pr__SIMPLE_CLASS_TYPE_SIGNATURE();
1413: pr__CLASS_TYPE_SIGNATURE_SUFFIXES();
1414: }
1415: } catch (RecognitionException pe) {
1416: synPredMatched18 = false;
1417: }
1418: rewind(_m18);
1419: inputState.guessing--;
1420: }
1421: if (synPredMatched18) {
1422: pr__SIMPLE_CLASS_TYPE_SIGNATURE();
1423: if (inputState.guessing == 0) {
1424: prntSS(" ### 10:", "m27.getText()");
1425: }
1426: pr__CLASS_TYPE_SIGNATURE_SUFFIXES();
1427: if (inputState.guessing == 0) {
1428: prntSS(" pr__REFERENCE 2 :", "m28.getText()");
1429: }
1430: } else if ((LA(1) == ID)) {
1431: pr__SIMPLE_CLASS_TYPE_SIGNATURE();
1432: if (inputState.guessing == 0) {
1433: prntSS(" pr__REFERENCE 1 :", "m26.getText()");
1434: }
1435: } else {
1436: boolean synPredMatched20 = false;
1437: if (((LA(1) == PACKAGE_SPECIFIER))) {
1438: int _m20 = mark();
1439: synPredMatched20 = true;
1440: inputState.guessing++;
1441: try {
1442: {
1443: pr__P_S_AND_S_C_T();
1444: pr__CLASS_TYPE_SIGNATURE_SUFFIXES();
1445: }
1446: } catch (RecognitionException pe) {
1447: synPredMatched20 = false;
1448: }
1449: rewind(_m20);
1450: inputState.guessing--;
1451: }
1452: if (synPredMatched20) {
1453: pr__P_S_AND_S_C_T();
1454: if (inputState.guessing == 0) {
1455: prntSS(" ### 11:", "m29.getText()");
1456: }
1457: pr__CLASS_TYPE_SIGNATURE_SUFFIXES();
1458: if (inputState.guessing == 0) {
1459: prntSS(" pr__REFERENCE 3 :", "m30.getText()");
1460: }
1461: } else if ((LA(1) == PACKAGE_SPECIFIER)) {
1462: pr__P_S_AND_S_C_T();
1463: if (inputState.guessing == 0) {
1464: prntSS(" pr__REFERENCE 4 :", "m31.getText()");
1465: }
1466: } else {
1467: throw new NoViableAltException(LT(1), getFilename());
1468: }
1469: }
1470: } catch (RecognitionException ex) {
1471: if (inputState.guessing == 0) {
1472: reportError(ex);
1473: recover(ex, _tokenSet_8);
1474: } else {
1475: throw ex;
1476: }
1477: }
1478: }
1479:
1480: public final void pr__SIMPLE_CLASS_TYPE_SIGNATURE()
1481: throws RecognitionException, TokenStreamException {
1482:
1483: Token m34 = null;
1484: Token m35 = null;
1485: Token m37 = null;
1486: Token m371 = null;
1487:
1488: try { // for error handling
1489: boolean synPredMatched24 = false;
1490: if (((LA(1) == ID))) {
1491: int _m24 = mark();
1492: synPredMatched24 = true;
1493: inputState.guessing++;
1494: try {
1495: {
1496: match(ID);
1497: match(TRIANGLEOPEN_SIGN);
1498: }
1499: } catch (RecognitionException pe) {
1500: synPredMatched24 = false;
1501: }
1502: rewind(_m24);
1503: inputState.guessing--;
1504: }
1505: if (synPredMatched24) {
1506: m34 = LT(1);
1507: match(ID);
1508: if (inputState.guessing == 0) {
1509:
1510: prntS(" ===13===");
1511: String ts1 = m34.getText();
1512: int tl = ts1.length();
1513: if (currentStackElem.rawType == null) { // so it's the non-inner class id
1514: prntS(" ===131===");
1515: // create the owner:
1516: currentStackElem.owner = null; // owner is absent for package level class
1517:
1518: // grow the gatheredStr:
1519: if (currentStackElem.gatheredStr == null) { // so, we should check the existence of "L" at the begin of ID because it is the begin of the reference
1520: // (for remembering: any "T..." identifier can not be considered as TVAR within
1521: // this being parsered pr__SIMPLE_CLASS_TYPE_SIGNATURE rule, especially, if we are
1522: // within generic parameters declaration parsering, where a TVAR using is prohibited)
1523: if (ts1.charAt(0) != 'L') {
1524: throwGenericSignatureFormatError();
1525: }
1526: addToGatheredStr(currentStackElem, ts1); // so, it's "L"<class ID> here
1527: } else { //so, it is the reference like <package name>/<non-inner class name> (because rawType == null && gatheredStr == null)
1528: addToGatheredStr(currentStackElem, ts1); // so, it's "L"[A-Za-z][A-Za-z0-9"/"]*"/"<class ID> here
1529: }
1530:
1531: // grow the signature (like the gatheredStr growing):
1532: if (currentStackElem.sigBegin == -1) {
1533: currentStackElem.sigBegin = addToSignature(ts1); // so, it's "L"<class ID> added to CTPTsignature
1534: currentStackElem.sigEnd = currentStackElem.sigBegin
1535: + tl;
1536: } else {
1537: currentStackElem.sigEnd = addToSignature(ts1)
1538: + tl; // so, it's <class ID> added to CTPTsignature,
1539: // consequently the "L"[A-Za-z][A-Za-z0-9"/"]*"/"<class ID> is there regarding the current parsered reference
1540: }
1541:
1542: // create the raw type:
1543: currentStackElem.rawType = createInterimClassType(currentStackElem.gatheredStr);
1544:
1545: // we know "<...>" follows further, so the type becames InterimParameterizedType now:
1546: currentStackElem.typeKind = 1;
1547: } else { // so it's the regular inner class id
1548: prntS(" ===132===");
1549: // create the owner:
1550: if (currentStackElem.typeKind == 0
1551: && currentStackElem.args == null) {
1552: prntS(" ===1321===");
1553: //if (currentStackElem.owner != null) {
1554: // // so, we have created InterimClassType some times for the previous parts (IDs)
1555: // // and we should provide that each InterimClassType object should be deleted by GC when the next one is being created
1556: // // because the only last preceding may to be used as owner of the first InterimParameterizedType object which arises
1557: // // while a reference is parsered.
1558: // // So, can/should we do anything special (I don't see such features within JNI) to destroy the previouse InterimClassType
1559: // // object which becames superflouos
1560: // // just when the next one appeares? Or GC will remove such objects because there will not be any references for them
1561: // // within the java code.
1562: // ???<<< (*env)->ReleaseObject(..., currentStackElem.owner, ...); >>>???
1563: //}
1564: currentStackElem.owner = createInterimClassType(/*currentStackElem.rawType*/currentStackElem.gatheredStr);
1565: } else {
1566: //printf(" %s %d %d %d\n", "===1322===", currentStackElem.typeKind, currentStackElem.args);
1567: currentStackElem.typeKind = 1; // at least one args was not equal to null at a previous stage, so we deal with the parameterized type from that time
1568: len = sigInd - currentStackElem.sigBegin/* + 1*/;
1569: currentStackElem.owner = createInterimParameterizedType(
1570: CTPTsignature.substring(
1571: currentStackElem.sigBegin,
1572: currentStackElem.sigBegin
1573: + len),
1574: currentStackElem);
1575: currentStackElem.args = null;
1576: }
1577:
1578: // grow the gatheredStr:
1579: addToGatheredStr(currentStackElem, "$"); // so, it's "L"[A-Za-z][A-Za-z0-9"/"]*"/"<class ID>{"$"<class ID>}"$" here
1580: addToGatheredStr(currentStackElem, ts1); // so, it's "L"[A-Za-z][A-Za-z0-9"/"]*"/"<class ID>{"$"<class ID>}"$"<class ID> here
1581:
1582: // grow the signature (like the gatheredStr growing):
1583: currentStackElem.sigEnd = addToSignature("$") + 1; // so, it's "L"[A-Za-z][A-Za-z0-9"/"]*"/"<class ID>{"$"<class ID>}"$" gathered in CTPTsignature
1584: currentStackElem.sigEnd = addToSignature(ts1)
1585: + tl; //so, it's "L"[A-Za-z][A-Za-z0-9"/"]*"/"<class ID>{"$"<class ID>}"$"<class ID> gathered in CTPTsignature
1586:
1587: // create the raw type:
1588: currentStackElem.rawType = createInterimClassType(currentStackElem.gatheredStr);
1589:
1590: // we know "<...>" follows further, so the type becames InterimParameterizedType now:
1591: currentStackElem.typeKind = 1;
1592: }
1593: prntSS(" ### 13:", ts1);
1594:
1595: }
1596: m35 = LT(1);
1597: match(TRIANGLEOPEN_SIGN);
1598: if (inputState.guessing == 0) {
1599:
1600: prntS(" ===14===");
1601: // grow the signature:
1602: currentStackElem.sigEnd = addToSignature("<") + 1;
1603:
1604: // It's the time to clean the arguments list of including class:
1605: if (currentStackElem.args != null) {
1606: currentStackElem.args = null;
1607: }
1608:
1609: currentStackElemCopy = currentStackElem;
1610: currentStackElem = new PTStack();
1611: currentStackElemCopy.nextLevel = currentStackElem;
1612: lexer.stackDepth++; //to reflect a level of argument nesting
1613: currentStackElem.gatheredStr = null;
1614: currentStackElem.gthrdStrLen = 0;
1615: currentStackElem.wrappInWildcard = -1;
1616: currentStackElem.typeKind = 0;
1617: currentStackElem.rawType = null;
1618: currentStackElem.owner = null;
1619: currentStackElem.args = null;
1620: currentStackElem.sigBegin = -1;
1621: currentStackElem.sigEnd = -1;
1622: currentStackElem.dim = 0;
1623: currentStackElem.nextLevel = null;
1624:
1625: prntSS(" ### 14:", m35.getText());
1626:
1627: }
1628: pr__TYPE_ARGUMENTS();
1629: if (inputState.guessing == 0) {
1630: prntSS(" ### 15:", "m36.getText()");
1631: }
1632: m37 = LT(1);
1633: match(TRIANGLECLOSE_SIGN);
1634: if (inputState.guessing == 0) {
1635:
1636: prntS(" ===15===");
1637: // grow the signature:
1638: currentStackElem.sigEnd = addToSignature(">") + 1;
1639:
1640: // find the previous element for the current stack's element:
1641: p1 = stack;
1642: while (p1 != currentStackElem) {
1643: p2 = p1;
1644: p1 = p1.nextLevel;
1645: }
1646: p2.nextLevel = null;
1647: lexer.stackDepth--; // to reflect a level of argument nesting
1648:
1649: // return to previous stack element:
1650: currentStackElem = p2;
1651: p2 = null;
1652:
1653: // in any case, the being finished reference is of InterimParametrizedType because it has "<...>"
1654: currentStackElem.typeKind = 1;
1655:
1656: // free memory of the being left stack's element:
1657: p1.gatheredStr = null;
1658: p1 = null;
1659:
1660: prntSS(" pr__SIMPLE_CLASS_TYPE_SIGNATURE 1 :",
1661: m37.getText());
1662:
1663: }
1664: } else if ((LA(1) == ID)) {
1665: m371 = LT(1);
1666: match(ID);
1667: if (inputState.guessing == 0) {
1668:
1669: prntS(" ===16===");
1670: String ts1 = m371.getText();
1671: int tl = ts1.length();
1672: if (currentStackElem.rawType == null) { // so it's the non-inner class id
1673: prntSS(" ===160===", ts1);
1674: // create the owner:
1675: currentStackElem.owner = null; // owner is absent for package level class
1676:
1677: // grow the gatheredStr:
1678: if (currentStackElem.gatheredStr == null) { // so, we should check the existence of "L" at the begin of ID because it is the begin of the reference
1679: // (for remembering: any "T..." identifier can not be considered as TVAR within
1680: // this being parsered pr__SIMPLE_CLASS_TYPE_SIGNATURE rule, especially, if we are
1681: // within generic parameters declaration parsering, where a TVAR using is prohibited)
1682: if (ts1.charAt(0) != 'L') {
1683: throwGenericSignatureFormatError();
1684: }
1685: addToGatheredStr(currentStackElem, ts1); // so, it's "L"<class ID> here
1686: } else {
1687: addToGatheredStr(currentStackElem, ts1); // so, it's "L"[A-Za-z][A-Za-z0-9"/"]*"/"<class ID> here
1688: }
1689:
1690: // grow the signature (like the gatheredStr growing):
1691: if (currentStackElem.sigBegin == -1) {
1692: currentStackElem.sigBegin = addToSignature(ts1); // so, it's "L"<class ID> added to CTPTsignature
1693: currentStackElem.sigEnd = currentStackElem.sigBegin
1694: + tl;
1695: } else {
1696: currentStackElem.sigEnd = addToSignature(ts1)
1697: + tl; // so, it's <class ID> added to CTPTsignature,
1698: // consequently the "L"[A-Za-z][A-Za-z0-9"/"]*"/"<class ID> is there regarding the current parsered reference
1699: }
1700:
1701: // create the raw type:
1702: currentStackElem.rawType = createInterimClassType(currentStackElem.gatheredStr);
1703: } else { //so it's the regular inner class id
1704: prntSS(" ===161===", ts1);
1705: // create the owner:
1706: if (currentStackElem.typeKind == 0
1707: && currentStackElem.args == null) {
1708: //if (currentStackElem.owner != null) {
1709: // // so, we have created InterimClassType some times for the previous parts (IDs)
1710: // // and we should provide that each InterimClassType object should be deleted by GC when the next one is being created
1711: // // because the only last preceding may to be used as owner of the first InterimParameterizedType object which arises
1712: // // while a reference is parsered.
1713: // // So, can/should we do anything special (I don't see such features within JNI) to destroy the previouse InterimClassType
1714: // // object which becames superflouos
1715: // // just when the next one appeares? Or GC will remove such objects because there will not be any references for them
1716: // // within the java code.
1717: // ???<<< (*env)->ReleaseObject(..., currentStackElem.owner, ...); >>>???
1718: //}
1719: currentStackElem.owner = createInterimClassType(/*currentStackElem.rawType*/currentStackElem.gatheredStr);
1720: } else {
1721: currentStackElem.typeKind = 1; // at least one args was not equal to null at a previous stage
1722: //len = currentStackElem.sigEnd - currentStackElem.sigBegin + 1;
1723: len = sigInd - currentStackElem.sigBegin/* + 1*/;
1724: currentStackElem.owner = createInterimParameterizedType(
1725: CTPTsignature.substring(
1726: currentStackElem.sigBegin,
1727: currentStackElem.sigBegin
1728: + len),
1729: currentStackElem);
1730: currentStackElem.args = null;
1731: }
1732:
1733: // grow the gatheredStr:
1734: addToGatheredStr(currentStackElem, "$"); //so, it's "L"[A-Za-z][A-Za-z0-9"/"]*"/"<class ID>{"$"<class ID>}"$" here
1735: addToGatheredStr(currentStackElem, ts1); //so, it's "L"[A-Za-z][A-Za-z0-9"/"]*"/"<class ID>{"$"<class ID>}"$"<class ID> here
1736:
1737: // grow the signature (like the gatheredStr growing):
1738: currentStackElem.sigEnd = addToSignature("$") + 1; //so, it's "L"[A-Za-z][A-Za-z0-9"/"]*"/"<class ID>{"$"<class ID>}"$" gathered in CTPTsignature
1739: currentStackElem.sigEnd = addToSignature(ts1)
1740: + tl; //so, it's "L"[A-Za-z][A-Za-z0-9"/"]*"/"<class ID>{"$"<class ID>}"$"<class ID> gathered in CTPTsignature
1741:
1742: // create the raw type:
1743: currentStackElem.rawType = createInterimClassType(currentStackElem.gatheredStr);
1744: }
1745: prntSS(" pr__SIMPLE_CLASS_TYPE_SIGNATURE 2:", ts1);
1746:
1747: }
1748: } else {
1749: throw new NoViableAltException(LT(1), getFilename());
1750: }
1751:
1752: } catch (RecognitionException ex) {
1753: if (inputState.guessing == 0) {
1754: reportError(ex);
1755: recover(ex, _tokenSet_9);
1756: } else {
1757: throw ex;
1758: }
1759: }
1760: }
1761:
1762: public final void pr__CLASS_TYPE_SIGNATURE_SUFFIXES()
1763: throws RecognitionException, TokenStreamException {
1764:
1765: Token m44 = null;
1766:
1767: try { // for error handling
1768: {
1769: int _cnt32 = 0;
1770: _loop32: do {
1771: if ((LA(1) == DOT_OR_DOLLAR_SIGN)) {
1772: m44 = LT(1);
1773: match(DOT_OR_DOLLAR_SIGN);
1774: if (inputState.guessing == 0) {
1775:
1776: prntS(" ===21===");
1777: //// seems, I have just done it in pr__SIMPLE_CLASS_TYPE_SIGNATURE
1778: //// grow the signature:
1779: //currentStackElem.sigEnd = addToSignature("$") + 1;
1780:
1781: prntSS(" ### 20:", m44.getText());
1782:
1783: }
1784: pr__SIMPLE_CLASS_TYPE_SIGNATURE();
1785: if (inputState.guessing == 0) {
1786: prntSS(
1787: " pr__CLASS_TYPE_SIGNATURE_SUFFIXES 2 :",
1788: "m45.getText()");
1789: }
1790: } else {
1791: if (_cnt32 >= 1) {
1792: break _loop32;
1793: } else {
1794: throw new NoViableAltException(LT(1),
1795: getFilename());
1796: }
1797: }
1798:
1799: _cnt32++;
1800: } while (true);
1801: }
1802: } catch (RecognitionException ex) {
1803: if (inputState.guessing == 0) {
1804: reportError(ex);
1805: recover(ex, _tokenSet_8);
1806: } else {
1807: throw ex;
1808: }
1809: }
1810: }
1811:
1812: public final void pr__P_S_AND_S_C_T() throws RecognitionException,
1813: TokenStreamException {
1814:
1815: Token m32 = null;
1816:
1817: try { // for error handling
1818: m32 = LT(1);
1819: match(PACKAGE_SPECIFIER);
1820: if (inputState.guessing == 0) {
1821:
1822: prntS(" ===12===");
1823:
1824: // to start of gathering all info within gatheredStr about the being parsered reference:
1825: addToGatheredStr(currentStackElem, m32.getText()); // so, it's "L"[A-Za-z][A-Za-z0-9"/"]*"/" here
1826:
1827: // to start of gathering all info within CTPTsignature about the being parsered reference:
1828: currentStackElem.sigBegin = addToSignature(m32
1829: .getText()); // so, it's "L"[A-Za-z][A-Za-z0-9"/"]*"/" added to CTPTsignature
1830: currentStackElem.sigEnd = currentStackElem.sigBegin
1831: + m32.getText().length();
1832:
1833: prntSS(">->->->-> ", currentStackElem.gatheredStr);
1834: prntSS(" ### 12:", m32.getText());
1835:
1836: }
1837: pr__SIMPLE_CLASS_TYPE_SIGNATURE();
1838: if (inputState.guessing == 0) {
1839: prntSS(" pr__P_S_AND_S_C_T:", "m33.getText()");
1840: }
1841: } catch (RecognitionException ex) {
1842: if (inputState.guessing == 0) {
1843: reportError(ex);
1844: recover(ex, _tokenSet_9);
1845: } else {
1846: throw ex;
1847: }
1848: }
1849: }
1850:
1851: public final void pr__TYPE_ARGUMENTS() throws RecognitionException,
1852: TokenStreamException {
1853:
1854: try { // for error handling
1855: {
1856: int _cnt27 = 0;
1857: _loop27: do {
1858: if ((_tokenSet_10.member(LA(1)))) {
1859: pr__TYPE_ARGUMENT();
1860: if (inputState.guessing == 0) {
1861: prntSS(" pr__TYPE_ARGUMENTS 1 :",
1862: "m38.getText()");
1863: }
1864: } else {
1865: if (_cnt27 >= 1) {
1866: break _loop27;
1867: } else {
1868: throw new NoViableAltException(LT(1),
1869: getFilename());
1870: }
1871: }
1872:
1873: _cnt27++;
1874: } while (true);
1875: }
1876: } catch (RecognitionException ex) {
1877: if (inputState.guessing == 0) {
1878: reportError(ex);
1879: recover(ex, _tokenSet_4);
1880: } else {
1881: throw ex;
1882: }
1883: }
1884: }
1885:
1886: public final void pr__TYPE_ARGUMENT() throws RecognitionException,
1887: TokenStreamException {
1888:
1889: Token m39 = null;
1890:
1891: try { // for error handling
1892: switch (LA(1)) {
1893: case STAR_SIGN: {
1894: m39 = LT(1);
1895: match(STAR_SIGN);
1896: if (inputState.guessing == 0) {
1897:
1898: prntS(" ===17===");
1899: // grow the signature inconditionally because a wildcard is always the argument of :
1900: currentStackElem.sigEnd = addToSignature("*") + 1;
1901:
1902: // so, it's "unrestricted" wildcard.
1903: // add the wildcard to the args list of the stack's element of the previous layer:
1904: upper = createInterimClassType("Ljava/lang/Object");
1905: addElemToTypeArgsList(createInterimWildcardType(
1906: 0 /* i.e. extends Object */,
1907: new InterimType[] { (InterimType) upper },
1908: 1));
1909:
1910: prntSS(" pr__TYPE_ARGUMENT 1 :", m39.getText());
1911:
1912: }
1913: break;
1914: }
1915: case ID:
1916: case TVAR:
1917: case PACKAGE_SPECIFIER:
1918: case SQUAREOPEN_SIGN: {
1919: pr__FIELD_TYPE_SIGNATURE();
1920: if (inputState.guessing == 0) {
1921: prntSS(" pr__TYPE_ARGUMENT 2 :", "m40.getText()");
1922: }
1923: break;
1924: }
1925: case PLUS_SIGN:
1926: case MINUS_SIGN: {
1927: pr__WILDCARD_INDICATOR();
1928: if (inputState.guessing == 0) {
1929: prntSS(" ### 17:", "m41.getText()");
1930: }
1931: pr__FIELD_TYPE_SIGNATURE();
1932: if (inputState.guessing == 0) {
1933: prntSS(" pr__TYPE_ARGUMENT 3 :", "m42.getText()");
1934: }
1935: break;
1936: }
1937: default: {
1938: throw new NoViableAltException(LT(1), getFilename());
1939: }
1940: }
1941: } catch (RecognitionException ex) {
1942: if (inputState.guessing == 0) {
1943: reportError(ex);
1944: recover(ex, _tokenSet_11);
1945: } else {
1946: throw ex;
1947: }
1948: }
1949: }
1950:
1951: public final void pr__WILDCARD_INDICATOR()
1952: throws RecognitionException, TokenStreamException {
1953:
1954: Token m43 = null;
1955:
1956: try { // for error handling
1957: switch (LA(1)) {
1958: case PLUS_SIGN: {
1959: match(PLUS_SIGN);
1960: if (inputState.guessing == 0) {
1961:
1962: prntS(" ===18===");
1963: // grow the signature inconditionally because a wildcard is always the argument of :
1964: currentStackElem.sigEnd = addToSignature("+") + 1;
1965:
1966: // so, it's "restricted" wildcard :
1967: currentStackElem.wrappInWildcard = 0; // upper
1968:
1969: prntS(" pr__WILDCARD_INDICATOR 1 ");
1970:
1971: }
1972: break;
1973: }
1974: case MINUS_SIGN: {
1975: m43 = LT(1);
1976: match(MINUS_SIGN);
1977: if (inputState.guessing == 0) {
1978:
1979: prntS(" ===19===");
1980: // grow the signature inconditionally because a wildcard is always the argument of :
1981: currentStackElem.sigEnd = addToSignature("-") + 1;
1982:
1983: // so, it's "restricted" wildcard:
1984: currentStackElem.wrappInWildcard = 1; // lower
1985:
1986: prntSS(" pr__WILDCARD_INDICATOR 2 :", m43
1987: .getText());
1988:
1989: }
1990: break;
1991: }
1992: default: {
1993: throw new NoViableAltException(LT(1), getFilename());
1994: }
1995: }
1996: } catch (RecognitionException ex) {
1997: if (inputState.guessing == 0) {
1998: reportError(ex);
1999: recover(ex, _tokenSet_0);
2000: } else {
2001: throw ex;
2002: }
2003: }
2004: }
2005:
2006: public final void pr__TYPE_SIGNATURE() throws RecognitionException,
2007: TokenStreamException {
2008:
2009: Token m49 = null;
2010:
2011: try { // for error handling
2012: switch (LA(1)) {
2013: case ID:
2014: case TVAR:
2015: case PACKAGE_SPECIFIER:
2016: case SQUAREOPEN_SIGN: {
2017: pr__FIELD_TYPE_SIGNATURE();
2018: if (inputState.guessing == 0) {
2019: prntSS(" pr__TYPE_SIGNATURE 1 :", "m48.getText()");
2020: }
2021: break;
2022: }
2023: case TBASE: {
2024: m49 = LT(1);
2025: match(TBASE);
2026: if (inputState.guessing == 0) {
2027:
2028: prsrT = createInterimClassType(getBaseTypeName(m49
2029: .getText().charAt(0)));
2030:
2031: // if there is dimention indicator then InterimTypeVariable should be "rolled up" by InterimGenericArrayType
2032: if (currentStackElem.dim > 0) {
2033: for (i = 0; i < currentStackElem.dim; i++) {
2034: prsrT = (InterimType) createInterimGenericArrayType(prsrT);
2035: }
2036: }
2037: currentStackElem.dim = 0;
2038:
2039: highLevelType = /*(InterimGenericType)*/(InterimType) prsrT;
2040:
2041: prntSS(" pr__TYPE_SIGNATURE 2 :", m49.getText());
2042:
2043: }
2044: break;
2045: }
2046: default: {
2047: throw new NoViableAltException(LT(1), getFilename());
2048: }
2049: }
2050: } catch (RecognitionException ex) {
2051: if (inputState.guessing == 0) {
2052: reportError(ex);
2053: recover(ex, _tokenSet_2);
2054: } else {
2055: throw ex;
2056: }
2057: }
2058: }
2059:
2060: public final void pr__SUPERINTERFACE_SIGNATURE()
2061: throws RecognitionException, TokenStreamException {
2062:
2063: try { // for error handling
2064: pr__CLASS_TYPE_SIGNATURE();
2065: if (inputState.guessing == 0) {
2066:
2067: prntS(" ===22===");
2068: addElemToImplList((InterimType) highLevelType); // add the gathered regular type to implements-list
2069:
2070: highLevelType = null;
2071:
2072: prntSS(" pr__SUPERINTERFACE_SIGNATURE:",
2073: "m51.getText()");
2074:
2075: }
2076: } catch (RecognitionException ex) {
2077: if (inputState.guessing == 0) {
2078: reportError(ex);
2079: recover(ex, _tokenSet_12);
2080: } else {
2081: throw ex;
2082: }
2083: }
2084: }
2085:
2086: public final void pr__C_P_AND_R_T() throws RecognitionException,
2087: TokenStreamException {
2088:
2089: try { // for error handling
2090: pr__METHOD_PARAMETERS();
2091: if (inputState.guessing == 0) {
2092: prntSS(" ### 241:", "m556.getText()");
2093: }
2094: LT(1);
2095: match(VOIDTYPE);
2096: if (inputState.guessing == 0) {
2097:
2098: prntSS(" pr__C_P_AND_R_T :", "m557.getText()");
2099: }
2100: } catch (RecognitionException ex) {
2101: if (inputState.guessing == 0) {
2102: reportError(ex);
2103: recover(ex, _tokenSet_13);
2104: } else {
2105: throw ex;
2106: }
2107: }
2108: }
2109:
2110: public final void pr__THROWN_SIGNATURE()
2111: throws RecognitionException, TokenStreamException {
2112:
2113: try { // for error handling
2114: pr__THROWNS();
2115: if (inputState.guessing == 0) {
2116:
2117: prntS(" ===32===");
2118: // set throwns field of InterimMethodGenericDecl/InterimConstructorGenericDecl object:
2119: //(declType == METHODoDECL ? methodDecl : constructorDecl).throwns = (InterimType[])thrownList.toArray();
2120: if (declType == METHODoDECL) {
2121: ((InterimMethodGenericDecl) methodDecl).throwns = thrownList
2122: .toArray(new InterimType[thrownList.size()]);
2123: } else {
2124: ((InterimConstructorGenericDecl) constructorDecl).throwns = thrownList
2125: .toArray(new InterimType[thrownList.size()]);
2126: }
2127:
2128: // clean the thrownList:
2129: thrownList = null;
2130:
2131: prntSS(" pr__THROWN_SIGNATURE:", "m82.getText()");
2132:
2133: }
2134: } catch (RecognitionException ex) {
2135: if (inputState.guessing == 0) {
2136: reportError(ex);
2137: recover(ex, _tokenSet_1);
2138: } else {
2139: throw ex;
2140: }
2141: }
2142: }
2143:
2144: public final void pr__F_T_P_AND_C_P_AND_R_T()
2145: throws RecognitionException, TokenStreamException {
2146:
2147: try { // for error handling
2148: pr__F_T_P_AND_M_P();
2149: if (inputState.guessing == 0) {
2150: prntSS(" ### 29:", "m558.getText()");
2151: }
2152: LT(1);
2153: match(VOIDTYPE);
2154: if (inputState.guessing == 0) {
2155:
2156: prntSS(" pr__F_T_P_AND_C_P_AND_R_T :",
2157: "m559.getText()");
2158: }
2159: } catch (RecognitionException ex) {
2160: if (inputState.guessing == 0) {
2161: reportError(ex);
2162: recover(ex, _tokenSet_13);
2163: } else {
2164: throw ex;
2165: }
2166: }
2167: }
2168:
2169: public final void pr__METHOD_PARAMETERS()
2170: throws RecognitionException, TokenStreamException {
2171:
2172: Token m76 = null;
2173: Token m77 = null;
2174: Token m73 = null;
2175: Token m75 = null;
2176:
2177: try { // for error handling
2178: boolean synPredMatched57 = false;
2179: if (((LA(1) == RINGOPEN_SIGN))) {
2180: int _m57 = mark();
2181: synPredMatched57 = true;
2182: inputState.guessing++;
2183: try {
2184: {
2185: match(RINGOPEN_SIGN);
2186: match(RINGCLOSE_SIGN);
2187: }
2188: } catch (RecognitionException pe) {
2189: synPredMatched57 = false;
2190: }
2191: rewind(_m57);
2192: inputState.guessing--;
2193: }
2194: if (synPredMatched57) {
2195: m76 = LT(1);
2196: match(RINGOPEN_SIGN);
2197: if (inputState.guessing == 0) {
2198:
2199: prntS(" ===29===");
2200: // create InterimMethodGenericDecl or InterimConstructorGenericDecl:
2201: if (declType == METHODoDECL) {
2202: methodDecl = new InterimMethodGenericDecl();
2203: } else {
2204: constructorDecl = new InterimConstructorGenericDecl();
2205: }
2206:
2207: prntSS(" ### 32:", m76.getText());
2208:
2209: }
2210: m77 = LT(1);
2211: match(RINGCLOSE_SIGN);
2212: if (inputState.guessing == 0) {
2213: prntSS(" pr__METHOD_PARAMETERS 2 :", m77
2214: .getText());
2215: }
2216: } else if ((LA(1) == RINGOPEN_SIGN)) {
2217: m73 = LT(1);
2218: match(RINGOPEN_SIGN);
2219: if (inputState.guessing == 0) {
2220:
2221: prntS(" ===27===");
2222: // create InterimMethodGenericDecl or InterimConstructorGenericDecl:
2223: if (declType == METHODoDECL) {
2224: methodDecl = new InterimMethodGenericDecl();
2225: } else {
2226: constructorDecl = new InterimConstructorGenericDecl();
2227: }
2228:
2229: prntSS(" ### 30:", m73.getText());
2230:
2231: }
2232: pr__PARAMETERS_LIST();
2233: if (inputState.guessing == 0) {
2234:
2235: prntS(" ===28===");
2236: // set methodParameters field of InterimMethodGenericDecl/InterimConstructorGenericDecl object:
2237: //(declType == METHODoDECL ? methodDecl : constructorDecl).methodParameters = (InterimType[])methParamList.toArray();
2238: if (declType == METHODoDECL) {
2239: ((InterimMethodGenericDecl) methodDecl).methodParameters = methParamList
2240: .toArray(new InterimType[methParamList
2241: .size()]);
2242: } else {
2243: ((InterimConstructorGenericDecl) constructorDecl).methodParameters = methParamList
2244: .toArray(new InterimType[methParamList
2245: .size()]);
2246: }
2247:
2248: // clean the methParamList:
2249: methParamList = null;
2250:
2251: prntSS(" ### 31:", "m74.getText()");
2252:
2253: }
2254: m75 = LT(1);
2255: match(RINGCLOSE_SIGN);
2256: if (inputState.guessing == 0) {
2257: prntSS(" pr__METHOD_PARAMETERS 1 :", m75
2258: .getText());
2259: }
2260: } else {
2261: throw new NoViableAltException(LT(1), getFilename());
2262: }
2263:
2264: } catch (RecognitionException ex) {
2265: if (inputState.guessing == 0) {
2266: reportError(ex);
2267: recover(ex, _tokenSet_14);
2268: } else {
2269: throw ex;
2270: }
2271: }
2272: }
2273:
2274: public final void pr__F_T_P_AND_M_P() throws RecognitionException,
2275: TokenStreamException {
2276:
2277: try { // for error handling
2278: pr__FORMAL_TYPE_PARAMETERS_DECL();
2279: if (inputState.guessing == 0) {
2280: prntSS(" ### 28:", "m66.getText()");
2281: }
2282: pr__METHOD_PARAMETERS();
2283: if (inputState.guessing == 0) {
2284:
2285: prntS(" ===23===");
2286: // set typeParameters field of InterimMethodGenericDecl or InterimConstructorGenericDecl object:
2287: //(declType == METHODoDECL ? methodDecl : constructorDecl).typeParameters = (InterimTypeParameter[])genParamList.toArray();
2288: if (declType == METHODoDECL) {
2289: ((InterimMethodGenericDecl) methodDecl).typeParameters = genParamList
2290: .toArray(new InterimTypeParameter[genParamList
2291: .size()]);
2292: } else {
2293: ((InterimConstructorGenericDecl) constructorDecl).typeParameters = genParamList
2294: .toArray(new InterimTypeParameter[genParamList
2295: .size()]);
2296: }
2297:
2298: // clean the genParamList:
2299: genParamList = null;
2300:
2301: prntSS(" pr__F_T_P_AND_M_P :", "m67.getText()");
2302:
2303: }
2304: } catch (RecognitionException ex) {
2305: if (inputState.guessing == 0) {
2306: reportError(ex);
2307: recover(ex, _tokenSet_14);
2308: } else {
2309: throw ex;
2310: }
2311: }
2312: }
2313:
2314: public final void pr__M_P_AND_R_T() throws RecognitionException,
2315: TokenStreamException {
2316:
2317: try { // for error handling
2318: pr__METHOD_PARAMETERS();
2319: if (inputState.guessing == 0) {
2320: prntSS(" ### 27:", "m64.getText()");
2321: }
2322: pr__RETURN_TYPE();
2323: if (inputState.guessing == 0) {
2324: prntSS(" pr__M_P_AND_R_T :", "m65.getText()");
2325: }
2326: } catch (RecognitionException ex) {
2327: if (inputState.guessing == 0) {
2328: reportError(ex);
2329: recover(ex, _tokenSet_13);
2330: } else {
2331: throw ex;
2332: }
2333: }
2334: }
2335:
2336: public final void pr__F_T_P_AND_M_P_AND_R_T()
2337: throws RecognitionException, TokenStreamException {
2338:
2339: try { // for error handling
2340: pr__F_T_P_AND_M_P();
2341: if (inputState.guessing == 0) {
2342: prntSS(" ### 29:", "m68.getText()");
2343: }
2344: pr__RETURN_TYPE();
2345: if (inputState.guessing == 0) {
2346: prntSS(" pr__F_T_P_AND_M_P_AND_R_T :",
2347: "m69.getText()");
2348: }
2349: } catch (RecognitionException ex) {
2350: if (inputState.guessing == 0) {
2351: reportError(ex);
2352: recover(ex, _tokenSet_13);
2353: } else {
2354: throw ex;
2355: }
2356: }
2357: }
2358:
2359: public final void pr__RETURN_TYPE() throws RecognitionException,
2360: TokenStreamException {
2361:
2362: Token m70 = null;
2363: Token m72 = null;
2364:
2365: try { // for error handling
2366: switch (LA(1)) {
2367: case VOIDTYPE: {
2368: m70 = LT(1);
2369: match(VOIDTYPE);
2370: if (inputState.guessing == 0) {
2371:
2372: prntS(" ===24===");
2373: if (declType == METHODoDECL) {
2374: // put void return type into the method decl:
2375: methodDecl.returnValue = (InterimType) createInterimClassType("void");
2376: }
2377:
2378: prntSS(" pr__RETURN_TYPE 1 :", m70.getText());
2379:
2380: }
2381: break;
2382: }
2383: case ID:
2384: case TVAR:
2385: case PACKAGE_SPECIFIER:
2386: case SQUAREOPEN_SIGN:
2387: case TBASE: {
2388: pr__TYPE_SIGNATURE();
2389: if (inputState.guessing == 0) {
2390:
2391: prntS(" ===25===");
2392: // put return type into the method decl:
2393: methodDecl.returnValue = (InterimType) highLevelType;
2394:
2395: highLevelType = null;
2396:
2397: prntSS(" pr__RETURN_TYPE 2 :", "m71.getText()");
2398:
2399: }
2400: break;
2401: }
2402: case RETURN_BASE_TYPE: {
2403: m72 = LT(1);
2404: match(RETURN_BASE_TYPE);
2405: if (inputState.guessing == 0) {
2406:
2407: prntS(" ===26===");
2408: prsrT = createInterimClassType(getBaseTypeName(m72
2409: .getText().charAt(0)));
2410:
2411: // if there is dimention indicator then InterimTypeVariable should be "rolled up" by InterimGenericArrayType
2412: if (currentStackElem.dim > 0) {
2413: for (i = 0; i < currentStackElem.dim; i++) {
2414: prsrT = (InterimType) createInterimGenericArrayType(prsrT);
2415: }
2416: }
2417: currentStackElem.dim = 0;
2418:
2419: // put base return type into the method decl:
2420: methodDecl.returnValue = prsrT;
2421:
2422: prntSS(" pr__RETURN_TYPE 3 :", m72.getText());
2423:
2424: }
2425: break;
2426: }
2427: default: {
2428: throw new NoViableAltException(LT(1), getFilename());
2429: }
2430: }
2431: } catch (RecognitionException ex) {
2432: if (inputState.guessing == 0) {
2433: reportError(ex);
2434: recover(ex, _tokenSet_13);
2435: } else {
2436: throw ex;
2437: }
2438: }
2439: }
2440:
2441: public final void pr__PARAMETERS_LIST()
2442: throws RecognitionException, TokenStreamException {
2443:
2444: try { // for error handling
2445: {
2446: int _cnt60 = 0;
2447: _loop60: do {
2448: if ((_tokenSet_15.member(LA(1)))) {
2449: pr__PARAMETER();
2450: if (inputState.guessing == 0) {
2451: prntSS(" pr__PARAMETERS_LIST 2 :",
2452: "m78.getText()");
2453: }
2454: } else {
2455: if (_cnt60 >= 1) {
2456: break _loop60;
2457: } else {
2458: throw new NoViableAltException(LT(1),
2459: getFilename());
2460: }
2461: }
2462:
2463: _cnt60++;
2464: } while (true);
2465: }
2466: } catch (RecognitionException ex) {
2467: if (inputState.guessing == 0) {
2468: reportError(ex);
2469: recover(ex, _tokenSet_16);
2470: } else {
2471: throw ex;
2472: }
2473: }
2474: }
2475:
2476: public final void pr__PARAMETER() throws RecognitionException,
2477: TokenStreamException {
2478:
2479: Token m80 = null;
2480:
2481: try { // for error handling
2482: switch (LA(1)) {
2483: case ID:
2484: case TVAR:
2485: case PACKAGE_SPECIFIER:
2486: case SQUAREOPEN_SIGN: {
2487: pr__FIELD_TYPE_SIGNATURE();
2488: if (inputState.guessing == 0) {
2489:
2490: prntS(" ===30===");
2491: // put base type into the method params list:
2492: addElemToMethParamList(highLevelType);
2493:
2494: highLevelType = null;
2495:
2496: prntSS(" pr__PARAMETER 1 :", "m79.getText()");
2497:
2498: }
2499: break;
2500: }
2501: case TBASE: {
2502: m80 = LT(1);
2503: match(TBASE);
2504: if (inputState.guessing == 0) {
2505:
2506: prntS(" ===31===");
2507: prsrT = createInterimClassType(getBaseTypeName(m80
2508: .getText().charAt(0)));
2509:
2510: // if there is dimention indicator then InterimTypeVariable should be "rolled up" by InterimGenericArrayType
2511: if (currentStackElem.dim > 0) {
2512: for (i = 0; i < currentStackElem.dim; i++) {
2513: prsrT = (InterimType) createInterimGenericArrayType(prsrT);
2514: }
2515: }
2516: currentStackElem.dim = 0;
2517:
2518: // put base type into the method params list:
2519: addElemToMethParamList(prsrT);
2520:
2521: prntSS(" pr__PARAMETER 2 :", m80.getText());
2522:
2523: }
2524: break;
2525: }
2526: default: {
2527: throw new NoViableAltException(LT(1), getFilename());
2528: }
2529: }
2530: } catch (RecognitionException ex) {
2531: if (inputState.guessing == 0) {
2532: reportError(ex);
2533: recover(ex, _tokenSet_17);
2534: } else {
2535: throw ex;
2536: }
2537: }
2538: }
2539:
2540: public final void pr__THROWNS() throws RecognitionException,
2541: TokenStreamException {
2542:
2543: try { // for error handling
2544: {
2545: int _cnt65 = 0;
2546: _loop65: do {
2547: if ((LA(1) == CNTRL_SIGN)) {
2548: pr__THROWN();
2549: if (inputState.guessing == 0) {
2550: prntSS(" pr__THROWNS 2 :",
2551: "m83.getText()");
2552: }
2553: } else {
2554: if (_cnt65 >= 1) {
2555: break _loop65;
2556: } else {
2557: throw new NoViableAltException(LT(1),
2558: getFilename());
2559: }
2560: }
2561:
2562: _cnt65++;
2563: } while (true);
2564: }
2565: } catch (RecognitionException ex) {
2566: if (inputState.guessing == 0) {
2567: reportError(ex);
2568: recover(ex, _tokenSet_1);
2569: } else {
2570: throw ex;
2571: }
2572: }
2573: }
2574:
2575: public final void pr__THROWN() throws RecognitionException,
2576: TokenStreamException {
2577:
2578: Token m84 = null;
2579: Token m86 = null;
2580: Token m87 = null;
2581:
2582: try { // for error handling
2583: boolean synPredMatched68 = false;
2584: if (((LA(1) == CNTRL_SIGN))) {
2585: int _m68 = mark();
2586: synPredMatched68 = true;
2587: inputState.guessing++;
2588: try {
2589: {
2590: match(CNTRL_SIGN);
2591: pr__CLASS_TYPE_SIGNATURE();
2592: }
2593: } catch (RecognitionException pe) {
2594: synPredMatched68 = false;
2595: }
2596: rewind(_m68);
2597: inputState.guessing--;
2598: }
2599: if (synPredMatched68) {
2600: m84 = LT(1);
2601: match(CNTRL_SIGN);
2602: if (inputState.guessing == 0) {
2603:
2604: Yflag2 = 1; // so, we are within throws part
2605:
2606: prntSS(" ### 35:", m84.getText());
2607:
2608: }
2609: pr__CLASS_TYPE_SIGNATURE();
2610: if (inputState.guessing == 0) {
2611:
2612: prntS(" ===33===");
2613: // put the InterimClassType or InterimParameterizedType to the throwns list:
2614: addElemToThrownList((InterimType) highLevelType);
2615:
2616: highLevelType = null;
2617:
2618: prntSS(" pr__THROWN 1 :", "m85.getText()");
2619:
2620: }
2621: } else if ((LA(1) == CNTRL_SIGN)) {
2622: m86 = LT(1);
2623: match(CNTRL_SIGN);
2624: if (inputState.guessing == 0) {
2625: prntSS(" ### 36:", m86.getText());
2626: }
2627: m87 = LT(1);
2628: match(TVAR);
2629: if (inputState.guessing == 0) {
2630:
2631: prntS(" ===34===");
2632: assert (currentStackElem.dim == 0);
2633:
2634: // put the InterimTypeVariable to the throwns list:
2635: // to exclude first (official) "T" symbol (and last ";" symbol):
2636: System.out.println(m87.getText() + "|"
2637: + m87.getText().length());
2638: addElemToThrownList((InterimType) createInterimTypeVariable(m87
2639: .getText().substring(1,
2640: m87.getText().length() - 1)));
2641:
2642: prntSS(" pr__THROWN 2 :", m87.getText());
2643:
2644: }
2645: } else {
2646: throw new NoViableAltException(LT(1), getFilename());
2647: }
2648:
2649: } catch (RecognitionException ex) {
2650: if (inputState.guessing == 0) {
2651: reportError(ex);
2652: recover(ex, _tokenSet_13);
2653: } else {
2654: throw ex;
2655: }
2656: }
2657: }
2658:
2659: public static final String[] _tokenNames = { "<0>", "EOF", "<2>",
2660: "NULL_TREE_LOOKAHEAD", "TRIANGLEOPEN_SIGN",
2661: "TRIANGLECLOSE_SIGN", "ID_COLON", "ID", "COLON_SIGN",
2662: "TVAR", "SEMICOLON_SIGN", "PACKAGE_SPECIFIER", "STAR_SIGN",
2663: "PLUS_SIGN", "MINUS_SIGN", "DOT_OR_DOLLAR_SIGN",
2664: "SQUAREOPEN_SIGN", "TBASE", "VOIDTYPE", "RETURN_BASE_TYPE",
2665: "RINGOPEN_SIGN", "RINGCLOSE_SIGN", "CNTRL_SIGN" };
2666:
2667: private static final long[] mk_tokenSet_0() {
2668: long[] data = { 68224L, 0L };
2669: return data;
2670: }
2671:
2672: public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0());
2673:
2674: private static final long[] mk_tokenSet_1() {
2675: long[] data = { 2L, 0L };
2676: return data;
2677: }
2678:
2679: public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1());
2680:
2681: private static final long[] mk_tokenSet_2() {
2682: long[] data = { 6519778L, 0L };
2683: return data;
2684: }
2685:
2686: public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2());
2687:
2688: private static final long[] mk_tokenSet_3() {
2689: long[] data = { 1050752L, 0L };
2690: return data;
2691: }
2692:
2693: public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3());
2694:
2695: private static final long[] mk_tokenSet_4() {
2696: long[] data = { 32L, 0L };
2697: return data;
2698: }
2699:
2700: public static final BitSet _tokenSet_4 = new BitSet(mk_tokenSet_4());
2701:
2702: private static final long[] mk_tokenSet_5() {
2703: long[] data = { 224L, 0L };
2704: return data;
2705: }
2706:
2707: public static final BitSet _tokenSet_5 = new BitSet(mk_tokenSet_5());
2708:
2709: private static final long[] mk_tokenSet_6() {
2710: long[] data = { 256L, 0L };
2711: return data;
2712: }
2713:
2714: public static final BitSet _tokenSet_6 = new BitSet(mk_tokenSet_6());
2715:
2716: private static final long[] mk_tokenSet_7() {
2717: long[] data = { 480L, 0L };
2718: return data;
2719: }
2720:
2721: public static final BitSet _tokenSet_7 = new BitSet(mk_tokenSet_7());
2722:
2723: private static final long[] mk_tokenSet_8() {
2724: long[] data = { 1024L, 0L };
2725: return data;
2726: }
2727:
2728: public static final BitSet _tokenSet_8 = new BitSet(mk_tokenSet_8());
2729:
2730: private static final long[] mk_tokenSet_9() {
2731: long[] data = { 33792L, 0L };
2732: return data;
2733: }
2734:
2735: public static final BitSet _tokenSet_9 = new BitSet(mk_tokenSet_9());
2736:
2737: private static final long[] mk_tokenSet_10() {
2738: long[] data = { 96896L, 0L };
2739: return data;
2740: }
2741:
2742: public static final BitSet _tokenSet_10 = new BitSet(
2743: mk_tokenSet_10());
2744:
2745: private static final long[] mk_tokenSet_11() {
2746: long[] data = { 96928L, 0L };
2747: return data;
2748: }
2749:
2750: public static final BitSet _tokenSet_11 = new BitSet(
2751: mk_tokenSet_11());
2752:
2753: private static final long[] mk_tokenSet_12() {
2754: long[] data = { 2178L, 0L };
2755: return data;
2756: }
2757:
2758: public static final BitSet _tokenSet_12 = new BitSet(
2759: mk_tokenSet_12());
2760:
2761: private static final long[] mk_tokenSet_13() {
2762: long[] data = { 4194306L, 0L };
2763: return data;
2764: }
2765:
2766: public static final BitSet _tokenSet_13 = new BitSet(
2767: mk_tokenSet_13());
2768:
2769: private static final long[] mk_tokenSet_14() {
2770: long[] data = { 985728L, 0L };
2771: return data;
2772: }
2773:
2774: public static final BitSet _tokenSet_14 = new BitSet(
2775: mk_tokenSet_14());
2776:
2777: private static final long[] mk_tokenSet_15() {
2778: long[] data = { 199296L, 0L };
2779: return data;
2780: }
2781:
2782: public static final BitSet _tokenSet_15 = new BitSet(
2783: mk_tokenSet_15());
2784:
2785: private static final long[] mk_tokenSet_16() {
2786: long[] data = { 2097152L, 0L };
2787: return data;
2788: }
2789:
2790: public static final BitSet _tokenSet_16 = new BitSet(
2791: mk_tokenSet_16());
2792:
2793: private static final long[] mk_tokenSet_17() {
2794: long[] data = { 2296448L, 0L };
2795: return data;
2796: }
2797:
2798: public static final BitSet _tokenSet_17 = new BitSet(
2799: mk_tokenSet_17());
2800:
2801: }
|