~alexreg/mathtexdotnet/0.1

« back to all changes in this revision

Viewing changes to TeX-Grammar.ebnf

  • Committer: Alex Regueiro
  • Date: 2009-10-04 23:32:04 UTC
  • Revision ID: alexreg@gmail.com-20091004233204-svjkdnyg3c2vbip3
Parser now supports `\over` infix operator.
Unit tests for parser broken. (Need to fix handling of implicit multiplication.)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
input = expr , ? EOF ? ;
 
1
input = fractional expr , ? EOF ? ;
 
2
fractional expr = expr [ "\over" , expr ] ;
2
3
expr = term , { ( "+" | "-" ) , term } ;
3
 
term = first implicit term , [ ( "*" | "/" | "\cdot" | "\bmod" ) , term ] ;
4
 
first implicit term = signed value , [ implicit term ] ;
5
 
implicit term = factorial value , [ implicit term ] ;
 
4
term = signed value , [ ( "*" | "/" | "\times" | "\cdot" | "\bmod" ) , term | implicit term ] ;
 
5
implicit term = factorial value , implicit term | term ;
6
6
signed value = [ "+" | "-" ] , factorial value ;
7
7
factorial value = indexed value , [ "!" ] ;
8
8
indexed value = value , indices pair ;