Eagle Legacy Modernization, LLC

Delphi Grammar

Main program: Delphi_Program

 Count  Terminals:
26 Delphi_Character: A string enclosed in quotes
1,057 Delphi_Comment: Comment
3 Delphi_HexNumber: A hex number
4,104 Delphi_Identifier_Reference: An identifier
11 Delphi_Include: Comment
286 Delphi_Literal: A string enclosed in quotes
538 Delphi_Number: A number
13 Delphi_Program_Definition: An identifier
6 Delphi_Property_Definition: An identifier
19 Delphi_Type_Definition: An identifier
470 Delphi_Variable_Definition: An identifier
 Count  Statistics(*) Tokens:
129 all 99% 1.62(33%) all Delphi_Arguments: '(' [Delphi_OneArgument] [Delphi_MoreArguments]* ')'
2 all all |   Delphi_InitialValue: '=' Delphi_Expression
68 all all |   Delphi_MoreArguments: ';' [Delphi_OneArgument]
196 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 ')'
12 all 1.00(8%) 4.42 Delphi_Consts: "Const" [Delphi_Comment]* Delphi_Const*
53 all 58% all all all 1.07(26%) |   Delphi_Const: Delphi_Variable_Definition [Delphi_ConstType] '=' Delphi_Expression ';' [Delphi_Comment]*
31 all all |   |   Delphi_ConstType: ':' Delphi_Type
3,539 (15% | 0% | 8% | 1% | 3% | 1% | 0% | 0% | 10% | 0% | 45% | none | 0% | 0% | 4% | 6% | 6% | 0%) Delphi_Expression: (Delphi_Number | Delphi_HexNumber | Delphi_Literal | Delphi_Character | Delphi_Builtins | Delphi_Parens | Delphi_Brackets | Delphi_Builtin_Function_Call | 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)
199 all all all |   Delphi_Additive_Expression: Delphi_Expression Delphi_Additive_Operator Delphi_Expression
199 (95% | 5%) |   |   Delphi_Additive_Operator: (("+"|"-") | ("Or"|"Xor"))
11 all 1.91 all |   Delphi_Brackets: '[' Delphi_Expression* ']'
7 all all |   Delphi_Builtin_Function_Call: ("Odd"|"Pred"|"Succ") Delphi_Parameter_List
99 all |   Delphi_Builtins: ("False"|"True"|"Nil")
1 all all all all |   Delphi_Cast: Delphi_Type '(' Delphi_Expression ')'
12 all all all |   Delphi_DotDot_Expression: Delphi_Expression ".." Delphi_Expression
4 all all all |   Delphi_Dot_Expression: Delphi_Expression '.' Delphi_Expression
356 all all |   Delphi_Function_Call: Delphi_Variable Delphi_Parameter_List
125 all all all |   Delphi_Multiplicative_Expression: Delphi_Expression Delphi_Multiplicative_Operator Delphi_Expression
125 (25% | 75%) |   |   Delphi_Multiplicative_Operator: (("*"|"/") | ("Div"|"Mod"|"And"|"Shl"|"Shr"|"As"))
12 all all |   Delphi_NotOp: "Not" Delphi_Expression
51 all 1.90 all |   Delphi_Parens: '(' Delphi_Expression* ')'
211 all all all all |   Delphi_Relational_Expression: Delphi_Expression Delphi_Relational_Operator [Delphi_Comment] Delphi_Expression
211 (99% | 1%) |   |   Delphi_Relational_Operator: (("="|"<>"|"<"|">"|"<="|">=") | ("In"|"Is"))
    |   Delphi_UnarySign: ("-"|"+") Delphi_Expression
1,610 all |   Delphi_VariableExpression: Delphi_Variable
16 all 1.20(94%) all 1.00(38%) all Delphi_Function: Delphi_FunctionForward [Delphi_Header]* Delphi_BeginEnd [Delphi_Comment]* ';'
22 all all 68% all all all |   Delphi_FunctionForward: "Function" Delphi_Variable [Delphi_Arguments] ':' Delphi_Type ';'
365 all all 2.13(100%) all Delphi_Parameter_List: '(' ["Inherited"] [Delphi_Expression]* ')'
90 all 1.70(71%) 98% 1.00(31%) 98% Delphi_Procedure: Delphi_ProcedureForward [Delphi_Header]* [Delphi_BeginEnd] [Delphi_Comment]* [';']
148 all all 77% all 2% |   Delphi_ProcedureForward: ("Procedure"|"Constructor"|"Destructor") Delphi_Variable [Delphi_Arguments] ';' [Delphi_Override]
3 all all |   |   Delphi_Override: "Override" ';'
20 all Delphi_Program: Delphi_Full_or_Partial
20 (65% | 35%) |   Delphi_Full_or_Partial: (Delphi_Full | Delphi_Partial)
13 all all all 12.38(all) 54% all all |   |   Delphi_Full: ("Program"|"Unit") Delphi_Program_Definition ';' [Delphi_Header]* [Delphi_BeginEnd] ["End"] '.'
7 5.86 |   |   Delphi_Partial: Delphi_Header*
329 (1% | 4% | 19% | 4% | 4% | 4% | 29% | 27% | 5% | 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,498 (0% | 37% | 12% | 0% | 0% | 0% | 5% | 0% | 13% | 1% | 0% | 1% | 1% | 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)
322 none all 3.20(79%) none 91% 1.71(2%) Delphi_Statement_List: [Delphi_Comment]* Delphi_Statement [Delphi_MoreStatements]* [Delphi_Comment]* [';'] [Delphi_Comment]*
812 all 1.07(8%) all 1.00(0%) |   Delphi_MoreStatements: ';' [Delphi_Comment]* Delphi_Statement [Delphi_Comment]*
684 (2% | 0% | 1% | 2% | 0% | 38% | 57% | 1%) Delphi_Type: (Delphi_Array | Delphi_Enum | Delphi_Range | Delphi_String | Delphi_Type_Record | ("Boolean"|"Integer"|"LongInt"|"Int64"|"Text") | Delphi_Identifier_Reference | Delphi_Class)
12 all 75% all all |   Delphi_Array: "Array" [Delphi_ArraySize] "Of" Delphi_Type
9 all 1.22 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
11 all all all all |   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 ';'
13 all 1.46(all) Delphi_Types: "Type" [Delphi_MoreTypes]*
19 all all all all |   Delphi_MoreTypes: Delphi_Type_Definition '=' Delphi_Type ';'
12 all 13.50 all Delphi_Uses: "Uses" Delphi_Identifier_Reference* ';'
2,904 all 1.27(23%) Delphi_Variable: Delphi_Identifier_Reference [Delphi_Extended_Variable]*
858 (72% | 28%) |   Delphi_Extended_Variable: (Delphi_DotName | Delphi_Subscript)
617 all all |   |   Delphi_DotName: '.' Delphi_Identifier_Reference
241 all 1.01 all |   |   Delphi_Subscript: '[' Delphi_Expression* ']'
97 all 2.88 Delphi_Vars: "Var" Delphi_Var*
279 1.14 all all all 1.00(6%) |   Delphi_Var: Delphi_Variable_Definition* ':' Delphi_Type ';' [Delphi_Comment]*
554 all all all all Delphi_Assignment: Delphi_Variable ":=" Delphi_Expression [Delphi_Comment]
288 all 1.00(18%) 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 ';'
7 all 71% Delphi_Close_Statement: "Close" [Delphi_CloseParams]
5 all all all |   Delphi_CloseParams: '(' Delphi_Identifier_Reference ')'
68 all all all all all all all 1.00(4%) all Delphi_For_Statement: "For" Delphi_Identifier_Reference ":=" Delphi_Expression ("To"|"DownTo") Delphi_Expression "Do" [Delphi_Comment]* Delphi_Statement
6 all Delphi_Halt_Statement: "Halt"
195 all all 1.00(1%) all 1.00(5%) 99% 33% Delphi_If_Statement: "If" Delphi_Expression [Delphi_Comment]* "Then" [Delphi_Comment]* [Delphi_Statement] [Delphi_If_Else]
64 1.00(2%) all all |   Delphi_If_Else: [Delphi_Comment]* "Else" Delphi_Statement
8 all 63% 25% Delphi_Inherited_Statement: "Inherited" [Delphi_Variable] [Delphi_Parameter_List]
265 all Delphi_Procedure_Call: Delphi_Expression
3 all all Delphi_Raise_Statement: "Raise" Delphi_Expression
18 all 78% Delphi_Readln_Statement: "ReadLn" [Delphi_Readln_What]
14 (50% | 50%) |   Delphi_Readln_What: (Delphi_Readln_FromFile | Delphi_Readln_NoFile)
7 all all all all all |   |   Delphi_Readln_FromFile: '(' Delphi_Identifier_Reference ',' Delphi_Identifier_Reference ')'
7 all all all |   |   Delphi_Readln_NoFile: '(' Delphi_Identifier_Reference ')'
10 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"
30 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
125 all 90% Delphi_Writeln_Statement: ("Write"|"WriteLn") [Delphi_WriteLn_Something]
113 all 3.27(99%) all |   Delphi_WriteLn_Something: '(' [Delphi_WriteLn_Piece]* ')'
239 all 1% 0% |   |   Delphi_WriteLn_Piece: Delphi_Expression [Delphi_Writeln_ColonWidth] [Delphi_Writeln_ColonWidth]
4 all all |   |   |   Delphi_Writeln_ColonWidth: ':' Delphi_Expression

Terminals = 11 (instances=6,533)
Tokens = 97 (instances=19,110)

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