InputElement ::= whiteSpace | LineTerminator | Comment | Token 

源代码以unicode为基础 

whiteSpace ::= ' ' | '  ' 

LineTerminator ::= '\n' | \r 

Comment ::=  SingleLineComment | MultiLineComment 

SingleLineComment ::= '/'  '/'  <any> *

MultiLineComment ::= '/' '*'  [^*] | '*' [^/]* '*'  '/'

Token ::= Literal ｜ Keywords ｜ Identifier | Punctuator

Literal ::= NumberLiteral  | BooleanLiteral | StringLiteral | NullLiteral | 

Keywords ::= 'if' | 'else' | 'for' | 'function' ......

Punctuator ::= '+' | '-' | '*' | '{' | '[' ......





symbol（无Literal）

Literal : 直接量

Keywords : 关键字

Identifier : 标识符

安全获取undefined (void(0))



Program ::= Statement

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