Eagle Legacy Modernization, LLC

Delphi Grammar

Main programs: Delphi_Program Delphi_Configuration

 Count  Terminals:
  Delphi_Character: A string enclosed in quotes
249 Delphi_Comment: Comment
321 Delphi_Config_EndOfLine: End of line
605 Delphi_Config_Value: A string enclosed in quotes
3 Delphi_HexNumber: A hex number
3,598 Delphi_Identifier_Reference: An identifier
9 Delphi_Include: Comment
180 Delphi_Literal: A string enclosed in quotes
392 Delphi_Number: A number
11 Delphi_Program_Definition: An identifier
6 Delphi_Property_Definition: An identifier
17 Delphi_Type_Definition: An identifier
394 Delphi_Variable_Definition: An identifier
 Count  Statistics(*) Tokens:
123 all 99% 1.65(33%) all Delphi_Arguments: '(' [Delphi_OneArgument] [Delphi_MoreArguments]* ')'
2 all all |   Delphi_InitialValue: '=' Delphi_Expression
66 all all |   Delphi_MoreArguments: ';' [Delphi_OneArgument]
188 all 1.13 all all 1% |   Delphi_OneArgument: ["Var"] Delphi_Variable* ':' Delphi_Type [Delphi_InitialValue]
7 all 86% 27.20(71%) 57% 43% 71% all Delphi_Class: "Class" [Delphi_SuperClass] [Delphi_Class_Entry]* [Delphi_PrivateEntries] [Delphi_ProtectedEntries] [Delphi_PublicEntries] "End"
188 (59% | 4% | 31% | 3% | 3%) |   Delphi_Class_Entry: (Delphi_Field | Delphi_Comment | Delphi_ProcedureForward | Delphi_FunctionForward | Delphi_Property)
110 1.02 all all all |   |   Delphi_Field: Delphi_Variable_Definition* ':' Delphi_Type ';'
4 all 1.50 |   Delphi_PrivateEntries: "Private" Delphi_Class_Entry*
3 all 2.33 |   Delphi_ProtectedEntries: "Protected" Delphi_Class_Entry*
5 all 7.80 |   Delphi_PublicEntries: "Public" Delphi_Class_Entry*
6 all all all |   Delphi_SuperClass: '(' Delphi_Type ')'
3 none 12.33 Delphi_Configuration: [Delphi_Config_EndOfLine] Delphi_Config_Block*
37 all all all all 7.68 |   Delphi_Config_Block: '[' [Delphi_Config_Value] ']' Delphi_Config_EndOfLine Delphi_Config_Line*
284 all all all all |   |   Delphi_Config_Line: [Delphi_Config_Value] '=' [Delphi_Config_Value] Delphi_Config_EndOfLine
7 all none 2.43 Delphi_Consts: "Const" [Delphi_Comment]* Delphi_Const*
17 all 6% all all all 1.09(65%) |   Delphi_Const: Delphi_Variable_Definition [Delphi_ConstType] '=' Delphi_Expression ';' [Delphi_Comment]*
1 all all |   |   Delphi_ConstType: ':' Delphi_Type
2,770 (14% | 0% | 6% | none | 3% | 1% | 0% | 10% | 0% | 48% | none | 0% | 0% | 4% | 6% | 6% | 0%) Delphi_Expression: (Delphi_Number | Delphi_HexNumber | Delphi_Literal | Delphi_Character | Delphi_Builtins | Delphi_Parens | Delphi_Brackets | Delphi_Function_Call | Delphi_Cast | Delphi_VariableExpression | Delphi_UnarySign | Delphi_NotOp | Delphi_Dot_Expression | Delphi_Multiplicative_Expression | Delphi_Additive_Expression | Delphi_Relational_Expression | Delphi_DotDot_Expression)
171 all all all |   Delphi_Additive_Expression: Delphi_Expression Delphi_Additive_Operator Delphi_Expression
171 (95% | 5%) |   |   Delphi_Additive_Operator: (("+"|"-") | ("Or"|"Xor"))
10 all 1.80 all |   Delphi_Brackets: '[' Delphi_Expression* ']'
87 all |   Delphi_Builtins: ("False"|"True"|"Nil")
1 all all all all |   Delphi_Cast: Delphi_Type '(' Delphi_Expression ')'
6 all all all |   Delphi_DotDot_Expression: Delphi_Expression ".." Delphi_Expression
4 all all all |   Delphi_Dot_Expression: Delphi_Expression '.' Delphi_Expression
282 all all |   Delphi_Function_Call: Delphi_Variable Delphi_Parameter_List
105 all all all |   Delphi_Multiplicative_Expression: Delphi_Expression Delphi_Multiplicative_Operator Delphi_Expression
105 (17% | 83%) |   |   Delphi_Multiplicative_Operator: (("*"|"/") | ("Div"|"Mod"|"And"|"Shl"|"Shr"|"As"))
10 all all |   Delphi_NotOp: "Not" Delphi_Expression
38 all 1.00 all |   Delphi_Parens: '(' Delphi_Expression* ')'
153 all all 1% all |   Delphi_Relational_Expression: Delphi_Expression Delphi_Relational_Operator [Delphi_Comment] Delphi_Expression
153 (99% | 1%) |   |   Delphi_Relational_Operator: (("="|"<>"|"<"|">"|"<="|">=") | ("In"|"Is"))
    |   Delphi_UnarySign: ("-"|"+") Delphi_Expression
1,340 all |   Delphi_VariableExpression: Delphi_Variable
12 all 1.09(92%) all 1.00(33%) all Delphi_Function: Delphi_FunctionForward [Delphi_Header]* Delphi_BeginEnd [Delphi_Comment]* ';'
18 all all 67% all all all |   Delphi_FunctionForward: "Function" Delphi_Variable [Delphi_Arguments] ':' Delphi_Type ';'
284 all all 1.95(100%) all Delphi_Parameter_List: '(' ["Inherited"] [Delphi_Expression]* ')'
86 all 1.67(71%) 98% 1.00(28%) 98% Delphi_Procedure: Delphi_ProcedureForward [Delphi_Header]* [Delphi_BeginEnd] [Delphi_Comment]* [';']
144 all all 77% all 2% |   Delphi_ProcedureForward: ("Procedure"|"Constructor"|"Destructor") Delphi_Variable [Delphi_Arguments] ';' [Delphi_Override]
3 all all |   |   Delphi_Override: "Override" ';'
16 all Delphi_Program: Delphi_Full_or_Partial
16 (69% | 31%) |   Delphi_Full_or_Partial: (Delphi_Full | Delphi_Partial)
11 all all all 13.91(all) 45% all all |   |   Delphi_Full: ("Program"|"Unit") Delphi_Program_Definition ';' [Delphi_Header]* [Delphi_BeginEnd] ["End"] '.'
5 4.20 |   |   Delphi_Partial: Delphi_Header*
288 (1% | 4% | 17% | 4% | 4% | 2% | 30% | 30% | 4% | 3%) |   Delphi_Header: (Delphi_Initialization | ("Interface"|"Implementation") | Delphi_Comment | Delphi_Uses | Delphi_Types | Delphi_Consts | Delphi_Vars | Delphi_Procedure | Delphi_Function | Delphi_Include)
2 all all all |   |   Delphi_Initialization: ("Initialization"|"Finalization") Delphi_Statement ';'
6 all all 17% all all 1.83 all Delphi_Property: "Property" Delphi_Property_Definition [Delphi_PropertySubscript] ':' Delphi_Type Delphi_PropertyReadWrite* ';'
11 (55% | 45%) |   Delphi_PropertyReadWrite: (Delphi_PropertyRead | Delphi_PropertyWrite)
6 all all |   |   Delphi_PropertyRead: "Read" Delphi_Identifier_Reference
5 all all |   |   Delphi_PropertyWrite: "Write" Delphi_Identifier_Reference
1 all all all all all |   Delphi_PropertySubscript: '[' Delphi_Variable_Definition ':' Delphi_Type ']'
1,236 (0% | 38% | 12% | 1% | 0% | 0% | 5% | 0% | 12% | 1% | 0% | 1% | 0% | 0% | 1% | 2% | 0% | 8% | 18%) Delphi_Statement: (';' | Delphi_Assignment | Delphi_BeginEnd | Delphi_Break_Statement | Delphi_Case_Statement | Delphi_Close_Statement | Delphi_For_Statement | Delphi_Halt_Statement | Delphi_If_Statement | Delphi_Inherited_Statement | Delphi_Raise_Statement | Delphi_Readln_Statement | Delphi_Repeat_Statement | Delphi_Rewrite_Statement | Delphi_Try_Statement | Delphi_While_Statement | Delphi_With_Statement | Delphi_Writeln_Statement | Delphi_Procedure_Call)
280 none all 3.17(77%) none 95% 1.71(3%) Delphi_Statement_List: [Delphi_Comment]* Delphi_Statement [Delphi_MoreStatements]* [Delphi_Comment]* [';'] [Delphi_Comment]*
685 all 1.08(9%) all none |   Delphi_MoreStatements: ';' [Delphi_Comment]* Delphi_Statement [Delphi_Comment]*
597 (2% | 0% | 1% | none | 0% | 37% | 60% | 1%) Delphi_Type: (Delphi_Array | Delphi_Enum | Delphi_Range | Delphi_String | Delphi_Type_Record | ("Boolean"|"Integer"|"LongInt"|"Int64"|"Text") | Delphi_Identifier_Reference | Delphi_Class)
9 all 67% all all |   Delphi_Array: "Array" [Delphi_ArraySize] "Of" Delphi_Type
6 all 1.00 all |   |   Delphi_ArraySize: '[' Delphi_Expression* ']'
1 all 5.00 all |   Delphi_Enum: '(' Delphi_EnumValue* ')'
3 all all all |   |   Delphi_EnumValue: Delphi_Variable_Definition '=' Delphi_Expression
4 all all all |   Delphi_Range: Delphi_Number ".." Delphi_Number
    |   Delphi_String: "String" '[' Delphi_Expression ']'
1 all 1.00 all |   Delphi_Type_Record: "Record" Delphi_RecordEntry* "End"
1 5.00 all all all |   |   Delphi_RecordEntry: Delphi_Variable_Definition* ':' Delphi_Type ';'
11 all 1.55(all) Delphi_Types: "Type" [Delphi_MoreTypes]*
17 all all all all |   Delphi_MoreTypes: Delphi_Type_Definition '=' Delphi_Type ';'
12 all 13.50 all Delphi_Uses: "Uses" Delphi_Identifier_Reference* ';'
2,453 all 1.28(26%) Delphi_Variable: Delphi_Identifier_Reference [Delphi_Extended_Variable]*
832 (74% | 26%) |   Delphi_Extended_Variable: (Delphi_DotName | Delphi_Subscript)
617 all all |   |   Delphi_DotName: '.' Delphi_Identifier_Reference
215 all 1.00 all |   |   Delphi_Subscript: '[' Delphi_Expression* ']'
87 all 2.75 Delphi_Vars: "Var" Delphi_Var*
239 1.17 all all all 1.00(6%) |   Delphi_Var: Delphi_Variable_Definition* ':' Delphi_Type ';' [Delphi_Comment]*
464 all all all Delphi_Assignment: Delphi_Variable ":=" Delphi_Expression
250 all 1.00(17%) 100% all Delphi_BeginEnd: "Begin" [Delphi_Comment]* [Delphi_Statement_List] "End"
7 all Delphi_Break_Statement: "Break"
1 all all all 2.00 all Delphi_Case_Statement: "Case" Delphi_Expression "Of" Delphi_CaseClause* "End"
2 all all all all |   Delphi_CaseClause: Delphi_Expression ':' Delphi_Statement ';'
6 all 67% Delphi_Close_Statement: "Close" [Delphi_CloseParams]
4 all all all |   Delphi_CloseParams: '(' Delphi_Identifier_Reference ')'
59 all all all all all all all 1.00(3%) all Delphi_For_Statement: "For" Delphi_Identifier_Reference ":=" Delphi_Expression ("To"|"DownTo") Delphi_Expression "Do" [Delphi_Comment]* Delphi_Statement
4 all Delphi_Halt_Statement: "Halt"
144 all all none all 1.00(6%) all 24% Delphi_If_Statement: "If" Delphi_Expression [Delphi_Comment]* "Then" [Delphi_Comment]* [Delphi_Statement] [Delphi_If_Else]
35 1.00(3%) all all |   Delphi_If_Else: [Delphi_Comment]* "Else" Delphi_Statement
8 all 63% 25% Delphi_Inherited_Statement: "Inherited" [Delphi_Variable] [Delphi_Parameter_List]
226 all Delphi_Procedure_Call: Delphi_Expression
3 all all Delphi_Raise_Statement: "Raise" Delphi_Expression
10 all 60% Delphi_Readln_Statement: "ReadLn" [Delphi_Readln_What]
6 (17% | 83%) |   Delphi_Readln_What: (Delphi_Readln_FromFile | Delphi_Readln_NoFile)
1 all all all all all |   |   Delphi_Readln_FromFile: '(' Delphi_Identifier_Reference ',' Delphi_Identifier_Reference ')'
5 all all all |   |   Delphi_Readln_NoFile: '(' Delphi_Identifier_Reference ')'
6 all all all all Delphi_Repeat_Statement: "Repeat" Delphi_Statement_List "Until" Delphi_Expression
4 all all all all all all Delphi_Rewrite_Statement: "ReWrite" '(' Delphi_Identifier_Reference ',' Delphi_Literal ')'
14 all all all 21% all 57% all Delphi_Try_Statement: "Try" Delphi_Statement_List ["Except"] [Delphi_Statement_List] ["Finally"] [Delphi_Statement_List] "End"
25 all all all all Delphi_While_Statement: "While" Delphi_Expression "Do" Delphi_Statement
4 all all all all Delphi_With_Statement: "With" Delphi_Expression "Do" Delphi_Statement
100 all 92% Delphi_Writeln_Statement: ("Write"|"WriteLn") [Delphi_WriteLn_Something]
92 all 2.85(99%) all |   Delphi_WriteLn_Something: '(' [Delphi_WriteLn_Piece]* ')'
175 all none none |   |   Delphi_WriteLn_Piece: Delphi_Expression [Delphi_Writeln_ColonWidth] [Delphi_Writeln_ColonWidth]
    |   |   |   Delphi_Writeln_ColonWidth: ':' Delphi_Expression

Terminals = 13 (instances=5,785)
Tokens = 99 (instances=16,332)

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