/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: 2013-12-08 07:03:50 UTC
  • Revision ID: distler@golem.ph.utexas.edu-20131208070350-bct56zppnyuou2jd
itex2MML 1.5.0beta

Embed equation source as an <annotation> in the
MathML output.

Show diffs side-by-side

added added

removed removed

1
 
/*             itex2MML 1.4.11
2
 
 *   itex2MML.l last modified 9/3/2013
 
1
/*             itex2MML 1.5.0
 
2
 *   itex2MML.l last modified 12/8/2013
3
3
 */
4
4
 
5
5
%{
29
29
int itex2MML_optarg_ind = 0;
30
30
int itex2MML_env_start = 0;
31
31
 
 
32
#define YY_USER_ACTION itex2MML_capture_eqn_src();
 
33
# define itex2MML_eqn_bufsize 131072
 
34
char itex2MML_eqn_buffer[itex2MML_eqn_bufsize];
 
35
char * itex2MML_eqn_src = itex2MML_eqn_buffer;
 
36
char * itex2MML_eqn_end = itex2MML_eqn_buffer;
 
37
 
32
38
int itex2MML_rowposn = 0;
33
39
int itex2MML_displaymode = 0;
34
40
 
50
56
 
51
57
 
52
58
"$"{1,2} |
53
 
"\\]"           {BEGIN(INITIAL); return ENDMATH;}
 
59
"\\]"           {itex2MML_eqn_buffer[itex2MML_eqn_end-itex2MML_eqn_src-yyleng]=0; itex2MML_eqn_end=itex2MML_eqn_buffer; yylval=itex2MML_copy_escaped(itex2MML_eqn_src); BEGIN(INITIAL); return ENDMATH;}
54
60
 
55
61
 
56
62
"^"            return SUP;
1093
1099
        s_itex2MML_length = length;
1094
1100
}
1095
1101
 
 
1102
int itex2MML_capture_eqn_src()
 
1103
{
 
1104
        if (YY_START != INITIAL && itex2MML_eqn_bufsize - (itex2MML_eqn_end-itex2MML_eqn_src) - yyleng > 1)
 
1105
        {
 
1106
                strcpy(itex2MML_eqn_end, yytext);
 
1107
                itex2MML_eqn_end += yyleng;
 
1108
        }
 
1109
}
 
1110
 
1096
1111
static int s_itex2MML_read (char * buffer, int max_size)
1097
1112
{
1098
1113
        int result = 0;