Eagle Legacy Modernization, LLC

Java Grammar

Main program: Java_Program

 Count  Terminals:
1,646 Java_Character_Literal: A string enclosed in quotes
5,647 Java_Class_Definition: An identifier
95,251 Java_Comment: Comment
2,127 Java_Current_Class_Reference: An identifier
239 Java_HexNumber: A hex number
82,344 Java_Identifier: An identifier
212,734 Java_Identifier_Reference: An identifier
  Java_Label_Definition: An identifier
25,301 Java_Literal: A string enclosed in quotes
8,228 Java_Method_Definition: An identifier
12,785 Java_Number: A number
41,243 Java_Variable_Definition: An identifier
 Count  Statistics(*) Tokens:
6,183 (15% | 85%) Java_Annotation: (Java_AnnotationCall | Java_AnnotationCall2)
911 all all all 1.00(all) all |   Java_AnnotationCall: '@' Java_Variable '(' [Java_Expression]* ')'
5,272 all all 1.00(0%) |   Java_AnnotationCall2: '@' Java_Identifier [Java_Comment]*
35,399 all 1.00(0%) 1.92(36%) 0% Java_ArgumentList: Java_Expression [Java_Comment]* [Java_MoreArguments]* [',']
24,699 all 1.02(1%) all 1.00(0%) |   Java_MoreArguments: ',' [Java_Comment]* Java_Expression [Java_Comment]*
5,647 99% all all all 1% 87% 6% 1.00(0%) all 5.52(99%) all 1.43(7%) none Java_Class: [Java_ClassModifierList] ['@'] ("class"|"interface") Java_Class_Definition [Java_GenericType] [Java_ClassExtends] [Java_ClassImplements] [Java_Comment]* '{' [Java_ClassElement]* '}' [Java_Comment]* [';']
30,743 (66% | 1% | 27% | 7% | none) |   Java_ClassElement: (Java_StaticStatement | Java_Comment | Java_Method | Java_Constructor | ';')
20,160 all all |   |   Java_StaticStatement: ["static"] Java_Statement
4,907 all 1.01 0% none |   Java_ClassExtends: "extends" Java_Identifier_Reference* [Java_GenericType] [Java_MoreExtends]*
    |   |   Java_MoreExtends: ',' Java_Identifier_Reference* [Java_GenericType]
315 all 1.22 1% 1.37(11%) |   Java_ClassImplements: "implements" Java_Identifier_Reference* [Java_GenericType] [Java_MoreImplements]*
48 all all 1.25 none |   |   Java_MoreImplements: ',' [Java_Comment] Java_Identifier_Reference* [Java_GenericType]
9,528 (0% | 11% | 88%) |   Java_ClassModifier: (Java_Comment | Java_Annotation | ("abstract"|"final"|"native"|"private"|"protected"|"public"|"static"|"synchronized"|"transient"|"volatile"))
5,601 1.70 |   Java_ClassModifierList: Java_ClassModifier*
29,412 1.00(1%) 1.24(56%) 1.06(12%) all all 1.00(1%) 70% 1.27(0%) all 1.22(3%) Java_Data: [Java_Annotation]* [Java_DataModifier]* [Java_Annotation]* Java_Type Java_Variable_Definition [Java_DataSubscript]* [Java_DataInitialValue] [Java_MoreIdentifiers]* ';' [Java_Comment]*
20,542 all all |   Java_DataInitialValue: '=' Java_Expression
20,653 all |   Java_DataModifier: ("abstract"|"final"|"native"|"private"|"protected"|"public"|"static"|"synchronized"|"transient"|"volatile")
358 all all |   Java_DataSubscript: '[' ']'
38 all all none none 5% |   Java_MoreIdentifiers: ',' Java_Variable_Definition ['['] [']'] [Java_DataInitialValue]
24 none 1.12(all) all all none all all all none none none none 4% all 1.00(4%) 17% Java_Enum: [Java_Annotation]* [Java_DataModifier]* "enum" Java_Variable_Definition [Java_ClassImplements] '{' [Java_Comment] [Java_EnumConstants] [','] [Java_Comment]* [Java_EnumDeclarations] [Java_Comment]* [';'] '}' [Java_Comment]* [';']
91 none all none none |   Java_EnumConstant: [Java_Annotation]* Java_Variable_Definition [Java_EnumInitializer] [Java_EnumClassBody]
    |   |   Java_EnumClassBody: '{' [Java_EnumClassBodyDeclaration]* '}'
24 all 2.79(all) none |   Java_EnumConstants: Java_EnumConstant [Java_MoreEnumConstants]* [Java_Comment]*
67 all none all |   |   Java_MoreEnumConstants: ',' [Java_Comment]* Java_EnumConstant
    |   Java_EnumDeclarations: ';' Java_EnumClassBodyDeclaration*
    |   |   Java_EnumClassBodyDeclaration: (Java_ClassElement)
    |   Java_EnumInitializer: '(' [Java_Expression]* ')'
201,274 (0% | 6% | 13% | 1% | none | 1% | 0% | 0% | 5% | 0% | 0% | 18% | 0% | none | 1% | 0% | 0% | none | 1% | 4% | 33% | 0% | none | 0% | 1% | 0% | 6% | 0% | 2% | 0% | 2% | 0% | 0% | 0% | 1% | 0% | 5% | 0%) Java_Expression: (Java_HexNumber | Java_Number | Java_Literal | Java_Character_Literal | Java_DotClass | Java_CastExpression | Java_ExpressionList | Java_InterfaceCreationWithMethod | Java_ClassCreationExpression | Java_ClassCreationWithInitializers | Java_ClassCreationWithSubscript | Java_MethodInvocation | Java_PreIncrementExpression | Java_PreDecrementExpression | Java_PostIncrementExpression | Java_PostDecrementExpression | Java_NegativeExpression | Java_LogicalNotExpression | Java_NotExpression | Java_BuiltIn | Java_VariableExpression | Java_ParenthesizedExpression | Java_CommentExpression | Java_SubscriptExpression | Java_Subfield | Java_MultiplicativeExpression | Java_AdditiveExpression | Java_ShiftExpression | Java_RelationalExpression | Java_InstanceOfExpression | Java_EqualityExpression | Java_AndExpression | Java_ExclusiveOrExpression | Java_InclusiveOrExpression | Java_ConditionalAndExpression | Java_ConditionalOrExpression | Java_AssignmentExpression | Java_TrueFalseExpression)
11,208 all all all |   Java_AdditiveExpression: Java_Expression ("+"|"-") Java_Expression
116 all all all |   Java_AndExpression: Java_Expression '&' Java_Expression
9,573 all all all |   Java_AssignmentExpression: Java_Expression ("="|"*="|"/="|"%="|"+="|"-="|"<<="|">>="|">>>="|"&="|"^="|"|=") Java_Expression
8,003 all |   Java_BuiltIn: ("false"|"true"|"null"|"this"|"super")
1,719 all all all all |   Java_CastExpression: '(' Java_Type ')' Java_Expression
9,994 all all all none 75% all 0% |   Java_ClassCreationExpression: "new" Java_Type '(' [Java_Comment]* [Java_ArgumentList] ')' [Java_ClassOverride]
4 all 1.25 all |   |   Java_ClassOverride: '{' Java_ClassElement* '}'
201 all all all all all |   Java_ClassCreationWithInitializers: "new" Java_Type '{' [Java_ArgumentList] '}'
324 all all 1.02 |   Java_ClassCreationWithSubscript: "new" Java_Type Java_Subscript*
    |   Java_CommentExpression: Java_Comment Java_Expression
1,168 all all all |   Java_ConditionalAndExpression: Java_Expression "&&" Java_Expression
571 all all all |   Java_ConditionalOrExpression: Java_Expression "||" Java_Expression
    |   Java_DotClass: Java_Type '.' "class"
3,810 all all all |   Java_EqualityExpression: Java_Expression ("=="|"!=") Java_Expression
8 all all all |   Java_ExclusiveOrExpression: Java_Expression '^' Java_Expression
111 all 1.00(1%) 96% all |   Java_ExpressionList: '{' [Java_Comment]* [Java_ArgumentList] '}'
21 all all all |   Java_InclusiveOrExpression: Java_Expression '|' Java_Expression
890 all all all |   Java_InstanceOfExpression: Java_Expression "instanceof" Java_Type
3 all all all all all all all |   Java_InterfaceCreationWithMethod: "new" ("Runnable"|"ActionListener"|"WindowAdapter") '(' ')' '{' Java_Method '}'
    |   Java_LogicalNotExpression: '~' Java_Expression
36,941 all all 71% all |   Java_MethodInvocation: Java_Variable '(' [Java_ArgumentList] ')'
704 all all all |   Java_MultiplicativeExpression: Java_Expression ("*"|"/"|"%") Java_Expression
63 all all |   Java_NegativeExpression: ("-"|"+") Java_Expression
1,096 all all |   Java_NotExpression: '!' Java_Expression
952 all all all |   Java_ParenthesizedExpression: '(' Java_Expression ')'
56 all all |   Java_PostDecrementExpression: Java_Variable "--"
1,811 all all |   Java_PostIncrementExpression: Java_Variable "++"
    |   Java_PreDecrementExpression: "--" Java_Variable
51 all all |   Java_PreIncrementExpression: "++" Java_Variable
3,203 all all all |   Java_RelationalExpression: Java_Expression ("<"|">"|"<="|">=") Java_Expression
73 all all all |   Java_ShiftExpression: Java_Expression (">>>"|"<<"|">>") Java_Expression
2,029 all all none all |   Java_Subfield: Java_Expression '.' [Java_GenericType] Java_Expression
24 all all 92% all |   Java_SubscriptExpression: Java_Expression '[' [Java_Expression] ']'
266 all all all all all |   Java_TrueFalseExpression: Java_Expression '?' Java_Expression ':' Java_Expression
66,315 all |   Java_VariableExpression: Java_Variable
    Java_Label: Java_Label_Definition ':'
8,228 none 1.26(99%) 0% all all all 66% 1.55(27%) all none 21% all all Java_Method: [Java_Comment]* [Java_MethodModifier]* [Java_GenericType] Java_Type Java_Method_Definition '(' [Java_MethodParameter] [Java_MoreParameters]* ')' [Java_MethodDefault] [Java_MethodThrows] [Java_Comment] Java_MethodBody
2,127 1.00(0%) 1.00(100%) all all 59% 2.02(36%) all 2% all all |   Java_Constructor: [Java_Annotation]* [Java_MethodModifier]* Java_Current_Class_Reference '(' [Java_MethodParameter] [Java_MoreParameters]* ')' [Java_MethodThrows] [Java_Comment] Java_MethodBody
10,355 (95% | 5%) |   Java_MethodBody: (Java_MethodImplementation | ';')
9,857 none all 1.89(7%) 0% |   |   Java_MethodImplementation: [Java_Comment]* Java_StatementBlock [Java_Comment]* [';']
    |   Java_MethodDefault: "default" [Java_Expression]
12,374 (0% | 91% | 9%) |   Java_MethodModifier: (Java_Comment | ("abstract"|"final"|"native"|"private"|"protected"|"public"|"static"|"synchronized"|"transient"|"volatile") | Java_Annotation)
11,678 1.00(0%) all all all all |   Java_MethodParameter: [Java_MethodParameterPrefix]* Java_Type ["..."] Java_Variable_Definition ["[]"]
15 (none | 7% | 93%) |   |   Java_MethodParameterPrefix: (Java_MethodNullable | Java_MethodSuppress | "final")
    |   |   |   Java_MethodNullable: '@' "Nullable"
1 all all all all all |   |   |   Java_MethodSuppress: '@' "SuppressWarnings" '(' Java_Literal ')'
1,752 all 1.01 |   Java_MethodThrows: "throws" Java_Variable*
4,980 all all |   Java_MoreParameters: ',' Java_MethodParameter
2,218 2.02(90%) none none 98% 7.30(93%) 1.00(all) Java_Program: [Java_Comment]* [Java_Annotation] [Java_Comment]* [Java_Package] [Java_ImportOrComment]* [Java_ClassOrEnum]*
2,218 (all | none) |   Java_ClassOrEnum: (Java_Class | Java_Enum)
14,758 all all all 3.57(all) all |   Java_Import: "import" ["static"] Java_Identifier [Java_DotIdentifierStar]* ';'
52,684 all all |   |   Java_DotIdentifierStar: '.' Java_IdentifierStar
52,684 (100% | 0%) |   |   |   Java_IdentifierStar: (Java_Identifier | '*')
14,996 (2% | 98%) |   Java_ImportOrComment: (Java_Comment | Java_Import)
2,180 all all 3.29(98%) all |   Java_Package: "package" Java_Identifier [Java_MorePackageIds]* ';'
7,011 all all |   |   Java_MorePackageIds: '.' Java_Identifier
90,094 (0% | 10% | 33% | 4% | 0% | 0% | 0% | 1% | 0% | 0% | 2% | 9% | 7% | 2% | 0% | 0% | 1% | 1% | 1% | 29%) Java_Statement: (Java_AnnotationDefinition | Java_StatementBlock | Java_Data | Java_Class | Java_Enum | ';' | Java_AssertStatement | Java_BreakStatement | Java_ContinueStatement | Java_DoStatement | Java_ForStatement | Java_IfStatement | Java_ReturnStatement | Java_SuperStatement | Java_SwitchStatement | Java_SynchronizedStatement | Java_ThrowStatement | Java_TryStatement | Java_WhileStatement | Java_ExpressionStatement)
15 all 1.00 all all all all 1.38(87%) 27% all |   Java_AnnotationDefinition: [Java_Annotation] Java_MethodModifier* '@' "interface" Java_Identifier '{' [Java_Comment]* [Java_AnnotationParameter] '}'
4 all all all all all |   |   Java_AnnotationParameter: Java_Type Java_Identifier '(' ')' ';'
19,282 all 2.97(99%) none all |   Java_StatementBlock: '{' [Java_StatementOrComment]* [';'] '}'
61,604 (7% | 93%) |   |   Java_StatementOrComment: (Java_Comment | Java_Statement)
2,345 all all all Java_Subscript: '[' Java_Expression ']'
68,482 all all 3% 1.02(1%) Java_Type: [Java_Comment] Java_TypeName [Java_GenericType] [Java_ArrayType]*
1,015 all all |   Java_ArrayType: '[' ']'
509 all all |   Java_ExtendsType: ("extends"|"super") Java_Identifier_Reference
2,157 all 100% all 3.14(23%) all |   Java_GenericType: '<' [Java_Type] ["[]"] [Java_MoreTypes]* '>'
1,574 all all |   |   Java_MoreTypes: ',' Java_Type
69,422 (0% | 79% | 21%) |   Java_TypeName: (Java_GenericTypeQuestion | Java_IdList | ("void"|"boolean"|"byte"|"short"|"int"|"long"|"char"|"float"|"double"|"String"|"class"))
263 all 58% |   |   Java_GenericTypeQuestion: '?' [Java_ExtendsType]
54,527 all 1% 1.00(2%) none |   |   Java_IdList: Java_Identifier_Reference [Java_ExtendsType] [Java_MoreIds]* [Java_ExtendsMultiple]
    |   |   |   Java_ExtendsMultiple: '&' Java_Identifier_Reference [Java_ExtendsType] [Java_MoreIds]*
940 all all |   |   |   Java_MoreIds: '.' Java_TypeName
108,349 all 1.09(38%) 1.04(2%) Java_Variable: Java_VariableIdentifier [Java_DotVariable]* [Java_Subscript]*
45,195 all all |   Java_DotVariable: '.' Java_VariableIdentifier
153,544 (0% | 1% | 99%) |   Java_VariableIdentifier: (Java_CastedVariable | ("this"|"class"|"super") | Java_Identifier_Reference)
314 all all all all all all |   |   Java_CastedVariable: '(' '(' Java_Type ')' Java_Identifier_Reference ')'
1 all all all all Java_AssertStatement: "assert" Java_Expression [Java_AssertMessage] ';'
1 all all |   Java_AssertMessage: ':' Java_Expression
639 all none all Java_BreakStatement: "break" [Java_Identifier_Reference] ';'
426 all none all Java_ContinueStatement: "continue" [Java_Identifier_Reference] ';'
16 none all all all all all all all all Java_DoStatement: [Java_Label] "do" [Java_Comment] Java_Statement "while" '(' Java_Expression ')' ';'
26,370 all all Java_ExpressionStatement: Java_Expression ';'
1,415 (35% | 65%) Java_ForStatement: (Java_ForCollectionStatement | Java_ForLoopStatement)
502 none all all all all all all all all all all |   Java_ForCollectionStatement: [Java_Label] "for" '(' ["final"] Java_Type Java_Variable ':' Java_Expression ')' [Java_Comment] Java_Statement
913 none all all all all all all all all all all |   Java_ForLoopStatement: [Java_Label] "for" '(' [Java_ForInit] ';' [Java_Expression] ';' [Java_Expression] ')' [Java_Comment] Java_Statement
913 all 1.00 |   |   Java_ForInit: ["final"] Java_ForWhat*
913 (96% | 4%) |   |   |   Java_ForWhat: (Java_ForWithType | Java_Expression)
877 all all |   |   |   |   Java_ForWithType: Java_Type Java_Expression
8,306 all all all none all 1.00(1%) all 22% Java_IfStatement: "if" '(' Java_Expression [Java_Comment]* ')' [Java_Comment]* Java_Statement [Java_IfElseClause]
1,800 1.21(1%) all all all |   Java_IfElseClause: [Java_Comment]* "else" [Java_Comment] Java_Statement
6,609 all 94% all Java_ReturnStatement: "return" [Java_Expression] ';'
1,488 all all 94% all all Java_SuperStatement: "super" '(' [Java_ArgumentList] ')' ';'
225 all all all all all 4.28 all Java_SwitchStatement: "switch" '(' Java_Expression ')' '{' Java_SwitchClause* '}'
964 (83% | 17% | none) |   Java_SwitchClause: (Java_CaseClause | Java_DefaultClause | Java_Comment)
803 all all all 1.62(92%) |   |   Java_CaseClause: "case" Java_Expression ':' [Java_StatementOrComment]*
161 all all 1.11(98%) |   |   Java_DefaultClause: "default" ':' [Java_StatementOrComment]*
5 all all all all all Java_SynchronizedStatement: "synchronized" '(' Java_Expression ')' Java_Statement
1,038 all all all Java_ThrowStatement: "throw" Java_Expression ';'
606 all none all 5.56 all none 1.01(100%) 1% Java_TryStatement: "try" [Java_TryResources] '{' Java_StatementOrComment* '}' [Java_Comment]* [Java_CatchBlock]* [Java_FinallyBlock]
610 all all all all none all all all |   Java_CatchBlock: "catch" '(' ["final"] Java_Type [Java_MoreExceptions]* Java_Identifier ')' Java_Statement
    |   |   Java_MoreExceptions: '|' Java_Type
4 all all |   Java_FinallyBlock: "finally" Java_Statement
    |   Java_TryResources: '(' Java_TryResource* ')'
    |   |   Java_TryResource: Java_Type Java_Variable_Definition Java_DataInitialValue
643 all all all all all all Java_WhileStatement: "while" '(' Java_Expression ')' [Java_Comment] Java_Statement

Terminals = 12 (instances=487,545)
Tokens = 133 (instances=1,529,203)

(*) Statistics are shown in the same order as the Tokens.
Percentages are rounded; 'all' and 'none' mean 100% and 0% before rounding.
For lists, it shows the average number of occurrences, excluding empty lists.