Eagle Legacy Modernization, LLC

VB Grammar

Main program: VB_Program

 Count  Terminals:
43 VB_Comment: Comment
327 VB_EndOfLine: End of line
330 VB_Identifier_Reference: An identifier
  VB_Label_Definition: An identifier
144 VB_Literal: A string enclosed in quotes
163 VB_Number: A number
7 VB_Sub_Definition: An identifier
56 VB_Variable_Definition: An identifier
 Count  Statistics(*) Tokens:
57 all all all VB_AssignmentStatement: VB_Variable '=' VB_Expression
5 all all all all VB_AttributeStatement: "attribute" VB_Identifier_Reference '=' VB_Expression
1 all all 1.00 all VB_BeginStatement: "begin" VB_EndOfLine VB_Statement* "end"
5 all all 60% VB_CallStatement: "call" VB_Identifier_Reference [VB_CallParameters]
3 all 4.33(all) all |   VB_CallParameters: '(' [VB_Expression]* ')'
5 all all all VB_CloseStatement: "close" '#' VB_Number
45 all all all 4% 2.00(2%) all 2% VB_DataDeclaration: ("private"|"public"|"dim"|"const") ["const"] VB_Variable_Definition [VB_Subscript] [VB_MoreVariables]* [VB_DataType] [VB_DataInitialization]
1 all all |   VB_DataInitialization: '=' VB_Expression
45 all all |   VB_DataType: "as" VB_Type
2 all all none |   VB_MoreVariables: ',' VB_Variable_Definition [VB_Subscript]
5 all all VB_ExitStatement: "exit" ("do"|"for"|"function"|"sub")
8 all all all all all all all 2.88 all 50% VB_ForStatement: "for" VB_Identifier_Reference '=' VB_Expression "to" VB_Expression VB_EndOfLine VB_Statement* "next" [VB_Identifier_Reference]
1 all all all all all all all 3.00(all) all all VB_FunctionDeclaration: ("private"|"public") "function" VB_Sub_Definition VB_Parameters "as" VB_Type VB_EndOfLine [VB_Statement]* "end" "function"
    VB_GotoStatement: "goto" VB_Identifier_Reference
21 all all all all VB_IfStatement: "if" VB_Expression "then" VB_IfType
4 none all all 1.25 |   VB_IfElseClause: [VB_Comment]* "else" VB_EndOfLine VB_Statement*
    |   VB_IfElseIfClause: [VB_Comment]* "elseif" VB_Expression "then" VB_EndOfLine VB_Statement*
21 (67% | 33%) |   VB_IfType: (VB_IfMultiLiner | VB_IfOneLiner)
14 all 4.07 none 29% all all |   |   VB_IfMultiLiner: VB_EndOfLine VB_Statement* [VB_IfElseIfClause]* [VB_IfElseClause] "end" "if"
7 all |   |   VB_IfOneLiner: VB_BaseStatement
1 all all VB_MessageBoxStatment: "MsgBox" VB_Expression
2 all all all VB_OnStatement: "on" "error" VB_OnWhat
2 (none | 50% | 50%) |   VB_OnWhat: (VB_OnGotoLabel | VB_OnGotoZero | VB_OnResume)
    |   |   VB_OnGotoLabel: "goto" VB_Identifier_Reference
1 all all |   |   VB_OnGotoZero: "goto" VB_Number
1 all all |   |   VB_OnResume: "resume" "next"
5 all all all all all all all VB_OpenStatement: "open" VB_Expression "for" ("input"|"output") "as" '#' VB_Number
1 all all VB_OptionStatement: "option" "explicit"
80 all all all all all VB_PrintStatement: "print" '#' VB_Number ',' VB_Expression
9 all all all all VB_SetStatement: "set" VB_Variable '=' VB_Expression
6 all all all all all 29.67(all) all all VB_SubDeclaration: [("private"|"public")] "sub" VB_Sub_Definition VB_Parameters VB_EndOfLine [VB_Statement]* "end" "sub"
1 all all all VB_VersionStatement: "version" VB_Number "class"
528 (13% | 27% | 1% | 4% | none | 0% | 31% | 0% | none | none | none | none | 1% | 2% | 14% | none | 1% | none | 4% | none | none | none | 1% | none) VB_Expression: (VB_Number | VB_Literal | VB_BuiltIn | VB_FunctionCall | VB_NegativeExpression | VB_NotExpression | VB_VariableExpression | VB_ParenthesizedExpression | VB_CommentExpression | VB_SubscriptExpression | VB_Subfield | VB_ExponentExpression | VB_MultiplicativeExpression | VB_AdditiveExpression | VB_ConcatExpression | VB_ShiftExpression | VB_RelationalExpression | VB_InstanceOfExpression | VB_EqualityExpression | VB_AndExpression | VB_ExclusiveOrExpression | VB_InclusiveOrExpression | VB_ConditionalAndExpression | VB_ConditionalOrExpression)
13 all all all |   VB_AdditiveExpression: VB_Expression ("+"|"-") VB_Expression
    |   VB_AndExpression: VB_Expression '&' VB_Expression
7 all |   VB_BuiltIn: ("false"|"true"|"nothing")
    |   VB_CommentExpression: VB_Comment VB_Expression
74 all all all |   VB_ConcatExpression: VB_Expression '&' VB_Expression
3 all all all |   VB_ConditionalAndExpression: VB_Expression ("and"|"andalso") VB_Expression
    |   VB_ConditionalOrExpression: VB_Expression ("or"|"orelse") VB_Expression
19 all all all |   VB_EqualityExpression: VB_Expression VB_EqualityOperator VB_Expression
19 (all | none) |   |   VB_EqualityOperator: ('=' | ("is"|"like"|"isnot"))
    |   VB_ExclusiveOrExpression: VB_Expression '^' VB_Expression
    |   VB_ExponentExpression: VB_Expression '^' VB_Expression
20 all all 2.60 all |   VB_FunctionCall: VB_Identifier_Reference '(' VB_Expression* ')'
    |   VB_InclusiveOrExpression: VB_Expression "xor" VB_Expression
    |   VB_InstanceOfExpression: VB_Expression "instanceof" VB_Type
6 all all all |   VB_MultiplicativeExpression: VB_Expression VB_MultiplyOperation VB_Expression
6 (50% | 50%) |   |   VB_MultiplyOperation: ("mod" | ("*"|"/"|"%"|"\"))
    |   VB_NegativeExpression: ("-"|"+") VB_Expression
1 all all |   VB_NotExpression: "NOT" VB_Expression
1 all all all |   VB_ParenthesizedExpression: '(' VB_Expression ')'
4 all all all |   VB_RelationalExpression: VB_Expression ("<="|">="|"<>"|"<"|">") VB_Expression
    |   VB_ShiftExpression: VB_Expression ("<<"|">>") VB_Expression
    |   VB_Subfield: VB_Expression '.' VB_Expression
    |   VB_SubscriptExpression: VB_Expression '[' VB_Expression ']'
165 all |   VB_VariableExpression: VB_Variable
7 all 3.50(57%) all VB_Parameters: '(' [VB_Parameter]* ')'
9 all all all all |   VB_Parameter: [("byval"|"byref")] VB_Variable_Definition "as" VB_Type
1 26.00(all) VB_Program: [VB_Statement]*
293 all 1% all VB_Statement: VB_BaseStatement [VB_Comment] VB_EndOfLine
300 (none | 13% | 19% | 2% | 0% | 2% | 2% | 15% | 2% | 3% | 0% | none | 7% | 0% | 1% | 2% | 0% | 27% | 3% | 2% | 0% | 1%) |   VB_BaseStatement: (VB_Label | VB_Comment | VB_AssignmentStatement | VB_AttributeStatement | VB_BeginStatement | VB_CallStatement | VB_CloseStatement | VB_DataDeclaration | VB_ExitStatement | VB_ForStatement | VB_FunctionDeclaration | VB_GotoStatement | VB_IfStatement | VB_MessageBoxStatment | VB_OnStatement | VB_OpenStatement | VB_OptionStatement | VB_PrintStatement | VB_SetStatement | VB_SubDeclaration | VB_VersionStatement | VB_Variable)
    |   |   VB_Label: VB_Label_Definition ':'
31 all 2.16 all VB_Subscript: '(' VB_Expression* ')'
55 (all) VB_Type: (("boolean"|"integer"|"long"|"range"|"string"|"worksheet"))
233 all 1% 1.49(16%) VB_Variable: VB_Identifier_Reference [VB_Subscript] [VB_VariableField]*
55 all all 49% |   VB_VariableField: '.' VB_Identifier_Reference [VB_Subscript]

Terminals = 8 (instances=1,070)
Tokens = 67 (instances=2,209)

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