Eagle Legacy Modernization, LLC

Perl Grammar

Main program: Perl_Program

 Count  Terminals:
9 Perl_Class_Definition: An identifier
6,508 Perl_Comment: Comment
362 Perl_Function_Definition: An identifier
  Perl_HexNumber: A hex number
23,904 Perl_Identifier_Reference: An identifier
7 Perl_Label_Definition: An identifier
19,921 Perl_Literal: A string enclosed in quotes
1,287 Perl_Number: A number
1 Perl_OctalNumber: A octal number
  Perl_Package_Definition: An identifier
  Perl_RegularCondition: A regular expression
  Perl_RegularSubstitution: A regular expression
  Perl_RegularTranslation: A regular expression
740 Perl_Variable_Definition: An identifier
 Count  Statistics(*) Tokens:
33 all none 2.87(45%) 9% none Perl_ArgumentList: Perl_Expression [Perl_Comment]* [Perl_MoreArguments]* [','] [Perl_Comment]*
43 all 1.00(9%) all 1.00(2%) |   Perl_MoreArguments: ',' [Perl_Comment]* Perl_Expression [Perl_Comment]*
59,244 (0% | none | 2% | 33% | 0% | 0% | 0% | none | 0% | none | none | 0% | 0% | none | none | 0% | none | 0% | none | none | 0% | none | 14% | 26% | none | 0% | 0% | 0% | none | none | none | 0% | 13% | none | 0% | 0% | 0% | 0% | none | 1% | none | 0% | 1% | 0% | none | none | 0% | 0% | 0% | 7%) Perl_Expression: (Perl_OctalNumber | Perl_HexNumber | Perl_Number | Perl_Literal | Perl_ClassCastExpression | Perl_Expression_List | Perl_ClassCreationExpression | Perl_CloneExpression | Perl_MethodInvocation | Perl_DollarEnvExpression | Perl_PreIncrementExpression | Perl_PreDecrementExpression | Perl_PostIncrementExpression | Perl_PostDecrementExpression | Perl_ExistsExpression | Perl_NegativeExpression | Perl_LogicalNotExpression | Perl_NotExpression | Perl_StarExpression | Perl_GrepExpression | Perl_BuiltIn | Perl_RegExExpression | Perl_FunctionCall | Perl_VariableExpression | Perl_ParenthesizedExpression | Perl_BracketedExpression | Perl_EachExpression | Perl_DieExpression | Perl_AddressOfExpression | Perl_FunctionExpression | Perl_FileIO | Perl_SubscriptExpression | Perl_DotExpression | Perl_ColonColonExpression | Perl_ArrowExpression | Perl_MapExpression | Perl_MultiplicativeExpression | Perl_AdditiveExpression | Perl_ShiftExpression | Perl_RelationalExpression | Perl_RegExTest | Perl_InstanceOfExpression | Perl_EqualityExpression | Perl_AndExpression | Perl_ExclusiveOrExpression | Perl_InclusiveOrExpression | Perl_ConditionalAndExpression | Perl_ConditionalOrExpression | Perl_TrueFalseExpression | Perl_AssignmentExpression)
257 all all all |   Perl_AdditiveExpression: Perl_Expression ("+"|"-") Perl_Expression
    |   Perl_AddressOfExpression: '\' Perl_Expression
90 all all all |   Perl_AndExpression: Perl_Expression '&' Perl_Expression
13 all all all |   Perl_ArrowExpression: Perl_Expression "->" Perl_Expression
4,352 all all all |   Perl_AssignmentExpression: Perl_Expression ("="|"*="|"/="|"%="|"+="|"-="|"<<="|">>="|">>>="|"&="|"^="|"|="|".=") Perl_Expression
4 all none 75% none none all |   Perl_BracketedExpression: '[' [Perl_Comment]* [Perl_ArgumentList] [','] [Perl_Comment]* ']'
260 all |   Perl_BuiltIn: ("FALSE"|"False"|"false"|"TRUE"|"True"|"true"|"NULL"|"null"|"T_CLASS"|"T_FUNCTION"|"T_INCLUDE"|"T_INCLUDE_ONCE"|"T_REQUIRE"|"T_REQUIRE_ONCE"|"T_USE"|"namespace"|"shift")
5 all all all all |   Perl_ClassCastExpression: '(' Perl_Variable ')' Perl_Expression
18 all all 1.00(all) all none 72% all |   Perl_ClassCreationExpression: "new" ['$'] [Perl_MoreNamespace]* '(' [Perl_Comment]* [Perl_ArgumentList] ')'
18 all all |   |   Perl_MoreNamespace: ['\'] Perl_Identifier_Reference
    |   Perl_CloneExpression: "clone" Perl_Expression
    |   Perl_ColonColonExpression: Perl_Expression "::" Perl_Expression
141 all all all |   Perl_ConditionalAndExpression: Perl_Expression Perl_AndOperator Perl_Expression
141 (12% | 88%) |   |   Perl_AndOperator: ("&&" | "and")
97 all all all |   Perl_ConditionalOrExpression: Perl_Expression Perl_OrOperator Perl_Expression
97 (59% | 41%) |   |   Perl_OrOperator: ("||" | "or")
9 all all |   Perl_DieExpression: "die" Perl_Expression
    |   Perl_DollarEnvExpression: '$' "ENV" '{' Perl_Literal '}'
7,505 all all all |   Perl_DotExpression: Perl_Expression '.' Perl_Expression
3 all all all all |   Perl_EachExpression: "each" '(' Perl_Variable ')'
830 all all all |   Perl_EqualityExpression: Perl_Expression Perl_EqualityOperator Perl_Expression
830 (none | all) |   |   Perl_EqualityOperator: (("eq"|"ne") | ("==="|"!=="|"=="|"!="))
    |   Perl_ExclusiveOrExpression: Perl_Expression '^' Perl_Expression
    |   Perl_ExistsExpression: '-' ("e"|"x") Perl_Expression
2 all |   Perl_Expression_List: Perl_ExpressionList
    |   Perl_FileIO: '<' [Perl_Identifier_Reference] '>'
8,032 all 1.00(0%) none all all 95% 1.50(47%) all |   Perl_FunctionCall: Perl_Identifier_Reference [Perl_MoreFunctionName]* [Perl_Method]* '(' ['@'] [Perl_Expression] [Perl_MoreParameters]* ')'
    |   |   Perl_Method: "::" Perl_Identifier_Reference
1 all all |   |   Perl_MoreFunctionName: '\' Perl_Identifier_Reference
5,656 all all all all |   |   Perl_MoreParameters: ',' [Perl_Comment] ['@'] Perl_Expression
    |   Perl_FunctionExpression: "function" Perl_Function_Parameters [Perl_FunctionUse] Perl_FunctionBlock
    |   |   Perl_FunctionUse: "use" '(' '&' Perl_Variable ')'
    |   Perl_GrepExpression: "grep" Perl_RegularExpression ',' Perl_Expression
    |   Perl_InclusiveOrExpression: Perl_Expression '|' Perl_Expression
4 all all all all |   Perl_InstanceOfExpression: Perl_Expression "instanceof" ['\'] Perl_Identifier_Reference
    |   Perl_LogicalNotExpression: '~' Perl_Expression
73 all all all |   Perl_MapExpression: Perl_Expression "=>" Perl_Expression
15 all all all all |   Perl_MethodInvocation: Perl_Variable '(' [Perl_ArgumentList] ')'
148 all all all |   Perl_MultiplicativeExpression: Perl_Expression ("*"|"/"|"%") Perl_Expression
3 all all |   Perl_NegativeExpression: ("-"|"+") Perl_Expression
191 all all |   Perl_NotExpression: Perl_NotOperator Perl_Expression
191 (all | none) |   |   Perl_NotOperator: ('!' | "not")
    |   Perl_ParenthesizedExpression: '(' Perl_ArgumentList ')'
    |   Perl_PostDecrementExpression: Perl_Variable "--"
189 all all |   Perl_PostIncrementExpression: Perl_Variable "++"
8 all all |   Perl_PreDecrementExpression: "--" Perl_Variable
    |   Perl_PreIncrementExpression: "++" Perl_Variable
    |   Perl_RegExExpression: Perl_RegularExpression
    |   Perl_RegExTest: Perl_Expression ("=~"|"!~") Perl_RegularExpression
335 all all all |   Perl_RelationalExpression: Perl_Expression ("<="|">="|"<"|">") Perl_Expression
    |   Perl_ShiftExpression: Perl_Expression (">>"|">>>") Perl_Expression
    |   Perl_StarExpression: '*' Perl_Expression
20 all all all all |   Perl_SubscriptExpression: Perl_Expression '[' [Perl_Expression] ']'
55 all all all all all |   Perl_TrueFalseExpression: Perl_Expression '?' Perl_Expression ':' Perl_Expression
15,442 all |   Perl_VariableExpression: Perl_Variable
2 all none all all Perl_ExpressionList: '{' [Perl_Comment]* Perl_ArgumentList '}'
362 1.05(11%) all all all all Perl_FunctionDefinition: [Perl_FunctionPrefix]* "function" Perl_Function_Definition Perl_Function_Parameters Perl_FunctionBlock
362 (none | all) |   Perl_FunctionBlock: (';' | Perl_StatementBlock)
42 all |   Perl_FunctionPrefix: ("abstract"|"const"|"final"|"private"|"protected"|"public"|"static"|"var")
362 all 83% 2.20(43%) all |   Perl_Function_Parameters: '(' [Perl_FunctionVariableOrTypeVariable] [Perl_MoreFuncParameters]* ')'
648 all all 2% |   |   Perl_FunctionVariable: ['&'] Perl_Variable_Definition [Perl_Variable_Initializer]
14 all all |   |   |   Perl_Variable_Initializer: '=' Perl_Expression
648 (1% | 99%) |   |   Perl_FunctionVariableOrTypeVariable: (Perl_FunctionTypeAndVariable | Perl_FunctionVariable)
5 all all |   |   |   Perl_FunctionTypeAndVariable: Perl_Type Perl_FunctionVariable
346 all all |   |   Perl_MoreFuncParameters: ',' Perl_FunctionVariableOrTypeVariable
74 all all all all all Perl_Include: "include" '(' Perl_Literal ')' ';'
7 all all Perl_Label: Perl_Label_Definition ':'
    Perl_Program: Perl_StatementOrComment*
16,499 (10% | 59% | 19% | 10% | none | 0% | 2% | none | 0% | 0% | none) Perl_Statement: (Perl_CompundStatement | Perl_ExpressionStatement | Perl_SimpleStatement | Perl_StatementBlock | Perl_SubDeclaration | Perl_Include | Perl_FunctionDefinition | Perl_NamespaceStatement | Perl_ClassStatement | Perl_Label | ';')
1,571 (3% | 4% | 80% | 1% | none | 0% | 12%) |   Perl_CompundStatement: (Perl_ForStatement | Perl_ForEachStatement | Perl_IfStatement | Perl_SwitchStatement | Perl_TraitStatement | Perl_TryStatement | Perl_WhileStatement)
9,736 all none all |   Perl_ExpressionStatement: Perl_Expression [Perl_StatementSuffixModifier] ';'
    |   |   Perl_StatementSuffixModifier: ("if"|"unless"|"while") [Perl_MinusF] Perl_Expression
    |   |   |   Perl_MinusF: '-' ("d"|"f")
3,135 all none all |   Perl_SimpleStatement: Perl_StatementList [Perl_StatementSuffixModifier] ';'
3,135 (2% | none | none | none | 1% | none | 0% | 3% | 0% | 3% | 0% | none | none | none | 80% | 0% | 10% | none | 0% | none | 0% | 1%) |   |   Perl_StatementList: (Perl_BreakStatement | Perl_ChdirStatement | Perl_ChmodStatement | Perl_CloseStatement | Perl_ContinueStatement | Perl_DieStatement | Perl_DoStatement | Perl_EchoStatement | Perl_ExitStatement | Perl_GlobalStatement | Perl_IncludeStatement | Perl_MyStatement | Perl_NextStatement | Perl_PackageStatement | Perl_PrintStatement | Perl_RequireStatement | Perl_ReturnStatement | Perl_SleepStatement | Perl_ThrowStatement | Perl_UnlinkStatement | Perl_UseStatement | Perl_VarStatement)
15,256 (95% | 5%) |   |   Perl_StatementOrComment: (Perl_Statement | Perl_Comment)
1,967 all 3.79(100%) all |   Perl_StatementBlock: '{' [Perl_StatementOrComment]* '}'
    |   Perl_SubDeclaration: "sub" [Perl_SubMain] Perl_Function_Definition [Perl_Function_Parameters] Perl_StatementBlock
    |   |   Perl_SubMain: Perl_Identifier_Reference '''
3,172 all all all Perl_Subscript: '[' Perl_Expression ']'
5 (none | 40% | 60%) Perl_Type: (Perl_CompoundType | ("array"|"string") | Perl_Variable_Definition)
    |   Perl_CompoundType: '\' Perl_Variable_Definition [Perl_MoreTypeName]*
    |   |   Perl_MoreTypeName: '\' Perl_Variable_Definition
15,823 (1% | none | none | none | none | none | none | none | 0% | 0% | none | none | none | 98% | 1% | none) Perl_Variable: (Perl_AmpersandVariable | Perl_AtUnderscoreVariable | Perl_AtVariable | Perl_DollarBarVariable | Perl_DollarBraceVariable | Perl_DollarNumberVariable | Perl_DollarSignalVariable | Perl_DollarUnderscoreVariable | Perl_ListVariable | Perl_NamespaceVariable | Perl_PercentUTFVariable | Perl_PercentVariable | Perl_SpecialVariable | Perl_UserVariable | Perl_VarFunctionCall | Perl_Identifier_Reference)
90 all all |   Perl_AmpersandVariable: '&' Perl_Identifier_Reference
    |   Perl_AtUnderscoreVariable: '@' '_'
    |   Perl_AtVariable: '@' Perl_Identifier_Reference
    |   Perl_DollarBarVariable: '$' '|'
    |   Perl_DollarBraceVariable: '$' Perl_ExpressionList
    |   Perl_DollarNumberVariable: '$' Perl_Number
    |   Perl_DollarSignalVariable: '$' "SIG" '{' Perl_Expression '}'
    |   Perl_DollarUnderscoreVariable: '$' '_'
3 all all 3.00 all |   Perl_ListVariable: "list" '(' Perl_Expression* ')'
16 all none all all all none |   Perl_NamespaceVariable: Perl_Identifier_Reference [Perl_More_NamespaceVars]* "::" ['$'] Perl_Identifier_Reference [Perl_NamespaceArrow]
    |   |   Perl_More_NamespaceVars: '\' Perl_Identifier_Reference
    |   |   Perl_NamespaceArrow: "->" "new" [Perl_Subscript]*
    |   Perl_PercentUTFVariable: '%' "utf8" "::" Perl_Identifier_Reference
    |   Perl_PercentVariable: '%' Perl_Identifier_Reference
    |   Perl_SpecialVariable: '$' '^' ("O")
15,539 all 1.01(20%) 1% 0% none |   Perl_UserVariable: Perl_Identifier_Reference [Perl_Subscript]* [Perl_ClassField] [Perl_VarFunctionCall] [Perl_ExpressionList]
165 all all 1.04(14%) |   |   Perl_ClassField: "->" Perl_Identifier_Reference [Perl_Subscript]*
228 all 1.12(90%) all |   Perl_VarFunctionCall: '(' [Perl_Expression]* ')'
61 all none Perl_BreakStatement: "break" [Perl_Expression]
    Perl_ChdirStatement: "chdir" Perl_Expression
    Perl_ChmodStatement: "chmod" Perl_Expression ',' Perl_Expression
9 none all all 44% all 17.00(78%) all none Perl_ClassStatement: [Perl_ClassPrefix]* "class" Perl_Class_Definition [Perl_ClassExtends] '{' [Perl_StatementOrComment]* '}' [';']
4 all 1.00 |   Perl_ClassExtends: ("extends"|"implements") Perl_ExtendsName*
4 all all |   |   Perl_ExtendsName: ['\'] Perl_Identifier_Reference
    |   Perl_ClassPrefix: ("abstract"|"const"|"final"|"private"|"protected"|"public"|"static"|"var")
    Perl_CloseStatement: "close" Perl_Expression
28 all Perl_ContinueStatement: "continue"
    Perl_DieStatement: "die" Perl_Literal
1 all all all all Perl_DoStatement: "do" Perl_Statement "while" Perl_Expression
89 all 1.00 Perl_EchoStatement: "echo" Perl_Expression*
2 all Perl_ExitStatement: "exit"
56 (all | none) Perl_ForEachStatement: (Perl_ForEachAsStatement | Perl_ForEachNoAsStatement)
56 all all all all all all 23% all all |   Perl_ForEachAsStatement: "foreach" '(' Perl_Expression "as" '$' Perl_Variable_Definition [Perl_ForEachArrow] ')' Perl_Statement
13 all all |   |   Perl_ForEachArrow: "=>" Perl_Variable
    |   Perl_ForEachNoAsStatement: "foreach" [Perl_ForEachVariable] '(' Perl_Expression ')' Perl_Statement
    |   |   Perl_ForEachVariable: '$' Perl_Variable_Definition
50 all all all all all all all all all Perl_ForStatement: "for" '(' [Perl_Expression] [';'] [Perl_Expression] [';'] [Perl_Expression] ')' Perl_Statement
97 all 2.05 Perl_GlobalStatement: "global" Perl_Variable*
1,262 all all all none all 1.00(0%) all 1.91(6%) 1.29(1%) none 29% Perl_IfStatement: "if" '(' Perl_IfWhat [Perl_Comment]* ')' [Perl_Comment]* Perl_Statement [Perl_Comment]* [Perl_IfElseIfClause]* [Perl_Comment]* [Perl_IfElseClause]
360 all 1.00(1%) all |   Perl_IfElseClause: "else" [Perl_Comment]* Perl_Statement
9 all all all all none all |   Perl_IfElseIfClause: ("elseif"|"elsif") '(' Perl_Expression ')' [Perl_Comment]* Perl_Statement
1,262 (none | all) |   Perl_IfWhat: (Perl_IfExists | Perl_Expression)
    |   |   Perl_IfExists: '-' "f" Perl_Expression
1 all all Perl_IncludeStatement: "include" Perl_Literal
    Perl_MyStatement: "my" Perl_MyWhat [Perl_MyEquals]
    |   Perl_MyEquals: '=' Perl_Expression
    |   Perl_MyWhat: (Perl_MyMany | Perl_MyOne)
    |   |   Perl_MyMany: '(' Perl_Variable* ')'
    |   |   Perl_MyOne: Perl_Variable
    Perl_NamespaceStatement: "namespace" [Perl_Identifier_Reference] [Perl_MoreSpace]* Perl_NamespaceBody
    |   Perl_MoreSpace: '\' Perl_Identifier_Reference
    |   Perl_NamespaceBody: (';' | Perl_StatementBlock)
    Perl_NextStatement: "next"
    Perl_PackageStatement: "package" Perl_Package_Definition
2,494 all all none Perl_PrintStatement: ("print"|"printf") Perl_Expression [Perl_Literal]
7 all all Perl_RequireStatement: ("require"|"require_once") Perl_Expression
303 all 94% Perl_ReturnStatement: "return" [Perl_Expression]
    Perl_SleepStatement: "sleep" Perl_Expression
12 all all all all all 7.25 none all Perl_SwitchStatement: "switch" '(' Perl_Expression ')' '{' Perl_CaseClause* [Perl_DefaultClause] '}'
87 all all all 2.55(75%) |   Perl_CaseClause: "case" Perl_Expression ':' [Perl_StatementOrComment]*
    |   Perl_DefaultClause: "default" ':' Perl_StatementOrComment*
13 all all all Perl_ThrowStatement: "throw" ["new"] Perl_Expression
    Perl_TraitStatement: "trait" Perl_Class_Definition '{' [Perl_StatementOrComment]* '}'
1 all all 1.00 all none 1.00(all) none Perl_TryStatement: "try" '{' Perl_Statement* '}' [Perl_Comment]* [Perl_CatchBlock]* [Perl_FinallyBlock]
1 all all all all all all all all |   Perl_CatchBlock: "catch" '(' ['\'] Perl_Identifier_Reference ['$'] Perl_Variable_Definition ')' Perl_Statement
    |   Perl_FinallyBlock: "finally" Perl_Statement
    Perl_UnlinkStatement: "unlink" Perl_Expression
7 all all Perl_UseStatement: "use" Perl_UseWhat
7 (all | none) |   Perl_UseWhat: (Perl_UseLocal | Perl_UseRemote)
7 all all 1.57(all) |   |   Perl_UseLocal: ['\'] Perl_Identifier_Reference [Perl_MoreUse]*
11 all all |   |   |   Perl_MoreUse: '\' Perl_Identifier_Reference
    |   |   Perl_UseRemote: ("Getopt"|"IPC"|"Net"|"Win32") ["::"] [Perl_Identifier_Reference]
32 1.00 all all 50% Perl_VarStatement: Perl_VarPrefix* ['$'] Perl_Variable_Definition [Perl_Variable_Init]
32 (all) |   Perl_VarPrefix: (("abstract"|"const"|"final"|"private"|"protected"|"public"|"static"|"var"))
16 all all |   Perl_Variable_Init: '=' Perl_Expression
190 all all all all 1.00(1%) all Perl_WhileStatement: "while" '(' Perl_Expression ')' [Perl_Comment]* Perl_Statement
    Perl_RegularExpression: (Perl_RegularCondition | Perl_RegularSubstitution | Perl_RegularTranslation)

Terminals = 14 (instances=52,739)
Tokens = 164 (instances=200,151)

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