Eagle Legacy Modernization, LLC

AWK Grammar

Main program: AWK_Program

 Count  Terminals:
16 AWK_Comment: Comment
1,148 AWK_EndOfLine: End of line
981 AWK_Identifier_Reference: An identifier
618 AWK_Literal: A string enclosed in quotes
313 AWK_Number: A number
218 AWK_Pattern: A string enclosed in quotes
 Count  Statistics(*) Tokens:
207 all 4.73(all) all 100% AWK_Action: '{' [AWK_StatementOrComment]* '}' [AWK_EndOfLine]
980 (78% | 0% | 21%) |   AWK_StatementOrComment: (AWK_Statements | AWK_Comment | AWK_EndOfLine)
509 2.57 AWK_ArgumentList: AWK_Expression*
186 1.00(92%) all AWK_Command: [AWK_Condition]* AWK_Action
172 (39% | 61%) AWK_Condition: (("BEGIN"|"END") | AWK_Expression)
2,567 (12% | 5% | 8% | none | none | 1% | 0% | 50% | 0% | 0% | none | 3% | 1% | 3% | 2% | none | 0% | 2% | 11%) AWK_Expression: (AWK_Number | AWK_FunctionCall | AWK_PatternExpression | AWK_PreIncrementExpression | AWK_PreDecrementExpression | AWK_PostIncrementExpression | AWK_PostDecrementExpression | AWK_Strings | AWK_NotExpression | AWK_ParenthesizedExpression | AWK_DollarParensExpression | AWK_SubscriptExpression | AWK_MultiplicativeExpression | AWK_AdditiveExpression | AWK_RelationalExpression | AWK_RegularExpression | AWK_AndExpression | AWK_OrExpression | AWK_Assignment)
86 all all all |   AWK_AdditiveExpression: AWK_Expression ("+"|"-") AWK_Expression
11 all all all |   AWK_AndExpression: AWK_Expression "&&" AWK_Expression
287 all all all |   AWK_Assignment: AWK_Expression ("="|"+=") AWK_Expression
    |   AWK_DollarParensExpression: '$' '(' AWK_Expression ')'
135 all all all all |   AWK_FunctionCall: ("getline"|"index"|"length"|"match"|"sprintf"|"strftime"|"substr") '(' [AWK_ArgumentList] ')'
25 all all all |   AWK_MultiplicativeExpression: AWK_Expression ("*"|"/"|"%") AWK_Expression
9 all all |   AWK_NotExpression: '!' AWK_Expression
49 all all all |   AWK_OrExpression: AWK_Expression "||" AWK_Expression
11 all all all |   AWK_ParenthesizedExpression: '(' AWK_Expression ')'
218 all |   AWK_PatternExpression: AWK_Pattern
1 all all |   AWK_PostDecrementExpression: AWK_Variable "--"
26 all all |   AWK_PostIncrementExpression: AWK_Variable "++"
    |   AWK_PreDecrementExpression: "--" AWK_Expression
    |   AWK_PreIncrementExpression: "++" AWK_Expression
    |   AWK_RegularExpression: AWK_Expression ("~"|"!~") AWK_Expression
39 all all all |   AWK_RelationalExpression: AWK_Expression ("=="|"!="|"<"|">"|"<="|">=") AWK_Expression
1,273 1.23 |   AWK_Strings: AWK_StringPiece*
1,572 (39% | 61%) |   |   AWK_StringPiece: (AWK_Literal | AWK_Identifier_Reference)
84 all all all all |   AWK_SubscriptExpression: AWK_Expression '[' AWK_Expression ']'
56 3.64 AWK_Program: AWK_Element*
204 (91% | 4% | 4%) |   AWK_Element: (AWK_Command | AWK_Comment | AWK_EndOfLine)
768 1.00 93% 1.00(1%) 94% AWK_Statements: AWK_Statement* [';'] [AWK_Comment]* [AWK_EndOfLine]
779 (none | 0% | 3% | 3% | 40% | 1% | 9% | 0% | 44%) |   AWK_Statement: (';' | AWK_ForStatement | AWK_IfStatement | AWK_NextStatement | AWK_PrintStatement | AWK_SplitStatement | AWK_SubStatement | AWK_WhileStatement | AWK_Expression)
27 all none AWK_Variable: AWK_Identifier_Reference [AWK_VarSubscript]
    |   AWK_VarSubscript: '[' AWK_Expression ']'
1 all all all all all all all all all AWK_ForStatement: "for" '(' AWK_Expression ';' AWK_Expression ';' AWK_Expression ')' AWK_ForBlock
1 (none | all) |   AWK_ForBlock: (AWK_Statement | AWK_Action)
27 all all all all all 11% AWK_IfStatement: "if" '(' AWK_Expression ')' AWK_IfBlock [AWK_IfElse]
30 (37% | 63%) |   AWK_IfBlock: (AWK_Statement | AWK_Action)
3 all all |   AWK_IfElse: "else" AWK_IfBlock
23 all AWK_NextStatement: "next"
311 all all AWK_PrintStatement: ("print"|"printf") AWK_PrintParameters
311 (78% | 22%) |   AWK_PrintParameters: (AWK_Print_NoParens | AWK_Print_WithParens)
243 95% |   |   AWK_Print_NoParens: [AWK_ArgumentList]
68 all all all |   |   AWK_Print_WithParens: '(' [AWK_ArgumentList] ')'
4 all all all all AWK_SplitStatement: ("split") '(' AWK_ArgumentList ')'
71 all all all all AWK_SubStatement: ("gsub"|"sub") '(' AWK_ArgumentList ')'
1 all all all all all AWK_WhileStatement: "while" '(' AWK_Expression ')' AWK_WhileBlock
1 (none | all) |   AWK_WhileBlock: (AWK_Statement | AWK_Action)

Terminals = 6 (instances=3,294)
Tokens = 45 (instances=11,376)

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