1 |
add op |
:= "+" | "-" | "bor" | "bxor" | "bsl" | "bsr" |
2 |
comp_op |
:= "==" | "/=" | "=<" | "<" | ">=" | ">" | "=:=" | "=/=" |
3 |
mult_op |
:= "*" | "/" | "div" | "rem" | "band" |
4 |
prefix_op |
:= "+" | "-" | "bnot" |
5 |
basic_type |
:= "atom" | "number" | "string" | "var" | "true" |
6 |
pattern |
:= basic_type | pattern_list | pattern_tuple |
7 |
pattern_list |
:= "[" "]" | "[" pattern pattern tail "]" |
8 |
pattern_tail |
:= "|" pattern | "," pattern pattern_tail | ε |
9 |
pattern_tuple |
:= "{" "}" | "{" patterns "}" |
10 |
patterns |
:= pattern | pattern "," patterns |
11 |
expr |
:= basic_type | list | tuple | function_call | expr add op expr | expr mult_op expr | prefix_op expr | "(" expr ")" | "begin" exprs "end" | "catch" expr | case_expr | if_expr | receive_expr | match_expr | send expr |
12 |
list |
:= "[" "]" | "[" expr expr_tail "]" |
13 |
expr_tail |
:= "|" expr | "," expr expr_tail | ε |
14 |
tuple |
:= "{" "}" | "{" exprs "}" |
15 |
function_call |
:= "atom" "(" parameter_list ")" | "atom" ":" "atom" "(" parameter_list ")" |
16 |
parameter_list |
:= exprs | ε |
17 |
case_expr |
:= "case" expr "of" cr_clauses "end" |
18 |
cr_clause |
:= pattern clause_guard clause_body |
19 |
cr_clauses |
:= cr_clause | cr_clause ";" cr_clauses |
20 |
if_expr |
:= "if" if_clauses "end" |
21 |
if_clause |
:= guard clause_body |
22 |
if_clauses |
:= if_clause | if_clause ";" if_clauses |
23 |
receive_expr |
:= "receive" "after" expr clause_body "end" | "receive" cr_clauses "end" | "receive" cr_clauses "after" expr clause_body "end" |
24 |
match_expr |
:= expr "=" expr |
25 |
send expr |
:= expr "!" expr |
26 |
exprs |
:= expr | expr "," exprs |
27 |
guard_expr |
:= basic_type | guard_expr_list | guard_expr_tuple | guard_call | "(" guard_expr ")" | guard_expr add op guard_expr | guard_expr mult_op guard_expr | prefix_op guard_expr |
28 |
guard_expr_list |
:= "[" "]" | "[" guard_expr guard_expr_tail "]" |
29 |
guard_expr_tail |
:= "|" guard_expr | "," guard_expr guard_expr_tail | ε |
30 |
guard_expr_tuple |
:= "{" "}" | "{" guard_exprs "}" |
31 |
guard_exprs |
:= guard_expr | guard_expr "," guard_exprs |
32 |
guard_call |
:= "atom" "(" guard_parameter_list ")" |
33 |
guard_parameter_list |
:= guard_exprs | ε |
34 |
bif_test |
:= "atom" "(" guard_parameter_list ")" |
35 |
guard_test |
:= bif_test | guard_expr comp_op guard_expr |
36 |
guard_tests |
:= guard_test | guard_test "," guard_tests |
37 |
guard |
:= "true" | guard_tests |
38 |
function_clause |
:= clause_head clause_guard clause_body |
39 |
clause_head |
:= "atom" "(" formal parameter_list ")" |
40 |
formal parameter_list |
:= patterns | ε |
41 |
clause_guard |
:= "when" guard | ε |
42 |
clause_body |
:= "->" exprs |
43 |
function |
:= function_clause | function_clause ";" function |
44 |
attribute |
:= pattern | "[" farity_list "]" | "atom" "," "[" farity_list "]" |
45 |
farity_list |
:= farity | farity "," farity_list |
46 |
farity |
:= "atom" "/" "number" |
47 |
form |
:= "-" "atom" "(" attribute ")" | function |