Eagle Legacy Modernization, LLC

CSharp Grammar

Main program: CSharp_Program

 Count  Terminals:
187 CSharp_Character_Literal: A string enclosed in quotes
724 CSharp_Class_Definition: An identifier
20,527 CSharp_Comment: Comment
  CSharp_CommentToEndOfLine: Comment
441 CSharp_Current_Class_Reference: An identifier
4 CSharp_HexNumber: A hex number
5,890 CSharp_Identifier: An identifier
80,464 CSharp_Identifier_Reference: An identifier
10,414 CSharp_Literal: A string enclosed in quotes
2,511 CSharp_Method_Definition: An identifier
3,229 CSharp_Number: A number
13,271 CSharp_Variable_Definition: An identifier
 Count  Statistics(*) Tokens:
216 all all none all CSharp_Annotation: '[' CSharp_AnnotationItem [CSharp_MoreAnnotations]* ']'
216 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
12,436 all all 1.88(43%) CSharp_ArgumentList: [("ref"|"out")] CSharp_Expression [CSharp_MoreArguments]*
10,007 all all all 1.00(0%) |   CSharp_MoreArguments: ',' [("ref"|"out")] CSharp_Expression [CSharp_Comment]*
724 1.62(16%) 1.19(98%) all all 0% 60% none all 9.35(99%) all none CSharp_Class: [CSharp_AnnotationOrComment]* [CSharp_ClassModifier]* ("class"|"interface"|"struct") CSharp_Class_Definition [CSharp_GenericType] [CSharp_ExtendsOrImplements] [CSharp_Comment]* '{' [CSharp_ClassElement]* '}' [';']
183 (26% | 74%) |   CSharp_AnnotationOrComment: (CSharp_Annotation | CSharp_Comment)
6,676 (47% | 2% | 7% | 7% | 37% | none | 0% | none) |   CSharp_ClassElement: (CSharp_StaticStatement | CSharp_Comment | CSharp_Property | CSharp_Constructor | CSharp_Method | CSharp_Statement | CSharp_SubscriptOperator | CSharp_RegionDirective)
3,130 all all |   |   CSharp_StaticStatement: ["static"] CSharp_Statement
847 all |   CSharp_ClassModifier: ("abstract"|"const"|"delegate"|"event"|"extern"|"final"|"internal"|"lock"|"override"|"partial"|"private"|"protected"|"public"|"readonly"|"sealed"|"static"|"virtual")
438 all none 1.88 1% 1.24(11%) |   CSharp_ExtendsOrImplements: ':' [CSharp_NamespaceQualifer] CSharp_Identifier_Reference* [CSharp_GenericType] [CSharp_MoreImplements]*
62 all 2.29 none |   |   CSharp_MoreImplements: ',' CSharp_Identifier_Reference* [CSharp_GenericType]
    |   |   CSharp_NamespaceQualifer: CSharp_Identifier_Reference "::"
441 none 1.00(0%) 1.00(all) all all 87% 2.25(50%) all 67% all CSharp_Constructor: [CSharp_Comment]* [CSharp_Annotation]* [CSharp_MethodModifiers]* CSharp_Current_Class_Reference '(' [CSharp_MethodParameter] [CSharp_MoreParameters]* ')' [CSharp_ExtendsBase] CSharp_MethodBody
295 all all all 99% all |   CSharp_ExtendsBase: ':' ("base"|"this") '(' [CSharp_ArgumentList] ')'
7,756 all all 1.49(5%) CSharp_Data: CSharp_DataBeforeSemicolon ';' [CSharp_Comment]*
7,805 none 1.28(36%) none all all none none 79% 1.56(1%) |   CSharp_DataBeforeSemicolon: [CSharp_Annotation]* [CSharp_DataModifier]* [CSharp_Annotation]* CSharp_Type CSharp_Variable_Definition ['['] [']'] [CSharp_DataInitialValue] [CSharp_MoreIdentifiers]*
6,201 all all |   CSharp_DataInitialValue: '=' CSharp_Expression
3,582 all |   CSharp_DataModifier: ("abstract"|"const"|"delegate"|"event"|"extern"|"final"|"internal"|"lock"|"override"|"partial"|"private"|"protected"|"public"|"readonly"|"sealed"|"static"|"virtual")
97 all all none none 9% |   CSharp_MoreIdentifiers: ',' CSharp_Variable_Definition ['['] [']'] [CSharp_DataInitialValue]
17 none 1.00(all) all all none all 1.00(6%) all 6% 6.47(all) none all 88% CSharp_Enum: [CSharp_Annotation]* [CSharp_DataModifier]* "enum" CSharp_Variable_Definition [CSharp_Enum_Basetype] '{' [CSharp_Comment]* CSharp_Variable_Definition [CSharp_EnumInitializer] [CSharp_MoreEnums]* [','] '}' [';']
3 all all |   CSharp_EnumInitializer: '=' CSharp_Expression
    |   CSharp_Enum_Basetype: ':' CSharp_Type
110 all all 2% |   CSharp_MoreEnums: ',' CSharp_Variable_Definition [CSharp_EnumInitializer]
82,419 (0% | 4% | 13% | 0% | none | 1% | 0% | none | 4% | 0% | 0% | 15% | 0% | 0% | 1% | 0% | 0% | none | 1% | 4% | 38% | 0% | 1% | 1% | 0% | none | 0% | 0% | 1% | 0% | 4% | none | 1% | 0% | 2% | none | 0% | 0% | 1% | 0% | 0% | 8% | 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)
3,165 all all all |   CSharp_AdditiveExpression: CSharp_Expression ("+"|"-") CSharp_Expression
    |   CSharp_AndExpression: CSharp_Expression '&' CSharp_Expression
6,242 all all all |   CSharp_AssignmentExpression: CSharp_Expression ("="|"*="|"/="|"%="|"+="|"-="|"<<="|">>="|">>>="|"&="|"^="|"|=") CSharp_Expression
3,246 all |   CSharp_BuiltIn: ("false"|"true"|"null"|"this"|"super")
807 all all all all |   CSharp_CastExpression: '(' CSharp_Type ')' CSharp_Expression
3,098 all all all none 61% all |   CSharp_ClassCreationExpression: "new" CSharp_Type '(' [CSharp_Comment]* [CSharp_ArgumentList] ')'
30 all all all 97% all |   CSharp_ClassCreationWithInitializers: "new" CSharp_Type '{' [CSharp_ArgumentList] '}'
153 all all 1.00 |   CSharp_ClassCreationWithSubscript: "new" CSharp_Type CSharp_Subscript*
559 all all |   CSharp_CommentExpression: CSharp_Comment CSharp_Expression
503 all all all |   CSharp_ConditionalAndExpression: CSharp_Expression "&&" CSharp_Expression
165 all all all |   CSharp_ConditionalOrExpression: CSharp_Expression "||" CSharp_Expression
    |   CSharp_Delegation: "delegate" CSharp_MethodParameters CSharp_MethodBody
    |   CSharp_DotClass: CSharp_Type '.' "class"
1,847 all all all |   CSharp_EqualityExpression: CSharp_Expression CSharp_EqualityOperator CSharp_Expression
1,847 (100% | 0%) |   |   CSharp_EqualityOperator: (("=="|"!="|"??") | ("as"|"is"))
2 all all all |   CSharp_ExclusiveOrExpression: CSharp_Expression '^' CSharp_Expression
11 all none all all |   CSharp_ExpressionList: '{' [CSharp_Comment]* CSharp_ArgumentList '}'
7 all all all |   CSharp_InclusiveOrExpression: CSharp_Expression '|' CSharp_Expression
175 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
12,759 all all 79% all |   CSharp_MethodInvocation: CSharp_Variable '(' [CSharp_ArgumentList] ')'
218 all all all |   CSharp_MultiplicativeExpression: CSharp_Expression ("*"|"/"|"%") CSharp_Expression
4 all all all |   CSharp_NamespaceExpression: CSharp_Expression "::" CSharp_Expression
36 all all |   CSharp_NegativeExpression: ("-"|"+") CSharp_Expression
461 all all |   CSharp_NotExpression: '!' CSharp_Expression
555 all all all |   CSharp_ParenthesizedExpression: '(' CSharp_Expression ')'
14 all all |   CSharp_PostDecrementExpression: CSharp_Variable "--"
496 all all |   CSharp_PostIncrementExpression: CSharp_Variable "++"
2 all all |   CSharp_PreDecrementExpression: "--" CSharp_Variable
59 all all |   CSharp_PreIncrementExpression: "++" CSharp_Variable
980 all all all |   CSharp_RelationalExpression: CSharp_Expression ("<"|">"|"<="|">=") CSharp_Expression
    |   CSharp_ShiftExpression: CSharp_Expression ("<<"|">>"|">>>") CSharp_Expression
1,213 all all all |   CSharp_SubfieldExpression: CSharp_Expression '.' CSharp_Expression
43 all all all all |   CSharp_SubscriptExpression: CSharp_Expression '[' CSharp_Expression ']'
134 all all all all all |   CSharp_TrueFalseExpression: CSharp_Expression '?' CSharp_Expression ':' CSharp_Expression
90 all |   CSharp_TypeExpression: CSharp_Type
138 all all all all |   CSharp_TypeOf: "typeof" '(' CSharp_Type ')'
31,373 all |   CSharp_VariableExpression: CSharp_Variable
2,511 1.52(1%) 1.00(0%) 1.52(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 [';']
2,952 (94% | 6%) |   CSharp_MethodBody: (CSharp_MethodImplementation | ';')
2,781 none all 3.00(10%) none |   |   CSharp_MethodImplementation: [CSharp_Comment]* CSharp_StatementBlock [CSharp_Comment]* [';']
4,180 all |   CSharp_MethodModifiers: ("abstract"|"const"|"delegate"|"event"|"extern"|"final"|"internal"|"lock"|"override"|"partial"|"private"|"protected"|"public"|"readonly"|"sealed"|"static"|"virtual")
4,730 none all all all all |   CSharp_MethodParameter: [CSharp_Annotation] [("ref"|"out"|"this")] CSharp_Type CSharp_Variable_Definition ["[]"]
2,511 all 79% 1.61(46%) all all |   CSharp_MethodParameters: '(' [CSharp_MethodParameter] [CSharp_MoreParameters]* ')' [CSharp_Comment]
2,358 all all |   CSharp_MoreParameters: ',' CSharp_MethodParameter
400 2.09(46%) 7.46 CSharp_Program: [CSharp_Comment]* CSharp_NamespaceOrClassEntry*
367 all 1.71 all 1.82 all |   CSharp_Namespace: "namespace" CSharp_Identifier* '{' CSharp_ProgramElems* '}'
2,982 (79% | 5% | 12% | 1% | 3%) |   CSharp_NamespaceOrClassEntry: (CSharp_Using | CSharp_Comment | CSharp_Namespace | CSharp_Class | CSharp_Annotation)
667 (2% | 0% | 36% | 57% | 1% | 4%) |   CSharp_ProgramElems: (CSharp_Namespace | CSharp_Using | CSharp_Comment | CSharp_Class | CSharp_Enum | CSharp_Method)
2,348 all 3.14 1% all |   CSharp_Using: "using" CSharp_Identifier* [CSharp_UsingEquals] ';'
29 all 8.66 |   |   CSharp_UsingEquals: '=' CSharp_Identifier*
495 3.08(5%) 1.07(all) all all none all 1.85(all) all CSharp_Property: [CSharp_Annotation]* [CSharp_PropertyModifier]* CSharp_Type CSharp_Variable_Definition [CSharp_PropertySubscript] '{' [CSharp_GetterSetter]* '}'
914 (50% | none | 50% | none) |   CSharp_GetterSetter: (CSharp_GetterBody | CSharp_GetterNoBody | CSharp_SetterBody | CSharp_SetterNoBody)
460 all all |   |   CSharp_GetterBody: "get" CSharp_Statement
    |   |   CSharp_GetterNoBody: "get" ';'
454 all all |   |   CSharp_SetterBody: "set" CSharp_Statement
    |   |   CSharp_SetterNoBody: ["private"] "set" ';'
530 all |   CSharp_PropertyModifier: ("abstract"|"const"|"delegate"|"event"|"extern"|"final"|"internal"|"lock"|"override"|"partial"|"private"|"protected"|"public"|"readonly"|"sealed"|"static"|"virtual")
    |   CSharp_PropertySubscript: '[' [CSharp_MethodParameter] [CSharp_MoreParameters]* ']'
33,318 (15% | 0% | 23% | 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)
7,794 all 3.08(97%) all |   CSharp_StatementBlock: '{' [CSharp_StatementOrComment]* '}'
25,417 (95% | 5%) |   |   CSharp_StatementOrComment: (CSharp_Statement | CSharp_Comment)
1,776 all all 1.00(2%) all CSharp_Subscript: '[' CSharp_Expression [CSharp_MoreSubscripts]* ']'
28 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] ')' ';'
21,317 all 2% 1.00(2%) CSharp_Type: CSharp_TypeName [CSharp_GenericType] [CSharp_ArrayType]*
366 all 1% all |   CSharp_ArrayType: '[' [','] ']'
    |   CSharp_ExtendsType: "extends" CSharp_Identifier_Reference
352 all 1.15 all |   CSharp_GenericType: '<' CSharp_Type* '>'
21,976 (none | 57% | 43%) |   CSharp_TypeName: (CSharp_GenericTypeQuestion | CSharp_IdList | ("void"|"bool"|"boolean"|"byte"|"short"|"int"|"long"|"char"|"float"|"double"|"string"|"String"|"class"))
    |   |   CSharp_GenericTypeQuestion: '?' [CSharp_ExtendsType]
12,570 0% all none 1.00(5%) |   |   CSharp_IdList: [CSharp_NamespaceId] CSharp_Identifier_Reference [CSharp_ExtendsType] [CSharp_MoreIds]*
659 all all |   |   |   CSharp_MoreIds: '.' CSharp_TypeName
12 all all |   |   |   CSharp_NamespaceId: CSharp_Identifier_Reference "::"
45,277 all 1.18(41%) 1.02(4%) CSharp_Variable: CSharp_VariableIdentifier [CSharp_MoreVariableIdentifiers]* [CSharp_Subscript]*
21,983 all all |   CSharp_MoreVariableIdentifiers: '.' CSharp_VariableIdentifier
67,260 (0% | 0% | 100%) |   CSharp_VariableIdentifier: (CSharp_CastedVariable | ("this"|"base"|"class") | CSharp_Identifier_Reference)
139 all all all all all all |   |   CSharp_CastedVariable: '(' '(' CSharp_Type ')' CSharp_Identifier_Reference ')'
    CSharp_RegionDirective: '#' "region" CSharp_CommentToEndOfLine CSharp_ClassElement* '#' "endregion"
308 all all all CSharp_BreakStatement: ["yield"] "break" ';'
8 all all CSharp_CheckedStatement: "checked" CSharp_Statement
34 all all CSharp_ContinueStatement: "continue" ';'
3 all all all all all all all CSharp_DoStatement: "do" CSharp_Statement "while" '(' CSharp_Expression ')' ';'
13,126 all all all CSharp_ExpressionStatement: CSharp_Expression ';' [CSharp_Comment]
342 all all all all all all all all all CSharp_ForEachStatement: "foreach" '(' CSharp_Type CSharp_Variable "in" CSharp_Expression ')' [CSharp_Comment] CSharp_Statement
232 all all all all all all all all all all all CSharp_ForStatement: "for" '(' CSharp_ForLoopVariable '=' CSharp_Expression ';' CSharp_Expression ';' CSharp_Expression ')' CSharp_Statement
232 (72% | 28%) |   CSharp_ForLoopVariable: (CSharp_ForLoopVariableWithType | CSharp_Variable)
167 all all |   |   CSharp_ForLoopVariableWithType: CSharp_Type CSharp_Variable
4 all all CSharp_GetProperty: "get" CSharp_StatementBlock
3,154 all all all all 1.00(1%) all 24% CSharp_IfStatement: "if" '(' CSharp_Expression ')' [CSharp_Comment]* CSharp_Statement [CSharp_IfElseClause]
768 1.00(1%) all 1.00(3%) all |   CSharp_IfElseClause: [CSharp_Comment]* "else" [CSharp_Comment]* CSharp_Statement
6 all all all all all CSharp_LockStatement: "lock" '(' CSharp_Expression ')' CSharp_Statement
2,083 all all 95% all CSharp_ReturnStatement: ["yield"] "return" [CSharp_Expression] ';'
    CSharp_SetProperty: "set" CSharp_StatementBlock
48 all all all all all 6.10 all CSharp_SwitchStatement: "switch" '(' CSharp_Expression ')' '{' CSharp_SwitchCase* '}'
293 (93% | 7%) |   CSharp_CaseType: (CSharp_CaseClause | "default")
273 all all |   |   CSharp_CaseClause: "case" CSharp_Expression
293 all all 2.09(87%) |   CSharp_SwitchCase: CSharp_CaseType ':' [CSharp_StatementOrComment]*
    CSharp_SynchronizedStatement: "synchronized" '(' CSharp_Expression ')' CSharp_Statement
352 all 99% all CSharp_ThrowStatement: "throw" [CSharp_Expression] ';'
264 all all 6.36 all 1.00(1%) 1.04(95%) 18% CSharp_TryStatement: "try" '{' CSharp_StatementOrComment* '}' [CSharp_Comment]* [CSharp_CatchBlock]* [CSharp_FinallyBlock]
261 all 98% all |   CSharp_CatchBlock: "catch" [CSharp_CatchWhat] CSharp_Statement
255 all all 57% all |   |   CSharp_CatchWhat: '(' CSharp_Type [CSharp_Identifier] ')'
47 all all |   CSharp_FinallyBlock: "finally" CSharp_Statement
49 all all all all all CSharp_UsingStatement: "using" '(' CSharp_DataBeforeSemicolon ')' CSharp_Statement
222 all all all all all all CSharp_WhileStatement: "while" '(' CSharp_Expression ')' [CSharp_Comment] CSharp_Statement

Terminals = 12 (instances=137,662)
Tokens = 137 (instances=529,140)

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