1 /* 2 * Copyright (C) 2011 Google Inc. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.google.doclava.parser; 18 19 import org.antlr.runtime.BaseRecognizer; 20 import org.antlr.runtime.BitSet; 21 import org.antlr.runtime.DFA; 22 import org.antlr.runtime.EarlyExitException; 23 import org.antlr.runtime.IntStream; 24 import org.antlr.runtime.MismatchedSetException; 25 import org.antlr.runtime.NoViableAltException; 26 import org.antlr.runtime.RecognitionException; 27 import org.antlr.runtime.RecognizerSharedState; 28 import org.antlr.runtime.TokenStream; 29 import org.antlr.runtime.debug.DebugEventListener; 30 import org.antlr.runtime.debug.DebugEventSocketProxy; 31 import org.antlr.runtime.debug.DebugParser; 32 33 import java.io.IOException; 34 import java.util.HashMap; 35 /** A Java 1.5 grammar for ANTLR v3 derived from the spec 36 * 37 * This is a very close representation of the spec; the changes 38 * are comestic (remove left recursion) and also fixes (the spec 39 * isn't exactly perfect). I have run this on the 1.4.2 source 40 * and some nasty looking enums from 1.5, but have not really 41 * tested for 1.5 compatibility. 42 * 43 * I built this with: java -Xmx100M org.antlr.Tool java.g 44 * and got two errors that are ok (for now): 45 * java.g:691:9: Decision can match input such as 46 * "'0'..'9'{'E', 'e'}{'+', '-'}'0'..'9'{'D', 'F', 'd', 'f'}" 47 * using multiple alternatives: 3, 4 48 * As a result, alternative(s) 4 were disabled for that input 49 * java.g:734:35: Decision can match input such as "{'$', 'A'..'Z', 50 * '_', 'a'..'z', '\u00C0'..'\u00D6', '\u00D8'..'\u00F6', 51 * '\u00F8'..'\u1FFF', '\u3040'..'\u318F', '\u3300'..'\u337F', 52 * '\u3400'..'\u3D2D', '\u4E00'..'\u9FFF', '\uF900'..'\uFAFF'}" 53 * using multiple alternatives: 1, 2 54 * As a result, alternative(s) 2 were disabled for that input 55 * 56 * You can turn enum on/off as a keyword :) 57 * 58 * Version 1.0 -- initial release July 5, 2006 (requires 3.0b2 or higher) 59 * 60 * Primary author: Terence Parr, July 2006 61 * 62 * Version 1.0.1 -- corrections by Koen Vanderkimpen & Marko van Dooren, 63 * October 25, 2006; 64 * fixed normalInterfaceDeclaration: now uses typeParameters instead 65 * of typeParameter (according to JLS, 3rd edition) 66 * fixed castExpression: no longer allows expression next to type 67 * (according to semantics in JLS, in contrast with syntax in JLS) 68 * 69 * Version 1.0.2 -- Terence Parr, Nov 27, 2006 70 * java spec I built this from had some bizarre for-loop control. 71 * Looked weird and so I looked elsewhere...Yep, it's messed up. 72 * simplified. 73 * 74 * Version 1.0.3 -- Chris Hogue, Feb 26, 2007 75 * Factored out an annotationName rule and used it in the annotation rule. 76 * Not sure why, but typeName wasn't recognizing references to inner 77 * annotations (e.g. @InterfaceName.InnerAnnotation()) 78 * Factored out the elementValue section of an annotation reference. Created 79 * elementValuePair and elementValuePairs rules, then used them in the 80 * annotation rule. Allows it to recognize annotation references with 81 * multiple, comma separated attributes. 82 * Updated elementValueArrayInitializer so that it allows multiple elements. 83 * (It was only allowing 0 or 1 element). 84 * Updated localVariableDeclaration to allow annotations. Interestingly the JLS 85 * doesn't appear to indicate this is legal, but it does work as of at least 86 * JDK 1.5.0_06. 87 * Moved the Identifier portion of annotationTypeElementRest to annotationMethodRest. 88 * Because annotationConstantRest already references variableDeclarator which 89 * has the Identifier portion in it, the parser would fail on constants in 90 * annotation definitions because it expected two identifiers. 91 * Added optional trailing ';' to the alternatives in annotationTypeElementRest. 92 * Wouldn't handle an inner interface that has a trailing ';'. 93 * Swapped the expression and type rule reference order in castExpression to 94 * make it check for genericized casts first. It was failing to recognize a 95 * statement like "Class<Byte> TYPE = (Class<Byte>)...;" because it was seeing 96 * 'Class<Byte' in the cast expression as a less than expression, then failing 97 * on the '>'. 98 * Changed createdName to use typeArguments instead of nonWildcardTypeArguments. 99 * 100 * Changed the 'this' alternative in primary to allow 'identifierSuffix' rather than 101 * just 'arguments'. The case it couldn't handle was a call to an explicit 102 * generic method invocation (e.g. this.<E>doSomething()). Using identifierSuffix 103 * may be overly aggressive--perhaps should create a more constrained thisSuffix rule? 104 * 105 * Version 1.0.4 -- Hiroaki Nakamura, May 3, 2007 106 * 107 * Fixed formalParameterDecls, localVariableDeclaration, forInit, 108 * and forVarControl to use variableModifier* not 'final'? (annotation)? 109 * 110 * Version 1.0.5 -- Terence, June 21, 2007 111 * --a[i].foo didn't work. Fixed unaryExpression 112 * 113 * Version 1.0.6 -- John Ridgway, March 17, 2008 114 * Made "assert" a switchable keyword like "enum". 115 * Fixed compilationUnit to disallow "annotation importDeclaration ...". 116 * Changed "Identifier ('.' Identifier)*" to "qualifiedName" in more 117 * places. 118 * Changed modifier* and/or variableModifier* to classOrInterfaceModifiers, 119 * modifiers or variableModifiers, as appropriate. 120 * Renamed "bound" to "typeBound" to better match language in the JLS. 121 * Added "memberDeclaration" which rewrites to methodDeclaration or 122 * fieldDeclaration and pulled type into memberDeclaration. So we parse 123 * type and then move on to decide whether we're dealing with a field 124 * or a method. 125 * Modified "constructorDeclaration" to use "constructorBody" instead of 126 * "methodBody". constructorBody starts with explicitConstructorInvocation, 127 * then goes on to blockStatement*. Pulling explicitConstructorInvocation 128 * out of expressions allowed me to simplify "primary". 129 * Changed variableDeclarator to simplify it. 130 * Changed type to use classOrInterfaceType, thus simplifying it; of course 131 * I then had to add classOrInterfaceType, but it is used in several 132 * places. 133 * Fixed annotations, old version allowed "@X(y,z)", which is illegal. 134 * Added optional comma to end of "elementValueArrayInitializer"; as per JLS. 135 * Changed annotationTypeElementRest to use normalClassDeclaration and 136 * normalInterfaceDeclaration rather than classDeclaration and 137 * interfaceDeclaration, thus getting rid of a couple of grammar ambiguities. 138 * Split localVariableDeclaration into localVariableDeclarationStatement 139 * (includes the terminating semi-colon) and localVariableDeclaration. 140 * This allowed me to use localVariableDeclaration in "forInit" clauses, 141 * simplifying them. 142 * Changed switchBlockStatementGroup to use multiple labels. This adds an 143 * ambiguity, but if one uses appropriately greedy parsing it yields the 144 * parse that is closest to the meaning of the switch statement. 145 * Renamed "forVarControl" to "enhancedForControl" -- JLS language. 146 * Added semantic predicates to test for shift operations rather than other 147 * things. Thus, for instance, the string "< <" will never be treated 148 * as a left-shift operator. 149 * In "creator" we rule out "nonWildcardTypeArguments" on arrayCreation, 150 * which are illegal. 151 * Moved "nonWildcardTypeArguments into innerCreator. 152 * Removed 'super' superSuffix from explicitGenericInvocation, since that 153 * is only used in explicitConstructorInvocation at the beginning of a 154 * constructorBody. (This is part of the simplification of expressions 155 * mentioned earlier.) 156 * Simplified primary (got rid of those things that are only used in 157 * explicitConstructorInvocation). 158 * Lexer -- removed "Exponent?" from FloatingPointLiteral choice 4, since it 159 * led to an ambiguity. 160 * 161 * This grammar successfully parses every .java file in the JDK 1.5 source 162 * tree (excluding those whose file names include '-', which are not 163 * valid Java compilation units). 164 * 165 * Known remaining problems: 166 * "Letter" and "JavaIDDigit" are wrong. The actual specification of 167 * "Letter" should be "a character for which the method 168 * Character.isJavaIdentifierStart(int) returns true." A "Java 169 * letter-or-digit is a character for which the method 170 * Character.isJavaIdentifierPart(int) returns true." 171 */ 172 public class JavaParser extends DebugParser { 173 public static final String[] tokenNames = new String[] { 174 "<invalid>", "<EOR>", "<DOWN>", "<UP>", "IDENTIFIER", "INTLITERAL", "LONGLITERAL", "FLOATLITERAL", "DOUBLELITERAL", "CHARLITERAL", "STRINGLITERAL", "TRUE", "FALSE", "NULL", "IntegerNumber", "LongSuffix", "HexPrefix", "HexDigit", "Exponent", "NonIntegerNumber", "FloatSuffix", "DoubleSuffix", "EscapeSequence", "UNICODECHAR", "UNICODEPART", "WS", "COMMENT", "LINE_COMMENT", "ABSTRACT", "ASSERT", "BOOLEAN", "BREAK", "BYTE", "CASE", "CATCH", "CHAR", "CLASS", "CONST", "CONTINUE", "DEFAULT", "DO", "DOUBLE", "ELSE", "ENUM", "EXTENDS", "FINAL", "FINALLY", "FLOAT", "FOR", "GOTO", "IF", "IMPLEMENTS", "IMPORT", "INSTANCEOF", "INT", "INTERFACE", "LONG", "NATIVE", "NEW", "PACKAGE", "PRIVATE", "PROTECTED", "PUBLIC", "RETURN", "SHORT", "STATIC", "STRICTFP", "SUPER", "SWITCH", "SYNCHRONIZED", "THIS", "THROW", "THROWS", "TRANSIENT", "TRY", "VOID", "VOLATILE", "WHILE", "LPAREN", "RPAREN", "LBRACE", "RBRACE", "LBRACKET", "RBRACKET", "SEMI", "COMMA", "DOT", "ELLIPSIS", "EQ", "BANG", "TILDE", "QUES", "COLON", "EQEQ", "AMPAMP", "BARBAR", "PLUSPLUS", "SUBSUB", "PLUS", "SUB", "STAR", "SLASH", "AMP", "BAR", "CARET", "PERCENT", "PLUSEQ", "SUBEQ", "STAREQ", "SLASHEQ", "AMPEQ", "BAREQ", "CARETEQ", "PERCENTEQ", "MONKEYS_AT", "BANGEQ", "GT", "LT", "IdentifierStart", "IdentifierPart", "SurrogateIdentifer" 175 }; 176 public static final int EOF=-1; 177 public static final int IDENTIFIER=4; 178 public static final int INTLITERAL=5; 179 public static final int LONGLITERAL=6; 180 public static final int FLOATLITERAL=7; 181 public static final int DOUBLELITERAL=8; 182 public static final int CHARLITERAL=9; 183 public static final int STRINGLITERAL=10; 184 public static final int TRUE=11; 185 public static final int FALSE=12; 186 public static final int NULL=13; 187 public static final int IntegerNumber=14; 188 public static final int LongSuffix=15; 189 public static final int HexPrefix=16; 190 public static final int HexDigit=17; 191 public static final int Exponent=18; 192 public static final int NonIntegerNumber=19; 193 public static final int FloatSuffix=20; 194 public static final int DoubleSuffix=21; 195 public static final int EscapeSequence=22; 196 public static final int UNICODECHAR=23; 197 public static final int UNICODEPART=24; 198 public static final int WS=25; 199 public static final int COMMENT=26; 200 public static final int LINE_COMMENT=27; 201 public static final int ABSTRACT=28; 202 public static final int ASSERT=29; 203 public static final int BOOLEAN=30; 204 public static final int BREAK=31; 205 public static final int BYTE=32; 206 public static final int CASE=33; 207 public static final int CATCH=34; 208 public static final int CHAR=35; 209 public static final int CLASS=36; 210 public static final int CONST=37; 211 public static final int CONTINUE=38; 212 public static final int DEFAULT=39; 213 public static final int DO=40; 214 public static final int DOUBLE=41; 215 public static final int ELSE=42; 216 public static final int ENUM=43; 217 public static final int EXTENDS=44; 218 public static final int FINAL=45; 219 public static final int FINALLY=46; 220 public static final int FLOAT=47; 221 public static final int FOR=48; 222 public static final int GOTO=49; 223 public static final int IF=50; 224 public static final int IMPLEMENTS=51; 225 public static final int IMPORT=52; 226 public static final int INSTANCEOF=53; 227 public static final int INT=54; 228 public static final int INTERFACE=55; 229 public static final int LONG=56; 230 public static final int NATIVE=57; 231 public static final int NEW=58; 232 public static final int PACKAGE=59; 233 public static final int PRIVATE=60; 234 public static final int PROTECTED=61; 235 public static final int PUBLIC=62; 236 public static final int RETURN=63; 237 public static final int SHORT=64; 238 public static final int STATIC=65; 239 public static final int STRICTFP=66; 240 public static final int SUPER=67; 241 public static final int SWITCH=68; 242 public static final int SYNCHRONIZED=69; 243 public static final int THIS=70; 244 public static final int THROW=71; 245 public static final int THROWS=72; 246 public static final int TRANSIENT=73; 247 public static final int TRY=74; 248 public static final int VOID=75; 249 public static final int VOLATILE=76; 250 public static final int WHILE=77; 251 public static final int LPAREN=78; 252 public static final int RPAREN=79; 253 public static final int LBRACE=80; 254 public static final int RBRACE=81; 255 public static final int LBRACKET=82; 256 public static final int RBRACKET=83; 257 public static final int SEMI=84; 258 public static final int COMMA=85; 259 public static final int DOT=86; 260 public static final int ELLIPSIS=87; 261 public static final int EQ=88; 262 public static final int BANG=89; 263 public static final int TILDE=90; 264 public static final int QUES=91; 265 public static final int COLON=92; 266 public static final int EQEQ=93; 267 public static final int AMPAMP=94; 268 public static final int BARBAR=95; 269 public static final int PLUSPLUS=96; 270 public static final int SUBSUB=97; 271 public static final int PLUS=98; 272 public static final int SUB=99; 273 public static final int STAR=100; 274 public static final int SLASH=101; 275 public static final int AMP=102; 276 public static final int BAR=103; 277 public static final int CARET=104; 278 public static final int PERCENT=105; 279 public static final int PLUSEQ=106; 280 public static final int SUBEQ=107; 281 public static final int STAREQ=108; 282 public static final int SLASHEQ=109; 283 public static final int AMPEQ=110; 284 public static final int BAREQ=111; 285 public static final int CARETEQ=112; 286 public static final int PERCENTEQ=113; 287 public static final int MONKEYS_AT=114; 288 public static final int BANGEQ=115; 289 public static final int GT=116; 290 public static final int LT=117; 291 public static final int IdentifierStart=118; 292 public static final int IdentifierPart=119; 293 public static final int SurrogateIdentifer=120; 294 295 // delegates 296 // delegators 297 298 public static final String[] ruleNames = new String[] { 299 "invalidRule", "typeList", "synpred114_Java", "synpred175_Java", 300 "synpred19_Java", "elementValuePairs", "identifierSuffix", "interfaceFieldDeclaration", 301 "synpred69_Java", "synpred263_Java", "synpred231_Java", "synpred267_Java", 302 "synpred111_Java", "block", "synpred261_Java", "elementValuePair", 303 "typeArgument", "synpred264_Java", "synpred95_Java", "synpred93_Java", 304 "synpred215_Java", "normalInterfaceDeclaration", "enumHeader", "synpred236_Java", 305 "createdName", "synpred271_Java", "synpred230_Java", "synpred30_Java", 306 "synpred212_Java", "synpred82_Java", "synpred128_Java", "synpred83_Java", 307 "synpred255_Java", "synpred190_Java", "arrayInitializer", "interfaceDeclaration", 308 "synpred92_Java", "localVariableHeader", "packageDeclaration", "formalParameter", 309 "catchClause", "synpred27_Java", "synpred270_Java", "synpred46_Java", 310 "synpred1_Java", "synpred4_Java", "synpred233_Java", "synpred120_Java", 311 "superSuffix", "literal", "classDeclaration", "synpred72_Java", 312 "synpred160_Java", "arguments", "synpred80_Java", "formalParameterDecls", 313 "synpred113_Java", "inclusiveOrExpression", "synpred71_Java", "selector", 314 "synpred194_Java", "synpred265_Java", "synpred173_Java", "synpred141_Java", 315 "synpred187_Java", "trystatement", "synpred133_Java", "interfaceHeader", 316 "synpred73_Java", "localVariableDeclarationStatement", "synpred102_Java", 317 "synpred90_Java", "equalityExpression", "synpred177_Java", "synpred149_Java", 318 "interfaceBodyDeclaration", "classCreatorRest", "synpred121_Java", 319 "synpred105_Java", "typeArguments", "synpred60_Java", "synpred195_Java", 320 "fieldDeclaration", "synpred269_Java", "synpred250_Java", "multiplicativeExpression", 321 "qualifiedNameList", "synpred86_Java", "synpred148_Java", "synpred142_Java", 322 "synpred65_Java", "synpred75_Java", "synpred235_Java", "synpred192_Java", 323 "synpred144_Java", "castExpression", "enumBody", "synpred70_Java", 324 "synpred33_Java", "synpred54_Java", "annotationTypeDeclaration", 325 "annotationHeader", "synpred107_Java", "synpred35_Java", "creator", 326 "nonWildcardTypeArguments", "variableInitializer", "enumConstants", 327 "synpred34_Java", "interfaceMethodDeclaration", "type", "synpred135_Java", 328 "synpred119_Java", "conditionalAndExpression", "synpred9_Java", 329 "synpred125_Java", "synpred40_Java", "synpred257_Java", "enumConstant", 330 "synpred143_Java", "synpred132_Java", "synpred146_Java", "synpred188_Java", 331 "ellipsisParameterDecl", "synpred245_Java", "synpred167_Java", "compilationUnit", 332 "synpred259_Java", "synpred64_Java", "synpred181_Java", "synpred23_Java", 333 "synpred12_Java", "synpred74_Java", "explicitConstructorInvocation", 334 "synpred266_Java", "synpred197_Java", "synpred147_Java", "synpred15_Java", 335 "synpred178_Java", "synpred174_Java", "exclusiveOrExpression", "forstatement", 336 "synpred7_Java", "synpred76_Java", "synpred224_Java", "parExpression", 337 "synpred241_Java", "synpred159_Java", "synpred260_Java", "synpred50_Java", 338 "synpred166_Java", "annotationMethodDeclaration", "synpred208_Java", 339 "synpred106_Java", "classOrInterfaceType", "qualifiedImportName", 340 "statement", "typeBound", "methodHeader", "synpred249_Java", "synpred55_Java", 341 "synpred131_Java", "classBodyDeclaration", "synpred189_Java", "synpred51_Java", 342 "synpred227_Java", "synpred220_Java", "synpred123_Java", "andExpression", 343 "synpred200_Java", "synpred165_Java", "relationalExpression", "annotationTypeBody", 344 "synpred210_Java", "synpred109_Java", "conditionalOrExpression", 345 "synpred161_Java", "classOrInterfaceDeclaration", "synpred180_Java", 346 "synpred154_Java", "elementValueArrayInitializer", "synpred14_Java", 347 "innerCreator", "synpred26_Java", "synpred52_Java", "synpred198_Java", 348 "synpred219_Java", "synpred126_Java", "synpred85_Java", "synpred88_Java", 349 "synpred68_Java", "synpred3_Java", "synpred203_Java", "annotations", 350 "elementValue", "synpred205_Java", "synpred6_Java", "synpred32_Java", 351 "synpred209_Java", "assignmentOperator", "synpred262_Java", "synpred139_Java", 352 "synpred29_Java", "synpred204_Java", "synpred118_Java", "synpred94_Java", 353 "synpred84_Java", "synpred63_Java", "conditionalExpression", "synpred56_Java", 354 "synpred162_Java", "primitiveType", "synpred240_Java", "synpred216_Java", 355 "synpred79_Java", "synpred99_Java", "additiveExpression", "synpred78_Java", 356 "modifiers", "synpred184_Java", "synpred168_Java", "synpred48_Java", 357 "switchBlockStatementGroups", "blockStatement", "synpred193_Java", 358 "classBody", "interfaceBody", "synpred67_Java", "synpred5_Java", 359 "synpred58_Java", "synpred254_Java", "localVariableDeclaration", 360 "annotationTypeElementDeclaration", "synpred251_Java", "arrayCreator", 361 "synpred226_Java", "synpred239_Java", "synpred191_Java", "synpred24_Java", 362 "normalClassDeclaration", "synpred98_Java", "synpred53_Java", "synpred145_Java", 363 "synpred22_Java", "synpred150_Java", "synpred238_Java", "synpred207_Java", 364 "variableModifiers", "typeParameters", "synpred38_Java", "synpred129_Java", 365 "enumBodyDeclarations", "synpred172_Java", "synpred16_Java", "synpred100_Java", 366 "fieldHeader", "synpred41_Java", "synpred248_Java", "synpred152_Java", 367 "synpred214_Java", "switchBlockStatementGroup", "synpred199_Java", 368 "switchLabel", "qualifiedName", "synpred137_Java", "synpred237_Java", 369 "synpred223_Java", "synpred156_Java", "synpred243_Java", "synpred182_Java", 370 "synpred138_Java", "synpred77_Java", "synpred127_Java", "synpred112_Java", 371 "unaryExpressionNotPlusMinus", "synpred42_Java", "synpred89_Java", 372 "formalParameters", "synpred225_Java", "synpred136_Java", "synpred186_Java", 373 "synpred122_Java", "synpred87_Java", "synpred244_Java", "synpred97_Java", 374 "synpred229_Java", "synpred170_Java", "shiftOp", "synpred134_Java", 375 "synpred253_Java", "synpred44_Java", "memberDecl", "synpred157_Java", 376 "synpred246_Java", "synpred49_Java", "synpred31_Java", "synpred256_Java", 377 "unaryExpression", "synpred13_Java", "synpred213_Java", "synpred155_Java", 378 "typeHeader", "synpred91_Java", "instanceOfExpression", "variableDeclarator", 379 "synpred140_Java", "synpred25_Java", "synpred117_Java", "synpred2_Java", 380 "synpred222_Java", "synpred10_Java", "synpred104_Java", "synpred115_Java", 381 "synpred221_Java", "synpred45_Java", "synpred211_Java", "typeParameter", 382 "synpred36_Java", "synpred103_Java", "synpred39_Java", "synpred201_Java", 383 "methodDeclaration", "synpred62_Java", "synpred110_Java", "classHeader", 384 "synpred101_Java", "synpred21_Java", "synpred196_Java", "synpred96_Java", 385 "synpred61_Java", "synpred228_Java", "synpred28_Java", "synpred218_Java", 386 "synpred179_Java", "normalParameterDecl", "enumDeclaration", "synpred17_Java", 387 "synpred18_Java", "synpred108_Java", "synpred43_Java", "synpred206_Java", 388 "synpred169_Java", "synpred130_Java", "synpred242_Java", "synpred252_Java", 389 "synpred151_Java", "forInit", "shiftExpression", "synpred81_Java", 390 "synpred247_Java", "synpred20_Java", "catches", "synpred202_Java", 391 "synpred47_Java", "synpred185_Java", "synpred158_Java", "synpred66_Java", 392 "synpred11_Java", "synpred8_Java", "synpred163_Java", "synpred217_Java", 393 "primary", "synpred153_Java", "synpred57_Java", "synpred258_Java", 394 "expressionList", "annotation", "expression", "synpred176_Java", 395 "synpred171_Java", "synpred164_Java", "importDeclaration", "synpred124_Java", 396 "synpred268_Java", "synpred234_Java", "relationalOp", "synpred59_Java", 397 "synpred37_Java", "synpred183_Java", "synpred232_Java", "synpred116_Java", 398 "typeDeclaration" 399 }; 400 public static final boolean[] decisionCanBacktrack = new boolean[] { 401 false, // invalid decision 402 false, true, false, false, false, false, false, false, false, false, 403 false, true, false, false, true, false, false, false, false, 404 false, false, false, false, false, false, false, false, false, 405 false, false, true, false, false, false, false, false, false, 406 false, true, false, false, true, false, false, false, false, 407 false, false, true, false, false, false, true, false, false, 408 false, false, false, false, false, false, false, false, false, 409 false, false, false, false, false, false, true, true, false, 410 false, false, true, false, false, false, false, false, false, 411 false, false, false, false, true, false, false, true, false, 412 false, false, true, false, false, false, true, false, false, 413 false, true, false, false, false, false, false, true, true, 414 false, false, false, false, false, false, false, false, false, 415 false, false, false, false, false, false, false, false, false, 416 false, false, true, true, true, true, true, true, false, false, 417 false, false, false, false, true, false, false, false, true, 418 false, true, false, true, false, false, false, false, false, 419 false, false, false, false, false, false, false, false, false, 420 false, false, false, false, false, false, true, false, false, 421 false, false, false, false, false, false, false, false, false, 422 false, false, false, false, false, false, false, false, false, 423 false, false, false 424 }; 425 426 427 public int ruleLevel = 0; 428 public int getRuleLevel() { return ruleLevel; } 429 public void incRuleLevel() { ruleLevel++; } 430 public void decRuleLevel() { ruleLevel--; } 431 public JavaParser(TokenStream input) { 432 this(input, DebugEventSocketProxy.DEFAULT_DEBUGGER_PORT, new RecognizerSharedState()); 433 } 434 public JavaParser(TokenStream input, int port, RecognizerSharedState state) { 435 super(input, state); 436 this.state.ruleMemo = new HashMap[381+1]; 437 438 DebugEventSocketProxy proxy = 439 new DebugEventSocketProxy(this, port, null); 440 setDebugListener(proxy); 441 try { 442 proxy.handshake(); 443 } 444 catch (IOException ioe) { 445 reportError(ioe); 446 } 447 } 448 public JavaParser(TokenStream input, DebugEventListener dbg) { 449 super(input, dbg, new RecognizerSharedState()); 450 this.state.ruleMemo = new HashMap[381+1]; 451 452 } 453 protected boolean evalPredicate(boolean result, String predicate) { 454 dbg.semanticPredicate(result, predicate); 455 return result; 456 } 457 458 459 public String[] getTokenNames() { return JavaParser.tokenNames; } 460 public String getGrammarFileName() { return "src/com/google/doclava/parser/Java.g"; } 461 462 463 464 // $ANTLR start "compilationUnit" 465 // src/com/google/doclava/parser/Java.g:293:1: compilationUnit : ( ( annotations )? packageDeclaration )? ( importDeclaration )* ( typeDeclaration )* ; 466 public final void compilationUnit() throws RecognitionException { 467 int compilationUnit_StartIndex = input.index(); 468 try { dbg.enterRule(getGrammarFileName(), "compilationUnit"); 469 if ( getRuleLevel()==0 ) {dbg.commence();} 470 incRuleLevel(); 471 dbg.location(293, 1); 472 473 try { 474 if ( state.backtracking>0 && alreadyParsedRule(input, 1) ) { return ; } 475 // src/com/google/doclava/parser/Java.g:298:5: ( ( ( annotations )? packageDeclaration )? ( importDeclaration )* ( typeDeclaration )* ) 476 dbg.enterAlt(1); 477 478 // src/com/google/doclava/parser/Java.g:298:9: ( ( annotations )? packageDeclaration )? ( importDeclaration )* ( typeDeclaration )* 479 { 480 dbg.location(298,9); 481 // src/com/google/doclava/parser/Java.g:298:9: ( ( annotations )? packageDeclaration )? 482 int alt2=2; 483 try { dbg.enterSubRule(2); 484 try { dbg.enterDecision(2, decisionCanBacktrack[2]); 485 486 try { 487 isCyclicDecision = true; 488 alt2 = dfa2.predict(input); 489 } 490 catch (NoViableAltException nvae) { 491 dbg.recognitionException(nvae); 492 throw nvae; 493 } 494 } finally {dbg.exitDecision(2);} 495 496 switch (alt2) { 497 case 1 : 498 dbg.enterAlt(1); 499 500 // src/com/google/doclava/parser/Java.g:298:13: ( annotations )? packageDeclaration 501 { 502 dbg.location(298,13); 503 // src/com/google/doclava/parser/Java.g:298:13: ( annotations )? 504 int alt1=2; 505 try { dbg.enterSubRule(1); 506 try { dbg.enterDecision(1, decisionCanBacktrack[1]); 507 508 int LA1_0 = input.LA(1); 509 510 if ( (LA1_0==MONKEYS_AT) ) { 511 alt1=1; 512 } 513 } finally {dbg.exitDecision(1);} 514 515 switch (alt1) { 516 case 1 : 517 dbg.enterAlt(1); 518 519 // src/com/google/doclava/parser/Java.g:298:14: annotations 520 { 521 dbg.location(298,14); 522 pushFollow(FOLLOW_annotations_in_compilationUnit64); 523 annotations(); 524 525 state._fsp--; 526 if (state.failed) return ; 527 528 } 529 break; 530 531 } 532 } finally {dbg.exitSubRule(1);} 533 534 dbg.location(300,13); 535 pushFollow(FOLLOW_packageDeclaration_in_compilationUnit93); 536 packageDeclaration(); 537 538 state._fsp--; 539 if (state.failed) return ; 540 541 } 542 break; 543 544 } 545 } finally {dbg.exitSubRule(2);} 546 547 dbg.location(302,9); 548 // src/com/google/doclava/parser/Java.g:302:9: ( importDeclaration )* 549 try { dbg.enterSubRule(3); 550 551 loop3: 552 do { 553 int alt3=2; 554 try { dbg.enterDecision(3, decisionCanBacktrack[3]); 555 556 int LA3_0 = input.LA(1); 557 558 if ( (LA3_0==IMPORT) ) { 559 alt3=1; 560 } 561 562 563 } finally {dbg.exitDecision(3);} 564 565 switch (alt3) { 566 case 1 : 567 dbg.enterAlt(1); 568 569 // src/com/google/doclava/parser/Java.g:302:10: importDeclaration 570 { 571 dbg.location(302,10); 572 pushFollow(FOLLOW_importDeclaration_in_compilationUnit115); 573 importDeclaration(); 574 575 state._fsp--; 576 if (state.failed) return ; 577 578 } 579 break; 580 581 default : 582 break loop3; 583 } 584 } while (true); 585 } finally {dbg.exitSubRule(3);} 586 587 dbg.location(304,9); 588 // src/com/google/doclava/parser/Java.g:304:9: ( typeDeclaration )* 589 try { dbg.enterSubRule(4); 590 591 loop4: 592 do { 593 int alt4=2; 594 try { dbg.enterDecision(4, decisionCanBacktrack[4]); 595 596 int LA4_0 = input.LA(1); 597 598 if ( (LA4_0==IDENTIFIER||LA4_0==ABSTRACT||LA4_0==BOOLEAN||LA4_0==BYTE||(LA4_0>=CHAR && LA4_0<=CLASS)||LA4_0==DOUBLE||LA4_0==ENUM||LA4_0==FINAL||LA4_0==FLOAT||(LA4_0>=INT && LA4_0<=NATIVE)||(LA4_0>=PRIVATE && LA4_0<=PUBLIC)||(LA4_0>=SHORT && LA4_0<=STRICTFP)||LA4_0==SYNCHRONIZED||LA4_0==TRANSIENT||(LA4_0>=VOID && LA4_0<=VOLATILE)||LA4_0==SEMI||LA4_0==MONKEYS_AT||LA4_0==LT) ) { 599 alt4=1; 600 } 601 602 603 } finally {dbg.exitDecision(4);} 604 605 switch (alt4) { 606 case 1 : 607 dbg.enterAlt(1); 608 609 // src/com/google/doclava/parser/Java.g:304:10: typeDeclaration 610 { 611 dbg.location(304,10); 612 pushFollow(FOLLOW_typeDeclaration_in_compilationUnit137); 613 typeDeclaration(); 614 615 state._fsp--; 616 if (state.failed) return ; 617 618 } 619 break; 620 621 default : 622 break loop4; 623 } 624 } while (true); 625 } finally {dbg.exitSubRule(4);} 626 627 628 } 629 630 } 631 catch (RecognitionException re) { 632 reportError(re); 633 recover(input,re); 634 } 635 finally { 636 if ( state.backtracking>0 ) { memoize(input, 1, compilationUnit_StartIndex); } 637 } 638 dbg.location(306, 5); 639 640 } 641 finally { 642 dbg.exitRule(getGrammarFileName(), "compilationUnit"); 643 decRuleLevel(); 644 if ( getRuleLevel()==0 ) {dbg.terminate();} 645 } 646 647 return ; 648 } 649 // $ANTLR end "compilationUnit" 650 651 652 // $ANTLR start "packageDeclaration" 653 // src/com/google/doclava/parser/Java.g:308:1: packageDeclaration : 'package' qualifiedName ';' ; 654 public final void packageDeclaration() throws RecognitionException { 655 int packageDeclaration_StartIndex = input.index(); 656 try { dbg.enterRule(getGrammarFileName(), "packageDeclaration"); 657 if ( getRuleLevel()==0 ) {dbg.commence();} 658 incRuleLevel(); 659 dbg.location(308, 1); 660 661 try { 662 if ( state.backtracking>0 && alreadyParsedRule(input, 2) ) { return ; } 663 // src/com/google/doclava/parser/Java.g:309:5: ( 'package' qualifiedName ';' ) 664 dbg.enterAlt(1); 665 666 // src/com/google/doclava/parser/Java.g:309:9: 'package' qualifiedName ';' 667 { 668 dbg.location(309,9); 669 match(input,PACKAGE,FOLLOW_PACKAGE_in_packageDeclaration167); if (state.failed) return ; 670 dbg.location(309,19); 671 pushFollow(FOLLOW_qualifiedName_in_packageDeclaration169); 672 qualifiedName(); 673 674 state._fsp--; 675 if (state.failed) return ; 676 dbg.location(310,9); 677 match(input,SEMI,FOLLOW_SEMI_in_packageDeclaration179); if (state.failed) return ; 678 679 } 680 681 } 682 catch (RecognitionException re) { 683 reportError(re); 684 recover(input,re); 685 } 686 finally { 687 if ( state.backtracking>0 ) { memoize(input, 2, packageDeclaration_StartIndex); } 688 } 689 dbg.location(311, 5); 690 691 } 692 finally { 693 dbg.exitRule(getGrammarFileName(), "packageDeclaration"); 694 decRuleLevel(); 695 if ( getRuleLevel()==0 ) {dbg.terminate();} 696 } 697 698 return ; 699 } 700 // $ANTLR end "packageDeclaration" 701 702 703 // $ANTLR start "importDeclaration" 704 // src/com/google/doclava/parser/Java.g:313:1: importDeclaration : ( 'import' ( 'static' )? IDENTIFIER '.' '*' ';' | 'import' ( 'static' )? IDENTIFIER ( '.' IDENTIFIER )+ ( '.' '*' )? ';' ); 705 public final void importDeclaration() throws RecognitionException { 706 int importDeclaration_StartIndex = input.index(); 707 try { dbg.enterRule(getGrammarFileName(), "importDeclaration"); 708 if ( getRuleLevel()==0 ) {dbg.commence();} 709 incRuleLevel(); 710 dbg.location(313, 1); 711 712 try { 713 if ( state.backtracking>0 && alreadyParsedRule(input, 3) ) { return ; } 714 // src/com/google/doclava/parser/Java.g:314:5: ( 'import' ( 'static' )? IDENTIFIER '.' '*' ';' | 'import' ( 'static' )? IDENTIFIER ( '.' IDENTIFIER )+ ( '.' '*' )? ';' ) 715 int alt9=2; 716 try { dbg.enterDecision(9, decisionCanBacktrack[9]); 717 718 int LA9_0 = input.LA(1); 719 720 if ( (LA9_0==IMPORT) ) { 721 int LA9_1 = input.LA(2); 722 723 if ( (LA9_1==STATIC) ) { 724 int LA9_2 = input.LA(3); 725 726 if ( (LA9_2==IDENTIFIER) ) { 727 int LA9_3 = input.LA(4); 728 729 if ( (LA9_3==DOT) ) { 730 int LA9_4 = input.LA(5); 731 732 if ( (LA9_4==STAR) ) { 733 alt9=1; 734 } 735 else if ( (LA9_4==IDENTIFIER) ) { 736 alt9=2; 737 } 738 else { 739 if (state.backtracking>0) {state.failed=true; return ;} 740 NoViableAltException nvae = 741 new NoViableAltException("", 9, 4, input); 742 743 dbg.recognitionException(nvae); 744 throw nvae; 745 } 746 } 747 else { 748 if (state.backtracking>0) {state.failed=true; return ;} 749 NoViableAltException nvae = 750 new NoViableAltException("", 9, 3, input); 751 752 dbg.recognitionException(nvae); 753 throw nvae; 754 } 755 } 756 else { 757 if (state.backtracking>0) {state.failed=true; return ;} 758 NoViableAltException nvae = 759 new NoViableAltException("", 9, 2, input); 760 761 dbg.recognitionException(nvae); 762 throw nvae; 763 } 764 } 765 else if ( (LA9_1==IDENTIFIER) ) { 766 int LA9_3 = input.LA(3); 767 768 if ( (LA9_3==DOT) ) { 769 int LA9_4 = input.LA(4); 770 771 if ( (LA9_4==STAR) ) { 772 alt9=1; 773 } 774 else if ( (LA9_4==IDENTIFIER) ) { 775 alt9=2; 776 } 777 else { 778 if (state.backtracking>0) {state.failed=true; return ;} 779 NoViableAltException nvae = 780 new NoViableAltException("", 9, 4, input); 781 782 dbg.recognitionException(nvae); 783 throw nvae; 784 } 785 } 786 else { 787 if (state.backtracking>0) {state.failed=true; return ;} 788 NoViableAltException nvae = 789 new NoViableAltException("", 9, 3, input); 790 791 dbg.recognitionException(nvae); 792 throw nvae; 793 } 794 } 795 else { 796 if (state.backtracking>0) {state.failed=true; return ;} 797 NoViableAltException nvae = 798 new NoViableAltException("", 9, 1, input); 799 800 dbg.recognitionException(nvae); 801 throw nvae; 802 } 803 } 804 else { 805 if (state.backtracking>0) {state.failed=true; return ;} 806 NoViableAltException nvae = 807 new NoViableAltException("", 9, 0, input); 808 809 dbg.recognitionException(nvae); 810 throw nvae; 811 } 812 } finally {dbg.exitDecision(9);} 813 814 switch (alt9) { 815 case 1 : 816 dbg.enterAlt(1); 817 818 // src/com/google/doclava/parser/Java.g:314:9: 'import' ( 'static' )? IDENTIFIER '.' '*' ';' 819 { 820 dbg.location(314,9); 821 match(input,IMPORT,FOLLOW_IMPORT_in_importDeclaration198); if (state.failed) return ; 822 dbg.location(315,9); 823 // src/com/google/doclava/parser/Java.g:315:9: ( 'static' )? 824 int alt5=2; 825 try { dbg.enterSubRule(5); 826 try { dbg.enterDecision(5, decisionCanBacktrack[5]); 827 828 int LA5_0 = input.LA(1); 829 830 if ( (LA5_0==STATIC) ) { 831 alt5=1; 832 } 833 } finally {dbg.exitDecision(5);} 834 835 switch (alt5) { 836 case 1 : 837 dbg.enterAlt(1); 838 839 // src/com/google/doclava/parser/Java.g:315:10: 'static' 840 { 841 dbg.location(315,10); 842 match(input,STATIC,FOLLOW_STATIC_in_importDeclaration209); if (state.failed) return ; 843 844 } 845 break; 846 847 } 848 } finally {dbg.exitSubRule(5);} 849 850 dbg.location(317,9); 851 match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_importDeclaration230); if (state.failed) return ; 852 dbg.location(317,20); 853 match(input,DOT,FOLLOW_DOT_in_importDeclaration232); if (state.failed) return ; 854 dbg.location(317,24); 855 match(input,STAR,FOLLOW_STAR_in_importDeclaration234); if (state.failed) return ; 856 dbg.location(318,9); 857 match(input,SEMI,FOLLOW_SEMI_in_importDeclaration244); if (state.failed) return ; 858 859 } 860 break; 861 case 2 : 862 dbg.enterAlt(2); 863 864 // src/com/google/doclava/parser/Java.g:319:9: 'import' ( 'static' )? IDENTIFIER ( '.' IDENTIFIER )+ ( '.' '*' )? ';' 865 { 866 dbg.location(319,9); 867 match(input,IMPORT,FOLLOW_IMPORT_in_importDeclaration254); if (state.failed) return ; 868 dbg.location(320,9); 869 // src/com/google/doclava/parser/Java.g:320:9: ( 'static' )? 870 int alt6=2; 871 try { dbg.enterSubRule(6); 872 try { dbg.enterDecision(6, decisionCanBacktrack[6]); 873 874 int LA6_0 = input.LA(1); 875 876 if ( (LA6_0==STATIC) ) { 877 alt6=1; 878 } 879 } finally {dbg.exitDecision(6);} 880 881 switch (alt6) { 882 case 1 : 883 dbg.enterAlt(1); 884 885 // src/com/google/doclava/parser/Java.g:320:10: 'static' 886 { 887 dbg.location(320,10); 888 match(input,STATIC,FOLLOW_STATIC_in_importDeclaration265); if (state.failed) return ; 889 890 } 891 break; 892 893 } 894 } finally {dbg.exitSubRule(6);} 895 896 dbg.location(322,9); 897 match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_importDeclaration286); if (state.failed) return ; 898 dbg.location(323,9); 899 // src/com/google/doclava/parser/Java.g:323:9: ( '.' IDENTIFIER )+ 900 int cnt7=0; 901 try { dbg.enterSubRule(7); 902 903 loop7: 904 do { 905 int alt7=2; 906 try { dbg.enterDecision(7, decisionCanBacktrack[7]); 907 908 int LA7_0 = input.LA(1); 909 910 if ( (LA7_0==DOT) ) { 911 int LA7_1 = input.LA(2); 912 913 if ( (LA7_1==IDENTIFIER) ) { 914 alt7=1; 915 } 916 917 918 } 919 920 921 } finally {dbg.exitDecision(7);} 922 923 switch (alt7) { 924 case 1 : 925 dbg.enterAlt(1); 926 927 // src/com/google/doclava/parser/Java.g:323:10: '.' IDENTIFIER 928 { 929 dbg.location(323,10); 930 match(input,DOT,FOLLOW_DOT_in_importDeclaration297); if (state.failed) return ; 931 dbg.location(323,14); 932 match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_importDeclaration299); if (state.failed) return ; 933 934 } 935 break; 936 937 default : 938 if ( cnt7 >= 1 ) break loop7; 939 if (state.backtracking>0) {state.failed=true; return ;} 940 EarlyExitException eee = 941 new EarlyExitException(7, input); 942 dbg.recognitionException(eee); 943 944 throw eee; 945 } 946 cnt7++; 947 } while (true); 948 } finally {dbg.exitSubRule(7);} 949 950 dbg.location(325,9); 951 // src/com/google/doclava/parser/Java.g:325:9: ( '.' '*' )? 952 int alt8=2; 953 try { dbg.enterSubRule(8); 954 try { dbg.enterDecision(8, decisionCanBacktrack[8]); 955 956 int LA8_0 = input.LA(1); 957 958 if ( (LA8_0==DOT) ) { 959 alt8=1; 960 } 961 } finally {dbg.exitDecision(8);} 962 963 switch (alt8) { 964 case 1 : 965 dbg.enterAlt(1); 966 967 // src/com/google/doclava/parser/Java.g:325:10: '.' '*' 968 { 969 dbg.location(325,10); 970 match(input,DOT,FOLLOW_DOT_in_importDeclaration321); if (state.failed) return ; 971 dbg.location(325,14); 972 match(input,STAR,FOLLOW_STAR_in_importDeclaration323); if (state.failed) return ; 973 974 } 975 break; 976 977 } 978 } finally {dbg.exitSubRule(8);} 979 980 dbg.location(327,9); 981 match(input,SEMI,FOLLOW_SEMI_in_importDeclaration344); if (state.failed) return ; 982 983 } 984 break; 985 986 } 987 } 988 catch (RecognitionException re) { 989 reportError(re); 990 recover(input,re); 991 } 992 finally { 993 if ( state.backtracking>0 ) { memoize(input, 3, importDeclaration_StartIndex); } 994 } 995 dbg.location(328, 5); 996 997 } 998 finally { 999 dbg.exitRule(getGrammarFileName(), "importDeclaration"); 1000 decRuleLevel(); 1001 if ( getRuleLevel()==0 ) {dbg.terminate();} 1002 } 1003 1004 return ; 1005 } 1006 // $ANTLR end "importDeclaration" 1007 1008 1009 // $ANTLR start "qualifiedImportName" 1010 // src/com/google/doclava/parser/Java.g:330:1: qualifiedImportName : IDENTIFIER ( '.' IDENTIFIER )* ; 1011 public final void qualifiedImportName() throws RecognitionException { 1012 int qualifiedImportName_StartIndex = input.index(); 1013 try { dbg.enterRule(getGrammarFileName(), "qualifiedImportName"); 1014 if ( getRuleLevel()==0 ) {dbg.commence();} 1015 incRuleLevel(); 1016 dbg.location(330, 1); 1017 1018 try { 1019 if ( state.backtracking>0 && alreadyParsedRule(input, 4) ) { return ; } 1020 // src/com/google/doclava/parser/Java.g:331:5: ( IDENTIFIER ( '.' IDENTIFIER )* ) 1021 dbg.enterAlt(1); 1022 1023 // src/com/google/doclava/parser/Java.g:331:9: IDENTIFIER ( '.' IDENTIFIER )* 1024 { 1025 dbg.location(331,9); 1026 match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_qualifiedImportName363); if (state.failed) return ; 1027 dbg.location(332,9); 1028 // src/com/google/doclava/parser/Java.g:332:9: ( '.' IDENTIFIER )* 1029 try { dbg.enterSubRule(10); 1030 1031 loop10: 1032 do { 1033 int alt10=2; 1034 try { dbg.enterDecision(10, decisionCanBacktrack[10]); 1035 1036 int LA10_0 = input.LA(1); 1037 1038 if ( (LA10_0==DOT) ) { 1039 alt10=1; 1040 } 1041 1042 1043 } finally {dbg.exitDecision(10);} 1044 1045 switch (alt10) { 1046 case 1 : 1047 dbg.enterAlt(1); 1048 1049 // src/com/google/doclava/parser/Java.g:332:10: '.' IDENTIFIER 1050 { 1051 dbg.location(332,10); 1052 match(input,DOT,FOLLOW_DOT_in_qualifiedImportName374); if (state.failed) return ; 1053 dbg.location(332,14); 1054 match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_qualifiedImportName376); if (state.failed) return ; 1055 1056 } 1057 break; 1058 1059 default : 1060 break loop10; 1061 } 1062 } while (true); 1063 } finally {dbg.exitSubRule(10);} 1064 1065 1066 } 1067 1068 } 1069 catch (RecognitionException re) { 1070 reportError(re); 1071 recover(input,re); 1072 } 1073 finally { 1074 if ( state.backtracking>0 ) { memoize(input, 4, qualifiedImportName_StartIndex); } 1075 } 1076 dbg.location(334, 5); 1077 1078 } 1079 finally { 1080 dbg.exitRule(getGrammarFileName(), "qualifiedImportName"); 1081 decRuleLevel(); 1082 if ( getRuleLevel()==0 ) {dbg.terminate();} 1083 } 1084 1085 return ; 1086 } 1087 // $ANTLR end "qualifiedImportName" 1088 1089 1090 // $ANTLR start "typeDeclaration" 1091 // src/com/google/doclava/parser/Java.g:336:1: typeDeclaration : ( classOrInterfaceDeclaration | ';' ); 1092 public final void typeDeclaration() throws RecognitionException { 1093 int typeDeclaration_StartIndex = input.index(); 1094 try { dbg.enterRule(getGrammarFileName(), "typeDeclaration"); 1095 if ( getRuleLevel()==0 ) {dbg.commence();} 1096 incRuleLevel(); 1097 dbg.location(336, 1); 1098 1099 try { 1100 if ( state.backtracking>0 && alreadyParsedRule(input, 5) ) { return ; } 1101 // src/com/google/doclava/parser/Java.g:337:5: ( classOrInterfaceDeclaration | ';' ) 1102 int alt11=2; 1103 try { dbg.enterDecision(11, decisionCanBacktrack[11]); 1104 1105 int LA11_0 = input.LA(1); 1106 1107 if ( (LA11_0==IDENTIFIER||LA11_0==ABSTRACT||LA11_0==BOOLEAN||LA11_0==BYTE||(LA11_0>=CHAR && LA11_0<=CLASS)||LA11_0==DOUBLE||LA11_0==ENUM||LA11_0==FINAL||LA11_0==FLOAT||(LA11_0>=INT && LA11_0<=NATIVE)||(LA11_0>=PRIVATE && LA11_0<=PUBLIC)||(LA11_0>=SHORT && LA11_0<=STRICTFP)||LA11_0==SYNCHRONIZED||LA11_0==TRANSIENT||(LA11_0>=VOID && LA11_0<=VOLATILE)||LA11_0==MONKEYS_AT||LA11_0==LT) ) { 1108 alt11=1; 1109 } 1110 else if ( (LA11_0==SEMI) ) { 1111 alt11=2; 1112 } 1113 else { 1114 if (state.backtracking>0) {state.failed=true; return ;} 1115 NoViableAltException nvae = 1116 new NoViableAltException("", 11, 0, input); 1117 1118 dbg.recognitionException(nvae); 1119 throw nvae; 1120 } 1121 } finally {dbg.exitDecision(11);} 1122 1123 switch (alt11) { 1124 case 1 : 1125 dbg.enterAlt(1); 1126 1127 // src/com/google/doclava/parser/Java.g:337:9: classOrInterfaceDeclaration 1128 { 1129 dbg.location(337,9); 1130 pushFollow(FOLLOW_classOrInterfaceDeclaration_in_typeDeclaration406); 1131 classOrInterfaceDeclaration(); 1132 1133 state._fsp--; 1134 if (state.failed) return ; 1135 1136 } 1137 break; 1138 case 2 : 1139 dbg.enterAlt(2); 1140 1141 // src/com/google/doclava/parser/Java.g:338:9: ';' 1142 { 1143 dbg.location(338,9); 1144 match(input,SEMI,FOLLOW_SEMI_in_typeDeclaration416); if (state.failed) return ; 1145 1146 } 1147 break; 1148 1149 } 1150 } 1151 catch (RecognitionException re) { 1152 reportError(re); 1153 recover(input,re); 1154 } 1155 finally { 1156 if ( state.backtracking>0 ) { memoize(input, 5, typeDeclaration_StartIndex); } 1157 } 1158 dbg.location(339, 5); 1159 1160 } 1161 finally { 1162 dbg.exitRule(getGrammarFileName(), "typeDeclaration"); 1163 decRuleLevel(); 1164 if ( getRuleLevel()==0 ) {dbg.terminate();} 1165 } 1166 1167 return ; 1168 } 1169 // $ANTLR end "typeDeclaration" 1170 1171 1172 // $ANTLR start "classOrInterfaceDeclaration" 1173 // src/com/google/doclava/parser/Java.g:341:1: classOrInterfaceDeclaration : ( classDeclaration | interfaceDeclaration ); 1174 public final void classOrInterfaceDeclaration() throws RecognitionException { 1175 int classOrInterfaceDeclaration_StartIndex = input.index(); 1176 try { dbg.enterRule(getGrammarFileName(), "classOrInterfaceDeclaration"); 1177 if ( getRuleLevel()==0 ) {dbg.commence();} 1178 incRuleLevel(); 1179 dbg.location(341, 1); 1180 1181 try { 1182 if ( state.backtracking>0 && alreadyParsedRule(input, 6) ) { return ; } 1183 // src/com/google/doclava/parser/Java.g:342:5: ( classDeclaration | interfaceDeclaration ) 1184 int alt12=2; 1185 try { dbg.enterDecision(12, decisionCanBacktrack[12]); 1186 1187 try { 1188 isCyclicDecision = true; 1189 alt12 = dfa12.predict(input); 1190 } 1191 catch (NoViableAltException nvae) { 1192 dbg.recognitionException(nvae); 1193 throw nvae; 1194 } 1195 } finally {dbg.exitDecision(12);} 1196 1197 switch (alt12) { 1198 case 1 : 1199 dbg.enterAlt(1); 1200 1201 // src/com/google/doclava/parser/Java.g:342:10: classDeclaration 1202 { 1203 dbg.location(342,10); 1204 pushFollow(FOLLOW_classDeclaration_in_classOrInterfaceDeclaration436); 1205 classDeclaration(); 1206 1207 state._fsp--; 1208 if (state.failed) return ; 1209 1210 } 1211 break; 1212 case 2 : 1213 dbg.enterAlt(2); 1214 1215 // src/com/google/doclava/parser/Java.g:343:9: interfaceDeclaration 1216 { 1217 dbg.location(343,9); 1218 pushFollow(FOLLOW_interfaceDeclaration_in_classOrInterfaceDeclaration446); 1219 interfaceDeclaration(); 1220 1221 state._fsp--; 1222 if (state.failed) return ; 1223 1224 } 1225 break; 1226 1227 } 1228 } 1229 catch (RecognitionException re) { 1230 reportError(re); 1231 recover(input,re); 1232 } 1233 finally { 1234 if ( state.backtracking>0 ) { memoize(input, 6, classOrInterfaceDeclaration_StartIndex); } 1235 } 1236 dbg.location(344, 5); 1237 1238 } 1239 finally { 1240 dbg.exitRule(getGrammarFileName(), "classOrInterfaceDeclaration"); 1241 decRuleLevel(); 1242 if ( getRuleLevel()==0 ) {dbg.terminate();} 1243 } 1244 1245 return ; 1246 } 1247 // $ANTLR end "classOrInterfaceDeclaration" 1248 1249 1250 // $ANTLR start "modifiers" 1251 // src/com/google/doclava/parser/Java.g:347:1: modifiers : ( annotation | 'public' | 'protected' | 'private' | 'static' | 'abstract' | 'final' | 'native' | 'synchronized' | 'transient' | 'volatile' | 'strictfp' )* ; 1252 public final void modifiers() throws RecognitionException { 1253 int modifiers_StartIndex = input.index(); 1254 try { dbg.enterRule(getGrammarFileName(), "modifiers"); 1255 if ( getRuleLevel()==0 ) {dbg.commence();} 1256 incRuleLevel(); 1257 dbg.location(347, 1); 1258 1259 try { 1260 if ( state.backtracking>0 && alreadyParsedRule(input, 7) ) { return ; } 1261 // src/com/google/doclava/parser/Java.g:348:5: ( ( annotation | 'public' | 'protected' | 'private' | 'static' | 'abstract' | 'final' | 'native' | 'synchronized' | 'transient' | 'volatile' | 'strictfp' )* ) 1262 dbg.enterAlt(1); 1263 1264 // src/com/google/doclava/parser/Java.g:349:5: ( annotation | 'public' | 'protected' | 'private' | 'static' | 'abstract' | 'final' | 'native' | 'synchronized' | 'transient' | 'volatile' | 'strictfp' )* 1265 { 1266 dbg.location(349,5); 1267 // src/com/google/doclava/parser/Java.g:349:5: ( annotation | 'public' | 'protected' | 'private' | 'static' | 'abstract' | 'final' | 'native' | 'synchronized' | 'transient' | 'volatile' | 'strictfp' )* 1268 try { dbg.enterSubRule(13); 1269 1270 loop13: 1271 do { 1272 int alt13=13; 1273 try { dbg.enterDecision(13, decisionCanBacktrack[13]); 1274 1275 try { 1276 isCyclicDecision = true; 1277 alt13 = dfa13.predict(input); 1278 } 1279 catch (NoViableAltException nvae) { 1280 dbg.recognitionException(nvae); 1281 throw nvae; 1282 } 1283 } finally {dbg.exitDecision(13);} 1284 1285 switch (alt13) { 1286 case 1 : 1287 dbg.enterAlt(1); 1288 1289 // src/com/google/doclava/parser/Java.g:349:10: annotation 1290 { 1291 dbg.location(349,10); 1292 pushFollow(FOLLOW_annotation_in_modifiers473); 1293 annotation(); 1294 1295 state._fsp--; 1296 if (state.failed) return ; 1297 1298 } 1299 break; 1300 case 2 : 1301 dbg.enterAlt(2); 1302 1303 // src/com/google/doclava/parser/Java.g:350:9: 'public' 1304 { 1305 dbg.location(350,9); 1306 match(input,PUBLIC,FOLLOW_PUBLIC_in_modifiers483); if (state.failed) return ; 1307 1308 } 1309 break; 1310 case 3 : 1311 dbg.enterAlt(3); 1312 1313 // src/com/google/doclava/parser/Java.g:351:9: 'protected' 1314 { 1315 dbg.location(351,9); 1316 match(input,PROTECTED,FOLLOW_PROTECTED_in_modifiers493); if (state.failed) return ; 1317 1318 } 1319 break; 1320 case 4 : 1321 dbg.enterAlt(4); 1322 1323 // src/com/google/doclava/parser/Java.g:352:9: 'private' 1324 { 1325 dbg.location(352,9); 1326 match(input,PRIVATE,FOLLOW_PRIVATE_in_modifiers503); if (state.failed) return ; 1327 1328 } 1329 break; 1330 case 5 : 1331 dbg.enterAlt(5); 1332 1333 // src/com/google/doclava/parser/Java.g:353:9: 'static' 1334 { 1335 dbg.location(353,9); 1336 match(input,STATIC,FOLLOW_STATIC_in_modifiers513); if (state.failed) return ; 1337 1338 } 1339 break; 1340 case 6 : 1341 dbg.enterAlt(6); 1342 1343 // src/com/google/doclava/parser/Java.g:354:9: 'abstract' 1344 { 1345 dbg.location(354,9); 1346 match(input,ABSTRACT,FOLLOW_ABSTRACT_in_modifiers523); if (state.failed) return ; 1347 1348 } 1349 break; 1350 case 7 : 1351 dbg.enterAlt(7); 1352 1353 // src/com/google/doclava/parser/Java.g:355:9: 'final' 1354 { 1355 dbg.location(355,9); 1356 match(input,FINAL,FOLLOW_FINAL_in_modifiers533); if (state.failed) return ; 1357 1358 } 1359 break; 1360 case 8 : 1361 dbg.enterAlt(8); 1362 1363 // src/com/google/doclava/parser/Java.g:356:9: 'native' 1364 { 1365 dbg.location(356,9); 1366 match(input,NATIVE,FOLLOW_NATIVE_in_modifiers543); if (state.failed) return ; 1367 1368 } 1369 break; 1370 case 9 : 1371 dbg.enterAlt(9); 1372 1373 // src/com/google/doclava/parser/Java.g:357:9: 'synchronized' 1374 { 1375 dbg.location(357,9); 1376 match(input,SYNCHRONIZED,FOLLOW_SYNCHRONIZED_in_modifiers553); if (state.failed) return ; 1377 1378 } 1379 break; 1380 case 10 : 1381 dbg.enterAlt(10); 1382 1383 // src/com/google/doclava/parser/Java.g:358:9: 'transient' 1384 { 1385 dbg.location(358,9); 1386 match(input,TRANSIENT,FOLLOW_TRANSIENT_in_modifiers563); if (state.failed) return ; 1387 1388 } 1389 break; 1390 case 11 : 1391 dbg.enterAlt(11); 1392 1393 // src/com/google/doclava/parser/Java.g:359:9: 'volatile' 1394 { 1395 dbg.location(359,9); 1396 match(input,VOLATILE,FOLLOW_VOLATILE_in_modifiers573); if (state.failed) return ; 1397 1398 } 1399 break; 1400 case 12 : 1401 dbg.enterAlt(12); 1402 1403 // src/com/google/doclava/parser/Java.g:360:9: 'strictfp' 1404 { 1405 dbg.location(360,9); 1406 match(input,STRICTFP,FOLLOW_STRICTFP_in_modifiers583); if (state.failed) return ; 1407 1408 } 1409 break; 1410 1411 default : 1412 break loop13; 1413 } 1414 } while (true); 1415 } finally {dbg.exitSubRule(13);} 1416 1417 1418 } 1419 1420 } 1421 catch (RecognitionException re) { 1422 reportError(re); 1423 recover(input,re); 1424 } 1425 finally { 1426 if ( state.backtracking>0 ) { memoize(input, 7, modifiers_StartIndex); } 1427 } 1428 dbg.location(362, 5); 1429 1430 } 1431 finally { 1432 dbg.exitRule(getGrammarFileName(), "modifiers"); 1433 decRuleLevel(); 1434 if ( getRuleLevel()==0 ) {dbg.terminate();} 1435 } 1436 1437 return ; 1438 } 1439 // $ANTLR end "modifiers" 1440 1441 1442 // $ANTLR start "variableModifiers" 1443 // src/com/google/doclava/parser/Java.g:365:1: variableModifiers : ( 'final' | annotation )* ; 1444 public final void variableModifiers() throws RecognitionException { 1445 int variableModifiers_StartIndex = input.index(); 1446 try { dbg.enterRule(getGrammarFileName(), "variableModifiers"); 1447 if ( getRuleLevel()==0 ) {dbg.commence();} 1448 incRuleLevel(); 1449 dbg.location(365, 1); 1450 1451 try { 1452 if ( state.backtracking>0 && alreadyParsedRule(input, 8) ) { return ; } 1453 // src/com/google/doclava/parser/Java.g:366:5: ( ( 'final' | annotation )* ) 1454 dbg.enterAlt(1); 1455 1456 // src/com/google/doclava/parser/Java.g:366:9: ( 'final' | annotation )* 1457 { 1458 dbg.location(366,9); 1459 // src/com/google/doclava/parser/Java.g:366:9: ( 'final' | annotation )* 1460 try { dbg.enterSubRule(14); 1461 1462 loop14: 1463 do { 1464 int alt14=3; 1465 try { dbg.enterDecision(14, decisionCanBacktrack[14]); 1466 1467 int LA14_0 = input.LA(1); 1468 1469 if ( (LA14_0==FINAL) ) { 1470 alt14=1; 1471 } 1472 else if ( (LA14_0==MONKEYS_AT) ) { 1473 alt14=2; 1474 } 1475 1476 1477 } finally {dbg.exitDecision(14);} 1478 1479 switch (alt14) { 1480 case 1 : 1481 dbg.enterAlt(1); 1482 1483 // src/com/google/doclava/parser/Java.g:366:13: 'final' 1484 { 1485 dbg.location(366,13); 1486 match(input,FINAL,FOLLOW_FINAL_in_variableModifiers614); if (state.failed) return ; 1487 1488 } 1489 break; 1490 case 2 : 1491 dbg.enterAlt(2); 1492 1493 // src/com/google/doclava/parser/Java.g:367:13: annotation 1494 { 1495 dbg.location(367,13); 1496 pushFollow(FOLLOW_annotation_in_variableModifiers628); 1497 annotation(); 1498 1499 state._fsp--; 1500 if (state.failed) return ; 1501 1502 } 1503 break; 1504 1505 default : 1506 break loop14; 1507 } 1508 } while (true); 1509 } finally {dbg.exitSubRule(14);} 1510 1511 1512 } 1513 1514 } 1515 catch (RecognitionException re) { 1516 reportError(re); 1517 recover(input,re); 1518 } 1519 finally { 1520 if ( state.backtracking>0 ) { memoize(input, 8, variableModifiers_StartIndex); } 1521 } 1522 dbg.location(369, 5); 1523 1524 } 1525 finally { 1526 dbg.exitRule(getGrammarFileName(), "variableModifiers"); 1527 decRuleLevel(); 1528 if ( getRuleLevel()==0 ) {dbg.terminate();} 1529 } 1530 1531 return ; 1532 } 1533 // $ANTLR end "variableModifiers" 1534 1535 1536 // $ANTLR start "classDeclaration" 1537 // src/com/google/doclava/parser/Java.g:372:1: classDeclaration : ( normalClassDeclaration | enumDeclaration ); 1538 public final void classDeclaration() throws RecognitionException { 1539 int classDeclaration_StartIndex = input.index(); 1540 try { dbg.enterRule(getGrammarFileName(), "classDeclaration"); 1541 if ( getRuleLevel()==0 ) {dbg.commence();} 1542 incRuleLevel(); 1543 dbg.location(372, 1); 1544 1545 try { 1546 if ( state.backtracking>0 && alreadyParsedRule(input, 9) ) { return ; } 1547 // src/com/google/doclava/parser/Java.g:373:5: ( normalClassDeclaration | enumDeclaration ) 1548 int alt15=2; 1549 try { dbg.enterDecision(15, decisionCanBacktrack[15]); 1550 1551 try { 1552 isCyclicDecision = true; 1553 alt15 = dfa15.predict(input); 1554 } 1555 catch (NoViableAltException nvae) { 1556 dbg.recognitionException(nvae); 1557 throw nvae; 1558 } 1559 } finally {dbg.exitDecision(15);} 1560 1561 switch (alt15) { 1562 case 1 : 1563 dbg.enterAlt(1); 1564 1565 // src/com/google/doclava/parser/Java.g:373:9: normalClassDeclaration 1566 { 1567 dbg.location(373,9); 1568 pushFollow(FOLLOW_normalClassDeclaration_in_classDeclaration659); 1569 normalClassDeclaration(); 1570 1571 state._fsp--; 1572 if (state.failed) return ; 1573 1574 } 1575 break; 1576 case 2 : 1577 dbg.enterAlt(2); 1578 1579 // src/com/google/doclava/parser/Java.g:374:9: enumDeclaration 1580 { 1581 dbg.location(374,9); 1582 pushFollow(FOLLOW_enumDeclaration_in_classDeclaration669); 1583 enumDeclaration(); 1584 1585 state._fsp--; 1586 if (state.failed) return ; 1587 1588 } 1589 break; 1590 1591 } 1592 } 1593 catch (RecognitionException re) { 1594 reportError(re); 1595 recover(input,re); 1596 } 1597 finally { 1598 if ( state.backtracking>0 ) { memoize(input, 9, classDeclaration_StartIndex); } 1599 } 1600 dbg.location(375, 5); 1601 1602 } 1603 finally { 1604 dbg.exitRule(getGrammarFileName(), "classDeclaration"); 1605 decRuleLevel(); 1606 if ( getRuleLevel()==0 ) {dbg.terminate();} 1607 } 1608 1609 return ; 1610 } 1611 // $ANTLR end "classDeclaration" 1612 1613 1614 // $ANTLR start "normalClassDeclaration" 1615 // src/com/google/doclava/parser/Java.g:377:1: normalClassDeclaration : modifiers 'class' IDENTIFIER ( typeParameters )? ( 'extends' type )? ( 'implements' typeList )? classBody ; 1616 public final void normalClassDeclaration() throws RecognitionException { 1617 int normalClassDeclaration_StartIndex = input.index(); 1618 try { dbg.enterRule(getGrammarFileName(), "normalClassDeclaration"); 1619 if ( getRuleLevel()==0 ) {dbg.commence();} 1620 incRuleLevel(); 1621 dbg.location(377, 1); 1622 1623 try { 1624 if ( state.backtracking>0 && alreadyParsedRule(input, 10) ) { return ; } 1625 // src/com/google/doclava/parser/Java.g:378:5: ( modifiers 'class' IDENTIFIER ( typeParameters )? ( 'extends' type )? ( 'implements' typeList )? classBody ) 1626 dbg.enterAlt(1); 1627 1628 // src/com/google/doclava/parser/Java.g:378:9: modifiers 'class' IDENTIFIER ( typeParameters )? ( 'extends' type )? ( 'implements' typeList )? classBody 1629 { 1630 dbg.location(378,9); 1631 pushFollow(FOLLOW_modifiers_in_normalClassDeclaration688); 1632 modifiers(); 1633 1634 state._fsp--; 1635 if (state.failed) return ; 1636 dbg.location(378,20); 1637 match(input,CLASS,FOLLOW_CLASS_in_normalClassDeclaration691); if (state.failed) return ; 1638 dbg.location(378,28); 1639 match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_normalClassDeclaration693); if (state.failed) return ; 1640 dbg.location(379,9); 1641 // src/com/google/doclava/parser/Java.g:379:9: ( typeParameters )? 1642 int alt16=2; 1643 try { dbg.enterSubRule(16); 1644 try { dbg.enterDecision(16, decisionCanBacktrack[16]); 1645 1646 int LA16_0 = input.LA(1); 1647 1648 if ( (LA16_0==LT) ) { 1649 alt16=1; 1650 } 1651 } finally {dbg.exitDecision(16);} 1652 1653 switch (alt16) { 1654 case 1 : 1655 dbg.enterAlt(1); 1656 1657 // src/com/google/doclava/parser/Java.g:379:10: typeParameters 1658 { 1659 dbg.location(379,10); 1660 pushFollow(FOLLOW_typeParameters_in_normalClassDeclaration704); 1661 typeParameters(); 1662 1663 state._fsp--; 1664 if (state.failed) return ; 1665 1666 } 1667 break; 1668 1669 } 1670 } finally {dbg.exitSubRule(16);} 1671 1672 dbg.location(381,9); 1673 // src/com/google/doclava/parser/Java.g:381:9: ( 'extends' type )? 1674 int alt17=2; 1675 try { dbg.enterSubRule(17); 1676 try { dbg.enterDecision(17, decisionCanBacktrack[17]); 1677 1678 int LA17_0 = input.LA(1); 1679 1680 if ( (LA17_0==EXTENDS) ) { 1681 alt17=1; 1682 } 1683 } finally {dbg.exitDecision(17);} 1684 1685 switch (alt17) { 1686 case 1 : 1687 dbg.enterAlt(1); 1688 1689 // src/com/google/doclava/parser/Java.g:381:10: 'extends' type 1690 { 1691 dbg.location(381,10); 1692 match(input,EXTENDS,FOLLOW_EXTENDS_in_normalClassDeclaration726); if (state.failed) return ; 1693 dbg.location(381,20); 1694 pushFollow(FOLLOW_type_in_normalClassDeclaration728); 1695 type(); 1696 1697 state._fsp--; 1698 if (state.failed) return ; 1699 1700 } 1701 break; 1702 1703 } 1704 } finally {dbg.exitSubRule(17);} 1705 1706 dbg.location(383,9); 1707 // src/com/google/doclava/parser/Java.g:383:9: ( 'implements' typeList )? 1708 int alt18=2; 1709 try { dbg.enterSubRule(18); 1710 try { dbg.enterDecision(18, decisionCanBacktrack[18]); 1711 1712 int LA18_0 = input.LA(1); 1713 1714 if ( (LA18_0==IMPLEMENTS) ) { 1715 alt18=1; 1716 } 1717 } finally {dbg.exitDecision(18);} 1718 1719 switch (alt18) { 1720 case 1 : 1721 dbg.enterAlt(1); 1722 1723 // src/com/google/doclava/parser/Java.g:383:10: 'implements' typeList 1724 { 1725 dbg.location(383,10); 1726 match(input,IMPLEMENTS,FOLLOW_IMPLEMENTS_in_normalClassDeclaration750); if (state.failed) return ; 1727 dbg.location(383,23); 1728 pushFollow(FOLLOW_typeList_in_normalClassDeclaration752); 1729 typeList(); 1730 1731 state._fsp--; 1732 if (state.failed) return ; 1733 1734 } 1735 break; 1736 1737 } 1738 } finally {dbg.exitSubRule(18);} 1739 1740 dbg.location(385,9); 1741 pushFollow(FOLLOW_classBody_in_normalClassDeclaration773); 1742 classBody(); 1743 1744 state._fsp--; 1745 if (state.failed) return ; 1746 1747 } 1748 1749 } 1750 catch (RecognitionException re) { 1751 reportError(re); 1752 recover(input,re); 1753 } 1754 finally { 1755 if ( state.backtracking>0 ) { memoize(input, 10, normalClassDeclaration_StartIndex); } 1756 } 1757 dbg.location(386, 5); 1758 1759 } 1760 finally { 1761 dbg.exitRule(getGrammarFileName(), "normalClassDeclaration"); 1762 decRuleLevel(); 1763 if ( getRuleLevel()==0 ) {dbg.terminate();} 1764 } 1765 1766 return ; 1767 } 1768 // $ANTLR end "normalClassDeclaration" 1769 1770 1771 // $ANTLR start "typeParameters" 1772 // src/com/google/doclava/parser/Java.g:389:1: typeParameters : '<' typeParameter ( ',' typeParameter )* '>' ; 1773 public final void typeParameters() throws RecognitionException { 1774 int typeParameters_StartIndex = input.index(); 1775 try { dbg.enterRule(getGrammarFileName(), "typeParameters"); 1776 if ( getRuleLevel()==0 ) {dbg.commence();} 1777 incRuleLevel(); 1778 dbg.location(389, 1); 1779 1780 try { 1781 if ( state.backtracking>0 && alreadyParsedRule(input, 11) ) { return ; } 1782 // src/com/google/doclava/parser/Java.g:390:5: ( '<' typeParameter ( ',' typeParameter )* '>' ) 1783 dbg.enterAlt(1); 1784 1785 // src/com/google/doclava/parser/Java.g:390:9: '<' typeParameter ( ',' typeParameter )* '>' 1786 { 1787 dbg.location(390,9); 1788 match(input,LT,FOLLOW_LT_in_typeParameters793); if (state.failed) return ; 1789 dbg.location(391,13); 1790 pushFollow(FOLLOW_typeParameter_in_typeParameters807); 1791 typeParameter(); 1792 1793 state._fsp--; 1794 if (state.failed) return ; 1795 dbg.location(392,13); 1796 // src/com/google/doclava/parser/Java.g:392:13: ( ',' typeParameter )* 1797 try { dbg.enterSubRule(19); 1798 1799 loop19: 1800 do { 1801 int alt19=2; 1802 try { dbg.enterDecision(19, decisionCanBacktrack[19]); 1803 1804 int LA19_0 = input.LA(1); 1805 1806 if ( (LA19_0==COMMA) ) { 1807 alt19=1; 1808 } 1809 1810 1811 } finally {dbg.exitDecision(19);} 1812 1813 switch (alt19) { 1814 case 1 : 1815 dbg.enterAlt(1); 1816 1817 // src/com/google/doclava/parser/Java.g:392:14: ',' typeParameter 1818 { 1819 dbg.location(392,14); 1820 match(input,COMMA,FOLLOW_COMMA_in_typeParameters822); if (state.failed) return ; 1821 dbg.location(392,18); 1822 pushFollow(FOLLOW_typeParameter_in_typeParameters824); 1823 typeParameter(); 1824 1825 state._fsp--; 1826 if (state.failed) return ; 1827 1828 } 1829 break; 1830 1831 default : 1832 break loop19; 1833 } 1834 } while (true); 1835 } finally {dbg.exitSubRule(19);} 1836 1837 dbg.location(394,9); 1838 match(input,GT,FOLLOW_GT_in_typeParameters849); if (state.failed) return ; 1839 1840 } 1841 1842 } 1843 catch (RecognitionException re) { 1844 reportError(re); 1845 recover(input,re); 1846 } 1847 finally { 1848 if ( state.backtracking>0 ) { memoize(input, 11, typeParameters_StartIndex); } 1849 } 1850 dbg.location(395, 5); 1851 1852 } 1853 finally { 1854 dbg.exitRule(getGrammarFileName(), "typeParameters"); 1855 decRuleLevel(); 1856 if ( getRuleLevel()==0 ) {dbg.terminate();} 1857 } 1858 1859 return ; 1860 } 1861 // $ANTLR end "typeParameters" 1862 1863 1864 // $ANTLR start "typeParameter" 1865 // src/com/google/doclava/parser/Java.g:397:1: typeParameter : IDENTIFIER ( 'extends' typeBound )? ; 1866 public final void typeParameter() throws RecognitionException { 1867 int typeParameter_StartIndex = input.index(); 1868 try { dbg.enterRule(getGrammarFileName(), "typeParameter"); 1869 if ( getRuleLevel()==0 ) {dbg.commence();} 1870 incRuleLevel(); 1871 dbg.location(397, 1); 1872 1873 try { 1874 if ( state.backtracking>0 && alreadyParsedRule(input, 12) ) { return ; } 1875 // src/com/google/doclava/parser/Java.g:398:5: ( IDENTIFIER ( 'extends' typeBound )? ) 1876 dbg.enterAlt(1); 1877 1878 // src/com/google/doclava/parser/Java.g:398:9: IDENTIFIER ( 'extends' typeBound )? 1879 { 1880 dbg.location(398,9); 1881 match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_typeParameter868); if (state.failed) return ; 1882 dbg.location(399,9); 1883 // src/com/google/doclava/parser/Java.g:399:9: ( 'extends' typeBound )? 1884 int alt20=2; 1885 try { dbg.enterSubRule(20); 1886 try { dbg.enterDecision(20, decisionCanBacktrack[20]); 1887 1888 int LA20_0 = input.LA(1); 1889 1890 if ( (LA20_0==EXTENDS) ) { 1891 alt20=1; 1892 } 1893 } finally {dbg.exitDecision(20);} 1894 1895 switch (alt20) { 1896 case 1 : 1897 dbg.enterAlt(1); 1898 1899 // src/com/google/doclava/parser/Java.g:399:10: 'extends' typeBound 1900 { 1901 dbg.location(399,10); 1902 match(input,EXTENDS,FOLLOW_EXTENDS_in_typeParameter879); if (state.failed) return ; 1903 dbg.location(399,20); 1904 pushFollow(FOLLOW_typeBound_in_typeParameter881); 1905 typeBound(); 1906 1907 state._fsp--; 1908 if (state.failed) return ; 1909 1910 } 1911 break; 1912 1913 } 1914 } finally {dbg.exitSubRule(20);} 1915 1916 1917 } 1918 1919 } 1920 catch (RecognitionException re) { 1921 reportError(re); 1922 recover(input,re); 1923 } 1924 finally { 1925 if ( state.backtracking>0 ) { memoize(input, 12, typeParameter_StartIndex); } 1926 } 1927 dbg.location(401, 5); 1928 1929 } 1930 finally { 1931 dbg.exitRule(getGrammarFileName(), "typeParameter"); 1932 decRuleLevel(); 1933 if ( getRuleLevel()==0 ) {dbg.terminate();} 1934 } 1935 1936 return ; 1937 } 1938 // $ANTLR end "typeParameter" 1939 1940 1941 // $ANTLR start "typeBound" 1942 // src/com/google/doclava/parser/Java.g:404:1: typeBound : type ( '&' type )* ; 1943 public final void typeBound() throws RecognitionException { 1944 int typeBound_StartIndex = input.index(); 1945 try { dbg.enterRule(getGrammarFileName(), "typeBound"); 1946 if ( getRuleLevel()==0 ) {dbg.commence();} 1947 incRuleLevel(); 1948 dbg.location(404, 1); 1949 1950 try { 1951 if ( state.backtracking>0 && alreadyParsedRule(input, 13) ) { return ; } 1952 // src/com/google/doclava/parser/Java.g:405:5: ( type ( '&' type )* ) 1953 dbg.enterAlt(1); 1954 1955 // src/com/google/doclava/parser/Java.g:405:9: type ( '&' type )* 1956 { 1957 dbg.location(405,9); 1958 pushFollow(FOLLOW_type_in_typeBound912); 1959 type(); 1960 1961 state._fsp--; 1962 if (state.failed) return ; 1963 dbg.location(406,9); 1964 // src/com/google/doclava/parser/Java.g:406:9: ( '&' type )* 1965 try { dbg.enterSubRule(21); 1966 1967 loop21: 1968 do { 1969 int alt21=2; 1970 try { dbg.enterDecision(21, decisionCanBacktrack[21]); 1971 1972 int LA21_0 = input.LA(1); 1973 1974 if ( (LA21_0==AMP) ) { 1975 alt21=1; 1976 } 1977 1978 1979 } finally {dbg.exitDecision(21);} 1980 1981 switch (alt21) { 1982 case 1 : 1983 dbg.enterAlt(1); 1984 1985 // src/com/google/doclava/parser/Java.g:406:10: '&' type 1986 { 1987 dbg.location(406,10); 1988 match(input,AMP,FOLLOW_AMP_in_typeBound923); if (state.failed) return ; 1989 dbg.location(406,14); 1990 pushFollow(FOLLOW_type_in_typeBound925); 1991 type(); 1992 1993 state._fsp--; 1994 if (state.failed) return ; 1995 1996 } 1997 break; 1998 1999 default : 2000 break loop21; 2001 } 2002 } while (true); 2003 } finally {dbg.exitSubRule(21);} 2004 2005 2006 } 2007 2008 } 2009 catch (RecognitionException re) { 2010 reportError(re); 2011 recover(input,re); 2012 } 2013 finally { 2014 if ( state.backtracking>0 ) { memoize(input, 13, typeBound_StartIndex); } 2015 } 2016 dbg.location(408, 5); 2017 2018 } 2019 finally { 2020 dbg.exitRule(getGrammarFileName(), "typeBound"); 2021 decRuleLevel(); 2022 if ( getRuleLevel()==0 ) {dbg.terminate();} 2023 } 2024 2025 return ; 2026 } 2027 // $ANTLR end "typeBound" 2028 2029 2030 // $ANTLR start "enumDeclaration" 2031 // src/com/google/doclava/parser/Java.g:411:1: enumDeclaration : modifiers ( 'enum' ) IDENTIFIER ( 'implements' typeList )? enumBody ; 2032 public final void enumDeclaration() throws RecognitionException { 2033 int enumDeclaration_StartIndex = input.index(); 2034 try { dbg.enterRule(getGrammarFileName(), "enumDeclaration"); 2035 if ( getRuleLevel()==0 ) {dbg.commence();} 2036 incRuleLevel(); 2037 dbg.location(411, 1); 2038 2039 try { 2040 if ( state.backtracking>0 && alreadyParsedRule(input, 14) ) { return ; } 2041 // src/com/google/doclava/parser/Java.g:412:5: ( modifiers ( 'enum' ) IDENTIFIER ( 'implements' typeList )? enumBody ) 2042 dbg.enterAlt(1); 2043 2044 // src/com/google/doclava/parser/Java.g:412:9: modifiers ( 'enum' ) IDENTIFIER ( 'implements' typeList )? enumBody 2045 { 2046 dbg.location(412,9); 2047 pushFollow(FOLLOW_modifiers_in_enumDeclaration956); 2048 modifiers(); 2049 2050 state._fsp--; 2051 if (state.failed) return ; 2052 dbg.location(413,9); 2053 // src/com/google/doclava/parser/Java.g:413:9: ( 'enum' ) 2054 dbg.enterAlt(1); 2055 2056 // src/com/google/doclava/parser/Java.g:413:10: 'enum' 2057 { 2058 dbg.location(413,10); 2059 match(input,ENUM,FOLLOW_ENUM_in_enumDeclaration967); if (state.failed) return ; 2060 2061 } 2062 2063 dbg.location(415,9); 2064 match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_enumDeclaration987); if (state.failed) return ; 2065 dbg.location(416,9); 2066 // src/com/google/doclava/parser/Java.g:416:9: ( 'implements' typeList )? 2067 int alt22=2; 2068 try { dbg.enterSubRule(22); 2069 try { dbg.enterDecision(22, decisionCanBacktrack[22]); 2070 2071 int LA22_0 = input.LA(1); 2072 2073 if ( (LA22_0==IMPLEMENTS) ) { 2074 alt22=1; 2075 } 2076 } finally {dbg.exitDecision(22);} 2077 2078 switch (alt22) { 2079 case 1 : 2080 dbg.enterAlt(1); 2081 2082 // src/com/google/doclava/parser/Java.g:416:10: 'implements' typeList 2083 { 2084 dbg.location(416,10); 2085 match(input,IMPLEMENTS,FOLLOW_IMPLEMENTS_in_enumDeclaration998); if (state.failed) return ; 2086 dbg.location(416,23); 2087 pushFollow(FOLLOW_typeList_in_enumDeclaration1000); 2088 typeList(); 2089 2090 state._fsp--; 2091 if (state.failed) return ; 2092 2093 } 2094 break; 2095 2096 } 2097 } finally {dbg.exitSubRule(22);} 2098 2099 dbg.location(418,9); 2100 pushFollow(FOLLOW_enumBody_in_enumDeclaration1021); 2101 enumBody(); 2102 2103 state._fsp--; 2104 if (state.failed) return ; 2105 2106 } 2107 2108 } 2109 catch (RecognitionException re) { 2110 reportError(re); 2111 recover(input,re); 2112 } 2113 finally { 2114 if ( state.backtracking>0 ) { memoize(input, 14, enumDeclaration_StartIndex); } 2115 } 2116 dbg.location(419, 5); 2117 2118 } 2119 finally { 2120 dbg.exitRule(getGrammarFileName(), "enumDeclaration"); 2121 decRuleLevel(); 2122 if ( getRuleLevel()==0 ) {dbg.terminate();} 2123 } 2124 2125 return ; 2126 } 2127 // $ANTLR end "enumDeclaration" 2128 2129 2130 // $ANTLR start "enumBody" 2131 // src/com/google/doclava/parser/Java.g:422:1: enumBody : '{' ( enumConstants )? ( ',' )? ( enumBodyDeclarations )? '}' ; 2132 public final void enumBody() throws RecognitionException { 2133 int enumBody_StartIndex = input.index(); 2134 try { dbg.enterRule(getGrammarFileName(), "enumBody"); 2135 if ( getRuleLevel()==0 ) {dbg.commence();} 2136 incRuleLevel(); 2137 dbg.location(422, 1); 2138 2139 try { 2140 if ( state.backtracking>0 && alreadyParsedRule(input, 15) ) { return ; } 2141 // src/com/google/doclava/parser/Java.g:423:5: ( '{' ( enumConstants )? ( ',' )? ( enumBodyDeclarations )? '}' ) 2142 dbg.enterAlt(1); 2143 2144 // src/com/google/doclava/parser/Java.g:423:9: '{' ( enumConstants )? ( ',' )? ( enumBodyDeclarations )? '}' 2145 { 2146 dbg.location(423,9); 2147 match(input,LBRACE,FOLLOW_LBRACE_in_enumBody1041); if (state.failed) return ; 2148 dbg.location(424,9); 2149 // src/com/google/doclava/parser/Java.g:424:9: ( enumConstants )? 2150 int alt23=2; 2151 try { dbg.enterSubRule(23); 2152 try { dbg.enterDecision(23, decisionCanBacktrack[23]); 2153 2154 int LA23_0 = input.LA(1); 2155 2156 if ( (LA23_0==IDENTIFIER||LA23_0==MONKEYS_AT) ) { 2157 alt23=1; 2158 } 2159 } finally {dbg.exitDecision(23);} 2160 2161 switch (alt23) { 2162 case 1 : 2163 dbg.enterAlt(1); 2164 2165 // src/com/google/doclava/parser/Java.g:424:10: enumConstants 2166 { 2167 dbg.location(424,10); 2168 pushFollow(FOLLOW_enumConstants_in_enumBody1052); 2169 enumConstants(); 2170 2171 state._fsp--; 2172 if (state.failed) return ; 2173 2174 } 2175 break; 2176 2177 } 2178 } finally {dbg.exitSubRule(23);} 2179 2180 dbg.location(426,9); 2181 // src/com/google/doclava/parser/Java.g:426:9: ( ',' )? 2182 int alt24=2; 2183 try { dbg.enterSubRule(24); 2184 try { dbg.enterDecision(24, decisionCanBacktrack[24]); 2185 2186 int LA24_0 = input.LA(1); 2187 2188 if ( (LA24_0==COMMA) ) { 2189 alt24=1; 2190 } 2191 } finally {dbg.exitDecision(24);} 2192 2193 switch (alt24) { 2194 case 1 : 2195 dbg.enterAlt(1); 2196 2197 // src/com/google/doclava/parser/Java.g:0:0: ',' 2198 { 2199 dbg.location(426,9); 2200 match(input,COMMA,FOLLOW_COMMA_in_enumBody1073); if (state.failed) return ; 2201 2202 } 2203 break; 2204 2205 } 2206 } finally {dbg.exitSubRule(24);} 2207 2208 dbg.location(427,9); 2209 // src/com/google/doclava/parser/Java.g:427:9: ( enumBodyDeclarations )? 2210 int alt25=2; 2211 try { dbg.enterSubRule(25); 2212 try { dbg.enterDecision(25, decisionCanBacktrack[25]); 2213 2214 int LA25_0 = input.LA(1); 2215 2216 if ( (LA25_0==SEMI) ) { 2217 alt25=1; 2218 } 2219 } finally {dbg.exitDecision(25);} 2220 2221 switch (alt25) { 2222 case 1 : 2223 dbg.enterAlt(1); 2224 2225 // src/com/google/doclava/parser/Java.g:427:10: enumBodyDeclarations 2226 { 2227 dbg.location(427,10); 2228 pushFollow(FOLLOW_enumBodyDeclarations_in_enumBody1085); 2229 enumBodyDeclarations(); 2230 2231 state._fsp--; 2232 if (state.failed) return ; 2233 2234 } 2235 break; 2236 2237 } 2238 } finally {dbg.exitSubRule(25);} 2239 2240 dbg.location(429,9); 2241 match(input,RBRACE,FOLLOW_RBRACE_in_enumBody1106); if (state.failed) return ; 2242 2243 } 2244 2245 } 2246 catch (RecognitionException re) { 2247 reportError(re); 2248 recover(input,re); 2249 } 2250 finally { 2251 if ( state.backtracking>0 ) { memoize(input, 15, enumBody_StartIndex); } 2252 } 2253 dbg.location(430, 5); 2254 2255 } 2256 finally { 2257 dbg.exitRule(getGrammarFileName(), "enumBody"); 2258 decRuleLevel(); 2259 if ( getRuleLevel()==0 ) {dbg.terminate();} 2260 } 2261 2262 return ; 2263 } 2264 // $ANTLR end "enumBody" 2265 2266 2267 // $ANTLR start "enumConstants" 2268 // src/com/google/doclava/parser/Java.g:432:1: enumConstants : enumConstant ( ',' enumConstant )* ; 2269 public final void enumConstants() throws RecognitionException { 2270 int enumConstants_StartIndex = input.index(); 2271 try { dbg.enterRule(getGrammarFileName(), "enumConstants"); 2272 if ( getRuleLevel()==0 ) {dbg.commence();} 2273 incRuleLevel(); 2274 dbg.location(432, 1); 2275 2276 try { 2277 if ( state.backtracking>0 && alreadyParsedRule(input, 16) ) { return ; } 2278 // src/com/google/doclava/parser/Java.g:433:5: ( enumConstant ( ',' enumConstant )* ) 2279 dbg.enterAlt(1); 2280 2281 // src/com/google/doclava/parser/Java.g:433:9: enumConstant ( ',' enumConstant )* 2282 { 2283 dbg.location(433,9); 2284 pushFollow(FOLLOW_enumConstant_in_enumConstants1125); 2285 enumConstant(); 2286 2287 state._fsp--; 2288 if (state.failed) return ; 2289 dbg.location(434,9); 2290 // src/com/google/doclava/parser/Java.g:434:9: ( ',' enumConstant )* 2291 try { dbg.enterSubRule(26); 2292 2293 loop26: 2294 do { 2295 int alt26=2; 2296 try { dbg.enterDecision(26, decisionCanBacktrack[26]); 2297 2298 int LA26_0 = input.LA(1); 2299 2300 if ( (LA26_0==COMMA) ) { 2301 int LA26_1 = input.LA(2); 2302 2303 if ( (LA26_1==IDENTIFIER||LA26_1==MONKEYS_AT) ) { 2304 alt26=1; 2305 } 2306 2307 2308 } 2309 2310 2311 } finally {dbg.exitDecision(26);} 2312 2313 switch (alt26) { 2314 case 1 : 2315 dbg.enterAlt(1); 2316 2317 // src/com/google/doclava/parser/Java.g:434:10: ',' enumConstant 2318 { 2319 dbg.location(434,10); 2320 match(input,COMMA,FOLLOW_COMMA_in_enumConstants1136); if (state.failed) return ; 2321 dbg.location(434,14); 2322 pushFollow(FOLLOW_enumConstant_in_enumConstants1138); 2323 enumConstant(); 2324 2325 state._fsp--; 2326 if (state.failed) return ; 2327 2328 } 2329 break; 2330 2331 default : 2332 break loop26; 2333 } 2334 } while (true); 2335 } finally {dbg.exitSubRule(26);} 2336 2337 2338 } 2339 2340 } 2341 catch (RecognitionException re) { 2342 reportError(re); 2343 recover(input,re); 2344 } 2345 finally { 2346 if ( state.backtracking>0 ) { memoize(input, 16, enumConstants_StartIndex); } 2347 } 2348 dbg.location(436, 5); 2349 2350 } 2351 finally { 2352 dbg.exitRule(getGrammarFileName(), "enumConstants"); 2353 decRuleLevel(); 2354 if ( getRuleLevel()==0 ) {dbg.terminate();} 2355 } 2356 2357 return ; 2358 } 2359 // $ANTLR end "enumConstants" 2360 2361 2362 // $ANTLR start "enumConstant" 2363 // src/com/google/doclava/parser/Java.g:438:1: enumConstant : ( annotations )? IDENTIFIER ( arguments )? ( classBody )? ; 2364 public final void enumConstant() throws RecognitionException { 2365 int enumConstant_StartIndex = input.index(); 2366 try { dbg.enterRule(getGrammarFileName(), "enumConstant"); 2367 if ( getRuleLevel()==0 ) {dbg.commence();} 2368 incRuleLevel(); 2369 dbg.location(438, 1); 2370 2371 try { 2372 if ( state.backtracking>0 && alreadyParsedRule(input, 17) ) { return ; } 2373 // src/com/google/doclava/parser/Java.g:443:5: ( ( annotations )? IDENTIFIER ( arguments )? ( classBody )? ) 2374 dbg.enterAlt(1); 2375 2376 // src/com/google/doclava/parser/Java.g:443:9: ( annotations )? IDENTIFIER ( arguments )? ( classBody )? 2377 { 2378 dbg.location(443,9); 2379 // src/com/google/doclava/parser/Java.g:443:9: ( annotations )? 2380 int alt27=2; 2381 try { dbg.enterSubRule(27); 2382 try { dbg.enterDecision(27, decisionCanBacktrack[27]); 2383 2384 int LA27_0 = input.LA(1); 2385 2386 if ( (LA27_0==MONKEYS_AT) ) { 2387 alt27=1; 2388 } 2389 } finally {dbg.exitDecision(27);} 2390 2391 switch (alt27) { 2392 case 1 : 2393 dbg.enterAlt(1); 2394 2395 // src/com/google/doclava/parser/Java.g:443:10: annotations 2396 { 2397 dbg.location(443,10); 2398 pushFollow(FOLLOW_annotations_in_enumConstant1171); 2399 annotations(); 2400 2401 state._fsp--; 2402 if (state.failed) return ; 2403 2404 } 2405 break; 2406 2407 } 2408 } finally {dbg.exitSubRule(27);} 2409 2410 dbg.location(445,9); 2411 match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_enumConstant1192); if (state.failed) return ; 2412 dbg.location(446,9); 2413 // src/com/google/doclava/parser/Java.g:446:9: ( arguments )? 2414 int alt28=2; 2415 try { dbg.enterSubRule(28); 2416 try { dbg.enterDecision(28, decisionCanBacktrack[28]); 2417 2418 int LA28_0 = input.LA(1); 2419 2420 if ( (LA28_0==LPAREN) ) { 2421 alt28=1; 2422 } 2423 } finally {dbg.exitDecision(28);} 2424 2425 switch (alt28) { 2426 case 1 : 2427 dbg.enterAlt(1); 2428 2429 // src/com/google/doclava/parser/Java.g:446:10: arguments 2430 { 2431 dbg.location(446,10); 2432 pushFollow(FOLLOW_arguments_in_enumConstant1203); 2433 arguments(); 2434 2435 state._fsp--; 2436 if (state.failed) return ; 2437 2438 } 2439 break; 2440 2441 } 2442 } finally {dbg.exitSubRule(28);} 2443 2444 dbg.location(448,9); 2445 // src/com/google/doclava/parser/Java.g:448:9: ( classBody )? 2446 int alt29=2; 2447 try { dbg.enterSubRule(29); 2448 try { dbg.enterDecision(29, decisionCanBacktrack[29]); 2449 2450 int LA29_0 = input.LA(1); 2451 2452 if ( (LA29_0==LBRACE) ) { 2453 alt29=1; 2454 } 2455 } finally {dbg.exitDecision(29);} 2456 2457 switch (alt29) { 2458 case 1 : 2459 dbg.enterAlt(1); 2460 2461 // src/com/google/doclava/parser/Java.g:448:10: classBody 2462 { 2463 dbg.location(448,10); 2464 pushFollow(FOLLOW_classBody_in_enumConstant1225); 2465 classBody(); 2466 2467 state._fsp--; 2468 if (state.failed) return ; 2469 2470 } 2471 break; 2472 2473 } 2474 } finally {dbg.exitSubRule(29);} 2475 2476 2477 } 2478 2479 } 2480 catch (RecognitionException re) { 2481 reportError(re); 2482 recover(input,re); 2483 } 2484 finally { 2485 if ( state.backtracking>0 ) { memoize(input, 17, enumConstant_StartIndex); } 2486 } 2487 dbg.location(452, 5); 2488 2489 } 2490 finally { 2491 dbg.exitRule(getGrammarFileName(), "enumConstant"); 2492 decRuleLevel(); 2493 if ( getRuleLevel()==0 ) {dbg.terminate();} 2494 } 2495 2496 return ; 2497 } 2498 // $ANTLR end "enumConstant" 2499 2500 2501 // $ANTLR start "enumBodyDeclarations" 2502 // src/com/google/doclava/parser/Java.g:454:1: enumBodyDeclarations : ';' ( classBodyDeclaration )* ; 2503 public final void enumBodyDeclarations() throws RecognitionException { 2504 int enumBodyDeclarations_StartIndex = input.index(); 2505 try { dbg.enterRule(getGrammarFileName(), "enumBodyDeclarations"); 2506 if ( getRuleLevel()==0 ) {dbg.commence();} 2507 incRuleLevel(); 2508 dbg.location(454, 1); 2509 2510 try { 2511 if ( state.backtracking>0 && alreadyParsedRule(input, 18) ) { return ; } 2512 // src/com/google/doclava/parser/Java.g:455:5: ( ';' ( classBodyDeclaration )* ) 2513 dbg.enterAlt(1); 2514 2515 // src/com/google/doclava/parser/Java.g:455:9: ';' ( classBodyDeclaration )* 2516 { 2517 dbg.location(455,9); 2518 match(input,SEMI,FOLLOW_SEMI_in_enumBodyDeclarations1265); if (state.failed) return ; 2519 dbg.location(456,9); 2520 // src/com/google/doclava/parser/Java.g:456:9: ( classBodyDeclaration )* 2521 try { dbg.enterSubRule(30); 2522 2523 loop30: 2524 do { 2525 int alt30=2; 2526 try { dbg.enterDecision(30, decisionCanBacktrack[30]); 2527 2528 int LA30_0 = input.LA(1); 2529 2530 if ( (LA30_0==IDENTIFIER||LA30_0==ABSTRACT||LA30_0==BOOLEAN||LA30_0==BYTE||(LA30_0>=CHAR && LA30_0<=CLASS)||LA30_0==DOUBLE||LA30_0==ENUM||LA30_0==FINAL||LA30_0==FLOAT||(LA30_0>=INT && LA30_0<=NATIVE)||(LA30_0>=PRIVATE && LA30_0<=PUBLIC)||(LA30_0>=SHORT && LA30_0<=STRICTFP)||LA30_0==SYNCHRONIZED||LA30_0==TRANSIENT||(LA30_0>=VOID && LA30_0<=VOLATILE)||LA30_0==LBRACE||LA30_0==SEMI||LA30_0==MONKEYS_AT||LA30_0==LT) ) { 2531 alt30=1; 2532 } 2533 2534 2535 } finally {dbg.exitDecision(30);} 2536 2537 switch (alt30) { 2538 case 1 : 2539 dbg.enterAlt(1); 2540 2541 // src/com/google/doclava/parser/Java.g:456:10: classBodyDeclaration 2542 { 2543 dbg.location(456,10); 2544 pushFollow(FOLLOW_classBodyDeclaration_in_enumBodyDeclarations1276); 2545 classBodyDeclaration(); 2546 2547 state._fsp--; 2548 if (state.failed) return ; 2549 2550 } 2551 break; 2552 2553 default : 2554 break loop30; 2555 } 2556 } while (true); 2557 } finally {dbg.exitSubRule(30);} 2558 2559 2560 } 2561 2562 } 2563 catch (RecognitionException re) { 2564 reportError(re); 2565 recover(input,re); 2566 } 2567 finally { 2568 if ( state.backtracking>0 ) { memoize(input, 18, enumBodyDeclarations_StartIndex); } 2569 } 2570 dbg.location(458, 5); 2571 2572 } 2573 finally { 2574 dbg.exitRule(getGrammarFileName(), "enumBodyDeclarations"); 2575 decRuleLevel(); 2576 if ( getRuleLevel()==0 ) {dbg.terminate();} 2577 } 2578 2579 return ; 2580 } 2581 // $ANTLR end "enumBodyDeclarations" 2582 2583 2584 // $ANTLR start "interfaceDeclaration" 2585 // src/com/google/doclava/parser/Java.g:460:1: interfaceDeclaration : ( normalInterfaceDeclaration | annotationTypeDeclaration ); 2586 public final void interfaceDeclaration() throws RecognitionException { 2587 int interfaceDeclaration_StartIndex = input.index(); 2588 try { dbg.enterRule(getGrammarFileName(), "interfaceDeclaration"); 2589 if ( getRuleLevel()==0 ) {dbg.commence();} 2590 incRuleLevel(); 2591 dbg.location(460, 1); 2592 2593 try { 2594 if ( state.backtracking>0 && alreadyParsedRule(input, 19) ) { return ; } 2595 // src/com/google/doclava/parser/Java.g:461:5: ( normalInterfaceDeclaration | annotationTypeDeclaration ) 2596 int alt31=2; 2597 try { dbg.enterDecision(31, decisionCanBacktrack[31]); 2598 2599 try { 2600 isCyclicDecision = true; 2601 alt31 = dfa31.predict(input); 2602 } 2603 catch (NoViableAltException nvae) { 2604 dbg.recognitionException(nvae); 2605 throw nvae; 2606 } 2607 } finally {dbg.exitDecision(31);} 2608 2609 switch (alt31) { 2610 case 1 : 2611 dbg.enterAlt(1); 2612 2613 // src/com/google/doclava/parser/Java.g:461:9: normalInterfaceDeclaration 2614 { 2615 dbg.location(461,9); 2616 pushFollow(FOLLOW_normalInterfaceDeclaration_in_interfaceDeclaration1306); 2617 normalInterfaceDeclaration(); 2618 2619 state._fsp--; 2620 if (state.failed) return ; 2621 2622 } 2623 break; 2624 case 2 : 2625 dbg.enterAlt(2); 2626 2627 // src/com/google/doclava/parser/Java.g:462:9: annotationTypeDeclaration 2628 { 2629 dbg.location(462,9); 2630 pushFollow(FOLLOW_annotationTypeDeclaration_in_interfaceDeclaration1316); 2631 annotationTypeDeclaration(); 2632 2633 state._fsp--; 2634 if (state.failed) return ; 2635 2636 } 2637 break; 2638 2639 } 2640 } 2641 catch (RecognitionException re) { 2642 reportError(re); 2643 recover(input,re); 2644 } 2645 finally { 2646 if ( state.backtracking>0 ) { memoize(input, 19, interfaceDeclaration_StartIndex); } 2647 } 2648 dbg.location(463, 5); 2649 2650 } 2651 finally { 2652 dbg.exitRule(getGrammarFileName(), "interfaceDeclaration"); 2653 decRuleLevel(); 2654 if ( getRuleLevel()==0 ) {dbg.terminate();} 2655 } 2656 2657 return ; 2658 } 2659 // $ANTLR end "interfaceDeclaration" 2660 2661 2662 // $ANTLR start "normalInterfaceDeclaration" 2663 // src/com/google/doclava/parser/Java.g:465:1: normalInterfaceDeclaration : modifiers 'interface' IDENTIFIER ( typeParameters )? ( 'extends' typeList )? interfaceBody ; 2664 public final void normalInterfaceDeclaration() throws RecognitionException { 2665 int normalInterfaceDeclaration_StartIndex = input.index(); 2666 try { dbg.enterRule(getGrammarFileName(), "normalInterfaceDeclaration"); 2667 if ( getRuleLevel()==0 ) {dbg.commence();} 2668 incRuleLevel(); 2669 dbg.location(465, 1); 2670 2671 try { 2672 if ( state.backtracking>0 && alreadyParsedRule(input, 20) ) { return ; } 2673 // src/com/google/doclava/parser/Java.g:466:5: ( modifiers 'interface' IDENTIFIER ( typeParameters )? ( 'extends' typeList )? interfaceBody ) 2674 dbg.enterAlt(1); 2675 2676 // src/com/google/doclava/parser/Java.g:466:9: modifiers 'interface' IDENTIFIER ( typeParameters )? ( 'extends' typeList )? interfaceBody 2677 { 2678 dbg.location(466,9); 2679 pushFollow(FOLLOW_modifiers_in_normalInterfaceDeclaration1335); 2680 modifiers(); 2681 2682 state._fsp--; 2683 if (state.failed) return ; 2684 dbg.location(466,19); 2685 match(input,INTERFACE,FOLLOW_INTERFACE_in_normalInterfaceDeclaration1337); if (state.failed) return ; 2686 dbg.location(466,31); 2687 match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_normalInterfaceDeclaration1339); if (state.failed) return ; 2688 dbg.location(467,9); 2689 // src/com/google/doclava/parser/Java.g:467:9: ( typeParameters )? 2690 int alt32=2; 2691 try { dbg.enterSubRule(32); 2692 try { dbg.enterDecision(32, decisionCanBacktrack[32]); 2693 2694 int LA32_0 = input.LA(1); 2695 2696 if ( (LA32_0==LT) ) { 2697 alt32=1; 2698 } 2699 } finally {dbg.exitDecision(32);} 2700 2701 switch (alt32) { 2702 case 1 : 2703 dbg.enterAlt(1); 2704 2705 // src/com/google/doclava/parser/Java.g:467:10: typeParameters 2706 { 2707 dbg.location(467,10); 2708 pushFollow(FOLLOW_typeParameters_in_normalInterfaceDeclaration1350); 2709 typeParameters(); 2710 2711 state._fsp--; 2712 if (state.failed) return ; 2713 2714 } 2715 break; 2716 2717 } 2718 } finally {dbg.exitSubRule(32);} 2719 2720 dbg.location(469,9); 2721 // src/com/google/doclava/parser/Java.g:469:9: ( 'extends' typeList )? 2722 int alt33=2; 2723 try { dbg.enterSubRule(33); 2724 try { dbg.enterDecision(33, decisionCanBacktrack[33]); 2725 2726 int LA33_0 = input.LA(1); 2727 2728 if ( (LA33_0==EXTENDS) ) { 2729 alt33=1; 2730 } 2731 } finally {dbg.exitDecision(33);} 2732 2733 switch (alt33) { 2734 case 1 : 2735 dbg.enterAlt(1); 2736 2737 // src/com/google/doclava/parser/Java.g:469:10: 'extends' typeList 2738 { 2739 dbg.location(469,10); 2740 match(input,EXTENDS,FOLLOW_EXTENDS_in_normalInterfaceDeclaration1372); if (state.failed) return ; 2741 dbg.location(469,20); 2742 pushFollow(FOLLOW_typeList_in_normalInterfaceDeclaration1374); 2743 typeList(); 2744 2745 state._fsp--; 2746 if (state.failed) return ; 2747 2748 } 2749 break; 2750 2751 } 2752 } finally {dbg.exitSubRule(33);} 2753 2754 dbg.location(471,9); 2755 pushFollow(FOLLOW_interfaceBody_in_normalInterfaceDeclaration1395); 2756 interfaceBody(); 2757 2758 state._fsp--; 2759 if (state.failed) return ; 2760 2761 } 2762 2763 } 2764 catch (RecognitionException re) { 2765 reportError(re); 2766 recover(input,re); 2767 } 2768 finally { 2769 if ( state.backtracking>0 ) { memoize(input, 20, normalInterfaceDeclaration_StartIndex); } 2770 } 2771 dbg.location(472, 5); 2772 2773 } 2774 finally { 2775 dbg.exitRule(getGrammarFileName(), "normalInterfaceDeclaration"); 2776 decRuleLevel(); 2777 if ( getRuleLevel()==0 ) {dbg.terminate();} 2778 } 2779 2780 return ; 2781 } 2782 // $ANTLR end "normalInterfaceDeclaration" 2783 2784 2785 // $ANTLR start "typeList" 2786 // src/com/google/doclava/parser/Java.g:474:1: typeList : type ( ',' type )* ; 2787 public final void typeList() throws RecognitionException { 2788 int typeList_StartIndex = input.index(); 2789 try { dbg.enterRule(getGrammarFileName(), "typeList"); 2790 if ( getRuleLevel()==0 ) {dbg.commence();} 2791 incRuleLevel(); 2792 dbg.location(474, 1); 2793 2794 try { 2795 if ( state.backtracking>0 && alreadyParsedRule(input, 21) ) { return ; } 2796 // src/com/google/doclava/parser/Java.g:475:5: ( type ( ',' type )* ) 2797 dbg.enterAlt(1); 2798 2799 // src/com/google/doclava/parser/Java.g:475:9: type ( ',' type )* 2800 { 2801 dbg.location(475,9); 2802 pushFollow(FOLLOW_type_in_typeList1414); 2803 type(); 2804 2805 state._fsp--; 2806 if (state.failed) return ; 2807 dbg.location(476,9); 2808 // src/com/google/doclava/parser/Java.g:476:9: ( ',' type )* 2809 try { dbg.enterSubRule(34); 2810 2811 loop34: 2812 do { 2813 int alt34=2; 2814 try { dbg.enterDecision(34, decisionCanBacktrack[34]); 2815 2816 int LA34_0 = input.LA(1); 2817 2818 if ( (LA34_0==COMMA) ) { 2819 alt34=1; 2820 } 2821 2822 2823 } finally {dbg.exitDecision(34);} 2824 2825 switch (alt34) { 2826 case 1 : 2827 dbg.enterAlt(1); 2828 2829 // src/com/google/doclava/parser/Java.g:476:10: ',' type 2830 { 2831 dbg.location(476,10); 2832 match(input,COMMA,FOLLOW_COMMA_in_typeList1425); if (state.failed) return ; 2833 dbg.location(476,14); 2834 pushFollow(FOLLOW_type_in_typeList1427); 2835 type(); 2836 2837 state._fsp--; 2838 if (state.failed) return ; 2839 2840 } 2841 break; 2842 2843 default : 2844 break loop34; 2845 } 2846 } while (true); 2847 } finally {dbg.exitSubRule(34);} 2848 2849 2850 } 2851 2852 } 2853 catch (RecognitionException re) { 2854 reportError(re); 2855 recover(input,re); 2856 } 2857 finally { 2858 if ( state.backtracking>0 ) { memoize(input, 21, typeList_StartIndex); } 2859 } 2860 dbg.location(478, 5); 2861 2862 } 2863 finally { 2864 dbg.exitRule(getGrammarFileName(), "typeList"); 2865 decRuleLevel(); 2866 if ( getRuleLevel()==0 ) {dbg.terminate();} 2867 } 2868 2869 return ; 2870 } 2871 // $ANTLR end "typeList" 2872 2873 2874 // $ANTLR start "classBody" 2875 // src/com/google/doclava/parser/Java.g:480:1: classBody : '{' ( classBodyDeclaration )* '}' ; 2876 public final void classBody() throws RecognitionException { 2877 int classBody_StartIndex = input.index(); 2878 try { dbg.enterRule(getGrammarFileName(), "classBody"); 2879 if ( getRuleLevel()==0 ) {dbg.commence();} 2880 incRuleLevel(); 2881 dbg.location(480, 1); 2882 2883 try { 2884 if ( state.backtracking>0 && alreadyParsedRule(input, 22) ) { return ; } 2885 // src/com/google/doclava/parser/Java.g:481:5: ( '{' ( classBodyDeclaration )* '}' ) 2886 dbg.enterAlt(1); 2887 2888 // src/com/google/doclava/parser/Java.g:481:9: '{' ( classBodyDeclaration )* '}' 2889 { 2890 dbg.location(481,9); 2891 match(input,LBRACE,FOLLOW_LBRACE_in_classBody1457); if (state.failed) return ; 2892 dbg.location(482,9); 2893 // src/com/google/doclava/parser/Java.g:482:9: ( classBodyDeclaration )* 2894 try { dbg.enterSubRule(35); 2895 2896 loop35: 2897 do { 2898 int alt35=2; 2899 try { dbg.enterDecision(35, decisionCanBacktrack[35]); 2900 2901 int LA35_0 = input.LA(1); 2902 2903 if ( (LA35_0==IDENTIFIER||LA35_0==ABSTRACT||LA35_0==BOOLEAN||LA35_0==BYTE||(LA35_0>=CHAR && LA35_0<=CLASS)||LA35_0==DOUBLE||LA35_0==ENUM||LA35_0==FINAL||LA35_0==FLOAT||(LA35_0>=INT && LA35_0<=NATIVE)||(LA35_0>=PRIVATE && LA35_0<=PUBLIC)||(LA35_0>=SHORT && LA35_0<=STRICTFP)||LA35_0==SYNCHRONIZED||LA35_0==TRANSIENT||(LA35_0>=VOID && LA35_0<=VOLATILE)||LA35_0==LBRACE||LA35_0==SEMI||LA35_0==MONKEYS_AT||LA35_0==LT) ) { 2904 alt35=1; 2905 } 2906 2907 2908 } finally {dbg.exitDecision(35);} 2909 2910 switch (alt35) { 2911 case 1 : 2912 dbg.enterAlt(1); 2913 2914 // src/com/google/doclava/parser/Java.g:482:10: classBodyDeclaration 2915 { 2916 dbg.location(482,10); 2917 pushFollow(FOLLOW_classBodyDeclaration_in_classBody1468); 2918 classBodyDeclaration(); 2919 2920 state._fsp--; 2921 if (state.failed) return ; 2922 2923 } 2924 break; 2925 2926 default : 2927 break loop35; 2928 } 2929 } while (true); 2930 } finally {dbg.exitSubRule(35);} 2931 2932 dbg.location(484,9); 2933 match(input,RBRACE,FOLLOW_RBRACE_in_classBody1489); if (state.failed) return ; 2934 2935 } 2936 2937 } 2938 catch (RecognitionException re) { 2939 reportError(re); 2940 recover(input,re); 2941 } 2942 finally { 2943 if ( state.backtracking>0 ) { memoize(input, 22, classBody_StartIndex); } 2944 } 2945 dbg.location(485, 5); 2946 2947 } 2948 finally { 2949 dbg.exitRule(getGrammarFileName(), "classBody"); 2950 decRuleLevel(); 2951 if ( getRuleLevel()==0 ) {dbg.terminate();} 2952 } 2953 2954 return ; 2955 } 2956 // $ANTLR end "classBody" 2957 2958 2959 // $ANTLR start "interfaceBody" 2960 // src/com/google/doclava/parser/Java.g:487:1: interfaceBody : '{' ( interfaceBodyDeclaration )* '}' ; 2961 public final void interfaceBody() throws RecognitionException { 2962 int interfaceBody_StartIndex = input.index(); 2963 try { dbg.enterRule(getGrammarFileName(), "interfaceBody"); 2964 if ( getRuleLevel()==0 ) {dbg.commence();} 2965 incRuleLevel(); 2966 dbg.location(487, 1); 2967 2968 try { 2969 if ( state.backtracking>0 && alreadyParsedRule(input, 23) ) { return ; } 2970 // src/com/google/doclava/parser/Java.g:488:5: ( '{' ( interfaceBodyDeclaration )* '}' ) 2971 dbg.enterAlt(1); 2972 2973 // src/com/google/doclava/parser/Java.g:488:9: '{' ( interfaceBodyDeclaration )* '}' 2974 { 2975 dbg.location(488,9); 2976 match(input,LBRACE,FOLLOW_LBRACE_in_interfaceBody1508); if (state.failed) return ; 2977 dbg.location(489,9); 2978 // src/com/google/doclava/parser/Java.g:489:9: ( interfaceBodyDeclaration )* 2979 try { dbg.enterSubRule(36); 2980 2981 loop36: 2982 do { 2983 int alt36=2; 2984 try { dbg.enterDecision(36, decisionCanBacktrack[36]); 2985 2986 int LA36_0 = input.LA(1); 2987 2988 if ( (LA36_0==IDENTIFIER||LA36_0==ABSTRACT||LA36_0==BOOLEAN||LA36_0==BYTE||(LA36_0>=CHAR && LA36_0<=CLASS)||LA36_0==DOUBLE||LA36_0==ENUM||LA36_0==FINAL||LA36_0==FLOAT||(LA36_0>=INT && LA36_0<=NATIVE)||(LA36_0>=PRIVATE && LA36_0<=PUBLIC)||(LA36_0>=SHORT && LA36_0<=STRICTFP)||LA36_0==SYNCHRONIZED||LA36_0==TRANSIENT||(LA36_0>=VOID && LA36_0<=VOLATILE)||LA36_0==SEMI||LA36_0==MONKEYS_AT||LA36_0==LT) ) { 2989 alt36=1; 2990 } 2991 2992 2993 } finally {dbg.exitDecision(36);} 2994 2995 switch (alt36) { 2996 case 1 : 2997 dbg.enterAlt(1); 2998 2999 // src/com/google/doclava/parser/Java.g:489:10: interfaceBodyDeclaration 3000 { 3001 dbg.location(489,10); 3002 pushFollow(FOLLOW_interfaceBodyDeclaration_in_interfaceBody1519); 3003 interfaceBodyDeclaration(); 3004 3005 state._fsp--; 3006 if (state.failed) return ; 3007 3008 } 3009 break; 3010 3011 default : 3012 break loop36; 3013 } 3014 } while (true); 3015 } finally {dbg.exitSubRule(36);} 3016 3017 dbg.location(491,9); 3018 match(input,RBRACE,FOLLOW_RBRACE_in_interfaceBody1540); if (state.failed) return ; 3019 3020 } 3021 3022 } 3023 catch (RecognitionException re) { 3024 reportError(re); 3025 recover(input,re); 3026 } 3027 finally { 3028 if ( state.backtracking>0 ) { memoize(input, 23, interfaceBody_StartIndex); } 3029 } 3030 dbg.location(492, 5); 3031 3032 } 3033 finally { 3034 dbg.exitRule(getGrammarFileName(), "interfaceBody"); 3035 decRuleLevel(); 3036 if ( getRuleLevel()==0 ) {dbg.terminate();} 3037 } 3038 3039 return ; 3040 } 3041 // $ANTLR end "interfaceBody" 3042 3043 3044 // $ANTLR start "classBodyDeclaration" 3045 // src/com/google/doclava/parser/Java.g:494:1: classBodyDeclaration : ( ';' | ( 'static' )? block | memberDecl ); 3046 public final void classBodyDeclaration() throws RecognitionException { 3047 int classBodyDeclaration_StartIndex = input.index(); 3048 try { dbg.enterRule(getGrammarFileName(), "classBodyDeclaration"); 3049 if ( getRuleLevel()==0 ) {dbg.commence();} 3050 incRuleLevel(); 3051 dbg.location(494, 1); 3052 3053 try { 3054 if ( state.backtracking>0 && alreadyParsedRule(input, 24) ) { return ; } 3055 // src/com/google/doclava/parser/Java.g:495:5: ( ';' | ( 'static' )? block | memberDecl ) 3056 int alt38=3; 3057 try { dbg.enterDecision(38, decisionCanBacktrack[38]); 3058 3059 switch ( input.LA(1) ) { 3060 case SEMI: 3061 { 3062 alt38=1; 3063 } 3064 break; 3065 case STATIC: 3066 { 3067 int LA38_2 = input.LA(2); 3068 3069 if ( (LA38_2==LBRACE) ) { 3070 alt38=2; 3071 } 3072 else if ( (LA38_2==IDENTIFIER||LA38_2==ABSTRACT||LA38_2==BOOLEAN||LA38_2==BYTE||(LA38_2>=CHAR && LA38_2<=CLASS)||LA38_2==DOUBLE||LA38_2==ENUM||LA38_2==FINAL||LA38_2==FLOAT||(LA38_2>=INT && LA38_2<=NATIVE)||(LA38_2>=PRIVATE && LA38_2<=PUBLIC)||(LA38_2>=SHORT && LA38_2<=STRICTFP)||LA38_2==SYNCHRONIZED||LA38_2==TRANSIENT||(LA38_2>=VOID && LA38_2<=VOLATILE)||LA38_2==MONKEYS_AT||LA38_2==LT) ) { 3073 alt38=3; 3074 } 3075 else { 3076 if (state.backtracking>0) {state.failed=true; return ;} 3077 NoViableAltException nvae = 3078 new NoViableAltException("", 38, 2, input); 3079 3080 dbg.recognitionException(nvae); 3081 throw nvae; 3082 } 3083 } 3084 break; 3085 case LBRACE: 3086 { 3087 alt38=2; 3088 } 3089 break; 3090 case IDENTIFIER: 3091 case ABSTRACT: 3092 case BOOLEAN: 3093 case BYTE: 3094 case CHAR: 3095 case CLASS: 3096 case DOUBLE: 3097 case ENUM: 3098 case FINAL: 3099 case FLOAT: 3100 case INT: 3101 case INTERFACE: 3102 case LONG: 3103 case NATIVE: 3104 case PRIVATE: 3105 case PROTECTED: 3106 case PUBLIC: 3107 case SHORT: 3108 case STRICTFP: 3109 case SYNCHRONIZED: 3110 case TRANSIENT: 3111 case VOID: 3112 case VOLATILE: 3113 case MONKEYS_AT: 3114 case LT: 3115 { 3116 alt38=3; 3117 } 3118 break; 3119 default: 3120 if (state.backtracking>0) {state.failed=true; return ;} 3121 NoViableAltException nvae = 3122 new NoViableAltException("", 38, 0, input); 3123 3124 dbg.recognitionException(nvae); 3125 throw nvae; 3126 } 3127 3128 } finally {dbg.exitDecision(38);} 3129 3130 switch (alt38) { 3131 case 1 : 3132 dbg.enterAlt(1); 3133 3134 // src/com/google/doclava/parser/Java.g:495:9: ';' 3135 { 3136 dbg.location(495,9); 3137 match(input,SEMI,FOLLOW_SEMI_in_classBodyDeclaration1559); if (state.failed) return ; 3138 3139 } 3140 break; 3141 case 2 : 3142 dbg.enterAlt(2); 3143 3144 // src/com/google/doclava/parser/Java.g:496:9: ( 'static' )? block 3145 { 3146 dbg.location(496,9); 3147 // src/com/google/doclava/parser/Java.g:496:9: ( 'static' )? 3148 int alt37=2; 3149 try { dbg.enterSubRule(37); 3150 try { dbg.enterDecision(37, decisionCanBacktrack[37]); 3151 3152 int LA37_0 = input.LA(1); 3153 3154 if ( (LA37_0==STATIC) ) { 3155 alt37=1; 3156 } 3157 } finally {dbg.exitDecision(37);} 3158 3159 switch (alt37) { 3160 case 1 : 3161 dbg.enterAlt(1); 3162 3163 // src/com/google/doclava/parser/Java.g:496:10: 'static' 3164 { 3165 dbg.location(496,10); 3166 match(input,STATIC,FOLLOW_STATIC_in_classBodyDeclaration1570); if (state.failed) return ; 3167 3168 } 3169 break; 3170 3171 } 3172 } finally {dbg.exitSubRule(37);} 3173 3174 dbg.location(498,9); 3175 pushFollow(FOLLOW_block_in_classBodyDeclaration1591); 3176 block(); 3177 3178 state._fsp--; 3179 if (state.failed) return ; 3180 3181 } 3182 break; 3183 case 3 : 3184 dbg.enterAlt(3); 3185 3186 // src/com/google/doclava/parser/Java.g:499:9: memberDecl 3187 { 3188 dbg.location(499,9); 3189 pushFollow(FOLLOW_memberDecl_in_classBodyDeclaration1601); 3190 memberDecl(); 3191 3192 state._fsp--; 3193 if (state.failed) return ; 3194 3195 } 3196 break; 3197 3198 } 3199 } 3200 catch (RecognitionException re) { 3201 reportError(re); 3202 recover(input,re); 3203 } 3204 finally { 3205 if ( state.backtracking>0 ) { memoize(input, 24, classBodyDeclaration_StartIndex); } 3206 } 3207 dbg.location(500, 5); 3208 3209 } 3210 finally { 3211 dbg.exitRule(getGrammarFileName(), "classBodyDeclaration"); 3212 decRuleLevel(); 3213 if ( getRuleLevel()==0 ) {dbg.terminate();} 3214 } 3215 3216 return ; 3217 } 3218 // $ANTLR end "classBodyDeclaration" 3219 3220 3221 // $ANTLR start "memberDecl" 3222 // src/com/google/doclava/parser/Java.g:502:1: memberDecl : ( fieldDeclaration | methodDeclaration | classDeclaration | interfaceDeclaration ); 3223 public final void memberDecl() throws RecognitionException { 3224 int memberDecl_StartIndex = input.index(); 3225 try { dbg.enterRule(getGrammarFileName(), "memberDecl"); 3226 if ( getRuleLevel()==0 ) {dbg.commence();} 3227 incRuleLevel(); 3228 dbg.location(502, 1); 3229 3230 try { 3231 if ( state.backtracking>0 && alreadyParsedRule(input, 25) ) { return ; } 3232 // src/com/google/doclava/parser/Java.g:503:5: ( fieldDeclaration | methodDeclaration | classDeclaration | interfaceDeclaration ) 3233 int alt39=4; 3234 try { dbg.enterDecision(39, decisionCanBacktrack[39]); 3235 3236 try { 3237 isCyclicDecision = true; 3238 alt39 = dfa39.predict(input); 3239 } 3240 catch (NoViableAltException nvae) { 3241 dbg.recognitionException(nvae); 3242 throw nvae; 3243 } 3244 } finally {dbg.exitDecision(39);} 3245 3246 switch (alt39) { 3247 case 1 : 3248 dbg.enterAlt(1); 3249 3250 // src/com/google/doclava/parser/Java.g:503:10: fieldDeclaration 3251 { 3252 dbg.location(503,10); 3253 pushFollow(FOLLOW_fieldDeclaration_in_memberDecl1621); 3254 fieldDeclaration(); 3255 3256 state._fsp--; 3257 if (state.failed) return ; 3258 3259 } 3260 break; 3261 case 2 : 3262 dbg.enterAlt(2); 3263 3264 // src/com/google/doclava/parser/Java.g:504:10: methodDeclaration 3265 { 3266 dbg.location(504,10); 3267 pushFollow(FOLLOW_methodDeclaration_in_memberDecl1632); 3268 methodDeclaration(); 3269 3270 state._fsp--; 3271 if (state.failed) return ; 3272 3273 } 3274 break; 3275 case 3 : 3276 dbg.enterAlt(3); 3277 3278 // src/com/google/doclava/parser/Java.g:505:10: classDeclaration 3279 { 3280 dbg.location(505,10); 3281 pushFollow(FOLLOW_classDeclaration_in_memberDecl1643); 3282 classDeclaration(); 3283 3284 state._fsp--; 3285 if (state.failed) return ; 3286 3287 } 3288 break; 3289 case 4 : 3290 dbg.enterAlt(4); 3291 3292 // src/com/google/doclava/parser/Java.g:506:10: interfaceDeclaration 3293 { 3294 dbg.location(506,10); 3295 pushFollow(FOLLOW_interfaceDeclaration_in_memberDecl1654); 3296 interfaceDeclaration(); 3297 3298 state._fsp--; 3299 if (state.failed) return ; 3300 3301 } 3302 break; 3303 3304 } 3305 } 3306 catch (RecognitionException re) { 3307 reportError(re); 3308 recover(input,re); 3309 } 3310 finally { 3311 if ( state.backtracking>0 ) { memoize(input, 25, memberDecl_StartIndex); } 3312 } 3313 dbg.location(507, 5); 3314 3315 } 3316 finally { 3317 dbg.exitRule(getGrammarFileName(), "memberDecl"); 3318 decRuleLevel(); 3319 if ( getRuleLevel()==0 ) {dbg.terminate();} 3320 } 3321 3322 return ; 3323 } 3324 // $ANTLR end "memberDecl" 3325 3326 3327 // $ANTLR start "methodDeclaration" 3328 // src/com/google/doclava/parser/Java.g:510:1: methodDeclaration : ( modifiers ( typeParameters )? IDENTIFIER formalParameters ( 'throws' qualifiedNameList )? '{' ( explicitConstructorInvocation )? ( blockStatement )* '}' | modifiers ( typeParameters )? ( type | 'void' ) IDENTIFIER formalParameters ( '[' ']' )* ( 'throws' qualifiedNameList )? ( block | ';' ) ); 3329 public final void methodDeclaration() throws RecognitionException { 3330 int methodDeclaration_StartIndex = input.index(); 3331 try { dbg.enterRule(getGrammarFileName(), "methodDeclaration"); 3332 if ( getRuleLevel()==0 ) {dbg.commence();} 3333 incRuleLevel(); 3334 dbg.location(510, 1); 3335 3336 try { 3337 if ( state.backtracking>0 && alreadyParsedRule(input, 26) ) { return ; } 3338 // src/com/google/doclava/parser/Java.g:511:5: ( modifiers ( typeParameters )? IDENTIFIER formalParameters ( 'throws' qualifiedNameList )? '{' ( explicitConstructorInvocation )? ( blockStatement )* '}' | modifiers ( typeParameters )? ( type | 'void' ) IDENTIFIER formalParameters ( '[' ']' )* ( 'throws' qualifiedNameList )? ( block | ';' ) ) 3339 int alt49=2; 3340 try { dbg.enterDecision(49, decisionCanBacktrack[49]); 3341 3342 try { 3343 isCyclicDecision = true; 3344 alt49 = dfa49.predict(input); 3345 } 3346 catch (NoViableAltException nvae) { 3347 dbg.recognitionException(nvae); 3348 throw nvae; 3349 } 3350 } finally {dbg.exitDecision(49);} 3351 3352 switch (alt49) { 3353 case 1 : 3354 dbg.enterAlt(1); 3355 3356 // src/com/google/doclava/parser/Java.g:513:10: modifiers ( typeParameters )? IDENTIFIER formalParameters ( 'throws' qualifiedNameList )? '{' ( explicitConstructorInvocation )? ( blockStatement )* '}' 3357 { 3358 dbg.location(513,10); 3359 pushFollow(FOLLOW_modifiers_in_methodDeclaration1691); 3360 modifiers(); 3361 3362 state._fsp--; 3363 if (state.failed) return ; 3364 dbg.location(514,9); 3365 // src/com/google/doclava/parser/Java.g:514:9: ( typeParameters )? 3366 int alt40=2; 3367 try { dbg.enterSubRule(40); 3368 try { dbg.enterDecision(40, decisionCanBacktrack[40]); 3369 3370 int LA40_0 = input.LA(1); 3371 3372 if ( (LA40_0==LT) ) { 3373 alt40=1; 3374 } 3375 } finally {dbg.exitDecision(40);} 3376 3377 switch (alt40) { 3378 case 1 : 3379 dbg.enterAlt(1); 3380 3381 // src/com/google/doclava/parser/Java.g:514:10: typeParameters 3382 { 3383 dbg.location(514,10); 3384 pushFollow(FOLLOW_typeParameters_in_methodDeclaration1702); 3385 typeParameters(); 3386 3387 state._fsp--; 3388 if (state.failed) return ; 3389 3390 } 3391 break; 3392 3393 } 3394 } finally {dbg.exitSubRule(40);} 3395 3396 dbg.location(516,9); 3397 match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_methodDeclaration1723); if (state.failed) return ; 3398 dbg.location(517,9); 3399 pushFollow(FOLLOW_formalParameters_in_methodDeclaration1733); 3400 formalParameters(); 3401 3402 state._fsp--; 3403 if (state.failed) return ; 3404 dbg.location(518,9); 3405 // src/com/google/doclava/parser/Java.g:518:9: ( 'throws' qualifiedNameList )? 3406 int alt41=2; 3407 try { dbg.enterSubRule(41); 3408 try { dbg.enterDecision(41, decisionCanBacktrack[41]); 3409 3410 int LA41_0 = input.LA(1); 3411 3412 if ( (LA41_0==THROWS) ) { 3413 alt41=1; 3414 } 3415 } finally {dbg.exitDecision(41);} 3416 3417 switch (alt41) { 3418 case 1 : 3419 dbg.enterAlt(1); 3420 3421 // src/com/google/doclava/parser/Java.g:518:10: 'throws' qualifiedNameList 3422 { 3423 dbg.location(518,10); 3424 match(input,THROWS,FOLLOW_THROWS_in_methodDeclaration1744); if (state.failed) return ; 3425 dbg.location(518,19); 3426 pushFollow(FOLLOW_qualifiedNameList_in_methodDeclaration1746); 3427 qualifiedNameList(); 3428 3429 state._fsp--; 3430 if (state.failed) return ; 3431 3432 } 3433 break; 3434 3435 } 3436 } finally {dbg.exitSubRule(41);} 3437 3438 dbg.location(520,9); 3439 match(input,LBRACE,FOLLOW_LBRACE_in_methodDeclaration1767); if (state.failed) return ; 3440 dbg.location(521,9); 3441 // src/com/google/doclava/parser/Java.g:521:9: ( explicitConstructorInvocation )? 3442 int alt42=2; 3443 try { dbg.enterSubRule(42); 3444 try { dbg.enterDecision(42, decisionCanBacktrack[42]); 3445 3446 try { 3447 isCyclicDecision = true; 3448 alt42 = dfa42.predict(input); 3449 } 3450 catch (NoViableAltException nvae) { 3451 dbg.recognitionException(nvae); 3452 throw nvae; 3453 } 3454 } finally {dbg.exitDecision(42);} 3455 3456 switch (alt42) { 3457 case 1 : 3458 dbg.enterAlt(1); 3459 3460 // src/com/google/doclava/parser/Java.g:521:10: explicitConstructorInvocation 3461 { 3462 dbg.location(521,10); 3463 pushFollow(FOLLOW_explicitConstructorInvocation_in_methodDeclaration1778); 3464 explicitConstructorInvocation(); 3465 3466 state._fsp--; 3467 if (state.failed) return ; 3468 3469 } 3470 break; 3471 3472 } 3473 } finally {dbg.exitSubRule(42);} 3474 3475 dbg.location(523,9); 3476 // src/com/google/doclava/parser/Java.g:523:9: ( blockStatement )* 3477 try { dbg.enterSubRule(43); 3478 3479 loop43: 3480 do { 3481 int alt43=2; 3482 try { dbg.enterDecision(43, decisionCanBacktrack[43]); 3483 3484 int LA43_0 = input.LA(1); 3485 3486 if ( ((LA43_0>=IDENTIFIER && LA43_0<=NULL)||(LA43_0>=ABSTRACT && LA43_0<=BYTE)||(LA43_0>=CHAR && LA43_0<=CLASS)||LA43_0==CONTINUE||(LA43_0>=DO && LA43_0<=DOUBLE)||LA43_0==ENUM||LA43_0==FINAL||(LA43_0>=FLOAT && LA43_0<=FOR)||LA43_0==IF||(LA43_0>=INT && LA43_0<=NEW)||(LA43_0>=PRIVATE && LA43_0<=THROW)||(LA43_0>=TRANSIENT && LA43_0<=LPAREN)||LA43_0==LBRACE||LA43_0==SEMI||(LA43_0>=BANG && LA43_0<=TILDE)||(LA43_0>=PLUSPLUS && LA43_0<=SUB)||LA43_0==MONKEYS_AT||LA43_0==LT) ) { 3487 alt43=1; 3488 } 3489 3490 3491 } finally {dbg.exitDecision(43);} 3492 3493 switch (alt43) { 3494 case 1 : 3495 dbg.enterAlt(1); 3496 3497 // src/com/google/doclava/parser/Java.g:523:10: blockStatement 3498 { 3499 dbg.location(523,10); 3500 pushFollow(FOLLOW_blockStatement_in_methodDeclaration1800); 3501 blockStatement(); 3502 3503 state._fsp--; 3504 if (state.failed) return ; 3505 3506 } 3507 break; 3508 3509 default : 3510 break loop43; 3511 } 3512 } while (true); 3513 } finally {dbg.exitSubRule(43);} 3514 3515 dbg.location(525,9); 3516 match(input,RBRACE,FOLLOW_RBRACE_in_methodDeclaration1821); if (state.failed) return ; 3517 3518 } 3519 break; 3520 case 2 : 3521 dbg.enterAlt(2); 3522 3523 // src/com/google/doclava/parser/Java.g:526:9: modifiers ( typeParameters )? ( type | 'void' ) IDENTIFIER formalParameters ( '[' ']' )* ( 'throws' qualifiedNameList )? ( block | ';' ) 3524 { 3525 dbg.location(526,9); 3526 pushFollow(FOLLOW_modifiers_in_methodDeclaration1831); 3527 modifiers(); 3528 3529 state._fsp--; 3530 if (state.failed) return ; 3531 dbg.location(527,9); 3532 // src/com/google/doclava/parser/Java.g:527:9: ( typeParameters )? 3533 int alt44=2; 3534 try { dbg.enterSubRule(44); 3535 try { dbg.enterDecision(44, decisionCanBacktrack[44]); 3536 3537 int LA44_0 = input.LA(1); 3538 3539 if ( (LA44_0==LT) ) { 3540 alt44=1; 3541 } 3542 } finally {dbg.exitDecision(44);} 3543 3544 switch (alt44) { 3545 case 1 : 3546 dbg.enterAlt(1); 3547 3548 // src/com/google/doclava/parser/Java.g:527:10: typeParameters 3549 { 3550 dbg.location(527,10); 3551 pushFollow(FOLLOW_typeParameters_in_methodDeclaration1842); 3552 typeParameters(); 3553 3554 state._fsp--; 3555 if (state.failed) return ; 3556 3557 } 3558 break; 3559 3560 } 3561 } finally {dbg.exitSubRule(44);} 3562 3563 dbg.location(529,9); 3564 // src/com/google/doclava/parser/Java.g:529:9: ( type | 'void' ) 3565 int alt45=2; 3566 try { dbg.enterSubRule(45); 3567 try { dbg.enterDecision(45, decisionCanBacktrack[45]); 3568 3569 int LA45_0 = input.LA(1); 3570 3571 if ( (LA45_0==IDENTIFIER||LA45_0==BOOLEAN||LA45_0==BYTE||LA45_0==CHAR||LA45_0==DOUBLE||LA45_0==FLOAT||LA45_0==INT||LA45_0==LONG||LA45_0==SHORT) ) { 3572 alt45=1; 3573 } 3574 else if ( (LA45_0==VOID) ) { 3575 alt45=2; 3576 } 3577 else { 3578 if (state.backtracking>0) {state.failed=true; return ;} 3579 NoViableAltException nvae = 3580 new NoViableAltException("", 45, 0, input); 3581 3582 dbg.recognitionException(nvae); 3583 throw nvae; 3584 } 3585 } finally {dbg.exitDecision(45);} 3586 3587 switch (alt45) { 3588 case 1 : 3589 dbg.enterAlt(1); 3590 3591 // src/com/google/doclava/parser/Java.g:529:10: type 3592 { 3593 dbg.location(529,10); 3594 pushFollow(FOLLOW_type_in_methodDeclaration1864); 3595 type(); 3596 3597 state._fsp--; 3598 if (state.failed) return ; 3599 3600 } 3601 break; 3602 case 2 : 3603 dbg.enterAlt(2); 3604 3605 // src/com/google/doclava/parser/Java.g:530:13: 'void' 3606 { 3607 dbg.location(530,13); 3608 match(input,VOID,FOLLOW_VOID_in_methodDeclaration1878); if (state.failed) return ; 3609 3610 } 3611 break; 3612 3613 } 3614 } finally {dbg.exitSubRule(45);} 3615 3616 dbg.location(532,9); 3617 match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_methodDeclaration1898); if (state.failed) return ; 3618 dbg.location(533,9); 3619 pushFollow(FOLLOW_formalParameters_in_methodDeclaration1908); 3620 formalParameters(); 3621 3622 state._fsp--; 3623 if (state.failed) return ; 3624 dbg.location(534,9); 3625 // src/com/google/doclava/parser/Java.g:534:9: ( '[' ']' )* 3626 try { dbg.enterSubRule(46); 3627 3628 loop46: 3629 do { 3630 int alt46=2; 3631 try { dbg.enterDecision(46, decisionCanBacktrack[46]); 3632 3633 int LA46_0 = input.LA(1); 3634 3635 if ( (LA46_0==LBRACKET) ) { 3636 alt46=1; 3637 } 3638 3639 3640 } finally {dbg.exitDecision(46);} 3641 3642 switch (alt46) { 3643 case 1 : 3644 dbg.enterAlt(1); 3645 3646 // src/com/google/doclava/parser/Java.g:534:10: '[' ']' 3647 { 3648 dbg.location(534,10); 3649 match(input,LBRACKET,FOLLOW_LBRACKET_in_methodDeclaration1919); if (state.failed) return ; 3650 dbg.location(534,14); 3651 match(input,RBRACKET,FOLLOW_RBRACKET_in_methodDeclaration1921); if (state.failed) return ; 3652 3653 } 3654 break; 3655 3656 default : 3657 break loop46; 3658 } 3659 } while (true); 3660 } finally {dbg.exitSubRule(46);} 3661 3662 dbg.location(536,9); 3663 // src/com/google/doclava/parser/Java.g:536:9: ( 'throws' qualifiedNameList )? 3664 int alt47=2; 3665 try { dbg.enterSubRule(47); 3666 try { dbg.enterDecision(47, decisionCanBacktrack[47]); 3667 3668 int LA47_0 = input.LA(1); 3669 3670 if ( (LA47_0==THROWS) ) { 3671 alt47=1; 3672 } 3673 } finally {dbg.exitDecision(47);} 3674 3675 switch (alt47) { 3676 case 1 : 3677 dbg.enterAlt(1); 3678 3679 // src/com/google/doclava/parser/Java.g:536:10: 'throws' qualifiedNameList 3680 { 3681 dbg.location(536,10); 3682 match(input,THROWS,FOLLOW_THROWS_in_methodDeclaration1943); if (state.failed) return ; 3683 dbg.location(536,19); 3684 pushFollow(FOLLOW_qualifiedNameList_in_methodDeclaration1945); 3685 qualifiedNameList(); 3686 3687 state._fsp--; 3688 if (state.failed) return ; 3689 3690 } 3691 break; 3692 3693 } 3694 } finally {dbg.exitSubRule(47);} 3695 3696 dbg.location(538,9); 3697 // src/com/google/doclava/parser/Java.g:538:9: ( block | ';' ) 3698 int alt48=2; 3699 try { dbg.enterSubRule(48); 3700 try { dbg.enterDecision(48, decisionCanBacktrack[48]); 3701 3702 int LA48_0 = input.LA(1); 3703 3704 if ( (LA48_0==LBRACE) ) { 3705 alt48=1; 3706 } 3707 else if ( (LA48_0==SEMI) ) { 3708 alt48=2; 3709 } 3710 else { 3711 if (state.backtracking>0) {state.failed=true; return ;} 3712 NoViableAltException nvae = 3713 new NoViableAltException("", 48, 0, input); 3714 3715 dbg.recognitionException(nvae); 3716 throw nvae; 3717 } 3718 } finally {dbg.exitDecision(48);} 3719 3720 switch (alt48) { 3721 case 1 : 3722 dbg.enterAlt(1); 3723 3724 // src/com/google/doclava/parser/Java.g:539:13: block 3725 { 3726 dbg.location(539,13); 3727 pushFollow(FOLLOW_block_in_methodDeclaration1980); 3728 block(); 3729 3730 state._fsp--; 3731 if (state.failed) return ; 3732 3733 } 3734 break; 3735 case 2 : 3736 dbg.enterAlt(2); 3737 3738 // src/com/google/doclava/parser/Java.g:540:13: ';' 3739 { 3740 dbg.location(540,13); 3741 match(input,SEMI,FOLLOW_SEMI_in_methodDeclaration1994); if (state.failed) return ; 3742 3743 } 3744 break; 3745 3746 } 3747 } finally {dbg.exitSubRule(48);} 3748 3749 3750 } 3751 break; 3752 3753 } 3754 } 3755 catch (RecognitionException re) { 3756 reportError(re); 3757 recover(input,re); 3758 } 3759 finally { 3760 if ( state.backtracking>0 ) { memoize(input, 26, methodDeclaration_StartIndex); } 3761 } 3762 dbg.location(542, 5); 3763 3764 } 3765 finally { 3766 dbg.exitRule(getGrammarFileName(), "methodDeclaration"); 3767 decRuleLevel(); 3768 if ( getRuleLevel()==0 ) {dbg.terminate();} 3769 } 3770 3771 return ; 3772 } 3773 // $ANTLR end "methodDeclaration" 3774 3775 3776 // $ANTLR start "fieldDeclaration" 3777 // src/com/google/doclava/parser/Java.g:545:1: fieldDeclaration : modifiers type variableDeclarator ( ',' variableDeclarator )* ';' ; 3778 public final void fieldDeclaration() throws RecognitionException { 3779 int fieldDeclaration_StartIndex = input.index(); 3780 try { dbg.enterRule(getGrammarFileName(), "fieldDeclaration"); 3781 if ( getRuleLevel()==0 ) {dbg.commence();} 3782 incRuleLevel(); 3783 dbg.location(545, 1); 3784 3785 try { 3786 if ( state.backtracking>0 && alreadyParsedRule(input, 27) ) { return ; } 3787 // src/com/google/doclava/parser/Java.g:546:5: ( modifiers type variableDeclarator ( ',' variableDeclarator )* ';' ) 3788 dbg.enterAlt(1); 3789 3790 // src/com/google/doclava/parser/Java.g:546:9: modifiers type variableDeclarator ( ',' variableDeclarator )* ';' 3791 { 3792 dbg.location(546,9); 3793 pushFollow(FOLLOW_modifiers_in_fieldDeclaration2024); 3794 modifiers(); 3795 3796 state._fsp--; 3797 if (state.failed) return ; 3798 dbg.location(547,9); 3799 pushFollow(FOLLOW_type_in_fieldDeclaration2034); 3800 type(); 3801 3802 state._fsp--; 3803 if (state.failed) return ; 3804 dbg.location(548,9); 3805 pushFollow(FOLLOW_variableDeclarator_in_fieldDeclaration2044); 3806 variableDeclarator(); 3807 3808 state._fsp--; 3809 if (state.failed) return ; 3810 dbg.location(549,9); 3811 // src/com/google/doclava/parser/Java.g:549:9: ( ',' variableDeclarator )* 3812 try { dbg.enterSubRule(50); 3813 3814 loop50: 3815 do { 3816 int alt50=2; 3817 try { dbg.enterDecision(50, decisionCanBacktrack[50]); 3818 3819 int LA50_0 = input.LA(1); 3820 3821 if ( (LA50_0==COMMA) ) { 3822 alt50=1; 3823 } 3824 3825 3826 } finally {dbg.exitDecision(50);} 3827 3828 switch (alt50) { 3829 case 1 : 3830 dbg.enterAlt(1); 3831 3832 // src/com/google/doclava/parser/Java.g:549:10: ',' variableDeclarator 3833 { 3834 dbg.location(549,10); 3835 match(input,COMMA,FOLLOW_COMMA_in_fieldDeclaration2055); if (state.failed) return ; 3836 dbg.location(549,14); 3837 pushFollow(FOLLOW_variableDeclarator_in_fieldDeclaration2057); 3838 variableDeclarator(); 3839 3840 state._fsp--; 3841 if (state.failed) return ; 3842 3843 } 3844 break; 3845 3846 default : 3847 break loop50; 3848 } 3849 } while (true); 3850 } finally {dbg.exitSubRule(50);} 3851 3852 dbg.location(551,9); 3853 match(input,SEMI,FOLLOW_SEMI_in_fieldDeclaration2078); if (state.failed) return ; 3854 3855 } 3856 3857 } 3858 catch (RecognitionException re) { 3859 reportError(re); 3860 recover(input,re); 3861 } 3862 finally { 3863 if ( state.backtracking>0 ) { memoize(input, 27, fieldDeclaration_StartIndex); } 3864 } 3865 dbg.location(552, 5); 3866 3867 } 3868 finally { 3869 dbg.exitRule(getGrammarFileName(), "fieldDeclaration"); 3870 decRuleLevel(); 3871 if ( getRuleLevel()==0 ) {dbg.terminate();} 3872 } 3873 3874 return ; 3875 } 3876 // $ANTLR end "fieldDeclaration" 3877 3878 3879 // $ANTLR start "variableDeclarator" 3880 // src/com/google/doclava/parser/Java.g:554:1: variableDeclarator : IDENTIFIER ( '[' ']' )* ( '=' variableInitializer )? ; 3881 public final void variableDeclarator() throws RecognitionException { 3882 int variableDeclarator_StartIndex = input.index(); 3883 try { dbg.enterRule(getGrammarFileName(), "variableDeclarator"); 3884 if ( getRuleLevel()==0 ) {dbg.commence();} 3885 incRuleLevel(); 3886 dbg.location(554