InputElement ::= WhiteSpace | LineTerminator | Comment | Token

WhiteSpace ::= " " | "  "

LineTerminator ::= "\n" | "\r"

Comment ::= SingLineComment | MultilineComment
SingLineComment ::= "/" "/" <any>*
MultilineComment ::= "/" "*" ([^*] | "*" [^/])* "*' "/"

Token ::= Literal | Keywords | Identifier | Punctuator
Literal ::= NumberLiteral | BooleanLiteral | StringLiteral | NullLiteral
Keywords ::= "if" | "else" | "for" | "function" | .....
Punctuator ::= "+" | "-" | "*" | "/" |"{" | "}" | .....

Program ::= Statement+

Statement ::= ExpressionStatement | IfStatement | ForStatement | WhileStatement | VariableDeclaration | FunctionDeclaration | ClassDeclaration | BreakStatement |ContinueStatememt | ReturnStatement | ThrowStatement | TryStatement | Block

IfStatement ::= "if" "(" Expression ")" Statement

Block ::= "{" Statement "}"

TryStatement ::= "try" "{" Statement+ "}" "catch"  "(" Expression ")" "{" Statement "}"

ExpressionStatement ::= Expression ";"

expression ::= AdditiveExpression

AdditiveExpression ::= MultiplicativeExpression | AdditiveExpression ("+" | "-") MultiplicativeExpression

MultiplicativeExpression ::= UnaryExpression | MultiplicativeExpression ("*" | "/") UnaryExpression

UnaryExpression ::= PrimaryExpression | ("+" | "-" | "typeof") PrimaryExpression

PrimaryExpression ::= "(" Expression ")" | Literal | Identifier