Eagle Legacy Modernization, LLC

Javascript Grammar

Main program: Javascript_Program

 Count  Terminals:
3,076 Javascript_Comment: Comment
378 Javascript_Function_Definition: An identifier
  Javascript_HexNumber: A hex number
92,416 Javascript_Identifier_Reference: An identifier
24 Javascript_Label_Definition: An identifier
57,650 Javascript_Literal: A string enclosed in quotes
8,557 Javascript_Number: A number
128 Javascript_RegularExpression: A string enclosed in quotes
5,502 Javascript_Variable_Definition: An identifier
 Count  Statistics(*) Tokens:
    Javascript_ArgumentList: Javascript_Expression [Javascript_Comment]* [Javascript_MoreArguments]* [',']
    |   Javascript_MoreArguments: ',' [Javascript_Comment]* Javascript_Expression [Javascript_Comment]*
2,055 all all 82% 1.74(13%) 99% Javascript_Data: Javascript_Type Javascript_Variable_Definition [Javascript_InitData] [Javascript_More_Variables]* [';']
2,184 all all |   Javascript_InitData: '=' Javascript_Expression
624 all none all 80% |   Javascript_More_Variables: ',' [Javascript_Comment]* Javascript_Variable_Definition [Javascript_InitData]
165,964 (none | 4% | 35% | 0% | none | none | 0% | 0% | 0% | 0% | none | none | 0% | 32% | 0% | none | 0% | 0% | 0% | none | 1% | 2% | 14% | 1% | 0% | 1% | 1% | 0% | 0% | 1% | 0% | 0% | 0% | 1% | 0% | 2% | 0% | 0% | 0% | 0% | 1% | 0% | none | 0% | 1% | 0% | 0% | 3%) 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,796 all all all |   Javascript_AdditiveExpression: Javascript_Expression ("+"|"-") Javascript_Expression
8 all all all |   Javascript_AndExpression: Javascript_Expression '&' Javascript_Expression
4,503 all all all |   Javascript_AssignmentExpression: Javascript_Expression ("="|"*="|"/="|"%="|"+="|"-="|"<<="|">>="|">>>="|"&="|"^="|"|=") Javascript_Expression
2,591 all |   Javascript_BuiltIn: ("false"|"null"|"String"|"super"|"this"|"true")
    |   Javascript_CastExpression: '(' Javascript_Type ')' Javascript_Expression
162 all all all |   Javascript_ClassCreationExpression: "new" Javascript_Type Javascript_ParenthesizedExpression
    |   Javascript_ClassCreationWithInitializers: "new" Javascript_Type '{' Javascript_ArgumentList '}'
    |   Javascript_ClassCreationWithSubscript: "new" Javascript_Type Javascript_Subscript*
95 all all |   Javascript_CommentExpression: Javascript_Comment Javascript_Expression
1,226 all all all |   Javascript_ConditionalAndExpression: Javascript_Expression "&&" Javascript_Expression
725 all all all |   Javascript_ConditionalOrExpression: Javascript_Expression "||" Javascript_Expression
37 all all |   Javascript_DeleteExpression: "delete" Javascript_Expression
600 all 7.79 none 3.00(0%) all |   Javascript_Dictionary: '{' Javascript_DictionaryItem* [','] [Javascript_Comment]* '}'
2,637 all all all |   |   Javascript_DictionaryItem: Javascript_Expression ':' Javascript_Expression
    |   Javascript_DotClass: Javascript_Type '.' "class"
1,271 all all all all |   Javascript_EqualityExpression: Javascript_Expression ("!=="|"==="|"=="|"!=") Javascript_Expression [Javascript_Comment]
    |   Javascript_ExclusiveOrExpression: Javascript_Expression '^' Javascript_Expression
286 all 1.00(0%) none all |   Javascript_ExpressionList: '{' [Javascript_Comment]* [Javascript_ArgumentList] '}'
1,471 all 0% |   Javascript_FunctionExpr: Javascript_Function [Javascript_ParenthesizedExpression]
65 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
    |   Javascript_LogicalNotExpression: '~' Javascript_Expression
53,306 all all |   Javascript_MethodInvocation: Javascript_Variable Javascript_ParenthesizedExpression
644 all all all |   Javascript_MultiplicativeExpression: Javascript_Expression ("*"|"/"|"%") Javascript_Expression
59 all all |   Javascript_NegativeExpression: ("-"|"+") Javascript_Expression
114 all all |   Javascript_NewNoArgsExpression: "new" Javascript_Type
856 all all |   Javascript_NotExpression: '!' Javascript_Expression
47 all all all all |   Javascript_ParenthesizedFunction: '(' Javascript_Function ')' Javascript_ParenthesizedExpression
1,031 all |   Javascript_Parenthesized_Expression: Javascript_ParenthesizedExpression
27 all all |   Javascript_PostDecrementExpression: Javascript_Variable "--"
343 all all |   Javascript_PostIncrementExpression: Javascript_Variable "++"
    |   Javascript_PreDecrementExpression: "--" Javascript_Variable
35 all all |   Javascript_PreIncrementExpression: "++" Javascript_Variable
685 all all all |   Javascript_RelationalExpression: Javascript_Expression ("<"|">"|"<="|">=") Javascript_Expression
6 all all all |   Javascript_ShiftExpression: Javascript_Expression (">>>"|"<<"|">>") Javascript_Expression
969 all 66% 4.14(54%) all |   Javascript_SimpleArray: '[' [Javascript_Expression] [Javascript_MoreArray]* ']'
2,163 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,961 all all all |   Javascript_Subfield: Javascript_Expression '.' Javascript_Expression
41 all all all all |   Javascript_SubscriptExpression: Javascript_Expression '[' Javascript_Expression ']'
723 all all none all all none all |   Javascript_TrueFalseExpression: Javascript_Expression '?' [Javascript_Comment]* Javascript_Expression ':' [Javascript_Comment]* Javascript_Expression
172 all all |   Javascript_TypeOfExpr: "typeof" Javascript_Expression
22,714 all |   Javascript_VariableExpression: Javascript_Variable
93 all all |   Javascript_VoidExpr: "void" Javascript_Number
1,865 all 20% all 70% 1.94(37%) 1.00(0%) all none all Javascript_Function: "function" [Javascript_Function_Definition] '(' [Javascript_FunctionParameter] [Javascript_MoreParameters]* [Javascript_Comment]* ')' [Javascript_Comment]* Javascript_FunctionBody
1,865 all 3.17(98%) all |   Javascript_FunctionBody: '{' [Javascript_StatementOrComment]* '}'
2,643 (all | none) |   Javascript_FunctionParameter: (Javascript_Variable_Definition | '$')
1,338 all all all |   Javascript_MoreParameters: ',' [Javascript_Comment] Javascript_FunctionParameter
56,013 all 1.26(99%) none all Javascript_ParenthesizedExpression: '(' [Javascript_Expression]* [','] ')'
435 174.30(65%) Javascript_Program: [Javascript_Element]*
49,501 (0% | 1% | 99%) |   Javascript_Element: (Javascript_Comment | Javascript_Function | Javascript_Statement)
62,493 0% all Javascript_Statement: [Javascript_Label] Javascript_RealStatement
24 all all |   Javascript_Label: Javascript_Label_Definition ':'
62,493 (89% | 3% | 3% | 0% | 0% | 0% | 0% | 1% | 2% | 2% | 0% | 0% | 0% | 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)
55,552 all 1.00(0%) 97% |   |   Javascript_ExpressionStmt: Javascript_Expression [Javascript_MoreStatements]* [';']
60 all all |   |   |   Javascript_MoreStatements: ',' Javascript_Statement
1,580 all 2.17(98%) all |   |   Javascript_StatementBlock: '{' [Javascript_StatementOrComment]* '}'
11,303 (98% | 2%) |   Javascript_StatementOrComment: (Javascript_Statement | Javascript_Comment)
2,455 all all all Javascript_Subscript: '[' Javascript_Expression ']'
2,636 (90% | 10%) Javascript_Type: (("const"|"var"|"Array"|"Date"|"Image"|"String") | Javascript_Variable)
78,558 all 1.25(14%) 1.15(3%) Javascript_Variable: Javascript_VariableIdentifier [Javascript_DotIdentifier]* [Javascript_Subscript]*
14,112 all all |   Javascript_DotIdentifier: '.' Javascript_VariableIdentifier
92,670 (none | 100% | 0% | none) |   Javascript_VariableIdentifier: (Javascript_CastedVariable | Javascript_Identifier_Reference | ("this"|"class") | ("$"|"_"))
    |   |   Javascript_CastedVariable: '(' '(' Javascript_Type ')' Javascript_Identifier_Reference ')'
123 all 20% 67% Javascript_BreakStatement: "break" [Javascript_Identifier_Reference] [';']
1 all all Javascript_ContinueStatement: "continue" ';'
6 all all all all all all 50% Javascript_DoStatement: "do" Javascript_Statement "while" '(' Javascript_Expression ')' [';']
437 (13% | 87%) Javascript_ForStatement: (Javascript_ForCollectionStatement | Javascript_ForLoopStatement)
55 all all all 44% all all all all |   Javascript_ForCollectionStatement: "for" '(' Javascript_Type [Javascript_Variable] Javascript_InOrColon Javascript_Expression ')' Javascript_Statement
55 (none | all) |   |   Javascript_InOrColon: (':' | "in")
382 all all 97% all 94% 1.83(23%) 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
369 (37% | 63%) |   |   Javascript_ForLoopVariable: (Javascript_ForLoopVariableNoType | Javascript_ForLoopVariableWithType)
137 all |   |   |   Javascript_ForLoopVariableNoType: Javascript_Variable
232 all all |   |   |   Javascript_ForLoopVariableWithType: Javascript_Type Javascript_Variable
1,349 all all 1.02 none all 1.00(0%) all 1.17(2%) 24% Javascript_IfStatement: "if" '(' Javascript_Expression* [Javascript_Comment]* ')' [Javascript_Comment]* Javascript_Statement [Javascript_Comment]* [Javascript_IfElseClause]
319 all all |   Javascript_IfElseClause: "else" Javascript_Statement
1,085 all 96% 35% Javascript_ReturnStatement: "return" [Javascript_Expression] [';']
38 all all all all all 5.37 24% all Javascript_SwitchStatement: "switch" '(' Javascript_Expression ')' '{' Javascript_CaseClause* [Javascript_DefaultClause] '}'
204 all all all 1.49(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] [';']
180 all all 13.33(78%) all 1.00(all) none Javascript_TryStatement: "try" '{' [Javascript_StatementOrComment]* '}' [Javascript_CatchBlock]* [Javascript_FinallyBlock]
180 all all all all all |   Javascript_CatchBlock: "catch" '(' Javascript_Variable_Definition ')' Javascript_Statement
    |   Javascript_FinallyBlock: "finally" Javascript_Statement
18 all all all all all Javascript_WhileStatement: "while" '(' Javascript_Expression ')' Javascript_Statement

Terminals = 9 (instances=167,731)
Tokens = 93 (instances=779,641)

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