Eagle Legacy Modernization, LLC

CSharp Grammar

Main program: CSharp_Program

 Count  Terminals:
236 CSharp_Character_Literal: A string enclosed in quotes
1,059 CSharp_Class_Definition: An identifier
10,814 CSharp_Comment: Comment
  CSharp_CommentToEndOfLine: Comment
787 CSharp_Current_Class_Reference: An identifier
2 CSharp_HexNumber: A hex number
7,177 CSharp_Identifier: An identifier
105,571 CSharp_Identifier_Reference: An identifier
10,755 CSharp_Literal: A string enclosed in quotes
3,763 CSharp_Method_Definition: An identifier
3,924 CSharp_Number: A number
18,148 CSharp_Variable_Definition: An identifier
 Count  Statistics(*) Tokens:
200 all all none all CSharp_Annotation: '[' CSharp_AnnotationItem [CSharp_MoreAnnotations]* ']'
200 3% 66% 1.15 98% |   CSharp_AnnotationItem: [CSharp_AnnotionGlobal] [CSharp_AnnotionAssembly] CSharp_Identifier* [CSharp_AnnotationParams]
196 all 94% all |   CSharp_AnnotationParams: '(' [CSharp_ArgumentList] ')'
132 all all |   CSharp_AnnotionAssembly: ("assembly"|"return") ':'
6 all all |   CSharp_AnnotionGlobal: "global" "::"
    |   CSharp_MoreAnnotations: ',' CSharp_AnnotationItem
15,928 all all 1.75(43%) CSharp_ArgumentList: [("ref"|"out")] CSharp_Expression [CSharp_MoreArguments]*
12,054 all all all 1.00(0%) |   CSharp_MoreArguments: ',' [("ref"|"out")] CSharp_Expression [CSharp_Comment]*
1,059 1.67(17%) 1.18(99%) all all 0% 66% none all 8.89(all) all none CSharp_Class: [CSharp_AnnotationOrComment]* [CSharp_ClassModifier]* ("class"|"interface"|"struct") CSharp_Class_Definition [CSharp_GenericType] [CSharp_ExtendsOrImplements] [CSharp_Comment]* '{' [CSharp_ClassElement]* '}' [';']
296 (8% | 92%) |   CSharp_AnnotationOrComment: (CSharp_Annotation | CSharp_Comment)
9,414 (48% | 1% | 3% | 8% | 39% | none | 0% | none) |   CSharp_ClassElement: (CSharp_StaticStatement | CSharp_Comment | CSharp_Property | CSharp_Constructor | CSharp_Method | CSharp_Statement | CSharp_SubscriptOperator | CSharp_RegionDirective)
4,519 all all |   |   CSharp_StaticStatement: ["static"] CSharp_Statement
1,238 all |   CSharp_ClassModifier: ("abstract"|"const"|"delegate"|"event"|"extern"|"final"|"internal"|"lock"|"override"|"partial"|"private"|"protected"|"public"|"readonly"|"sealed"|"static"|"virtual")
699 all none 1.79 0% 1.32(11%) |   CSharp_ExtendsOrImplements: ':' [CSharp_NamespaceQualifer] CSharp_Identifier_Reference* [CSharp_GenericType] [CSharp_MoreImplements]*
100 all 2.60 none |   |   CSharp_MoreImplements: ',' CSharp_Identifier_Reference* [CSharp_GenericType]
    |   |   CSharp_NamespaceQualifer: CSharp_Identifier_Reference "::"
787 none 1.00(0%) 1.00(all) all all 93% 2.26(53%) all 73% all CSharp_Constructor: [CSharp_Comment]* [CSharp_Annotation]* [CSharp_MethodModifiers]* CSharp_Current_Class_Reference '(' [CSharp_MethodParameter] [CSharp_MoreParameters]* ')' [CSharp_ExtendsBase] CSharp_MethodBody
572 all all all 99% all |   CSharp_ExtendsBase: ':' ("base"|"this") '(' [CSharp_ArgumentList] ')'
10,401 all all 1.47(4%) CSharp_Data: CSharp_DataBeforeSemicolon ';' [CSharp_Comment]*
10,427 none 1.29(38%) none all all none none 82% 1.57(1%) |   CSharp_DataBeforeSemicolon: [CSharp_Annotation]* [CSharp_DataModifier]* [CSharp_Annotation]* CSharp_Type CSharp_Variable_Definition ['['] [']'] [CSharp_DataInitialValue] [CSharp_MoreIdentifiers]*
8,512 all all |   CSharp_DataInitialValue: '=' CSharp_Expression
5,169 all |   CSharp_DataModifier: ("abstract"|"const"|"delegate"|"event"|"extern"|"final"|"internal"|"lock"|"override"|"partial"|"private"|"protected"|"public"|"readonly"|"sealed"|"static"|"virtual")
94 all all none none 10% |   CSharp_MoreIdentifiers: ',' CSharp_Variable_Definition ['['] [']'] [CSharp_DataInitialValue]
25 none 1.00(all) all all none all 1.00(8%) all 8% 6.64(all) none all 96% 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
166 all all 2% |   CSharp_MoreEnums: ',' CSharp_Variable_Definition [CSharp_EnumInitializer]
101,140 (0% | 4% | 11% | 0% | none | 1% | 0% | none | 4% | 0% | 0% | 16% | 0% | 0% | 1% | 0% | 0% | none | 1% | 4% | 40% | 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)
3,544 all all all |   CSharp_AdditiveExpression: CSharp_Expression ("+"|"-") CSharp_Expression
    |   CSharp_AndExpression: CSharp_Expression '&' CSharp_Expression
7,558 all all all |   CSharp_AssignmentExpression: CSharp_Expression ("="|"*="|"/="|"%="|"+="|"-="|"<<="|">>="|">>>="|"&="|"^="|"|=") CSharp_Expression
3,928 all |   CSharp_BuiltIn: ("false"|"true"|"null"|"this"|"super")
1,101 all all all all |   CSharp_CastExpression: '(' CSharp_Type ')' CSharp_Expression
4,164 all all all none 60% all |   CSharp_ClassCreationExpression: "new" CSharp_Type '(' [CSharp_Comment]* [CSharp_ArgumentList] ')'
36 all all all 97% all |   CSharp_ClassCreationWithInitializers: "new" CSharp_Type '{' [CSharp_ArgumentList] '}'
270 all all 1.00 |   CSharp_ClassCreationWithSubscript: "new" CSharp_Type CSharp_Subscript*
1,173 all all |   CSharp_CommentExpression: CSharp_Comment CSharp_Expression
596 all all all |   CSharp_ConditionalAndExpression: CSharp_Expression "&&" CSharp_Expression
187 all all all |   CSharp_ConditionalOrExpression: CSharp_Expression "||" CSharp_Expression
    |   CSharp_Delegation: "delegate" CSharp_MethodParameters CSharp_MethodBody
    |   CSharp_DotClass: CSharp_Type '.' "class"
2,063 all all all |   CSharp_EqualityExpression: CSharp_Expression CSharp_EqualityOperator CSharp_Expression
2,063 (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
317 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
15,777 all all 80% all |   CSharp_MethodInvocation: CSharp_Variable '(' [CSharp_ArgumentList] ')'
268 all all all |   CSharp_MultiplicativeExpression: CSharp_Expression ("*"|"/"|"%") CSharp_Expression
2 all all all |   CSharp_NamespaceExpression: CSharp_Expression "::" CSharp_Expression
66 all all |   CSharp_NegativeExpression: ("-"|"+") CSharp_Expression
537 all all |   CSharp_NotExpression: '!' CSharp_Expression
604 all all all |   CSharp_ParenthesizedExpression: '(' CSharp_Expression ')'
18 all all |   CSharp_PostDecrementExpression: CSharp_Variable "--"
653 all all |   CSharp_PostIncrementExpression: CSharp_Variable "++"
1 all all |   CSharp_PreDecrementExpression: "--" CSharp_Variable
50 all all |   CSharp_PreIncrementExpression: "++" CSharp_Variable
1,139 all all all |   CSharp_RelationalExpression: CSharp_Expression ("<"|">"|"<="|">=") CSharp_Expression
    |   CSharp_ShiftExpression: CSharp_Expression ("<<"|">>"|">>>") CSharp_Expression
1,136 all all all |   CSharp_SubfieldExpression: CSharp_Expression '.' CSharp_Expression
38 all all all all |   CSharp_SubscriptExpression: CSharp_Expression '[' CSharp_Expression ']'
180 all all all all all |   CSharp_TrueFalseExpression: CSharp_Expression '?' CSharp_Expression ':' CSharp_Expression
78 all |   CSharp_TypeExpression: CSharp_Type
223 all all all all |   CSharp_TypeOf: "typeof" '(' CSharp_Type ')'
40,477 all |   CSharp_VariableExpression: CSharp_Variable
3,763 1.63(1%) 1.00(0%) 1.54(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 [';']
4,550 (94% | 6%) |   CSharp_MethodBody: (CSharp_MethodImplementation | ';')
4,263 none all 3.10(8%) none |   |   CSharp_MethodImplementation: [CSharp_Comment]* CSharp_StatementBlock [CSharp_Comment]* [';']
6,448 all |   CSharp_MethodModifiers: ("abstract"|"const"|"delegate"|"event"|"extern"|"final"|"internal"|"lock"|"override"|"partial"|"private"|"protected"|"public"|"readonly"|"sealed"|"static"|"virtual")
7,130 none all all all all |   CSharp_MethodParameter: [CSharp_Annotation] [("ref"|"out"|"this")] CSharp_Type CSharp_Variable_Definition ["[]"]
3,763 all 79% 1.50(44%) all all |   CSharp_MethodParameters: '(' [CSharp_MethodParameter] [CSharp_MoreParameters]* ')' [CSharp_Comment]
3,432 all all |   CSharp_MoreParameters: ',' CSharp_MethodParameter
526 2.04(68%) 7.28 CSharp_Program: [CSharp_Comment]* CSharp_NamespaceOrClassEntry*
491 all 2.05 all 1.64 all |   CSharp_Namespace: "namespace" CSharp_Identifier* '{' CSharp_ProgramElems* '}'
3,829 (77% | 6% | 12% | 1% | 3%) |   CSharp_NamespaceOrClassEntry: (CSharp_Using | CSharp_Comment | CSharp_Namespace | CSharp_Class | CSharp_Annotation)
807 (2% | 0% | 28% | 64% | 0% | 6%) |   CSharp_ProgramElems: (CSharp_Namespace | CSharp_Using | CSharp_Comment | CSharp_Class | CSharp_Enum | CSharp_Method)
2,959 all 2.88 2% all |   CSharp_Using: "using" CSharp_Identifier* [CSharp_UsingEquals] ';'
58 all 8.66 |   |   CSharp_UsingEquals: '=' CSharp_Identifier*
281 2.93(5%) 1.07(all) all all 1% all 1.78(all) all CSharp_Property: [CSharp_Annotation]* [CSharp_PropertyModifier]* CSharp_Type CSharp_Variable_Definition [CSharp_PropertySubscript] '{' [CSharp_GetterSetter]* '}'
501 (49% | none | 51% | none) |   CSharp_GetterSetter: (CSharp_GetterBody | CSharp_GetterNoBody | CSharp_SetterBody | CSharp_SetterNoBody)
246 all all |   |   CSharp_GetterBody: "get" CSharp_Statement
    |   |   CSharp_GetterNoBody: "get" ';'
255 all all |   |   CSharp_SetterBody: "set" CSharp_Statement
    |   |   CSharp_SetterNoBody: ["private"] "set" ';'
300 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]* ']'
41,521 (13% | 0% | 25% | 1% | 0% | 1% | 0% | 0% | 0% | 1% | 1% | 0% | 9% | 0% | 6% | none | none | 0% | none | 1% | 1% | 0% | 1% | 40%) 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)
9,845 all 3.13(95%) all |   CSharp_StatementBlock: '{' [CSharp_StatementOrComment]* '}'
32,348 (94% | 6%) |   |   CSharp_StatementOrComment: (CSharp_Statement | CSharp_Comment)
2,095 all all 1.00(1%) all CSharp_Subscript: '[' CSharp_Expression [CSharp_MoreSubscripts]* ']'
17 all all |   CSharp_MoreSubscripts: ',' CSharp_Expression
2 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] ')' ';'
29,178 all 1% 1.00(2%) CSharp_Type: CSharp_TypeName [CSharp_GenericType] [CSharp_ArrayType]*
538 all 0% all |   CSharp_ArrayType: '[' [','] ']'
    |   CSharp_ExtendsType: "extends" CSharp_Identifier_Reference
198 all 1.13 all |   CSharp_GenericType: '<' CSharp_Type* '>'
29,825 (none | 59% | 41%) |   CSharp_TypeName: (CSharp_GenericTypeQuestion | CSharp_IdList | ("void"|"bool"|"boolean"|"byte"|"short"|"int"|"long"|"char"|"float"|"double"|"string"|"String"|"class"))
    |   |   CSharp_GenericTypeQuestion: '?' [CSharp_ExtendsType]
17,727 0% all none 1.00(4%) |   |   CSharp_IdList: [CSharp_NamespaceId] CSharp_Identifier_Reference [CSharp_ExtendsType] [CSharp_MoreIds]*
647 all all |   |   |   CSharp_MoreIds: '.' CSharp_TypeName
6 all all |   |   |   CSharp_NamespaceId: CSharp_Identifier_Reference "::"
57,708 all 1.19(42%) 1.01(3%) CSharp_Variable: CSharp_VariableIdentifier [CSharp_MoreVariableIdentifiers]* [CSharp_Subscript]*
29,063 all all |   CSharp_MoreVariableIdentifiers: '.' CSharp_VariableIdentifier
86,771 (0% | 0% | 100%) |   CSharp_VariableIdentifier: (CSharp_CastedVariable | ("this"|"base"|"class") | CSharp_Identifier_Reference)
214 all all all all all all |   |   CSharp_CastedVariable: '(' '(' CSharp_Type ')' CSharp_Identifier_Reference ')'
    CSharp_RegionDirective: '#' "region" CSharp_CommentToEndOfLine CSharp_ClassElement* '#' "endregion"
461 all all all CSharp_BreakStatement: ["yield"] "break" ';'
16 all all CSharp_CheckedStatement: "checked" CSharp_Statement
41 all all CSharp_ContinueStatement: "continue" ';'
4 all all all all all all all CSharp_DoStatement: "do" CSharp_Statement "while" '(' CSharp_Expression ')' ';'
16,513 all all CSharp_ExpressionStatement: CSharp_Expression ';'
434 all all all all all all all all all CSharp_ForEachStatement: "foreach" '(' CSharp_Type CSharp_Variable "in" CSharp_Expression ')' [CSharp_Comment] CSharp_Statement
298 all all all all all all all all all all all CSharp_ForStatement: "for" '(' CSharp_ForLoopVariable '=' CSharp_Expression ';' CSharp_Expression ';' CSharp_Expression ')' CSharp_Statement
298 (71% | 29%) |   CSharp_ForLoopVariable: (CSharp_ForLoopVariableWithType | CSharp_Variable)
213 all all |   |   CSharp_ForLoopVariableWithType: CSharp_Type CSharp_Variable
2 all all CSharp_GetProperty: "get" CSharp_StatementBlock
3,612 all all all all 1.00(1%) all 26% CSharp_IfStatement: "if" '(' CSharp_Expression ')' [CSharp_Comment]* CSharp_Statement [CSharp_IfElseClause]
924 1.00(1%) all 1.00(2%) all |   CSharp_IfElseClause: [CSharp_Comment]* "else" [CSharp_Comment]* CSharp_Statement
7 all all all all all CSharp_LockStatement: "lock" '(' CSharp_Expression ')' CSharp_Statement
2,444 all all 95% all CSharp_ReturnStatement: ["yield"] "return" [CSharp_Expression] ';'
    CSharp_SetProperty: "set" CSharp_StatementBlock
81 all all all all all 6.32 all CSharp_SwitchStatement: "switch" '(' CSharp_Expression ')' '{' CSharp_SwitchCase* '}'
512 (94% | 6%) |   CSharp_CaseType: (CSharp_CaseClause | "default")
483 all all |   |   CSharp_CaseClause: "case" CSharp_Expression
512 all all 2.02(88%) |   CSharp_SwitchCase: CSharp_CaseType ':' [CSharp_StatementOrComment]*
    CSharp_SynchronizedStatement: "synchronized" '(' CSharp_Expression ')' CSharp_Statement
486 all 100% all CSharp_ThrowStatement: "throw" [CSharp_Expression] ';'
319 all all 6.21 all 1.00(1%) 1.03(97%) 8% CSharp_TryStatement: "try" '{' CSharp_StatementOrComment* '}' [CSharp_Comment]* [CSharp_CatchBlock]* [CSharp_FinallyBlock]
319 all 98% all |   CSharp_CatchBlock: "catch" [CSharp_CatchWhat] CSharp_Statement
314 all all 61% all |   |   CSharp_CatchWhat: '(' CSharp_Type [CSharp_Identifier] ')'
27 all all |   CSharp_FinallyBlock: "finally" CSharp_Statement
26 all all all all all CSharp_UsingStatement: "using" '(' CSharp_DataBeforeSemicolon ')' CSharp_Statement
268 all all all all all all CSharp_WhileStatement: "while" '(' CSharp_Expression ')' [CSharp_Comment] CSharp_Statement

Terminals = 12 (instances=162,236)
Tokens = 137 (instances=681,547)

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