Eagle Legacy Modernization, LLC

CSharp Grammar

Main program: CSharp_Program

 Count  Terminals:
294 CSharp_Character_Literal: A string enclosed in quotes
1,214 CSharp_Class_Definition: An identifier
32,020 CSharp_Comment: Comment
  CSharp_CommentToEndOfLine: Comment
822 CSharp_Current_Class_Reference: An identifier
6 CSharp_HexNumber: A hex number
8,303 CSharp_Identifier: An identifier
126,568 CSharp_Identifier_Reference: An identifier
14,980 CSharp_Literal: A string enclosed in quotes
4,196 CSharp_Method_Definition: An identifier
5,064 CSharp_Number: A number
21,393 CSharp_Variable_Definition: An identifier
 Count  Statistics(*) Tokens:
217 all all none all CSharp_Annotation: '[' CSharp_AnnotationItem [CSharp_MoreAnnotations]* ']'
217 6% 39% 1.28 97% |   CSharp_AnnotationItem: [CSharp_AnnotionGlobal] [CSharp_AnnotionAssembly] CSharp_Identifier* [CSharp_AnnotationParams]
210 all 90% all |   CSharp_AnnotationParams: '(' [CSharp_ArgumentList] ')'
84 all all |   CSharp_AnnotionAssembly: ("assembly"|"return") ':'
12 all all |   CSharp_AnnotionGlobal: "global" "::"
    |   CSharp_MoreAnnotations: ',' CSharp_AnnotationItem
19,484 all all 1.86(44%) CSharp_ArgumentList: [("ref"|"out")] CSharp_Expression [CSharp_MoreArguments]*
15,800 all all all 1.00(0%) |   CSharp_MoreArguments: ',' [("ref"|"out")] CSharp_Expression [CSharp_Comment]*
1,214 1.65(16%) 1.17(99%) all all 0% 62% none all 9.11(99%) all none CSharp_Class: [CSharp_AnnotationOrComment]* [CSharp_ClassModifier]* ("class"|"interface"|"struct") CSharp_Class_Definition [CSharp_GenericType] [CSharp_ExtendsOrImplements] [CSharp_Comment]* '{' [CSharp_ClassElement]* '}' [';']
319 (15% | 85%) |   CSharp_AnnotationOrComment: (CSharp_Annotation | CSharp_Comment)
10,965 (49% | 2% | 5% | 7% | 38% | none | 0% | none) |   CSharp_ClassElement: (CSharp_StaticStatement | CSharp_Comment | CSharp_Property | CSharp_Constructor | CSharp_Method | CSharp_Statement | CSharp_SubscriptOperator | CSharp_RegionDirective)
5,319 all all |   |   CSharp_StaticStatement: ["static"] CSharp_Statement
1,402 all |   CSharp_ClassModifier: ("abstract"|"const"|"delegate"|"event"|"extern"|"final"|"internal"|"lock"|"override"|"partial"|"private"|"protected"|"public"|"readonly"|"sealed"|"static"|"virtual")
758 all none 1.75 1% 1.29(11%) |   CSharp_ExtendsOrImplements: ':' [CSharp_NamespaceQualifer] CSharp_Identifier_Reference* [CSharp_GenericType] [CSharp_MoreImplements]*
106 all 2.51 none |   |   CSharp_MoreImplements: ',' CSharp_Identifier_Reference* [CSharp_GenericType]
    |   |   CSharp_NamespaceQualifer: CSharp_Identifier_Reference "::"
822 none 1.00(0%) 1.00(all) all all 91% 2.26(53%) all 71% all CSharp_Constructor: [CSharp_Comment]* [CSharp_Annotation]* [CSharp_MethodModifiers]* CSharp_Current_Class_Reference '(' [CSharp_MethodParameter] [CSharp_MoreParameters]* ')' [CSharp_ExtendsBase] CSharp_MethodBody
581 all all all 99% all |   CSharp_ExtendsBase: ':' ("base"|"this") '(' [CSharp_ArgumentList] ')'
12,585 all all 1.49(4%) CSharp_Data: CSharp_DataBeforeSemicolon ';' [CSharp_Comment]*
12,635 none 1.29(37%) none all all none none 81% 1.54(1%) |   CSharp_DataBeforeSemicolon: [CSharp_Annotation]* [CSharp_DataModifier]* [CSharp_Annotation]* CSharp_Type CSharp_Variable_Definition ['['] [']'] [CSharp_DataInitialValue] [CSharp_MoreIdentifiers]*
10,224 all all |   CSharp_DataInitialValue: '=' CSharp_Expression
6,117 all |   CSharp_DataModifier: ("abstract"|"const"|"delegate"|"event"|"extern"|"final"|"internal"|"lock"|"override"|"partial"|"private"|"protected"|"public"|"readonly"|"sealed"|"static"|"virtual")
100 all all none none 9% |   CSharp_MoreIdentifiers: ',' CSharp_Variable_Definition ['['] [']'] [CSharp_DataInitialValue]
28 none 1.00(all) all all none all 1.00(7%) all 7% 6.57(all) none all 93% CSharp_Enum: [CSharp_Annotation]* [CSharp_DataModifier]* "enum" CSharp_Variable_Definition [CSharp_Enum_Basetype] '{' [CSharp_Comment]* CSharp_Variable_Definition [CSharp_EnumInitializer] [CSharp_MoreEnums]* [','] '}' [';']
6 all all |   CSharp_EnumInitializer: '=' CSharp_Expression
    |   CSharp_Enum_Basetype: ':' CSharp_Type
184 all all 2% |   CSharp_MoreEnums: ',' CSharp_Variable_Definition [CSharp_EnumInitializer]
125,256 (0% | 4% | 12% | 0% | none | 1% | 0% | none | 4% | 0% | 0% | 16% | 0% | 0% | 1% | 0% | 0% | none | 1% | 4% | 39% | 0% | 1% | 1% | 0% | none | 0% | 0% | 1% | 0% | 4% | none | 1% | 0% | 2% | none | 0% | 0% | 1% | 0% | 0% | 7% | none) CSharp_Expression: (CSharp_HexNumber | CSharp_Number | CSharp_Literal | CSharp_Character_Literal | CSharp_DotClass | CSharp_CastExpression | CSharp_ExpressionList | CSharp_InterfaceCreationWithMethod | CSharp_ClassCreationExpression | CSharp_ClassCreationWithInitializers | CSharp_ClassCreationWithSubscript | CSharp_MethodInvocation | CSharp_PreIncrementExpression | CSharp_PreDecrementExpression | CSharp_PostIncrementExpression | CSharp_PostDecrementExpression | CSharp_NegativeExpression | CSharp_LogicalNotExpression | CSharp_NotExpression | CSharp_BuiltIn | CSharp_VariableExpression | CSharp_TypeExpression | CSharp_ParenthesizedExpression | CSharp_CommentExpression | CSharp_TypeOf | CSharp_Delegation | CSharp_SubscriptExpression | CSharp_NamespaceExpression | CSharp_SubfieldExpression | CSharp_MultiplicativeExpression | CSharp_AdditiveExpression | CSharp_ShiftExpression | CSharp_RelationalExpression | CSharp_InstanceOfExpression | CSharp_EqualityExpression | CSharp_AndExpression | CSharp_ExclusiveOrExpression | CSharp_InclusiveOrExpression | CSharp_ConditionalAndExpression | CSharp_ConditionalOrExpression | CSharp_TrueFalseExpression | CSharp_AssignmentExpression | CSharp_LambdaExpression)
4,395 all all all |   CSharp_AdditiveExpression: CSharp_Expression ("+"|"-") CSharp_Expression
    |   CSharp_AndExpression: CSharp_Expression '&' CSharp_Expression
9,198 all all all |   CSharp_AssignmentExpression: CSharp_Expression ("="|"*="|"/="|"%="|"+="|"-="|"<<="|">>="|">>>="|"&="|"^="|"|=") CSharp_Expression
4,894 all |   CSharp_BuiltIn: ("false"|"true"|"null"|"this"|"super")
1,277 all all all all |   CSharp_CastExpression: '(' CSharp_Type ')' CSharp_Expression
4,963 all all all none 60% all |   CSharp_ClassCreationExpression: "new" CSharp_Type '(' [CSharp_Comment]* [CSharp_ArgumentList] ')'
44 all all all 98% all |   CSharp_ClassCreationWithInitializers: "new" CSharp_Type '{' [CSharp_ArgumentList] '}'
285 all all 1.00 |   CSharp_ClassCreationWithSubscript: "new" CSharp_Type CSharp_Subscript*
961 all all |   CSharp_CommentExpression: CSharp_Comment CSharp_Expression
770 all all all |   CSharp_ConditionalAndExpression: CSharp_Expression "&&" CSharp_Expression
240 all all all |   CSharp_ConditionalOrExpression: CSharp_Expression "||" CSharp_Expression
    |   CSharp_Delegation: "delegate" CSharp_MethodParameters CSharp_MethodBody
    |   CSharp_DotClass: CSharp_Type '.' "class"
2,647 all all all |   CSharp_EqualityExpression: CSharp_Expression CSharp_EqualityOperator CSharp_Expression
2,647 (100% | 0%) |   |   CSharp_EqualityOperator: (("=="|"!="|"??") | ("as"|"is"))
4 all all all |   CSharp_ExclusiveOrExpression: CSharp_Expression '^' CSharp_Expression
21 all none all all |   CSharp_ExpressionList: '{' [CSharp_Comment]* CSharp_ArgumentList '}'
14 all all all |   CSharp_InclusiveOrExpression: CSharp_Expression '|' CSharp_Expression
324 all all all |   CSharp_InstanceOfExpression: CSharp_Expression "is" CSharp_Type
    |   CSharp_InterfaceCreationWithMethod: "new" ("Runnable"|"ActionListener"|"WindowAdapter") '(' ')' '{' CSharp_Method '}'
    |   CSharp_LambdaExpression: CSharp_Expression "=>" CSharp_Expression
    |   CSharp_LogicalNotExpression: '~' CSharp_Expression
19,742 all all 79% all |   CSharp_MethodInvocation: CSharp_Variable '(' [CSharp_ArgumentList] ')'
362 all all all |   CSharp_MultiplicativeExpression: CSharp_Expression ("*"|"/"|"%") CSharp_Expression
4 all all all |   CSharp_NamespaceExpression: CSharp_Expression "::" CSharp_Expression
70 all all |   CSharp_NegativeExpression: ("-"|"+") CSharp_Expression
673 all all |   CSharp_NotExpression: '!' CSharp_Expression
801 all all all |   CSharp_ParenthesizedExpression: '(' CSharp_Expression ')'
24 all all |   CSharp_PostDecrementExpression: CSharp_Variable "--"
820 all all |   CSharp_PostIncrementExpression: CSharp_Variable "++"
2 all all |   CSharp_PreDecrementExpression: "--" CSharp_Variable
87 all all |   CSharp_PreIncrementExpression: "++" CSharp_Variable
1,508 all all all |   CSharp_RelationalExpression: CSharp_Expression ("<"|">"|"<="|">=") CSharp_Expression
    |   CSharp_ShiftExpression: CSharp_Expression ("<<"|">>"|">>>") CSharp_Expression
1,608 all all all |   CSharp_SubfieldExpression: CSharp_Expression '.' CSharp_Expression
58 all all all all |   CSharp_SubscriptExpression: CSharp_Expression '[' CSharp_Expression ']'
204 all all all all all |   CSharp_TrueFalseExpression: CSharp_Expression '?' CSharp_Expression ':' CSharp_Expression
95 all |   CSharp_TypeExpression: CSharp_Type
239 all all all all |   CSharp_TypeOf: "typeof" '(' CSharp_Type ')'
48,578 all |   CSharp_VariableExpression: CSharp_Variable
4,196 1.61(1%) 1.00(0%) 1.53(98%) 1.00(0%) all all all all all all none CSharp_Method: [CSharp_Comment]* [CSharp_Annotation]* [CSharp_MethodModifiers]* [CSharp_Comment]* CSharp_Type ["global"] ["::"] CSharp_Method_Definition CSharp_MethodParameters CSharp_MethodBody [';']
5,018 (94% | 6%) |   CSharp_MethodBody: (CSharp_MethodImplementation | ';')
4,712 none all 3.12(10%) none |   |   CSharp_MethodImplementation: [CSharp_Comment]* CSharp_StatementBlock [CSharp_Comment]* [';']
7,118 all |   CSharp_MethodModifiers: ("abstract"|"const"|"delegate"|"event"|"extern"|"final"|"internal"|"lock"|"override"|"partial"|"private"|"protected"|"public"|"readonly"|"sealed"|"static"|"virtual")
7,911 none all all all all |   CSharp_MethodParameter: [CSharp_Annotation] [("ref"|"out"|"this")] CSharp_Type CSharp_Variable_Definition ["[]"]
4,196 all 78% 1.55(45%) all all |   CSharp_MethodParameters: '(' [CSharp_MethodParameter] [CSharp_MoreParameters]* ')' [CSharp_Comment]
3,873 all all |   CSharp_MoreParameters: ',' CSharp_MethodParameter
613 2.05(59%) 6.96 CSharp_Program: [CSharp_Comment]* CSharp_NamespaceOrClassEntry*
578 all 1.89 all 1.74 all |   CSharp_Namespace: "namespace" CSharp_Identifier* '{' CSharp_ProgramElems* '}'
4,269 (80% | 4% | 13% | 1% | 2%) |   CSharp_NamespaceOrClassEntry: (CSharp_Using | CSharp_Comment | CSharp_Namespace | CSharp_Class | CSharp_Annotation)
1,005 (2% | 0% | 32% | 61% | 0% | 5%) |   CSharp_ProgramElems: (CSharp_Namespace | CSharp_Using | CSharp_Comment | CSharp_Class | CSharp_Enum | CSharp_Method)
3,415 all 2.93 2% all |   CSharp_Using: "using" CSharp_Identifier* [CSharp_UsingEquals] ';'
58 all 8.66 |   |   CSharp_UsingEquals: '=' CSharp_Identifier*
507 3.08(5%) 1.07(all) all all 0% all 1.84(all) all CSharp_Property: [CSharp_Annotation]* [CSharp_PropertyModifier]* CSharp_Type CSharp_Variable_Definition [CSharp_PropertySubscript] '{' [CSharp_GetterSetter]* '}'
933 (51% | none | 49% | none) |   CSharp_GetterSetter: (CSharp_GetterBody | CSharp_GetterNoBody | CSharp_SetterBody | CSharp_SetterNoBody)
472 all all |   |   CSharp_GetterBody: "get" CSharp_Statement
    |   |   CSharp_GetterNoBody: "get" ';'
461 all all |   |   CSharp_SetterBody: "set" CSharp_Statement
    |   |   CSharp_SetterNoBody: ["private"] "set" ';'
543 all |   CSharp_PropertyModifier: ("abstract"|"const"|"delegate"|"event"|"extern"|"final"|"internal"|"lock"|"override"|"partial"|"private"|"protected"|"public"|"readonly"|"sealed"|"static"|"virtual")
2 all all none all |   CSharp_PropertySubscript: '[' [CSharp_MethodParameter] [CSharp_MoreParameters]* ']'
51,229 (14% | 0% | 25% | 1% | 0% | 1% | 0% | 0% | 0% | 1% | 1% | 0% | 9% | 0% | 6% | none | none | 0% | none | 1% | 1% | 0% | 1% | 39%) CSharp_Statement: (CSharp_StatementBlock | ';' | CSharp_Data | CSharp_Class | CSharp_Enum | CSharp_BreakStatement | CSharp_ContinueStatement | CSharp_CheckedStatement | CSharp_DoStatement | CSharp_ForStatement | CSharp_ForEachStatement | CSharp_GetProperty | CSharp_IfStatement | CSharp_LockStatement | CSharp_ReturnStatement | CSharp_SetProperty | CSharp_SuperStatement | CSharp_SwitchStatement | CSharp_SynchronizedStatement | CSharp_ThrowStatement | CSharp_TryStatement | CSharp_UsingStatement | CSharp_WhileStatement | CSharp_ExpressionStatement)
11,903 all 3.13(96%) all |   CSharp_StatementBlock: '{' [CSharp_StatementOrComment]* '}'
39,236 (95% | 5%) |   |   CSharp_StatementOrComment: (CSharp_Statement | CSharp_Comment)
2,527 all all 1.00(1%) all CSharp_Subscript: '[' CSharp_Expression [CSharp_MoreSubscripts]* ']'
30 all all |   CSharp_MoreSubscripts: ',' CSharp_Expression
4 none none 1.00(all) all all all all all all CSharp_SubscriptOperator: [CSharp_Comment]* [CSharp_Annotation]* [CSharp_MethodModifiers]* CSharp_Type "this" '[' CSharp_MethodParameter ']' CSharp_MethodImplementation
    CSharp_SuperStatement: "super" '(' [CSharp_ArgumentList] ')' ';'
34,313 all 1% 1.00(2%) CSharp_Type: CSharp_TypeName [CSharp_GenericType] [CSharp_ArrayType]*
612 all 1% all |   CSharp_ArrayType: '[' [','] ']'
    |   CSharp_ExtendsType: "extends" CSharp_Identifier_Reference
388 all 1.14 all |   CSharp_GenericType: '<' CSharp_Type* '>'
35,345 (none | 58% | 42%) |   CSharp_TypeName: (CSharp_GenericTypeQuestion | CSharp_IdList | ("void"|"bool"|"boolean"|"byte"|"short"|"int"|"long"|"char"|"float"|"double"|"string"|"String"|"class"))
    |   |   CSharp_GenericTypeQuestion: '?' [CSharp_ExtendsType]
20,573 0% all none 1.00(5%) |   |   CSharp_IdList: [CSharp_NamespaceId] CSharp_Identifier_Reference [CSharp_ExtendsType] [CSharp_MoreIds]*
1,032 all all |   |   |   CSharp_MoreIds: '.' CSharp_TypeName
12 all all |   |   |   CSharp_NamespaceId: CSharp_Identifier_Reference "::"
70,139 all 1.18(42%) 1.01(3%) CSharp_Variable: CSharp_VariableIdentifier [CSharp_MoreVariableIdentifiers]* [CSharp_Subscript]*
34,741 all all |   CSharp_MoreVariableIdentifiers: '.' CSharp_VariableIdentifier
104,880 (0% | 0% | 100%) |   CSharp_VariableIdentifier: (CSharp_CastedVariable | ("this"|"base"|"class") | CSharp_Identifier_Reference)
221 all all all all all all |   |   CSharp_CastedVariable: '(' '(' CSharp_Type ')' CSharp_Identifier_Reference ')'
    CSharp_RegionDirective: '#' "region" CSharp_CommentToEndOfLine CSharp_ClassElement* '#' "endregion"
534 all all all CSharp_BreakStatement: ["yield"] "break" ';'
16 all all CSharp_CheckedStatement: "checked" CSharp_Statement
52 all all CSharp_ContinueStatement: "continue" ';'
5 all all all all all all all CSharp_DoStatement: "do" CSharp_Statement "while" '(' CSharp_Expression ')' ';'
20,118 all all all CSharp_ExpressionStatement: CSharp_Expression ';' [CSharp_Comment]
535 all all all all all all all all all CSharp_ForEachStatement: "foreach" '(' CSharp_Type CSharp_Variable "in" CSharp_Expression ')' [CSharp_Comment] CSharp_Statement
351 all all all all all all all all all all all CSharp_ForStatement: "for" '(' CSharp_ForLoopVariable '=' CSharp_Expression ';' CSharp_Expression ';' CSharp_Expression ')' CSharp_Statement
351 (75% | 25%) |   CSharp_ForLoopVariable: (CSharp_ForLoopVariableWithType | CSharp_Variable)
262 all all |   |   CSharp_ForLoopVariableWithType: CSharp_Type CSharp_Variable
4 all all CSharp_GetProperty: "get" CSharp_StatementBlock
4,665 all all all all 1.00(1%) all 24% CSharp_IfStatement: "if" '(' CSharp_Expression ')' [CSharp_Comment]* CSharp_Statement [CSharp_IfElseClause]
1,137 1.00(1%) all 1.00(3%) all |   CSharp_IfElseClause: [CSharp_Comment]* "else" [CSharp_Comment]* CSharp_Statement
9 all all all all all CSharp_LockStatement: "lock" '(' CSharp_Expression ')' CSharp_Statement
3,112 all all 95% all CSharp_ReturnStatement: ["yield"] "return" [CSharp_Expression] ';'
    CSharp_SetProperty: "set" CSharp_StatementBlock
88 all all all all all 6.20 all CSharp_SwitchStatement: "switch" '(' CSharp_Expression ')' '{' CSharp_SwitchCase* '}'
546 (94% | 6%) |   CSharp_CaseType: (CSharp_CaseClause | "default")
512 all all |   |   CSharp_CaseClause: "case" CSharp_Expression
546 all all 2.05(87%) |   CSharp_SwitchCase: CSharp_CaseType ':' [CSharp_StatementOrComment]*
    CSharp_SynchronizedStatement: "synchronized" '(' CSharp_Expression ')' CSharp_Statement
576 all 99% all CSharp_ThrowStatement: "throw" [CSharp_Expression] ';'
408 all all 6.06 all 1.00(1%) 1.04(96%) 13% CSharp_TryStatement: "try" '{' CSharp_StatementOrComment* '}' [CSharp_Comment]* [CSharp_CatchBlock]* [CSharp_FinallyBlock]
405 all 99% all |   CSharp_CatchBlock: "catch" [CSharp_CatchWhat] CSharp_Statement
399 all all 58% all |   |   CSharp_CatchWhat: '(' CSharp_Type [CSharp_Identifier] ')'
53 all all |   CSharp_FinallyBlock: "finally" CSharp_Statement
50 all all all all all CSharp_UsingStatement: "using" '(' CSharp_DataBeforeSemicolon ')' CSharp_Statement
349 all all all all all all CSharp_WhileStatement: "while" '(' CSharp_Expression ')' [CSharp_Comment] CSharp_Statement

Terminals = 12 (instances=214,860)
Tokens = 137 (instances=824,352)

(*) 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.