program:
program ::= dcl_stmt*
no referencesdcl_stmt:
dcl_stmt ::= var_stmt
| fn_stmt
referenced by:
program
var_stmt:
var_stmt ::= perm_ident ident_token value_type? ( ',' ident_token value_type? )* ( '=' append_exp ( ',' append_exp )* )? ';'
referenced by:
dcl_stmt
fn_stmt:
fn_stmt ::= fn_type block
referenced by:
addr
dcl_stmt
block:
block ::= '{' stmt* '}'
referenced by:
do_stmt
each_stmt
exp
fn_stmt
if_stmt
match_stmt
stmt
this_exp
value
while_stmt
stmt:
stmt ::= if_stmt
| match_stmt
| block
| while_stmt
| break_stmt
| cont_stmt
| each_stmt
| return_stmt
| do_stmt
| exp_stmt
| ';'
referenced by:
block
if_stmt:
if_stmt ::= 'if' logic_exp block ( 'elif' logic_exp block )* ( 'else' block )?
referenced by:
exp
stmt
match_stmt:
match_stmt
::= 'match' exp ( 'using' exp )? ( 'into' var_list )? ( 'with' exp ( 'into' var_list )? block )+ ( 'else' block )?
referenced by:
exp
stmt
while_stmt:
while_stmt
::= 'while' logic_exp block
referenced by:
stmt
each_stmt:
each_stmt
::= 'each' ( ident_token ':' )? var_list 'in' ( exp | '...' ) block
referenced by:
stmt
break_stmt:
break_stmt
::= 'break' clause ';'
referenced by:
stmt
cont_stmt:
cont_stmt
::= 'continue' clause ';'
referenced by:
stmt
return_stmt:
return_stmt
::= 'return' this_exp? clause ';'
referenced by:
stmt
do_stmt:
do_stmt ::= 'do' exp? block
referenced by:
stmt
exp_stmt:
exp_stmt ::= this_exp clause ';'
referenced by:
stmt
this_exp:
this_exp ::= exp ( ( 'using' exp )? block )?
referenced by:
exp_stmt
return_stmt
value
clause:
clause ::= ( ( 'if' | 'while' ) logic_exp | 'each' ( ident_token ':' )? var_list 'in' exp )*
referenced by:
break_stmt
cont_stmt
exp_stmt
return_stmt
var_list:
var_list ::= perm_ident? ident_token value_type ( ',' perm_ident? ident_token value_type )*
referenced by:
clause
each_stmt
match_stmt
value_type:
value_type
::= nbrtype
| arraytype
| ptrtype
| fntype
referenced by:
arraytype
fnparm
fntype
ptrtype
var_list
var_stmt
nbrtype:
nbrtype ::= 'i8'
| 'i16'
| 'i32'
| 'i64'
| 'u8'
| 'u16'
| 'u32'
| 'u64'
| 'f32'
| 'f64'
referenced by:
value_type
arraytype:
arraytype
::= '[' integer_token? ']' value_type
referenced by:
value_type
ptrtype:
ptrtype ::= '&' alloc-type? perm_type? value_type
referenced by:
value_type
fntype:
fntype ::= 'fn' ident_token? '(' fnparm ( ',' fnparm )* ')' ( value_type ( ',' value_type )* )?
referenced by:
value_type
fnparm:
fnparm ::= perm_ident? ident_token value_type? ( '=' ( literal | ident ) )?
referenced by:
fntype
perm_ident:
perm_ident
::= 'mut'
| 'imm'
| 'mmut'
| 'ro'
| 'mutx'
| 'id'
| ident_token
referenced by:
fnparm
var_list
var_stmt
alloc_type:
alloc_type
::= ident_token
no referencesexp:
exp ::= if_stmt
| match_stmt
| block
| assgn_exp
referenced by:
addr
clause
do_stmt
each_stmt
lvar
match_stmt
property
this_exp
value
assgn_exp:
assgn_exp
::= ( 'local'? lvar ( ( ',' lvar )* '=' | '+=' | '-=' | '*=' | '/=' ) | property ( ':' | ':=' ) )* append_exp ( ',' append_exp )*
referenced by:
exp
lvar:
lvar ::= ident_token ( '[' exp ']' | '.' ident_token )?
| '.' ident_token
| '*' exp
referenced by:
assgn_exp
append_exp:
append_exp
::= ( ternary_exp? ( '<<' | '>>' ) )? ternary_exp
referenced by:
assgn_exp
suffix
var_stmt
logic_exp:
logic_exp
::= not_exp ( ( '||' | '&&' | 'and' | 'or' ) not_exp )*
referenced by:
clause
if_stmt
while_stmt
not_exp:
not_exp ::= ( '!' | 'not' )* eval_exp
referenced by:
logic_exp
eval_exp:
eval_exp ::= range_exp ( ( '==' | '!=' | '~~' | '<=>' | '<' | '<=' | '>' | '>=' ) range_exp )?
referenced by:
not_exp
range_exp:
range_exp
::= bit_exp ( '..' bit_exp )? ( '..' bit_exp )?
referenced by:
eval_exp
bit_exp:
bit_exp ::= arith_exp ( ( '|' | '&' | '^' ) arith_exp )*
referenced by:
range_exp
arith_exp:
arith_exp
::= prefix_exp ( ( '+' | '-' | '*' | '/' | '%' ) prefix_exp )*
referenced by:
bit_exp
prefix_exp:
prefix_exp
::= ( ( '-' | '~' | '*' )* | '@' ) term
referenced by:
arith_exp
term:
term ::= ( value | suffix | '+' value ( text_token | symbol_token )? ) suffix*
referenced by:
prefix_exp
suffix:
suffix ::= ( ( '.' | '::' ) property )? ( '(' ( if_exp ( ',' if_exp )* )? ')' | '[' ( append_exp ( ',' append_exp )* )? ']' )?
referenced by:
term
property:
property ::= ident_token
| symbol_token
| integer_token
| '(' exp ')'
referenced by:
assgn_exp
suffix
value:
value ::= literal
| ident_token
| pseudo
| '(' exp ')'
| 'yield' this_exp?
| addr
| fn_type block
referenced by:
term
addr:
addr ::= '&' ( ident_token ( '[' exp ']' | '.' ident_token )? | '.' ident_token | fn_stmt )
referenced by:
value
pseudo:
pseudo ::= 'self'
| 'this'
| 'context'
| 'selfmethod'
| 'baseurl'
| '...'
referenced by:
value
literal:
literal ::= float_token
| integer_token
| text_token
| symbol_token
| url_token
| 'true'
| 'false'
| 'null'
referenced by:
fnparm
value
float_token:
float_token
::= ( '0' - '9' )+ '.' ( '0' - '9' )* ( ( 'e' | 'E' ) ( '-' | '+' )? ( '0' - '9' )+ )?
referenced by:
literal
integer_token:
integer_token
::= ( '0' - '9' )+
| '0x' ( '0' - '9' | 'a' - 'f' | 'A' - 'F' )+
referenced by:
arraytype
literal
property
text_token:
text_token
::= '"' any_char '"'
referenced by:
literal
term
symbol_token:
symbol_token
::= "'" any_char "'"
referenced by:
literal
property
term
url_token:
url_token
::= '@' any_char ( space | tab | lf | cr )
referenced by:
literal
ident_token:
ident_token
::= '`' any_char* '`'
| ( '$' | '_' | alpha_char ) ( alpha_char | '0' - '9' | '$' | '_' )*
referenced by:
addr
alloc_type
clause
each_stmt
fnparm
fntype
lvar
perm_ident
property
value
var_list
var_stmt
... generated by Railroad Diagram Generator