1
input = fractional expr , ? EOF ? ;
2
relation expr = expr , [ ? relational op ? , relation expr ] ;
1
input = relation expr , ? EOF ? ;
2
relational expr = fractional expr , [ ? relation op ? , relational expr ] ;
3
3
fractional expr = expr [ "\over" , expr ] ;
4
4
expr = term , [ expr operator , signed term ] ;
5
5
expr operator = "+" | "-" | "\pm" | "\mp" ;
8
8
term operator = "*" | "/" | "\times" | "\cdot" | "\bmod" ;
9
9
factorial value = indexed value , [ "!" ] ;
10
10
indexed value = value , indices pair ;
11
value = raw value | group | bracket expr | factorial | fraction | binomial | root | function | big operator | text ;
11
value = raw value | group | bracketed expr | factorial | fraction | binomial | root | function | big operator | text ;
12
12
raw value = ? number ? | ? letter ? | ? greek letter ? ;
13
13
indices pair = ( [ "^" , index ] , [ "_" , index ] ) | ( [ "_" , index ] , [ "^" , index ] ) ;
14
14
index = raw value | group ;
15
group = "{" , fractional expr , "}" ;
16
bracket expr = "{" , expr , "}" | "(" , expr , ")" | "[" , expr , "]" | "\{" , expr , "\}" ;
15
group = "{" , relational expr , "}" ;
16
bracketed expr = "{" , relational expr , "}" | "(" , relational expr , ")" | "[" , relational expr , "]" |
17
"\{" , relational expr , "\}" ;
17
18
fraction = "\frac" , group , group ;
18
19
binomial = "\binom" , group , group ;
19
20
root = "\sqrt" , [ argument ] , group ;
20
function = ? function name ? , indices pair , fractional expr ;
21
function = ? function name ? , indices pair , relational expr ;
21
22
argument = "[" , expr , "]" ;
22
big operator = ? big operator ? , indices pair , fractional expr ;
23
big operator = ? big operator ? , indices pair , relational expr ;
23
24
text = "{" , { ? letter ? }- , "}" ;