Eagle Legacy Modernization, LLC

Natural Grammar

Main program: Natural_Program

 Count  Terminals:
348 Natural_Comment: Comment
51 Natural_DataType: Natural data type, such as A21 or N2.
448 Natural_Data_Definition: An identifier
28 Natural_EditMask: An edit mask, such as (EM=YYYY-MM-DD)
888 Natural_Identifier_Reference: An identifier
448 Natural_Level: Natural DDM level number.
300 Natural_Literal_Quotes: A string enclosed in quotes
388 Natural_Number: A number
60 Natural_Tab: A tab, such as 23T
 Count  Statistics(*) Tokens:
127 all 66% 1.23(10%) Natural_Condition: Natural_Condition_Base [Natural_OperatorExpression] [Natural_AndOr]*
16 6% all all |   Natural_AndOr: [Natural_Comment] ("AND"|"OR") Natural_ConditionClause
16 69% all |   Natural_ConditionClause: [Natural_Condition_Base] Natural_OperatorExpression
138 (2% | 98%) |   Natural_Condition_Base: (Natural_NotCondition | Natural_Expression)
3 all all all all |   |   Natural_NotCondition: "NOT" '(' Natural_Condition ')'
100 all all 4% |   Natural_OperatorExpression: Natural_Relational_Operator Natural_Expression [Natural_ThruCondition]
1 all all all |   |   Natural_ButNotCondition: "BUT" "NOT" Natural_Expression
100 (none | 1% | 2% | 93% | 4%) |   |   Natural_Relational_Operator: (Natural_Greater_Than | Natural_Less_Than | Natural_Not_Equals | (">="|"<="|"<"|">"|"=") | ("GT"|"LT"|"NE"))
    |   |   |   Natural_Greater_Than: "GREATER" "THAN"
1 all all |   |   |   Natural_Less_Than: "LESS" "THAN"
2 all all |   |   |   Natural_Not_Equals: "NOT" '='
4 all all 25% |   |   Natural_ThruCondition: "THRU" Natural_Expression [Natural_ButNotCondition]
601 (46% | 17% | 2% | none | 35% | none | none | 0% | 0%) Natural_Expression: (Natural_Number | Natural_LiteralExpression | Natural_System_Variable | Natural_NegativeExpression | Natural_VariableExpression | Natural_Function_Call | Natural_ParenthesizedExpression | Natural_MultiplicativeExpression | Natural_AdditiveExpression)
2 all all all |   Natural_AdditiveExpression: Natural_Expression ("+"|"-") Natural_Expression
    |   Natural_Function_Call: Natural_FunctionCall
101 all |   Natural_LiteralExpression: Natural_Literal
2 all all all |   Natural_MultiplicativeExpression: Natural_Expression ("*"|"/") Natural_Expression
    |   Natural_NegativeExpression: ("+"|"-") Natural_Expression
    |   Natural_ParenthesizedExpression: '(' Natural_Expression ')'
10 all |   Natural_System_Variable: Natural_SystemVariable
210 all |   Natural_VariableExpression: Natural_Variable
28 all all all all Natural_FunctionCall: ("AVER"|"COUNT"|"MAX"|"MIN"|"NAVER"|"NCOUNT"|"NMIN"|"OLD") '(' Natural_Expression ')'
58 all all Natural_Label: Natural_Identifier_Reference '.'
79 all 1.30 all Natural_Option: '(' Natural_OptionChoice* ')'
110 (8% | 18% | 1% | 22% | 3% | 2% | 2% | 1% | 2% | 1% | 13% | 3% | 1% | 2% | 6% | 1% | 4% | 2% | 1% | 2% | 5% | 3%) |   Natural_OptionChoice: (Natural_OptionAD | Natural_OptionAL | Natural_OptionDF | Natural_OptionEM | Natural_OptionES | Natural_OptionFC | Natural_OptionGC | Natural_OptionHC | Natural_OptionIC | Natural_OptionIP | Natural_OptionIS | Natural_OptionLC1 | Natural_OptionLC2 | Natural_OptionLC3 | Natural_OptionNL | Natural_OptionPS | Natural_OptionSF | Natural_OptionTC1 | Natural_OptionTC2 | Natural_OptionTC3 | Natural_OptionUC | Natural_OptionZP)
9 all all all |   |   Natural_OptionAD: "AD" '=' Natural_Identifier_Reference
20 all all all |   |   Natural_OptionAL: "AL" '=' Natural_Number
1 all all all |   |   Natural_OptionDF: "DF" '=' ("L")
24 all all all |   |   Natural_OptionEM: "EM" '=' Natural_EditMask
3 all all all |   |   Natural_OptionES: "ES" '=' ("OFF")
2 all all all |   |   Natural_OptionFC: "FC" '=' ("*"|"-")
2 all all all |   |   Natural_OptionGC: "GC" '=' ("+"|"=")
1 all all all |   |   Natural_OptionHC: "HC" '=' ("L")
2 all all all |   |   Natural_OptionIC: "IC" '=' Natural_Literal
1 all all all |   |   Natural_OptionIP: "IP" '=' ("OFF")
14 all all all |   |   Natural_OptionIS: "IS" '=' ("ON"|"OFF")
3 all all all |   |   Natural_OptionLC1: "LC" '=' Natural_Literal
1 all all all |   |   Natural_OptionLC2: "LC" '=' ("<")
2 all all all |   |   Natural_OptionLC3: "LC" '=' ("USD")
7 all all all |   |   Natural_OptionNL: "NL" '=' Natural_Number
1 all all all |   |   Natural_OptionPS: "PS" '=' Natural_Number
4 all all all |   |   Natural_OptionSF: "SF" '=' Natural_Number
2 all all all |   |   Natural_OptionTC1: "TC" '=' Natural_Literal
1 all all all |   |   Natural_OptionTC2: "TC" '=' (">")
2 all all all |   |   Natural_OptionTC3: "TC" '=' Natural_EditMask
5 all all all |   |   Natural_OptionUC: "UC" '=' ("="|"%"|"-")
3 all all all |   |   Natural_OptionZP: "ZP" '=' ("ON")
74 6.50 all Natural_Program: Natural_Statement* ["END"]
778 (40% | 2% | 1% | 1% | 0% | 9% | 9% | 0% | 0% | 1% | 0% | 0% | 4% | 0% | 0% | 0% | 4% | 4% | 1% | 4% | 7% | 1% | 0% | 0% | 0% | 3% | 0% | 0% | 0% | 0% | 0% | 5%) Natural_Statement: (Natural_Comment | Natural_AtStatement | Natural_AcceptStatement | Natural_CompressStatement | Natural_ComputeStatement | Natural_DefineStatement | Natural_DisplayStatement | Natural_DivideStatement | Natural_DoStatement | Natural_EndStatement | Natural_EnterStatement | Natural_EscapeStatement | Natural_FindStatement | Natural_FormatStatement | Natural_GetStatement | Natural_HistogramStatement | Natural_IfStatement | Natural_LimitStatement | Natural_InputStatement | Natural_MoveStatement | Natural_ReadStatement | Natural_ReinputStatement | Natural_RejectStatement | Natural_ReleaseStatement | Natural_RepeatStatement | Natural_SkipStatement | Natural_SortStatement | Natural_StopStatement | Natural_StoreStatement | Natural_SuspendStatement | Natural_UpdateStatement | Natural_WriteStatement)
206 all all all Natural_Subscript: '(' Natural_Subscript_Contents ')'
206 (15% | 84% | 0%) |   Natural_Subscript_Contents: (Natural_Subscript_Contents_Label | Natural_Subscript_Contents_Normal | '*')
31 all |   |   Natural_Subscript_Contents_Label: Natural_Label
174 all 13% 15% |   |   Natural_Subscript_Contents_Normal: Natural_Expression [Natural_Subscript_Range] [Natural_Second_Subscript]
26 all all none |   |   |   Natural_Second_Subscript: ',' Natural_Expression [Natural_Subscript_Range]
23 all all |   |   |   Natural_Subscript_Range: ':' Natural_Expression
51 all all 16% Natural_SystemVariable: '*' Natural_Identifier_Reference [Natural_Subscript]
578 (1% | 99%) Natural_Variable: (Natural_BuiltinVariable | Natural_UserVariable)
3 all all |   Natural_BuiltinVariable: ['*'] ("PAGE-NUMBER")
575 all 1.00(2%) 24% |   Natural_UserVariable: Natural_Identifier_Reference [Natural_Field]* [Natural_Subscript]
14 all all |   |   Natural_Field: '.' Natural_Identifier_Reference
4 all all all Natural_AcceptStatement: "ACCEPT" "IF" Natural_Condition
18 all all Natural_AtStatement: "AT" Natural_AtWhat
18 (33% | 28% | 17% | 22%) |   Natural_AtWhat: (Natural_AtBreakOfVariable | Natural_AtEndOfData | Natural_AtEndOfPage | Natural_AtStartOfData)
6 all all all 1.33 all |   |   Natural_AtBreakOfVariable: "BREAK" ["OF"] Natural_Variable Natural_Statement* "END-BREAK"
5 all all all 1.20 all |   |   Natural_AtEndOfData: "END" ["OF"] "DATA" Natural_Statement* ["END-ENDDATA"]
3 all all all 1.00 all |   |   Natural_AtEndOfPage: "END" ["OF"] "PAGE" Natural_Statement* "END-ENDPAGE"
4 all all all 1.00 all |   |   Natural_AtStartOfData: "START" ["OF"] "DATA" Natural_Statement* "END-START"
7 all 2.43 all all Natural_CompressStatement: "COMPRESS" Natural_Expression* "INTO" Natural_Variable
2 all all all all Natural_ComputeStatement: "COMPUTE" Natural_Variable '=' Natural_Expression
72 all all all 6.22 all Natural_DefineStatement: "DEFINE" "DATA" "LOCAL" Natural_DataLine* "END-DEFINE"
448 2% all all all 19% 11% 14% 0% |   Natural_DataLine: [Natural_Comment] Natural_Level ["REDEFINE"] Natural_Data_Definition [Natural_DataView] [Natural_DataDeclaration] [Natural_Subscript] [Natural_DataInitialization]
51 all all all |   |   Natural_DataDeclaration: '(' Natural_DataType ')'
2 all all all all |   |   Natural_DataInitialization: "INIT" '<' Natural_Literal '>'
84 all all all |   |   Natural_DataView: "VIEW" "OF" Natural_Identifier_Reference
72 all all 4% 5.53 Natural_DisplayStatement: "DISPLAY" ["NOTITLE"] [Natural_DisplayFunctions] Natural_DisplayElement*
864 (20% | 0% | 0% | 0% | 1% | 0% | 0% | 9% | 15% | 7% | 34% | 3% | 5% | 1% | 3% | 0%) |   Natural_DisplayElement: (Natural_Display_Literal | Natural_FieldAndLinePositioning | Natural_FieldPositioning | Natural_Justified | Natural_Relative_Positioning | Natural_Vertical | Natural_VerticalCaptioned | Natural_Option | '/' | Natural_Tab | Natural_Variable | Natural_Comment | Natural_SystemVariable | ("HORIZ"|"UNDERLINED"|"TRAILER") | Natural_FunctionCall | Natural_DisplayParameter)
172 all 2% |   |   Natural_Display_Literal: Natural_Literal [Natural_LiteralCount]
4 all all all |   |   |   Natural_LiteralCount: '(' Natural_Number ')'
4 all all all |   |   Natural_FieldAndLinePositioning: "P" '*' Natural_Variable
4 all all all |   |   Natural_FieldPositioning: "T" '*' Natural_Variable
4 all all |   |   Natural_Justified: "LEFT" ["JUSTIFIED"]
5 all all all |   |   Natural_Relative_Positioning: Natural_Number '/' Natural_Number
3 all all all |   |   Natural_Vertical: "VERT" ["AS"] Natural_Literal
1 all all all |   |   Natural_VerticalCaptioned: "VERT" ["AS"] "CAPTIONED"
3 all all all all |   Natural_DisplayFunctions: ["AND"] ["GIVE"] ["SYSTEM"] "FUNCTIONS"
3 all all all |   Natural_DisplayParameter: '(' Natural_DisplayParameterContents ')'
3 (none | none | none | all | none) |   Natural_DisplayParameterContents: (NaturalDisplayParameterColorDefinition | NaturalDisplayParameterFieldRepresentation | NaturalDisplayParameterPrintMode | Natural_DisplayParametersAD | Natural_DisplayParametersCD)
    |   |   NaturalDisplayParameterColorDefinition: "CD" '=' Natural_DisplayParametersCD
    |   |   NaturalDisplayParameterFieldRepresentation: "AD" '=' Natural_DisplayParametersAD
    |   |   NaturalDisplayParameterPrintMode: "PM" '=' Natural_DisplayParametersPM
3 all |   Natural_DisplayParametersAD: ("B"|"C"|"D"|"I"|"N"|"U"|"V")
    |   Natural_DisplayParametersCD: ("BL"|"GR"|"NE"|"PI"|"RE"|"TU"|"YE")
    |   Natural_DisplayParametersPM: ("C"|"D"|"I"|"N")
1 all all all all all all Natural_DivideStatement: "DIVIDE" Natural_Variable "INTO" Natural_Variable "GIVING" Natural_Variable
1 all 2.00(all) all Natural_DoStatement: "DO" [Natural_Statement]* "DOEND"
4 all all all 4.50(50%) 25% Natural_EndStatement: "END" ["OF"] "TRANSACTION" [Natural_Variable]* [Natural_Literal]
2 all Natural_EnterStatement: "ENTER"
3 all all Natural_EscapeStatement: "ESCAPE" ("BOTTOM"|"TOP")
35 43% all all Natural_FindStatement: [Natural_Label] "FIND" Natural_FindType
35 (11% | 89%) |   Natural_FindType: (Natural_FindNoBlock | Natural_FindWithBlock)
4 all none all all 1.00 |   |   Natural_FindNoBlock: ("FIRST"|"NUMBER"|"UNIQUE") [Natural_Find_Number_Records] Natural_Identifier_Reference [("PHYSICAL"|"LOGICAL")] Natural_Find_Clause*
31 6% all all 1.29 2.03 all |   |   Natural_FindWithBlock: [Natural_Find_Number_Records] Natural_Identifier_Reference [("PHYSICAL"|"LOGICAL")] Natural_Find_Clause* Natural_Statement* "END-FIND"
36 all 3% all 3% |   Natural_Find_By_Condition: ("BY"|"WITH") [Natural_Find_With_Limit] Natural_Condition [Natural_Find_Retain]
1 all all all |   |   Natural_Find_Retain: "RETAIN" "AS" Natural_Literal
1 all all |   |   Natural_Find_With_Limit: "LIMIT" Natural_Find_Number_Records
    |   Natural_Find_By_ISN: "BY" Natural_Identifier_Reference
44 (82% | none | none | 2% | 5% | 11%) |   Natural_Find_Clause: (Natural_Find_By_Condition | Natural_Find_By_ISN | Natural_Find_From | Natural_Find_Coupled | Natural_Find_Sorted_By | Natural_Find_Where)
1 all all all all all all |   Natural_Find_Coupled: ("AND"|"OR") "COUPLED" ["TO"] ["FILE"] Natural_Identifier_Reference [Natural_Find_Coupled_Via]
1 all all all all all |   |   Natural_Find_Coupled_Via: "VIA" Natural_Identifier_Reference Natural_Find_Via_Equals ["TO"] Natural_Identifier_Reference
1 (all | none) |   |   |   Natural_Find_Via_Equals: ('=' | ("EQ"|"EQUAL"))
    |   Natural_Find_From: ["STARTING"] "FROM" Natural_Literal
3 all all all |   Natural_Find_Number_Records: '(' Natural_Number ')'
2 all all 1.50 |   Natural_Find_Sorted_By: ["SORTED"] "BY" Natural_Variable*
5 all all |   Natural_Find_Where: "WHERE" Natural_Condition
3 all 2.33 Natural_FormatStatement: "FORMAT" Natural_OptionChoice*
2 50% all all all 3.50 Natural_GetStatement: [Natural_Label] "GET" ["TRANSACTION"] ["DATA"] Natural_Expression*
1 all all all all all all 1.00 all Natural_HistogramStatement: "HISTOGRAM" Natural_Identifier_Reference Natural_Variable "STARTING" "FROM" Natural_Literal Natural_Statement* "END-HISTOGRAM"
29 all all 1.34 10% all Natural_IfStatement: "IF" Natural_IfWhat Natural_Statement* [Natural_ElseClause] ("END-IF"|"END-NOREC")
3 all 1.33 |   Natural_ElseClause: "ELSE" Natural_Statement*
29 (38% | 62%) |   Natural_IfWhat: (Natural_NoRecordsFound | Natural_Condition)
11 all all all |   Natural_NoRecordsFound: "NO" "RECORDS" "FOUND"
6 all all all 67% 24.33 Natural_InputStatement: "INPUT" ["NO"] ["ERASE"] [Natural_Option] Natural_DisplayElement*
35 all all Natural_LimitStatement: "LIMIT" Natural_Number
28 all all all all 1.11 7% Natural_MoveStatement: "MOVE" ["EDITED"] Natural_Expression "TO" Natural_Variable* [Natural_MoveMask]
2 all all all all all |   Natural_MoveMask: '(' "EM" '=' Natural_EditMask ')'
54 13% all 35% all 9% 1.63(94%) 2.21(98%) all Natural_ReadStatement: [Natural_Label] "READ" [Natural_Read_Number_Records] Natural_Identifier_Reference [Natural_PhysicalLogical] [Natural_ReadClause]* [Natural_Statement]* [("END-READ"|"END-ALL")]
5 all all all |   Natural_PhysicalLogical: ["IN"] ("PHYSICAL"|"LOGICAL") ["SEQUENCE"]
83 (52% | 27% | 11% | 2% | 8%) |   Natural_ReadClause: (Natural_Read_By | Natural_Read_Starting | Natural_Read_Where | Natural_Read_Ending | Natural_Read_With)
43 all all |   Natural_Read_By: "BY" Natural_Condition
2 all all all |   Natural_Read_Ending: "ENDING" "AT" Natural_Expression
19 all all all |   Natural_Read_Number_Records: '(' Natural_Number ')'
22 all all all |   Natural_Read_Starting: ["STARTING"] "FROM" Natural_Expression
9 all all |   Natural_Read_Where: "WHERE" Natural_Condition
7 all all |   Natural_Read_With: "WITH" Natural_Condition
10 all all all all 90% 30% Natural_ReinputStatement: "REINPUT" ["WITH"] ["TEXT"] Natural_Literal [Natural_Reinput_Mark] [Natural_Reinput_Alarm]
3 all all all |   Natural_Reinput_Alarm: ["AND"] ["SOUND"] "ALARM"
9 all all |   Natural_Reinput_Mark: "MARK" Natural_Number
2 all all all Natural_RejectStatement: "REJECT" "IF" Natural_Condition
1 all all all Natural_ReleaseStatement: "RELEASE" "SET" Natural_Literal
2 all 23.00 all Natural_RepeatStatement: "REPEAT" Natural_Statement* "END-REPEAT"
24 all all Natural_SkipStatement: "SKIP" Natural_Expression
1 all all all 1.00 all 4.00 all Natural_SortStatement: "SORT" [("THEM"|"RECORDS")] ["BY"] Natural_SortBy* Natural_SortUsing Natural_Statement* ["END-SORT"]
1 all all |   Natural_SortBy: Natural_Identifier_Reference [("ASC"|"DESC"|"ASCENDING"|"DESCENDING")]
1 all all 2.00(all) |   Natural_SortUsing: "USING" ["KEYS"] [Natural_SortUsingVar]*
2 all 50% |   |   Natural_SortUsingVar: Natural_Identifier_Reference [Natural_Subscript]
3 all Natural_StopStatement: "STOP"
1 all all all all all all Natural_StoreStatement: [Natural_Label] "STORE" ["RECORD"] ["IN"] ["FILE"] Natural_Identifier_Reference
3 all all all Natural_SuspendStatement: "SUSPEND" "IDENTICAL" "SUPPRESS"
3 all all all all Natural_UpdateStatement: "UPDATE" '(' Natural_Label ')'
39 all all 8.21 Natural_WriteStatement: "WRITE" [("TITLE"|"NOTITLE")] Natural_DisplayElement*
299 all 1.00(0%) Natural_Literal: Natural_Literal_Quotes [Natural_Literal_Continuation]*
1 all all |   Natural_Literal_Continuation: '-' Natural_Literal_Quotes

Terminals = 9 (instances=2,959)
Tokens = 152 (instances=7,436)

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