~alexreg/mathtexdotnet/0.1

« back to all changes in this revision

Viewing changes to TeX-Grammar.ebnf

  • Committer: Alex Regueiro
  • Date: 2009-10-07 21:36:26 UTC
  • Revision ID: alexreg@gmail.com-20091007213626-8kaxszo50pmi7jse
Parser and composer now properly handle relation expressions/operators.
Major refactoring of TexComposer and TexUtilities classes; minor refactoring elsewhere. More comments also added.
Completed initial version of F# bindings for common utility methods.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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 ? }- , "}" ;