Stephan Herrmann | 234bfec | 2011-04-26 08:26:58 +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 : if (DEBUG) { System.out.println("$rule_text"); } //$NON-NLS-1$ |
| 22 | ./ |
| 23 | |
| 24 | $break |
| 25 | /. |
| 26 | break; |
| 27 | ./ |
| 28 | |
| 29 | |
| 30 | $readableName |
| 31 | /.1#$rule_number#./ |
| 32 | $compliance |
| 33 | /.2#$rule_number#./ |
| 34 | $recovery |
| 35 | /.2#$rule_number# recovery./ |
| 36 | $recovery_template |
| 37 | /.3#$rule_number#./ |
| 38 | $no_statements_recovery |
| 39 | /.4#$rule_number# 1./ |
| 40 | -- here it starts really ------------------------------------------ |
| 41 | $Terminals |
| 42 | |
| 43 | Identifier |
| 44 | |
| 45 | abstract assert boolean break byte case catch char class |
| 46 | continue const default do double else enum extends false final finally float |
| 47 | for goto if implements import instanceof int |
| 48 | interface long native new null package private |
| 49 | protected public return short static strictfp super switch |
| 50 | synchronized this throw throws transient true try void |
| 51 | volatile while |
| 52 | |
| 53 | -- {ObjectTeams: keywords |
| 54 | as base callin playedBy precedence readonly team tsuper when with within |
| 55 | |
| 56 | -- The following symbols are recoknized as keywords only in specific contexts: |
| 57 | -- After "<-": |
| 58 | replace after before |
| 59 | -- After "->": |
| 60 | get set |
| 61 | |
| 62 | -- Markus Witte} |
| 63 | |
| 64 | IntegerLiteral |
| 65 | LongLiteral |
| 66 | FloatingPointLiteral |
| 67 | DoubleLiteral |
| 68 | CharacterLiteral |
| 69 | StringLiteral |
| 70 | |
| 71 | PLUS_PLUS |
| 72 | MINUS_MINUS |
| 73 | EQUAL_EQUAL |
| 74 | LESS_EQUAL |
| 75 | GREATER_EQUAL |
| 76 | NOT_EQUAL |
| 77 | LEFT_SHIFT |
| 78 | RIGHT_SHIFT |
| 79 | UNSIGNED_RIGHT_SHIFT |
| 80 | PLUS_EQUAL |
| 81 | MINUS_EQUAL |
| 82 | MULTIPLY_EQUAL |
| 83 | DIVIDE_EQUAL |
| 84 | AND_EQUAL |
| 85 | OR_EQUAL |
| 86 | XOR_EQUAL |
| 87 | REMAINDER_EQUAL |
| 88 | LEFT_SHIFT_EQUAL |
| 89 | RIGHT_SHIFT_EQUAL |
| 90 | UNSIGNED_RIGHT_SHIFT_EQUAL |
| 91 | OR_OR |
| 92 | AND_AND |
| 93 | PLUS |
| 94 | MINUS |
| 95 | NOT |
| 96 | REMAINDER |
| 97 | XOR |
| 98 | AND |
| 99 | MULTIPLY |
| 100 | OR |
| 101 | TWIDDLE |
| 102 | DIVIDE |
| 103 | GREATER |
| 104 | LESS |
| 105 | LPAREN |
| 106 | RPAREN |
| 107 | LBRACE |
| 108 | RBRACE |
| 109 | LBRACKET |
| 110 | RBRACKET |
| 111 | SEMICOLON |
| 112 | QUESTION |
| 113 | COLON |
| 114 | COMMA |
| 115 | DOT |
| 116 | EQUAL |
| 117 | AT |
| 118 | ELLIPSIS |
| 119 | -- {ObjectTeams |
| 120 | BINDIN |
| 121 | BINDOUT |
| 122 | CALLOUT_OVERRIDE |
| 123 | -- Markus Witte} |
| 124 | -- BodyMarker |
| 125 | |
| 126 | $Alias |
| 127 | |
| 128 | '++' ::= PLUS_PLUS |
| 129 | '--' ::= MINUS_MINUS |
| 130 | '==' ::= EQUAL_EQUAL |
| 131 | '<=' ::= LESS_EQUAL |
| 132 | '>=' ::= GREATER_EQUAL |
| 133 | '!=' ::= NOT_EQUAL |
| 134 | '<<' ::= LEFT_SHIFT |
| 135 | '>>' ::= RIGHT_SHIFT |
| 136 | '>>>' ::= UNSIGNED_RIGHT_SHIFT |
| 137 | '+=' ::= PLUS_EQUAL |
| 138 | '-=' ::= MINUS_EQUAL |
| 139 | '*=' ::= MULTIPLY_EQUAL |
| 140 | '/=' ::= DIVIDE_EQUAL |
| 141 | '&=' ::= AND_EQUAL |
| 142 | '|=' ::= OR_EQUAL |
| 143 | '^=' ::= XOR_EQUAL |
| 144 | '%=' ::= REMAINDER_EQUAL |
| 145 | '<<=' ::= LEFT_SHIFT_EQUAL |
| 146 | '>>=' ::= RIGHT_SHIFT_EQUAL |
| 147 | '>>>=' ::= UNSIGNED_RIGHT_SHIFT_EQUAL |
| 148 | '||' ::= OR_OR |
| 149 | '&&' ::= AND_AND |
| 150 | '+' ::= PLUS |
| 151 | '-' ::= MINUS |
| 152 | '!' ::= NOT |
| 153 | '%' ::= REMAINDER |
| 154 | '^' ::= XOR |
| 155 | '&' ::= AND |
| 156 | '*' ::= MULTIPLY |
| 157 | '|' ::= OR |
| 158 | '~' ::= TWIDDLE |
| 159 | '/' ::= DIVIDE |
| 160 | '>' ::= GREATER |
| 161 | '<' ::= LESS |
| 162 | '(' ::= LPAREN |
| 163 | ')' ::= RPAREN |
| 164 | '{' ::= LBRACE |
| 165 | '}' ::= RBRACE |
| 166 | '[' ::= LBRACKET |
| 167 | ']' ::= RBRACKET |
| 168 | ';' ::= SEMICOLON |
| 169 | '?' ::= QUESTION |
| 170 | ':' ::= COLON |
| 171 | ',' ::= COMMA |
| 172 | '.' ::= DOT |
| 173 | '=' ::= EQUAL |
| 174 | '@' ::= AT |
| 175 | '...' ::= ELLIPSIS |
| 176 | |
| 177 | -- {ObjectTeams |
| 178 | '<-' ::= BINDIN |
| 179 | '->' ::= BINDOUT |
| 180 | '=>' ::= CALLOUT_OVERRIDE |
| 181 | -- Markus Witte} |
| 182 | |
| 183 | $Start |
| 184 | Goal |
| 185 | |
| 186 | $Rules |
| 187 | |
| 188 | /.// This method is part of an automatic generation : do NOT edit-modify |
| 189 | protected void consumeRule(int act) { |
| 190 | switch ( act ) { |
| 191 | ./ |
| 192 | |
| 193 | |
| 194 | |
| 195 | Goal ::= '++' CompilationUnit |
| 196 | Goal ::= '--' MethodBody |
| 197 | -- Initializer |
| 198 | Goal ::= '>>' StaticInitializer |
| 199 | Goal ::= '>>' Initializer |
| 200 | -- error recovery |
| 201 | -- Modifiersopt is used to properly consume a header and exit the rule reduction at the end of the parse() method |
| 202 | Goal ::= '>>>' Header1 Modifiersopt |
| 203 | Goal ::= '!' Header2 Modifiersopt |
| 204 | Goal ::= '*' BlockStatements |
| 205 | Goal ::= '*' CatchHeader |
| 206 | -- JDOM |
| 207 | Goal ::= '&&' FieldDeclaration |
| 208 | Goal ::= '||' ImportDeclaration |
| 209 | Goal ::= '?' PackageDeclaration |
| 210 | Goal ::= '+' TypeDeclaration |
| 211 | Goal ::= '/' GenericMethodDeclaration |
| 212 | Goal ::= '&' ClassBodyDeclarations |
| 213 | -- code snippet |
| 214 | Goal ::= '%' Expression |
| 215 | Goal ::= '%' ArrayInitializer |
| 216 | -- completion parser |
| 217 | Goal ::= '~' BlockStatementsopt |
| 218 | -- source type converter |
| 219 | Goal ::= '||' MemberValue |
| 220 | -- syntax diagnosis |
| 221 | Goal ::= '?' AnnotationTypeMemberDeclaration |
| 222 | --{ObjectTeams new goals: |
| 223 | Goal ::= ':' CallinParameterMappings |
| 224 | Goal ::= ';' CalloutParameterMappings |
| 225 | Goal ::= '^' ParameterMapping |
| 226 | Goal ::= '<' MethodSpecShort |
| 227 | Goal ::= '>' MethodSpecLong |
| 228 | -- SH} |
| 229 | /:$readableName Goal:/ |
| 230 | |
| 231 | -- {ObjectTeams |
| 232 | -- insert new Goals for Delta-Compiling |
| 233 | -- for Callin/Callout-Binding |
| 234 | -- Markus Witte} |
| 235 | |
| 236 | Literal -> IntegerLiteral |
| 237 | Literal -> LongLiteral |
| 238 | Literal -> FloatingPointLiteral |
| 239 | Literal -> DoubleLiteral |
| 240 | Literal -> CharacterLiteral |
| 241 | Literal -> StringLiteral |
| 242 | Literal -> null |
| 243 | Literal -> BooleanLiteral |
| 244 | /:$readableName Literal:/ |
| 245 | BooleanLiteral -> true |
| 246 | BooleanLiteral -> false |
| 247 | /:$readableName BooleanLiteral:/ |
| 248 | |
| 249 | Type ::= PrimitiveType |
| 250 | /.$putCase consumePrimitiveType(); $break ./ |
| 251 | Type -> ReferenceType |
| 252 | -- {ObjectTeams |
| 253 | Type -> LiftingType |
| 254 | Type -> ArrayLiftingType |
| 255 | Type -> InvalidDeclaredArrayLifting |
| 256 | -- Markus Witte} |
| 257 | /:$readableName Type:/ |
| 258 | |
| 259 | PrimitiveType -> NumericType |
| 260 | /:$readableName PrimitiveType:/ |
| 261 | NumericType -> IntegralType |
| 262 | NumericType -> FloatingPointType |
| 263 | /:$readableName NumericType:/ |
| 264 | |
| 265 | PrimitiveType -> 'boolean' |
| 266 | PrimitiveType -> 'void' |
| 267 | IntegralType -> 'byte' |
| 268 | IntegralType -> 'short' |
| 269 | IntegralType -> 'int' |
| 270 | IntegralType -> 'long' |
| 271 | IntegralType -> 'char' |
| 272 | /:$readableName IntegralType:/ |
| 273 | FloatingPointType -> 'float' |
| 274 | FloatingPointType -> 'double' |
| 275 | /:$readableName FloatingPointType:/ |
| 276 | |
| 277 | ReferenceType ::= ClassOrInterfaceType |
| 278 | /.$putCase consumeReferenceType(); $break ./ |
| 279 | ReferenceType -> ArrayType |
| 280 | /:$readableName ReferenceType:/ |
| 281 | |
| 282 | --------------------------------------------------------------- |
| 283 | -- 1.5 feature |
| 284 | --------------------------------------------------------------- |
| 285 | ClassOrInterfaceType -> ClassOrInterface |
| 286 | ClassOrInterfaceType -> GenericType |
| 287 | /:$readableName Type:/ |
| 288 | |
| 289 | ClassOrInterface ::= Name |
| 290 | /.$putCase consumeClassOrInterfaceName(); $break ./ |
| 291 | ClassOrInterface ::= GenericType '.' Name |
| 292 | /.$putCase consumeClassOrInterface(); $break ./ |
| 293 | /:$readableName Type:/ |
| 294 | |
| 295 | GenericType ::= ClassOrInterface TypeArguments |
| 296 | /.$putCase consumeGenericType(); $break ./ |
| 297 | /:$readableName GenericType:/ |
| 298 | |
| 299 | -- {ObjectTeams: "Base as Role" types: |
| 300 | |
| 301 | LiftingType ::= ClassType 'as' ClassType |
| 302 | /.$putCase consumeLiftingType(); $break ./ |
| 303 | /:$readableName LiftingType:/ |
| 304 | |
| 305 | ArrayLiftingType ::= ArrayType 'as' ArrayType |
| 306 | /.$putCase consumeLiftingTypeArray(); $break ./ |
| 307 | /:$readableName ArrayLiftingType:/ |
| 308 | |
| 309 | -- handle invalid array liftings: "Type as Array" and "Array as Type" |
| 310 | InvalidDeclaredArrayLifting ::= ClassType 'as' ArrayType |
| 311 | /.$putCase consumeLiftingTypeArrayInvalid(); $break ./ |
| 312 | /:$readableName InvalidDeclaredArrayLifting:/ |
| 313 | |
| 314 | InvalidDeclaredArrayLifting ::= ArrayType 'as' ClassType |
| 315 | /.$putCase consumeLiftingTypeArrayInvalid(); $break ./ |
| 316 | /:$readableName InvalidDeclaredArrayLifting:/ |
| 317 | -- SH} |
| 318 | |
| 319 | -- {ObjectTeams: "base.R" types: |
| 320 | |
| 321 | BaseAnchoredType ::= 'base' '.' SimpleName |
| 322 | /.$putCase consumeBaseAnchoredType(); $break ./ |
| 323 | /:$readableName QualifiedName:/ |
| 324 | |
| 325 | -- Connecting BaseAnchoredType to other rules (2 variants): |
| 326 | -- 1.) connect via Type->ReferenceType->ClassOrInterfaceType |
| 327 | -- as well as via ClassType->ClassOrInterfaceType |
| 328 | ClassOrInterfaceType -> BaseAnchoredType |
| 329 | /:$readableName BaseAnchoredType:/ |
| 330 | |
| 331 | -- 2.) via ReferenceType we may add dimensions: |
| 332 | ReferenceType -> BaseAnchoredType Dims |
| 333 | /:$readableName ArrayOfBaseAnchoredType:/ |
| 334 | -- SH} |
| 335 | |
| 336 | -- |
| 337 | -- These rules have been rewritten to avoid some conflicts introduced |
| 338 | -- by adding the 1.1 features |
| 339 | -- |
| 340 | -- ArrayType ::= PrimitiveType '[' ']' |
| 341 | -- ArrayType ::= Name '[' ']' |
| 342 | -- ArrayType ::= ArrayType '[' ']' |
| 343 | -- |
| 344 | |
| 345 | ArrayTypeWithTypeArgumentsName ::= GenericType '.' Name |
| 346 | /.$putCase consumeArrayTypeWithTypeArgumentsName(); $break ./ |
| 347 | /:$readableName ArrayTypeWithTypeArgumentsName:/ |
| 348 | |
| 349 | ArrayType ::= PrimitiveType Dims |
| 350 | /.$putCase consumePrimitiveArrayType(); $break ./ |
| 351 | ArrayType ::= Name Dims |
| 352 | /.$putCase consumeNameArrayType(); $break ./ |
| 353 | ArrayType ::= ArrayTypeWithTypeArgumentsName Dims |
| 354 | /.$putCase consumeGenericTypeNameArrayType(); $break ./ |
| 355 | ArrayType ::= GenericType Dims |
| 356 | /.$putCase consumeGenericTypeArrayType(); $break ./ |
| 357 | /:$readableName ArrayType:/ |
| 358 | |
| 359 | ClassType -> ClassOrInterfaceType |
| 360 | /:$readableName ClassType:/ |
| 361 | |
| 362 | -------------------------------------------------------------- |
| 363 | -------------------------------------------------------------- |
| 364 | |
| 365 | Name -> SimpleName |
| 366 | Name -> QualifiedName |
| 367 | /:$readableName Name:/ |
| 368 | /:$recovery_template Identifier:/ |
| 369 | |
| 370 | SimpleName -> 'Identifier' |
| 371 | /:$readableName SimpleName:/ |
| 372 | |
| 373 | QualifiedName ::= Name '.' SimpleName |
| 374 | /.$putCase consumeQualifiedName(); $break ./ |
| 375 | /:$readableName QualifiedName:/ |
| 376 | |
| 377 | CompilationUnit ::= EnterCompilationUnit InternalCompilationUnit |
| 378 | /.$putCase consumeCompilationUnit(); $break ./ |
| 379 | /:$readableName CompilationUnit:/ |
| 380 | |
| 381 | InternalCompilationUnit ::= PackageDeclaration |
| 382 | /.$putCase consumeInternalCompilationUnit(); $break ./ |
| 383 | InternalCompilationUnit ::= PackageDeclaration ImportDeclarations ReduceImports |
| 384 | /.$putCase consumeInternalCompilationUnit(); $break ./ |
| 385 | InternalCompilationUnit ::= PackageDeclaration ImportDeclarations ReduceImports TypeDeclarations |
| 386 | /.$putCase consumeInternalCompilationUnitWithTypes(); $break ./ |
| 387 | InternalCompilationUnit ::= PackageDeclaration TypeDeclarations |
| 388 | /.$putCase consumeInternalCompilationUnitWithTypes(); $break ./ |
| 389 | InternalCompilationUnit ::= ImportDeclarations ReduceImports |
| 390 | /.$putCase consumeInternalCompilationUnit(); $break ./ |
| 391 | InternalCompilationUnit ::= TypeDeclarations |
| 392 | /.$putCase consumeInternalCompilationUnitWithTypes(); $break ./ |
| 393 | InternalCompilationUnit ::= ImportDeclarations ReduceImports TypeDeclarations |
| 394 | /.$putCase consumeInternalCompilationUnitWithTypes(); $break ./ |
| 395 | InternalCompilationUnit ::= $empty |
| 396 | /.$putCase consumeEmptyInternalCompilationUnit(); $break ./ |
| 397 | /:$readableName CompilationUnit:/ |
| 398 | |
| 399 | ReduceImports ::= $empty |
| 400 | /.$putCase consumeReduceImports(); $break ./ |
| 401 | /:$readableName ReduceImports:/ |
| 402 | |
| 403 | EnterCompilationUnit ::= $empty |
| 404 | /.$putCase consumeEnterCompilationUnit(); $break ./ |
| 405 | /:$readableName EnterCompilationUnit:/ |
| 406 | |
| 407 | Header -> ImportDeclaration |
| 408 | Header -> PackageDeclaration |
| 409 | Header -> ClassHeader |
| 410 | Header -> InterfaceHeader |
| 411 | Header -> EnumHeader |
| 412 | Header -> AnnotationTypeDeclarationHeader |
| 413 | Header -> StaticInitializer |
| 414 | Header -> RecoveryMethodHeader |
| 415 | Header -> FieldDeclaration |
| 416 | Header -> AllocationHeader |
| 417 | Header -> ArrayCreationHeader |
| 418 | --{ObjectTeams: |
| 419 | Header -> RecoveryBindingHeader |
| 420 | Header -> PrecedenceDeclaration |
| 421 | -- SH} |
| 422 | /:$readableName Header:/ |
| 423 | |
| 424 | Header1 -> Header |
| 425 | Header1 -> ConstructorHeader |
| 426 | /:$readableName Header1:/ |
| 427 | |
| 428 | Header2 -> Header |
| 429 | Header2 -> EnumConstantHeader |
| 430 | /:$readableName Header2:/ |
| 431 | |
| 432 | CatchHeader ::= 'catch' '(' FormalParameter ')' '{' |
| 433 | /.$putCase consumeCatchHeader(); $break ./ |
| 434 | /:$readableName CatchHeader:/ |
| 435 | |
| 436 | ImportDeclarations -> ImportDeclaration |
| 437 | ImportDeclarations ::= ImportDeclarations ImportDeclaration |
| 438 | /.$putCase consumeImportDeclarations(); $break ./ |
| 439 | /:$readableName ImportDeclarations:/ |
| 440 | |
| 441 | TypeDeclarations -> TypeDeclaration |
| 442 | TypeDeclarations ::= TypeDeclarations TypeDeclaration |
| 443 | /.$putCase consumeTypeDeclarations(); $break ./ |
| 444 | /:$readableName TypeDeclarations:/ |
| 445 | |
| 446 | PackageDeclaration ::= PackageDeclarationName ';' |
| 447 | /.$putCase consumePackageDeclaration(); $break ./ |
| 448 | /:$readableName PackageDeclaration:/ |
| 449 | |
| 450 | PackageDeclarationName ::= Modifiers 'package' PushRealModifiers Name |
| 451 | /.$putCase consumePackageDeclarationNameWithModifiers(); $break ./ |
| 452 | /:$readableName PackageDeclarationName:/ |
| 453 | /:$compliance 1.5:/ |
| 454 | |
| 455 | PackageDeclarationName ::= PackageComment 'package' Name |
| 456 | /.$putCase consumePackageDeclarationName(); $break ./ |
| 457 | /:$readableName PackageDeclarationName:/ |
| 458 | |
| 459 | PackageComment ::= $empty |
| 460 | /.$putCase consumePackageComment(); $break ./ |
| 461 | /:$readableName PackageComment:/ |
| 462 | |
| 463 | ImportDeclaration -> SingleTypeImportDeclaration |
| 464 | ImportDeclaration -> TypeImportOnDemandDeclaration |
| 465 | ----------------------------------------------- |
| 466 | -- 1.5 feature |
| 467 | ----------------------------------------------- |
| 468 | ImportDeclaration -> SingleStaticImportDeclaration |
| 469 | --{ObjectTeams: base import: |
| 470 | ImportDeclaration -> SingleBaseImportDeclaration |
| 471 | -- SH} |
| 472 | ImportDeclaration -> StaticImportOnDemandDeclaration |
| 473 | /:$readableName ImportDeclaration:/ |
| 474 | |
| 475 | SingleTypeImportDeclaration ::= SingleTypeImportDeclarationName ';' |
| 476 | /.$putCase consumeImportDeclaration(); $break ./ |
| 477 | /:$readableName SingleTypeImportDeclaration:/ |
| 478 | |
| 479 | -- {ObjectTeams: special case: allow 'team' in imported package/type name: |
| 480 | -- orig: SingleTypeImportDeclarationName ::= 'import' Name |
| 481 | SingleTypeImportDeclarationName ::= 'import' ImportName |
| 482 | /.$putCase consumeSingleTypeImportDeclarationName(); $break ./ |
| 483 | /:$readableName SingleTypeImportDeclarationName:/ |
| 484 | |
| 485 | ImportName -> Name |
| 486 | ImportName ::= Name '.' 'team' '.' Name |
| 487 | /.$putCase consumeNameContainingTeam(); $break ./ |
| 488 | /:$readableName Name:/ |
| 489 | -- SH} |
| 490 | |
| 491 | TypeImportOnDemandDeclaration ::= TypeImportOnDemandDeclarationName ';' |
| 492 | /.$putCase consumeImportDeclaration(); $break ./ |
| 493 | /:$readableName TypeImportOnDemandDeclaration:/ |
| 494 | |
| 495 | TypeImportOnDemandDeclarationName ::= 'import' Name '.' '*' |
| 496 | /.$putCase consumeTypeImportOnDemandDeclarationName(); $break ./ |
| 497 | /:$readableName TypeImportOnDemandDeclarationName:/ |
| 498 | |
| 499 | TypeDeclaration -> ClassDeclaration |
| 500 | TypeDeclaration -> InterfaceDeclaration |
| 501 | -- this declaration in part of a list od declaration and we will |
| 502 | -- use and optimized list length calculation process |
| 503 | -- thus we decrement the number while it will be incremend..... |
| 504 | TypeDeclaration ::= ';' |
| 505 | /. $putCase consumeEmptyTypeDeclaration(); $break ./ |
| 506 | ----------------------------------------------- |
| 507 | -- 1.5 feature |
| 508 | ----------------------------------------------- |
| 509 | TypeDeclaration -> EnumDeclaration |
| 510 | TypeDeclaration -> AnnotationTypeDeclaration |
| 511 | /:$readableName TypeDeclaration:/ |
| 512 | |
| 513 | --18.7 Only in the LALR(1) Grammar |
| 514 | |
| 515 | Modifiers -> Modifier |
| 516 | Modifiers ::= Modifiers Modifier |
| 517 | /.$putCase consumeModifiers2(); $break ./ |
| 518 | /:$readableName Modifiers:/ |
| 519 | |
| 520 | Modifier -> 'public' |
| 521 | Modifier -> 'protected' |
| 522 | Modifier -> 'private' |
| 523 | Modifier -> 'static' |
| 524 | Modifier -> 'abstract' |
| 525 | Modifier -> 'final' |
| 526 | Modifier -> 'native' |
| 527 | Modifier -> 'synchronized' |
| 528 | Modifier -> 'transient' |
| 529 | Modifier -> 'volatile' |
| 530 | Modifier -> 'strictfp' |
| 531 | Modifier ::= Annotation |
| 532 | /.$putCase consumeAnnotationAsModifier(); $break ./ |
| 533 | -- {ObjectTeams |
| 534 | Modifier -> 'team' |
| 535 | Modifier -> 'callin' |
| 536 | Modifier -> 'readonly' |
| 537 | -- Markus Witte} |
| 538 | /:$readableName Modifier:/ |
| 539 | |
| 540 | --18.8 Productions from 8: Class Declarations |
| 541 | --ClassModifier ::= |
| 542 | -- 'abstract' |
| 543 | -- | 'final' |
| 544 | -- | 'public' |
| 545 | --18.8.1 Productions from 8.1: Class Declarations |
| 546 | |
| 547 | ClassDeclaration ::= ClassHeader ClassBody |
| 548 | /.$putCase consumeClassDeclaration(); $break ./ |
| 549 | /:$readableName ClassDeclaration:/ |
| 550 | |
| 551 | --{ObjectTeams: playedBy & guard predicate support: |
| 552 | -- orig: ClassHeader ::= ClassHeaderName ClassHeaderExtendsopt ClassHeaderImplementsopt |
| 553 | ClassHeader ::= ClassHeaderName ClassHeaderExtendsopt ClassHeaderImplementsopt ClassHeaderPlayedByopt Predicateopt |
| 554 | -- MW+SH} |
| 555 | /.$putCase consumeClassHeader(); $break ./ |
| 556 | /:$readableName ClassHeader:/ |
| 557 | |
| 558 | ----------------------------------------------- |
| 559 | -- 1.5 features : generics |
| 560 | ----------------------------------------------- |
| 561 | ClassHeaderName ::= ClassHeaderName1 TypeParameters |
| 562 | /.$putCase consumeTypeHeaderNameWithTypeParameters(); $break ./ |
| 563 | |
| 564 | ClassHeaderName -> ClassHeaderName1 |
| 565 | /:$readableName ClassHeaderName:/ |
| 566 | |
| 567 | ClassHeaderName1 ::= Modifiersopt 'class' 'Identifier' |
| 568 | /.$putCase consumeClassHeaderName1(); $break ./ |
| 569 | /:$readableName ClassHeaderName:/ |
| 570 | |
| 571 | ClassHeaderExtends ::= 'extends' ClassType |
| 572 | /.$putCase consumeClassHeaderExtends(); $break ./ |
| 573 | /:$readableName ClassHeaderExtends:/ |
| 574 | |
| 575 | ClassHeaderImplements ::= 'implements' InterfaceTypeList |
| 576 | /.$putCase consumeClassHeaderImplements(); $break ./ |
| 577 | /:$readableName ClassHeaderImplements:/ |
| 578 | |
| 579 | -- {ObjectTeams: ==== playedBy ==== |
| 580 | ClassHeaderPlayedByopt ::= $empty |
| 581 | ClassHeaderPlayedByopt -> ClassHeaderPlayedBy |
| 582 | /:$readableName ClassHeaderPlayedBy:/ |
| 583 | |
| 584 | ClassHeaderPlayedBy ::= 'playedBy' ClassType |
| 585 | /.$putCase consumeClassHeaderPlayedBy(); $break ./ |
| 586 | /:$readableName ClassHeaderPlayedBy:/ |
| 587 | |
| 588 | -- Markus Witte} |
| 589 | |
| 590 | --{ObjectTeams: ==== predicates ==== |
| 591 | Predicateopt ::= $empty |
| 592 | Predicateopt -> Predicate |
| 593 | |
| 594 | Predicate -> RolePredicate |
| 595 | Predicate -> BasePredicate |
| 596 | |
| 597 | RolePredicate ::= PredicateHeader PredicateBody |
| 598 | /:$readableName Predicate:/ |
| 599 | |
| 600 | PredicateHeader ::= 'when' |
| 601 | /.$putCase consumePredicate(false); $break ./ |
| 602 | /:$readableName PredicateHeader:/ |
| 603 | |
| 604 | BasePredicate ::= BasePredicateHeader ForceBaseIsIdentifier PredicateBody RestoreBaseKeyword |
| 605 | /:$readableName Predicate:/ |
| 606 | |
| 607 | BasePredicateHeader ::= 'base' 'when' |
| 608 | /.$putCase consumePredicate(true); $break ./ |
| 609 | /:$readableName PredicateHeader:/ |
| 610 | |
| 611 | PredicateBody ::= '(' ForceNoDiet Expression RestoreDiet ')' |
| 612 | /.$putCase consumePredicateExpression(); $break ./ |
| 613 | /:$readableName PredicateBody:/ |
| 614 | |
| 615 | PredicateBody ::= '(' ')' |
| 616 | /.$putCase consumePredicateMissingExpression(); $break ./ |
| 617 | |
| 618 | |
| 619 | ForceBaseIsIdentifier ::= $empty |
| 620 | /.$putCase consumeForceBaseIsIdentifier(); $break ./ |
| 621 | /:$readableName ForceBaseIsIdentifier:/ |
| 622 | |
| 623 | RestoreBaseKeyword ::= $empty |
| 624 | /.$putCase consumeRestoreBaseKeyword(); $break ./ |
| 625 | /:$readableName RestoreBaseKeyword:/ |
| 626 | -- SH} |
| 627 | |
| 628 | InterfaceTypeList -> InterfaceType |
| 629 | InterfaceTypeList ::= InterfaceTypeList ',' InterfaceType |
| 630 | /.$putCase consumeInterfaceTypeList(); $break ./ |
| 631 | /:$readableName InterfaceTypeList:/ |
| 632 | |
| 633 | InterfaceType ::= ClassOrInterfaceType |
| 634 | /.$putCase consumeInterfaceType(); $break ./ |
| 635 | /:$readableName InterfaceType:/ |
| 636 | |
| 637 | ClassBody ::= '{' ClassBodyDeclarationsopt '}' |
| 638 | /:$readableName ClassBody:/ |
| 639 | /:$no_statements_recovery:/ |
| 640 | |
| 641 | ClassBodyDeclarations ::= ClassBodyDeclaration |
| 642 | ClassBodyDeclarations ::= ClassBodyDeclarations ClassBodyDeclaration |
| 643 | /.$putCase consumeClassBodyDeclarations(); $break ./ |
| 644 | /:$readableName ClassBodyDeclarations:/ |
| 645 | |
| 646 | ClassBodyDeclaration -> ClassMemberDeclaration |
| 647 | ClassBodyDeclaration -> StaticInitializer |
| 648 | ClassBodyDeclaration -> ConstructorDeclaration |
| 649 | --1.1 feature |
| 650 | ClassBodyDeclaration ::= Diet NestedMethod CreateInitializer Block |
| 651 | /.$putCase consumeClassBodyDeclaration(); $break ./ |
| 652 | /:$readableName ClassBodyDeclaration:/ |
| 653 | |
| 654 | Diet ::= $empty |
| 655 | /.$putCase consumeDiet(); $break./ |
| 656 | /:$readableName Diet:/ |
| 657 | |
| 658 | Initializer ::= Diet NestedMethod CreateInitializer Block |
| 659 | /.$putCase consumeClassBodyDeclaration(); $break ./ |
| 660 | /:$readableName Initializer:/ |
| 661 | |
| 662 | CreateInitializer ::= $empty |
| 663 | /.$putCase consumeCreateInitializer(); $break./ |
| 664 | /:$readableName CreateInitializer:/ |
| 665 | |
| 666 | ClassMemberDeclaration -> FieldDeclaration |
| 667 | ClassMemberDeclaration -> MethodDeclaration |
| 668 | |
| 669 | -- {ObjectTeams |
| 670 | ClassMemberDeclaration -> BindingDeclaration |
| 671 | ClassMemberDeclaration -> PrecedenceDeclaration |
| 672 | -- Markus Witte} |
| 673 | |
| 674 | --1.1 feature |
| 675 | ClassMemberDeclaration -> ClassDeclaration |
| 676 | --1.1 feature |
| 677 | ClassMemberDeclaration -> InterfaceDeclaration |
| 678 | -- 1.5 feature |
| 679 | ClassMemberDeclaration -> EnumDeclaration |
| 680 | ClassMemberDeclaration -> AnnotationTypeDeclaration |
| 681 | /:$readableName ClassMemberDeclaration:/ |
| 682 | |
| 683 | -- Empty declarations are not valid Java ClassMemberDeclarations. |
| 684 | -- However, since the current (2/14/97) Java compiler accepts them |
| 685 | -- (in fact, some of the official tests contain this erroneous |
| 686 | -- syntax) |
| 687 | ClassMemberDeclaration ::= ';' |
| 688 | /.$putCase consumeEmptyTypeDeclaration(); $break./ |
| 689 | |
| 690 | GenericMethodDeclaration -> MethodDeclaration |
| 691 | GenericMethodDeclaration -> ConstructorDeclaration |
| 692 | /:$readableName GenericMethodDeclaration:/ |
| 693 | |
| 694 | --18.8.2 Productions from 8.3: Field Declarations |
| 695 | --VariableModifier ::= |
| 696 | -- 'public' |
| 697 | -- | 'protected' |
| 698 | -- | 'private' |
| 699 | -- | 'static' |
| 700 | -- | 'final' |
| 701 | -- | 'transient' |
| 702 | -- | 'volatile' |
| 703 | |
| 704 | FieldDeclaration ::= Modifiersopt Type VariableDeclarators ';' |
| 705 | /.$putCase consumeFieldDeclaration(); $break ./ |
| 706 | /:$readableName FieldDeclaration:/ |
| 707 | |
| 708 | VariableDeclarators -> VariableDeclarator |
| 709 | VariableDeclarators ::= VariableDeclarators ',' VariableDeclarator |
| 710 | /.$putCase consumeVariableDeclarators(); $break ./ |
| 711 | /:$readableName VariableDeclarators:/ |
| 712 | |
| 713 | VariableDeclarator ::= VariableDeclaratorId EnterVariable ExitVariableWithoutInitialization |
| 714 | VariableDeclarator ::= VariableDeclaratorId EnterVariable '=' ForceNoDiet VariableInitializer RestoreDiet ExitVariableWithInitialization |
| 715 | /:$readableName VariableDeclarator:/ |
| 716 | /:$recovery_template Identifier:/ |
| 717 | |
| 718 | EnterVariable ::= $empty |
| 719 | /.$putCase consumeEnterVariable(); $break ./ |
| 720 | /:$readableName EnterVariable:/ |
| 721 | |
| 722 | ExitVariableWithInitialization ::= $empty |
| 723 | /.$putCase consumeExitVariableWithInitialization(); $break ./ |
| 724 | /:$readableName ExitVariableWithInitialization:/ |
| 725 | |
| 726 | ExitVariableWithoutInitialization ::= $empty |
| 727 | /.$putCase consumeExitVariableWithoutInitialization(); $break ./ |
| 728 | /:$readableName ExitVariableWithoutInitialization:/ |
| 729 | |
| 730 | ForceNoDiet ::= $empty |
| 731 | /.$putCase consumeForceNoDiet(); $break ./ |
| 732 | /:$readableName ForceNoDiet:/ |
| 733 | RestoreDiet ::= $empty |
| 734 | /.$putCase consumeRestoreDiet(); $break ./ |
| 735 | /:$readableName RestoreDiet:/ |
| 736 | |
| 737 | VariableDeclaratorId ::= 'Identifier' Dimsopt |
| 738 | /:$readableName VariableDeclaratorId:/ |
| 739 | /:$recovery_template Identifier:/ |
| 740 | |
| 741 | VariableInitializer -> Expression |
| 742 | VariableInitializer -> ArrayInitializer |
| 743 | /:$readableName VariableInitializer:/ |
| 744 | /:$recovery_template Identifier:/ |
| 745 | |
| 746 | --18.8.3 Productions from 8.4: Method Declarations |
| 747 | --MethodModifier ::= |
| 748 | -- 'public' |
| 749 | -- | 'protected' |
| 750 | -- | 'private' |
| 751 | -- | 'static' |
| 752 | -- | 'abstract' |
| 753 | -- | 'final' |
| 754 | -- | 'native' |
| 755 | -- | 'synchronized' |
| 756 | -- |
| 757 | |
| 758 | MethodDeclaration -> AbstractMethodDeclaration |
| 759 | MethodDeclaration ::= MethodHeader MethodBody |
| 760 | /.$putCase // set to true to consume a method with a body |
| 761 | consumeMethodDeclaration(true); $break ./ |
| 762 | /:$readableName MethodDeclaration:/ |
| 763 | |
| 764 | AbstractMethodDeclaration ::= MethodHeader ';' |
| 765 | /.$putCase // set to false to consume a method without body |
| 766 | consumeMethodDeclaration(false); $break ./ |
| 767 | /:$readableName MethodDeclaration:/ |
| 768 | |
| 769 | MethodHeader ::= MethodHeaderName FormalParameterListopt MethodHeaderRightParen MethodHeaderExtendedDims MethodHeaderThrowsClauseopt |
| 770 | /.$putCase consumeMethodHeader(); $break ./ |
| 771 | /:$readableName MethodDeclaration:/ |
| 772 | |
| 773 | MethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '(' |
| 774 | /.$putCase consumeMethodHeaderNameWithTypeParameters(false); $break ./ |
| 775 | MethodHeaderName ::= Modifiersopt Type 'Identifier' '(' |
| 776 | /.$putCase consumeMethodHeaderName(false); $break ./ |
| 777 | /:$readableName MethodHeaderName:/ |
| 778 | |
| 779 | MethodHeaderRightParen ::= ')' |
| 780 | /.$putCase consumeMethodHeaderRightParen(); $break ./ |
| 781 | /:$readableName ):/ |
| 782 | /:$recovery_template ):/ |
| 783 | |
| 784 | MethodHeaderExtendedDims ::= Dimsopt |
| 785 | /.$putCase consumeMethodHeaderExtendedDims(); $break ./ |
| 786 | /:$readableName MethodHeaderExtendedDims:/ |
| 787 | |
| 788 | MethodHeaderThrowsClause ::= 'throws' ClassTypeList |
| 789 | /.$putCase consumeMethodHeaderThrowsClause(); $break ./ |
| 790 | /:$readableName MethodHeaderThrowsClause:/ |
| 791 | |
| 792 | ConstructorHeader ::= ConstructorHeaderName FormalParameterListopt MethodHeaderRightParen MethodHeaderThrowsClauseopt |
| 793 | /.$putCase consumeConstructorHeader(); $break ./ |
| 794 | /:$readableName ConstructorDeclaration:/ |
| 795 | |
| 796 | ConstructorHeaderName ::= Modifiersopt TypeParameters 'Identifier' '(' |
| 797 | /.$putCase consumeConstructorHeaderNameWithTypeParameters(); $break ./ |
| 798 | ConstructorHeaderName ::= Modifiersopt 'Identifier' '(' |
| 799 | /.$putCase consumeConstructorHeaderName(); $break ./ |
| 800 | /:$readableName ConstructorHeaderName:/ |
| 801 | |
| 802 | FormalParameterList -> FormalParameter |
| 803 | FormalParameterList ::= FormalParameterList ',' FormalParameter |
| 804 | /.$putCase consumeFormalParameterList(); $break ./ |
| 805 | /:$readableName FormalParameterList:/ |
| 806 | |
| 807 | --1.1 feature |
| 808 | FormalParameter ::= Modifiersopt Type VariableDeclaratorId |
| 809 | /.$putCase consumeFormalParameter(false); $break ./ |
| 810 | FormalParameter ::= Modifiersopt Type '...' VariableDeclaratorId |
| 811 | /.$putCase consumeFormalParameter(true); $break ./ |
| 812 | /:$readableName FormalParameter:/ |
| 813 | /:$compliance 1.5:/ |
| 814 | /:$recovery_template Identifier Identifier:/ |
| 815 | |
| 816 | ClassTypeList -> ClassTypeElt |
| 817 | ClassTypeList ::= ClassTypeList ',' ClassTypeElt |
| 818 | /.$putCase consumeClassTypeList(); $break ./ |
| 819 | /:$readableName ClassTypeList:/ |
| 820 | |
| 821 | ClassTypeElt ::= ClassType |
| 822 | /.$putCase consumeClassTypeElt(); $break ./ |
| 823 | /:$readableName ClassType:/ |
| 824 | |
| 825 | -- {ObjectTeams: added Predicateopt |
| 826 | MethodBody ::= Predicateopt NestedMethod '{' BlockStatementsopt '}' |
| 827 | /.$putCase consumeMethodBody(); $break ./ |
| 828 | /:$readableName MethodBody:/ |
| 829 | /:$no_statements_recovery:/ |
| 830 | -- SH} |
| 831 | |
| 832 | NestedMethod ::= $empty |
| 833 | /.$putCase consumeNestedMethod(); $break ./ |
| 834 | /:$readableName NestedMethod:/ |
| 835 | |
| 836 | -- {ObjectTeams ========== METHOD BINDINGS ========== |
| 837 | BindingDeclaration -> CalloutBinding |
| 838 | BindingDeclaration -> CallinBinding |
| 839 | BindingDeclaration -> InvalidCallinBinding |
| 840 | /:$readableName BindingDeclaration:/ |
| 841 | |
| 842 | -- ==== CALLOUT: ==== |
| 843 | |
| 844 | -- LONG: |
| 845 | CalloutBinding ::= CalloutHeaderLong CalloutParameterMappingsopt |
| 846 | /.$putCase consumeCalloutBindingLong(); $break ./ |
| 847 | /:$readableName CalloutBinding:/ |
| 848 | |
| 849 | CalloutHeaderLong ::= CalloutBindingLeftLong MethodSpecLong |
| 850 | /.$putCase consumeCalloutHeader(); $break ./ |
| 851 | /:$readableName CalloutHeader:/ |
| 852 | |
| 853 | CalloutHeaderLong ::= CalloutBindingLeftLong CalloutFieldSpecLong |
| 854 | /.$putCase consumeCalloutHeader(); $break ./ |
| 855 | /:$readableName CalloutHeader:/ |
| 856 | |
| 857 | CalloutBindingLeftLong ::= MethodSpecLong CalloutKind |
| 858 | /.$putCase consumeCalloutBindingLeft(true); $break ./ |
| 859 | /:$readableName CalloutBindingLeft:/ |
| 860 | |
| 861 | |
| 862 | -- SHORT: |
| 863 | -- Note(SH): Modifiersopt is needed to make grammar LALR(1), in real life modifiers must be empty |
| 864 | -- Note(SH): This rule includes callout to field short (there cannot be a distinct FieldSpecShort) |
| 865 | CalloutBinding ::= Modifiersopt CalloutBindingLeftShort CalloutModifieropt MethodSpecShort ';' |
| 866 | /.$putCase consumeCalloutHeader(); $break ./ |
| 867 | /:$readableName CalloutHeader:/ |
| 868 | |
| 869 | CalloutBindingLeftShort ::= MethodSpecShort CalloutKind |
| 870 | /.$putCase consumeCalloutBindingLeft(false); $break ./ |
| 871 | /:$readableName CalloutBindingLeft:/ |
| 872 | |
| 873 | -- this one added to give better message for parameter mappings despite of missing signatures: |
| 874 | -- Note(SH): Modifiersopt is needed to make grammar LALR(1), in real life modifiers must be empty |
| 875 | CalloutBinding ::= Modifiersopt CalloutBindingLeftShort CalloutModifieropt MethodSpecShort CalloutParameterMappings |
| 876 | /.$putCase consumeCalloutParameterMappingsInvalid(); $break ./ |
| 877 | |
| 878 | -- SYMBOLS: |
| 879 | CalloutKind -> '->' |
| 880 | CalloutKind -> '=>' |
| 881 | /:$readableName CalloutKind:/ |
| 882 | |
| 883 | CalloutModifieropt ::= $empty |
| 884 | CalloutModifieropt -> CalloutModifier |
| 885 | /:$readableName CalloutModifier:/ |
| 886 | -- get set |
| 887 | CalloutModifier ::= 'get' |
| 888 | /.$putCase consumeCalloutModifier(TokenNameget); $break ./ |
| 889 | /:$readableName CalloutModifier:/ |
| 890 | CalloutModifier ::= 'set' |
| 891 | /.$putCase consumeCalloutModifier(TokenNameset); $break ./ |
| 892 | /:$readableName CalloutModifier:/ |
| 893 | |
| 894 | |
| 895 | ---- CALLOUT-BINDING-PARAMETERMAPPING |
| 896 | CalloutParameterMappingsopt -> CalloutParameterMappings |
| 897 | CalloutParameterMappingsopt ::= ';' |
| 898 | /.$putCase consumeParameterMappingsEmpty(); $break ./ |
| 899 | /:$readableName EmptyParameterMappings:/ |
| 900 | |
| 901 | |
| 902 | CalloutParameterMappings ::= 'with' NestedParamMappings '{' CalloutParameterMappingList ,opt '}' |
| 903 | /:$readableName CalloutParameterMappings:/ |
| 904 | |
| 905 | -- note that this rule is needed for diagnose parsing where bodies of parameter mappings are ignored |
| 906 | CalloutParameterMappingList ::= $empty |
| 907 | /:$readableName EmptyParameterMappings:/ |
| 908 | |
| 909 | CalloutParameterMappingList -> ParameterMapping |
| 910 | CalloutParameterMappingList ::= CalloutParameterMappingList ',' ParameterMapping |
| 911 | /.$putCase consumeParameterMappingList(); $break ./ |
| 912 | /:$readableName CalloutParameterMappingList:/ |
| 913 | |
| 914 | ParameterMapping ::= Expression '->' 'Identifier' |
| 915 | /.$putCase consumeParameterMappingOut(); $break ./ |
| 916 | |
| 917 | ParameterMapping ::= 'Identifier' '<-' ForceBaseIsIdentifier Expression RestoreBaseKeyword |
| 918 | /.$putCase consumeParameterMappingIn(); $break ./ |
| 919 | /:$readableName ParameterMapping:/ |
| 920 | |
| 921 | |
| 922 | NestedParamMappings ::= $empty |
| 923 | /.$putCase consumeNestedParamMappings(); $break ./ |
| 924 | /:$readableName NestedParameterMappings:/ |
| 925 | |
| 926 | -- ==== CALLIN-BINDING: ==== |
| 927 | |
| 928 | -- LONG: |
| 929 | CallinBinding ::= CallinHeaderLong CallinParameterMappingsopt |
| 930 | /.$putCase consumeCallinBindingLong(); $break ./ |
| 931 | /:$readableName CallinBinding:/ |
| 932 | |
| 933 | CallinHeaderLong ::= CallinBindingLeftLong CallinModifier MethodSpecsLong Predicateopt |
| 934 | /.$putCase consumeCallinHeader(); $break ./ |
| 935 | /:$readableName CallinHeader:/ |
| 936 | |
| 937 | -- Note(SH): Modifiersopt is needed to make grammar LALR(1), in real life modifiers must be empty |
| 938 | CallinHeaderLong ::= Modifiersopt CallinLabel CallinBindingLeftLong CallinModifier MethodSpecsLong Predicateopt |
| 939 | /.$putCase consumeCallinHeader(); $break ./ |
| 940 | |
| 941 | CallinBindingLeftLong ::= MethodSpecLong '<-' |
| 942 | /.$putCase consumeCallinBindingLeft(true); $break ./ |
| 943 | /:$readableName CallinBindingLeft:/ |
| 944 | |
| 945 | -- SHORT: |
| 946 | -- Note(SH): Modifiersopt is needed to make grammar LALR(1), in real life modifiers must be empty |
| 947 | CallinBinding ::= Modifiersopt CallinBindingLeftShort CallinModifier BaseMethodSpecsShort Predicateopt ';' |
| 948 | /.$putCase consumeCallinHeader(); $break ./ |
| 949 | |
| 950 | -- Note(SH): Modifiersopt is needed to make grammar LALR(1), in real life modifiers must be empty (2 OCCURENCES!) |
| 951 | CallinBinding ::= Modifiersopt CallinLabel Modifiersopt CallinBindingLeftShort CallinModifier BaseMethodSpecsShort Predicateopt ';' |
| 952 | /.$putCase consumeCallinHeader(); $break ./ |
| 953 | |
| 954 | CallinBindingLeftShort ::= MethodSpecShort '<-' |
| 955 | /.$putCase consumeCallinBindingLeft(false); $break ./ |
| 956 | /:$readableName CallinBindingLeft:/ |
| 957 | |
| 958 | -- LABEL: |
| 959 | CallinLabel ::= SimpleName ':' |
| 960 | /.$putCase consumeCallinLabel(); $break ./ |
| 961 | /:$readableName CallinLabel:/ |
| 962 | |
| 963 | -- MODIFIER: |
| 964 | CallinModifier ::= 'replace' |
| 965 | /.$putCase consumeCallinModifier(TokenNamereplace); $break ./ |
| 966 | /:$readableName CallinModifier:/ |
| 967 | |
| 968 | CallinModifier ::= 'before' |
| 969 | /.$putCase consumeCallinModifier(TokenNamebefore); $break ./ |
| 970 | /:$readableName CallinModifier:/ |
| 971 | |
| 972 | CallinModifier ::= 'after' |
| 973 | /.$putCase consumeCallinModifier(TokenNameafter); $break ./ |
| 974 | /:$readableName CallinModifier:/ |
| 975 | |
| 976 | |
| 977 | -- These rules are added to parse invalid callin-bindings without replace/before/after modifier |
| 978 | InvalidCallinModifier ::= $empty |
| 979 | /.$putCase consumeCallinModifierMissing(); $break ./ |
| 980 | /:$readableName InvalidCallinModifier:/ |
| 981 | |
| 982 | -- Note(SH): Modifiersopt is needed to make grammar LALR(1), in real life modifiers must be empty |
| 983 | InvalidCallinBinding ::= Modifiersopt CallinBindingLeftShort InvalidCallinModifier BaseMethodSpecsShort |
| 984 | /.$putCase consumeCallinBindingInvalid(false,false); $break ./ |
| 985 | /:$readableName InvalidCallinBinding:/ |
| 986 | |
| 987 | InvalidCallinBinding ::= Modifiersopt CallinLabel Modifiersopt CallinBindingLeftShort InvalidCallinModifier BaseMethodSpecsShort |
| 988 | /.$putCase consumeCallinBindingInvalid(false,false); $break ./ |
| 989 | /:$readableName InvalidCallinBinding:/ |
| 990 | |
| 991 | InvalidCallinBinding ::= Modifiersopt CallinBindingLeftShort CallinModifier BaseMethodSpecsShort CallinParameterMappings |
| 992 | /.$putCase consumeCallinBindingInvalid(false,true); $break ./ |
| 993 | /:$readableName InvalidCallinBinding:/ |
| 994 | |
| 995 | InvalidCallinBinding ::= Modifiersopt CallinLabel Modifiersopt CallinBindingLeftShort CallinModifier BaseMethodSpecsShort CallinParameterMappings |
| 996 | /.$putCase consumeCallinBindingInvalid(false,true); $break ./ |
| 997 | /:$readableName InvalidCallinBinding:/ |
| 998 | |
| 999 | InvalidCallinBinding ::= CallinBindingLeftLong InvalidCallinModifier MethodSpecsLong CallinParameterMappingsopt |
| 1000 | /.$putCase consumeCallinBindingInvalid(true,false); $break ./ |
| 1001 | /:$readableName InvalidCallinBinding:/ |
| 1002 | |
| 1003 | InvalidCallinBinding ::= Modifiersopt CallinLabel CallinBindingLeftLong InvalidCallinModifier MethodSpecsLong CallinParameterMappingsopt |
| 1004 | /.$putCase consumeCallinBindingInvalid(true,false); $break ./ |
| 1005 | /:$readableName InvalidCallinBinding:/ |
| 1006 | |
| 1007 | |
| 1008 | ---- CALLIN-BINDING-PARAMETERMAPPING |
| 1009 | CallinParameterMappingsopt -> CallinParameterMappings |
| 1010 | CallinParameterMappingsopt ::= ';' |
| 1011 | /.$putCase consumeParameterMappingsEmpty(); $break ./ |
| 1012 | /:$readableName EmptyParameterMappings:/ |
| 1013 | |
| 1014 | CallinParameterMappings ::= 'with' NestedParamMappings '{' CallinParameterMappingList ,opt '}' |
| 1015 | /:$readableName CallinParameterMappings:/ |
| 1016 | |
| 1017 | -- note that this rule is needed for diagnose parsing where bodies of parameter mappings are ignored |
| 1018 | CallinParameterMappingList ::= $empty |
| 1019 | /:$readableName EmptyParameterMappings:/ |
| 1020 | |
| 1021 | CallinParameterMappingList -> ParameterMapping |
| 1022 | CallinParameterMappingList ::= CallinParameterMappingList ',' ParameterMapping |
| 1023 | /.$putCase consumeParameterMappingList(); $break ./ |
| 1024 | /:$readableName ParameterMappingList:/ |
| 1025 | |
| 1026 | -- ==== METHOD_SPEC: ==== |
| 1027 | |
| 1028 | MethodSpecShort ::= SimpleName |
| 1029 | /.$putCase consumeMethodSpecShort(); $break ./ |
| 1030 | /:$readableName MethodSpecShort:/ |
| 1031 | |
| 1032 | MethodSpecLong ::= MethodHeaderName FormalParameterListopt MethodHeaderRightParen |
| 1033 | /.$putCase consumeMethodSpecLong(false); $break ./ |
| 1034 | /:$readableName MethodSpecLong:/ |
| 1035 | |
| 1036 | -- explicitly handle this error case: |
| 1037 | MethodSpecLong ::= ConstructorHeaderName FormalParameterListopt MethodHeaderRightParen |
| 1038 | /.$putCase consumeMethodSpecLongCtor(); $break ./ |
| 1039 | /:$readableName IllegalMethodSpecLong:/ |
| 1040 | |
| 1041 | -- base of callin can use '+' after return type: |
| 1042 | BaseMethodSpecLong ::= MethodHeaderName FormalParameterListopt MethodHeaderRightParen |
| 1043 | /.$putCase consumeMethodSpecLong(false); $break ./ |
| 1044 | /:$readableName MethodSpecLong:/ |
| 1045 | |
| 1046 | BaseMethodSpecLong ::= MethodSpecNamePlus FormalParameterListopt MethodHeaderRightParen |
| 1047 | /.$putCase consumeMethodSpecLong(true); $break ./ |
| 1048 | /:$readableName MethodSpecLong:/ |
| 1049 | |
| 1050 | MethodSpecNamePlus ::= Modifiersopt Type '+' 'Identifier' '(' |
| 1051 | /.$putCase consumeMethodHeaderName(false); $break ./ |
| 1052 | /:$readableName MethodSpecName:/ |
| 1053 | |
| 1054 | CalloutFieldSpecLong ::= CalloutModifier Type 'Identifier' |
| 1055 | /.$putCase consumeFieldSpecLong(); $break ./ |
| 1056 | /:$readableName CallloutFieldSpec:/ |
| 1057 | |
| 1058 | BaseMethodSpecsShort -> BaseMethodSpecListShort |
| 1059 | /:$readableName MethodSpecsShort:/ |
| 1060 | |
| 1061 | BaseMethodSpecListShort -> BaseMethodSpecShort |
| 1062 | BaseMethodSpecListShort ::= BaseMethodSpecListShort ',' BaseMethodSpecShort |
| 1063 | /.$putCase consumeMethodSpecList(); $break ./ |
| 1064 | /:$readableName MethodSpecListShort:/ |
| 1065 | |
| 1066 | BaseMethodSpecShort -> MethodSpecShort |
| 1067 | |
| 1068 | MethodSpecsLong -> MethodSpecListLong |
| 1069 | /:$readableName MethodSpecsLong:/ |
| 1070 | |
| 1071 | MethodSpecListLong -> BaseMethodSpecLong |
| 1072 | MethodSpecListLong ::= MethodSpecListLong ',' BaseMethodSpecLong |
| 1073 | /.$putCase consumeMethodSpecList(); $break ./ |
| 1074 | /:$readableName MethodSpecListLong:/ |
| 1075 | |
| 1076 | -- ==== PRECEDENCE DECLARATION ==== |
| 1077 | PrecedenceDeclaration ::= 'precedence' BindingNames ';' |
| 1078 | /.$putCase consumePrecedenceDeclaration(false); $break ./ |
| 1079 | /:$readableName PrecedenceDeclaration:/ |
| 1080 | |
| 1081 | PrecedenceDeclaration ::= 'precedence' 'after' BindingNames ';' |
| 1082 | /.$putCase consumePrecedenceDeclaration(true); $break ./ |
| 1083 | /:$readableName PrecedenceAfterDeclaration:/ |
| 1084 | |
| 1085 | BindingNames -> BindingName |
| 1086 | BindingNames ::= BindingNames ',' BindingName |
| 1087 | /.$putCase consumeBindingNames(); $break ./ |
| 1088 | /:$readableName CallinBindingNames:/ |
| 1089 | |
| 1090 | BindingName ::= Name |
| 1091 | /.$putCase consumeBindingName(); $break ./ |
| 1092 | /:$readableName CallinBindingName:/ |
| 1093 | -- Markus Witte} |
| 1094 | |
| 1095 | --18.8.4 Productions from 8.5: Static Initializers |
| 1096 | |
| 1097 | StaticInitializer ::= StaticOnly Block |
| 1098 | /.$putCase consumeStaticInitializer(); $break./ |
| 1099 | /:$readableName StaticInitializer:/ |
| 1100 | |
| 1101 | StaticOnly ::= 'static' |
| 1102 | /.$putCase consumeStaticOnly(); $break ./ |
| 1103 | /:$readableName StaticOnly:/ |
| 1104 | |
| 1105 | --18.8.5 Productions from 8.6: Constructor Declarations |
| 1106 | --ConstructorModifier ::= |
| 1107 | -- 'public' |
| 1108 | -- | 'protected' |
| 1109 | -- | 'private' |
| 1110 | -- |
| 1111 | -- |
| 1112 | ConstructorDeclaration ::= ConstructorHeader MethodBody |
| 1113 | /.$putCase consumeConstructorDeclaration() ; $break ./ |
| 1114 | -- These rules are added to be able to parse constructors with no body |
| 1115 | ConstructorDeclaration ::= ConstructorHeader ';' |
| 1116 | /.$putCase consumeInvalidConstructorDeclaration() ; $break ./ |
| 1117 | /:$readableName ConstructorDeclaration:/ |
| 1118 | |
| 1119 | -- the rules ExplicitConstructorInvocationopt has been expanded |
| 1120 | -- in the rule below in order to make the grammar lalr(1). |
| 1121 | |
| 1122 | ExplicitConstructorInvocation ::= 'this' '(' ArgumentListopt ')' ';' |
| 1123 | /.$putCase consumeExplicitConstructorInvocation(0, THIS_CALL); $break ./ |
| 1124 | |
| 1125 | ExplicitConstructorInvocation ::= OnlyTypeArguments 'this' '(' ArgumentListopt ')' ';' |
| 1126 | /.$putCase consumeExplicitConstructorInvocationWithTypeArguments(0,THIS_CALL); $break ./ |
| 1127 | |
| 1128 | ExplicitConstructorInvocation ::= 'super' '(' ArgumentListopt ')' ';' |
| 1129 | /.$putCase consumeExplicitConstructorInvocation(0,SUPER_CALL); $break ./ |
| 1130 | |
| 1131 | ExplicitConstructorInvocation ::= OnlyTypeArguments 'super' '(' ArgumentListopt ')' ';' |
| 1132 | /.$putCase consumeExplicitConstructorInvocationWithTypeArguments(0,SUPER_CALL); $break ./ |
| 1133 | |
| 1134 | -- {ObjectTeams |
| 1135 | ExplicitConstructorInvocation ::= 'tsuper' '(' ArgumentListopt ')' ';' |
| 1136 | /.$putCase consumeExplicitConstructorInvocation(0,TSUPER_CALL); $break ./ |
| 1137 | |
| 1138 | ExplicitConstructorInvocation ::= Name '.' 'tsuper' '(' ArgumentListopt ')' ';' |
| 1139 | /.$putCase consumeExplicitConstructorInvocation(2,TSUPER_CALL); $break ./ |
| 1140 | -- Markus Witte} |
| 1141 | |
| 1142 | --1.1 feature |
| 1143 | ExplicitConstructorInvocation ::= Primary '.' 'super' '(' ArgumentListopt ')' ';' |
| 1144 | /.$putCase consumeExplicitConstructorInvocation(1, SUPER_CALL); $break ./ |
| 1145 | |
| 1146 | ExplicitConstructorInvocation ::= Primary '.' OnlyTypeArguments 'super' '(' ArgumentListopt ')' ';' |
| 1147 | /.$putCase consumeExplicitConstructorInvocationWithTypeArguments(1, SUPER_CALL); $break ./ |
| 1148 | |
| 1149 | --1.1 feature |
| 1150 | ExplicitConstructorInvocation ::= Name '.' 'super' '(' ArgumentListopt ')' ';' |
| 1151 | /.$putCase consumeExplicitConstructorInvocation(2, SUPER_CALL); $break ./ |
| 1152 | |
| 1153 | ExplicitConstructorInvocation ::= Name '.' OnlyTypeArguments 'super' '(' ArgumentListopt ')' ';' |
| 1154 | /.$putCase consumeExplicitConstructorInvocationWithTypeArguments(2, SUPER_CALL); $break ./ |
| 1155 | |
| 1156 | --1.1 feature |
| 1157 | ExplicitConstructorInvocation ::= Primary '.' 'this' '(' ArgumentListopt ')' ';' |
| 1158 | /.$putCase consumeExplicitConstructorInvocation(1, THIS_CALL); $break ./ |
| 1159 | |
| 1160 | ExplicitConstructorInvocation ::= Primary '.' OnlyTypeArguments 'this' '(' ArgumentListopt ')' ';' |
| 1161 | /.$putCase consumeExplicitConstructorInvocationWithTypeArguments(1, THIS_CALL); $break ./ |
| 1162 | |
| 1163 | --1.1 feature |
| 1164 | ExplicitConstructorInvocation ::= Name '.' 'this' '(' ArgumentListopt ')' ';' |
| 1165 | /.$putCase consumeExplicitConstructorInvocation(2, THIS_CALL); $break ./ |
| 1166 | |
| 1167 | ExplicitConstructorInvocation ::= Name '.' OnlyTypeArguments 'this' '(' ArgumentListopt ')' ';' |
| 1168 | /.$putCase consumeExplicitConstructorInvocationWithTypeArguments(2, THIS_CALL); $break ./ |
| 1169 | /:$readableName ExplicitConstructorInvocation:/ |
| 1170 | |
| 1171 | -- {ObjectTeams |
| 1172 | BaseConstructorExpression ::= 'base' '(' ArgumentListopt ')' |
| 1173 | /.$putCase consumeExplicitConstructorInvocationBase(0); $break ./ |
| 1174 | /:$readableName BaseConstructorInvocation:/ |
| 1175 | |
| 1176 | BaseConstructorInvocation ::= 'base' '(' ArgumentListopt ')' |
| 1177 | /.$putCase consumeExplicitConstructorInvocationBase(1); $break ./ |
| 1178 | /:$readableName BaseConstructorInvocation:/ |
| 1179 | |
| 1180 | BaseConstructorInvocation ::= Primary . 'base' '(' ArgumentListopt ')' |
| 1181 | /.$putCase consumeExplicitConstructorInvocationBase(2); $break ./ |
| 1182 | /:$readableName QualifiedBaseConstructorInvocation:/ |
| 1183 | |
| 1184 | BaseConstructorInvocation ::= Name . 'base' '(' ArgumentListopt ')' |
| 1185 | /.$putCase consumeExplicitConstructorInvocationBase(3); $break ./ |
| 1186 | /:$readableName QualifiedBaseConstructorInvocation:/ |
| 1187 | -- Markus Witte} |
| 1188 | |
| 1189 | --18.9 Productions from 9: Interface Declarations |
| 1190 | |
| 1191 | --18.9.1 Productions from 9.1: Interface Declarations |
| 1192 | --InterfaceModifier ::= |
| 1193 | -- 'public' |
| 1194 | -- | 'abstract' |
| 1195 | -- |
| 1196 | InterfaceDeclaration ::= InterfaceHeader InterfaceBody |
| 1197 | /.$putCase consumeInterfaceDeclaration(); $break ./ |
| 1198 | /:$readableName InterfaceDeclaration:/ |
| 1199 | |
| 1200 | -- {ObjectTeams |
| 1201 | -- orig: InterfaceHeader ::= InterfaceHeaderName InterfaceHeaderExtendsopt |
| 1202 | InterfaceHeader ::= InterfaceHeaderName InterfaceHeaderExtendsopt ClassHeaderPlayedByopt |
| 1203 | -- SH} |
| 1204 | /.$putCase consumeInterfaceHeader(); $break ./ |
| 1205 | /:$readableName InterfaceHeader:/ |
| 1206 | |
| 1207 | ----------------------------------------------- |
| 1208 | -- 1.5 features : generics |
| 1209 | ----------------------------------------------- |
| 1210 | InterfaceHeaderName ::= InterfaceHeaderName1 TypeParameters |
| 1211 | /.$putCase consumeTypeHeaderNameWithTypeParameters(); $break ./ |
| 1212 | |
| 1213 | InterfaceHeaderName -> InterfaceHeaderName1 |
| 1214 | /:$readableName InterfaceHeaderName:/ |
| 1215 | |
| 1216 | InterfaceHeaderName1 ::= Modifiersopt interface Identifier |
| 1217 | /.$putCase consumeInterfaceHeaderName1(); $break ./ |
| 1218 | /:$readableName InterfaceHeaderName:/ |
| 1219 | |
| 1220 | InterfaceHeaderExtends ::= 'extends' InterfaceTypeList |
| 1221 | /.$putCase consumeInterfaceHeaderExtends(); $break ./ |
| 1222 | /:$readableName InterfaceHeaderExtends:/ |
| 1223 | |
| 1224 | InterfaceBody ::= '{' InterfaceMemberDeclarationsopt '}' |
| 1225 | /:$readableName InterfaceBody:/ |
| 1226 | |
| 1227 | InterfaceMemberDeclarations -> InterfaceMemberDeclaration |
| 1228 | InterfaceMemberDeclarations ::= InterfaceMemberDeclarations InterfaceMemberDeclaration |
| 1229 | /.$putCase consumeInterfaceMemberDeclarations(); $break ./ |
| 1230 | /:$readableName InterfaceMemberDeclarations:/ |
| 1231 | |
| 1232 | --same as for class members |
| 1233 | InterfaceMemberDeclaration ::= ';' |
| 1234 | /.$putCase consumeEmptyTypeDeclaration(); $break ./ |
| 1235 | /:$readableName InterfaceMemberDeclaration:/ |
| 1236 | |
| 1237 | InterfaceMemberDeclaration -> ConstantDeclaration |
| 1238 | InterfaceMemberDeclaration ::= MethodHeader MethodBody |
| 1239 | /.$putCase consumeInvalidMethodDeclaration(); $break ./ |
| 1240 | /:$readableName InterfaceMemberDeclaration:/ |
| 1241 | |
| 1242 | -- These rules are added to be able to parse constructors inside interface and then report a relevent error message |
| 1243 | InvalidConstructorDeclaration ::= ConstructorHeader MethodBody |
| 1244 | /.$putCase consumeInvalidConstructorDeclaration(true); $break ./ |
| 1245 | InvalidConstructorDeclaration ::= ConstructorHeader ';' |
| 1246 | /.$putCase consumeInvalidConstructorDeclaration(false); $break ./ |
| 1247 | /:$readableName InvalidConstructorDeclaration:/ |
| 1248 | |
| 1249 | -- These rules are added to be able to parse initializers inside an interface and then report a relevent error message (bug 212713) |
| 1250 | InvalidInitializer -> StaticInitializer |
| 1251 | InvalidInitializer -> Initializer |
| 1252 | /:$readableName InvalidInitializer:/ |
| 1253 | |
| 1254 | |
| 1255 | InterfaceMemberDeclaration -> AbstractMethodDeclaration |
| 1256 | InterfaceMemberDeclaration -> InvalidConstructorDeclaration |
| 1257 | InterfaceMemberDeclaration -> InvalidInitializer |
| 1258 | --1.1 feature |
| 1259 | InterfaceMemberDeclaration -> ClassDeclaration |
| 1260 | --1.1 feature |
| 1261 | InterfaceMemberDeclaration -> InterfaceDeclaration |
| 1262 | InterfaceMemberDeclaration -> EnumDeclaration |
| 1263 | InterfaceMemberDeclaration -> AnnotationTypeDeclaration |
| 1264 | --{ObjectTeams: bindings in role interfaces: |
| 1265 | InterfaceMemberDeclaration -> BindingDeclaration |
| 1266 | -- SH} |
| 1267 | /:$readableName InterfaceMemberDeclaration:/ |
| 1268 | |
| 1269 | ConstantDeclaration -> FieldDeclaration |
| 1270 | /:$readableName ConstantDeclaration:/ |
| 1271 | |
| 1272 | PushLeftBrace ::= $empty |
| 1273 | /.$putCase consumePushLeftBrace(); $break ./ |
| 1274 | /:$readableName PushLeftBrace:/ |
| 1275 | |
| 1276 | ArrayInitializer ::= '{' PushLeftBrace ,opt '}' |
| 1277 | /.$putCase consumeEmptyArrayInitializer(); $break ./ |
| 1278 | ArrayInitializer ::= '{' PushLeftBrace VariableInitializers '}' |
| 1279 | /.$putCase consumeArrayInitializer(); $break ./ |
| 1280 | ArrayInitializer ::= '{' PushLeftBrace VariableInitializers , '}' |
| 1281 | /.$putCase consumeArrayInitializer(); $break ./ |
| 1282 | /:$readableName ArrayInitializer:/ |
| 1283 | /:$recovery_template Identifier:/ |
| 1284 | |
| 1285 | VariableInitializers ::= VariableInitializer |
| 1286 | VariableInitializers ::= VariableInitializers ',' VariableInitializer |
| 1287 | /.$putCase consumeVariableInitializers(); $break ./ |
| 1288 | /:$readableName VariableInitializers:/ |
| 1289 | |
| 1290 | Block ::= OpenBlock '{' BlockStatementsopt '}' |
| 1291 | /.$putCase consumeBlock(); $break ./ |
| 1292 | /:$readableName Block:/ |
| 1293 | |
| 1294 | OpenBlock ::= $empty |
| 1295 | /.$putCase consumeOpenBlock() ; $break ./ |
| 1296 | /:$readableName OpenBlock:/ |
| 1297 | |
| 1298 | BlockStatements -> BlockStatement |
| 1299 | BlockStatements ::= BlockStatements BlockStatement |
| 1300 | /.$putCase consumeBlockStatements() ; $break ./ |
| 1301 | /:$readableName BlockStatements:/ |
| 1302 | |
| 1303 | BlockStatement -> LocalVariableDeclarationStatement |
| 1304 | BlockStatement -> Statement |
| 1305 | --1.1 feature |
| 1306 | BlockStatement -> ClassDeclaration |
| 1307 | BlockStatement ::= InterfaceDeclaration |
| 1308 | /.$putCase consumeInvalidInterfaceDeclaration(); $break ./ |
| 1309 | /:$readableName BlockStatement:/ |
| 1310 | BlockStatement ::= AnnotationTypeDeclaration |
| 1311 | /.$putCase consumeInvalidAnnotationTypeDeclaration(); $break ./ |
| 1312 | /:$readableName BlockStatement:/ |
| 1313 | BlockStatement ::= EnumDeclaration |
| 1314 | /.$putCase consumeInvalidEnumDeclaration(); $break ./ |
| 1315 | /:$readableName BlockStatement:/ |
| 1316 | |
| 1317 | LocalVariableDeclarationStatement ::= LocalVariableDeclaration ';' |
| 1318 | /.$putCase consumeLocalVariableDeclarationStatement(); $break ./ |
| 1319 | /:$readableName LocalVariableDeclarationStatement:/ |
| 1320 | |
| 1321 | LocalVariableDeclaration ::= Type PushModifiers VariableDeclarators |
| 1322 | /.$putCase consumeLocalVariableDeclaration(); $break ./ |
| 1323 | -- 1.1 feature |
| 1324 | -- The modifiers part of this rule makes the grammar more permissive. |
| 1325 | -- The only modifier here is final. We put Modifiers to allow multiple modifiers |
| 1326 | -- This will require to check the validity of the modifier |
| 1327 | LocalVariableDeclaration ::= Modifiers Type PushRealModifiers VariableDeclarators |
| 1328 | /.$putCase consumeLocalVariableDeclaration(); $break ./ |
| 1329 | /:$readableName LocalVariableDeclaration:/ |
| 1330 | |
| 1331 | PushModifiers ::= $empty |
| 1332 | /.$putCase consumePushModifiers(); $break ./ |
| 1333 | /:$readableName PushModifiers:/ |
| 1334 | |
| 1335 | PushModifiersForHeader ::= $empty |
| 1336 | /.$putCase consumePushModifiersForHeader(); $break ./ |
| 1337 | /:$readableName PushModifiersForHeader:/ |
| 1338 | |
| 1339 | PushRealModifiers ::= $empty |
| 1340 | /.$putCase consumePushRealModifiers(); $break ./ |
| 1341 | /:$readableName PushRealModifiers:/ |
| 1342 | |
| 1343 | Statement -> StatementWithoutTrailingSubstatement |
| 1344 | Statement -> LabeledStatement |
| 1345 | Statement -> IfThenStatement |
| 1346 | Statement -> IfThenElseStatement |
| 1347 | Statement -> WhileStatement |
| 1348 | Statement -> ForStatement |
| 1349 | -- {ObjectTeams |
| 1350 | Statement -> WithinStatement |
| 1351 | -- Markus Witte} |
| 1352 | ----------------------------------------------- |
| 1353 | -- 1.5 feature |
| 1354 | ----------------------------------------------- |
| 1355 | Statement -> EnhancedForStatement |
| 1356 | /:$readableName Statement:/ |
| 1357 | /:$recovery_template ;:/ |
| 1358 | |
| 1359 | StatementNoShortIf -> StatementWithoutTrailingSubstatement |
| 1360 | StatementNoShortIf -> LabeledStatementNoShortIf |
| 1361 | StatementNoShortIf -> IfThenElseStatementNoShortIf |
| 1362 | StatementNoShortIf -> WhileStatementNoShortIf |
| 1363 | StatementNoShortIf -> ForStatementNoShortIf |
| 1364 | ----------------------------------------------- |
| 1365 | -- 1.5 feature |
| 1366 | ----------------------------------------------- |
| 1367 | StatementNoShortIf -> EnhancedForStatementNoShortIf |
| 1368 | /:$readableName Statement:/ |
| 1369 | |
| 1370 | StatementWithoutTrailingSubstatement -> AssertStatement |
| 1371 | StatementWithoutTrailingSubstatement -> Block |
| 1372 | StatementWithoutTrailingSubstatement -> EmptyStatement |
| 1373 | StatementWithoutTrailingSubstatement -> ExpressionStatement |
| 1374 | StatementWithoutTrailingSubstatement -> SwitchStatement |
| 1375 | StatementWithoutTrailingSubstatement -> DoStatement |
| 1376 | StatementWithoutTrailingSubstatement -> BreakStatement |
| 1377 | StatementWithoutTrailingSubstatement -> ContinueStatement |
| 1378 | StatementWithoutTrailingSubstatement -> ReturnStatement |
| 1379 | StatementWithoutTrailingSubstatement -> SynchronizedStatement |
| 1380 | StatementWithoutTrailingSubstatement -> ThrowStatement |
| 1381 | StatementWithoutTrailingSubstatement -> TryStatement |
| 1382 | /:$readableName Statement:/ |
| 1383 | |
| 1384 | EmptyStatement ::= ';' |
| 1385 | /.$putCase consumeEmptyStatement(); $break ./ |
| 1386 | /:$readableName EmptyStatement:/ |
| 1387 | |
| 1388 | LabeledStatement ::= Label ':' Statement |
| 1389 | /.$putCase consumeStatementLabel() ; $break ./ |
| 1390 | /:$readableName LabeledStatement:/ |
| 1391 | |
| 1392 | LabeledStatementNoShortIf ::= Label ':' StatementNoShortIf |
| 1393 | /.$putCase consumeStatementLabel() ; $break ./ |
| 1394 | /:$readableName LabeledStatement:/ |
| 1395 | |
| 1396 | Label ::= 'Identifier' |
| 1397 | /.$putCase consumeLabel() ; $break ./ |
| 1398 | /:$readableName Label:/ |
| 1399 | |
| 1400 | ExpressionStatement ::= StatementExpression ';' |
| 1401 | /. $putCase consumeExpressionStatement(); $break ./ |
| 1402 | ExpressionStatement ::= ExplicitConstructorInvocation |
| 1403 | /:$readableName Statement:/ |
| 1404 | |
| 1405 | StatementExpression ::= Assignment |
| 1406 | StatementExpression ::= PreIncrementExpression |
| 1407 | StatementExpression ::= PreDecrementExpression |
| 1408 | StatementExpression ::= PostIncrementExpression |
| 1409 | StatementExpression ::= PostDecrementExpression |
| 1410 | StatementExpression ::= MethodInvocation |
| 1411 | StatementExpression ::= ClassInstanceCreationExpression |
| 1412 | -- {ObjectTeams |
| 1413 | StatementExpression ::= BaseConstructorInvocation |
| 1414 | -- SH} |
| 1415 | /:$readableName Expression:/ |
| 1416 | |
| 1417 | IfThenStatement ::= 'if' '(' Expression ')' Statement |
| 1418 | /.$putCase consumeStatementIfNoElse(); $break ./ |
| 1419 | /:$readableName IfStatement:/ |
| 1420 | |
| 1421 | IfThenElseStatement ::= 'if' '(' Expression ')' StatementNoShortIf 'else' Statement |
| 1422 | /.$putCase consumeStatementIfWithElse(); $break ./ |
| 1423 | /:$readableName IfStatement:/ |
| 1424 | |
| 1425 | IfThenElseStatementNoShortIf ::= 'if' '(' Expression ')' StatementNoShortIf 'else' StatementNoShortIf |
| 1426 | /.$putCase consumeStatementIfWithElse(); $break ./ |
| 1427 | /:$readableName IfStatement:/ |
| 1428 | |
| 1429 | SwitchStatement ::= 'switch' '(' Expression ')' OpenBlock SwitchBlock |
| 1430 | /.$putCase consumeStatementSwitch() ; $break ./ |
| 1431 | /:$readableName SwitchStatement:/ |
| 1432 | |
| 1433 | SwitchBlock ::= '{' '}' |
| 1434 | /.$putCase consumeEmptySwitchBlock() ; $break ./ |
| 1435 | |
| 1436 | SwitchBlock ::= '{' SwitchBlockStatements '}' |
| 1437 | SwitchBlock ::= '{' SwitchLabels '}' |
| 1438 | SwitchBlock ::= '{' SwitchBlockStatements SwitchLabels '}' |
| 1439 | /.$putCase consumeSwitchBlock() ; $break ./ |
| 1440 | /:$readableName SwitchBlock:/ |
| 1441 | |
| 1442 | SwitchBlockStatements -> SwitchBlockStatement |
| 1443 | SwitchBlockStatements ::= SwitchBlockStatements SwitchBlockStatement |
| 1444 | /.$putCase consumeSwitchBlockStatements() ; $break ./ |
| 1445 | /:$readableName SwitchBlockStatements:/ |
| 1446 | |
| 1447 | SwitchBlockStatement ::= SwitchLabels BlockStatements |
| 1448 | /.$putCase consumeSwitchBlockStatement() ; $break ./ |
| 1449 | /:$readableName SwitchBlockStatement:/ |
| 1450 | |
| 1451 | SwitchLabels -> SwitchLabel |
| 1452 | SwitchLabels ::= SwitchLabels SwitchLabel |
| 1453 | /.$putCase consumeSwitchLabels() ; $break ./ |
| 1454 | /:$readableName SwitchLabels:/ |
| 1455 | |
| 1456 | SwitchLabel ::= 'case' ConstantExpression ':' |
| 1457 | /. $putCase consumeCaseLabel(); $break ./ |
| 1458 | |
| 1459 | SwitchLabel ::= 'default' ':' |
| 1460 | /. $putCase consumeDefaultLabel(); $break ./ |
| 1461 | /:$readableName SwitchLabel:/ |
| 1462 | |
| 1463 | WhileStatement ::= 'while' '(' Expression ')' Statement |
| 1464 | /.$putCase consumeStatementWhile() ; $break ./ |
| 1465 | /:$readableName WhileStatement:/ |
| 1466 | |
| 1467 | WhileStatementNoShortIf ::= 'while' '(' Expression ')' StatementNoShortIf |
| 1468 | /.$putCase consumeStatementWhile() ; $break ./ |
| 1469 | /:$readableName WhileStatement:/ |
| 1470 | |
| 1471 | DoStatement ::= 'do' Statement 'while' '(' Expression ')' ';' |
| 1472 | /.$putCase consumeStatementDo() ; $break ./ |
| 1473 | /:$readableName DoStatement:/ |
| 1474 | |
| 1475 | ForStatement ::= 'for' '(' ForInitopt ';' Expressionopt ';' ForUpdateopt ')' Statement |
| 1476 | /.$putCase consumeStatementFor() ; $break ./ |
| 1477 | /:$readableName ForStatement:/ |
| 1478 | |
| 1479 | ForStatementNoShortIf ::= 'for' '(' ForInitopt ';' Expressionopt ';' ForUpdateopt ')' StatementNoShortIf |
| 1480 | /.$putCase consumeStatementFor() ; $break ./ |
| 1481 | /:$readableName ForStatement:/ |
| 1482 | |
| 1483 | --the minus one allows to avoid a stack-to-stack transfer |
| 1484 | ForInit ::= StatementExpressionList |
| 1485 | /.$putCase consumeForInit() ; $break ./ |
| 1486 | ForInit -> LocalVariableDeclaration |
| 1487 | /:$readableName ForInit:/ |
| 1488 | |
| 1489 | ForUpdate -> StatementExpressionList |
| 1490 | /:$readableName ForUpdate:/ |
| 1491 | |
| 1492 | StatementExpressionList -> StatementExpression |
| 1493 | StatementExpressionList ::= StatementExpressionList ',' StatementExpression |
| 1494 | /.$putCase consumeStatementExpressionList() ; $break ./ |
| 1495 | /:$readableName StatementExpressionList:/ |
| 1496 | |
| 1497 | -- {ObjectTeams |
| 1498 | WithinStatement ::= 'within' '(' Expression ')' Statement |
| 1499 | /.$putCase consumeWithinStatement(); $break ./ |
| 1500 | /:$readableName WithinStatement:/ |
| 1501 | -- Markus Witte} |
| 1502 | |
| 1503 | -- 1.4 feature |
| 1504 | AssertStatement ::= 'assert' Expression ';' |
| 1505 | /.$putCase consumeSimpleAssertStatement() ; $break ./ |
| 1506 | /:$compliance 1.4:/ |
| 1507 | |
| 1508 | AssertStatement ::= 'assert' Expression ':' Expression ';' |
| 1509 | /.$putCase consumeAssertStatement() ; $break ./ |
| 1510 | /:$readableName AssertStatement:/ |
| 1511 | /:$compliance 1.4:/ |
| 1512 | |
| 1513 | BreakStatement ::= 'break' ';' |
| 1514 | /.$putCase consumeStatementBreak() ; $break ./ |
| 1515 | |
| 1516 | BreakStatement ::= 'break' Identifier ';' |
| 1517 | /.$putCase consumeStatementBreakWithLabel() ; $break ./ |
| 1518 | /:$readableName BreakStatement:/ |
| 1519 | |
| 1520 | ContinueStatement ::= 'continue' ';' |
| 1521 | /.$putCase consumeStatementContinue() ; $break ./ |
| 1522 | |
| 1523 | ContinueStatement ::= 'continue' Identifier ';' |
| 1524 | /.$putCase consumeStatementContinueWithLabel() ; $break ./ |
| 1525 | /:$readableName ContinueStatement:/ |
| 1526 | |
| 1527 | ReturnStatement ::= 'return' Expressionopt ';' |
| 1528 | /.$putCase consumeStatementReturn() ; $break ./ |
| 1529 | /:$readableName ReturnStatement:/ |
| 1530 | |
| 1531 | ThrowStatement ::= 'throw' Expression ';' |
| 1532 | /.$putCase consumeStatementThrow(); $break ./ |
| 1533 | /:$readableName ThrowStatement:/ |
| 1534 | |
| 1535 | SynchronizedStatement ::= OnlySynchronized '(' Expression ')' Block |
| 1536 | /.$putCase consumeStatementSynchronized(); $break ./ |
| 1537 | /:$readableName SynchronizedStatement:/ |
| 1538 | |
| 1539 | OnlySynchronized ::= 'synchronized' |
| 1540 | /.$putCase consumeOnlySynchronized(); $break ./ |
| 1541 | /:$readableName OnlySynchronized:/ |
| 1542 | |
| 1543 | TryStatement ::= 'try' TryBlock Catches |
| 1544 | /.$putCase consumeStatementTry(false); $break ./ |
| 1545 | TryStatement ::= 'try' TryBlock Catchesopt Finally |
| 1546 | /.$putCase consumeStatementTry(true); $break ./ |
| 1547 | /:$readableName TryStatement:/ |
| 1548 | |
| 1549 | TryBlock ::= Block ExitTryBlock |
| 1550 | /:$readableName Block:/ |
| 1551 | |
| 1552 | ExitTryBlock ::= $empty |
| 1553 | /.$putCase consumeExitTryBlock(); $break ./ |
| 1554 | /:$readableName ExitTryBlock:/ |
| 1555 | |
| 1556 | Catches -> CatchClause |
| 1557 | Catches ::= Catches CatchClause |
| 1558 | /.$putCase consumeCatches(); $break ./ |
| 1559 | /:$readableName Catches:/ |
| 1560 | |
| 1561 | CatchClause ::= 'catch' '(' FormalParameter ')' Block |
| 1562 | /.$putCase consumeStatementCatch() ; $break ./ |
| 1563 | /:$readableName CatchClause:/ |
| 1564 | |
| 1565 | Finally ::= 'finally' Block |
| 1566 | /:$readableName Finally:/ |
| 1567 | /:$recovery_template finally { }:/ |
| 1568 | |
| 1569 | --18.12 Productions from 14: Expressions |
| 1570 | |
| 1571 | --for source positioning purpose |
| 1572 | PushLPAREN ::= '(' |
| 1573 | /.$putCase consumeLeftParen(); $break ./ |
| 1574 | /:$readableName (:/ |
| 1575 | /:$recovery_template (:/ |
| 1576 | PushRPAREN ::= ')' |
| 1577 | /.$putCase consumeRightParen(); $break ./ |
| 1578 | /:$readableName ):/ |
| 1579 | /:$recovery_template ):/ |
| 1580 | |
| 1581 | Primary -> PrimaryNoNewArray |
| 1582 | Primary -> ArrayCreationWithArrayInitializer |
| 1583 | Primary -> ArrayCreationWithoutArrayInitializer |
| 1584 | /:$readableName Expression:/ |
| 1585 | |
| 1586 | PrimaryNoNewArray -> Literal |
| 1587 | PrimaryNoNewArray ::= 'this' |
| 1588 | /.$putCase consumePrimaryNoNewArrayThis(); $break ./ |
| 1589 | |
| 1590 | PrimaryNoNewArray ::= PushLPAREN Expression_NotName PushRPAREN |
| 1591 | /.$putCase consumePrimaryNoNewArray(); $break ./ |
| 1592 | |
| 1593 | PrimaryNoNewArray ::= PushLPAREN Name PushRPAREN |
| 1594 | /.$putCase consumePrimaryNoNewArrayWithName(); $break ./ |
| 1595 | |
| 1596 | PrimaryNoNewArray -> ClassInstanceCreationExpression |
| 1597 | --{ObjectTeams: |
| 1598 | PrimaryNoNewArray -> BaseConstructorExpression |
| 1599 | -- SH} |
| 1600 | PrimaryNoNewArray -> FieldAccess |
| 1601 | --1.1 feature |
| 1602 | PrimaryNoNewArray ::= Name '.' 'this' |
| 1603 | /.$putCase consumePrimaryNoNewArrayNameThis(); $break ./ |
| 1604 | PrimaryNoNewArray ::= Name '.' 'super' |
| 1605 | /.$putCase consumePrimaryNoNewArrayNameSuper(); $break ./ |
| 1606 | |
| 1607 | --1.1 feature |
| 1608 | --PrimaryNoNewArray ::= Type '.' 'class' |
| 1609 | --inline Type in the previous rule in order to make the grammar LL1 instead |
| 1610 | -- of LL2. The result is the 3 next rules. |
| 1611 | |
| 1612 | PrimaryNoNewArray ::= Name '.' 'class' |
| 1613 | /.$putCase consumePrimaryNoNewArrayName(); $break ./ |
| 1614 | |
| 1615 | PrimaryNoNewArray ::= Name Dims '.' 'class' |
| 1616 | /.$putCase consumePrimaryNoNewArrayArrayType(); $break ./ |
| 1617 | |
| 1618 | PrimaryNoNewArray ::= PrimitiveType Dims '.' 'class' |
| 1619 | /.$putCase consumePrimaryNoNewArrayPrimitiveArrayType(); $break ./ |
| 1620 | |
| 1621 | PrimaryNoNewArray ::= PrimitiveType '.' 'class' |
| 1622 | /.$putCase consumePrimaryNoNewArrayPrimitiveType(); $break ./ |
| 1623 | |
| 1624 | --{ObjectTeams: R<@t>.class |
| 1625 | -- (start with RelationalExpression to make the grammer LL1, further syntax checking in Parser) |
| 1626 | RelationalExpression ::= RelationalExpression '<' TypeAnchor '>' '.' 'class' |
| 1627 | /.$putCase consumeRoleClassLiteral(); $break ./ |
| 1628 | -- SH} |
| 1629 | |
| 1630 | PrimaryNoNewArray -> MethodInvocation |
| 1631 | PrimaryNoNewArray -> ArrayAccess |
| 1632 | /:$readableName Expression:/ |
| 1633 | --1.1 feature |
| 1634 | -- |
| 1635 | -- In Java 1.0 a ClassBody could not appear at all in a |
| 1636 | -- ClassInstanceCreationExpression. |
| 1637 | -- |
| 1638 | |
| 1639 | AllocationHeader ::= 'new' ClassType '(' ArgumentListopt ')' |
| 1640 | /.$putCase consumeAllocationHeader(); $break ./ |
| 1641 | /:$readableName AllocationHeader:/ |
| 1642 | |
| 1643 | ClassInstanceCreationExpression ::= 'new' OnlyTypeArguments ClassType '(' ArgumentListopt ')' UnqualifiedClassBodyopt |
| 1644 | /.$putCase consumeClassInstanceCreationExpressionWithTypeArguments(); $break ./ |
| 1645 | |
| 1646 | ClassInstanceCreationExpression ::= 'new' ClassType '(' ArgumentListopt ')' UnqualifiedClassBodyopt |
| 1647 | /.$putCase consumeClassInstanceCreationExpression(); $break ./ |
| 1648 | --1.1 feature |
| 1649 | |
| 1650 | ClassInstanceCreationExpression ::= Primary '.' 'new' OnlyTypeArguments ClassType '(' ArgumentListopt ')' QualifiedClassBodyopt |
| 1651 | /.$putCase consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ; $break ./ |
| 1652 | |
| 1653 | ClassInstanceCreationExpression ::= Primary '.' 'new' ClassType '(' ArgumentListopt ')' QualifiedClassBodyopt |
| 1654 | /.$putCase consumeClassInstanceCreationExpressionQualified() ; $break ./ |
| 1655 | |
| 1656 | --1.1 feature |
| 1657 | ClassInstanceCreationExpression ::= ClassInstanceCreationExpressionName 'new' ClassType '(' ArgumentListopt ')' QualifiedClassBodyopt |
| 1658 | /.$putCase consumeClassInstanceCreationExpressionQualified() ; $break ./ |
| 1659 | /:$readableName ClassInstanceCreationExpression:/ |
| 1660 | |
| 1661 | ClassInstanceCreationExpression ::= ClassInstanceCreationExpressionName 'new' OnlyTypeArguments ClassType '(' ArgumentListopt ')' QualifiedClassBodyopt |
| 1662 | /.$putCase consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ; $break ./ |
| 1663 | /:$readableName ClassInstanceCreationExpression:/ |
| 1664 | |
| 1665 | ClassInstanceCreationExpressionName ::= Name '.' |
| 1666 | /.$putCase consumeClassInstanceCreationExpressionName() ; $break ./ |
| 1667 | /:$readableName ClassInstanceCreationExpressionName:/ |
| 1668 | |
| 1669 | UnqualifiedClassBodyopt ::= $empty --test made using null as contents |
| 1670 | /.$putCase consumeClassBodyopt(); $break ./ |
| 1671 | UnqualifiedClassBodyopt ::= UnqualifiedEnterAnonymousClassBody ClassBody |
| 1672 | /:$readableName ClassBody:/ |
| 1673 | /:$no_statements_recovery:/ |
| 1674 | |
| 1675 | UnqualifiedEnterAnonymousClassBody ::= $empty |
| 1676 | /.$putCase consumeEnterAnonymousClassBody(false); $break ./ |
| 1677 | /:$readableName EnterAnonymousClassBody:/ |
| 1678 | |
| 1679 | QualifiedClassBodyopt ::= $empty --test made using null as contents |
| 1680 | /.$putCase consumeClassBodyopt(); $break ./ |
| 1681 | QualifiedClassBodyopt ::= QualifiedEnterAnonymousClassBody ClassBody |
| 1682 | /:$readableName ClassBody:/ |
| 1683 | /:$no_statements_recovery:/ |
| 1684 | |
| 1685 | QualifiedEnterAnonymousClassBody ::= $empty |
| 1686 | /.$putCase consumeEnterAnonymousClassBody(true); $break ./ |
| 1687 | /:$readableName EnterAnonymousClassBody:/ |
| 1688 | |
| 1689 | ArgumentList ::= Expression |
| 1690 | ArgumentList ::= ArgumentList ',' Expression |
| 1691 | /.$putCase consumeArgumentList(); $break ./ |
| 1692 | /:$readableName ArgumentList:/ |
| 1693 | |
| 1694 | ArrayCreationHeader ::= 'new' PrimitiveType DimWithOrWithOutExprs |
| 1695 | /.$putCase consumeArrayCreationHeader(); $break ./ |
| 1696 | |
| 1697 | ArrayCreationHeader ::= 'new' ClassOrInterfaceType DimWithOrWithOutExprs |
| 1698 | /.$putCase consumeArrayCreationHeader(); $break ./ |
| 1699 | /:$readableName ArrayCreationHeader:/ |
| 1700 | |
| 1701 | ArrayCreationWithoutArrayInitializer ::= 'new' PrimitiveType DimWithOrWithOutExprs |
| 1702 | /.$putCase consumeArrayCreationExpressionWithoutInitializer(); $break ./ |
| 1703 | /:$readableName ArrayCreationWithoutArrayInitializer:/ |
| 1704 | |
| 1705 | ArrayCreationWithArrayInitializer ::= 'new' PrimitiveType DimWithOrWithOutExprs ArrayInitializer |
| 1706 | /.$putCase consumeArrayCreationExpressionWithInitializer(); $break ./ |
| 1707 | /:$readableName ArrayCreationWithArrayInitializer:/ |
| 1708 | |
| 1709 | ArrayCreationWithoutArrayInitializer ::= 'new' ClassOrInterfaceType DimWithOrWithOutExprs |
| 1710 | /.$putCase consumeArrayCreationExpressionWithoutInitializer(); $break ./ |
| 1711 | |
| 1712 | ArrayCreationWithArrayInitializer ::= 'new' ClassOrInterfaceType DimWithOrWithOutExprs ArrayInitializer |
| 1713 | /.$putCase consumeArrayCreationExpressionWithInitializer(); $break ./ |
| 1714 | |
| 1715 | DimWithOrWithOutExprs ::= DimWithOrWithOutExpr |
| 1716 | DimWithOrWithOutExprs ::= DimWithOrWithOutExprs DimWithOrWithOutExpr |
| 1717 | /.$putCase consumeDimWithOrWithOutExprs(); $break ./ |
| 1718 | /:$readableName Dimensions:/ |
| 1719 | |
| 1720 | DimWithOrWithOutExpr ::= '[' Expression ']' |
| 1721 | DimWithOrWithOutExpr ::= '[' ']' |
| 1722 | /. $putCase consumeDimWithOrWithOutExpr(); $break ./ |
| 1723 | /:$readableName Dimension:/ |
| 1724 | -- ----------------------------------------------- |
| 1725 | |
| 1726 | Dims ::= DimsLoop |
| 1727 | /. $putCase consumeDims(); $break ./ |
| 1728 | /:$readableName Dimensions:/ |
| 1729 | DimsLoop -> OneDimLoop |
| 1730 | DimsLoop ::= DimsLoop OneDimLoop |
| 1731 | /:$readableName Dimensions:/ |
| 1732 | OneDimLoop ::= '[' ']' |
| 1733 | /. $putCase consumeOneDimLoop(); $break ./ |
| 1734 | /:$readableName Dimension:/ |
| 1735 | |
| 1736 | FieldAccess ::= Primary '.' 'Identifier' |
| 1737 | /.$putCase consumeFieldAccess(false); $break ./ |
| 1738 | |
| 1739 | FieldAccess ::= 'super' '.' 'Identifier' |
| 1740 | /.$putCase consumeFieldAccess(true); $break ./ |
| 1741 | /:$readableName FieldAccess:/ |
| 1742 | |
| 1743 | MethodInvocation ::= Name '(' ArgumentListopt ')' |
| 1744 | /.$putCase consumeMethodInvocationName(); $break ./ |
| 1745 | |
| 1746 | MethodInvocation ::= Name '.' OnlyTypeArguments 'Identifier' '(' ArgumentListopt ')' |
| 1747 | /.$putCase consumeMethodInvocationNameWithTypeArguments(); $break ./ |
| 1748 | |
| 1749 | MethodInvocation ::= Primary '.' OnlyTypeArguments 'Identifier' '(' ArgumentListopt ')' |
| 1750 | /.$putCase consumeMethodInvocationPrimaryWithTypeArguments(); $break ./ |
| 1751 | |
| 1752 | MethodInvocation ::= Primary '.' 'Identifier' '(' ArgumentListopt ')' |
| 1753 | /.$putCase consumeMethodInvocationPrimary(); $break ./ |
| 1754 | |
| 1755 | MethodInvocation ::= 'super' '.' OnlyTypeArguments 'Identifier' '(' ArgumentListopt ')' |
| 1756 | /.$putCase consumeMethodInvocationSuperWithTypeArguments(); $break ./ |
| 1757 | |
| 1758 | MethodInvocation ::= 'super' '.' 'Identifier' '(' ArgumentListopt ')' |
| 1759 | /.$putCase consumeMethodInvocationSuper(); $break ./ |
| 1760 | |
| 1761 | -- {ObjectTeams |
| 1762 | MethodInvocation ::= 'tsuper' '.' 'Identifier' '(' ArgumentListopt ')' |
| 1763 | /.$putCase consumeMethodInvocationTSuper(UNQUALIFIED); $break ./ |
| 1764 | |
| 1765 | MethodInvocation ::= 'tsuper' '.' OnlyTypeArguments 'Identifier' '(' ArgumentListopt ')' |
| 1766 | /.$putCase consumeMethodInvocationTSuperWithTypeArguments(0); $break ./ |
| 1767 | |
| 1768 | MethodInvocation ::= Name '.' 'tsuper' '.' 'Identifier' '(' ArgumentListopt ')' |
| 1769 | /.$putCase consumeMethodInvocationTSuper(QUALIFIED); $break ./ |
| 1770 | |
| 1771 | MethodInvocation ::= Name '.' 'tsuper' '.' OnlyTypeArguments 'Identifier' '(' ArgumentListopt ')' |
| 1772 | /.$putCase consumeMethodInvocationTSuperWithTypeArguments(2); $break ./ |
| 1773 | |
| 1774 | MethodInvocation ::= 'base' '.' 'Identifier' '(' ArgumentListopt ')' |
| 1775 | /.$putCase consumeMethodInvocationBase(false); $break ./ |
| 1776 | |
| 1777 | MethodInvocation ::= 'base' '.' OnlyTypeArguments 'Identifier' '(' ArgumentListopt ')' |
| 1778 | /.$putCase consumeMethodInvocationBaseWithTypeArguments(false); $break ./ |
| 1779 | |
| 1780 | MethodInvocation ::= 'base' '.' 'super' '.' 'Identifier' '(' ArgumentListopt ')' |
| 1781 | /.$putCase consumeMethodInvocationBase(true); $break ./ |
| 1782 | |
| 1783 | MethodInvocation ::= 'base' '.' 'super' '.' OnlyTypeArguments 'Identifier' '(' ArgumentListopt ')' |
| 1784 | /.$putCase consumeMethodInvocationBaseWithTypeArguments(true); $break ./ |
| 1785 | -- Markus Witte} |
| 1786 | |
| 1787 | /:$readableName MethodInvocation:/ |
| 1788 | |
| 1789 | ArrayAccess ::= Name '[' Expression ']' |
| 1790 | /.$putCase consumeArrayAccess(true); $break ./ |
| 1791 | ArrayAccess ::= PrimaryNoNewArray '[' Expression ']' |
| 1792 | /.$putCase consumeArrayAccess(false); $break ./ |
| 1793 | ArrayAccess ::= ArrayCreationWithArrayInitializer '[' Expression ']' |
| 1794 | /.$putCase consumeArrayAccess(false); $break ./ |
| 1795 | /:$readableName ArrayAccess:/ |
| 1796 | |
| 1797 | PostfixExpression -> Primary |
| 1798 | PostfixExpression ::= Name |
| 1799 | /.$putCase consumePostfixExpression(); $break ./ |
| 1800 | PostfixExpression -> PostIncrementExpression |
| 1801 | PostfixExpression -> PostDecrementExpression |
| 1802 | /:$readableName Expression:/ |
| 1803 | |
| 1804 | PostIncrementExpression ::= PostfixExpression '++' |
| 1805 | /.$putCase consumeUnaryExpression(OperatorIds.PLUS,true); $break ./ |
| 1806 | /:$readableName PostIncrementExpression:/ |
| 1807 | |
| 1808 | PostDecrementExpression ::= PostfixExpression '--' |
| 1809 | /.$putCase consumeUnaryExpression(OperatorIds.MINUS,true); $break ./ |
| 1810 | /:$readableName PostDecrementExpression:/ |
| 1811 | |
| 1812 | --for source managment purpose |
| 1813 | PushPosition ::= $empty |
| 1814 | /.$putCase consumePushPosition(); $break ./ |
| 1815 | /:$readableName PushPosition:/ |
| 1816 | |
| 1817 | UnaryExpression -> PreIncrementExpression |
| 1818 | UnaryExpression -> PreDecrementExpression |
| 1819 | UnaryExpression ::= '+' PushPosition UnaryExpression |
| 1820 | /.$putCase consumeUnaryExpression(OperatorIds.PLUS); $break ./ |
| 1821 | UnaryExpression ::= '-' PushPosition UnaryExpression |
| 1822 | /.$putCase consumeUnaryExpression(OperatorIds.MINUS); $break ./ |
| 1823 | UnaryExpression -> UnaryExpressionNotPlusMinus |
| 1824 | /:$readableName Expression:/ |
| 1825 | |
| 1826 | PreIncrementExpression ::= '++' PushPosition UnaryExpression |
| 1827 | /.$putCase consumeUnaryExpression(OperatorIds.PLUS,false); $break ./ |
| 1828 | /:$readableName PreIncrementExpression:/ |
| 1829 | |
| 1830 | PreDecrementExpression ::= '--' PushPosition UnaryExpression |
| 1831 | /.$putCase consumeUnaryExpression(OperatorIds.MINUS,false); $break ./ |
| 1832 | /:$readableName PreDecrementExpression:/ |
| 1833 | |
| 1834 | UnaryExpressionNotPlusMinus -> PostfixExpression |
| 1835 | UnaryExpressionNotPlusMinus ::= '~' PushPosition UnaryExpression |
| 1836 | /.$putCase consumeUnaryExpression(OperatorIds.TWIDDLE); $break ./ |
| 1837 | UnaryExpressionNotPlusMinus ::= '!' PushPosition UnaryExpression |
| 1838 | /.$putCase consumeUnaryExpression(OperatorIds.NOT); $break ./ |
| 1839 | UnaryExpressionNotPlusMinus -> CastExpression |
| 1840 | /:$readableName Expression:/ |
| 1841 | |
| 1842 | CastExpression ::= PushLPAREN PrimitiveType Dimsopt PushRPAREN InsideCastExpression UnaryExpression |
| 1843 | /.$putCase consumeCastExpressionWithPrimitiveType(); $break ./ |
| 1844 | CastExpression ::= PushLPAREN Name OnlyTypeArgumentsForCastExpression Dimsopt PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus |
| 1845 | /.$putCase consumeCastExpressionWithGenericsArray(); $break ./ |
| 1846 | CastExpression ::= PushLPAREN Name OnlyTypeArgumentsForCastExpression '.' ClassOrInterfaceType Dimsopt PushRPAREN InsideCastExpressionWithQualifiedGenerics UnaryExpressionNotPlusMinus |
| 1847 | /.$putCase consumeCastExpressionWithQualifiedGenericsArray(); $break ./ |
| 1848 | CastExpression ::= PushLPAREN Name PushRPAREN InsideCastExpressionLL1 UnaryExpressionNotPlusMinus |
| 1849 | /.$putCase consumeCastExpressionLL1(); $break ./ |
| 1850 | CastExpression ::= PushLPAREN Name Dims PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus |
| 1851 | /.$putCase consumeCastExpressionWithNameArray(); $break ./ |
| 1852 | /:$readableName CastExpression:/ |
| 1853 | |
| 1854 | OnlyTypeArgumentsForCastExpression ::= OnlyTypeArguments |
| 1855 | /.$putCase consumeOnlyTypeArgumentsForCastExpression(); $break ./ |
| 1856 | /:$readableName TypeArguments:/ |
| 1857 | |
| 1858 | InsideCastExpression ::= $empty |
| 1859 | /.$putCase consumeInsideCastExpression(); $break ./ |
| 1860 | /:$readableName InsideCastExpression:/ |
| 1861 | InsideCastExpressionLL1 ::= $empty |
| 1862 | /.$putCase consumeInsideCastExpressionLL1(); $break ./ |
| 1863 | /:$readableName InsideCastExpression:/ |
| 1864 | InsideCastExpressionWithQualifiedGenerics ::= $empty |
| 1865 | /.$putCase consumeInsideCastExpressionWithQualifiedGenerics(); $break ./ |
| 1866 | /:$readableName InsideCastExpression:/ |
| 1867 | |
| 1868 | MultiplicativeExpression -> UnaryExpression |
| 1869 | MultiplicativeExpression ::= MultiplicativeExpression '*' UnaryExpression |
| 1870 | /.$putCase consumeBinaryExpression(OperatorIds.MULTIPLY); $break ./ |
| 1871 | MultiplicativeExpression ::= MultiplicativeExpression '/' UnaryExpression |
| 1872 | /.$putCase consumeBinaryExpression(OperatorIds.DIVIDE); $break ./ |
| 1873 | MultiplicativeExpression ::= MultiplicativeExpression '%' UnaryExpression |
| 1874 | /.$putCase consumeBinaryExpression(OperatorIds.REMAINDER); $break ./ |
| 1875 | /:$readableName Expression:/ |
| 1876 | |
| 1877 | AdditiveExpression -> MultiplicativeExpression |
| 1878 | AdditiveExpression ::= AdditiveExpression '+' MultiplicativeExpression |
| 1879 | /.$putCase consumeBinaryExpression(OperatorIds.PLUS); $break ./ |
| 1880 | AdditiveExpression ::= AdditiveExpression '-' MultiplicativeExpression |
| 1881 | /.$putCase consumeBinaryExpression(OperatorIds.MINUS); $break ./ |
| 1882 | /:$readableName Expression:/ |
| 1883 | |
| 1884 | ShiftExpression -> AdditiveExpression |
| 1885 | ShiftExpression ::= ShiftExpression '<<' AdditiveExpression |
| 1886 | /.$putCase consumeBinaryExpression(OperatorIds.LEFT_SHIFT); $break ./ |
| 1887 | ShiftExpression ::= ShiftExpression '>>' AdditiveExpression |
| 1888 | /.$putCase consumeBinaryExpression(OperatorIds.RIGHT_SHIFT); $break ./ |
| 1889 | ShiftExpression ::= ShiftExpression '>>>' AdditiveExpression |
| 1890 | /.$putCase consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT); $break ./ |
| 1891 | /:$readableName Expression:/ |
| 1892 | |
| 1893 | RelationalExpression -> ShiftExpression |
| 1894 | RelationalExpression ::= RelationalExpression '<' ShiftExpression |
| 1895 | /.$putCase consumeBinaryExpression(OperatorIds.LESS); $break ./ |
| 1896 | RelationalExpression ::= RelationalExpression '>' ShiftExpression |
| 1897 | /.$putCase consumeBinaryExpression(OperatorIds.GREATER); $break ./ |
| 1898 | RelationalExpression ::= RelationalExpression '<=' ShiftExpression |
| 1899 | /.$putCase consumeBinaryExpression(OperatorIds.LESS_EQUAL); $break ./ |
| 1900 | RelationalExpression ::= RelationalExpression '>=' ShiftExpression |
| 1901 | /.$putCase consumeBinaryExpression(OperatorIds.GREATER_EQUAL); $break ./ |
| 1902 | /:$readableName Expression:/ |
| 1903 | |
| 1904 | InstanceofExpression -> RelationalExpression |
| 1905 | InstanceofExpression ::= InstanceofExpression 'instanceof' ReferenceType |
| 1906 | /.$putCase consumeInstanceOfExpression(); $break ./ |
| 1907 | /:$readableName Expression:/ |
| 1908 | |
| 1909 | EqualityExpression -> InstanceofExpression |
| 1910 | EqualityExpression ::= EqualityExpression '==' InstanceofExpression |
| 1911 | /.$putCase consumeEqualityExpression(OperatorIds.EQUAL_EQUAL); $break ./ |
| 1912 | EqualityExpression ::= EqualityExpression '!=' InstanceofExpression |
| 1913 | /.$putCase consumeEqualityExpression(OperatorIds.NOT_EQUAL); $break ./ |
| 1914 | /:$readableName Expression:/ |
| 1915 | |
| 1916 | AndExpression -> EqualityExpression |
| 1917 | AndExpression ::= AndExpression '&' EqualityExpression |
| 1918 | /.$putCase consumeBinaryExpression(OperatorIds.AND); $break ./ |
| 1919 | /:$readableName Expression:/ |
| 1920 | |
| 1921 | ExclusiveOrExpression -> AndExpression |
| 1922 | ExclusiveOrExpression ::= ExclusiveOrExpression '^' AndExpression |
| 1923 | /.$putCase consumeBinaryExpression(OperatorIds.XOR); $break ./ |
| 1924 | /:$readableName Expression:/ |
| 1925 | |
| 1926 | InclusiveOrExpression -> ExclusiveOrExpression |
| 1927 | InclusiveOrExpression ::= InclusiveOrExpression '|' ExclusiveOrExpression |
| 1928 | /.$putCase consumeBinaryExpression(OperatorIds.OR); $break ./ |
| 1929 | /:$readableName Expression:/ |
| 1930 | |
| 1931 | ConditionalAndExpression -> InclusiveOrExpression |
| 1932 | ConditionalAndExpression ::= ConditionalAndExpression '&&' InclusiveOrExpression |
| 1933 | /.$putCase consumeBinaryExpression(OperatorIds.AND_AND); $break ./ |
| 1934 | /:$readableName Expression:/ |
| 1935 | |
| 1936 | ConditionalOrExpression -> ConditionalAndExpression |
| 1937 | ConditionalOrExpression ::= ConditionalOrExpression '||' ConditionalAndExpression |
| 1938 | /.$putCase consumeBinaryExpression(OperatorIds.OR_OR); $break ./ |
| 1939 | /:$readableName Expression:/ |
| 1940 | |
| 1941 | ConditionalExpression -> ConditionalOrExpression |
| 1942 | ConditionalExpression ::= ConditionalOrExpression '?' Expression ':' ConditionalExpression |
| 1943 | /.$putCase consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ; $break ./ |
| 1944 | /:$readableName Expression:/ |
| 1945 | |
| 1946 | AssignmentExpression -> ConditionalExpression |
| 1947 | AssignmentExpression -> Assignment |
| 1948 | /:$readableName Expression:/ |
| 1949 | /:$recovery_template Identifier:/ |
| 1950 | |
| 1951 | Assignment ::= PostfixExpression AssignmentOperator AssignmentExpression |
| 1952 | /.$putCase consumeAssignment(); $break ./ |
| 1953 | /:$readableName Assignment:/ |
| 1954 | |
| 1955 | -- this rule is added to parse an array initializer in a assigment and then report a syntax error knowing the exact senario |
| 1956 | InvalidArrayInitializerAssignement ::= PostfixExpression AssignmentOperator ArrayInitializer |
| 1957 | /:$readableName ArrayInitializerAssignment:/ |
| 1958 | /:$recovery:/ |
| 1959 | Assignment ::= InvalidArrayInitializerAssignement |
| 1960 | /.$putcase ignoreExpressionAssignment();$break ./ |
| 1961 | /:$recovery:/ |
| 1962 | |
| 1963 | AssignmentOperator ::= '=' |
| 1964 | /.$putCase consumeAssignmentOperator(EQUAL); $break ./ |
| 1965 | AssignmentOperator ::= '*=' |
| 1966 | /.$putCase consumeAssignmentOperator(MULTIPLY); $break ./ |
| 1967 | AssignmentOperator ::= '/=' |
| 1968 | /.$putCase consumeAssignmentOperator(DIVIDE); $break ./ |
| 1969 | AssignmentOperator ::= '%=' |
| 1970 | /.$putCase consumeAssignmentOperator(REMAINDER); $break ./ |
| 1971 | AssignmentOperator ::= '+=' |
| 1972 | /.$putCase consumeAssignmentOperator(PLUS); $break ./ |
| 1973 | AssignmentOperator ::= '-=' |
| 1974 | /.$putCase consumeAssignmentOperator(MINUS); $break ./ |
| 1975 | AssignmentOperator ::= '<<=' |
| 1976 | /.$putCase consumeAssignmentOperator(LEFT_SHIFT); $break ./ |
| 1977 | AssignmentOperator ::= '>>=' |
| 1978 | /.$putCase consumeAssignmentOperator(RIGHT_SHIFT); $break ./ |
| 1979 | AssignmentOperator ::= '>>>=' |
| 1980 | /.$putCase consumeAssignmentOperator(UNSIGNED_RIGHT_SHIFT); $break ./ |
| 1981 | AssignmentOperator ::= '&=' |
| 1982 | /.$putCase consumeAssignmentOperator(AND); $break ./ |
| 1983 | AssignmentOperator ::= '^=' |
| 1984 | /.$putCase consumeAssignmentOperator(XOR); $break ./ |
| 1985 | AssignmentOperator ::= '|=' |
| 1986 | /.$putCase consumeAssignmentOperator(OR); $break ./ |
| 1987 | /:$readableName AssignmentOperator:/ |
| 1988 | /:$recovery_template =:/ |
| 1989 | |
| 1990 | Expression -> AssignmentExpression |
| 1991 | /:$readableName Expression:/ |
| 1992 | /:$recovery_template Identifier:/ |
| 1993 | |
| 1994 | -- The following rules are for optional nonterminals. |
| 1995 | -- |
| 1996 | ClassHeaderExtendsopt ::= $empty |
| 1997 | ClassHeaderExtendsopt -> ClassHeaderExtends |
| 1998 | /:$readableName ClassHeaderExtends:/ |
| 1999 | |
| 2000 | Expressionopt ::= $empty |
| 2001 | /.$putCase consumeEmptyExpression(); $break ./ |
| 2002 | Expressionopt -> Expression |
| 2003 | /:$readableName Expression:/ |
| 2004 | |
| 2005 | ConstantExpression -> Expression |
| 2006 | /:$readableName ConstantExpression:/ |
| 2007 | |
| 2008 | --------------------------------------------------------------------------------------- |
| 2009 | -- |
| 2010 | -- The rules below are for optional terminal symbols. An optional comma, |
| 2011 | -- is only used in the context of an array initializer - It is a |
| 2012 | -- "syntactic sugar" that otherwise serves no other purpose. By contrast, |
| 2013 | -- an optional identifier is used in the definition of a break and |
| 2014 | -- continue statement. When the identifier does not appear, a NULL |
| 2015 | -- is produced. When the identifier is present, the user should use the |
| 2016 | -- corresponding TOKEN(i) method. See break statement as an example. |
| 2017 | -- |
| 2018 | --------------------------------------------------------------------------------------- |
| 2019 | |
| 2020 | ,opt -> $empty |
| 2021 | ,opt -> , |
| 2022 | /:$readableName ,:/ |
| 2023 | |
| 2024 | ClassBodyDeclarationsopt ::= $empty |
| 2025 | /.$putCase consumeEmptyClassBodyDeclarationsopt(); $break ./ |
| 2026 | ClassBodyDeclarationsopt ::= NestedType ClassBodyDeclarations |
| 2027 | /.$putCase consumeClassBodyDeclarationsopt(); $break ./ |
| 2028 | /:$readableName ClassBodyDeclarations:/ |
| 2029 | |
| 2030 | Modifiersopt ::= $empty |
| 2031 | /. $putCase consumeDefaultModifiers(); $break ./ |
| 2032 | Modifiersopt ::= Modifiers |
| 2033 | /.$putCase consumeModifiers(); $break ./ |
| 2034 | /:$readableName Modifiers:/ |
| 2035 | |
| 2036 | BlockStatementsopt ::= $empty |
| 2037 | /.$putCase consumeEmptyBlockStatementsopt(); $break ./ |
| 2038 | BlockStatementsopt -> BlockStatements |
| 2039 | /:$readableName BlockStatements:/ |
| 2040 | |
| 2041 | Dimsopt ::= $empty |
| 2042 | /. $putCase consumeEmptyDimsopt(); $break ./ |
| 2043 | Dimsopt -> Dims |
| 2044 | /:$readableName Dimensions:/ |
| 2045 | |
| 2046 | ArgumentListopt ::= $empty |
| 2047 | /. $putCase consumeEmptyArgumentListopt(); $break ./ |
| 2048 | ArgumentListopt -> ArgumentList |
| 2049 | /:$readableName ArgumentList:/ |
| 2050 | |
| 2051 | MethodHeaderThrowsClauseopt ::= $empty |
| 2052 | MethodHeaderThrowsClauseopt -> MethodHeaderThrowsClause |
| 2053 | /:$readableName MethodHeaderThrowsClause:/ |
| 2054 | |
| 2055 | FormalParameterListopt ::= $empty |
| 2056 | /.$putcase consumeFormalParameterListopt(); $break ./ |
| 2057 | FormalParameterListopt -> FormalParameterList |
| 2058 | /:$readableName FormalParameterList:/ |
| 2059 | |
| 2060 | ClassHeaderImplementsopt ::= $empty |
| 2061 | ClassHeaderImplementsopt -> ClassHeaderImplements |
| 2062 | /:$readableName ClassHeaderImplements:/ |
| 2063 | |
| 2064 | InterfaceMemberDeclarationsopt ::= $empty |
| 2065 | /. $putCase consumeEmptyInterfaceMemberDeclarationsopt(); $break ./ |
| 2066 | InterfaceMemberDeclarationsopt ::= NestedType InterfaceMemberDeclarations |
| 2067 | /. $putCase consumeInterfaceMemberDeclarationsopt(); $break ./ |
| 2068 | /:$readableName InterfaceMemberDeclarations:/ |
| 2069 | |
| 2070 | NestedType ::= $empty |
| 2071 | /.$putCase consumeNestedType(); $break./ |
| 2072 | /:$readableName NestedType:/ |
| 2073 | |
| 2074 | ForInitopt ::= $empty |
| 2075 | /. $putCase consumeEmptyForInitopt(); $break ./ |
| 2076 | ForInitopt -> ForInit |
| 2077 | /:$readableName ForInit:/ |
| 2078 | |
| 2079 | ForUpdateopt ::= $empty |
| 2080 | /. $putCase consumeEmptyForUpdateopt(); $break ./ |
| 2081 | ForUpdateopt -> ForUpdate |
| 2082 | /:$readableName ForUpdate:/ |
| 2083 | |
| 2084 | InterfaceHeaderExtendsopt ::= $empty |
| 2085 | InterfaceHeaderExtendsopt -> InterfaceHeaderExtends |
| 2086 | /:$readableName InterfaceHeaderExtends:/ |
| 2087 | |
| 2088 | Catchesopt ::= $empty |
| 2089 | /. $putCase consumeEmptyCatchesopt(); $break ./ |
| 2090 | Catchesopt -> Catches |
| 2091 | /:$readableName Catches:/ |
| 2092 | |
| 2093 | ----------------------------------------------- |
| 2094 | -- 1.5 features : enum type |
| 2095 | ----------------------------------------------- |
| 2096 | EnumDeclaration ::= EnumHeader EnumBody |
| 2097 | /. $putCase consumeEnumDeclaration(); $break ./ |
| 2098 | /:$readableName EnumDeclaration:/ |
| 2099 | |
| 2100 | EnumHeader ::= EnumHeaderName ClassHeaderImplementsopt |
| 2101 | /. $putCase consumeEnumHeader(); $break ./ |
| 2102 | /:$readableName EnumHeader:/ |
| 2103 | |
| 2104 | EnumHeaderName ::= Modifiersopt 'enum' Identifier |
| 2105 | /. $putCase consumeEnumHeaderName(); $break ./ |
| 2106 | /:$compliance 1.5:/ |
| 2107 | EnumHeaderName ::= Modifiersopt 'enum' Identifier TypeParameters |
| 2108 | /. $putCase consumeEnumHeaderNameWithTypeParameters(); $break ./ |
| 2109 | /:$readableName EnumHeaderName:/ |
| 2110 | /:$compliance 1.5:/ |
| 2111 | |
| 2112 | EnumBody ::= '{' EnumBodyDeclarationsopt '}' |
| 2113 | /. $putCase consumeEnumBodyNoConstants(); $break ./ |
| 2114 | EnumBody ::= '{' ',' EnumBodyDeclarationsopt '}' |
| 2115 | /. $putCase consumeEnumBodyNoConstants(); $break ./ |
| 2116 | EnumBody ::= '{' EnumConstants ',' EnumBodyDeclarationsopt '}' |
| 2117 | /. $putCase consumeEnumBodyWithConstants(); $break ./ |
| 2118 | EnumBody ::= '{' EnumConstants EnumBodyDeclarationsopt '}' |
| 2119 | /. $putCase consumeEnumBodyWithConstants(); $break ./ |
| 2120 | /:$readableName EnumBody:/ |
| 2121 | |
| 2122 | EnumConstants -> EnumConstant |
| 2123 | EnumConstants ::= EnumConstants ',' EnumConstant |
| 2124 | /.$putCase consumeEnumConstants(); $break ./ |
| 2125 | /:$readableName EnumConstants:/ |
| 2126 | |
| 2127 | EnumConstantHeaderName ::= Modifiersopt Identifier |
| 2128 | /.$putCase consumeEnumConstantHeaderName(); $break ./ |
| 2129 | /:$readableName EnumConstantHeaderName:/ |
| 2130 | |
| 2131 | EnumConstantHeader ::= EnumConstantHeaderName ForceNoDiet Argumentsopt RestoreDiet |
| 2132 | /.$putCase consumeEnumConstantHeader(); $break ./ |
| 2133 | /:$readableName EnumConstantHeader:/ |
| 2134 | |
| 2135 | EnumConstant ::= EnumConstantHeader ForceNoDiet ClassBody RestoreDiet |
| 2136 | /.$putCase consumeEnumConstantWithClassBody(); $break ./ |
| 2137 | EnumConstant ::= EnumConstantHeader |
| 2138 | /.$putCase consumeEnumConstantNoClassBody(); $break ./ |
| 2139 | /:$readableName EnumConstant:/ |
| 2140 | |
| 2141 | Arguments ::= '(' ArgumentListopt ')' |
| 2142 | /.$putCase consumeArguments(); $break ./ |
| 2143 | /:$readableName Arguments:/ |
| 2144 | |
| 2145 | Argumentsopt ::= $empty |
| 2146 | /.$putCase consumeEmptyArguments(); $break ./ |
| 2147 | Argumentsopt -> Arguments |
| 2148 | /:$readableName Argumentsopt:/ |
| 2149 | |
| 2150 | EnumDeclarations ::= ';' ClassBodyDeclarationsopt |
| 2151 | /.$putCase consumeEnumDeclarations(); $break ./ |
| 2152 | /:$readableName EnumDeclarations:/ |
| 2153 | |
| 2154 | EnumBodyDeclarationsopt ::= $empty |
| 2155 | /.$putCase consumeEmptyEnumDeclarations(); $break ./ |
| 2156 | EnumBodyDeclarationsopt -> EnumDeclarations |
| 2157 | /:$readableName EnumBodyDeclarationsopt:/ |
| 2158 | |
| 2159 | ----------------------------------------------- |
| 2160 | -- 1.5 features : enhanced for statement |
| 2161 | ----------------------------------------------- |
| 2162 | EnhancedForStatement ::= EnhancedForStatementHeader Statement |
| 2163 | /.$putCase consumeEnhancedForStatement(); $break ./ |
| 2164 | /:$readableName EnhancedForStatement:/ |
| 2165 | |
| 2166 | EnhancedForStatementNoShortIf ::= EnhancedForStatementHeader StatementNoShortIf |
| 2167 | /.$putCase consumeEnhancedForStatement(); $break ./ |
| 2168 | /:$readableName EnhancedForStatementNoShortIf:/ |
| 2169 | |
| 2170 | EnhancedForStatementHeaderInit ::= 'for' '(' Type PushModifiers Identifier Dimsopt |
| 2171 | /.$putCase consumeEnhancedForStatementHeaderInit(false); $break ./ |
| 2172 | /:$readableName EnhancedForStatementHeaderInit:/ |
| 2173 | |
| 2174 | EnhancedForStatementHeaderInit ::= 'for' '(' Modifiers Type PushRealModifiers Identifier Dimsopt |
| 2175 | /.$putCase consumeEnhancedForStatementHeaderInit(true); $break ./ |
| 2176 | /:$readableName EnhancedForStatementHeaderInit:/ |
| 2177 | |
| 2178 | EnhancedForStatementHeader ::= EnhancedForStatementHeaderInit ':' Expression ')' |
| 2179 | /.$putCase consumeEnhancedForStatementHeader(); $break ./ |
| 2180 | /:$readableName EnhancedForStatementHeader:/ |
| 2181 | /:$compliance 1.5:/ |
| 2182 | |
| 2183 | --{ObjectTeams: base import: |
| 2184 | SingleBaseImportDeclaration ::= SingleBaseImportDeclarationName ';' |
| 2185 | /.$putCase consumeImportDeclaration(); $break ./ |
| 2186 | /:$readableName SingleBaseImportDeclaration:/ |
| 2187 | |
| 2188 | SingleBaseImportDeclarationName ::= 'import' 'base' Name |
| 2189 | /.$putCase consumeSingleBaseImportDeclarationName(); $break ./ |
| 2190 | /:$readableName SingleBaseImportDeclarationName:/ |
| 2191 | -- SH} |
| 2192 | ----------------------------------------------- |
| 2193 | -- 1.5 features : static imports |
| 2194 | ----------------------------------------------- |
| 2195 | SingleStaticImportDeclaration ::= SingleStaticImportDeclarationName ';' |
| 2196 | /.$putCase consumeImportDeclaration(); $break ./ |
| 2197 | /:$readableName SingleStaticImportDeclaration:/ |
| 2198 | |
| 2199 | SingleStaticImportDeclarationName ::= 'import' 'static' Name |
| 2200 | /.$putCase consumeSingleStaticImportDeclarationName(); $break ./ |
| 2201 | /:$readableName SingleStaticImportDeclarationName:/ |
| 2202 | /:$compliance 1.5:/ |
| 2203 | |
| 2204 | StaticImportOnDemandDeclaration ::= StaticImportOnDemandDeclarationName ';' |
| 2205 | /.$putCase consumeImportDeclaration(); $break ./ |
| 2206 | /:$readableName StaticImportOnDemandDeclaration:/ |
| 2207 | |
| 2208 | StaticImportOnDemandDeclarationName ::= 'import' 'static' Name '.' '*' |
| 2209 | /.$putCase consumeStaticImportOnDemandDeclarationName(); $break ./ |
| 2210 | /:$readableName StaticImportOnDemandDeclarationName:/ |
| 2211 | /:$compliance 1.5:/ |
| 2212 | |
| 2213 | ----------------------------------------------- |
| 2214 | -- 1.5 features : generics |
| 2215 | ----------------------------------------------- |
| 2216 | TypeArguments ::= '<' TypeArgumentList1 |
| 2217 | /.$putCase consumeTypeArguments(); $break ./ |
| 2218 | /:$readableName TypeArguments:/ |
| 2219 | /:$compliance 1.5:/ |
| 2220 | |
| 2221 | OnlyTypeArguments ::= '<' TypeArgumentList1 |
| 2222 | /.$putCase consumeOnlyTypeArguments(); $break ./ |
| 2223 | /:$readableName TypeArguments:/ |
| 2224 | /:$compliance 1.5:/ |
| 2225 | |
| 2226 | TypeArgumentList1 -> TypeArgument1 |
| 2227 | /:$compliance 1.5:/ |
| 2228 | TypeArgumentList1 ::= TypeArgumentList ',' TypeArgument1 |
| 2229 | /.$putCase consumeTypeArgumentList1(); $break ./ |
| 2230 | /:$readableName TypeArgumentList1:/ |
| 2231 | /:$compliance 1.5:/ |
| 2232 | |
| 2233 | TypeArgumentList -> TypeArgument |
| 2234 | /:$compliance 1.5:/ |
| 2235 | TypeArgumentList ::= TypeArgumentList ',' TypeArgument |
| 2236 | /.$putCase consumeTypeArgumentList(); $break ./ |
| 2237 | /:$readableName TypeArgumentList:/ |
| 2238 | /:$compliance 1.5:/ |
| 2239 | |
| 2240 | TypeArgument ::= ReferenceType |
| 2241 | /.$putCase consumeTypeArgument(); $break ./ |
| 2242 | /:$compliance 1.5:/ |
| 2243 | TypeArgument -> Wildcard |
| 2244 | /:$readableName TypeArgument:/ |
| 2245 | /:$compliance 1.5:/ |
| 2246 | |
| 2247 | --{ObjectTeams: anchored types: |
| 2248 | TypeArgument -> TypeAnchor |
| 2249 | TypeArgument1 -> TypeAnchor '>' |
| 2250 | TypeArgument2 -> TypeAnchor '>>' |
| 2251 | |
| 2252 | TypeAnchor ::= '@' Name |
| 2253 | /.$putCase consumeTypeAnchor(false); $break ./ |
| 2254 | /:$readableName typeAnchor:/ |
| 2255 | |
| 2256 | -- base is a keyword in this mode, so explicitly expect it: |
| 2257 | TypeAnchor ::= '@' 'base' |
| 2258 | /.$putCase consumeTypeAnchor(true); $break ./ |
| 2259 | /:$readableName typeAnchor:/ |
| 2260 | |
| 2261 | -- also 'this' requires special treatment (skip because redundant): |
| 2262 | TypeAnchor ::= '@' 'this' |
| 2263 | /.$putCase skipThisAnchor(); $break ./ |
| 2264 | /:$readableName typeAnchor:/ |
| 2265 | |
| 2266 | TypeAnchor ::= '@' Name '.' 'base' |
| 2267 | /:$readableName typeAnchor:/ |
| 2268 | /.$putCase consumeQualifiedBaseTypeAnchor(); $break ./ |
| 2269 | |
| 2270 | --SH} |
| 2271 | |
| 2272 | TypeArgument1 -> ReferenceType1 |
| 2273 | /:$compliance 1.5:/ |
| 2274 | TypeArgument1 -> Wildcard1 |
| 2275 | /:$readableName TypeArgument1:/ |
| 2276 | /:$compliance 1.5:/ |
| 2277 | |
| 2278 | ReferenceType1 ::= ReferenceType '>' |
| 2279 | /.$putCase consumeReferenceType1(); $break ./ |
| 2280 | /:$compliance 1.5:/ |
| 2281 | ReferenceType1 ::= ClassOrInterface '<' TypeArgumentList2 |
| 2282 | /.$putCase consumeTypeArgumentReferenceType1(); $break ./ |
| 2283 | /:$readableName ReferenceType1:/ |
| 2284 | /:$compliance 1.5:/ |
| 2285 | |
| 2286 | TypeArgumentList2 -> TypeArgument2 |
| 2287 | /:$compliance 1.5:/ |
| 2288 | TypeArgumentList2 ::= TypeArgumentList ',' TypeArgument2 |
| 2289 | /.$putCase consumeTypeArgumentList2(); $break ./ |
| 2290 | /:$readableName TypeArgumentList2:/ |
| 2291 | /:$compliance 1.5:/ |
| 2292 | |
| 2293 | TypeArgument2 -> ReferenceType2 |
| 2294 | /:$compliance 1.5:/ |
| 2295 | TypeArgument2 -> Wildcard2 |
| 2296 | /:$readableName TypeArgument2:/ |
| 2297 | /:$compliance 1.5:/ |
| 2298 | |
| 2299 | ReferenceType2 ::= ReferenceType '>>' |
| 2300 | /.$putCase consumeReferenceType2(); $break ./ |
| 2301 | /:$compliance 1.5:/ |
| 2302 | ReferenceType2 ::= ClassOrInterface '<' TypeArgumentList3 |
| 2303 | /.$putCase consumeTypeArgumentReferenceType2(); $break ./ |
| 2304 | /:$readableName ReferenceType2:/ |
| 2305 | /:$compliance 1.5:/ |
| 2306 | |
| 2307 | TypeArgumentList3 -> TypeArgument3 |
| 2308 | TypeArgumentList3 ::= TypeArgumentList ',' TypeArgument3 |
| 2309 | /.$putCase consumeTypeArgumentList3(); $break ./ |
| 2310 | /:$readableName TypeArgumentList3:/ |
| 2311 | /:$compliance 1.5:/ |
| 2312 | |
| 2313 | TypeArgument3 -> ReferenceType3 |
| 2314 | TypeArgument3 -> Wildcard3 |
| 2315 | /:$readableName TypeArgument3:/ |
| 2316 | /:$compliance 1.5:/ |
| 2317 | |
| 2318 | ReferenceType3 ::= ReferenceType '>>>' |
| 2319 | /.$putCase consumeReferenceType3(); $break ./ |
| 2320 | /:$readableName ReferenceType3:/ |
| 2321 | /:$compliance 1.5:/ |
| 2322 | |
| 2323 | Wildcard ::= '?' |
| 2324 | /.$putCase consumeWildcard(); $break ./ |
| 2325 | /:$compliance 1.5:/ |
| 2326 | Wildcard ::= '?' WildcardBounds |
| 2327 | /.$putCase consumeWildcardWithBounds(); $break ./ |
| 2328 | /:$readableName Wildcard:/ |
| 2329 | /:$compliance 1.5:/ |
| 2330 | |
| 2331 | WildcardBounds ::= 'extends' ReferenceType |
| 2332 | /.$putCase consumeWildcardBoundsExtends(); $break ./ |
| 2333 | /:$compliance 1.5:/ |
| 2334 | WildcardBounds ::= 'super' ReferenceType |
| 2335 | /.$putCase consumeWildcardBoundsSuper(); $break ./ |
| 2336 | /:$readableName WildcardBounds:/ |
| 2337 | /:$compliance 1.5:/ |
| 2338 | |
| 2339 | Wildcard1 ::= '?' '>' |
| 2340 | /.$putCase consumeWildcard1(); $break ./ |
| 2341 | /:$compliance 1.5:/ |
| 2342 | Wildcard1 ::= '?' WildcardBounds1 |
| 2343 | /.$putCase consumeWildcard1WithBounds(); $break ./ |
| 2344 | /:$readableName Wildcard1:/ |
| 2345 | /:$compliance 1.5:/ |
| 2346 | |
| 2347 | WildcardBounds1 ::= 'extends' ReferenceType1 |
| 2348 | /.$putCase consumeWildcardBounds1Extends(); $break ./ |
| 2349 | /:$compliance 1.5:/ |
| 2350 | WildcardBounds1 ::= 'super' ReferenceType1 |
| 2351 | /.$putCase consumeWildcardBounds1Super(); $break ./ |
| 2352 | /:$readableName WildcardBounds1:/ |
| 2353 | /:$compliance 1.5:/ |
| 2354 | |
| 2355 | Wildcard2 ::= '?' '>>' |
| 2356 | /.$putCase consumeWildcard2(); $break ./ |
| 2357 | /:$compliance 1.5:/ |
| 2358 | Wildcard2 ::= '?' WildcardBounds2 |
| 2359 | /.$putCase consumeWildcard2WithBounds(); $break ./ |
| 2360 | /:$readableName Wildcard2:/ |
| 2361 | /:$compliance 1.5:/ |
| 2362 | |
| 2363 | WildcardBounds2 ::= 'extends' ReferenceType2 |
| 2364 | /.$putCase consumeWildcardBounds2Extends(); $break ./ |
| 2365 | /:$compliance 1.5:/ |
| 2366 | WildcardBounds2 ::= 'super' ReferenceType2 |
| 2367 | /.$putCase consumeWildcardBounds2Super(); $break ./ |
| 2368 | /:$readableName WildcardBounds2:/ |
| 2369 | /:$compliance 1.5:/ |
| 2370 | |
| 2371 | Wildcard3 ::= '?' '>>>' |
| 2372 | /.$putCase consumeWildcard3(); $break ./ |
| 2373 | /:$compliance 1.5:/ |
| 2374 | Wildcard3 ::= '?' WildcardBounds3 |
| 2375 | /.$putCase consumeWildcard3WithBounds(); $break ./ |
| 2376 | /:$readableName Wildcard3:/ |
| 2377 | /:$compliance 1.5:/ |
| 2378 | |
| 2379 | WildcardBounds3 ::= 'extends' ReferenceType3 |
| 2380 | /.$putCase consumeWildcardBounds3Extends(); $break ./ |
| 2381 | /:$compliance 1.5:/ |
| 2382 | WildcardBounds3 ::= 'super' ReferenceType3 |
| 2383 | /.$putCase consumeWildcardBounds3Super(); $break ./ |
| 2384 | /:$readableName WildcardBound3:/ |
| 2385 | /:$compliance 1.5:/ |
| 2386 | |
| 2387 | TypeParameterHeader ::= Identifier |
| 2388 | /.$putCase consumeTypeParameterHeader(); $break ./ |
| 2389 | /:$readableName TypeParameter:/ |
| 2390 | /:$compliance 1.5:/ |
| 2391 | |
| 2392 | TypeParameters ::= '<' TypeParameterList1 |
| 2393 | /.$putCase consumeTypeParameters(); $break ./ |
| 2394 | /:$readableName TypeParameters:/ |
| 2395 | /:$compliance 1.5:/ |
| 2396 | |
| 2397 | TypeParameterList -> TypeParameter |
| 2398 | /:$compliance 1.5:/ |
| 2399 | TypeParameterList ::= TypeParameterList ',' TypeParameter |
| 2400 | /.$putCase consumeTypeParameterList(); $break ./ |
| 2401 | /:$readableName TypeParameterList:/ |
| 2402 | /:$compliance 1.5:/ |
| 2403 | |
| 2404 | TypeParameter -> TypeParameterHeader |
| 2405 | /:$compliance 1.5:/ |
| 2406 | TypeParameter ::= TypeParameterHeader 'extends' ReferenceType |
| 2407 | /.$putCase consumeTypeParameterWithExtends(); $break ./ |
| 2408 | /:$compliance 1.5:/ |
| 2409 | TypeParameter ::= TypeParameterHeader 'extends' ReferenceType AdditionalBoundList |
| 2410 | /.$putCase consumeTypeParameterWithExtendsAndBounds(); $break ./ |
| 2411 | /:$readableName TypeParameter:/ |
| 2412 | /:$compliance 1.5:/ |
| 2413 | |
| 2414 | --{ObjectTeams: |
| 2415 | -- <B base R> |
| 2416 | TypeParameter ::= TypeParameterHeader 'base' ReferenceType |
| 2417 | /.$putCase consumeTypeParameterWithBase(); $break ./ |
| 2418 | /:$compliance 1.5:/ |
| 2419 | |
| 2420 | -- <... Team t ...> |
| 2421 | TypeParameter -> TypeValueParameter |
| 2422 | TypeParameter1 -> TypeValueParameter1 |
| 2423 | |
| 2424 | TypeValueParameter1 -> TypeValueParameter '>' |
| 2425 | |
| 2426 | TypeValueParameter ::= TypeParameterHeader Identifier |
| 2427 | /.$putCase consumeTypeValueParameter(); $break ./ |
| 2428 | /:$compliance 1.5:/ |
| 2429 | /:$readableName TypeValueParameter:/ |
| 2430 | |
| 2431 | TypeParameter -> AnchoredTypeParameterHeader0 '>' TypeBoundOpt |
| 2432 | TypeParameter1 -> AnchoredTypeParameterHeader0 '>' TypeBoundOpt1 |
| 2433 | TypeParameter1 -> AnchoredTypeParameterHeader0 '>>' |
| 2434 | |
| 2435 | TypeBoundOpt -> $empty |
| 2436 | TypeBoundOpt ::= 'extends' ReferenceType |
| 2437 | /.$putCase consumeBoundsOfAnchoredTypeParameter(); $break ./ |
| 2438 | /:$compliance 1.5:/ |
| 2439 | /:$readableName TypeParameterBound:/ |
| 2440 | |
| 2441 | TypeBoundOpt1 -> '>' |
| 2442 | TypeBoundOpt1 ::= 'extends' ReferenceType1 |
| 2443 | /.$putCase consumeBoundsOfAnchoredTypeParameter(); $break ./ |
| 2444 | /:$compliance 1.5:/ |
| 2445 | /:$readableName TypeParameterBound:/ |
| 2446 | |
| 2447 | AnchoredTypeParameterHeader0 ::= TypeParameterHeader '<' TypeAnchor |
| 2448 | /.$putCase consumeAnchoredTypeParameter(); $break ./ |
| 2449 | /:$compliance 1.5:/ |
| 2450 | /:$readableName AnchoredTypeParameter:/ |
| 2451 | -- SH} |
| 2452 | |
| 2453 | AdditionalBoundList -> AdditionalBound |
| 2454 | /:$compliance 1.5:/ |
| 2455 | AdditionalBoundList ::= AdditionalBoundList AdditionalBound |
| 2456 | /.$putCase consumeAdditionalBoundList(); $break ./ |
| 2457 | /:$readableName AdditionalBoundList:/ |
| 2458 | |
| 2459 | AdditionalBound ::= '&' ReferenceType |
| 2460 | /.$putCase consumeAdditionalBound(); $break ./ |
| 2461 | /:$readableName AdditionalBound:/ |
| 2462 | /:$compliance 1.5:/ |
| 2463 | |
| 2464 | TypeParameterList1 -> TypeParameter1 |
| 2465 | /:$compliance 1.5:/ |
| 2466 | TypeParameterList1 ::= TypeParameterList ',' TypeParameter1 |
| 2467 | /.$putCase consumeTypeParameterList1(); $break ./ |
| 2468 | /:$readableName TypeParameterList1:/ |
| 2469 | /:$compliance 1.5:/ |
| 2470 | |
| 2471 | TypeParameter1 ::= TypeParameterHeader '>' |
| 2472 | /.$putCase consumeTypeParameter1(); $break ./ |
| 2473 | /:$compliance 1.5:/ |
| 2474 | TypeParameter1 ::= TypeParameterHeader 'extends' ReferenceType1 |
| 2475 | /.$putCase consumeTypeParameter1WithExtends(); $break ./ |
| 2476 | /:$compliance 1.5:/ |
| 2477 | |
| 2478 | --{ObjectTeams: <B base R> |
| 2479 | TypeParameter1 ::= TypeParameterHeader 'base' ReferenceType1 |
| 2480 | /.$putCase consumeTypeParameter1WithBase(); $break ./ |
| 2481 | /:$compliance 1.5:/ |
| 2482 | -- SH} |
| 2483 | |
| 2484 | TypeParameter1 ::= TypeParameterHeader 'extends' ReferenceType AdditionalBoundList1 |
| 2485 | /.$putCase consumeTypeParameter1WithExtendsAndBounds(); $break ./ |
| 2486 | /:$readableName TypeParameter1:/ |
| 2487 | /:$compliance 1.5:/ |
| 2488 | |
| 2489 | AdditionalBoundList1 -> AdditionalBound1 |
| 2490 | /:$compliance 1.5:/ |
| 2491 | AdditionalBoundList1 ::= AdditionalBoundList AdditionalBound1 |
| 2492 | /.$putCase consumeAdditionalBoundList1(); $break ./ |
| 2493 | /:$readableName AdditionalBoundList1:/ |
| 2494 | /:$compliance 1.5:/ |
| 2495 | |
| 2496 | AdditionalBound1 ::= '&' ReferenceType1 |
| 2497 | /.$putCase consumeAdditionalBound1(); $break ./ |
| 2498 | /:$readableName AdditionalBound1:/ |
| 2499 | /:$compliance 1.5:/ |
| 2500 | |
| 2501 | ------------------------------------------------- |
| 2502 | -- Duplicate rules to remove ambiguity for (x) -- |
| 2503 | ------------------------------------------------- |
| 2504 | PostfixExpression_NotName -> Primary |
| 2505 | PostfixExpression_NotName -> PostIncrementExpression |
| 2506 | PostfixExpression_NotName -> PostDecrementExpression |
| 2507 | /:$readableName Expression:/ |
| 2508 | |
| 2509 | UnaryExpression_NotName -> PreIncrementExpression |
| 2510 | UnaryExpression_NotName -> PreDecrementExpression |
| 2511 | UnaryExpression_NotName ::= '+' PushPosition UnaryExpression |
| 2512 | /.$putCase consumeUnaryExpression(OperatorIds.PLUS); $break ./ |
| 2513 | UnaryExpression_NotName ::= '-' PushPosition UnaryExpression |
| 2514 | /.$putCase consumeUnaryExpression(OperatorIds.MINUS); $break ./ |
| 2515 | UnaryExpression_NotName -> UnaryExpressionNotPlusMinus_NotName |
| 2516 | /:$readableName Expression:/ |
| 2517 | |
| 2518 | UnaryExpressionNotPlusMinus_NotName -> PostfixExpression_NotName |
| 2519 | UnaryExpressionNotPlusMinus_NotName ::= '~' PushPosition UnaryExpression |
| 2520 | /.$putCase consumeUnaryExpression(OperatorIds.TWIDDLE); $break ./ |
| 2521 | UnaryExpressionNotPlusMinus_NotName ::= '!' PushPosition UnaryExpression |
| 2522 | /.$putCase consumeUnaryExpression(OperatorIds.NOT); $break ./ |
| 2523 | UnaryExpressionNotPlusMinus_NotName -> CastExpression |
| 2524 | /:$readableName Expression:/ |
| 2525 | |
| 2526 | MultiplicativeExpression_NotName -> UnaryExpression_NotName |
| 2527 | MultiplicativeExpression_NotName ::= MultiplicativeExpression_NotName '*' UnaryExpression |
| 2528 | /.$putCase consumeBinaryExpression(OperatorIds.MULTIPLY); $break ./ |
| 2529 | MultiplicativeExpression_NotName ::= Name '*' UnaryExpression |
| 2530 | /.$putCase consumeBinaryExpressionWithName(OperatorIds.MULTIPLY); $break ./ |
| 2531 | MultiplicativeExpression_NotName ::= MultiplicativeExpression_NotName '/' UnaryExpression |
| 2532 | /.$putCase consumeBinaryExpression(OperatorIds.DIVIDE); $break ./ |
| 2533 | MultiplicativeExpression_NotName ::= Name '/' UnaryExpression |
| 2534 | /.$putCase consumeBinaryExpressionWithName(OperatorIds.DIVIDE); $break ./ |
| 2535 | MultiplicativeExpression_NotName ::= MultiplicativeExpression_NotName '%' UnaryExpression |
| 2536 | /.$putCase consumeBinaryExpression(OperatorIds.REMAINDER); $break ./ |
| 2537 | MultiplicativeExpression_NotName ::= Name '%' UnaryExpression |
| 2538 | /.$putCase consumeBinaryExpressionWithName(OperatorIds.REMAINDER); $break ./ |
| 2539 | /:$readableName Expression:/ |
| 2540 | |
| 2541 | AdditiveExpression_NotName -> MultiplicativeExpression_NotName |
| 2542 | AdditiveExpression_NotName ::= AdditiveExpression_NotName '+' MultiplicativeExpression |
| 2543 | /.$putCase consumeBinaryExpression(OperatorIds.PLUS); $break ./ |
| 2544 | AdditiveExpression_NotName ::= Name '+' MultiplicativeExpression |
| 2545 | /.$putCase consumeBinaryExpressionWithName(OperatorIds.PLUS); $break ./ |
| 2546 | AdditiveExpression_NotName ::= AdditiveExpression_NotName '-' MultiplicativeExpression |
| 2547 | /.$putCase consumeBinaryExpression(OperatorIds.MINUS); $break ./ |
| 2548 | AdditiveExpression_NotName ::= Name '-' MultiplicativeExpression |
| 2549 | /.$putCase consumeBinaryExpressionWithName(OperatorIds.MINUS); $break ./ |
| 2550 | /:$readableName Expression:/ |
| 2551 | |
| 2552 | ShiftExpression_NotName -> AdditiveExpression_NotName |
| 2553 | ShiftExpression_NotName ::= ShiftExpression_NotName '<<' AdditiveExpression |
| 2554 | /.$putCase consumeBinaryExpression(OperatorIds.LEFT_SHIFT); $break ./ |
| 2555 | ShiftExpression_NotName ::= Name '<<' AdditiveExpression |
| 2556 | /.$putCase consumeBinaryExpressionWithName(OperatorIds.LEFT_SHIFT); $break ./ |
| 2557 | ShiftExpression_NotName ::= ShiftExpression_NotName '>>' AdditiveExpression |
| 2558 | /.$putCase consumeBinaryExpression(OperatorIds.RIGHT_SHIFT); $break ./ |
| 2559 | ShiftExpression_NotName ::= Name '>>' AdditiveExpression |
| 2560 | /.$putCase consumeBinaryExpressionWithName(OperatorIds.RIGHT_SHIFT); $break ./ |
| 2561 | ShiftExpression_NotName ::= ShiftExpression_NotName '>>>' AdditiveExpression |
| 2562 | /.$putCase consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT); $break ./ |
| 2563 | ShiftExpression_NotName ::= Name '>>>' AdditiveExpression |
| 2564 | /.$putCase consumeBinaryExpressionWithName(OperatorIds.UNSIGNED_RIGHT_SHIFT); $break ./ |
| 2565 | /:$readableName Expression:/ |
| 2566 | |
| 2567 | RelationalExpression_NotName -> ShiftExpression_NotName |
| 2568 | RelationalExpression_NotName ::= ShiftExpression_NotName '<' ShiftExpression |
| 2569 | /.$putCase consumeBinaryExpression(OperatorIds.LESS); $break ./ |
| 2570 | RelationalExpression_NotName ::= Name '<' ShiftExpression |
| 2571 | /.$putCase consumeBinaryExpressionWithName(OperatorIds.LESS); $break ./ |
| 2572 | RelationalExpression_NotName ::= ShiftExpression_NotName '>' ShiftExpression |
| 2573 | /.$putCase consumeBinaryExpression(OperatorIds.GREATER); $break ./ |
| 2574 | RelationalExpression_NotName ::= Name '>' ShiftExpression |
| 2575 | /.$putCase consumeBinaryExpressionWithName(OperatorIds.GREATER); $break ./ |
| 2576 | RelationalExpression_NotName ::= RelationalExpression_NotName '<=' ShiftExpression |
| 2577 | /.$putCase consumeBinaryExpression(OperatorIds.LESS_EQUAL); $break ./ |
| 2578 | RelationalExpression_NotName ::= Name '<=' ShiftExpression |
| 2579 | /.$putCase consumeBinaryExpressionWithName(OperatorIds.LESS_EQUAL); $break ./ |
| 2580 | RelationalExpression_NotName ::= RelationalExpression_NotName '>=' ShiftExpression |
| 2581 | /.$putCase consumeBinaryExpression(OperatorIds.GREATER_EQUAL); $break ./ |
| 2582 | RelationalExpression_NotName ::= Name '>=' ShiftExpression |
| 2583 | /.$putCase consumeBinaryExpressionWithName(OperatorIds.GREATER_EQUAL); $break ./ |
| 2584 | /:$readableName Expression:/ |
| 2585 | |
| 2586 | InstanceofExpression_NotName -> RelationalExpression_NotName |
| 2587 | InstanceofExpression_NotName ::= Name 'instanceof' ReferenceType |
| 2588 | /.$putCase consumeInstanceOfExpressionWithName(); $break ./ |
| 2589 | InstanceofExpression_NotName ::= InstanceofExpression_NotName 'instanceof' ReferenceType |
| 2590 | /.$putCase consumeInstanceOfExpression(); $break ./ |
| 2591 | /:$readableName Expression:/ |
| 2592 | |
| 2593 | EqualityExpression_NotName -> InstanceofExpression_NotName |
| 2594 | EqualityExpression_NotName ::= EqualityExpression_NotName '==' InstanceofExpression |
| 2595 | /.$putCase consumeEqualityExpression(OperatorIds.EQUAL_EQUAL); $break ./ |
| 2596 | EqualityExpression_NotName ::= Name '==' InstanceofExpression |
| 2597 | /.$putCase consumeEqualityExpressionWithName(OperatorIds.EQUAL_EQUAL); $break ./ |
| 2598 | EqualityExpression_NotName ::= EqualityExpression_NotName '!=' InstanceofExpression |
| 2599 | /.$putCase consumeEqualityExpression(OperatorIds.NOT_EQUAL); $break ./ |
| 2600 | EqualityExpression_NotName ::= Name '!=' InstanceofExpression |
| 2601 | /.$putCase consumeEqualityExpressionWithName(OperatorIds.NOT_EQUAL); $break ./ |
| 2602 | /:$readableName Expression:/ |
| 2603 | |
| 2604 | AndExpression_NotName -> EqualityExpression_NotName |
| 2605 | AndExpression_NotName ::= AndExpression_NotName '&' EqualityExpression |
| 2606 | /.$putCase consumeBinaryExpression(OperatorIds.AND); $break ./ |
| 2607 | AndExpression_NotName ::= Name '&' EqualityExpression |
| 2608 | /.$putCase consumeBinaryExpressionWithName(OperatorIds.AND); $break ./ |
| 2609 | /:$readableName Expression:/ |
| 2610 | |
| 2611 | ExclusiveOrExpression_NotName -> AndExpression_NotName |
| 2612 | ExclusiveOrExpression_NotName ::= ExclusiveOrExpression_NotName '^' AndExpression |
| 2613 | /.$putCase consumeBinaryExpression(OperatorIds.XOR); $break ./ |
| 2614 | ExclusiveOrExpression_NotName ::= Name '^' AndExpression |
| 2615 | /.$putCase consumeBinaryExpressionWithName(OperatorIds.XOR); $break ./ |
| 2616 | /:$readableName Expression:/ |
| 2617 | |
| 2618 | InclusiveOrExpression_NotName -> ExclusiveOrExpression_NotName |
| 2619 | InclusiveOrExpression_NotName ::= InclusiveOrExpression_NotName '|' ExclusiveOrExpression |
| 2620 | /.$putCase consumeBinaryExpression(OperatorIds.OR); $break ./ |
| 2621 | InclusiveOrExpression_NotName ::= Name '|' ExclusiveOrExpression |
| 2622 | /.$putCase consumeBinaryExpressionWithName(OperatorIds.OR); $break ./ |
| 2623 | /:$readableName Expression:/ |
| 2624 | |
| 2625 | ConditionalAndExpression_NotName -> InclusiveOrExpression_NotName |
| 2626 | ConditionalAndExpression_NotName ::= ConditionalAndExpression_NotName '&&' InclusiveOrExpression |
| 2627 | /.$putCase consumeBinaryExpression(OperatorIds.AND_AND); $break ./ |
| 2628 | ConditionalAndExpression_NotName ::= Name '&&' InclusiveOrExpression |
| 2629 | /.$putCase consumeBinaryExpressionWithName(OperatorIds.AND_AND); $break ./ |
| 2630 | /:$readableName Expression:/ |
| 2631 | |
| 2632 | ConditionalOrExpression_NotName -> ConditionalAndExpression_NotName |
| 2633 | ConditionalOrExpression_NotName ::= ConditionalOrExpression_NotName '||' ConditionalAndExpression |
| 2634 | /.$putCase consumeBinaryExpression(OperatorIds.OR_OR); $break ./ |
| 2635 | ConditionalOrExpression_NotName ::= Name '||' ConditionalAndExpression |
| 2636 | /.$putCase consumeBinaryExpressionWithName(OperatorIds.OR_OR); $break ./ |
| 2637 | /:$readableName Expression:/ |
| 2638 | |
| 2639 | ConditionalExpression_NotName -> ConditionalOrExpression_NotName |
| 2640 | ConditionalExpression_NotName ::= ConditionalOrExpression_NotName '?' Expression ':' ConditionalExpression |
| 2641 | /.$putCase consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ; $break ./ |
| 2642 | ConditionalExpression_NotName ::= Name '?' Expression ':' ConditionalExpression |
| 2643 | /.$putCase consumeConditionalExpressionWithName(OperatorIds.QUESTIONCOLON) ; $break ./ |
| 2644 | /:$readableName Expression:/ |
| 2645 | |
| 2646 | AssignmentExpression_NotName -> ConditionalExpression_NotName |
| 2647 | AssignmentExpression_NotName -> Assignment |
| 2648 | /:$readableName Expression:/ |
| 2649 | |
| 2650 | Expression_NotName -> AssignmentExpression_NotName |
| 2651 | /:$readableName Expression:/ |
| 2652 | ----------------------------------------------- |
| 2653 | -- 1.5 features : end of generics |
| 2654 | ----------------------------------------------- |
| 2655 | ----------------------------------------------- |
| 2656 | -- 1.5 features : annotation - Metadata feature jsr175 |
| 2657 | ----------------------------------------------- |
| 2658 | AnnotationTypeDeclarationHeaderName ::= Modifiers '@' PushRealModifiers interface Identifier |
| 2659 | /.$putCase consumeAnnotationTypeDeclarationHeaderName() ; $break ./ |
| 2660 | /:$compliance 1.5:/ |
| 2661 | AnnotationTypeDeclarationHeaderName ::= Modifiers '@' PushRealModifiers interface Identifier TypeParameters |
| 2662 | /.$putCase consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ; $break ./ |
| 2663 | /:$compliance 1.5:/ |
| 2664 | AnnotationTypeDeclarationHeaderName ::= '@' PushModifiersForHeader interface Identifier TypeParameters |
| 2665 | /.$putCase consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ; $break ./ |
| 2666 | /:$compliance 1.5:/ |
| 2667 | AnnotationTypeDeclarationHeaderName ::= '@' PushModifiersForHeader interface Identifier |
| 2668 | /.$putCase consumeAnnotationTypeDeclarationHeaderName() ; $break ./ |
| 2669 | /:$readableName AnnotationTypeDeclarationHeaderName:/ |
| 2670 | /:$compliance 1.5:/ |
| 2671 | |
| 2672 | AnnotationTypeDeclarationHeader ::= AnnotationTypeDeclarationHeaderName ClassHeaderExtendsopt ClassHeaderImplementsopt |
| 2673 | /.$putCase consumeAnnotationTypeDeclarationHeader() ; $break ./ |
| 2674 | /:$readableName AnnotationTypeDeclarationHeader:/ |
| 2675 | /:$compliance 1.5:/ |
| 2676 | |
| 2677 | AnnotationTypeDeclaration ::= AnnotationTypeDeclarationHeader AnnotationTypeBody |
| 2678 | /.$putCase consumeAnnotationTypeDeclaration() ; $break ./ |
| 2679 | /:$readableName AnnotationTypeDeclaration:/ |
| 2680 | /:$compliance 1.5:/ |
| 2681 | |
| 2682 | AnnotationTypeBody ::= '{' AnnotationTypeMemberDeclarationsopt '}' |
| 2683 | /:$readableName AnnotationTypeBody:/ |
| 2684 | /:$compliance 1.5:/ |
| 2685 | |
| 2686 | AnnotationTypeMemberDeclarationsopt ::= $empty |
| 2687 | /.$putCase consumeEmptyAnnotationTypeMemberDeclarationsopt() ; $break ./ |
| 2688 | /:$compliance 1.5:/ |
| 2689 | AnnotationTypeMemberDeclarationsopt ::= NestedType AnnotationTypeMemberDeclarations |
| 2690 | /.$putCase consumeAnnotationTypeMemberDeclarationsopt() ; $break ./ |
| 2691 | /:$readableName AnnotationTypeMemberDeclarations:/ |
| 2692 | /:$compliance 1.5:/ |
| 2693 | |
| 2694 | AnnotationTypeMemberDeclarations -> AnnotationTypeMemberDeclaration |
| 2695 | /:$compliance 1.5:/ |
| 2696 | AnnotationTypeMemberDeclarations ::= AnnotationTypeMemberDeclarations AnnotationTypeMemberDeclaration |
| 2697 | /.$putCase consumeAnnotationTypeMemberDeclarations() ; $break ./ |
| 2698 | /:$readableName AnnotationTypeMemberDeclarations:/ |
| 2699 | /:$compliance 1.5:/ |
| 2700 | |
| 2701 | AnnotationMethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '(' |
| 2702 | /.$putCase consumeMethodHeaderNameWithTypeParameters(true); $break ./ |
| 2703 | AnnotationMethodHeaderName ::= Modifiersopt Type 'Identifier' '(' |
| 2704 | /.$putCase consumeMethodHeaderName(true); $break ./ |
| 2705 | /:$readableName MethodHeaderName:/ |
| 2706 | /:$compliance 1.5:/ |
| 2707 | |
| 2708 | AnnotationMethodHeaderDefaultValueopt ::= $empty |
| 2709 | /.$putCase consumeEmptyMethodHeaderDefaultValue() ; $break ./ |
| 2710 | /:$readableName MethodHeaderDefaultValue:/ |
| 2711 | /:$compliance 1.5:/ |
| 2712 | AnnotationMethodHeaderDefaultValueopt ::= DefaultValue |
| 2713 | /.$putCase consumeMethodHeaderDefaultValue(); $break ./ |
| 2714 | /:$readableName MethodHeaderDefaultValue:/ |
| 2715 | /:$compliance 1.5:/ |
| 2716 | |
| 2717 | AnnotationMethodHeader ::= AnnotationMethodHeaderName FormalParameterListopt MethodHeaderRightParen MethodHeaderExtendedDims AnnotationMethodHeaderDefaultValueopt |
| 2718 | /.$putCase consumeMethodHeader(); $break ./ |
| 2719 | /:$readableName AnnotationMethodHeader:/ |
| 2720 | /:$compliance 1.5:/ |
| 2721 | |
| 2722 | AnnotationTypeMemberDeclaration ::= AnnotationMethodHeader ';' |
| 2723 | /.$putCase consumeAnnotationTypeMemberDeclaration() ; $break ./ |
| 2724 | /:$compliance 1.5:/ |
| 2725 | AnnotationTypeMemberDeclaration -> ConstantDeclaration |
| 2726 | /:$compliance 1.5:/ |
| 2727 | AnnotationTypeMemberDeclaration -> ConstructorDeclaration |
| 2728 | /:$compliance 1.5:/ |
| 2729 | AnnotationTypeMemberDeclaration -> TypeDeclaration |
| 2730 | /:$readableName AnnotationTypeMemberDeclaration:/ |
| 2731 | /:$compliance 1.5:/ |
| 2732 | |
| 2733 | DefaultValue ::= 'default' MemberValue |
| 2734 | /:$readableName DefaultValue:/ |
| 2735 | /:$compliance 1.5:/ |
| 2736 | |
| 2737 | Annotation -> NormalAnnotation |
| 2738 | /:$compliance 1.5:/ |
| 2739 | Annotation -> MarkerAnnotation |
| 2740 | /:$compliance 1.5:/ |
| 2741 | Annotation -> SingleMemberAnnotation |
| 2742 | /:$readableName Annotation:/ |
| 2743 | /:$compliance 1.5:/ |
| 2744 | |
| 2745 | AnnotationName ::= '@' Name |
| 2746 | /.$putCase consumeAnnotationName() ; $break ./ |
| 2747 | /:$readableName AnnotationName:/ |
| 2748 | /:$compliance 1.5:/ |
| 2749 | |
| 2750 | NormalAnnotation ::= AnnotationName '(' MemberValuePairsopt ')' |
| 2751 | /.$putCase consumeNormalAnnotation() ; $break ./ |
| 2752 | /:$readableName NormalAnnotation:/ |
| 2753 | /:$compliance 1.5:/ |
| 2754 | |
| 2755 | MemberValuePairsopt ::= $empty |
| 2756 | /.$putCase consumeEmptyMemberValuePairsopt() ; $break ./ |
| 2757 | /:$compliance 1.5:/ |
| 2758 | MemberValuePairsopt -> MemberValuePairs |
| 2759 | /:$readableName MemberValuePairsopt:/ |
| 2760 | /:$compliance 1.5:/ |
| 2761 | |
| 2762 | MemberValuePairs -> MemberValuePair |
| 2763 | /:$compliance 1.5:/ |
| 2764 | MemberValuePairs ::= MemberValuePairs ',' MemberValuePair |
| 2765 | /.$putCase consumeMemberValuePairs() ; $break ./ |
| 2766 | /:$readableName MemberValuePairs:/ |
| 2767 | /:$compliance 1.5:/ |
| 2768 | |
| 2769 | MemberValuePair ::= SimpleName '=' EnterMemberValue MemberValue ExitMemberValue |
| 2770 | /.$putCase consumeMemberValuePair() ; $break ./ |
| 2771 | /:$readableName MemberValuePair:/ |
| 2772 | /:$compliance 1.5:/ |
| 2773 | |
| 2774 | EnterMemberValue ::= $empty |
| 2775 | /.$putCase consumeEnterMemberValue() ; $break ./ |
| 2776 | /:$readableName EnterMemberValue:/ |
| 2777 | /:$compliance 1.5:/ |
| 2778 | |
| 2779 | ExitMemberValue ::= $empty |
| 2780 | /.$putCase consumeExitMemberValue() ; $break ./ |
| 2781 | /:$readableName ExitMemberValue:/ |
| 2782 | /:$compliance 1.5:/ |
| 2783 | |
| 2784 | MemberValue -> ConditionalExpression_NotName |
| 2785 | /:$compliance 1.5:/ |
| 2786 | MemberValue ::= Name |
| 2787 | /.$putCase consumeMemberValueAsName() ; $break ./ |
| 2788 | /:$compliance 1.5:/ |
| 2789 | MemberValue -> Annotation |
| 2790 | /:$compliance 1.5:/ |
| 2791 | MemberValue -> MemberValueArrayInitializer |
| 2792 | /:$readableName MemberValue:/ |
| 2793 | /:$recovery_template Identifier:/ |
| 2794 | /:$compliance 1.5:/ |
| 2795 | |
| 2796 | MemberValueArrayInitializer ::= EnterMemberValueArrayInitializer '{' PushLeftBrace MemberValues ',' '}' |
| 2797 | /.$putCase consumeMemberValueArrayInitializer() ; $break ./ |
| 2798 | /:$compliance 1.5:/ |
| 2799 | MemberValueArrayInitializer ::= EnterMemberValueArrayInitializer '{' PushLeftBrace MemberValues '}' |
| 2800 | /.$putCase consumeMemberValueArrayInitializer() ; $break ./ |
| 2801 | /:$compliance 1.5:/ |
| 2802 | MemberValueArrayInitializer ::= EnterMemberValueArrayInitializer '{' PushLeftBrace ',' '}' |
| 2803 | /.$putCase consumeEmptyMemberValueArrayInitializer() ; $break ./ |
| 2804 | /:$compliance 1.5:/ |
| 2805 | MemberValueArrayInitializer ::= EnterMemberValueArrayInitializer '{' PushLeftBrace '}' |
| 2806 | /.$putCase consumeEmptyMemberValueArrayInitializer() ; $break ./ |
| 2807 | /:$readableName MemberValueArrayInitializer:/ |
| 2808 | /:$compliance 1.5:/ |
| 2809 | |
| 2810 | EnterMemberValueArrayInitializer ::= $empty |
| 2811 | /.$putCase consumeEnterMemberValueArrayInitializer() ; $break ./ |
| 2812 | /:$readableName EnterMemberValueArrayInitializer:/ |
| 2813 | /:$compliance 1.5:/ |
| 2814 | |
| 2815 | MemberValues -> MemberValue |
| 2816 | /:$compliance 1.5:/ |
| 2817 | MemberValues ::= MemberValues ',' MemberValue |
| 2818 | /.$putCase consumeMemberValues() ; $break ./ |
| 2819 | /:$readableName MemberValues:/ |
| 2820 | /:$compliance 1.5:/ |
| 2821 | |
| 2822 | MarkerAnnotation ::= AnnotationName |
| 2823 | /.$putCase consumeMarkerAnnotation() ; $break ./ |
| 2824 | /:$readableName MarkerAnnotation:/ |
| 2825 | /:$compliance 1.5:/ |
| 2826 | |
| 2827 | SingleMemberAnnotationMemberValue ::= MemberValue |
| 2828 | /.$putCase consumeSingleMemberAnnotationMemberValue() ; $break ./ |
| 2829 | /:$readableName MemberValue:/ |
| 2830 | /:$compliance 1.5:/ |
| 2831 | |
| 2832 | SingleMemberAnnotation ::= AnnotationName '(' SingleMemberAnnotationMemberValue ')' |
| 2833 | /.$putCase consumeSingleMemberAnnotation() |