mathematical 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1084 @@
1
+ /* itex2MML 1.4.5
2
+ * itex2MML.l last modified 10/2/2010
3
+ */
4
+
5
+ %{
6
+ %}
7
+ %option noyywrap
8
+ %x MATH ATTRIBUTELIST BBOLD FRAKTUR CALLIGRAPHIC ROMAN PLAINTEXT INT1 INT2 INT3 MATHENV SVGENV SVGEND OPTARG ARRAYOPTIONS COLOPTS
9
+ %{
10
+ #include <string.h>
11
+
12
+ #define YYSTYPE char *
13
+
14
+ #include "y.tab.h"
15
+ #include "itex2MML.h"
16
+
17
+ #define YY_NEVER_INTERACTIVE 1
18
+ #define YY_INPUT(buffer,result,max_size) result = s_itex2MML_read (buffer, max_size)
19
+ #define YY_NO_INPUT
20
+
21
+ static int s_itex2MML_read (char * buffer, int max_size);
22
+
23
+ #define yylval itex2MML_yylval
24
+ #define itex2MML_optarg_depth 100
25
+
26
+ extern char * yylval;
27
+
28
+ int itex2MML_lineno = 1;
29
+ int itex2MML_inoptarg[itex2MML_optarg_depth];
30
+ int itex2MML_optarg_ind = 0;
31
+ int itex2MML_env_start = 0;
32
+
33
+ int itex2MML_rowposn = 0;
34
+ int itex2MML_displaymode = 0;
35
+
36
+ %}
37
+ %%
38
+ %{ if (itex2MML_rowposn==1) itex2MML_rowposn=0;
39
+ if (itex2MML_rowposn==2) itex2MML_rowposn=1;
40
+ %}
41
+
42
+ <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;
43
+ <INITIAL>"\\[" BEGIN(MATH); itex2MML_inoptarg[0] = 0; itex2MML_rowposn=2; itex2MML_displaymode=1; return STARTDMATH;
44
+ <INITIAL>EOF return 0;
45
+ <INITIAL>"\n" {itex2MML_lineno++; yylval=itex2MML_copy_string(yytext); return CHAR;}
46
+ <INITIAL>. {yylval=itex2MML_copy_string(yytext); return CHAR;}
47
+
48
+
49
+ <MATH>{
50
+
51
+
52
+
53
+ "$"{1,2} |
54
+ "\\]" {BEGIN(INITIAL); return ENDMATH;}
55
+
56
+
57
+ "^" return SUP;
58
+ "_" return SUB;
59
+ "{"[\t\r\n ]*"}" return EMPTYMROW;
60
+ "{" {itex2MML_rowposn = 2; if(itex2MML_inoptarg[itex2MML_optarg_ind] != 0) itex2MML_inoptarg[itex2MML_optarg_ind]++; return MROWOPEN;}
61
+ "}" {if(itex2MML_inoptarg[itex2MML_optarg_ind] != 0) itex2MML_inoptarg[itex2MML_optarg_ind]--; return MROWCLOSE;}
62
+
63
+ "\\left" itex2MML_rowposn=2; return LEFT;
64
+ "\\right" return RIGHT;
65
+
66
+ "\\big" |
67
+ "\\bigr" {return BIG;}
68
+ "\\Big" |
69
+ "\\Bigr" {return BBIG;}
70
+ "\\bigg" |
71
+ "\\biggr" {return BIGG;}
72
+ "\\Bigg" |
73
+ "\\Biggr" {return BBIGG;}
74
+
75
+ "\\bigl" {return BIGL;}
76
+ "\\Bigl" {return BBIGL;}
77
+ "\\biggl" {return BIGGL;}
78
+ "\\Biggl" {return BBIGGL;}
79
+
80
+ "\\mathrlap" {return RLAP;}
81
+ "\\mathllap" {return LLAP;}
82
+ "\\mathclap" {return CLAP;}
83
+ "\\rlap" |
84
+ "\\llap" |
85
+ "\\ulap" |
86
+ "\\dlap" {/* Ignore */ ;}
87
+
88
+
89
+ "&amp;" |
90
+ "&" {itex2MML_rowposn=2; return COLSEP;}
91
+
92
+ "\\&" {yylval=itex2MML_copy_string("&amp;"); return MI;}
93
+
94
+ "\\$" {yylval=itex2MML_copy_string("$"); return MI;}
95
+ "\\%" {yylval=itex2MML_copy_string("%"); return MI;}
96
+
97
+ "\\\\" itex2MML_rowposn=2; return ROWSEP;
98
+
99
+ [a-zA-Z]+ {yylval=itex2MML_copy_string(yytext); return MI;}
100
+
101
+ [0-9,.]*[0-9]+ {yylval=itex2MML_copy_string(yytext); return MN;}
102
+ "\\infty" |
103
+ "\\infinity" {yylval=itex2MML_copy_string("&infin;"); return MN;}
104
+
105
+ "(" |
106
+ "[" {yylval=itex2MML_copy_string(yytext); return LEFTDELIM;}
107
+
108
+ ")" {yylval=itex2MML_copy_string(yytext); return RIGHTDELIM;}
109
+ "]" {if(itex2MML_inoptarg[itex2MML_optarg_ind]==1 && itex2MML_optarg_ind > 0) {itex2MML_inoptarg[itex2MML_optarg_ind]=0; itex2MML_optarg_ind--; return OPTARGCLOSE;} else {yylval=itex2MML_copy_string(yytext); return RIGHTDELIM;}}
110
+
111
+ "\\lbrace" |
112
+ "\\{" {yylval=itex2MML_copy_string("{"); return LEFTDELIM;}
113
+ "\\rbrace" |
114
+ "\\}" {yylval=itex2MML_copy_string("}"); return RIGHTDELIM;}
115
+
116
+ "\\vert" |
117
+ "|" {yylval=itex2MML_copy_string("&VerticalBar;"); return OTHERDELIM;}
118
+ "\\Vert" |
119
+ "\\|" {yylval=itex2MML_copy_string("&DoubleVerticalBar;"); return OTHERDELIM;}
120
+
121
+ "\\setminus" {yylval=itex2MML_copy_string("&setminus;"); return MO;}
122
+ "\\backslash" {yylval=itex2MML_copy_string("&bsol;"); return MO;}
123
+ "\\smallsetminus" {yylval=itex2MML_copy_string("&#xFE68;"); return MOF;}
124
+
125
+ "\\sslash" {yylval=itex2MML_copy_string("&parsl;"); return MO;}
126
+
127
+ "\\lfloor" |
128
+ "\\lceil" |
129
+ "\\lang" |
130
+ "\\langle" {yylval=itex2MML_copy2(yytext, ";"); if (yylval != itex2MML_empty_string) yylval[0]='&'; return LEFTDELIM;}
131
+
132
+ "\\rfloor" |
133
+ "\\rceil" |
134
+ "\\rang" |
135
+ "\\rangle" {yylval=itex2MML_copy2(yytext, ";"); if (yylval != itex2MML_empty_string) yylval[0]='&'; return RIGHTDELIM;}
136
+
137
+ "/" {yylval=itex2MML_copy_string(yytext); return OTHERDELIM;}
138
+
139
+ "\\uparrow" |
140
+ "\\downarrow" |
141
+ "\\updownarrow" {yylval=itex2MML_copy2(yytext, ";"); if (yylval != itex2MML_empty_string) yylval[0]='&'; return OTHERDELIM;}
142
+
143
+ "." {yylval=itex2MML_copy_string(yytext); return PERIODDELIM;}
144
+
145
+ "-" {if (itex2MML_rowposn==1) return UNARYMINUS; else {yylval=itex2MML_copy_string("&minus;"); return MO;}}
146
+
147
+ "+" {if (itex2MML_rowposn==1) return UNARYPLUS; else {yylval=itex2MML_copy_string("+"); return MO;}}
148
+
149
+ "\\#" {yylval=itex2MML_copy_string("#"); return MOL;}
150
+
151
+ "," |
152
+ ":" |
153
+ "!" |
154
+ "=" |
155
+ "~" |
156
+ ";" |
157
+ "?" |
158
+ "#" |
159
+ "`" |
160
+ "*" {yylval=itex2MML_copy_string(yytext); return MOL;}
161
+
162
+ "\\prime" {yylval=itex2MML_copy_string("&prime;"); return MOLL;}
163
+ "'" {yylval=itex2MML_copy_string("&prime;"); return MOL;}
164
+ "''" {yylval=itex2MML_copy_string("&Prime;"); return MOL;}
165
+ "'''" {yylval=itex2MML_copy_string("&#8244;"); return MOL;}
166
+ "''''" {yylval=itex2MML_copy_string("&#8279;"); return MOL;}
167
+
168
+ "\\alpha" |
169
+ "\\beta" |
170
+ "\\gamma" |
171
+ "\\delta" |
172
+ "\\zeta" |
173
+ "\\eta" |
174
+ "\\theta" |
175
+ "\\iota" |
176
+ "\\kappa" |
177
+ "\\lambda" |
178
+ "\\mu" |
179
+ "\\nu" |
180
+ "\\xi" |
181
+ "\\pi" |
182
+ "\\rho" |
183
+ "\\sigma" |
184
+ "\\tau" |
185
+ "\\upsilon" |
186
+ "\\chi" |
187
+ "\\psi" |
188
+ "\\omega" |
189
+ "\\backepsilon" |
190
+ "\\varkappa" |
191
+ "\\varpi" |
192
+ "\\varrho" |
193
+ "\\varsigma" |
194
+ "\\vartheta" {yylval=itex2MML_copy2(yytext, ";"); if (yylval != itex2MML_empty_string) yylval[0]='&'; return MI;}
195
+
196
+ "\\varepsilon" {yylval=itex2MML_copy_string("&#x03B5;"); return MI;}
197
+ "\\phi" {yylval=itex2MML_copy_string("&#x03D5;"); return MI;}
198
+ "\\varphi" {yylval=itex2MML_copy_string("&#x03C6;"); return MI;}
199
+
200
+ "\\arccos" |
201
+ "\\arcsin" |
202
+ "\\arctan" |
203
+ "\\arg" |
204
+ "\\cos" |
205
+ "\\cosh" |
206
+ "\\cot" |
207
+ "\\coth" |
208
+ "\\csc" |
209
+ "\\deg" |
210
+ "\\dim" |
211
+ "\\exp" |
212
+ "\\hom" |
213
+ "\\ker" |
214
+ "\\lg" |
215
+ "\\ln" |
216
+ "\\log" |
217
+ "\\sec" |
218
+ "\\sin" |
219
+ "\\sinh" |
220
+ "\\tan" |
221
+ "\\tanh" {yylval=itex2MML_copy_string(yytext+1); return MI;}
222
+
223
+ "\\det" |
224
+ "\\gcd" |
225
+ "\\inf" |
226
+ "\\lim" |
227
+ "\\liminf" |
228
+ "\\limsup" |
229
+ "\\max" |
230
+ "\\min" |
231
+ "\\Pr" |
232
+ "\\sup" {yylval=itex2MML_copy_string(yytext+1); return MIB;}
233
+
234
+ "\\omicron" {yylval=itex2MML_copy_string("&oscr;"); return MI;}
235
+
236
+ "\\epsilon" {yylval=itex2MML_copy_string("&epsi;"); return MI;}
237
+
238
+ "\\cdot" {yylval=itex2MML_copy_string("&sdot;"); return MO;}
239
+
240
+ "\\Alpha" |
241
+ "\\Beta" |
242
+ "\\Delta" |
243
+ "\\Gamma" |
244
+ "\\digamma" |
245
+ "\\Lambda" |
246
+ "\\Pi" |
247
+ "\\Phi" |
248
+ "\\Psi" |
249
+ "\\Sigma" |
250
+ "\\Theta" |
251
+ "\\Xi" |
252
+ "\\Zeta" |
253
+ "\\Eta" |
254
+ "\\Iota" |
255
+ "\\Kappa" |
256
+ "\\Mu" |
257
+ "\\Nu" |
258
+ "\\Rho" |
259
+ "\\Tau" |
260
+ "\\mho" |
261
+ "\\Omega" {yylval=itex2MML_copy2(yytext, ";"); if (yylval != itex2MML_empty_string) yylval[0]='&'; return MI;}
262
+
263
+ "\\Upsilon" |
264
+ "\\Upsi" {yylval=itex2MML_copy_string("&Upsi;"); return MI;}
265
+
266
+ "\\iff" |
267
+ "\\Longleftrightarrow" {yylval=itex2MML_copy_string("&iff;"); return MOL;}
268
+
269
+ "\\Leftrightarrow" {yylval=itex2MML_copy_string("&Leftrightarrow;"); return MOL;}
270
+
271
+ "\\impliedby" |
272
+ "\\Leftarrow" {yylval=itex2MML_copy_string("&Leftarrow;"); return MOL;}
273
+
274
+ "\\implies" |
275
+ "\\Rightarrow" {yylval=itex2MML_copy_string("&Rightarrow;"); return MOL;}
276
+
277
+ "\\hookleftarrow" {yylval=itex2MML_copy_string("&hookleftarrow;"); return MOL;}
278
+
279
+ "\\embedsin" |
280
+ "\\hookrightarrow" {yylval=itex2MML_copy_string("&hookrightarrow;"); return MOL;}
281
+
282
+ "\\longleftarrow" {yylval=itex2MML_copy_string("&longleftarrow;"); return MOL;}
283
+
284
+ "\\longrightarrow" {yylval=itex2MML_copy_string("&longrightarrow;"); return MOL;}
285
+
286
+ "\\leftarrow" {yylval=itex2MML_copy_string("&leftarrow;"); return MOL;}
287
+
288
+ "\\to" |
289
+ "\\rightarrow" {yylval=itex2MML_copy_string("&rightarrow;"); return MOL;}
290
+
291
+ "\\leftrightarrow" {yylval=itex2MML_copy_string("&leftrightarrow;"); return MOL;}
292
+
293
+ "\\mapsto" |
294
+ "\\map" {yylval=itex2MML_copy_string("&map;"); return MOL;}
295
+
296
+ "\\nearrow" |
297
+ "\\nearr" {yylval=itex2MML_copy_string("&nearr;"); return MOL;}
298
+
299
+ "\\nwarrow" |
300
+ "\\nwarr" {yylval=itex2MML_copy_string("&nwarr;"); return MOL;}
301
+
302
+ "\\searrow" |
303
+ "\\searr" {yylval=itex2MML_copy_string("&searr;"); return MOL;}
304
+
305
+ "\\swarrow" |
306
+ "\\swarr" {yylval=itex2MML_copy_string("&swarr;"); return MOL;}
307
+
308
+ "\\neArrow" |
309
+ "\\neArr" {yylval=itex2MML_copy_string("&neArr;"); return MOL;}
310
+
311
+ "\\nwArrow" |
312
+ "\\nwArr" {yylval=itex2MML_copy_string("&nwArr;"); return MOL;}
313
+
314
+ "\\seArrow" |
315
+ "\\seArr" {yylval=itex2MML_copy_string("&seArr;"); return MOL;}
316
+
317
+ "\\swArrow" |
318
+ "\\swArr" {yylval=itex2MML_copy_string("&swArr;"); return MOL;}
319
+
320
+ "\\darr" {yylval=itex2MML_copy_string("&darr;"); return MOL;}
321
+
322
+ "\\Downarrow" {yylval=itex2MML_copy_string("&dArr;"); return MOL;}
323
+
324
+ "\\uparr" {yylval=itex2MML_copy_string("&uarr;"); return MOL;}
325
+
326
+ "\\Uparrow" {yylval=itex2MML_copy_string("&uArr;"); return MOL;}
327
+
328
+ "\\downuparrow" |
329
+ "\\duparr" |
330
+ "\\updarr" {yylval=itex2MML_copy_string("&updownarrow;"); return MOL;}
331
+
332
+ "\\Updownarrow" {yylval=itex2MML_copy_string("&Updownarrow;"); return MOL;}
333
+
334
+ "\\leftsquigarrow" {yylval=itex2MML_copy_string("&#x21DC;"); return MOL;}
335
+ "\\rightsquigarrow" {yylval=itex2MML_copy_string("&zigrarr;"); return MOL;}
336
+ "\\dashleftarrow" {yylval=itex2MML_copy_string("&#x290E;"); return MOL;}
337
+ "\\dashrightarrow" {yylval=itex2MML_copy_string("&#x290F;"); return MOL;}
338
+ "\\curvearrowbotright" {yylval=itex2MML_copy_string("&#x293B;"); return MOL;}
339
+ "\\righttoleftarrow" {yylval=itex2MML_copy_string("&#x27F2;"); return MOL;}
340
+ "\\lefttorightarrow" {yylval=itex2MML_copy_string("&#x27F3;"); return MOL;}
341
+ "\\leftrightsquigarrow" |
342
+ "\\upuparrows" |
343
+ "\\rightleftarrows" |
344
+ "\\rightrightarrows" |
345
+ "\\curvearrowleft" |
346
+ "\\curvearrowright" |
347
+ "\\downdownarrows" |
348
+ "\\leftarrowtail" |
349
+ "\\rightarrowtail" |
350
+ "\\leftleftarrows" |
351
+ "\\leftrightarrows" |
352
+ "\\Lleftarrow" |
353
+ "\\Rrightarrow" |
354
+ "\\looparrowleft" |
355
+ "\\looparrowright" |
356
+ "\\Lsh" |
357
+ "\\Rsh" |
358
+ "\\circlearrowleft" |
359
+ "\\circlearrowright" |
360
+ "\\twoheadleftarrow" |
361
+ "\\twoheadrightarrow" |
362
+ "\\nLeftarrow" |
363
+ "\\nleftarrow" |
364
+ "\\nLeftrightarrow" |
365
+ "\\nleftrightarrow" |
366
+ "\\nRightarrow" |
367
+ "\\nrightarrow" |
368
+ "\\downharpoonleft" |
369
+ "\\downharpoonright" |
370
+ "\\leftrightharpoons" |
371
+ "\\rightleftharpoons" |
372
+ "\\upharpoonleft" |
373
+ "\\upharpoonright" {yylval=itex2MML_copy2(yytext, ";"); if (yylval != itex2MML_empty_string) yylval[0]='&'; return MOL;}
374
+
375
+ "\\xrightarrow" |
376
+ "\\xleftarrow" |
377
+ "\\xleftrightarrow" |
378
+ "\\xLeftarrow" |
379
+ "\\xRightarrow" |
380
+ "\\xLeftrightarrow" |
381
+ "\\xleftrightharpoons" |
382
+ "\\xrightleftharpoons" |
383
+ "\\xhookleftarrow" |
384
+ "\\xhookrightarrow" |
385
+ "\\xmapsto" {BEGIN(OPTARG); char * s1 = itex2MML_copy_string(yytext+2); yylval = itex2MML_copy3("&", s1, ";"); itex2MML_free_string(s1); return XARROW;}
386
+
387
+ "\\dots" |
388
+ "\\ldots" {yylval=itex2MML_copy_string("&hellip;"); return MI;}
389
+ "\\cdots" {yylval=itex2MML_copy_string("&ctdot;"); return MI;}
390
+ "\\ddots" {yylval=itex2MML_copy_string("&dtdot;"); return MI;}
391
+ "\\udots" {yylval=itex2MML_copy_string("&utdot;"); return MI;}
392
+ "\\vdots" {yylval=itex2MML_copy_string("&vellip;"); return MI;}
393
+ "\\colon" {yylval=itex2MML_copy_string("&colon;"); return MOR;}
394
+
395
+ "\\cup" |
396
+ "\&union;" |
397
+ "\\union" {yylval=itex2MML_copy_string("&cup;"); return MOL;}
398
+
399
+ "\\bigcup" |
400
+ "\\Union" |
401
+ "\&Union;" {yylval=itex2MML_copy_string("&Union;"); return MOB;}
402
+
403
+ "\\cap" |
404
+ "\\intersection" {yylval=itex2MML_copy_string("&cap;"); return MOL;}
405
+
406
+ "\\bigcap" |
407
+ "\\Intersection" {yylval=itex2MML_copy_string("&Intersection;"); return MOB;}
408
+
409
+ "\\in" {yylval=itex2MML_copy_string("&Element;"); return MOL;}
410
+
411
+ /* For some reason, Firefox does not put in the right spacing around some of these operators
412
+ * unless we ask for it, explicitly.
413
+ */
414
+ "\\coloneqq" {yylval=itex2MML_copy_string("&colone;"); return MOL;}
415
+ "\\Coloneqq" {yylval=itex2MML_copy_string("&Colone;"); return MOS;}
416
+ "\\coloneq" {yylval=itex2MML_copy_string("&#x2236;&#x2212;"); return MOS;}
417
+ "\\Coloneq" {yylval=itex2MML_copy_string("&#x2237;&#x2212;"); return MOS;}
418
+ "\\eqqcolon" {yylval=itex2MML_copy_string("&ecolon;"); return MOS;}
419
+ "\\Eqqcolon" {yylval=itex2MML_copy_string("&#x003d;&#x2237;"); return MOS;}
420
+ "\\eqcolon" {yylval=itex2MML_copy_string("&#x2239;"); return MOS;}
421
+ "\\Eqcolon" {yylval=itex2MML_copy_string("&#x2212;&#x2237;"); return MOS;}
422
+ "\\colonapprox" {yylval=itex2MML_copy_string("&#x2236;&#x2248;"); return MOS;}
423
+ "\\Colonapprox" {yylval=itex2MML_copy_string("&#x2237;&#x2248;"); return MOS;}
424
+ "\\colonsim" {yylval=itex2MML_copy_string("&#x2236;&#x223C;"); return MOS;}
425
+ "\\Colonsim" {yylval=itex2MML_copy_string("&#x2237;&#x223C;"); return MOS;}
426
+ "\\dblcolon" {yylval=itex2MML_copy_string("&Colon;"); return MOL;}
427
+
428
+ "\\ast" |
429
+ "\\Cap" |
430
+ "\\Cup" |
431
+ "\\circledast" |
432
+ "\\circledcirc" |
433
+ "\\curlyvee" |
434
+ "\\curlywedge" |
435
+ "\\divideontimes" |
436
+ "\\dotplus" |
437
+ "\\leftthreetimes" |
438
+ "\\rightthreetimes" |
439
+ "\\veebar" |
440
+ "\\gt" |
441
+ "\\lt" |
442
+ "\\approxeq" |
443
+ "\\backsim" |
444
+ "\\backsimeq" |
445
+ "\\barwedge" |
446
+ "\\doublebarwedge" |
447
+ "\\subset" |
448
+ "\\subseteq" |
449
+ "\\subseteqq" |
450
+ "\\subsetneq" |
451
+ "\\subsetneqq" |
452
+ "\\varsubsetneq" |
453
+ "\\varsubsetneqq" |
454
+ "\\prec" |
455
+ "\\parallel" |
456
+ "\\nparallel" |
457
+ "\\shortparallel" |
458
+ "\\nshortparallel" |
459
+ "\\perp" |
460
+ "\\eqslantgtr" |
461
+ "\\eqslantless" |
462
+ "\\gg" |
463
+ "\\ggg" |
464
+ "\\geq" |
465
+ "\\geqq" |
466
+ "\\geqslant" |
467
+ "\\gneq" |
468
+ "\\gneqq" |
469
+ "\\gnapprox" |
470
+ "\\gnsim" |
471
+ "\\gtrapprox" |
472
+ "\\ge" |
473
+ "\\le" |
474
+ "\\leq" |
475
+ "\\leqq" |
476
+ "\\leqslant" |
477
+ "\\lessapprox" |
478
+ "\\lessdot" |
479
+ "\\lesseqgtr" |
480
+ "\\lesseqqgtr" |
481
+ "\\lessgtr" |
482
+ "\\lneq" |
483
+ "\\lneqq" |
484
+ "\\lnsim" |
485
+ "\\lvertneqq" |
486
+ "\\gtrsim" |
487
+ "\\gtrdot" |
488
+ "\\gtreqless" |
489
+ "\\gtreqqless" |
490
+ "\\gtrless" |
491
+ "\\gvertneqq" |
492
+ "\\lesssim" |
493
+ "\\lnapprox" |
494
+ "\\nsubset" |
495
+ "\\nsubseteq" |
496
+ "\\nsubseteqq" |
497
+ "\\notin" |
498
+ "\\ni" |
499
+ "\\notni" |
500
+ "\\nmid" |
501
+ "\\nshortmid" |
502
+ "\\preceq" |
503
+ "\\npreceq" |
504
+ "\\ll" |
505
+ "\\ngeq" |
506
+ "\\ngeqq" |
507
+ "\\ngeqslant" |
508
+ "\\nleq" |
509
+ "\\nleqq" |
510
+ "\\nleqslant" |
511
+ "\\nless" |
512
+ "\\supset" |
513
+ "\\supseteq" |
514
+ "\\supseteqq" |
515
+ "\\supsetneq" |
516
+ "\\supsetneqq" |
517
+ "\\varsupsetneq" |
518
+ "\\varsupsetneqq" |
519
+ "\\approx" |
520
+ "\\asymp" |
521
+ "\\bowtie" |
522
+ "\\dashv" |
523
+ "\\Vdash" |
524
+ "\\vDash" |
525
+ "\\VDash" |
526
+ "\\vdash" |
527
+ "\\Vvdash" |
528
+ "\\models" |
529
+ "\\sim" |
530
+ "\\simeq" |
531
+ "\\nsim" |
532
+ "\\smile" |
533
+ "\\triangle" |
534
+ "\\triangledown" |
535
+ "\\triangleleft" |
536
+ "\\cong" |
537
+ "\\succ" |
538
+ "\\nsucc" |
539
+ "\\ngtr" |
540
+ "\\nsupset" |
541
+ "\\nsupseteq" |
542
+ "\\propto" |
543
+ "\\equiv" |
544
+ "\\nequiv" |
545
+ "\\frown" |
546
+ "\\triangleright" |
547
+ "\\ncong" |
548
+ "\\succeq" |
549
+ "\\succapprox" |
550
+ "\\succnapprox" |
551
+ "\\succcurlyeq" |
552
+ "\\succsim" |
553
+ "\\succnsim" |
554
+ "\\nsucceq" |
555
+ "\\nvDash" |
556
+ "\\nvdash" |
557
+ "\\nVDash" |
558
+ "\\amalg" |
559
+ "\\pm" |
560
+ "\\mp" |
561
+ "\\bigcirc" |
562
+ "\\wr" |
563
+ "\\odot" |
564
+ "\\uplus" |
565
+ "\\clubsuit" |
566
+ "\\spadesuit" |
567
+ "\\Diamond" |
568
+ "\\diamond" |
569
+ "\\sqcup" |
570
+ "\\sqcap" |
571
+ "\\sqsubset" |
572
+ "\\sqsubseteq" |
573
+ "\\sqsupset" |
574
+ "\\sqsupseteq" |
575
+ "\\Subset" |
576
+ "\\Supset" |
577
+ "\\ltimes" |
578
+ "\\div" |
579
+ "\\rtimes" |
580
+ "\\bot" |
581
+ "\\therefore" |
582
+ "\\thickapprox" |
583
+ "\\thicksim" |
584
+ "\\varpropto" |
585
+ "\\varnothing" |
586
+ "\\flat" |
587
+ "\\vee" |
588
+ "\\because" |
589
+ "\\between" |
590
+ "\\Bumpeq" |
591
+ "\\bumpeq" |
592
+ "\\circeq" |
593
+ "\\curlyeqprec" |
594
+ "\\curlyeqsucc" |
595
+ "\\doteq" |
596
+ "\\doteqdot" |
597
+ "\\eqcirc" |
598
+ "\\fallingdotseq" |
599
+ "\\multimap" |
600
+ "\\pitchfork" |
601
+ "\\precapprox" |
602
+ "\\precnapprox" |
603
+ "\\preccurlyeq" |
604
+ "\\precsim" |
605
+ "\\precnsim" |
606
+ "\\risingdotseq" |
607
+ "\\sharp" |
608
+ "\\bullet" |
609
+ "\\nexists" |
610
+ "\\dagger" |
611
+ "\\ddagger" |
612
+ "\\not" |
613
+ "\\top" |
614
+ "\\natural" |
615
+ "\\angle" |
616
+ "\\measuredangle" |
617
+ "\\backprime" |
618
+ "\\bigstar" |
619
+ "\\blacklozenge" |
620
+ "\\lozenge" |
621
+ "\\blacksquare" |
622
+ "\\blacktriangle" |
623
+ "\\blacktriangleleft" |
624
+ "\\blacktriangleright" |
625
+ "\\blacktriangledown" |
626
+ "\\ntriangleleft" |
627
+ "\\ntriangleright" |
628
+ "\\ntrianglelefteq" |
629
+ "\\ntrianglerighteq" |
630
+ "\\trianglelefteq" |
631
+ "\\trianglerighteq" |
632
+ "\\triangleq" |
633
+ "\\vartriangleleft" |
634
+ "\\vartriangleright" |
635
+ "\\forall" |
636
+ "\\bigtriangleup" |
637
+ "\\bigtriangledown" |
638
+ "\\nprec" {yylval=itex2MML_copy2(yytext, ";"); if (yylval != itex2MML_empty_string) yylval[0]='&'; return MOL;}
639
+
640
+ "\\aleph" |
641
+ "\\beth" |
642
+ "\\eth" |
643
+ "\\ell" |
644
+ "\\hbar" |
645
+ "\\Im" |
646
+ "\\imath" |
647
+ "\\jmath" |
648
+ "\\wp" |
649
+ "\\Re" {yylval=itex2MML_copy2(yytext, ";"); if (yylval != itex2MML_empty_string) yylval[0]='&'; return MI;}
650
+
651
+ "\\Perp" |
652
+ "\\Vbar" {yylval=itex2MML_copy_string("&Vbar;"); return MOL;}
653
+ "\\boxdot" {yylval=itex2MML_copy_string("&sdotb;"); return MOL;}
654
+ "\\Box" |
655
+ "\\square" {yylval=itex2MML_copy_string("&square;"); return MOL;}
656
+ "\\emptyset" |
657
+ "\\empty" {yylval=itex2MML_copy_string("&emptyv;"); return MI;}
658
+ "\\exists" {yylval=itex2MML_copy_string("&Exists;"); return MOL;}
659
+ "\\circ" {yylval=itex2MML_copy_string("&SmallCircle;"); return MOL;}
660
+ "\\rhd" {yylval=itex2MML_copy_string("&RightTriangle;"); return MOL;}
661
+ "\\lhd" {yylval=itex2MML_copy_string("&LeftTriangle;"); return MOL;}
662
+ "\\lll" {yylval=itex2MML_copy_string("&Ll;"); return MOL;}
663
+ "\\unrhd" {yylval=itex2MML_copy_string("&RightTriangleEqual;"); return MOL;}
664
+ "\\unlhd" {yylval=itex2MML_copy_string("&LeftTriangleEqual;"); return MOL;}
665
+ "\\Del" |
666
+ "\\nabla" {yylval=itex2MML_copy_string("&Del;"); return MOL;}
667
+ "\\sphericalangle" {yylval=itex2MML_copy_string("&angsph;"); return MOL;}
668
+
669
+ "\\heartsuit" {yylval=itex2MML_copy_string("&#x2661;"); return MOL;}
670
+ "\\diamondsuit" {yylval=itex2MML_copy_string("&#x2662;"); return MOL;}
671
+
672
+ "\\partial" {yylval=itex2MML_copy_string("&PartialD;"); return MOL;}
673
+
674
+ "\\qed" {yylval=itex2MML_copy_string("&squf;"); return MO;}
675
+
676
+ "\\mod" {yylval=itex2MML_copy_string("mod"); return MOS;}
677
+ "\\pmod" {return PMOD;}
678
+
679
+ "\\bottom" {yylval=itex2MML_copy_string("&perp;"); return MOL;}
680
+
681
+ "\\neg" {yylval=itex2MML_copy_string("&not;"); return MOL;}
682
+
683
+ "\\neq" |
684
+ "\\ne" {yylval=itex2MML_copy_string("&ne;"); return MOL;}
685
+
686
+ "\\shortmid" |
687
+ "\\mid" {yylval=itex2MML_copy_string("&VerticalBar;"); return MOS;}
688
+
689
+ "\\int" |
690
+ "\\integral" {yylval=itex2MML_copy_string("&Integral;"); return MOL;}
691
+
692
+ "\\iint" |
693
+ "\\doubleintegral" {yylval=itex2MML_copy_string("&Int;"); return MOL;}
694
+
695
+ "\\iiint" |
696
+ "\\tripleintegral" {yylval=itex2MML_copy_string("&tint;"); return MOL;}
697
+
698
+ "\\iiiint" |
699
+ "\\quadrupleintegral" {yylval=itex2MML_copy_string("&qint;"); return MOL;}
700
+
701
+ "\\oint" |
702
+ "\\conint" |
703
+ "\\contourintegral" {yylval=itex2MML_copy_string("&conint;"); return MOL;}
704
+
705
+ "\\times" {yylval=itex2MML_copy_string("&times;"); return MOL;}
706
+ "\\star" {yylval=itex2MML_copy_string("&sstarf;"); return MOL;}
707
+ "\\circleddash" |
708
+ "\\odash" {yylval=itex2MML_copy_string("&odash;"); return MOL;}
709
+
710
+ "\\intercal" {yylval=itex2MML_copy_string("&intcal;"); return MOL;}
711
+ "\\smallfrown" {yylval=itex2MML_copy_string("&sfrown;"); return MOL;}
712
+ "\\smallsmile" {yylval=itex2MML_copy_string("&ssmile;"); return MOL;}
713
+
714
+ "\\boxminus" |
715
+ "\\minusb" {yylval=itex2MML_copy_string("&boxminus;"); return MOL;}
716
+ "\\boxplus" |
717
+ "\\plusb" {yylval=itex2MML_copy_string("&boxplus;"); return MOL;}
718
+ "\\boxtimes" |
719
+ "\\timesb" {yylval=itex2MML_copy_string("&boxtimes;"); return MOL;}
720
+
721
+ "\\sum" {yylval=itex2MML_copy_string("&Sum;"); return MOB;}
722
+
723
+ "\\prod" |
724
+ "\\product" {yylval=itex2MML_copy_string("&prod;"); return MOB;}
725
+
726
+ "\\coprod" |
727
+ "\\coproduct" {yylval=itex2MML_copy_string("&coprod;"); return MOB;}
728
+
729
+ "\\otimes" {yylval=itex2MML_copy_string("&otimes;"); return MOL;}
730
+ "\\Otimes" {yylval=itex2MML_copy_string("&Otimes;"); return MOL;}
731
+ "\\bigotimes" {yylval=itex2MML_copy_string("&bigotimes;"); return MOL;}
732
+
733
+ "\\ominus" {yylval=itex2MML_copy_string("&ominus;"); return MOL;}
734
+ "\\oslash" {yylval=itex2MML_copy_string("&osol;"); return MOL;}
735
+
736
+ "\\oplus" {yylval=itex2MML_copy_string("&oplus;"); return MOL;}
737
+ "\\Oplus" |
738
+ "\\bigoplus" {yylval=itex2MML_copy_string("&bigoplus;"); return MOB;}
739
+
740
+ "\\bigodot" {yylval=itex2MML_copy_string("&bigodot;"); return MOB;}
741
+ "\\bigsqcup" {yylval=itex2MML_copy_string("&bigsqcup;"); return MOB;}
742
+ "\\biguplus" {yylval=itex2MML_copy_string("&biguplus;"); return MOB;}
743
+
744
+ "\\wedge" {yylval=itex2MML_copy_string("&wedge;"); return MOL;}
745
+ "\\Wedge" |
746
+ "\\bigwedge" {yylval=itex2MML_copy_string("&xwedge;"); return MOB;}
747
+
748
+ "\\Vee" |
749
+ "\\bigvee" {yylval=itex2MML_copy_string("&bigvee;"); return MOB;}
750
+
751
+ "\\invamp" |
752
+ "\\parr" {yylval=itex2MML_copy_string("&#8523;"); return MOL;}
753
+
754
+ "\\frac" {return FRAC;}
755
+ "\\tfrac" {return TFRAC;}
756
+
757
+ "\\binom" {return BINOM;}
758
+ "\\tbinom" {return TBINOM;}
759
+
760
+ "\\tensor" {return TENSOR;}
761
+
762
+ "\\multiscripts" {return MULTI;}
763
+
764
+ "\\overbrace" {return OVERBRACE;}
765
+
766
+ "\\underbrace" {return UNDERBRACE;}
767
+
768
+ "\\underline" {return UNDERLINE;}
769
+
770
+ "\\bar" {return BAR;}
771
+ "\\overline" |
772
+ "\\closure" |
773
+ "\\widebar" {return WIDEBAR;}
774
+
775
+ "\\vec" {return VEC;}
776
+ "\\widevec" {return WIDEVEC;}
777
+
778
+ "\\dot" {return DOT;}
779
+ "\\ddot" {return DDOT;}
780
+ "\\dddot" {return DDDOT;}
781
+ "\\ddddot" {return DDDDOT;}
782
+
783
+ "\\tilde" {return TILDE;}
784
+ "\\widetilde" {return WIDETILDE;}
785
+
786
+
787
+ "\\check" {return CHECK;}
788
+ "\\widecheck" {return WIDECHECK;}
789
+
790
+
791
+ "\\hat" {return HAT;}
792
+ "\\widehat" {return WIDEHAT;}
793
+
794
+ "\\underset" {return UNDER;}
795
+
796
+ "\\stackrel" |
797
+ "\\overset" {return OVER;}
798
+
799
+ "\\over" {return TEXOVER;}
800
+ "\\atop" {return TEXATOP;}
801
+
802
+ "\\underoverset" {return UNDEROVER;}
803
+
804
+ "\\sqrt" {BEGIN(OPTARG); return SQRT;}
805
+
806
+ "\\root" {return ROOT;}
807
+
808
+ "\\space" {BEGIN(INT1); return SPACE;}
809
+
810
+ "\\text" {BEGIN(PLAINTEXT); return TEXTBOX;}
811
+
812
+ "\\statusline" {BEGIN(PLAINTEXT); return STATLINE;}
813
+ "\\tooltip" {BEGIN(PLAINTEXT); return TOOLTIP;}
814
+
815
+ "\\toggle" {return TOGGLE;}
816
+
817
+ "\\fghilight" |
818
+ "\\fghighlight" {BEGIN(ATTRIBUTELIST); return FGHIGHLIGHT;}
819
+
820
+ "\\bghilight" |
821
+ "\\bghighlight" {BEGIN(ATTRIBUTELIST); return BGHIGHLIGHT;}
822
+
823
+ "\\color" {BEGIN(ATTRIBUTELIST); return COLOR;}
824
+ "\\bgcolor" {BEGIN(ATTRIBUTELIST); return BGCOLOR;}
825
+
826
+ "\\displaystyle" {itex2MML_rowposn=2; return DISPLAY;}
827
+
828
+ "\\textstyle" {itex2MML_rowposn=2; return TEXTSTY;}
829
+
830
+ "\\textsize" {return TEXTSIZE;}
831
+
832
+ "\\scriptsize" {return SCSIZE;}
833
+
834
+ "\\scriptscriptsize" {return SCSCSIZE;}
835
+
836
+ "\\mathit" {return ITALICS;}
837
+
838
+ "\\boldsymbol" |
839
+ "\\mathbf" {return BOLD;}
840
+
841
+ "\\mathrm" {BEGIN(ROMAN); return RM;}
842
+
843
+ "\\mathbb" {BEGIN(BBOLD); return BB;}
844
+
845
+ "\\mathfrak" |
846
+ "\\mathfr" {BEGIN(FRAKTUR); return FRAK;}
847
+
848
+ "\\slash" {return SLASHED;}
849
+
850
+ "\\boxed" {return BOXED;}
851
+
852
+ "\\mathcal" {BEGIN(CALLIGRAPHIC); return CAL;}
853
+
854
+ "\\begin" {itex2MML_env_start = 1; BEGIN(MATHENV); return BEGINENV;}
855
+ "\\end" {BEGIN(MATHENV); return ENDENV;}
856
+
857
+ "\\substack" {return SUBSTACK;}
858
+
859
+ "\\array" {return ARRAY;}
860
+
861
+ "\\arrayopts" {return ARRAYOPTS;}
862
+
863
+ "\\colalign" {BEGIN(ATTRIBUTELIST); return COLALIGN;}
864
+
865
+ "\\collayout" {BEGIN(ATTRIBUTELIST); return COLLAYOUT;}
866
+
867
+ "\\rowalign" {BEGIN(ATTRIBUTELIST); return ROWALIGN;}
868
+
869
+ "\\align" {BEGIN(ATTRIBUTELIST); return ALIGN;}
870
+
871
+ "\\equalrows" {BEGIN(ATTRIBUTELIST); return EQROWS;}
872
+
873
+ "\\equalcols" {BEGIN(ATTRIBUTELIST); return EQCOLS;}
874
+
875
+ "\\rowlines" {BEGIN(ATTRIBUTELIST); return ROWLINES;}
876
+
877
+ "\\collines" {BEGIN(ATTRIBUTELIST); return COLLINES;}
878
+
879
+ "\\frame" {BEGIN(ATTRIBUTELIST); return FRAME;}
880
+
881
+ "\\padding" {BEGIN(ATTRIBUTELIST); return PADDING;}
882
+
883
+ "\\rowopts" {return ROWOPTS;}
884
+
885
+ "\\cellopts" {return CELLOPTS;}
886
+
887
+ "\\rowspan" {BEGIN(ATTRIBUTELIST); return ROWSPAN;}
888
+
889
+ "\\colspan" {BEGIN(ATTRIBUTELIST); return COLSPAN;}
890
+
891
+
892
+ "\\," |
893
+ "\\thinspace" {return THINSPACE;}
894
+
895
+ "\\:" |
896
+ "\\medspace" {return MEDSPACE;}
897
+
898
+ "\\;" |
899
+ "\\thickspace" {return THICKSPACE;}
900
+
901
+ "\\quad" {return QUAD;}
902
+ "\\qquad" {return QQUAD;}
903
+
904
+ "\\!" |
905
+ "\\negspace" {return NEGSPACE;}
906
+
907
+ "\\phantom" {return PHANTOM;}
908
+
909
+ "\\href" {BEGIN(PLAINTEXT); return HREF;}
910
+
911
+ "\\operatorname" {BEGIN(PLAINTEXT); return OPERATORNAME;}
912
+ "\\mathop" {BEGIN(PLAINTEXT); return MATHOP;}
913
+ "\\mathbin" {BEGIN(PLAINTEXT); return MATHBIN;}
914
+ "\\mathrel" {BEGIN(PLAINTEXT); return MATHREL;}
915
+
916
+ "\\includegraphics"(\[[^\]]*\])?\{[^}]*\} ;
917
+
918
+ "\\"[a-zA-Z]+ {yylval=itex2MML_copy_string(yytext+1); return MOP;}
919
+
920
+ "\&"[a-zA-Z_][a-zA-Z0-9_]*";" |
921
+ "\&#"[0-9]+";" |
922
+ "\&#x"[a-fA-F0-9]+";" {yylval=itex2MML_copy_string(yytext); return MI;}
923
+
924
+ "\n" itex2MML_lineno++;
925
+ [\r\t ]+ ;
926
+
927
+
928
+ . {return UNKNOWNCHAR;}
929
+ }
930
+
931
+ <ATTRIBUTELIST>"{"[ \t\n\r #a-zA-Z0-9.\-]*"}" {BEGIN(MATH); yylval=itex2MML_copy_string(yytext); if (yylval != itex2MML_empty_string) { yylval[0]='"'; yylval[yyleng-1]='"'; } return ATTRLIST;}
932
+
933
+ <OPTARG>{
934
+ "[" {if(itex2MML_optarg_ind < itex2MML_optarg_depth - 1 && itex2MML_inoptarg[itex2MML_optarg_ind] !=1 ){itex2MML_optarg_ind++; itex2MML_inoptarg[itex2MML_optarg_ind]=1;}; BEGIN(MATH); return OPTARGOPEN;}
935
+ . {BEGIN(MATH); unput(yytext[0]);}
936
+ }
937
+
938
+ <MATHENV>{
939
+ "\{matrix\}" {itex2MML_env_start = 0; BEGIN(MATH); return MATRIX;}
940
+ "\{pmatrix\}" {itex2MML_env_start = 0; BEGIN(MATH); return PMATRIX;}
941
+ "\{bmatrix\}" {itex2MML_env_start = 0; BEGIN(MATH); return BMATRIX;}
942
+ "\{Bmatrix\}" {itex2MML_env_start = 0; BEGIN(MATH); return BBMATRIX;}
943
+ "\{vmatrix\}" {itex2MML_env_start = 0; BEGIN(MATH); return VMATRIX;}
944
+ "\{Vmatrix\}" {itex2MML_env_start = 0; BEGIN(MATH); return VVMATRIX;}
945
+ "\{smallmatrix\}" {itex2MML_env_start = 0; BEGIN(MATH); return SMALLMATRIX;}
946
+ "\{cases\}" {itex2MML_env_start = 0; BEGIN(MATH); return CASES;}
947
+ "\{aligned\}" {itex2MML_env_start = 0; BEGIN(MATH); return ALIGNED;}
948
+ "\{gathered\}" {itex2MML_env_start = 0; BEGIN(MATH); return GATHERED;}
949
+ "\{split\}" {itex2MML_env_start = 0; BEGIN(MATH); return ALIGNED;}
950
+ "\{array\}" {if (itex2MML_env_start == 1) BEGIN(ARRAYOPTIONS); else BEGIN(MATH); return ARRAY;}
951
+ "\{svg\}" {itex2MML_env_start = 0; BEGIN(SVGENV); return SVG;}
952
+ }
953
+
954
+ <ARRAYOPTIONS>{
955
+ "[t]" {yylval=itex2MML_copy_string("axis 1"); return ARRAYALIGN;}
956
+ "[c]" {yylval=itex2MML_copy_string("center"); return ARRAYALIGN;}
957
+ "[b]" {yylval=itex2MML_copy_string("axis -1"); return ARRAYALIGN;}
958
+ "\{" {BEGIN(COLOPTS); return ST;}
959
+ [\t\n\r ]+ ;
960
+ }
961
+
962
+ <COLOPTS>{
963
+ "\}" {itex2MML_env_start = 0; BEGIN(MATH); return END;}
964
+ "c" {yylval=itex2MML_copy_string("center"); return COLUMNALIGN;}
965
+ "l" {yylval=itex2MML_copy_string("left"); return COLUMNALIGN;}
966
+ "r" {yylval=itex2MML_copy_string("right"); return COLUMNALIGN;}
967
+ [\t\n\r ]+ ;
968
+ }
969
+
970
+ <SVGENV>{
971
+ "\\end\{svg" {yylval=itex2MML_copy_string(yytext); yylval[yyleng-8]=0; BEGIN(SVGEND); return XMLSTRING;}
972
+ (.|\n) {yymore();}
973
+ }
974
+
975
+ <SVGEND>{
976
+ "\}" {BEGIN(MATH); return ENDSVG;}
977
+ }
978
+
979
+ <ROMAN>{
980
+ "\{" {return ST;}
981
+ "\}" {BEGIN(MATH); return END;}
982
+ [a-zA-Z] {yylval=itex2MML_copy_string(yytext); return RMCHAR;}
983
+ [\t\n\r ]+ ;
984
+ . {return yytext[0];}
985
+ }
986
+
987
+ <BBOLD>{
988
+ "\{" {return ST;}
989
+ "\}" {BEGIN(MATH); return END;}
990
+ [a-z] {yylval=itex2MML_copy_string(yytext); return BBLOWERCHAR;}
991
+ [A-Z] {yylval=itex2MML_copy_string(yytext); return BBUPPERCHAR;}
992
+ [0-9] {yylval=itex2MML_copy_string(yytext); return BBDIGIT;}
993
+ [\t\n\r ]+ ;
994
+ . {return yytext[0];}
995
+ }
996
+
997
+ <CALLIGRAPHIC>{
998
+ "\{" {return ST;}
999
+ "\}" {BEGIN(MATH); return END;}
1000
+ [a-zA-Z] {yylval=itex2MML_copy_string(yytext); return CALCHAR;}
1001
+ [\t\n\r ]+ ;
1002
+ . {return yytext[0];}
1003
+ }
1004
+
1005
+ <FRAKTUR>{
1006
+ "\{" {return ST;}
1007
+ "\}" {BEGIN(MATH); return END;}
1008
+ [a-zA-Z] {yylval=itex2MML_copy_string(yytext); return FRAKCHAR;}
1009
+ [\t\n\r ]+ ;
1010
+ . {return yytext[0];}
1011
+ }
1012
+
1013
+ <PLAINTEXT>{
1014
+ \{[^\}]*?\} {yylval=itex2MML_copy_string(yytext+1); if ((yyleng > 1) && (yylval != itex2MML_empty_string)) yylval[yyleng-2]='\0'; BEGIN(MATH); return TEXTSTRING;}
1015
+ }
1016
+
1017
+ <INT1>{
1018
+ "\{" {return ST;}
1019
+ "\}" {BEGIN(INT2); return END;}
1020
+ [0-9]+ {yylval=itex2MML_copy_string_extra(yytext, 1); if (yyleng && (yylval != itex2MML_empty_string)) { yylval[yyleng]=yylval[yyleng-1]; yylval[yyleng-1]='.'; yylval[yyleng+1]='\0'; } return INTONE;}
1021
+ [\t\n\r ]+ ;
1022
+ . {return yytext[0];}
1023
+ }
1024
+
1025
+ <INT2>{
1026
+ "\{" {return ST;}
1027
+ "\}" {BEGIN(INT3); return END;}
1028
+ [0-9]+ {yylval=itex2MML_copy_string_extra(yytext, 1); if (yyleng && (yylval != itex2MML_empty_string)) { yylval[yyleng]=yylval[yyleng-1]; yylval[yyleng-1]='.'; yylval[yyleng+1]='\0'; } return INTTWO;}
1029
+ [\t\n\r ]+ ;
1030
+ . {return yytext[0];}
1031
+ }
1032
+
1033
+ <INT3>{
1034
+ "\{" {return ST;}
1035
+ "\}" {BEGIN(MATH); return END;}
1036
+ [0-9]+ {yylval=itex2MML_copy_string_extra(yytext, 1); if (yyleng && (yylval != itex2MML_empty_string)) { yylval[yyleng]=yylval[yyleng-1]; yylval[yyleng-1]='.'; yylval[yyleng+1]='\0'; } return INTTHREE;}
1037
+ [\t\n\r ]+ ;
1038
+ . {return yytext[0];}
1039
+ }
1040
+
1041
+
1042
+
1043
+ %%
1044
+
1045
+ void itex2MML_restart (void)
1046
+ {
1047
+ BEGIN(INITIAL);
1048
+ }
1049
+
1050
+ static const char * s_itex2MML_buffer = 0;
1051
+ static unsigned long s_itex2MML_length = 0;
1052
+
1053
+ void itex2MML_setup (const char * buffer, unsigned long length)
1054
+ {
1055
+ yy_flush_buffer( YY_CURRENT_BUFFER );
1056
+
1057
+ s_itex2MML_buffer = buffer;
1058
+ s_itex2MML_length = length;
1059
+ }
1060
+
1061
+ static int s_itex2MML_read (char * buffer, int max_size)
1062
+ {
1063
+ int result = 0;
1064
+
1065
+ if (max_size < s_itex2MML_length)
1066
+ {
1067
+ result = max_size;
1068
+
1069
+ memcpy (buffer, s_itex2MML_buffer, max_size);
1070
+
1071
+ s_itex2MML_buffer += max_size;
1072
+ s_itex2MML_length -= max_size;
1073
+ }
1074
+ else
1075
+ {
1076
+ result = s_itex2MML_length;
1077
+
1078
+ memcpy (buffer, s_itex2MML_buffer, s_itex2MML_length);
1079
+
1080
+ s_itex2MML_buffer = 0;
1081
+ s_itex2MML_length = 0;
1082
+ }
1083
+ return result;
1084
+ }