Eagle Legacy Modernization, LLC

RPG Grammar

Main programs: RPG_III_Program RPG_IV_Program

 Count  Terminals:
274 RPG_Blanks: A character string
237 RPG_Comment: Comment
673 RPG_EndOfLine: End of line
3,787 RPG_Literal: A character string
922 RPG_Number: A number
 Count  Statistics(*) Tokens:
    RPG_Copy_Directive: "/COPY" RPG_Literal
    RPG_Eject_Directive: "/EJECT"
    RPG_Space_Directive: "/SPACE" RPG_Number
    RPG_Title_Directive: "/TITLE" RPG_Literal
1 63.00 |   RPG_III_Program: RPG_Item*
3 203.33 |   RPG_IV_Program: RPG_Item*
673 all all |   RPG_Item: [RPG_Spec_or_Directive] RPG_EndOfLine
673 (35% | none | none | none | none | none | none | none | none | none | none | 1% | none | none) |   RPG_Spec_or_Directive: (RPG_Comment | RPG_Title_Directive | RPG_Eject_Directive | RPG_Space_Directive | RPG_Copy_Directive | RPG_D_Data_Specification | RPG_U_AutoReport_Specification | RPG_H_Header_Specification | RPG_F_File_Specification | RPG_E_Extension_Specification | RPG_L_LineCounter_Specification | RPG_I_Input_Specification | RPG_C_Calculation_Specification | RPG_O_Output_Specification)
3 all all all all all all all all all all all all all all all all all all all |   RPG_C_Calculation_Specification_III: "C" [RPG_Literal] ["N"] [RPG_Literal] ["N"] [RPG_Literal] ["N"] [RPG_Literal] [RPG_Literal] [RPG_Literal] [RPG_Literal] [RPG_Literal] [RPG_Number] [RPG_Number] [("H"|"N"|"P")] [RPG_Literal] [RPG_Literal] [RPG_Literal] [RPG_Literal]
    |   RPG_D_Data_Specification_III: "D" [RPG_Literal] [""] [RPG_KeywordChoice] [RPG_KeywordChoice] [RPG_Number] [RPG_Number] [RPG_KeywordChoice] [RPG_Number] RPG_Blanks [RPG_Literal]
    RPG_E_Extension_Specification: "E" RPG_Blanks [RPG_Literal] [RPG_Literal] RPG_Literal RPG_Number RPG_Number [("P"|"B"|"L"|"R")] [RPG_Number] [("A"|"D")] RPG_Literal RPG_Number [("P"|"B"|"L"|"R")] [RPG_Number] [("A"|"D")] [RPG_Literal]
2 all all all all all all all all all all all all all all all all all all all all all all all all all |   RPG_F_File_Specification_III: "F" [RPG_Literal] [("I"|"O"|"U"|"C")] [("P"|"S"|"R"|"T"|"F")] ["E"] [("A"|"D")] [("F"|"E")] RPG_Blanks [RPG_Number] ["L"] [RPG_Number] [("A"|"P"|"K")] [("I"|"T")] [RPG_Literal] [RPG_Number] [("E"|"L")] [("PRINTER"|"DISK"|"WORKSTN"|"SPECIAL"|"SEQ")] RPG_Blanks ["K"] [RPG_Literal] RPG_Blanks ["A"] RPG_Blanks [RPG_Literal] RPG_Blanks
    |   RPG_H_Header_Specification_III: "H" ["1"] [RPG_Literal] [("M"|"D"|"Y")] [RPG_Literal] [("I"|"J"|"D")] ["S"] ["1"] ["F"] ["1"] [RPG_Literal]
9 (none | 11% | 67% | none | none | none | 11% | 11%) RPG_I_Input_Specification: (RPG_I_Input_Constant_Continued | RPG_I_Input_Data_Structure | RPG_I_Input_Data_Subfield | RPG_I_Input_External_Field_Descr | RPG_I_Input_External_Record_Id | RPG_I_Input_Named_Constant | RPG_I_Input_Program_Field_Descr | RPG_I_Input_Program_Record_Id)
    |   RPG_I_Input_Constant_Continued: "I" RPG_Blanks RPG_Literal RPG_Blanks
1 all all all all all all all all all all all |   RPG_I_Input_Data_Structure: "I" RPG_Literal RPG_Blanks ["E"] [("I"|"S"|"U")] ["DS"] RPG_Literal RPG_Blanks [RPG_Number] [RPG_Number] RPG_Blanks
6 all all all all all all all all |   RPG_I_Input_Data_Subfield: "I" RPG_Blanks RPG_I_Input_Data_Subfield_Init [("P"|"B")] RPG_I_Input_Data_Subfield_Position [RPG_Number] RPG_Literal RPG_Blanks
6 (all | none) |   |   RPG_I_Input_Data_Subfield_Init: (RPG_I_Input_Data_Subfield_Init1 | RPG_I_Input_Data_Subfield_Init2)
6 all all all |   |   |   RPG_I_Input_Data_Subfield_Init1: ["I"] RPG_Blanks RPG_Literal
    |   |   |   RPG_I_Input_Data_Subfield_Init2: RPG_Blanks RPG_Literal RPG_Blanks
6 (all | none) |   |   RPG_I_Input_Data_Subfield_Position: (RPG_I_Input_Data_Subfield_Position1 | RPG_I_Input_Data_Subfield_Position2)
6 all all |   |   |   RPG_I_Input_Data_Subfield_Position1: RPG_Number RPG_Number
    |   |   |   RPG_I_Input_Data_Subfield_Position2: ("*STATUS"|"*PROGRAM"|"*PARMS"|"*ROUTINE"|"*FILE"|"*RECORD"|"*OPCODE"|"*STATUS")
    |   RPG_I_Input_External_Field_Descr: "I" RPG_Blanks RPG_Literal RPG_Blanks RPG_Literal [RPG_Literal] [RPG_Literal] RPG_Blanks [RPG_Literal] RPG_Blanks
    |   RPG_I_Input_External_Record_Id: "I" RPG_Literal RPG_Blanks [RPG_Literal] RPG_Blanks RPG_Blanks
    |   RPG_I_Input_Named_Constant: "I" RPG_Blanks RPG_Literal ["C"] RPG_Blanks RPG_Literal RPG_Blanks
1 all all all all all all all all all all all all |   RPG_I_Input_Program_Field_Descr: "I" RPG_Blanks [("P"|"B"|"L"|"R")] RPG_Number RPG_Number [RPG_Number] RPG_Literal [RPG_Literal] [RPG_Literal] [RPG_Literal] [RPG_Literal] RPG_Blanks
1 all all all all all all all all all all all all all all all all all all |   RPG_I_Input_Program_Record_Id: "I" RPG_I_Input_Program_Record_Id_Piece [("1"|"N")] ["O"] RPG_Literal [RPG_Number] ["N"] [("C"|"Z"|"D")] [RPG_Literal] [RPG_Number] ["N"] [("C"|"Z"|"D")] [RPG_Literal] [RPG_Number] ["N"] [("C"|"Z"|"D")] [RPG_Literal] RPG_Blanks
1 (all | none) |   |   RPG_I_Input_Program_Record_Id_Piece: (RPG_I_Input_Program_Record_Id_Piece1 | RPG_I_Input_Program_Record_Id_Piece2)
1 all all |   |   |   RPG_I_Input_Program_Record_Id_Piece1: RPG_Literal RPG_Literal
    |   |   |   RPG_I_Input_Program_Record_Id_Piece2: RPG_Blanks ("AND"|"OR")
    RPG_L_LineCounter_Specification: "L" RPG_Literal RPG_Number ["FL"] RPG_Number ["OL"] RPG_Blanks
42 (none | none | none | none) |   RPG_O_Output_Spec: (RPG_O_Output_Program_Record_Id | RPG_O_Output_Program_Field_Descr | RPG_O_Output_External_Record_Id | RPG_O_Output_External_Field_Descr)
42 all RPG_O_Output_Specification_III: RPG_O_Output_Spec
    |   RPG_O_Output_External_Field_Descr_III: "O" RPG_Blanks [RPG_Literal] RPG_Literal RPG_Blanks ["B"] RPG_Blanks
    |   RPG_O_Output_External_Record_Id_III: "O" RPG_Literal RPG_O_Output_External_Record_Id_Piece [RPG_Literal] [RPG_Literal] RPG_Blanks
    |   RPG_O_Output_External_Record_Id_Piece1_III: RPG_Literal ("H"|"D"|"T"|"E") "R" RPG_Blanks
    |   RPG_O_Output_External_Record_Id_Piece2_III: RPG_Blanks ("AND"|"OR") RPG_Blanks
    |   RPG_O_Output_External_Record_Id_Piece3_III: RPG_Blanks ("ADD"|"DEL") RPG_Blanks
    |   RPG_O_Output_External_Record_Id_Piece_III: (RPG_O_Output_External_Record_Id_Piece1 | RPG_O_Output_External_Record_Id_Piece2 | RPG_O_Output_External_Record_Id_Piece3)
28 all all all all all all all all all all |   RPG_O_Output_Program_Field_Descr_III: "O" RPG_Blanks [RPG_Literal] RPG_Literal [RPG_Literal] ["B"] [RPG_Literal] [("P"|"B"|"L"|"R")] [RPG_Literal] RPG_Blanks
14 all all all all all all all |   RPG_O_Output_Program_Record_Id_III: "O" RPG_O_Output_Program_Record_Id_Piece [RPG_Literal] [RPG_Literal] [RPG_Literal] [RPG_Literal] RPG_Blanks
9 all all all all all all all |   RPG_O_Output_Program_Record_Id_Piece1_III: RPG_Literal ("H"|"D"|"T"|"E") [("F"|"R")] [RPG_Number] [RPG_Number] [RPG_Literal] [RPG_Literal]
5 all all all |   RPG_O_Output_Program_Record_Id_Piece2_III: RPG_Blanks ("AND"|"OR") RPG_Blanks
    |   RPG_O_Output_Program_Record_Id_Piece3_III: RPG_Blanks ("ADD"|"DEL") RPG_Blanks
14 (none | none | none) |   RPG_O_Output_Program_Record_Id_Piece_III: (RPG_O_Output_Program_Record_Id_Piece1 | RPG_O_Output_Program_Record_Id_Piece2 | RPG_O_Output_Program_Record_Id_Piece3)
    RPG_U_AutoReport_Specification: "U"

Terminals = 5 (instances=5,893)
Tokens = 47 (instances=1,553)

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