Expr = Expr "?" Expr ":" Expr
| Expr "||" Expr
| Expr "&&" Expr
| Expr in Expr
| Expr "|" Expr
| Expr "^" Expr
| Expr "&" Expr
| Expr "==" Expr
| Expr "!=" Expr
| Expr "===" Expr
| Expr "!==" Expr
| Expr "<" Expr
| Expr ">" Expr
| Expr "<=" Expr
| Expr ">=" Expr
| Expr "<<" Expr
| Expr ">>" Expr
| Expr ">>>" Expr
| Expr "@" Expr
| Expr "+" Expr
| Expr "-" Expr
| Expr "*" Expr
| Expr "/" Expr
| Expr "%" Expr
| "!" Expr
| "+" Expr
| "-" Expr
| "~" Expr
| "#" Expr
| final Expr
| new Expr
| Designator
| INTEGER
| FLOATINGPOINTNUMBER
| CHARACTER
| nil
| "(" Expr ")"
| Call
| "[" ElistPartsList "]"
| "{" ElistPartsList "}"
| STRING
| char
| int
| float
| hide
| hideblock
| vector
| table
| func
| thread
| class
| func "(" ")"
| char "(" Expr ")"
| int "(" Expr ")"
| float "(" Expr ")"
| vector "(" Expr ["," Expr] ")"
| table "(" Expr ")"
| thread "(" ")"
| class "(" ")"
| type
| type "(" Expr ")"
| func "(" Expr ")"
| thread "(" Expr ")"
| class "(" Expr ")"
Designator = DesignatorOrCall "[" Expr "]"
| DesignatorOrCall "{" Expr "}"
| DesignatorOrCall ActualParameters
| DesignatorOrCall "." IDENT
| IDENT
ElistPartsList = [ Expr [ ":" Expr ] {"," Expr [ ":" Expr ] } ]
DesignatorOrCall = Designator
| Call
Call = Designator ActualParameters
ActualParameters = "(" [ Expr { "," Expr } ] ")"
VarParList = VarPar { "," VarPar }
VarPar = [final] IDENT [ "=" Expr]
Stmt = ExecutiveStmt
| Declaration
Assign = "="
| "*="
| "/="
| "%="
| "+="
| "-="
| "@="
| "<<="
| ">>="
| ">>>="
| "&="
| "^="
| "|="
ExecutiveStmt = ";"
| Designator Assign Expr ";"
| Designator ("++" | "--") ";"
| ("++" | "--") Designator ";"
| Designator ActualParameters ";"
| if "(" Expr ")" Stmt [ else Stmt ]
| for "(" Stmt ForGuardExpr ";" Stmt ")" Stmt
| for "(" Designator in Expr ")" Stmt
| break ";"
| continue ";"
| return [ Expr ] ";"
| throw Expr ";"
| wait "(" Expr ")" Stmt
| BlockStmt
| TryBlockStmt
ForGuardExpr = [Expr]
BlockStmt = Block
TryBlockStmt = try Block { Catch }
Catch = catch "(" ExceptClassList ")" Block
ExceptClassList = Expr { "," Expr }
Declaration = VarDeclarations
| AccessClause
| ExternDeclarations
| FuncClassExtDeclaration
| IncludeDeclaration
VarDeclarations = var VarParList ";"
ExternDeclarations = extern ExternItem { "," ExternItem } ";"
FuncClassExtDeclaration = Header Block
AccessClause = (public | private | friend) AccessList ";"
AccessList = IDENT { "," IDENT }
IncludeDeclaration = include ["+"] STRING ";"
ExternItem = IDENT
| IDENT "(" ")"
Header = [final] FuncThreadClass IDENT FormalParameters
| ext IDENT
FuncThreadClass = func
| thread
| class
FormalParameters = "(" [ VarParList ] ")"
| "(" VarParList "," "..." ")"
| "(" "..." ")"
Block = "{" StmtList "}"
StmtList = { Stmt }
Program = StmtList