program
declaration
declaration
declaration
class_decl
class_decl
fun_decl
fun_decl
var_decl
var_decl
statement
statement
class_decl
CLASS
CLASS
identifier
identifier
'<'
identifier
identifier
LBRACE
LBRACE
function
function
property_
property_
class_decl
class_decl
RBRACE
RBRACE
CLASS
'class'
function
identifier
identifier
LPAR
LPAR
parameters
parameters
RPAR
RPAR
block
block
parameters
identifier
identifier
','
[suppress]
identifier
identifier
block
LBRACE
LBRACE
declaration
declaration
RBRACE
RBRACE
LBRACE
'{'
[suppress]
property_
identifier
identifier
block
block
RBRACE
'}'
[suppress]
fun_decl
FUN
FUN
identifier
identifier
LPAR
LPAR
parameters
parameters
RPAR
RPAR
block
block
FUN
'fun'
var_decl
VAR
VAR
identifier
identifier
EQ
EQ
expression
expression
SEMI
SEMI
VAR
'var'
expression
assignment
assignment
arith_operand_expression
arith_operand_expression
function
function
assignment
call
call
identifier
identifier
EQ
EQ
assignment
assignment
arith_operand_expression
arith_operand_expression
call
primary
primary
LPAR
LPAR
arguments
arguments
RPAR
RPAR
'.'
identifier
identifier
primary
TRUE
TRUE
FALSE
FALSE
NIL
NIL
THIS
THIS
number
number
string
string
identifier
identifier
SUPER
SUPER
'.'
identifier
identifier
arguments
expression
expression
','
[suppress]
expression
expression
EQ
'='
[suppress]
arith_operand_expression
'or' operations
'or' operations
'or' operations
'and' operations
'and' operations
OR
OR
'and' operations
'and' operations
'and' operations
'and' operations
'and' operations
!= | == operations
!= | == operations
AND
AND
!= | == operations
!= | == operations
!= | == operations
!= | == operations
!= | == operations
>= | > | <= | < operations
>= | > | <= | < operations
!= | ==
!= | ==
>= | > | <= | < operations
>= | > | <= | < operations
>= | > | <= | < operations
>= | > | <= | < operations
>= | > | <= | < operations
- | + operations
- | + operations
>= | > | <= | <
>= | > | <= | <
- | + operations
- | + operations
- | + operations
- | + operations
- | + operations
/ | * operations
/ | * operations
- | +
- | +
/ | * operations
/ | * operations
/ | * operations
/ | * operations
/ | * operations
! | - operations
! | - operations
/ | *
/ | *
! | - operations
! | - operations
! | - operations
! | - operations
! | - operations
! | -
! | -
! | - operations
! | - operations
call
call
TRUE
TRUE
FALSE
FALSE
NIL
NIL
THIS
THIS
number
number
string
string
identifier
identifier
SUPER
SUPER
'.'
identifier
identifier
nested_arith_operand
nested_arith_operand
! | -
[!\-]
TRUE
'true'
FALSE
'false'
NIL
'nil'
THIS
'this'
number
\d+(?:\.\d+)?
string
string enclosed in '"'
SUPER
'super'
identifier
W:(A-Z_a-z, '0-9A-Z_a-z)
nested_arith_operand
'('
[suppress]
arith_operand_expression
arith_operand_expression
')'
[suppress]
/ | *
[/*]
- | +
[\-+]
>= | > | <= | <
>=|>|<=|<
!= | ==
!=|==
AND
'and'
OR
'or'
statement
expr_statement
expr_statement
for_statement
for_statement
if_statement
if_statement
print_statement
print_statement
return_statement
return_statement
while_statement
while_statement
block
block
expr_statement
expression
expression
';'
for_statement
FOR
FOR
LPAR
LPAR
var_decl
var_decl
expr_statement
expr_statement
';'
expression
expression
';'
expression
expression
RPAR
RPAR
statement
statement
FOR
'for'
if_statement
IF
IF
LPAR
LPAR
expression
expression
RPAR
RPAR
statement
statement
ELSE
ELSE
statement
statement
IF
'if'
ELSE
'else'
print_statement
PRINT
PRINT
expression
expression
SEMI
SEMI
PRINT
'print'
return_statement
RETURN
RETURN
expression
expression
SEMI
SEMI
RETURN
'return'
SEMI
';'
[suppress]
while_statement
WHILE
WHILE
LPAR
LPAR
expression
expression
RPAR
RPAR
statement
statement
WHILE
'while'
LPAR
'('
[suppress]
RPAR
')'
[suppress]