InputElement ::= WhiteSpace | LineTerminator | Comment | Token

WhiteSpace ::= " " | " "

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

Comment ::= SingleLineComment | MultiLineComment
SingleLineComment ::= "/" "/" <any>*
MultiLineComment ::= "/" "*" ([^*] | "*" [^/])* "*" "/"

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

Program ::= Statement+

Statement ::= ExpressionStatement | IfStatement | ForStatement | WhileStatement
        | VariableDeclaration | FunctionDeclaration | ClassDeclaration
        | BreakStatement | ContinueStatement | ReturnStatement
        | 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 | Identifer
