Stephan Herrmann | 7b7062f | 2010-04-01 19:56:59 +0000 | [diff] [blame] | 1 | --main options |
| 2 | %options ACTION, AN=JavaAction.java, GP=java, |
| 3 | %options FILE-PREFIX=java, ESCAPE=$, PREFIX=TokenName, OUTPUT-SIZE=125 , |
| 4 | %options NOGOTO-DEFAULT, SINGLE-PRODUCTIONS, LALR=1 , TABLE, |
| 5 | |
| 6 | --error recovering options..... |
| 7 | %options ERROR_MAPS |
| 8 | |
| 9 | --grammar understanding options |
| 10 | %options first follow |
| 11 | %options TRACE=FULL , |
| 12 | %options VERBOSE |
| 13 | |
| 14 | %options DEFERRED |
| 15 | %options NAMES=MAX |
| 16 | %options SCOPES |
| 17 | |
| 18 | --Usefull macros helping reading/writing semantic actions |
| 19 | $Define |
| 20 | $putCase |
| 21 | /. case $rule_number : // System.out.println("$rule_text"); //$NON-NLS-1$ |
| 22 | ./ |
| 23 | |
| 24 | $break |
| 25 | /. |
| 26 | break ; |
| 27 | ./ |
| 28 | |
| 29 | $readableName |
| 30 | /.$rule_number=./ |
| 31 | |
| 32 | -- here it starts really ------------------------------------------ |
| 33 | $Terminals |
| 34 | |
| 35 | Identifier |
| 36 | |
| 37 | abstract assert boolean break byte case catch char class |
| 38 | continue default do double else extends false final finally float |
| 39 | for if implements import instanceof int |
| 40 | interface long native new null package private |
| 41 | protected public return short static strictfp super switch |
| 42 | synchronized this throw throws transient true try void |
| 43 | volatile while |
| 44 | |
| 45 | IntegerLiteral |
| 46 | LongLiteral |
| 47 | FloatingPointLiteral |
| 48 | DoubleLiteral |
| 49 | CharacterLiteral |
| 50 | StringLiteral |
| 51 | |
| 52 | PLUS_PLUS |
| 53 | MINUS_MINUS |
| 54 | EQUAL_EQUAL |
| 55 | LESS_EQUAL |
| 56 | GREATER_EQUAL |
| 57 | NOT_EQUAL |
| 58 | LEFT_SHIFT |
| 59 | RIGHT_SHIFT |
| 60 | UNSIGNED_RIGHT_SHIFT |
| 61 | PLUS_EQUAL |
| 62 | MINUS_EQUAL |
| 63 | MULTIPLY_EQUAL |
| 64 | DIVIDE_EQUAL |
| 65 | AND_EQUAL |
| 66 | OR_EQUAL |
| 67 | XOR_EQUAL |
| 68 | REMAINDER_EQUAL |
| 69 | LEFT_SHIFT_EQUAL |
| 70 | RIGHT_SHIFT_EQUAL |
| 71 | UNSIGNED_RIGHT_SHIFT_EQUAL |
| 72 | OR_OR |
| 73 | AND_AND |
| 74 | PLUS |
| 75 | MINUS |
| 76 | NOT |
| 77 | REMAINDER |
| 78 | XOR |
| 79 | AND |
| 80 | MULTIPLY |
| 81 | OR |
| 82 | TWIDDLE |
| 83 | DIVIDE |
| 84 | GREATER |
| 85 | LESS |
| 86 | LPAREN |
| 87 | RPAREN |
| 88 | LBRACE |
| 89 | RBRACE |
| 90 | LBRACKET |
| 91 | RBRACKET |
| 92 | SEMICOLON |
| 93 | QUESTION |
| 94 | COLON |
| 95 | COMMA |
| 96 | DOT |
| 97 | EQUAL |
| 98 | |
| 99 | -- BodyMarker |
| 100 | |
| 101 | $Alias |
| 102 | |
| 103 | '++' ::= PLUS_PLUS |
| 104 | '--' ::= MINUS_MINUS |
| 105 | '==' ::= EQUAL_EQUAL |
| 106 | '<=' ::= LESS_EQUAL |
| 107 | '>=' ::= GREATER_EQUAL |
| 108 | '!=' ::= NOT_EQUAL |
| 109 | '<<' ::= LEFT_SHIFT |
| 110 | '>>' ::= RIGHT_SHIFT |
| 111 | '>>>' ::= UNSIGNED_RIGHT_SHIFT |
| 112 | '+=' ::= PLUS_EQUAL |
| 113 | '-=' ::= MINUS_EQUAL |
| 114 | '*=' ::= MULTIPLY_EQUAL |
| 115 | '/=' ::= DIVIDE_EQUAL |
| 116 | '&=' ::= AND_EQUAL |
| 117 | '|=' ::= OR_EQUAL |
| 118 | '^=' ::= XOR_EQUAL |
| 119 | '%=' ::= REMAINDER_EQUAL |
| 120 | '<<=' ::= LEFT_SHIFT_EQUAL |
| 121 | '>>=' ::= RIGHT_SHIFT_EQUAL |
| 122 | '>>>=' ::= UNSIGNED_RIGHT_SHIFT_EQUAL |
| 123 | '||' ::= OR_OR |
| 124 | '&&' ::= AND_AND |
| 125 | |
| 126 | '+' ::= PLUS |
| 127 | '-' ::= MINUS |
| 128 | '!' ::= NOT |
| 129 | '%' ::= REMAINDER |
| 130 | '^' ::= XOR |
| 131 | '&' ::= AND |
| 132 | '*' ::= MULTIPLY |
| 133 | '|' ::= OR |
| 134 | '~' ::= TWIDDLE |
| 135 | '/' ::= DIVIDE |
| 136 | '>' ::= GREATER |
| 137 | '<' ::= LESS |
| 138 | '(' ::= LPAREN |
| 139 | ')' ::= RPAREN |
| 140 | '{' ::= LBRACE |
| 141 | '}' ::= RBRACE |
| 142 | '[' ::= LBRACKET |
| 143 | ']' ::= RBRACKET |
| 144 | ';' ::= SEMICOLON |
| 145 | '?' ::= QUESTION |
| 146 | ':' ::= COLON |
| 147 | ',' ::= COMMA |
| 148 | '.' ::= DOT |
| 149 | '=' ::= EQUAL |
| 150 | |
| 151 | $Start |
| 152 | Goal |
| 153 | |
| 154 | $Rules |
| 155 | |
| 156 | /. // This method is part of an automatic generation : do NOT edit-modify |
| 157 | protected void consumeRule(int act) { |
| 158 | switch ( act ) { |
| 159 | ./ |
| 160 | |
| 161 | |
| 162 | |
| 163 | Goal ::= '++' CompilationUnit |
| 164 | Goal ::= '--' MethodBody |
| 165 | -- Initializer |
| 166 | Goal ::= '>>' StaticInitializer |
| 167 | Goal ::= '>>' Initializer |
| 168 | -- error recovery |
| 169 | Goal ::= '>>>' Headers |
| 170 | Goal ::= '*' BlockStatements |
| 171 | Goal ::= '*' CatchHeader |
| 172 | -- JDOM |
| 173 | Goal ::= '&&' FieldDeclaration |
| 174 | Goal ::= '||' ImportDeclaration |
| 175 | Goal ::= '?' PackageDeclaration |
| 176 | Goal ::= '+' TypeDeclaration |
| 177 | Goal ::= '/' GenericMethodDeclaration |
| 178 | Goal ::= '&' ClassBodyDeclarations |
| 179 | -- code snippet |
| 180 | Goal ::= '%' Expression |
| 181 | -- completion parser |
| 182 | Goal ::= '~' BlockStatementsopt |
| 183 | /:$readableName Goal:/ |
| 184 | |
| 185 | Literal -> IntegerLiteral |
| 186 | Literal -> LongLiteral |
| 187 | Literal -> FloatingPointLiteral |
| 188 | Literal -> DoubleLiteral |
| 189 | Literal -> CharacterLiteral |
| 190 | Literal -> StringLiteral |
| 191 | Literal -> null |
| 192 | Literal -> BooleanLiteral |
| 193 | /:$readableName Literal:/ |
| 194 | BooleanLiteral -> true |
| 195 | BooleanLiteral -> false |
| 196 | /:$readableName BooleanLiteral:/ |
| 197 | |
| 198 | ------------------------------------------------------------- |
| 199 | ------------------------------------------------------------- |
| 200 | --a Type results in both a push of its dimension(s) and its name(s). |
| 201 | |
| 202 | Type ::= PrimitiveType |
| 203 | /.$putCase consumePrimitiveType(); $break ./ |
| 204 | Type -> ReferenceType |
| 205 | /:$readableName Type:/ |
| 206 | |
| 207 | PrimitiveType -> NumericType |
| 208 | /:$readableName PrimitiveType:/ |
| 209 | NumericType -> IntegralType |
| 210 | NumericType -> FloatingPointType |
| 211 | /:$readableName NumericType:/ |
| 212 | |
| 213 | PrimitiveType -> 'boolean' |
| 214 | PrimitiveType -> 'void' |
| 215 | IntegralType -> 'byte' |
| 216 | IntegralType -> 'short' |
| 217 | IntegralType -> 'int' |
| 218 | IntegralType -> 'long' |
| 219 | IntegralType -> 'char' |
| 220 | /:$readableName IntegralType:/ |
| 221 | FloatingPointType -> 'float' |
| 222 | FloatingPointType -> 'double' |
| 223 | /:$readableName FloatingPointType:/ |
| 224 | |
| 225 | ReferenceType ::= ClassOrInterfaceType |
| 226 | /.$putCase consumeReferenceType(); $break ./ |
| 227 | ReferenceType -> ArrayType -- here a push of dimensions is done, that explains the two previous push 0 |
| 228 | /:$readableName ReferenceType:/ |
| 229 | ClassOrInterfaceType -> Name |
| 230 | /:$readableName Type:/ |
| 231 | |
| 232 | -- |
| 233 | -- These rules have been rewritten to avoid some conflicts introduced |
| 234 | -- by adding the 1.1 features |
| 235 | -- |
| 236 | -- ArrayType ::= PrimitiveType '[' ']' |
| 237 | -- ArrayType ::= Name '[' ']' |
| 238 | -- ArrayType ::= ArrayType '[' ']' |
| 239 | -- |
| 240 | |
| 241 | ArrayType ::= PrimitiveType Dims |
| 242 | ArrayType ::= Name Dims |
| 243 | /:$readableName ArrayType:/ |
| 244 | |
| 245 | ClassType -> ClassOrInterfaceType |
| 246 | /:$readableName ClassType:/ |
| 247 | |
| 248 | -------------------------------------------------------------- |
| 249 | -------------------------------------------------------------- |
| 250 | |
| 251 | Name -> SimpleName |
| 252 | Name -> QualifiedName |
| 253 | /:$readableName Name:/ |
| 254 | |
| 255 | SimpleName -> 'Identifier' |
| 256 | /:$readableName SimpleName:/ |
| 257 | |
| 258 | QualifiedName ::= Name '.' SimpleName |
| 259 | /.$putCase consumeQualifiedName(); $break ./ |
| 260 | /:$readableName QualifiedName:/ |
| 261 | |
| 262 | CompilationUnit ::= EnterCompilationUnit PackageDeclarationopt ImportDeclarationsopt TypeDeclarationsopt |
| 263 | /.$putCase consumeCompilationUnit(); $break ./ |
| 264 | /:$readableName CompilationUnit:/ |
| 265 | |
| 266 | EnterCompilationUnit ::= $empty |
| 267 | /.$putCase consumeEnterCompilationUnit(); $break ./ |
| 268 | /:$readableName EnterCompilationUnit:/ |
| 269 | |
| 270 | Headers -> Header |
| 271 | Headers ::= Headers Header |
| 272 | /:$readableName Headers:/ |
| 273 | |
| 274 | Header -> ImportDeclaration |
| 275 | Header -> PackageDeclaration |
| 276 | Header -> ClassHeader |
| 277 | Header -> InterfaceHeader |
| 278 | Header -> StaticInitializer |
| 279 | Header -> MethodHeader |
| 280 | Header -> ConstructorHeader |
| 281 | Header -> FieldDeclaration |
| 282 | Header -> AllocationHeader |
| 283 | Header -> ArrayCreationHeader |
| 284 | /:$readableName Header:/ |
| 285 | |
| 286 | CatchHeader ::= 'catch' '(' FormalParameter ')' '{' |
| 287 | /.$putCase consumeCatchHeader(); $break ./ |
| 288 | /:$readableName CatchHeader:/ |
| 289 | |
| 290 | ImportDeclarations -> ImportDeclaration |
| 291 | ImportDeclarations ::= ImportDeclarations ImportDeclaration |
| 292 | /.$putCase consumeImportDeclarations(); $break ./ |
| 293 | /:$readableName ImportDeclarations:/ |
| 294 | |
| 295 | TypeDeclarations -> TypeDeclaration |
| 296 | TypeDeclarations ::= TypeDeclarations TypeDeclaration |
| 297 | /.$putCase consumeTypeDeclarations(); $break ./ |
| 298 | /:$readableName TypeDeclarations:/ |
| 299 | |
| 300 | PackageDeclaration ::= PackageDeclarationName ';' |
| 301 | /.$putCase consumePackageDeclaration(); $break ./ |
| 302 | /:$readableName PackageDeclaration:/ |
| 303 | |
| 304 | PackageDeclarationName ::= 'package' Name |
| 305 | /.$putCase consumePackageDeclarationName(); $break ./ |
| 306 | /:$readableName PackageDeclarationName:/ |
| 307 | |
| 308 | ImportDeclaration -> SingleTypeImportDeclaration |
| 309 | ImportDeclaration -> TypeImportOnDemandDeclaration |
| 310 | /:$readableName ImportDeclaration:/ |
| 311 | |
| 312 | SingleTypeImportDeclaration ::= SingleTypeImportDeclarationName ';' |
| 313 | /.$putCase consumeSingleTypeImportDeclaration(); $break ./ |
| 314 | /:$readableName SingleTypeImportDeclaration:/ |
| 315 | |
| 316 | SingleTypeImportDeclarationName ::= 'import' Name |
| 317 | /.$putCase consumeSingleTypeImportDeclarationName(); $break ./ |
| 318 | /:$readableName SingleTypeImportDeclarationName:/ |
| 319 | |
| 320 | TypeImportOnDemandDeclaration ::= TypeImportOnDemandDeclarationName ';' |
| 321 | /.$putCase consumeTypeImportOnDemandDeclaration(); $break ./ |
| 322 | /:$readableName TypeImportOnDemandDeclaration:/ |
| 323 | |
| 324 | TypeImportOnDemandDeclarationName ::= 'import' Name '.' '*' |
| 325 | /.$putCase consumeTypeImportOnDemandDeclarationName(); $break ./ |
| 326 | /:$readableName TypeImportOnDemandDeclarationName:/ |
| 327 | |
| 328 | TypeDeclaration -> ClassDeclaration |
| 329 | TypeDeclaration -> InterfaceDeclaration |
| 330 | -- this declaration in part of a list od declaration and we will |
| 331 | -- use and optimized list length calculation process |
| 332 | -- thus we decrement the number while it will be incremend..... |
| 333 | TypeDeclaration ::= ';' |
| 334 | /. $putCase consumeEmptyTypeDeclaration(); $break ./ |
| 335 | /:$readableName TypeDeclaration:/ |
| 336 | |
| 337 | --18.7 Only in the LALR(1) Grammar |
| 338 | |
| 339 | Modifiers ::= Modifier |
| 340 | Modifiers ::= Modifiers Modifier |
| 341 | /:$readableName Modifiers:/ |
| 342 | |
| 343 | Modifier -> 'public' |
| 344 | Modifier -> 'protected' |
| 345 | Modifier -> 'private' |
| 346 | Modifier -> 'static' |
| 347 | Modifier -> 'abstract' |
| 348 | Modifier -> 'final' |
| 349 | Modifier -> 'native' |
| 350 | Modifier -> 'synchronized' |
| 351 | Modifier -> 'transient' |
| 352 | Modifier -> 'volatile' |
| 353 | Modifier -> 'strictfp' |
| 354 | /:$readableName Modifier:/ |
| 355 | |
| 356 | --18.8 Productions from 8: Class Declarations |
| 357 | --ClassModifier ::= |
| 358 | -- 'abstract' |
| 359 | -- | 'final' |
| 360 | -- | 'public' |
| 361 | --18.8.1 Productions from 8.1: Class Declarations |
| 362 | |
| 363 | ClassDeclaration ::= ClassHeader ClassBody |
| 364 | /.$putCase consumeClassDeclaration(); $break ./ |
| 365 | /:$readableName ClassDeclaration:/ |
| 366 | |
| 367 | ClassHeader ::= ClassHeaderName ClassHeaderExtendsopt ClassHeaderImplementsopt |
| 368 | /.$putCase consumeClassHeader(); $break ./ |
| 369 | /:$readableName ClassHeader:/ |
| 370 | |
| 371 | ClassHeaderName ::= Modifiersopt 'class' 'Identifier' |
| 372 | /.$putCase consumeClassHeaderName(); $break ./ |
| 373 | /:$readableName ClassHeaderName:/ |
| 374 | |
| 375 | ClassHeaderExtends ::= 'extends' ClassType |
| 376 | /.$putCase consumeClassHeaderExtends(); $break ./ |
| 377 | /:$readableName ClassHeaderExtends:/ |
| 378 | |
| 379 | ClassHeaderImplements ::= 'implements' InterfaceTypeList |
| 380 | /.$putCase consumeClassHeaderImplements(); $break ./ |
| 381 | /:$readableName ClassHeaderImplements:/ |
| 382 | |
| 383 | InterfaceTypeList -> InterfaceType |
| 384 | InterfaceTypeList ::= InterfaceTypeList ',' InterfaceType |
| 385 | /.$putCase consumeInterfaceTypeList(); $break ./ |
| 386 | /:$readableName InterfaceTypeList:/ |
| 387 | |
| 388 | InterfaceType ::= ClassOrInterfaceType |
| 389 | /.$putCase consumeInterfaceType(); $break ./ |
| 390 | /:$readableName InterfaceType:/ |
| 391 | |
| 392 | ClassBody ::= '{' ClassBodyDeclarationsopt '}' |
| 393 | /:$readableName ClassBody:/ |
| 394 | |
| 395 | ClassBodyDeclarations ::= ClassBodyDeclaration |
| 396 | ClassBodyDeclarations ::= ClassBodyDeclarations ClassBodyDeclaration |
| 397 | /.$putCase consumeClassBodyDeclarations(); $break ./ |
| 398 | /:$readableName ClassBodyDeclarations:/ |
| 399 | |
| 400 | ClassBodyDeclaration -> ClassMemberDeclaration |
| 401 | ClassBodyDeclaration -> StaticInitializer |
| 402 | ClassBodyDeclaration -> ConstructorDeclaration |
| 403 | --1.1 feature |
| 404 | ClassBodyDeclaration ::= Diet NestedMethod Block |
| 405 | /.$putCase consumeClassBodyDeclaration(); $break ./ |
| 406 | /:$readableName ClassBodyDeclaration:/ |
| 407 | Diet ::= $empty |
| 408 | /.$putCase consumeDiet(); $break./ |
| 409 | /:$readableName Diet:/ |
| 410 | |
| 411 | Initializer ::= Diet NestedMethod Block |
| 412 | /.$putCase consumeClassBodyDeclaration(); $break ./ |
| 413 | /:$readableName Initializer:/ |
| 414 | |
| 415 | ClassMemberDeclaration -> FieldDeclaration |
| 416 | ClassMemberDeclaration -> MethodDeclaration |
| 417 | --1.1 feature |
| 418 | ClassMemberDeclaration -> ClassDeclaration |
| 419 | --1.1 feature |
| 420 | ClassMemberDeclaration -> InterfaceDeclaration |
| 421 | /:$readableName ClassMemberDeclaration:/ |
| 422 | |
| 423 | -- Empty declarations are not valid Java ClassMemberDeclarations. |
| 424 | -- However, since the current (2/14/97) Java compiler accepts them |
| 425 | -- (in fact, some of the official tests contain this erroneous |
| 426 | -- syntax) |
| 427 | |
| 428 | GenericMethodDeclaration -> MethodDeclaration |
| 429 | GenericMethodDeclaration -> ConstructorDeclaration |
| 430 | /:$readableName GenericMethodDeclaration:/ |
| 431 | |
| 432 | ClassMemberDeclaration ::= ';' |
| 433 | /.$putCase consumeEmptyClassMemberDeclaration(); $break./ |
| 434 | |
| 435 | --18.8.2 Productions from 8.3: Field Declarations |
| 436 | --VariableModifier ::= |
| 437 | -- 'public' |
| 438 | -- | 'protected' |
| 439 | -- | 'private' |
| 440 | -- | 'static' |
| 441 | -- | 'final' |
| 442 | -- | 'transient' |
| 443 | -- | 'volatile' |
| 444 | |
| 445 | FieldDeclaration ::= Modifiersopt Type VariableDeclarators ';' |
| 446 | /.$putCase consumeFieldDeclaration(); $break ./ |
| 447 | /:$readableName FieldDeclaration:/ |
| 448 | |
| 449 | VariableDeclarators -> VariableDeclarator |
| 450 | VariableDeclarators ::= VariableDeclarators ',' VariableDeclarator |
| 451 | /.$putCase consumeVariableDeclarators(); $break ./ |
| 452 | /:$readableName VariableDeclarators:/ |
| 453 | |
| 454 | VariableDeclarator ::= VariableDeclaratorId EnterVariable ExitVariableWithoutInitialization |
| 455 | |
| 456 | VariableDeclarator ::= VariableDeclaratorId EnterVariable '=' ForceNoDiet VariableInitializer RestoreDiet ExitVariableWithInitialization |
| 457 | /:$readableName VariableDeclarator:/ |
| 458 | |
| 459 | EnterVariable ::= $empty |
| 460 | /.$putCase consumeEnterVariable(); $break ./ |
| 461 | /:$readableName EnterVariable:/ |
| 462 | |
| 463 | ExitVariableWithInitialization ::= $empty |
| 464 | /.$putCase consumeExitVariableWithInitialization(); $break ./ |
| 465 | /:$readableName ExitVariableWithInitialization:/ |
| 466 | |
| 467 | ExitVariableWithoutInitialization ::= $empty |
| 468 | /.$putCase consumeExitVariableWithoutInitialization(); $break ./ |
| 469 | /:$readableName ExitVariableWithoutInitialization:/ |
| 470 | |
| 471 | ForceNoDiet ::= $empty |
| 472 | /.$putCase consumeForceNoDiet(); $break ./ |
| 473 | /:$readableName ForceNoDiet:/ |
| 474 | RestoreDiet ::= $empty |
| 475 | /.$putCase consumeRestoreDiet(); $break ./ |
| 476 | /:$readableName RestoreDiet:/ |
| 477 | |
| 478 | VariableDeclaratorId ::= 'Identifier' Dimsopt |
| 479 | /:$readableName VariableDeclaratorId:/ |
| 480 | |
| 481 | VariableInitializer -> Expression |
| 482 | VariableInitializer -> ArrayInitializer |
| 483 | /:$readableName VariableInitializer:/ |
| 484 | |
| 485 | --18.8.3 Productions from 8.4: Method Declarations |
| 486 | --MethodModifier ::= |
| 487 | -- 'public' |
| 488 | -- | 'protected' |
| 489 | -- | 'private' |
| 490 | -- | 'static' |
| 491 | -- | 'abstract' |
| 492 | -- | 'final' |
| 493 | -- | 'native' |
| 494 | -- | 'synchronized' |
| 495 | -- |
| 496 | |
| 497 | MethodDeclaration -> AbstractMethodDeclaration |
| 498 | MethodDeclaration ::= MethodHeader MethodBody |
| 499 | /.$putCase // set to true to consume a method with a body |
| 500 | consumeMethodDeclaration(true); $break ./ |
| 501 | /:$readableName MethodDeclaration:/ |
| 502 | |
| 503 | AbstractMethodDeclaration ::= MethodHeader ';' |
| 504 | /.$putCase // set to false to consume a method without body |
| 505 | consumeMethodDeclaration(false); $break ./ |
| 506 | /:$readableName AbstractMethodDeclaration:/ |
| 507 | |
| 508 | MethodHeader ::= MethodHeaderName MethodHeaderParameters MethodHeaderExtendedDims MethodHeaderThrowsClauseopt |
| 509 | /.$putCase consumeMethodHeader(); $break ./ |
| 510 | /:$readableName MethodHeader:/ |
| 511 | |
| 512 | MethodHeaderName ::= Modifiersopt Type 'Identifier' '(' |
| 513 | /.$putCase consumeMethodHeaderName(); $break ./ |
| 514 | /:$readableName MethodHeaderName:/ |
| 515 | |
| 516 | MethodHeaderParameters ::= FormalParameterListopt ')' |
| 517 | /.$putCase consumeMethodHeaderParameters(); $break ./ |
| 518 | /:$readableName MethodHeaderParameters:/ |
| 519 | |
| 520 | MethodHeaderExtendedDims ::= Dimsopt |
| 521 | /.$putCase consumeMethodHeaderExtendedDims(); $break ./ |
| 522 | /:$readableName MethodHeaderExtendedDims:/ |
| 523 | |
| 524 | MethodHeaderThrowsClause ::= 'throws' ClassTypeList |
| 525 | /.$putCase consumeMethodHeaderThrowsClause(); $break ./ |
| 526 | /:$readableName MethodHeaderThrowsClause:/ |
| 527 | |
| 528 | ConstructorHeader ::= ConstructorHeaderName MethodHeaderParameters MethodHeaderThrowsClauseopt |
| 529 | /.$putCase consumeConstructorHeader(); $break ./ |
| 530 | /:$readableName ConstructorHeader:/ |
| 531 | |
| 532 | ConstructorHeaderName ::= Modifiersopt 'Identifier' '(' |
| 533 | /.$putCase consumeConstructorHeaderName(); $break ./ |
| 534 | /:$readableName ConstructorHeaderName:/ |
| 535 | |
| 536 | FormalParameterList -> FormalParameter |
| 537 | FormalParameterList ::= FormalParameterList ',' FormalParameter |
| 538 | /.$putCase consumeFormalParameterList(); $break ./ |
| 539 | /:$readableName FormalParameterList:/ |
| 540 | |
| 541 | --1.1 feature |
| 542 | FormalParameter ::= Modifiersopt Type VariableDeclaratorId |
| 543 | /.$putCase // the boolean is used to know if the modifiers should be reset |
| 544 | consumeFormalParameter(); $break ./ |
| 545 | /:$readableName FormalParameter:/ |
| 546 | |
| 547 | ClassTypeList -> ClassTypeElt |
| 548 | ClassTypeList ::= ClassTypeList ',' ClassTypeElt |
| 549 | /.$putCase consumeClassTypeList(); $break ./ |
| 550 | /:$readableName ClassTypeList:/ |
| 551 | |
| 552 | ClassTypeElt ::= ClassType |
| 553 | /.$putCase consumeClassTypeElt(); $break ./ |
| 554 | /:$readableName ClassType:/ |
| 555 | |
| 556 | MethodBody ::= NestedMethod '{' BlockStatementsopt '}' |
| 557 | /.$putCase consumeMethodBody(); $break ./ |
| 558 | /:$readableName MethodBody:/ |
| 559 | |
| 560 | NestedMethod ::= $empty |
| 561 | /.$putCase consumeNestedMethod(); $break ./ |
| 562 | /:$readableName NestedMethod:/ |
| 563 | |
| 564 | --18.8.4 Productions from 8.5: Static Initializers |
| 565 | |
| 566 | StaticInitializer ::= StaticOnly Block |
| 567 | /.$putCase consumeStaticInitializer(); $break./ |
| 568 | /:$readableName StaticInitializer:/ |
| 569 | |
| 570 | StaticOnly ::= 'static' |
| 571 | /.$putCase consumeStaticOnly(); $break ./ |
| 572 | /:$readableName StaticOnly:/ |
| 573 | |
| 574 | --18.8.5 Productions from 8.6: Constructor Declarations |
| 575 | --ConstructorModifier ::= |
| 576 | -- 'public' |
| 577 | -- | 'protected' |
| 578 | -- | 'private' |
| 579 | -- |
| 580 | -- |
| 581 | ConstructorDeclaration ::= ConstructorHeader MethodBody |
| 582 | /.$putCase consumeConstructorDeclaration() ; $break ./ |
| 583 | |
| 584 | -- These rules are added to be able to parse constructors with no body |
| 585 | ConstructorDeclaration ::= ConstructorHeader ';' |
| 586 | /.$putCase consumeInvalidConstructorDeclaration() ; $break ./ |
| 587 | /:$readableName ConstructorDeclaration:/ |
| 588 | |
| 589 | -- the rules ExplicitConstructorInvocationopt has been expanded |
| 590 | -- in the rule below in order to make the grammar lalr(1). |
| 591 | |
| 592 | ExplicitConstructorInvocation ::= 'this' '(' ArgumentListopt ')' ';' |
| 593 | /.$putCase consumeExplicitConstructorInvocation(0,ExplicitConstructorCall.This); $break ./ |
| 594 | |
| 595 | ExplicitConstructorInvocation ::= 'super' '(' ArgumentListopt ')' ';' |
| 596 | /.$putCase consumeExplicitConstructorInvocation(0,ExplicitConstructorCall.Super); $break ./ |
| 597 | |
| 598 | --1.1 feature |
| 599 | ExplicitConstructorInvocation ::= Primary '.' 'super' '(' ArgumentListopt ')' ';' |
| 600 | /.$putCase consumeExplicitConstructorInvocation(1, ExplicitConstructorCall.Super); $break ./ |
| 601 | |
| 602 | --1.1 feature |
| 603 | ExplicitConstructorInvocation ::= Name '.' 'super' '(' ArgumentListopt ')' ';' |
| 604 | /.$putCase consumeExplicitConstructorInvocation(2, ExplicitConstructorCall.Super); $break ./ |
| 605 | |
| 606 | --1.1 feature |
| 607 | ExplicitConstructorInvocation ::= Primary '.' 'this' '(' ArgumentListopt ')' ';' |
| 608 | /.$putCase consumeExplicitConstructorInvocation(1, ExplicitConstructorCall.This); $break ./ |
| 609 | |
| 610 | --1.1 feature |
| 611 | ExplicitConstructorInvocation ::= Name '.' 'this' '(' ArgumentListopt ')' ';' |
| 612 | /.$putCase consumeExplicitConstructorInvocation(2, ExplicitConstructorCall.This); $break ./ |
| 613 | /:$readableName ExplicitConstructorInvocation:/ |
| 614 | |
| 615 | --18.9 Productions from 9: Interface Declarations |
| 616 | |
| 617 | --18.9.1 Productions from 9.1: Interface Declarations |
| 618 | --InterfaceModifier ::= |
| 619 | -- 'public' |
| 620 | -- | 'abstract' |
| 621 | -- |
| 622 | InterfaceDeclaration ::= InterfaceHeader InterfaceBody |
| 623 | /.$putCase consumeInterfaceDeclaration(); $break ./ |
| 624 | /:$readableName InterfaceDeclaration:/ |
| 625 | |
| 626 | InterfaceHeader ::= InterfaceHeaderName InterfaceHeaderExtendsopt |
| 627 | /.$putCase consumeInterfaceHeader(); $break ./ |
| 628 | /:$readableName InterfaceHeader:/ |
| 629 | |
| 630 | InterfaceHeaderName ::= Modifiersopt 'interface' 'Identifier' |
| 631 | /.$putCase consumeInterfaceHeaderName(); $break ./ |
| 632 | /:$readableName InterfaceHeaderName:/ |
| 633 | |
| 634 | -- This rule will be used to accept inner local interface and then report a relevant error message |
| 635 | InvalidInterfaceDeclaration -> InterfaceHeader InterfaceBody |
| 636 | /:$readableName InvalidInterfaceDeclaration:/ |
| 637 | |
| 638 | InterfaceHeaderExtends ::= 'extends' InterfaceTypeList |
| 639 | /.$putCase consumeInterfaceHeaderExtends(); $break ./ |
| 640 | /:$readableName InterfaceHeaderExtends:/ |
| 641 | |
| 642 | InterfaceBody ::= '{' InterfaceMemberDeclarationsopt '}' |
| 643 | /:$readableName InterfaceBody:/ |
| 644 | |
| 645 | InterfaceMemberDeclarations -> InterfaceMemberDeclaration |
| 646 | InterfaceMemberDeclarations ::= InterfaceMemberDeclarations InterfaceMemberDeclaration |
| 647 | /.$putCase consumeInterfaceMemberDeclarations(); $break ./ |
| 648 | /:$readableName InterfaceMemberDeclarations:/ |
| 649 | |
| 650 | --same as for class members |
| 651 | InterfaceMemberDeclaration ::= ';' |
| 652 | /.$putCase consumeEmptyInterfaceMemberDeclaration(); $break ./ |
| 653 | /:$readableName InterfaceMemberDeclaration:/ |
| 654 | |
| 655 | -- This rule is added to be able to parse non abstract method inside interface and then report a relevent error message |
| 656 | InvalidMethodDeclaration -> MethodHeader MethodBody |
| 657 | /:$readableName InvalidMethodDeclaration:/ |
| 658 | |
| 659 | InterfaceMemberDeclaration -> ConstantDeclaration |
| 660 | InterfaceMemberDeclaration ::= InvalidMethodDeclaration |
| 661 | /.$putCase ignoreMethodBody(); $break ./ |
| 662 | /:$readableName InterfaceMemberDeclaration:/ |
| 663 | |
| 664 | -- These rules are added to be able to parse constructors inside interface and then report a relevent error message |
| 665 | InvalidConstructorDeclaration ::= ConstructorHeader MethodBody |
| 666 | /.$putCase ignoreInvalidConstructorDeclaration(true); $break ./ |
| 667 | |
| 668 | InvalidConstructorDeclaration ::= ConstructorHeader ';' |
| 669 | /.$putCase ignoreInvalidConstructorDeclaration(false); $break ./ |
| 670 | /:$readableName InvalidConstructorDeclaration:/ |
| 671 | |
| 672 | InterfaceMemberDeclaration -> AbstractMethodDeclaration |
| 673 | InterfaceMemberDeclaration -> InvalidConstructorDeclaration |
| 674 | /:$readableName InterfaceMemberDeclaration:/ |
| 675 | |
| 676 | --1.1 feature |
| 677 | InterfaceMemberDeclaration -> ClassDeclaration |
| 678 | --1.1 feature |
| 679 | InterfaceMemberDeclaration -> InterfaceDeclaration |
| 680 | /:$readableName InterfaceMemberDeclaration:/ |
| 681 | |
| 682 | ConstantDeclaration -> FieldDeclaration |
| 683 | /:$readableName ConstantDeclaration:/ |
| 684 | |
| 685 | ArrayInitializer ::= '{' ,opt '}' |
| 686 | /.$putCase consumeEmptyArrayInitializer(); $break ./ |
| 687 | ArrayInitializer ::= '{' VariableInitializers '}' |
| 688 | /.$putCase consumeArrayInitializer(); $break ./ |
| 689 | ArrayInitializer ::= '{' VariableInitializers , '}' |
| 690 | /.$putCase consumeArrayInitializer(); $break ./ |
| 691 | /:$readableName ArrayInitializer:/ |
| 692 | |
| 693 | VariableInitializers ::= VariableInitializer |
| 694 | VariableInitializers ::= VariableInitializers ',' VariableInitializer |
| 695 | /.$putCase consumeVariableInitializers(); $break ./ |
| 696 | /:$readableName VariableInitializers:/ |
| 697 | |
| 698 | Block ::= OpenBlock '{' BlockStatementsopt '}' |
| 699 | /.$putCase consumeBlock(); $break ./ |
| 700 | /:$readableName Block:/ |
| 701 | |
| 702 | OpenBlock ::= $empty |
| 703 | /.$putCase consumeOpenBlock() ; $break ./ |
| 704 | /:$readableName OpenBlock:/ |
| 705 | |
| 706 | BlockStatements -> BlockStatement |
| 707 | BlockStatements ::= BlockStatements BlockStatement |
| 708 | /.$putCase consumeBlockStatements() ; $break ./ |
| 709 | /:$readableName BlockStatements:/ |
| 710 | |
| 711 | BlockStatement -> LocalVariableDeclarationStatement |
| 712 | BlockStatement -> Statement |
| 713 | --1.1 feature |
| 714 | BlockStatement -> ClassDeclaration |
| 715 | BlockStatement ::= InvalidInterfaceDeclaration |
| 716 | /.$putCase ignoreInterfaceDeclaration(); $break ./ |
| 717 | /:$readableName BlockStatement:/ |
| 718 | |
| 719 | LocalVariableDeclarationStatement ::= LocalVariableDeclaration ';' |
| 720 | /.$putCase consumeLocalVariableDeclarationStatement(); $break ./ |
| 721 | /:$readableName LocalVariableDeclarationStatement:/ |
| 722 | |
| 723 | LocalVariableDeclaration ::= Type PushModifiers VariableDeclarators |
| 724 | /.$putCase consumeLocalVariableDeclaration(); $break ./ |
| 725 | |
| 726 | -- 1.1 feature |
| 727 | -- The modifiers part of this rule makes the grammar more permissive. |
| 728 | -- The only modifier here is final. We put Modifiers to allow multiple modifiers |
| 729 | -- This will require to check the validity of the modifier |
| 730 | |
| 731 | LocalVariableDeclaration ::= Modifiers Type PushModifiers VariableDeclarators |
| 732 | /.$putCase consumeLocalVariableDeclaration(); $break ./ |
| 733 | /:$readableName LocalVariableDeclaration:/ |
| 734 | |
| 735 | PushModifiers ::= $empty |
| 736 | /.$putCase consumePushModifiers(); $break ./ |
| 737 | /:$readableName PushModifiers:/ |
| 738 | |
| 739 | Statement -> StatementWithoutTrailingSubstatement |
| 740 | Statement -> LabeledStatement |
| 741 | Statement -> IfThenStatement |
| 742 | Statement -> IfThenElseStatement |
| 743 | Statement -> WhileStatement |
| 744 | Statement -> ForStatement |
| 745 | /:$readableName Statement:/ |
| 746 | |
| 747 | StatementNoShortIf -> StatementWithoutTrailingSubstatement |
| 748 | StatementNoShortIf -> LabeledStatementNoShortIf |
| 749 | StatementNoShortIf -> IfThenElseStatementNoShortIf |
| 750 | StatementNoShortIf -> WhileStatementNoShortIf |
| 751 | StatementNoShortIf -> ForStatementNoShortIf |
| 752 | /:$readableName Statement:/ |
| 753 | |
| 754 | StatementWithoutTrailingSubstatement -> AssertStatement |
| 755 | StatementWithoutTrailingSubstatement -> Block |
| 756 | StatementWithoutTrailingSubstatement -> EmptyStatement |
| 757 | StatementWithoutTrailingSubstatement -> ExpressionStatement |
| 758 | StatementWithoutTrailingSubstatement -> SwitchStatement |
| 759 | StatementWithoutTrailingSubstatement -> DoStatement |
| 760 | StatementWithoutTrailingSubstatement -> BreakStatement |
| 761 | StatementWithoutTrailingSubstatement -> ContinueStatement |
| 762 | StatementWithoutTrailingSubstatement -> ReturnStatement |
| 763 | StatementWithoutTrailingSubstatement -> SynchronizedStatement |
| 764 | StatementWithoutTrailingSubstatement -> ThrowStatement |
| 765 | StatementWithoutTrailingSubstatement -> TryStatement |
| 766 | /:$readableName Statement:/ |
| 767 | |
| 768 | EmptyStatement ::= ';' |
| 769 | /.$putCase consumeEmptyStatement(); $break ./ |
| 770 | /:$readableName EmptyStatement:/ |
| 771 | |
| 772 | LabeledStatement ::= 'Identifier' ':' Statement |
| 773 | /.$putCase consumeStatementLabel() ; $break ./ |
| 774 | /:$readableName LabeledStatement:/ |
| 775 | |
| 776 | LabeledStatementNoShortIf ::= 'Identifier' ':' StatementNoShortIf |
| 777 | /.$putCase consumeStatementLabel() ; $break ./ |
| 778 | /:$readableName LabeledStatement:/ |
| 779 | |
| 780 | ExpressionStatement ::= StatementExpression ';' |
| 781 | /. $putCase consumeExpressionStatement(); $break ./ |
| 782 | ExpressionStatement ::= ExplicitConstructorInvocation |
| 783 | /:$readableName Statement:/ |
| 784 | |
| 785 | StatementExpression ::= Assignment |
| 786 | StatementExpression ::= PreIncrementExpression |
| 787 | StatementExpression ::= PreDecrementExpression |
| 788 | StatementExpression ::= PostIncrementExpression |
| 789 | StatementExpression ::= PostDecrementExpression |
| 790 | StatementExpression ::= MethodInvocation |
| 791 | StatementExpression ::= ClassInstanceCreationExpression |
| 792 | /:$readableName Expression:/ |
| 793 | |
| 794 | IfThenStatement ::= 'if' '(' Expression ')' Statement |
| 795 | /.$putCase consumeStatementIfNoElse(); $break ./ |
| 796 | /:$readableName IfStatement:/ |
| 797 | |
| 798 | IfThenElseStatement ::= 'if' '(' Expression ')' StatementNoShortIf 'else' Statement |
| 799 | /.$putCase consumeStatementIfWithElse(); $break ./ |
| 800 | /:$readableName IfStatement:/ |
| 801 | |
| 802 | IfThenElseStatementNoShortIf ::= 'if' '(' Expression ')' StatementNoShortIf 'else' StatementNoShortIf |
| 803 | /.$putCase consumeStatementIfWithElse(); $break ./ |
| 804 | /:$readableName IfStatement:/ |
| 805 | |
| 806 | SwitchStatement ::= 'switch' '(' Expression ')' OpenBlock SwitchBlock |
| 807 | /.$putCase consumeStatementSwitch() ; $break ./ |
| 808 | /:$readableName SwitchStatement:/ |
| 809 | |
| 810 | SwitchBlock ::= '{' '}' |
| 811 | /.$putCase consumeEmptySwitchBlock() ; $break ./ |
| 812 | |
| 813 | SwitchBlock ::= '{' SwitchBlockStatements '}' |
| 814 | SwitchBlock ::= '{' SwitchLabels '}' |
| 815 | SwitchBlock ::= '{' SwitchBlockStatements SwitchLabels '}' |
| 816 | /.$putCase consumeSwitchBlock() ; $break ./ |
| 817 | /:$readableName SwitchBlock:/ |
| 818 | |
| 819 | SwitchBlockStatements -> SwitchBlockStatement |
| 820 | SwitchBlockStatements ::= SwitchBlockStatements SwitchBlockStatement |
| 821 | /.$putCase consumeSwitchBlockStatements() ; $break ./ |
| 822 | /:$readableName SwitchBlockStatements:/ |
| 823 | |
| 824 | SwitchBlockStatement ::= SwitchLabels BlockStatements |
| 825 | /.$putCase consumeSwitchBlockStatement() ; $break ./ |
| 826 | /:$readableName SwitchBlockStatement:/ |
| 827 | |
| 828 | |
| 829 | SwitchLabels -> SwitchLabel |
| 830 | SwitchLabels ::= SwitchLabels SwitchLabel |
| 831 | /.$putCase consumeSwitchLabels() ; $break ./ |
| 832 | /:$readableName SwitchLabels:/ |
| 833 | |
| 834 | SwitchLabel ::= 'case' ConstantExpression ':' |
| 835 | /. $putCase consumeCaseLabel(); $break ./ |
| 836 | |
| 837 | SwitchLabel ::= 'default' ':' |
| 838 | /. $putCase consumeDefaultLabel(); $break ./ |
| 839 | /:$readableName SwitchLabel:/ |
| 840 | |
| 841 | WhileStatement ::= 'while' '(' Expression ')' Statement |
| 842 | /.$putCase consumeStatementWhile() ; $break ./ |
| 843 | /:$readableName WhileStatement:/ |
| 844 | |
| 845 | WhileStatementNoShortIf ::= 'while' '(' Expression ')' StatementNoShortIf |
| 846 | /.$putCase consumeStatementWhile() ; $break ./ |
| 847 | /:$readableName WhileStatement:/ |
| 848 | |
| 849 | DoStatement ::= 'do' Statement 'while' '(' Expression ')' ';' |
| 850 | /.$putCase consumeStatementDo() ; $break ./ |
| 851 | /:$readableName DoStatement:/ |
| 852 | |
| 853 | ForStatement ::= 'for' '(' ForInitopt ';' Expressionopt ';' ForUpdateopt ')' Statement |
| 854 | /.$putCase consumeStatementFor() ; $break ./ |
| 855 | /:$readableName ForStatement:/ |
| 856 | |
| 857 | ForStatementNoShortIf ::= 'for' '(' ForInitopt ';' Expressionopt ';' ForUpdateopt ')' StatementNoShortIf |
| 858 | /.$putCase consumeStatementFor() ; $break ./ |
| 859 | /:$readableName ForStatement:/ |
| 860 | |
| 861 | --the minus one allows to avoid a stack-to-stack transfer |
| 862 | ForInit ::= StatementExpressionList |
| 863 | /.$putCase consumeForInit() ; $break ./ |
| 864 | ForInit -> LocalVariableDeclaration |
| 865 | /:$readableName ForInit:/ |
| 866 | |
| 867 | ForUpdate -> StatementExpressionList |
| 868 | /:$readableName ForUpdate:/ |
| 869 | |
| 870 | StatementExpressionList -> StatementExpression |
| 871 | StatementExpressionList ::= StatementExpressionList ',' StatementExpression |
| 872 | /.$putCase consumeStatementExpressionList() ; $break ./ |
| 873 | /:$readableName StatementExpressionList:/ |
| 874 | |
| 875 | -- 1.4 feature |
| 876 | AssertStatement ::= 'assert' Expression ';' |
| 877 | /.$putCase consumeSimpleAssertStatement() ; $break ./ |
| 878 | |
| 879 | AssertStatement ::= 'assert' Expression ':' Expression ';' |
| 880 | /.$putCase consumeAssertStatement() ; $break ./ |
| 881 | /:$readableName AssertStatement:/ |
| 882 | |
| 883 | BreakStatement ::= 'break' ';' |
| 884 | /.$putCase consumeStatementBreak() ; $break ./ |
| 885 | |
| 886 | BreakStatement ::= 'break' Identifier ';' |
| 887 | /.$putCase consumeStatementBreakWithLabel() ; $break ./ |
| 888 | /:$readableName BreakStatement:/ |
| 889 | |
| 890 | ContinueStatement ::= 'continue' ';' |
| 891 | /.$putCase consumeStatementContinue() ; $break ./ |
| 892 | |
| 893 | ContinueStatement ::= 'continue' Identifier ';' |
| 894 | /.$putCase consumeStatementContinueWithLabel() ; $break ./ |
| 895 | /:$readableName ContinueStatement:/ |
| 896 | |
| 897 | ReturnStatement ::= 'return' Expressionopt ';' |
| 898 | /.$putCase consumeStatementReturn() ; $break ./ |
| 899 | /:$readableName ReturnStatement:/ |
| 900 | |
| 901 | ThrowStatement ::= 'throw' Expression ';' |
| 902 | /.$putCase consumeStatementThrow(); |
| 903 | $break ./ |
| 904 | /:$readableName ThrowStatement:/ |
| 905 | |
| 906 | SynchronizedStatement ::= OnlySynchronized '(' Expression ')' Block |
| 907 | /.$putCase consumeStatementSynchronized(); $break ./ |
| 908 | /:$readableName SynchronizedStatement:/ |
| 909 | |
| 910 | OnlySynchronized ::= 'synchronized' |
| 911 | /.$putCase consumeOnlySynchronized(); $break ./ |
| 912 | /:$readableName OnlySynchronized:/ |
| 913 | |
| 914 | TryStatement ::= 'try' TryBlock Catches |
| 915 | /.$putCase consumeStatementTry(false); $break ./ |
| 916 | TryStatement ::= 'try' TryBlock Catchesopt Finally |
| 917 | /.$putCase consumeStatementTry(true); $break ./ |
| 918 | /:$readableName TryStatement:/ |
| 919 | |
| 920 | TryBlock ::= Block ExitTryBlock |
| 921 | /:$readableName Block:/ |
| 922 | |
| 923 | ExitTryBlock ::= $empty |
| 924 | /.$putCase consumeExitTryBlock(); $break ./ |
| 925 | /:$readableName ExitTryBlock:/ |
| 926 | |
| 927 | Catches -> CatchClause |
| 928 | Catches ::= Catches CatchClause |
| 929 | /.$putCase consumeCatches(); $break ./ |
| 930 | /:$readableName Catches:/ |
| 931 | |
| 932 | CatchClause ::= 'catch' '(' FormalParameter ')' Block |
| 933 | /.$putCase consumeStatementCatch() ; $break ./ |
| 934 | /:$readableName CatchClause:/ |
| 935 | |
| 936 | Finally ::= 'finally' Block |
| 937 | /:$readableName Finally:/ |
| 938 | |
| 939 | --18.12 Productions from 14: Expressions |
| 940 | |
| 941 | --for source positionning purpose |
| 942 | PushLPAREN ::= '(' |
| 943 | /.$putCase consumeLeftParen(); $break ./ |
| 944 | /:$readableName (:/ |
| 945 | PushRPAREN ::= ')' |
| 946 | /.$putCase consumeRightParen(); $break ./ |
| 947 | /:$readableName ):/ |
| 948 | |
| 949 | Primary -> PrimaryNoNewArray |
| 950 | Primary -> ArrayCreationWithArrayInitializer |
| 951 | Primary -> ArrayCreationWithoutArrayInitializer |
| 952 | /:$readableName Expression:/ |
| 953 | |
| 954 | PrimaryNoNewArray -> Literal |
| 955 | PrimaryNoNewArray ::= 'this' |
| 956 | /.$putCase consumePrimaryNoNewArrayThis(); $break ./ |
| 957 | |
| 958 | PrimaryNoNewArray ::= PushLPAREN Expression PushRPAREN |
| 959 | /.$putCase consumePrimaryNoNewArray(); $break ./ |
| 960 | |
| 961 | PrimaryNoNewArray -> ClassInstanceCreationExpression |
| 962 | PrimaryNoNewArray -> FieldAccess |
| 963 | --1.1 feature |
| 964 | PrimaryNoNewArray ::= Name '.' 'this' |
| 965 | /.$putCase consumePrimaryNoNewArrayNameThis(); $break ./ |
| 966 | PrimaryNoNewArray ::= Name '.' 'super' |
| 967 | /.$putCase consumePrimaryNoNewArrayNameSuper(); $break ./ |
| 968 | |
| 969 | --1.1 feature |
| 970 | --PrimaryNoNewArray ::= Type '.' 'class' |
| 971 | --inline Type in the previous rule in order to make the grammar LL1 instead |
| 972 | -- of LL2. The result is the 3 next rules. |
| 973 | PrimaryNoNewArray ::= Name '.' 'class' |
| 974 | /.$putCase consumePrimaryNoNewArrayName(); $break ./ |
| 975 | |
| 976 | PrimaryNoNewArray ::= ArrayType '.' 'class' |
| 977 | /.$putCase consumePrimaryNoNewArrayArrayType(); $break ./ |
| 978 | |
| 979 | PrimaryNoNewArray ::= PrimitiveType '.' 'class' |
| 980 | /.$putCase consumePrimaryNoNewArrayPrimitiveType(); $break ./ |
| 981 | |
| 982 | PrimaryNoNewArray -> MethodInvocation |
| 983 | PrimaryNoNewArray -> ArrayAccess |
| 984 | /:$readableName Expression:/ |
| 985 | --1.1 feature |
| 986 | -- |
| 987 | -- In Java 1.0 a ClassBody could not appear at all in a |
| 988 | -- ClassInstanceCreationExpression. |
| 989 | -- |
| 990 | |
| 991 | AllocationHeader ::= 'new' ClassType '(' ArgumentListopt ')' |
| 992 | /.$putCase consumeAllocationHeader(); $break ./ |
| 993 | /:$readableName AllocationHeader:/ |
| 994 | |
| 995 | ClassInstanceCreationExpression ::= 'new' ClassType '(' ArgumentListopt ')' ClassBodyopt |
| 996 | /.$putCase consumeClassInstanceCreationExpression(); $break ./ |
| 997 | --1.1 feature |
| 998 | |
| 999 | ClassInstanceCreationExpression ::= Primary '.' 'new' SimpleName '(' ArgumentListopt ')' ClassBodyopt |
| 1000 | /.$putCase consumeClassInstanceCreationExpressionQualified() ; $break ./ |
| 1001 | |
| 1002 | --1.1 feature |
| 1003 | ClassInstanceCreationExpression ::= ClassInstanceCreationExpressionName 'new' SimpleName '(' ArgumentListopt ')' ClassBodyopt |
| 1004 | /.$putCase consumeClassInstanceCreationExpressionQualified() ; $break ./ |
| 1005 | /:$readableName ClassInstanceCreationExpression:/ |
| 1006 | |
| 1007 | ClassInstanceCreationExpressionName ::= Name '.' |
| 1008 | /.$putCase consumeClassInstanceCreationExpressionName() ; $break ./ |
| 1009 | /:$readableName ClassInstanceCreationExpressionName:/ |
| 1010 | |
| 1011 | ClassBodyopt ::= $empty --test made using null as contents |
| 1012 | /.$putCase consumeClassBodyopt(); $break ./ |
| 1013 | ClassBodyopt ::= EnterAnonymousClassBody ClassBody |
| 1014 | /:$readableName ClassBody:/ |
| 1015 | |
| 1016 | EnterAnonymousClassBody ::= $empty |
| 1017 | /.$putCase consumeEnterAnonymousClassBody(); $break ./ |
| 1018 | /:$readableName EnterAnonymousClassBody:/ |
| 1019 | |
| 1020 | ArgumentList ::= Expression |
| 1021 | ArgumentList ::= ArgumentList ',' Expression |
| 1022 | /.$putCase consumeArgumentList(); $break ./ |
| 1023 | /:$readableName ArgumentList:/ |
| 1024 | |
| 1025 | ArrayCreationHeader ::= 'new' PrimitiveType DimWithOrWithOutExprs |
| 1026 | /.$putCase consumeArrayCreationHeader(); $break ./ |
| 1027 | |
| 1028 | ArrayCreationHeader ::= 'new' ClassOrInterfaceType DimWithOrWithOutExprs |
| 1029 | /.$putCase consumeArrayCreationHeader(); $break ./ |
| 1030 | /:$readableName ArrayCreationHeader:/ |
| 1031 | |
| 1032 | ArrayCreationWithoutArrayInitializer ::= 'new' PrimitiveType DimWithOrWithOutExprs |
| 1033 | /.$putCase consumeArrayCreationExpressionWithoutInitializer(); $break ./ |
| 1034 | /:$readableName ArrayCreationWithoutArrayInitializer:/ |
| 1035 | |
| 1036 | ArrayCreationWithArrayInitializer ::= 'new' PrimitiveType DimWithOrWithOutExprs ArrayInitializer |
| 1037 | /.$putCase consumeArrayCreationExpressionWithInitializer(); $break ./ |
| 1038 | /:$readableName ArrayCreationWithArrayInitializer:/ |
| 1039 | |
| 1040 | ArrayCreationWithoutArrayInitializer ::= 'new' ClassOrInterfaceType DimWithOrWithOutExprs |
| 1041 | /.$putCase consumeArrayCreationExpressionWithoutInitializer(); $break ./ |
| 1042 | |
| 1043 | ArrayCreationWithArrayInitializer ::= 'new' ClassOrInterfaceType DimWithOrWithOutExprs ArrayInitializer |
| 1044 | /.$putCase consumeArrayCreationExpressionWithInitializer(); $break ./ |
| 1045 | |
| 1046 | DimWithOrWithOutExprs ::= DimWithOrWithOutExpr |
| 1047 | DimWithOrWithOutExprs ::= DimWithOrWithOutExprs DimWithOrWithOutExpr |
| 1048 | /.$putCase consumeDimWithOrWithOutExprs(); $break ./ |
| 1049 | /:$readableName Dimensions:/ |
| 1050 | |
| 1051 | DimWithOrWithOutExpr ::= '[' Expression ']' |
| 1052 | DimWithOrWithOutExpr ::= '[' ']' |
| 1053 | /. $putCase consumeDimWithOrWithOutExpr(); $break ./ |
| 1054 | /:$readableName Dimension:/ |
| 1055 | -- ----------------------------------------------- |
| 1056 | |
| 1057 | Dims ::= DimsLoop |
| 1058 | /. $putCase consumeDims(); $break ./ |
| 1059 | /:$readableName Dimensions:/ |
| 1060 | DimsLoop -> OneDimLoop |
| 1061 | DimsLoop ::= DimsLoop OneDimLoop |
| 1062 | /:$readableName Dimensions:/ |
| 1063 | OneDimLoop ::= '[' ']' |
| 1064 | /. $putCase consumeOneDimLoop(); $break ./ |
| 1065 | /:$readableName Dimension:/ |
| 1066 | |
| 1067 | FieldAccess ::= Primary '.' 'Identifier' |
| 1068 | /.$putCase consumeFieldAccess(false); $break ./ |
| 1069 | |
| 1070 | FieldAccess ::= 'super' '.' 'Identifier' |
| 1071 | /.$putCase consumeFieldAccess(true); $break ./ |
| 1072 | /:$readableName FieldAccess:/ |
| 1073 | |
| 1074 | MethodInvocation ::= Name '(' ArgumentListopt ')' |
| 1075 | /.$putCase consumeMethodInvocationName(); $break ./ |
| 1076 | |
| 1077 | MethodInvocation ::= Primary '.' 'Identifier' '(' ArgumentListopt ')' |
| 1078 | /.$putCase consumeMethodInvocationPrimary(); $break ./ |
| 1079 | |
| 1080 | MethodInvocation ::= 'super' '.' 'Identifier' '(' ArgumentListopt ')' |
| 1081 | /.$putCase consumeMethodInvocationSuper(); $break ./ |
| 1082 | /:$readableName MethodInvocation:/ |
| 1083 | |
| 1084 | ArrayAccess ::= Name '[' Expression ']' |
| 1085 | /.$putCase consumeArrayAccess(true); $break ./ |
| 1086 | ArrayAccess ::= PrimaryNoNewArray '[' Expression ']' |
| 1087 | /.$putCase consumeArrayAccess(false); $break ./ |
| 1088 | ArrayAccess ::= ArrayCreationWithArrayInitializer '[' Expression ']' |
| 1089 | /.$putCase consumeArrayAccess(false); $break ./ |
| 1090 | /:$readableName ArrayAccess:/ |
| 1091 | |
| 1092 | PostfixExpression -> Primary |
| 1093 | PostfixExpression ::= Name |
| 1094 | /.$putCase consumePostfixExpression(); $break ./ |
| 1095 | PostfixExpression -> PostIncrementExpression |
| 1096 | PostfixExpression -> PostDecrementExpression |
| 1097 | /:$readableName Expression:/ |
| 1098 | |
| 1099 | PostIncrementExpression ::= PostfixExpression '++' |
| 1100 | /.$putCase consumeUnaryExpression(OperatorIds.PLUS,true); $break ./ |
| 1101 | /:$readableName PostIncrementExpression:/ |
| 1102 | |
| 1103 | PostDecrementExpression ::= PostfixExpression '--' |
| 1104 | /.$putCase consumeUnaryExpression(OperatorIds.MINUS,true); $break ./ |
| 1105 | /:$readableName PostDecrementExpression:/ |
| 1106 | |
| 1107 | --for source managment purpose |
| 1108 | PushPosition ::= $empty |
| 1109 | /.$putCase consumePushPosition(); $break ./ |
| 1110 | /:$readableName PushPosition:/ |
| 1111 | |
| 1112 | UnaryExpression -> PreIncrementExpression |
| 1113 | UnaryExpression -> PreDecrementExpression |
| 1114 | UnaryExpression ::= '+' PushPosition UnaryExpression |
| 1115 | /.$putCase consumeUnaryExpression(OperatorIds.PLUS); $break ./ |
| 1116 | UnaryExpression ::= '-' PushPosition UnaryExpression |
| 1117 | /.$putCase consumeUnaryExpression(OperatorIds.MINUS); $break ./ |
| 1118 | UnaryExpression -> UnaryExpressionNotPlusMinus |
| 1119 | /:$readableName Expression:/ |
| 1120 | |
| 1121 | PreIncrementExpression ::= '++' PushPosition UnaryExpression |
| 1122 | /.$putCase consumeUnaryExpression(OperatorIds.PLUS,false); $break ./ |
| 1123 | /:$readableName PreIncrementExpression:/ |
| 1124 | |
| 1125 | PreDecrementExpression ::= '--' PushPosition UnaryExpression |
| 1126 | /.$putCase consumeUnaryExpression(OperatorIds.MINUS,false); $break ./ |
| 1127 | /:$readableName PreDecrementExpression:/ |
| 1128 | |
| 1129 | UnaryExpressionNotPlusMinus -> PostfixExpression |
| 1130 | UnaryExpressionNotPlusMinus ::= '~' PushPosition UnaryExpression |
| 1131 | /.$putCase consumeUnaryExpression(OperatorIds.TWIDDLE); $break ./ |
| 1132 | UnaryExpressionNotPlusMinus ::= '!' PushPosition UnaryExpression |
| 1133 | /.$putCase consumeUnaryExpression(OperatorIds.NOT); $break ./ |
| 1134 | UnaryExpressionNotPlusMinus -> CastExpression |
| 1135 | /:$readableName Expression:/ |
| 1136 | |
| 1137 | CastExpression ::= PushLPAREN PrimitiveType Dimsopt PushRPAREN InsideCastExpression UnaryExpression |
| 1138 | /.$putCase consumeCastExpression(); $break ./ |
| 1139 | CastExpression ::= PushLPAREN Name Dims PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus |
| 1140 | /.$putCase consumeCastExpression(); $break ./ |
| 1141 | -- Expression is here only in order to make the grammar LL1 |
| 1142 | CastExpression ::= PushLPAREN Expression PushRPAREN InsideCastExpressionLL1 UnaryExpressionNotPlusMinus |
| 1143 | /.$putCase consumeCastExpressionLL1(); $break ./ |
| 1144 | /:$readableName CastExpression:/ |
| 1145 | |
| 1146 | InsideCastExpression ::= $empty |
| 1147 | /.$putCase consumeInsideCastExpression(); $break ./ |
| 1148 | /:$readableName InsideCastExpression:/ |
| 1149 | InsideCastExpressionLL1 ::= $empty |
| 1150 | /.$putCase consumeInsideCastExpressionLL1(); $break ./ |
| 1151 | /:$readableName InsideCastExpression:/ |
| 1152 | |
| 1153 | MultiplicativeExpression -> UnaryExpression |
| 1154 | MultiplicativeExpression ::= MultiplicativeExpression '*' UnaryExpression |
| 1155 | /.$putCase consumeBinaryExpression(OperatorIds.MULTIPLY); $break ./ |
| 1156 | MultiplicativeExpression ::= MultiplicativeExpression '/' UnaryExpression |
| 1157 | /.$putCase consumeBinaryExpression(OperatorIds.DIVIDE); $break ./ |
| 1158 | MultiplicativeExpression ::= MultiplicativeExpression '%' UnaryExpression |
| 1159 | /.$putCase consumeBinaryExpression(OperatorIds.REMAINDER); $break ./ |
| 1160 | /:$readableName Expression:/ |
| 1161 | |
| 1162 | AdditiveExpression -> MultiplicativeExpression |
| 1163 | AdditiveExpression ::= AdditiveExpression '+' MultiplicativeExpression |
| 1164 | /.$putCase consumeBinaryExpression(OperatorIds.PLUS); $break ./ |
| 1165 | AdditiveExpression ::= AdditiveExpression '-' MultiplicativeExpression |
| 1166 | /.$putCase consumeBinaryExpression(OperatorIds.MINUS); $break ./ |
| 1167 | /:$readableName Expression:/ |
| 1168 | |
| 1169 | ShiftExpression -> AdditiveExpression |
| 1170 | ShiftExpression ::= ShiftExpression '<<' AdditiveExpression |
| 1171 | /.$putCase consumeBinaryExpression(OperatorIds.LEFT_SHIFT); $break ./ |
| 1172 | ShiftExpression ::= ShiftExpression '>>' AdditiveExpression |
| 1173 | /.$putCase consumeBinaryExpression(OperatorIds.RIGHT_SHIFT); $break ./ |
| 1174 | ShiftExpression ::= ShiftExpression '>>>' AdditiveExpression |
| 1175 | /.$putCase consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT); $break ./ |
| 1176 | /:$readableName Expression:/ |
| 1177 | |
| 1178 | RelationalExpression -> ShiftExpression |
| 1179 | RelationalExpression ::= RelationalExpression '<' ShiftExpression |
| 1180 | /.$putCase consumeBinaryExpression(OperatorIds.LESS); $break ./ |
| 1181 | RelationalExpression ::= RelationalExpression '>' ShiftExpression |
| 1182 | /.$putCase consumeBinaryExpression(OperatorIds.GREATER); $break ./ |
| 1183 | RelationalExpression ::= RelationalExpression '<=' ShiftExpression |
| 1184 | /.$putCase consumeBinaryExpression(OperatorIds.LESS_EQUAL); $break ./ |
| 1185 | RelationalExpression ::= RelationalExpression '>=' ShiftExpression |
| 1186 | /.$putCase consumeBinaryExpression(OperatorIds.GREATER_EQUAL); $break ./ |
| 1187 | RelationalExpression ::= RelationalExpression 'instanceof' ReferenceType |
| 1188 | /.$putCase consumeInstanceOfExpression(OperatorIds.INSTANCEOF); $break ./ |
| 1189 | /:$readableName Expression:/ |
| 1190 | |
| 1191 | EqualityExpression -> RelationalExpression |
| 1192 | EqualityExpression ::= EqualityExpression '==' RelationalExpression |
| 1193 | /.$putCase consumeEqualityExpression(OperatorIds.EQUAL_EQUAL); $break ./ |
| 1194 | EqualityExpression ::= EqualityExpression '!=' RelationalExpression |
| 1195 | /.$putCase consumeEqualityExpression(OperatorIds.NOT_EQUAL); $break ./ |
| 1196 | /:$readableName Expression:/ |
| 1197 | |
| 1198 | AndExpression -> EqualityExpression |
| 1199 | AndExpression ::= AndExpression '&' EqualityExpression |
| 1200 | /.$putCase consumeBinaryExpression(OperatorIds.AND); $break ./ |
| 1201 | /:$readableName Expression:/ |
| 1202 | |
| 1203 | ExclusiveOrExpression -> AndExpression |
| 1204 | ExclusiveOrExpression ::= ExclusiveOrExpression '^' AndExpression |
| 1205 | /.$putCase consumeBinaryExpression(OperatorIds.XOR); $break ./ |
| 1206 | /:$readableName Expression:/ |
| 1207 | |
| 1208 | InclusiveOrExpression -> ExclusiveOrExpression |
| 1209 | InclusiveOrExpression ::= InclusiveOrExpression '|' ExclusiveOrExpression |
| 1210 | /.$putCase consumeBinaryExpression(OperatorIds.OR); $break ./ |
| 1211 | /:$readableName Expression:/ |
| 1212 | |
| 1213 | ConditionalAndExpression -> InclusiveOrExpression |
| 1214 | ConditionalAndExpression ::= ConditionalAndExpression '&&' InclusiveOrExpression |
| 1215 | /.$putCase consumeBinaryExpression(OperatorIds.AND_AND); $break ./ |
| 1216 | /:$readableName Expression:/ |
| 1217 | |
| 1218 | ConditionalOrExpression -> ConditionalAndExpression |
| 1219 | ConditionalOrExpression ::= ConditionalOrExpression '||' ConditionalAndExpression |
| 1220 | /.$putCase consumeBinaryExpression(OperatorIds.OR_OR); $break ./ |
| 1221 | /:$readableName Expression:/ |
| 1222 | |
| 1223 | ConditionalExpression -> ConditionalOrExpression |
| 1224 | ConditionalExpression ::= ConditionalOrExpression '?' Expression ':' ConditionalExpression |
| 1225 | /.$putCase consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ; $break ./ |
| 1226 | /:$readableName Expression:/ |
| 1227 | |
| 1228 | AssignmentExpression -> ConditionalExpression |
| 1229 | AssignmentExpression -> Assignment |
| 1230 | /:$readableName Expression:/ |
| 1231 | |
| 1232 | Assignment ::= PostfixExpression AssignmentOperator AssignmentExpression |
| 1233 | /.$putCase consumeAssignment(); $break ./ |
| 1234 | /:$readableName Assignment:/ |
| 1235 | |
| 1236 | -- this rule is added to parse an array initializer in a assigment and then report a syntax error knowing the exact senario |
| 1237 | InvalidArrayInitializerAssignement ::= PostfixExpression AssignmentOperator ArrayInitializer |
| 1238 | /:$readableName ArrayInitializerAssignement:/ |
| 1239 | Assignment ::= InvalidArrayInitializerAssignement |
| 1240 | /.$putcase ignoreExpressionAssignment();$break ./ |
| 1241 | |
| 1242 | AssignmentOperator ::= '=' |
| 1243 | /.$putCase consumeAssignmentOperator(EQUAL); $break ./ |
| 1244 | AssignmentOperator ::= '*=' |
| 1245 | /.$putCase consumeAssignmentOperator(MULTIPLY); $break ./ |
| 1246 | AssignmentOperator ::= '/=' |
| 1247 | /.$putCase consumeAssignmentOperator(DIVIDE); $break ./ |
| 1248 | AssignmentOperator ::= '%=' |
| 1249 | /.$putCase consumeAssignmentOperator(REMAINDER); $break ./ |
| 1250 | AssignmentOperator ::= '+=' |
| 1251 | /.$putCase consumeAssignmentOperator(PLUS); $break ./ |
| 1252 | AssignmentOperator ::= '-=' |
| 1253 | /.$putCase consumeAssignmentOperator(MINUS); $break ./ |
| 1254 | AssignmentOperator ::= '<<=' |
| 1255 | /.$putCase consumeAssignmentOperator(LEFT_SHIFT); $break ./ |
| 1256 | AssignmentOperator ::= '>>=' |
| 1257 | /.$putCase consumeAssignmentOperator(RIGHT_SHIFT); $break ./ |
| 1258 | AssignmentOperator ::= '>>>=' |
| 1259 | /.$putCase consumeAssignmentOperator(UNSIGNED_RIGHT_SHIFT); $break ./ |
| 1260 | AssignmentOperator ::= '&=' |
| 1261 | /.$putCase consumeAssignmentOperator(AND); $break ./ |
| 1262 | AssignmentOperator ::= '^=' |
| 1263 | /.$putCase consumeAssignmentOperator(XOR); $break ./ |
| 1264 | AssignmentOperator ::= '|=' |
| 1265 | /.$putCase consumeAssignmentOperator(OR); $break ./ |
| 1266 | /:$readableName AssignmentOperator:/ |
| 1267 | |
| 1268 | Expression -> AssignmentExpression |
| 1269 | /:$readableName Expression:/ |
| 1270 | |
| 1271 | ConstantExpression -> Expression |
| 1272 | /:$readableName ConstantExpression:/ |
| 1273 | |
| 1274 | -- The following rules are for optional nonterminals. |
| 1275 | -- |
| 1276 | |
| 1277 | PackageDeclarationopt -> $empty |
| 1278 | PackageDeclarationopt -> PackageDeclaration |
| 1279 | /:$readableName PackageDeclaration:/ |
| 1280 | |
| 1281 | ClassHeaderExtendsopt ::= $empty |
| 1282 | ClassHeaderExtendsopt -> ClassHeaderExtends |
| 1283 | /:$readableName ClassHeaderExtends:/ |
| 1284 | |
| 1285 | Expressionopt ::= $empty |
| 1286 | /.$putCase consumeEmptyExpression(); $break ./ |
| 1287 | Expressionopt -> Expression |
| 1288 | /:$readableName Expression:/ |
| 1289 | |
| 1290 | |
| 1291 | --------------------------------------------------------------------------------------- |
| 1292 | -- |
| 1293 | -- The rules below are for optional terminal symbols. An optional comma, |
| 1294 | -- is only used in the context of an array initializer - It is a |
| 1295 | -- "syntactic sugar" that otherwise serves no other purpose. By contrast, |
| 1296 | -- an optional identifier is used in the definition of a break and |
| 1297 | -- continue statement. When the identifier does not appear, a NULL |
| 1298 | -- is produced. When the identifier is present, the user should use the |
| 1299 | -- corresponding TOKEN(i) method. See break statement as an example. |
| 1300 | -- |
| 1301 | --------------------------------------------------------------------------------------- |
| 1302 | |
| 1303 | ,opt -> $empty |
| 1304 | ,opt -> , |
| 1305 | /:$readableName ,:/ |
| 1306 | |
| 1307 | ImportDeclarationsopt ::= $empty |
| 1308 | /.$putCase consumeEmptyImportDeclarationsopt(); $break ./ |
| 1309 | ImportDeclarationsopt ::= ImportDeclarations |
| 1310 | /.$putCase consumeImportDeclarationsopt(); $break ./ |
| 1311 | /:$readableName ImportDeclarations:/ |
| 1312 | |
| 1313 | TypeDeclarationsopt ::= $empty |
| 1314 | /.$putCase consumeEmptyTypeDeclarationsopt(); $break ./ |
| 1315 | TypeDeclarationsopt ::= TypeDeclarations |
| 1316 | /.$putCase consumeTypeDeclarationsopt(); $break ./ |
| 1317 | /:$readableName TypeDeclarations:/ |
| 1318 | |
| 1319 | ClassBodyDeclarationsopt ::= $empty |
| 1320 | /.$putCase consumeEmptyClassBodyDeclarationsopt(); $break ./ |
| 1321 | ClassBodyDeclarationsopt ::= NestedType ClassBodyDeclarations |
| 1322 | /.$putCase consumeClassBodyDeclarationsopt(); $break ./ |
| 1323 | /:$readableName ClassBodyDeclarations:/ |
| 1324 | |
| 1325 | Modifiersopt ::= $empty |
| 1326 | /. $putCase consumeDefaultModifiers(); $break ./ |
| 1327 | Modifiersopt ::= Modifiers |
| 1328 | /.$putCase consumeModifiers(); $break ./ |
| 1329 | /:$readableName Modifiers:/ |
| 1330 | |
| 1331 | BlockStatementsopt ::= $empty |
| 1332 | /.$putCase consumeEmptyBlockStatementsopt(); $break ./ |
| 1333 | BlockStatementsopt -> BlockStatements |
| 1334 | /:$readableName BlockStatements:/ |
| 1335 | |
| 1336 | Dimsopt ::= $empty |
| 1337 | /. $putCase consumeEmptyDimsopt(); $break ./ |
| 1338 | Dimsopt -> Dims |
| 1339 | /:$readableName Dimensions:/ |
| 1340 | |
| 1341 | ArgumentListopt ::= $empty |
| 1342 | /. $putCase consumeEmptyArgumentListopt(); $break ./ |
| 1343 | ArgumentListopt -> ArgumentList |
| 1344 | /:$readableName ArgumentList:/ |
| 1345 | |
| 1346 | MethodHeaderThrowsClauseopt ::= $empty |
| 1347 | MethodHeaderThrowsClauseopt -> MethodHeaderThrowsClause |
| 1348 | /:$readableName MethodHeaderThrowsClause:/ |
| 1349 | |
| 1350 | FormalParameterListopt ::= $empty |
| 1351 | /.$putcase consumeFormalParameterListopt(); $break ./ |
| 1352 | FormalParameterListopt -> FormalParameterList |
| 1353 | /:$readableName FormalParameterList:/ |
| 1354 | |
| 1355 | ClassHeaderImplementsopt ::= $empty |
| 1356 | ClassHeaderImplementsopt -> ClassHeaderImplements |
| 1357 | /:$readableName ClassHeaderImplements:/ |
| 1358 | |
| 1359 | InterfaceMemberDeclarationsopt ::= $empty |
| 1360 | /. $putCase consumeEmptyInterfaceMemberDeclarationsopt(); $break ./ |
| 1361 | InterfaceMemberDeclarationsopt ::= NestedType InterfaceMemberDeclarations |
| 1362 | /. $putCase consumeInterfaceMemberDeclarationsopt(); $break ./ |
| 1363 | /:$readableName InterfaceMemberDeclarations:/ |
| 1364 | |
| 1365 | NestedType ::= $empty |
| 1366 | /.$putCase consumeNestedType(); $break./ |
| 1367 | /:$readableName NestedType:/ |
| 1368 | |
| 1369 | ForInitopt ::= $empty |
| 1370 | /. $putCase consumeEmptyForInitopt(); $break ./ |
| 1371 | ForInitopt -> ForInit |
| 1372 | /:$readableName ForInit:/ |
| 1373 | |
| 1374 | ForUpdateopt ::= $empty |
| 1375 | /. $putCase consumeEmptyForUpdateopt(); $break ./ |
| 1376 | ForUpdateopt -> ForUpdate |
| 1377 | /:$readableName ForUpdate:/ |
| 1378 | |
| 1379 | InterfaceHeaderExtendsopt ::= $empty |
| 1380 | InterfaceHeaderExtendsopt -> InterfaceHeaderExtends |
| 1381 | /:$readableName InterfaceHeaderExtends:/ |
| 1382 | |
| 1383 | Catchesopt ::= $empty |
| 1384 | /. $putCase consumeEmptyCatchesopt(); $break ./ |
| 1385 | Catchesopt -> Catches |
| 1386 | /:$readableName Catches:/ |
| 1387 | |
| 1388 | /. } |
| 1389 | } ./ |
| 1390 | |
| 1391 | --------------------------------------------------------------------------------------- |
| 1392 | |
| 1393 | $names |
| 1394 | |
| 1395 | -- BodyMarker ::= '"class Identifier { ... MethodHeader "' |
| 1396 | |
| 1397 | -- void ::= 'void' |
| 1398 | |
| 1399 | PLUS_PLUS ::= '++' |
| 1400 | MINUS_MINUS ::= '--' |
| 1401 | EQUAL_EQUAL ::= '==' |
| 1402 | LESS_EQUAL ::= '<=' |
| 1403 | GREATER_EQUAL ::= '>=' |
| 1404 | NOT_EQUAL ::= '!=' |
| 1405 | LEFT_SHIFT ::= '<<' |
| 1406 | RIGHT_SHIFT ::= '>>' |
| 1407 | UNSIGNED_RIGHT_SHIFT ::= '>>>' |
| 1408 | PLUS_EQUAL ::= '+=' |
| 1409 | MINUS_EQUAL ::= '-=' |
| 1410 | MULTIPLY_EQUAL ::= '*=' |
| 1411 | DIVIDE_EQUAL ::= '/=' |
| 1412 | AND_EQUAL ::= '&=' |
| 1413 | OR_EQUAL ::= '|=' |
| 1414 | XOR_EQUAL ::= '^=' |
| 1415 | REMAINDER_EQUAL ::= '%=' |
| 1416 | LEFT_SHIFT_EQUAL ::= '<<=' |
| 1417 | RIGHT_SHIFT_EQUAL ::= '>>=' |
| 1418 | UNSIGNED_RIGHT_SHIFT_EQUAL ::= '>>>=' |
| 1419 | OR_OR ::= '||' |
| 1420 | AND_AND ::= '&&' |
| 1421 | |
| 1422 | PLUS ::= '+' |
| 1423 | MINUS ::= '-' |
| 1424 | NOT ::= '!' |
| 1425 | REMAINDER ::= '%' |
| 1426 | XOR ::= '^' |
| 1427 | AND ::= '&' |
| 1428 | MULTIPLY ::= '*' |
| 1429 | OR ::= '|' |
| 1430 | TWIDDLE ::= '~' |
| 1431 | DIVIDE ::= '/' |
| 1432 | GREATER ::= '>' |
| 1433 | LESS ::= '<' |
| 1434 | LPAREN ::= '(' |
| 1435 | RPAREN ::= ')' |
| 1436 | LBRACE ::= '{' |
| 1437 | RBRACE ::= '}' |
| 1438 | LBRACKET ::= '[' |
| 1439 | RBRACKET ::= ']' |
| 1440 | SEMICOLON ::= ';' |
| 1441 | QUESTION ::= '?' |
| 1442 | COLON ::= ':' |
| 1443 | COMMA ::= ',' |
| 1444 | DOT ::= '.' |
| 1445 | EQUAL ::= '=' |
| 1446 | |
| 1447 | $end |
| 1448 | -- need a carriage return after the $end |