endofline:
endofline
::= newline
| $
referenced by:
Binding
Block
id:
id ::= letter ( letter | digit | _ )*
referenced by:
Binding
Comprehension
FunDec
ObjectDec
Param
Var
intlit:
intlit ::= digit+
referenced by:
Literal
floatlit:
floatlit ::= digit* '.' digit+
referenced by:
Literal
assignop:
assignop ::= '='
| '+='
| '-='
| '*='
| '/='
| '%='
referenced by:
AssignStmt
relop:
relop ::= '<'
| '<='
| '=='
| 'is'
| '!='
| 'isnt'
| '>='
| '>'
referenced by:
Exp2
addop:
addop ::= '+'
| '-'
referenced by:
Exp4
mulop:
mulop ::= '*'
| '/'
| '%'
| '//'
referenced by:
Exp5
expop:
expop ::= '**'
referenced by:
Exp7
prefixop:
prefixop ::= '!'
| '-'
no referencespostfixop:
postfixop
::= '++'
| '--'
referenced by:
Increment
boollit:
boollit ::= 'true'
| 'false'
referenced by:
Literal
stringlit:
stringlit
::= '"' char* '"'
| "'" char* "'"
referenced by:
Literal
nulllit:
nulllit ::= 'null'
referenced by:
Literal
comment:
comment ::= '#' [^\n]* newline
| '/#' .* '#/'
no referencesProgram:
Program ::= Block
no referencesBlock:
Block ::= ( Stmt? endofline )*
referenced by:
Body
Program
Stmt:
Stmt ::= WhileLoop
| IfStmt
| Loop
| ForLoop
| Dec
| Exp
| ReturnStmt
| BreakStmt
| ContinueStmt
referenced by:
Block
Dec:
Dec ::= AssignStmt
| FunDec
| ObjectDec
referenced by:
Stmt
AssignStmt:
AssignStmt
::= 'global'? Var assignop Exp
| Increment
referenced by:
Dec
Increment:
Increment
::= Var postfixop
referenced by:
AssignStmt
FunDec:
FunDec ::= 'fun' id Params Body
referenced by:
Dec
Params:
Params ::= '(' ( Param ( ',' Param )* )? ')'
referenced by:
FunDec
Lambda
Param:
Param ::= id '=' Exp
| id
referenced by:
Params
ObjectDec:
ObjectDec
::= 'class' id Body
referenced by:
Dec
Loop:
Loop ::= 'loop' Body
referenced by:
Stmt
WhileLoop:
WhileLoop
::= 'while' Exp Body
referenced by:
Stmt
ForLoop:
ForLoop ::= 'for' Exp Body
referenced by:
Stmt
IfStmt:
IfStmt ::= 'if' Exp Body ElseIfStmt* ElseSmt?
referenced by:
Stmt
ElseIfStmt:
ElseIfStmt
::= 'else if' Exp Body
referenced by:
IfStmt
ElseStmt:
ElseStmt ::= 'else' Body
no referencesBreakStmt:
BreakStmt
::= 'break'
referenced by:
Stmt
ContinueStmt:
ContinueStmt
::= 'continue'
referenced by:
Stmt
ReturnStmt:
ReturnStmt
::= 'return' Exp
referenced by:
Stmt
Body:
Body ::= '{' Block? '}'
referenced by:
ElseIfStmt
ElseStmt
ForLoop
FunDec
IfStmt
Lambda
Loop
ObjectDec
WhileLoop
Exp:
Exp ::= Exp1 ( ( 'or' | '||' ) Exp1 )*
referenced by:
AssignStmt
Binding
Comprehension
ElseIfStmt
Exp9
ExpList
ForLoop
IfStmt
Param
ReturnStmt
Stmt
TupleList
Var
WhileLoop
Exp1:
Exp1 ::= Exp2 ( ( 'and' | '&&' ) Exp2 )*
referenced by:
Exp
Exp2:
Exp2 ::= Exp3 ( relop Exp3 )?
referenced by:
Exp1
Exp3:
Exp3 ::= Range
| Exp4
referenced by:
Exp2
Range:
Range ::= Exp4 'to' Exp4 step?
| Exp4 '..' step?
| '..' Exp4 step?
referenced by:
Exp3
Step:
Step ::= 'by' Exp4
no referencesExp4:
Exp4 ::= Exp5 ( addop Exp5 )*
referenced by:
Exp3
Range
Step
Exp5:
Exp5 ::= Exp6 ( mulop Exp6 )*
referenced by:
Exp4
Exp6:
Exp6 ::= PrefixOp? Exp7
referenced by:
Exp5
Exp7:
Exp7 ::= Exp8 ( expop Exp8 )?
referenced by:
Exp6
Exp8:
Exp8 ::= ObjectCreation
| Var
| Exp9
referenced by:
Exp7
Exp9:
Exp9 ::= Literal
| '(' Exp ')'
| Lambda
| Comprehension
referenced by:
Exp8
Literal:
Literal ::= nulllit
| boollit
| intlit
| floatlit
| stringlit
| TupleLit
| ListLit
| SetLit
| MapLit
referenced by:
Exp9
Var:
Var ::= id ( '[' Exp ']' | '.' id | '(' ExpList ')' )*
referenced by:
AssignStmt
Exp8
Increment
ObjCreation
ExpList:
ExpList ::= Exp ( ',' Exp )*
referenced by:
ListLit
ObjCreation
SetLit
Var
Lambda:
Lambda ::= Params '->' Body
referenced by:
Exp9
Comprehension:
Comprehension
::= '[' Exp 'for' id 'in' Exp ']'
referenced by:
Exp9
ObjCreation:
ObjCreation
::= 'new' Var '(' ExpList ')'
no referencesTupleLit:
TupleLit ::= '(' TupleList? ')'
referenced by:
Literal
TupleList:
TupleList
::= Exp ',' ( Exp ( ',' Exp )* ','? )?
referenced by:
TupleLit
ListLit:
ListLit ::= '[' ExpList? ']'
referenced by:
Literal
SetLit:
SetLit ::= '<' ExpList? '>'
referenced by:
Literal
MapLit:
MapLit ::= '{' BindingList? '}'
referenced by:
Literal
BindingList:
BindingList
::= Binding ( ',' Binding )*
referenced by:
MapLit
Binding:
Binding ::= endofline? id ':' Exp endofline?
referenced by:
BindingList
... generated by Railroad Diagram Generator