Eagle Legacy Modernization, LLC

Basic Grammar

Main program: Basic_Program

Basic syntax:

 Count  Terminals:
44 Basic_Comment: REM comment to end of line
286 Basic_EndOfLine: End of line
18 Basic_Identifier_Definition: An identifier
626 Basic_Identifier_Reference: An identifier
37 Basic_Literal: Literal quotes:" escape:none doubled:yes multiline:no
806 Basic_Number: Number exponent_chars:Ee suffix_chars:none trailing_period:yes ignore_char:none
 Count  Statistics(*) Tokens:
934 (25% | 4% | none | 2% | 0% | 0% | 1% | 0% | 0% | 0% | 43% | none | 1% | 6% | 13% | 4%) Basic_Expression: (Basic_Number | Basic_Literal | Basic_NegativeExpression | Basic_ParenthesizedExpression | Basic_AbsFunction | Basic_ChrFunction | Basic_IntFunction | Basic_RndFunction | Basic_TabFunction | Basic_TrigFunction | Basic_VariableExpression | Basic_SubscriptExpression | Basic_ExponentExpression | Basic_MultiplicativeExpression | Basic_AdditiveExpression | Basic_RelationalExpression)
6 28.50(all) Basic_Program: [Basic_Statement]*
264 all 1.34 all Basic_Statement: Basic_Number Basic_BaseStatement* Basic_EndOfLine
371 (4% | 2% | 1% | 8% | 2% | 4% | 10% | 4% | 1% | 15% | 1% | 12% | 1% | 37%) |   Basic_BaseStatement: (Basic_DataStatement | Basic_DimStatement | Basic_EndStatement | Basic_ForStatement | Basic_GoSubStatement | Basic_GoToStatement | Basic_IfStatement | Basic_InputStatement | Basic_OnGoToStatement | Basic_PrintStatement | Basic_ReadStatement | Basic_RemStatement | Basic_ReturnStatement | Basic_AssignmentStatement)
566 all 23% Basic_Variable: Basic_Identifier_Reference [Basic_Subscript]
133 all 1.05 all |   Basic_Subscript: '(' Basic_Expression* ')'
120 all all all Basic_AdditiveExpression: Basic_Expression ("+"|"-") Basic_Expression
8 all all all Basic_ExponentExpression: Basic_Expression '^' Basic_Expression
59 all all all Basic_MultiplicativeExpression: Basic_Expression ("*"|"/") Basic_Expression
    Basic_NegativeExpression: '-' Basic_Expression
15 all all all Basic_ParenthesizedExpression: '(' Basic_Expression ')'
39 all all all Basic_RelationalExpression: Basic_Expression ("="|"<="|">="|"<>"|"<"|">") Basic_Expression
    Basic_SubscriptExpression: Basic_Expression '(' Basic_Expression ')'
405 all Basic_VariableExpression: Basic_Variable
3 all all all all Basic_AbsFunction: "ABS" '(' Basic_Expression ')'
1 all all all all Basic_ChrFunction: "CHR$" '(' Basic_Expression ')'
13 all all all all Basic_IntFunction: "INT" '(' Basic_Expression ')'
2 all all all all Basic_RndFunction: "RND" '(' "X" ')'
1 all all all all Basic_TabFunction: "TAB" '(' Basic_Expression ')'
2 all all all all Basic_TrigFunction: ("SIN"|"COS") '(' Basic_Expression ')'
137 all all all Basic_AssignmentStatement: Basic_Variable '=' Basic_Expression
13 all 30.08 Basic_DataStatement: ("DATA"|"DAT") Basic_Number*
7 all 4.14 Basic_DimStatement: "DIM" Basic_DimEntry*
18 all all 1.11 all |   Basic_DimEntry: Basic_Identifier_Definition '(' Basic_Expression* ')'
3 all Basic_EndStatement: "END"
30 all all all all all all 20% 57% 73% 5.81(53%) 73% 37% 27% 3% all all Basic_ForStatement: "FOR" Basic_Identifier_Reference '=' Basic_Expression "TO" Basic_Expression [Basic_ForStep] [Basic_For_PostFor] [Basic_EndOfLine] [Basic_Statement]* [Basic_Number] [Basic_For_PreNext] ['\'] [Basic_For_IfThenNext] ("NEXT"|"NEX") Basic_Identifier_Reference
6 all all |   Basic_ForStep: "STEP" Basic_Expression
1 all all all |   Basic_For_IfThenNext: "IF" Basic_Expression ("THEN"|"THE")
17 2.06 |   Basic_For_PostFor: Basic_For_PostPair*
35 all all |   Basic_For_PostPair: '\' Basic_BaseStatement
11 1.55 |   Basic_For_PreNext: Basic_For_PreNextPair*
17 all all |   Basic_For_PreNextPair: Basic_BaseStatement '\'
7 all all Basic_GoSubStatement: "GOSUB" Basic_Number
15 all all Basic_GoToStatement: "GOTO" Basic_Number
38 all all all all Basic_IfStatement: "IF" Basic_Expression ("THEN"|"THE") Basic_IfWhat
38 (74% | 26%) |   Basic_IfWhat: (Basic_Number | Basic_BaseStatement)
13 all 15% 15% 2.08 Basic_InputStatement: ("INPUT"|"INP") [Basic_Literal] [';'] Basic_Variable*
3 all all all 23.67 Basic_OnGoToStatement: "ON" Basic_Expression "GOTO" Basic_Number*
57 all 2.06(63%) Basic_PrintStatement: ("PRINT"|"PRI") [Basic_PrintItem]*
74 (64% | 35% | 1%) |   Basic_PrintItem: (Basic_Expression | ';' | ',')
2 all 3.00 Basic_ReadStatement: "READ" Basic_Variable*
44 all all Basic_RemStatement: "REM" Basic_Comment
2 all Basic_ReturnStatement: ("RETURN"|"RET")

Terminals = 6 (instances=1,817)
Tokens = 43 (instances=3,530)

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