Eagle Legacy Modernization, LLC

Javascript Grammar

Main program: Javascript_Program

 Count  Terminals:
391 Javascript_Comment: Comment
318 Javascript_Function_Definition: An identifier
  Javascript_HexNumber: A hex number
44,721 Javascript_Identifier_Reference: An identifier
28 Javascript_Label_Definition: An identifier
10,786 Javascript_Literal: A string enclosed in quotes
7,370 Javascript_Number: A number
132 Javascript_RegularExpression: A string enclosed in quotes
5,527 Javascript_Variable_Definition: An identifier
 Count  Statistics(*) Tokens:
    Javascript_ArgumentList: Javascript_Expression [Javascript_Comment]* [Javascript_MoreArguments]* [',']
    |   Javascript_MoreArguments: ',' [Javascript_Comment]* Javascript_Expression [Javascript_Comment]*
1,970 all all 82% 1.97(15%) 99% Javascript_Data: Javascript_Type Javascript_Variable_Definition [Javascript_InitData] [Javascript_More_Variables]* [';']
2,191 all all |   Javascript_InitData: '=' Javascript_Expression
731 all none all 80% |   Javascript_More_Variables: ',' [Javascript_Comment]* Javascript_Variable_Definition [Javascript_InitData]
69,859 (none | 8% | 15% | 0% | none | none | 0% | 0% | 0% | 0% | none | none | 0% | 8% | 0% | none | 0% | 0% | 0% | 0% | 1% | 4% | 32% | 2% | 0% | 1% | 1% | 0% | 1% | 2% | 0% | 0% | 0% | 3% | 1% | 3% | 0% | 1% | 0% | 0% | 2% | 0% | none | 0% | 2% | 1% | 1% | 6%) Javascript_Expression: (Javascript_HexNumber | Javascript_Number | Javascript_Literal | Javascript_RegularExpression | Javascript_DotClass | Javascript_CastExpression | Javascript_ExpressionList | Javascript_StringFunction | Javascript_DeleteExpression | Javascript_ClassCreationExpression | Javascript_ClassCreationWithInitializers | Javascript_ClassCreationWithSubscript | Javascript_NewNoArgsExpression | Javascript_MethodInvocation | Javascript_PreIncrementExpression | Javascript_PreDecrementExpression | Javascript_PostIncrementExpression | Javascript_PostDecrementExpression | Javascript_NegativeExpression | Javascript_LogicalNotExpression | Javascript_NotExpression | Javascript_BuiltIn | Javascript_VariableExpression | Javascript_StrangeFunction | Javascript_ParenthesizedFunction | Javascript_Parenthesized_Expression | Javascript_SimpleArray | Javascript_CommentExpression | Javascript_Dictionary | Javascript_FunctionExpr | Javascript_TypeOfExpr | Javascript_VoidExpr | Javascript_SubscriptExpression | Javascript_Subfield | Javascript_MultiplicativeExpression | Javascript_AdditiveExpression | Javascript_ShiftExpression | Javascript_RelationalExpression | Javascript_InstanceOfExpression | Javascript_InExpression | Javascript_EqualityExpression | Javascript_AndExpression | Javascript_ExclusiveOrExpression | Javascript_InclusiveOrExpression | Javascript_ConditionalAndExpression | Javascript_ConditionalOrExpression | Javascript_TrueFalseExpression | Javascript_AssignmentExpression)
2,363 all all all |   Javascript_AdditiveExpression: Javascript_Expression ("+"|"-") Javascript_Expression
8 all all all |   Javascript_AndExpression: Javascript_Expression '&' Javascript_Expression
4,502 all all all |   Javascript_AssignmentExpression: Javascript_Expression ("="|"*="|"/="|"%="|"+="|"-="|"<<="|">>="|">>>="|"&="|"^="|"|=") Javascript_Expression
2,634 all |   Javascript_BuiltIn: ("false"|"null"|"String"|"super"|"this"|"true")
    |   Javascript_CastExpression: '(' Javascript_Type ')' Javascript_Expression
155 all all all |   Javascript_ClassCreationExpression: "new" Javascript_Type Javascript_ParenthesizedExpression
    |   Javascript_ClassCreationWithInitializers: "new" Javascript_Type '{' Javascript_ArgumentList '}'
    |   Javascript_ClassCreationWithSubscript: "new" Javascript_Type Javascript_Subscript*
74 all all |   Javascript_CommentExpression: Javascript_Comment Javascript_Expression
1,282 all all all |   Javascript_ConditionalAndExpression: Javascript_Expression "&&" Javascript_Expression
763 all all all |   Javascript_ConditionalOrExpression: Javascript_Expression "||" Javascript_Expression
38 all all |   Javascript_DeleteExpression: "delete" Javascript_Expression
531 all 8.44 none none all |   Javascript_Dictionary: '{' Javascript_DictionaryItem* [','] [Javascript_Comment] '}'
2,507 all all all |   |   Javascript_DictionaryItem: Javascript_Expression ':' Javascript_Expression
    |   Javascript_DotClass: Javascript_Type '.' "class"
1,306 all all all none |   Javascript_EqualityExpression: Javascript_Expression ("!=="|"==="|"=="|"!=") Javascript_Expression [Javascript_Comment]
    |   Javascript_ExclusiveOrExpression: Javascript_Expression '^' Javascript_Expression
297 all none none all |   Javascript_ExpressionList: '{' [Javascript_Comment]* [Javascript_ArgumentList] '}'
1,556 all 1% |   Javascript_FunctionExpr: Javascript_Function [Javascript_ParenthesizedExpression]
70 all all all |   Javascript_InExpression: Javascript_Expression "in" Javascript_Expression
6 all all all |   Javascript_InclusiveOrExpression: Javascript_Expression '|' Javascript_Expression
18 all all all |   Javascript_InstanceOfExpression: Javascript_Expression "instanceof" Javascript_Type
2 all all |   Javascript_LogicalNotExpression: '~' Javascript_Expression
5,904 all all |   Javascript_MethodInvocation: Javascript_Variable Javascript_ParenthesizedExpression
463 all all all |   Javascript_MultiplicativeExpression: Javascript_Expression ("*"|"/"|"%") Javascript_Expression
58 all all |   Javascript_NegativeExpression: ("-"|"+") Javascript_Expression
115 all all |   Javascript_NewNoArgsExpression: "new" Javascript_Type
896 all all |   Javascript_NotExpression: '!' Javascript_Expression
48 all all all all |   Javascript_ParenthesizedFunction: '(' Javascript_Function ')' Javascript_ParenthesizedExpression
1,041 all |   Javascript_Parenthesized_Expression: Javascript_ParenthesizedExpression
27 all all |   Javascript_PostDecrementExpression: Javascript_Variable "--"
329 all all |   Javascript_PostIncrementExpression: Javascript_Variable "++"
    |   Javascript_PreDecrementExpression: "--" Javascript_Variable
39 all all |   Javascript_PreIncrementExpression: "++" Javascript_Variable
656 all all all |   Javascript_RelationalExpression: Javascript_Expression ("<"|">"|"<="|">=") Javascript_Expression
6 all all all |   Javascript_ShiftExpression: Javascript_Expression (">>>"|"<<"|">>") Javascript_Expression
969 all 65% 4.16(53%) all |   Javascript_SimpleArray: '[' [Javascript_Expression] [Javascript_MoreArray]* ']'
2,127 all 99% |   |   Javascript_MoreArray: ',' [Javascript_Expression]
1,464 all all all all all all |   Javascript_StrangeFunction: '(' Javascript_Number ',' Javascript_Variable ')' Javascript_ParenthesizedExpression
36 all all all all |   Javascript_StringFunction: "String" '(' Javascript_Expression ')'
1,973 all all all |   Javascript_Subfield: Javascript_Expression '.' Javascript_Expression
47 all all all all |   Javascript_SubscriptExpression: Javascript_Expression '[' Javascript_Expression ']'
763 all all all all all |   Javascript_TrueFalseExpression: Javascript_Expression '?' Javascript_Expression ':' Javascript_Expression
177 all all |   Javascript_TypeOfExpr: "typeof" Javascript_Expression
22,419 all |   Javascript_VariableExpression: Javascript_Variable
93 all all |   Javascript_VoidExpr: "void" Javascript_Number
1,864 all 17% all 70% 1.90(38%) 1.00(0%) all none all Javascript_Function: "function" [Javascript_Function_Definition] '(' [Javascript_FunctionParameter] [Javascript_MoreParameters]* [Javascript_Comment]* ')' [Javascript_Comment]* Javascript_FunctionBody
1,864 all 3.05(98%) all |   Javascript_FunctionBody: '{' [Javascript_StatementOrComment]* '}'
2,647 (all | none) |   Javascript_FunctionParameter: (Javascript_Variable_Definition | '$')
1,342 all 1% all |   Javascript_MoreParameters: ',' [Javascript_Comment] Javascript_FunctionParameter
8,621 all 2.85(90%) none all Javascript_ParenthesizedExpression: '(' [Javascript_Expression]* [','] ')'
351 9.13(62%) Javascript_Program: [Javascript_Element]*
1,972 (7% | 13% | 79%) |   Javascript_Element: (Javascript_Comment | Javascript_Function | Javascript_Statement)
14,950 0% all Javascript_Statement: [Javascript_Label] Javascript_RealStatement
28 all all |   Javascript_Label: Javascript_Label_Definition ':'
14,950 (54% | 11% | 13% | 0% | 1% | 0% | 0% | 3% | 9% | 8% | 0% | 0% | 1% | 0%) |   Javascript_RealStatement: (Javascript_ExpressionStmt | Javascript_StatementBlock | Javascript_Data | ';' | Javascript_BreakStatement | Javascript_ContinueStatement | Javascript_DoStatement | Javascript_ForStatement | Javascript_IfStatement | Javascript_ReturnStatement | Javascript_SwitchStatement | Javascript_ThrowStatement | Javascript_TryStatement | Javascript_WhileStatement)
8,041 all 1.00(2%) 79% |   |   Javascript_ExpressionStmt: Javascript_Expression [Javascript_MoreStatements]* [';']
129 all all |   |   |   Javascript_MoreStatements: ',' Javascript_Statement
1,574 all 2.18(98%) all |   |   Javascript_StatementBlock: '{' [Javascript_StatementOrComment]* '}'
11,085 (99% | 1%) |   Javascript_StatementOrComment: (Javascript_Statement | Javascript_Comment)
2,485 all all all Javascript_Subscript: '[' Javascript_Expression ']'
2,543 (89% | 11%) Javascript_Type: (("var"|"Array"|"Date"|"Image"|"String") | Javascript_Variable)
30,845 all 1.24(37%) 1.15(7%) Javascript_Variable: Javascript_VariableIdentifier [Javascript_DotIdentifier]* [Javascript_Subscript]*
14,136 all all |   Javascript_DotIdentifier: '.' Javascript_VariableIdentifier
44,981 (none | 99% | 1% | none) |   Javascript_VariableIdentifier: (Javascript_CastedVariable | Javascript_Identifier_Reference | ("this"|"class") | ("$"|"_"))
    |   |   Javascript_CastedVariable: '(' '(' Javascript_Type ')' Javascript_Identifier_Reference ')'
127 all 19% 66% Javascript_BreakStatement: "break" [Javascript_Identifier_Reference] [';']
2 all all Javascript_ContinueStatement: "continue" ';'
7 all all all all all all 57% Javascript_DoStatement: "do" Javascript_Statement "while" '(' Javascript_Expression ')' [';']
427 (14% | 86%) Javascript_ForStatement: (Javascript_ForCollectionStatement | Javascript_ForLoopStatement)
60 all all all 47% all all all all |   Javascript_ForCollectionStatement: "for" '(' Javascript_Type [Javascript_Variable] Javascript_InOrColon Javascript_Expression ')' Javascript_Statement
60 (none | all) |   |   Javascript_InOrColon: (':' | "in")
367 all all 96% all 94% 1.83(24%) all all all 91% 2% 2% all all |   Javascript_ForLoopStatement: "for" '(' [Javascript_ForLoopVariable] [("="|"+=")] [Javascript_Expression] [Javascript_More_Variables]* ';' [Javascript_Expression] ';' [Javascript_Expression] [','] [Javascript_Expression] ')' Javascript_Statement
354 (36% | 64%) |   |   Javascript_ForLoopVariable: (Javascript_ForLoopVariableNoType | Javascript_ForLoopVariableWithType)
129 all |   |   |   Javascript_ForLoopVariableNoType: Javascript_Variable
225 all all |   |   |   Javascript_ForLoopVariableWithType: Javascript_Type Javascript_Variable
1,362 all all 1.02 none all 1.00(0%) all 24% Javascript_IfStatement: "if" '(' Javascript_Expression* [Javascript_Comment]* ')' [Javascript_Comment]* Javascript_Statement [Javascript_IfElseClause]
324 all all |   Javascript_IfElseClause: "else" Javascript_Statement
1,126 all 96% 33% Javascript_ReturnStatement: "return" [Javascript_Expression] [';']
39 all all all all all 5.31 23% all Javascript_SwitchStatement: "switch" '(' Javascript_Expression ')' '{' Javascript_CaseClause* [Javascript_DefaultClause] '}'
207 all all all 1.52(93%) |   Javascript_CaseClause: "case" Javascript_Expression ':' [Javascript_StatementOrComment]*
9 all all 1.00 |   Javascript_DefaultClause: "default" ':' Javascript_StatementOrComment*
53 all all 6% 6% 92% Javascript_ThrowStatement: "throw" Javascript_Expression [','] [Javascript_Expression] [';']
179 all all 13.40(78%) all 1.00(all) none Javascript_TryStatement: "try" '{' [Javascript_StatementOrComment]* '}' [Javascript_CatchBlock]* [Javascript_FinallyBlock]
179 all all all all all |   Javascript_CatchBlock: "catch" '(' Javascript_Variable_Definition ')' Javascript_Statement
    |   Javascript_FinallyBlock: "finally" Javascript_Statement
24 all all all all all Javascript_WhileStatement: "while" '(' Javascript_Expression ')' Javascript_Statement

Terminals = 9 (instances=69,273)
Tokens = 93 (instances=302,181)

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