Eagle Legacy Modernization, LLC

PL/I Grammar

Main program: PLI_Program

 Count  Terminals:
96 PLI_BitLiteral: A bit literal, like '0'B
1,615 PLI_Comment: Comment
2 PLI_HexNumber: A hex number
6,100 PLI_Identifier_Reference: An identifier
19 PLI_Label_Definition: An identifier
6 PLI_Level: PL/I level number.
552 PLI_Literal: A string enclosed in quotes
2,482 PLI_Number: A number
164 PLI_Procedure_Definition: An identifier
1,075 PLI_Variable_Definition: An identifier
 Count  Statistics(*) Tokens:
595 none all 1.11 all PLI_Declaration: [PLI_Comment]* ("DCL"|"DECLARE") PLI_Declare_Item* ';'
1 all all all |   PLI_Declare_Character: ("CHAR"|"CHARACTER") [PLI_Declare_Character_Size] ["VARYING"]
1 all all all |   |   PLI_Declare_Character_Size: '(' PLI_Expression ')'
629 1% all 10% 91% all none all 0% 5% 0% |   PLI_Declare_Item: [PLI_Level] PLI_Declare_Variables [PLI_Declare_Size] [PLI_Type] [("BUILTIN"|"CONTROLLED"|"EXTERNAL"|"NONASSIGNABLE"|"OPTIONAL")] [PLI_Declare_Character] ["STATIC"] [PLI_Type] [PLI_Declare_Initial] [PLI_Declare_Character]
89 all 1.27 all |   PLI_Declare_Size: '(' PLI_Declare_Size_OneDimension* ')'
101 (34% | none | 66%) |   |   PLI_Declare_Size_OneDimension: (PLI_Declare_Array | PLI_Declare_Bounds_Array | PLI_ParenStar)
34 all all all |   |   |   PLI_Declare_Array: PLI_Expression ':' PLI_Expression
    |   |   |   PLI_Declare_Bounds_Array: "LBOUND" '(' PLI_Identifier_Reference [PLI_Declare_Array_Dim] ')' ':' "HBOUND" '(' PLI_Identifier_Reference [PLI_Declare_Array_Dim] ')'
    |   |   |   |   PLI_Declare_Array_Dim: ',' PLI_Number
67 all |   |   |   PLI_ParenStar: '*'
629 (43% | 57%) |   PLI_Declare_Variables: (PLI_Identifier_List | PLI_Variable_Definition)
270 all all 4% 5% all 1% 1.71(85%) all |   |   PLI_Identifier_List: '(' PLI_Variable_Definition [PLI_Declare_Size] [PLI_Type] ["STATIC"] [PLI_Declare_Initial] [PLI_More_Identifier_List]* ')'
41 all all 19.29 all |   |   |   PLI_Declare_Initial: "INITIAL" '(' PLI_Expression* ')'
391 all all 4% 6% all 1% |   |   |   PLI_More_Identifier_List: ',' PLI_Variable_Definition [PLI_Declare_Size] [PLI_Type] ["STATIC"] [PLI_Declare_Initial]
34 all all all all all 3.97(all) all all PLI_DeclareGeneric: "DECLARE" PLI_Variable_Definition "GENERIC" '(' PLI_GenericWhen [PLI_GenericMoreWhens]* ')' ';'
135 all all |   PLI_GenericMoreWhens: ',' PLI_GenericWhen
169 all all all 3.18(99%) all |   PLI_GenericWhen: PLI_Identifier_Reference "WHEN" '(' [PLI_Type]* ')'
1 all all all all all none all none all 7.00 PLI_Entry: ['%'] PLI_Procedure_Definition ':' "ENTRY" [PLI_Procedure_Parameters] [PLI_ProcedureOptions] [PLI_ProcedureReturns] [PLI_ProcedureOptions] ';' PLI_StatementOrComment*
9,507 (26% | 1% | 0% | 6% | 0% | 0% | 0% | 0% | 0% | 0% | 45% | 6% | none | 0% | 2% | 6% | 2% | 6% | 0% | 1% | none | none) PLI_Expression: (PLI_Number | PLI_BitLiteral | PLI_HexNumber | PLI_Literal | PLI_RepeatedBitLiteral | PLI_RepeatedHexLiteral | PLI_RepeatedLiteral | PLI_NegativeExpression | PLI_NotExpression | PLI_FieldReference | PLI_VariableOrFunctionCall | PLI_ParenthesizedExpression | PLI_CommentExpression | PLI_ExponentExpression | PLI_MultiplicativeExpression | PLI_AdditiveExpression | PLI_StrCatExpression | PLI_RelationalExpression | PLI_AndExpression | PLI_OrExpression | PLI_AndThenExpression | PLI_OrElseExpression)
559 all all all |   PLI_AdditiveExpression: PLI_Expression ("+"|"-") PLI_Expression
22 all all all |   PLI_AndExpression: PLI_Expression '&' PLI_Expression
    |   PLI_AndThenExpression: PLI_Expression "&:" PLI_Expression
    |   PLI_CommentExpression: PLI_Comment PLI_Expression
12 all all all |   PLI_ExponentExpression: PLI_Expression "**" PLI_Expression
1 all all all |   PLI_FieldReference: PLI_Identifier_Reference '.' PLI_Identifier_Reference
156 all all all |   PLI_MultiplicativeExpression: PLI_Expression ("*"|"/") PLI_Expression
6 all all |   PLI_NegativeExpression: ("-"|"+") PLI_Expression
15 all all |   PLI_NotExpression: '^' PLI_Expression
    |   PLI_OrElseExpression: PLI_Expression PLI_OrElseOperator PLI_Expression
    |   |   PLI_OrElseOperator: ("!:" | "|:")
61 all all all |   PLI_OrExpression: PLI_Expression ("^"|"|"|"!") PLI_Expression
577 all all 2% all |   PLI_ParenthesizedExpression: '(' PLI_Expression [PLI_Expression_Do] ')'
9 all all all all all all |   |   PLI_Expression_Do: "DO" PLI_Variable_Definition '=' PLI_Expression "TO" PLI_Expression
558 all all all |   PLI_RelationalExpression: PLI_Expression ("^>"|"^<"|"^="|"<="|">="|">"|"<"|"=") PLI_Expression
7 1.43 all |   PLI_RepeatedBitLiteral: PLI_RepeatCount* PLI_BitLiteral
1 1.00 all |   PLI_RepeatedHexLiteral: PLI_RepeatCount* PLI_HexNumber
1 2.00 all |   PLI_RepeatedLiteral: PLI_RepeatCount* PLI_Literal
13 all all all |   |   PLI_RepeatCount: '(' PLI_Number ')'
173 all all all |   PLI_StrCatExpression: PLI_Expression "||" PLI_Expression
4,273 all 28% |   PLI_VariableOrFunctionCall: PLI_Identifier_Reference [PLI_Subscript]
19 all all PLI_Label: PLI_Label_Definition ':'
163 8% all all all all 97% 48% all 80% 1% all 11.87 all all all all PLI_Procedure: [PLI_Signals] ['%'] PLI_Procedure_Definition ':' ("PROCEDURE"|"PROC") [PLI_Procedure_Parameters] [PLI_ProcedureOptions] ["RECURSIVE"] [PLI_ProcedureReturns] [PLI_ProcedureOptions] ';' PLI_StatementOrComment* ['%'] "END" PLI_Identifier_Reference ';'
81 all all all 1% all all |   PLI_ProcedureOptions: "OPTIONS" '(' ["MAIN"] [','] [("ORDER"|"REORDER")] ')'
132 all all all all all |   PLI_ProcedureReturns: "RETURNS" '(' PLI_Type ["BYADDR"] ')'
159 all 1% 3.42(98%) all |   PLI_Procedure_Parameters: '(' ['*'] [PLI_Identifier_Reference]* ')'
3,087 (0% | 21% | 60% | 19% | 0%) |   PLI_StatementOrComment: (PLI_Entry | PLI_Comment | PLI_Statement | PLI_Declaration | PLI_Signals)
40 22.70(all) PLI_Program: [PLI_Element]*
908 (76% | 4% | 18% | 1% | 2%) |   PLI_Element: (PLI_Comment | PLI_DeclareGeneric | PLI_Procedure | PLI_Declaration | PLI_PercentStatement)
80 (4% | 96%) PLI_Signal: (PLI_OnEndFile | ("CONVERSION"|"ERROR"|"FIXEDOVERFLOW"|"NOFIXEDOVERFLOW"|"NOFOFL"|"NOSIZE"|"NOSTRINGSIZE"|"OVERFLOW"|"SIZE"|"STRINGRANGE"|"STRINGSIZE"|"SUBSCRIPTRANGE"|"UNDERFLOW"|"ZERODIVIDE"))
3 all all all all |   PLI_OnEndFile: "ENDFILE" '(' PLI_Identifier_Reference ')'
19 all all 1.75(21%) all all PLI_Signals: '(' ("CONVERSION"|"ERROR"|"FIXEDOVERFLOW"|"NOFIXEDOVERFLOW"|"NOFOFL"|"NOSIZE"|"NOSTRINGSIZE"|"OVERFLOW"|"SIZE"|"STRINGRANGE"|"STRINGSIZE"|"SUBSCRIPTRANGE"|"UNDERFLOW"|"ZERODIVIDE") [PLI_Procedure_MoreSignals]* ')' ':'
7 all all |   PLI_Procedure_MoreSignals: ',' ("CONVERSION"|"ERROR"|"FIXEDOVERFLOW"|"NOFIXEDOVERFLOW"|"NOFOFL"|"NOSIZE"|"NOSTRINGSIZE"|"OVERFLOW"|"SIZE"|"STRINGRANGE"|"STRINGSIZE"|"SUBSCRIPTRANGE"|"UNDERFLOW"|"ZERODIVIDE")
2,437 (0% | 36% | 0% | 1% | 0% | 1% | 15% | 0% | 0% | 0% | 1% | 20% | 0% | 1% | 1% | 1% | 0% | 0% | 3% | 16% | 0% | 2% | 0% | 0% | 0%) PLI_Statement: (';' | PLI_AssignmentStatement | PLI_AllocateStatement | PLI_AnswerStatement | PLI_BeginStatement | PLI_CallStatement | PLI_DoStatement | PLI_FormatStatement | PLI_FreeStatement | PLI_GetStatement | PLI_GoStatement | PLI_IfStatement | PLI_IterateStatement | PLI_LeaveStatement | PLI_NoteStatement | PLI_OnStatement | PLI_OpenStatement | PLI_PercentStatement | PLI_PutStatement | PLI_ReturnStatement | PLI_RevertStatement | PLI_SignalStatement | PLI_SelectStatement | PLI_StopStatement | PLI_Procedure)
1,410 all 2.25(98%) all PLI_Subscript: '(' [PLI_ExpressionOrStar]* ')'
2,247 (100% | 0%) |   PLI_ExpressionOrStar: (PLI_Expression | '*')
1,093 (81% | 3% | 16%) PLI_Type: (PLI_BaseType | PLI_TypeSize | '*')
882 (11% | 25% | 34% | 18% | 11% | 1%) |   PLI_BaseType: (PLI_TypeBit | PLI_TypeCharacter | PLI_TypeFixedBinary | PLI_TypeFloat | PLI_TypeGraphic | ("COMPLEX"|"FILE"|"VARYING"|"UNION"))
95 7% all 77% all all 5% |   |   PLI_TypeBit: [PLI_TypeSize] "BIT" [PLI_TypeSize] [("STATIC"|"VARYING")] ["ALIGNED"] [PLI_BitInitial]
5 all all all all |   |   |   PLI_BitInitial: "INITIAL" '(' PLI_BitLiteral ')'
219 3% all 72% all 1% |   |   PLI_TypeCharacter: [PLI_TypeSize] ("CHAR"|"CHARACTER"|"WIDECHAR") [PLI_TypeSize] [("STATIC"|"VARYING")] [PLI_CharInitial]
3 all all all all |   |   |   PLI_CharInitial: "INITIAL" '(' PLI_Literal ')'
303 all all 83% all |   |   PLI_TypeFixedBinary: ("FIXED"|"FLOAT") "BINARY" [PLI_TypeSize] ["COMPLEX"]
162 all all 71% all |   |   PLI_TypeFloat: ("FIXED"|"FLOAT") ["DECIMAL"] [PLI_TypeSize] ["COMPLEX"]
93 all 37% all |   |   PLI_TypeGraphic: "GRAPHIC" [PLI_TypeSize] [("VARYING")]
679 all 1.03 all |   PLI_TypeSize: '(' PLI_TypeSizeContents* ')'
688 (81% | 19%) |   |   PLI_TypeSizeContents: (PLI_TypeSizeNormal | '*')
557 all 0% 0% |   |   |   PLI_TypeSizeNormal: PLI_Expression [','] [PLI_Expression]
8 all all 6.00(13%) all PLI_AllocateStatement: "ALLOCATE" PLI_AllocateVariable [PLI_Allocate_MoreVars]* ';'
16 all 38% 38% |   PLI_AllocateSize: PLI_Expression [':'] [PLI_Expression]
14 all all 1.29 all |   PLI_AllocateVariable: PLI_Identifier_Reference '(' PLI_AllocateSize* ')'
6 all all |   PLI_Allocate_MoreVars: ',' PLI_AllocateVariable
35 all all all all 2.43(all) all PLI_AnswerStatement: "ANSWER" '(' PLI_Expression ')' [PLI_AnswerClause]* ';'
85 (29% | 71%) |   PLI_AnswerClause: (PLI_AnswerCol | ("SKIP"|"NOSCAN"))
25 all all |   |   PLI_AnswerCol: "COL" PLI_Expression
876 0% all 23% all all 1% all PLI_AssignmentStatement: [PLI_Label] PLI_Identifier_Reference [PLI_Subscript] '=' PLI_Expression [PLI_Comment] ';'
4 25% all all 37.75 all 25% all PLI_BeginStatement: [PLI_Label] "BEGIN" ';' PLI_StatementOrComment* "END" [PLI_Identifier_Reference] ';'
26 all all 15% all PLI_CallStatement: "CALL" PLI_Expression [PLI_Comment] ';'
356 1% all 54% 2% 5% all all 2.87(97%) all 0% all PLI_DoStatement: [PLI_Label] "DO" [PLI_DoLoop] [PLI_DoUntil] [PLI_DoWhile] ["FOREVER"] ';' [PLI_StatementOrComment]* "END" [PLI_Identifier_Reference] ';'
193 all all all all all 37% |   PLI_DoLoop: PLI_Identifier_Reference '=' PLI_Expression "TO" PLI_Expression [PLI_DoBy]
71 all all |   |   PLI_DoBy: "BY" PLI_Expression
7 all all |   PLI_DoUntil: "UNTIL" PLI_Expression
19 all all |   PLI_DoWhile: "WHILE" PLI_Expression
5 all all all all PLI_FormatStatement: [PLI_Label] "FORMAT" PLI_PutFormat ';'
2 all 7.00 all PLI_FreeStatement: "FREE" PLI_Identifier_Reference* ';'
8 all all 38% 63% all PLI_GetStatement: "GET" ["SKIP"] [PLI_GetFile] [PLI_GetEdit] ';'
5 all all 1.40 all all 1.80 all |   PLI_GetEdit: "EDIT" '(' PLI_Expression* ')' '(' PLI_GetFormat* ')'
7 14% all 57% |   |   PLI_GetFormat: [PLI_GetFormat_Count] ("A"|"F"|"L"|"X") [PLI_GetFormat_Count]
5 all all all |   |   PLI_GetFormat_Count: '(' PLI_Expression ')'
3 all all all all |   PLI_GetFile: "FILE" '(' PLI_Identifier_Reference ')'
13 all all all all PLI_GoStatement: "GO" "TO" PLI_Identifier_Reference ';'
496 0% all all all 1.04(27%) all 1.21(19%) 17% all PLI_IfStatement: [PLI_Label] "IF" PLI_Expression "THEN" [PLI_Comment]* PLI_Statement [PLI_Comment]* [PLI_Else] ["END-IF"]
83 all none all 1.21(17%) |   PLI_Else: "ELSE" [PLI_Comment]* PLI_Statement [PLI_Comment]*
1 all all all PLI_IterateStatement: "ITERATE" PLI_Identifier_Reference ';'
24 all 8% all PLI_LeaveStatement: "LEAVE" [PLI_Identifier_Reference] ';'
15 all all all all all all all PLI_NoteStatement: "NOTE" '(' PLI_Expression ',' PLI_Expression ')' ';'
23 4% all 1.09 all all PLI_OnStatement: [PLI_Label] "ON" PLI_Signal* ["SNAP"] PLI_OnAction
23 (57% | 43%) |   PLI_OnAction: (PLI_On_Action_System | PLI_Statement)
13 all all |   |   PLI_On_Action_System: "SYSTEM" ';'
1 all all all all all all all all all all PLI_OpenStatement: "OPEN" "FILE" '(' PLI_Identifier_Reference ')' "TITLE" '(' PLI_Literal ')' ';'
27 all all all 22% PLI_PercentStatement: '%' PLI_PercentWhat ';' [';']
27 (37% | 22% | 7% | 19% | 7% | 4% | 4%) |   PLI_PercentWhat: (PLI_PercentActivate | PLI_PercentAssignment | PLI_PercentDeactivate | PLI_PercentDeclare | PLI_PercentInclude | PLI_PercentProcess | PLI_PercentSkip)
10 all 1.60 all |   |   PLI_PercentActivate: "ACTIVATE" PLI_Identifier_Reference* ["NORESCAN"]
6 all all all |   |   PLI_PercentAssignment: PLI_Variable_Definition '=' PLI_Expression
2 all all |   |   PLI_PercentDeactivate: "DEACTIVATE" PLI_Identifier_Reference
5 all 20% 1.40 20% all |   |   PLI_PercentDeclare: "DECLARE" ['('] PLI_Variable_Definition* [')'] ("FIXED"|"CHARACTER")
2 all all |   |   PLI_PercentInclude: "INCLUDE" PLI_ProcessIncludeWhat
2 (50% | 50%) |   |   |   PLI_ProcessIncludeWhat: (PLI_Literal | PLI_Identifier_Reference)
1 all all |   |   PLI_PercentProcess: "PROCESS" "GOSTMT"
1 all all all all |   |   PLI_PercentSkip: "SKIP" '(' PLI_Number ')'
70 1% all 9% all 3% 6% all 83% 30% all PLI_PutStatement: [PLI_Label] "PUT" [PLI_PutFile] ["SKIP"] [PLI_PutFormat_Count] [PLI_PutString] [("DATA"|"EDIT"|"LIST")] [PLI_PutValues] [PLI_PutFormat] ';'
6 all all all all |   PLI_PutFile: "FILE" '(' PLI_Identifier_Reference ')'
31 all all 2.47(48%) all |   PLI_PutFormat: '(' PLI_PutEditFormat [PLI_PutMoreFormats]* ')'
68 (25% | 6% | 15% | 9% | 25% | 7% | 13% | none) |   |   PLI_PutEditFormat: (PLI_PutFormat_A | PLI_PutFormat_E | PLI_PutFormat_F | PLI_PutFormat_R | PLI_PutFormat_X | PLI_PutMultipleFormats | "SKIP" | PLI_Literal)
17 12% all 35% |   |   |   PLI_PutFormat_A: [PLI_Number] "A" [PLI_PutFormat_Count]
4 none all all |   |   |   PLI_PutFormat_E: [PLI_Number] "E" PLI_PutFormat_Count
10 20% all all |   |   |   PLI_PutFormat_F: [PLI_Number] "F" PLI_PutFormat_Count
6 all all all all |   |   |   PLI_PutFormat_R: "R" '(' PLI_Identifier_Reference ')'
17 6% all all |   |   |   PLI_PutFormat_X: [PLI_Number] "X" PLI_PutFormat_Count
5 all all |   |   |   PLI_PutMultipleFormats: PLI_Number PLI_PutFormat
37 all all |   |   PLI_PutMoreFormats: ',' PLI_PutEditFormat
39 all all 33% all |   PLI_PutFormat_Count: '(' PLI_Expression [PLI_PutFormat_SecondCount] ')'
13 all all |   |   PLI_PutFormat_SecondCount: ',' PLI_Expression
4 all all all all |   PLI_PutString: "STRING" '(' PLI_Identifier_Reference ')'
58 all 2.38 all |   PLI_PutValues: '(' PLI_Expression* ')'
402 all 92% all PLI_ReturnStatement: "RETURN" [PLI_Expression] ';'
7 71% none all all all PLI_RevertStatement: [PLI_Label] [PLI_Signal_Label] "REVERT" PLI_Signal ';'
1 all all all all all 3.00 all all all PLI_SelectStatement: "SELECT" '(' PLI_Expression ')' ';' PLI_SelectWhenClause* [PLI_SelectOtherwise] "END" ';'
1 all all all |   PLI_SelectOtherwise: "OTHERWISE" [PLI_Statement] [';']
3 all all 1.67 all all |   PLI_SelectWhenClause: "WHEN" '(' PLI_Literal* ')' PLI_Statement
49 16% all all all PLI_SignalStatement: [PLI_Signal_Label] "SIGNAL" PLI_Signal ';'
8 all all all all |   PLI_Signal_Label: '(' ("CONVERSION"|"ERROR"|"FIXEDOVERFLOW"|"NOFIXEDOVERFLOW"|"NOFOFL"|"NOSIZE"|"NOSTRINGSIZE"|"OVERFLOW"|"SIZE"|"STRINGRANGE"|"STRINGSIZE"|"SUBSCRIPTRANGE"|"UNDERFLOW"|"ZERODIVIDE") ')' ':'
1 all all PLI_StopStatement: "STOP" ';'

Terminals = 10 (instances=12,111)
Tokens = 132 (instances=38,117)

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