/itexToMML

To download this project, use:
bzr branch http://golem.ph.utexas.edu/~distler/code/itexToMML/

« back to all changes in this revision

Viewing changes to itex-src/itex2MML.l

  • Committer: Jacques Distler
  • Date: 2017-05-17 21:38:32 UTC
  • Revision ID: distler@golem.ph.utexas.edu-20170517213832-c8ss72aelc1fa8jm
Tags: 1.5.6
itex2MML 1.5.6

Support for:

  \overrightarrow{abc}
  \overleftarrow{abc}
  \␣
  inline equations delimited by \(...\)

Fixed bug in parsing

  \$

Show diffs side-by-side

added added

removed removed

1
 
/*             itex2MML 1.5.5
2
 
 *   itex2MML.l last modified 12/10/2016
 
1
/*             itex2MML 1.5.6
 
2
 *   itex2MML.l last modified 05/17/2017
3
3
 */
4
4
 
5
5
%{
47
47
 
48
48
<INITIAL>"$"{1,2}   BEGIN(MATH); itex2MML_inoptarg[0] = 0; itex2MML_rowposn=2; if (yyleng==2) { itex2MML_displaymode=1; return STARTDMATH;}; itex2MML_displaymode=0; return STARTMATH;
49
49
<INITIAL>"\\[" BEGIN(MATH); itex2MML_inoptarg[0] = 0; itex2MML_rowposn=2; itex2MML_displaymode=1; return STARTDMATH;
 
50
<INITIAL>"\\(" BEGIN(MATH); itex2MML_inoptarg[0] = 0; itex2MML_rowposn=2; itex2MML_displaymode=0; return STARTMATH;
50
51
<INITIAL>EOF    return 0;
51
52
<INITIAL>"\n" {itex2MML_lineno++; yylval=itex2MML_copy_string(yytext); return CHAR;}
52
53
<INITIAL>.     {yylval=itex2MML_copy_string(yytext); return CHAR;}
54
55
 
55
56
<MATH>{
56
57
 
57
 
 
58
 
 
 
58
"\\$"/.          {yylval=itex2MML_copy_string("$"); return MI;};
59
59
"$"{1,2} |
 
60
"\\)" |
60
61
"\\]"           {itex2MML_eqn_src[itex2MML_eqn_end-itex2MML_eqn_src-yyleng]=0; itex2MML_eqn_end=itex2MML_eqn_src; yylval=itex2MML_copy_escaped(itex2MML_eqn_src); BEGIN(INITIAL); return ENDMATH;}
61
62
 
62
 
 
63
63
"^"            return SUP;
64
64
"_"            return SUB; 
65
65
"{"[\t\r\n ]*"}"   return EMPTYMROW;
97
97
 
98
98
"\\&"           {yylval=itex2MML_copy_string("&amp;"); return MI;}
99
99
 
100
 
"\\$"           {yylval=itex2MML_copy_string("$"); return MI;}
101
100
"\\%"           {yylval=itex2MML_copy_string("%"); return MI;}
102
101
 
103
102
"\\\\"          itex2MML_rowposn=2; return ROWSEP;
791
790
"\\widebar"      {return WIDEBAR;}
792
791
 
793
792
"\\vec"       {return VEC;} 
794
 
"\\widevec"   {return WIDEVEC;}
 
793
"\\widevec" |
 
794
"\\overrightarrow" {return WIDEVEC;}
 
795
 
 
796
"\\overleftarrow" {return WIDELVEC;}
795
797
 
796
798
"\\dot"       {return DOT;}
797
799
"\\ddot"      {return DDOT;}
921
923
"\\:" |
922
924
"\\medspace"    {return MEDSPACE;}
923
925
 
 
926
"\\ " |
924
927
"\\;" |
925
928
"\\thickspace"  {return THICKSPACE;}
926
929