GNU Octave  3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
oct-tex-lexer.cc
Go to the documentation of this file.
1 #line 30 "corefcn/oct-tex-lexer.ll"
2 #ifdef HAVE_CONFIG_H
3 #include <config.h>
4 #endif
5 
6 
7 
8 
9 #line 10 "corefcn/oct-tex-lexer.cc"
10 
11 #define YY_INT_ALIGNED short int
12 
13 /* A lexical scanner generated by flex */
14 
15 #define FLEX_SCANNER
16 #define YY_FLEX_MAJOR_VERSION 2
17 #define YY_FLEX_MINOR_VERSION 5
18 #define YY_FLEX_SUBMINOR_VERSION 35
19 #if YY_FLEX_SUBMINOR_VERSION > 0
20 #define FLEX_BETA
21 #endif
22 
23 /* First, we deal with platform-specific or compiler-specific issues. */
24 
25 /* begin standard C headers. */
26 #include <stdio.h>
27 #include <string.h>
28 #include <errno.h>
29 #include <stdlib.h>
30 
31 /* end standard C headers. */
32 
33 /* flex integer type definitions */
34 
35 #ifndef FLEXINT_H
36 #define FLEXINT_H
37 
38 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
39 
40 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
41 
42 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
43  * if you want the limit (max/min) macros for int types.
44  */
45 #ifndef __STDC_LIMIT_MACROS
46 #define __STDC_LIMIT_MACROS 1
47 #endif
48 
49 #include <inttypes.h>
50 typedef int8_t flex_int8_t;
51 typedef uint8_t flex_uint8_t;
52 typedef int16_t flex_int16_t;
53 typedef uint16_t flex_uint16_t;
54 typedef int32_t flex_int32_t;
55 typedef uint32_t flex_uint32_t;
56 #else
57 typedef signed char flex_int8_t;
58 typedef short int flex_int16_t;
59 typedef int flex_int32_t;
60 typedef unsigned char flex_uint8_t;
61 typedef unsigned short int flex_uint16_t;
62 typedef unsigned int flex_uint32_t;
63 
64 /* Limits of integral types. */
65 #ifndef INT8_MIN
66 #define INT8_MIN (-128)
67 #endif
68 #ifndef INT16_MIN
69 #define INT16_MIN (-32767-1)
70 #endif
71 #ifndef INT32_MIN
72 #define INT32_MIN (-2147483647-1)
73 #endif
74 #ifndef INT8_MAX
75 #define INT8_MAX (127)
76 #endif
77 #ifndef INT16_MAX
78 #define INT16_MAX (32767)
79 #endif
80 #ifndef INT32_MAX
81 #define INT32_MAX (2147483647)
82 #endif
83 #ifndef UINT8_MAX
84 #define UINT8_MAX (255U)
85 #endif
86 #ifndef UINT16_MAX
87 #define UINT16_MAX (65535U)
88 #endif
89 #ifndef UINT32_MAX
90 #define UINT32_MAX (4294967295U)
91 #endif
92 
93 #endif /* ! C99 */
94 
95 #endif /* ! FLEXINT_H */
96 
97 #ifdef __cplusplus
98 
99 /* The "const" storage-class-modifier is valid. */
100 #define YY_USE_CONST
101 
102 #else /* ! __cplusplus */
103 
104 /* C99 requires __STDC__ to be defined as 1. */
105 #if defined (__STDC__)
106 
107 #define YY_USE_CONST
108 
109 #endif /* defined (__STDC__) */
110 #endif /* ! __cplusplus */
111 
112 #ifdef YY_USE_CONST
113 #define yyconst const
114 #else
115 #define yyconst
116 #endif
117 
118 /* Returned upon end-of-file. */
119 #define YY_NULL 0
120 
121 /* Promotes a possibly negative, possibly signed char to an unsigned
122  * integer for use as an array index. If the signed char is negative,
123  * we want to instead treat it as an 8-bit unsigned char, hence the
124  * double cast.
125  */
126 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
127 
128 /* An opaque pointer. */
129 #ifndef YY_TYPEDEF_YY_SCANNER_T
130 #define YY_TYPEDEF_YY_SCANNER_T
131 typedef void* yyscan_t;
132 #endif
133 
134 /* For convenience, these vars (plus the bison vars far below)
135  are macros in the reentrant scanner. */
136 #define yyin yyg->yyin_r
137 #define yyout yyg->yyout_r
138 #define yyextra yyg->yyextra_r
139 #define yyleng yyg->yyleng_r
140 #define yytext yyg->yytext_r
141 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
142 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
143 #define yy_flex_debug yyg->yy_flex_debug_r
144 
145 /* Enter a start condition. This macro really ought to take a parameter,
146  * but we do it the disgusting crufty way forced on us by the ()-less
147  * definition of BEGIN.
148  */
149 #define BEGIN yyg->yy_start = 1 + 2 *
150 
151 /* Translate the current start state into a value that can be later handed
152  * to BEGIN to return to the state. The YYSTATE alias is for lex
153  * compatibility.
154  */
155 #define YY_START ((yyg->yy_start - 1) / 2)
156 #define YYSTATE YY_START
157 
158 /* Action number for EOF rule of a given start state. */
159 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
160 
161 /* Special action meaning "start processing a new file". */
162 #define YY_NEW_FILE octave_tex_restart(yyin ,yyscanner )
163 
164 #define YY_END_OF_BUFFER_CHAR 0
165 
166 /* Size of default input buffer. */
167 #ifndef YY_BUF_SIZE
168 #ifdef __ia64__
169 /* On IA-64, the buffer size is 16k, not 8k.
170  * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
171  * Ditto for the __ia64__ case accordingly.
172  */
173 #define YY_BUF_SIZE 32768
174 #else
175 #define YY_BUF_SIZE 16384
176 #endif /* __ia64__ */
177 #endif
178 
179 /* The state buf must be large enough to hold one state per character in the main buffer.
180  */
181 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
182 
183 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
184 #define YY_TYPEDEF_YY_BUFFER_STATE
186 #endif
187 
188 #define EOB_ACT_CONTINUE_SCAN 0
189 #define EOB_ACT_END_OF_FILE 1
190 #define EOB_ACT_LAST_MATCH 2
191 
192  #define YY_LESS_LINENO(n)
193 
194 /* Return all but the first "n" matched characters back to the input stream. */
195 #define yyless(n) \
196  do \
197  { \
198  /* Undo effects of setting up yytext. */ \
199  int yyless_macro_arg = (n); \
200  YY_LESS_LINENO(yyless_macro_arg);\
201  *yy_cp = yyg->yy_hold_char; \
202  YY_RESTORE_YY_MORE_OFFSET \
203  yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
204  YY_DO_BEFORE_ACTION; /* set up yytext again */ \
205  } \
206  while ( 0 )
207 
208 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
209 
210 #ifndef YY_TYPEDEF_YY_SIZE_T
211 #define YY_TYPEDEF_YY_SIZE_T
212 typedef size_t yy_size_t;
213 #endif
214 
215 #ifndef YY_STRUCT_YY_BUFFER_STATE
216 #define YY_STRUCT_YY_BUFFER_STATE
218  {
220 
221  char *yy_ch_buf; /* input buffer */
222  char *yy_buf_pos; /* current position in input buffer */
223 
224  /* Size of input buffer in bytes, not including room for EOB
225  * characters.
226  */
228 
229  /* Number of characters read into yy_ch_buf, not including EOB
230  * characters.
231  */
233 
234  /* Whether we "own" the buffer - i.e., we know we created it,
235  * and can realloc() it to grow it, and should free() it to
236  * delete it.
237  */
239 
240  /* Whether this is an "interactive" input source; if so, and
241  * if we're using stdio for input, then we want to use getc()
242  * instead of fread(), to make sure we stop fetching input after
243  * each newline.
244  */
246 
247  /* Whether we're considered to be at the beginning of a line.
248  * If so, '^' rules will be active on the next match, otherwise
249  * not.
250  */
252 
253  int yy_bs_lineno; /**< The line count. */
254  int yy_bs_column; /**< The column count. */
255 
256  /* Whether to try to fill the input buffer when we reach the
257  * end of it.
258  */
260 
262 
263 #define YY_BUFFER_NEW 0
264 #define YY_BUFFER_NORMAL 1
265  /* When an EOF's been seen but there's still some text to process
266  * then we mark the buffer as YY_EOF_PENDING, to indicate that we
267  * shouldn't try reading from the input source any more. We might
268  * still have a bunch of tokens to match, though, because of
269  * possible backing-up.
270  *
271  * When we actually see the EOF, we change the status to "new"
272  * (via octave_tex_restart()), so that the user can continue scanning by
273  * just pointing yyin at a new input file.
274  */
275 #define YY_BUFFER_EOF_PENDING 2
276 
277  };
278 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
279 
280 /* We provide macros for accessing buffer states in case in the
281  * future we want to put the buffer states in a more general
282  * "scanner state".
283  *
284  * Returns the top of the stack, or NULL.
285  */
286 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
287  ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
288  : NULL)
289 
290 /* Same as previous macro, but useful when we know that the buffer stack is not
291  * NULL or when we need an lvalue. For internal use only.
292  */
293 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
294 
295 void octave_tex_restart (FILE *input_file ,yyscan_t yyscanner );
296 void octave_tex__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
297 YY_BUFFER_STATE octave_tex__create_buffer (FILE *file,int size ,yyscan_t yyscanner );
298 void octave_tex__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
299 void octave_tex__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
300 void octave_tex_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
301 void octave_tex_pop_buffer_state (yyscan_t yyscanner );
302 
303 static void octave_tex_ensure_buffer_stack (yyscan_t yyscanner );
304 static void octave_tex__load_buffer_state (yyscan_t yyscanner );
305 static void octave_tex__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
306 
307 #define YY_FLUSH_BUFFER octave_tex__flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
308 
309 YY_BUFFER_STATE octave_tex__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
310 YY_BUFFER_STATE octave_tex__scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
311 YY_BUFFER_STATE octave_tex__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
312 
313 void *octave_tex_alloc (yy_size_t ,yyscan_t yyscanner );
314 void *octave_tex_realloc (void *,yy_size_t ,yyscan_t yyscanner );
315 void octave_tex_free (void * ,yyscan_t yyscanner );
316 
317 #define yy_new_buffer octave_tex__create_buffer
318 
319 #define yy_set_interactive(is_interactive) \
320  { \
321  if ( ! YY_CURRENT_BUFFER ){ \
322  octave_tex_ensure_buffer_stack (yyscanner); \
323  YY_CURRENT_BUFFER_LVALUE = \
324  octave_tex__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
325  } \
326  YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
327  }
328 
329 #define yy_set_bol(at_bol) \
330  { \
331  if ( ! YY_CURRENT_BUFFER ){\
332  octave_tex_ensure_buffer_stack (yyscanner); \
333  YY_CURRENT_BUFFER_LVALUE = \
334  octave_tex__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
335  } \
336  YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
337  }
338 
339 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
340 
341 /* Begin user sect3 */
342 
343 #define octave_tex_wrap(n) 1
344 #define YY_SKIP_YYWRAP
345 
346 typedef unsigned char YY_CHAR;
347 
348 typedef int yy_state_type;
349 
350 #define yytext_ptr yytext_r
351 
352 static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
353 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
354 static int yy_get_next_buffer (yyscan_t yyscanner );
355 static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
356 
357 /* Done after the current pattern has been matched and before the
358  * corresponding action - sets up yytext.
359  */
360 #define YY_DO_BEFORE_ACTION \
361  yyg->yytext_ptr = yy_bp; \
362  yyleng = (size_t) (yy_cp - yy_bp); \
363  yyg->yy_hold_char = *yy_cp; \
364  *yy_cp = '\0'; \
365  yyg->yy_c_buf_p = yy_cp;
366 
367 #define YY_NUM_RULES 128
368 #define YY_END_OF_BUFFER 129
369 /* This struct is not used in this scanner,
370  but its presence is necessary. */
372  {
375  };
377  { 0,
378  0, 0, 0, 0, 0, 0, 129, 127, 126, 127,
379  16, 17, 14, 15, 3, 2, 3, 1, 5, 4,
380  123, 0, 0, 0, 0, 0, 0, 0, 0, 0,
381  0, 0, 22, 20, 21, 0, 0, 0, 0, 0,
382  0, 0, 0, 0, 0, 0, 0, 0, 38, 0,
383  0, 0, 0, 0, 0, 0, 0, 0, 18, 19,
384  2, 1, 1, 1, 0, 0, 64, 0, 0, 0,
385  0, 55, 0, 63, 0, 0, 0, 0, 54, 0,
386  0, 0, 0, 0, 6, 0, 0, 0, 0, 0,
387  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
388 
389  0, 0, 0, 0, 96, 0, 7, 0, 0, 0,
390  0, 0, 0, 0, 35, 0, 0, 100, 36, 0,
391  0, 0, 0, 0, 0, 0, 39, 79, 0, 0,
392  0, 0, 0, 0, 0, 9, 0, 8, 0, 0,
393  0, 0, 0, 0, 0, 0, 0, 62, 37, 0,
394  1, 0, 0, 0, 0, 0, 58, 59, 0, 0,
395  0, 0, 0, 0, 0, 0, 82, 0, 0, 86,
396  0, 47, 0, 0, 0, 0, 0, 87, 125, 0,
397  0, 85, 0, 0, 0, 29, 0, 0, 0, 0,
398  97, 0, 0, 78, 0, 0, 0, 0, 0, 0,
399 
400  0, 93, 0, 101, 0, 73, 121, 0, 0, 0,
401  0, 0, 0, 46, 0, 0, 48, 0, 0, 0,
402  41, 0, 0, 103, 0, 0, 0, 0, 44, 0,
403  0, 0, 0, 0, 88, 0, 0, 0, 0, 0,
404  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
405  24, 0, 80, 83, 0, 0, 105, 0, 0, 0,
406  0, 0, 0, 0, 0, 0, 0, 0, 0, 32,
407  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
408  0, 0, 0, 107, 0, 0, 0, 0, 0, 0,
409  0, 0, 0, 0, 69, 0, 0, 0, 0, 0,
410 
411  0, 0, 0, 28, 51, 50, 0, 0, 60, 0,
412  56, 52, 0, 61, 23, 70, 0, 0, 0, 13,
413  0, 26, 0, 0, 0, 102, 0, 0, 0, 0,
414  25, 0, 66, 33, 0, 0, 117, 122, 0, 0,
415  0, 68, 49, 90, 0, 0, 0, 67, 0, 0,
416  120, 0, 0, 42, 0, 0, 0, 30, 81, 0,
417  0, 40, 0, 0, 89, 53, 0, 0, 0, 104,
418  84, 0, 0, 0, 0, 0, 0, 72, 0, 0,
419  71, 0, 34, 116, 0, 0, 115, 92, 91, 0,
420  106, 119, 118, 0, 0, 94, 98, 0, 0, 0,
421 
422  0, 0, 0, 57, 0, 0, 0, 0, 0, 27,
423  0, 0, 0, 0, 0, 65, 0, 0, 0, 0,
424  113, 45, 0, 0, 0, 0, 74, 0, 0, 0,
425  0, 10, 11, 0, 0, 0, 0, 0, 95, 99,
426  43, 31, 109, 0, 0, 124, 0, 114, 76, 108,
427  0, 0, 77, 111, 12, 0, 0, 110, 75, 0,
428  0, 0, 112, 0
429  } ;
430 
432  { 0,
433  1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
434  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
435  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
436  1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
437  1, 1, 1, 1, 1, 4, 1, 5, 6, 6,
438  6, 6, 6, 6, 6, 6, 6, 1, 1, 1,
439  1, 1, 1, 1, 1, 1, 1, 7, 1, 1,
440  8, 1, 9, 1, 1, 10, 1, 1, 11, 12,
441  1, 13, 14, 15, 16, 1, 1, 17, 1, 1,
442  18, 19, 20, 21, 22, 1, 23, 24, 25, 26,
443 
444  27, 28, 29, 30, 31, 1, 32, 33, 34, 35,
445  36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
446  46, 47, 48, 1, 49, 1, 1, 1, 1, 1,
447  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
448  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
449  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
450  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
451  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
452  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
453  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
454 
455  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
456  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
457  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
458  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
459  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
460  1, 1, 1, 1, 1
461  } ;
462 
464  { 0,
465  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
466  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
467  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
468  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
469  1, 1, 1, 1, 1, 1, 1, 1, 1
470  } ;
471 
473  { 0,
474  0, 4, 0, 6, 434, 433, 480, 483, 483, 49,
475  483, 483, 483, 483, 483, 477, 8, 11, 483, 483,
476  483, 451, 454, 442, 1, 441, 0, 2, 443, 443,
477  435, 440, 483, 483, 483, 1, 72, 79, 8, 5,
478  434, 24, 442, 72, 445, 97, 64, 103, 95, 110,
479  123, 125, 88, 430, 104, 0, 435, 438, 483, 483,
480  462, 98, 111, 155, 430, 428, 483, 427, 432, 432,
481  427, 483, 426, 483, 427, 426, 427, 413, 483, 18,
482  423, 414, 409, 408, 483, 415, 410, 410, 414, 405,
483  401, 131, 405, 109, 44, 397, 400, 397, 415, 406,
484 
485  104, 402, 397, 411, 124, 392, 483, 395, 135, 404,
486  394, 135, 396, 402, 483, 403, 142, 483, 483, 399,
487  392, 391, 392, 383, 382, 389, 483, 483, 141, 388,
488  383, 390, 383, 379, 385, 483, 145, 483, 390, 151,
489  370, 384, 376, 153, 370, 381, 381, 483, 483, 365,
490  176, 364, 370, 379, 361, 372, 483, 483, 370, 365,
491  357, 366, 359, 365, 361, 354, 483, 369, 358, 483,
492  349, 483, 364, 364, 351, 357, 339, 483, 483, 343,
493  349, 483, 347, 350, 349, 483, 339, 337, 354, 342,
494  483, 336, 333, 483, 350, 335, 347, 341, 338, 327,
495 
496  326, 483, 330, 483, 332, 483, 483, 335, 321, 339,
497  327, 319, 322, 483, 324, 320, 483, 327, 324, 318,
498  483, 323, 318, 483, 325, 310, 309, 322, 483, 306,
499  319, 306, 313, 146, 483, 314, 319, 318, 317, 313,
500  315, 314, 295, 312, 311, 300, 302, 308, 303, 293,
501  483, 301, 483, 483, 287, 287, 483, 286, 301, 287,
502  299, 288, 277, 278, 149, 285, 294, 275, 269, 483,
503  291, 287, 279, 278, 270, 155, 273, 285, 284, 266,
504  265, 277, 272, 483, 275, 260, 267, 266, 262, 256,
505  273, 268, 267, 266, 483, 269, 251, 251, 256, 257,
506 
507  256, 256, 258, 483, 483, 483, 261, 244, 483, 259,
508  483, 483, 245, 483, 483, 483, 235, 238, 236, 259,
509  245, 483, 240, 235, 237, 483, 232, 248, 239, 236,
510  483, 228, 483, 483, 244, 239, 483, 483, 226, 233,
511  224, 483, 483, 483, 232, 221, 237, 483, 223, 231,
512  483, 218, 233, 483, 215, 213, 212, 483, 483, 216,
513  215, 483, 221, 222, 483, 483, 209, 208, 211, 483,
514  483, 214, 205, 214, 216, 202, 205, 483, 205, 191,
515  483, 195, 483, 483, 197, 206, 483, 483, 483, 201,
516  483, 483, 483, 194, 190, 204, 203, 185, 193, 193,
517 
518  185, 189, 185, 483, 182, 193, 191, 180, 183, 483,
519  191, 190, 185, 179, 184, 483, 174, 181, 173, 172,
520  483, 483, 186, 185, 163, 170, 483, 181, 163, 161,
521  158, 483, 483, 160, 156, 158, 162, 156, 483, 483,
522  483, 483, 483, 152, 175, 483, 161, 483, 483, 483,
523  168, 141, 483, 483, 483, 114, 108, 483, 483, 89,
524  65, 25, 483, 483, 17, 8, 0
525  } ;
526 
528  { 0,
529  465, 465, 466, 466, 467, 467, 464, 464, 464, 464,
530  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
531  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
532  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
533  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
534  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
535  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
536  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
537  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
538  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
539 
540  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
541  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
542  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
543  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
544  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
545  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
546  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
547  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
548  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
549  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
550 
551  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
552  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
553  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
554  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
555  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
556  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
557  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
558  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
559  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
560  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
561 
562  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
563  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
564  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
565  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
566  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
567  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
568  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
569  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
570  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
571  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
572 
573  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
574  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
575  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
576  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
577  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
578  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
579  464, 464, 464, 0, 464, 464, 464
580  } ;
581 
583  { 0,
584  19, 16, 9, 17, 18, 18, 9, 16, 15, 17,
585  18, 18, 62, 62, 63, 64, 64, 8, 10, 464,
586  11, 12, 10, 68, 11, 12, 147, 69, 74, 71,
587  72, 464, 75, 80, 94, 81, 148, 82, 95, 73,
588  83, 97, 98, 96, 163, 99, 102, 13, 14, 100,
589  103, 13, 14, 21, 164, 22, 23, 24, 25, 26,
590  27, 28, 29, 30, 31, 32, 181, 33, 463, 34,
591  35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
592  45, 46, 47, 48, 49, 50, 182, 51, 52, 53,
593  54, 55, 56, 57, 114, 58, 59, 60, 84, 85,
594 
595  462, 87, 62, 62, 88, 115, 105, 106, 89, 90,
596  141, 91, 107, 86, 92, 151, 151, 142, 143, 109,
597  93, 110, 111, 112, 113, 116, 145, 461, 120, 117,
598  146, 121, 124, 118, 122, 123, 125, 179, 188, 126,
599  127, 180, 189, 128, 119, 131, 460, 132, 129, 130,
600  133, 193, 134, 135, 459, 137, 136, 138, 63, 64,
601  64, 139, 201, 175, 194, 176, 140, 177, 197, 198,
602  206, 215, 202, 223, 226, 232, 216, 339, 224, 207,
603  151, 151, 300, 328, 458, 301, 302, 227, 329, 228,
604  457, 456, 233, 340, 455, 454, 453, 452, 451, 450,
605 
606  449, 448, 447, 446, 445, 444, 443, 442, 441, 440,
607  439, 438, 437, 436, 435, 434, 433, 432, 431, 430,
608  429, 428, 427, 426, 425, 424, 423, 422, 421, 420,
609  419, 418, 417, 416, 415, 414, 413, 412, 411, 410,
610  409, 408, 407, 406, 405, 404, 403, 402, 401, 400,
611  399, 398, 397, 396, 395, 394, 393, 392, 391, 390,
612  389, 388, 387, 386, 385, 384, 383, 382, 381, 380,
613  379, 378, 377, 376, 375, 374, 373, 372, 371, 370,
614  369, 368, 367, 366, 365, 364, 363, 362, 361, 360,
615  359, 358, 357, 356, 355, 354, 353, 352, 351, 350,
616 
617  349, 348, 347, 346, 345, 344, 343, 342, 341, 338,
618  337, 336, 335, 334, 333, 332, 331, 330, 327, 326,
619  325, 324, 323, 322, 321, 320, 319, 318, 317, 316,
620  315, 314, 313, 312, 311, 310, 309, 308, 307, 306,
621  305, 304, 303, 299, 298, 297, 296, 295, 294, 293,
622  292, 291, 290, 289, 288, 287, 286, 285, 284, 283,
623  282, 281, 280, 279, 278, 277, 276, 275, 274, 273,
624  272, 271, 270, 269, 268, 267, 266, 265, 264, 263,
625  262, 261, 260, 259, 258, 257, 256, 255, 254, 253,
626  252, 251, 250, 249, 248, 247, 246, 245, 244, 243,
627 
628  242, 241, 240, 239, 238, 237, 236, 235, 234, 231,
629  230, 229, 225, 222, 221, 220, 219, 218, 217, 214,
630  213, 212, 211, 210, 209, 208, 205, 204, 203, 200,
631  199, 196, 195, 192, 191, 190, 187, 186, 185, 184,
632  183, 178, 174, 173, 172, 171, 170, 169, 168, 167,
633  166, 165, 162, 161, 160, 159, 158, 157, 156, 155,
634  154, 153, 152, 61, 150, 149, 144, 108, 104, 101,
635  79, 78, 77, 76, 70, 67, 66, 65, 61, 464,
636  20, 20, 7, 464, 464, 464, 464, 464, 464, 464,
637  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
638 
639  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
640  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
641  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
642  464, 464
643  } ;
644 
646  { 0,
647  467, 3, 1, 3, 3, 3, 2, 4, 466, 4,
648  4, 4, 17, 17, 18, 18, 18, 465, 1, 0,
649  1, 1, 2, 25, 2, 2, 56, 25, 28, 27,
650  27, 0, 28, 36, 39, 36, 56, 36, 39, 27,
651  36, 40, 40, 39, 80, 40, 42, 1, 1, 40,
652  42, 2, 2, 10, 80, 10, 10, 10, 10, 10,
653  10, 10, 10, 10, 10, 10, 95, 10, 462, 10,
654  10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
655  10, 10, 10, 10, 10, 10, 95, 10, 10, 10,
656  10, 10, 10, 10, 47, 10, 10, 10, 37, 37,
657 
658  461, 38, 62, 62, 38, 47, 44, 44, 38, 38,
659  53, 38, 44, 37, 38, 63, 63, 53, 53, 46,
660  38, 46, 46, 46, 46, 48, 55, 460, 49, 48,
661  55, 49, 50, 48, 49, 49, 50, 94, 101, 50,
662  50, 94, 101, 50, 48, 51, 457, 51, 50, 50,
663  51, 105, 51, 51, 456, 52, 51, 52, 64, 64,
664  64, 52, 112, 92, 105, 92, 52, 92, 109, 109,
665  117, 129, 112, 137, 140, 144, 129, 276, 137, 117,
666  151, 151, 234, 265, 452, 234, 234, 140, 265, 140,
667  451, 447, 144, 276, 445, 444, 438, 437, 436, 435,
668 
669  434, 431, 430, 429, 428, 426, 425, 424, 423, 420,
670  419, 418, 417, 415, 414, 413, 412, 411, 409, 408,
671  407, 406, 405, 403, 402, 401, 400, 399, 398, 397,
672  396, 395, 394, 390, 386, 385, 382, 380, 379, 377,
673  376, 375, 374, 373, 372, 369, 368, 367, 364, 363,
674  361, 360, 357, 356, 355, 353, 352, 350, 349, 347,
675  346, 345, 341, 340, 339, 336, 335, 332, 330, 329,
676  328, 327, 325, 324, 323, 321, 320, 319, 318, 317,
677  313, 310, 308, 307, 303, 302, 301, 300, 299, 298,
678  297, 296, 294, 293, 292, 291, 290, 289, 288, 287,
679 
680  286, 285, 283, 282, 281, 280, 279, 278, 277, 275,
681  274, 273, 272, 271, 269, 268, 267, 266, 264, 263,
682  262, 261, 260, 259, 258, 256, 255, 252, 250, 249,
683  248, 247, 246, 245, 244, 243, 242, 241, 240, 239,
684  238, 237, 236, 233, 232, 231, 230, 228, 227, 226,
685  225, 223, 222, 220, 219, 218, 216, 215, 213, 212,
686  211, 210, 209, 208, 205, 203, 201, 200, 199, 198,
687  197, 196, 195, 193, 192, 190, 189, 188, 187, 185,
688  184, 183, 181, 180, 177, 176, 175, 174, 173, 171,
689  169, 168, 166, 165, 164, 163, 162, 161, 160, 159,
690 
691  156, 155, 154, 153, 152, 150, 147, 146, 145, 143,
692  142, 141, 139, 135, 134, 133, 132, 131, 130, 126,
693  125, 124, 123, 122, 121, 120, 116, 114, 113, 111,
694  110, 108, 106, 104, 103, 102, 100, 99, 98, 97,
695  96, 93, 91, 90, 89, 88, 87, 86, 84, 83,
696  82, 81, 78, 77, 76, 75, 73, 71, 70, 69,
697  68, 66, 65, 61, 58, 57, 54, 45, 43, 41,
698  32, 31, 30, 29, 26, 24, 23, 22, 16, 7,
699  6, 5, 464, 464, 464, 464, 464, 464, 464, 464,
700  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
701 
702  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
703  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
704  464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
705  464, 464
706  } ;
707 
708 /* The intent behind this definition is that it'll catch
709  * any uses of REJECT which flex missed.
710  */
711 #define REJECT reject_used_but_not_detected
712 #define yymore() yymore_used_but_not_detected
713 #define YY_MORE_ADJ 0
714 #define YY_RESTORE_YY_MORE_OFFSET
715 #line 1 "corefcn/oct-tex-lexer.ll"
716 /* DO NOT EDIT. AUTOMATICALLY GENERATED FROM oct-tex-lexer.in.ll and oct-tex-symbols.in. */
717 /*
718 
719 Copyright (C) 2013 Michael Goffioul
720 
721 This file is part of Octave.
722 
723 Octave is free software; you can redistribute it and/or modify it
724 under the terms of the GNU General Public License as published by the
725 Free Software Foundation; either version 3 of the License, or (at your
726 option) any later version.
727 
728 Octave is distributed in the hope that it will be useful, but WITHOUT
729 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
730 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
731 for more details.
732 
733 You should have received a copy of the GNU General Public License
734 along with Octave; see the file COPYING. If not, see
735 <http://www.gnu.org/licenses/>.
736 
737 */
738 
739 
740 
741 #line 40 "corefcn/oct-tex-lexer.ll"
742 
743 // The generated code may include unistd.h. We need that to happen
744 // before defining isatty to be prefixed with the gnulib namespace
745 // identifier.
746 
747 #include <sys/types.h>
748 #include <unistd.h>
749 
750 #include "txt-eng.h"
751 #include "oct-tex-parser.h"
752 
753 #if defined (GNULIB_NAMESPACE)
754 // Calls to the following functions appear in the generated output from
755 // flex without the namespace tag. Redefine them so we will use them
756 // via the gnulib namespace.
757 #define fprintf GNULIB_NAMESPACE::fprintf
758 #define fread GNULIB_NAMESPACE::fread
759 #define fwrite GNULIB_NAMESPACE::fwrite
760 #define getc GNULIB_NAMESPACE::getc
761 #define isatty GNULIB_NAMESPACE::isatty
762 #define malloc GNULIB_NAMESPACE::malloc
763 #define realloc GNULIB_NAMESPACE::realloc
764 #endif
765 
766 #line 767 "corefcn/oct-tex-lexer.cc"
767 
768 #define INITIAL 0
769 #define NUM_MODE 1
770 #define MAYBE_NUM_MODE 2
771 
772 #ifndef YY_NO_UNISTD_H
773 /* Special case for "unistd.h", since it is non-ANSI. We include it way
774  * down here because we want the user's section 1 to have been scanned first.
775  * The user has a chance to override it with an option.
776  */
777 #include <unistd.h>
778 #endif
779 
780 #ifndef YY_EXTRA_TYPE
781 #define YY_EXTRA_TYPE void *
782 #endif
783 
784 /* Holds the entire state of the reentrant scanner. */
785 struct yyguts_t
786  {
787 
788  /* User-defined. Not touched by flex. */
790 
791  /* The rest are the same as the globals declared in the non-reentrant scanner. */
792  FILE *yyin_r, *yyout_r;
793  size_t yy_buffer_stack_top; /**< index of top of stack. */
794  size_t yy_buffer_stack_max; /**< capacity of stack. */
795  YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
798  int yyleng_r;
799  char *yy_c_buf_p;
800  int yy_init;
801  int yy_start;
808 
811 
812  char *yytext_r;
815 
817 
818  }; /* end struct yyguts_t */
819 
820 static int yy_init_globals (yyscan_t yyscanner );
821 
822  /* This must go here because YYSTYPE and YYLTYPE are included
823  * from bison output in section 1.*/
824  # define yylval yyg->yylval_r
825 
827 
829 
830 /* Accessor methods to globals.
831  These are made visible to non-reentrant scanners for convenience. */
832 
833 int octave_tex_lex_destroy (yyscan_t yyscanner );
834 
835 int octave_tex_get_debug (yyscan_t yyscanner );
836 
837 void octave_tex_set_debug (int debug_flag ,yyscan_t yyscanner );
838 
840 
841 void octave_tex_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
842 
843 FILE *octave_tex_get_in (yyscan_t yyscanner );
844 
845 void octave_tex_set_in (FILE * in_str ,yyscan_t yyscanner );
846 
847 FILE *octave_tex_get_out (yyscan_t yyscanner );
848 
849 void octave_tex_set_out (FILE * out_str ,yyscan_t yyscanner );
850 
851 int octave_tex_get_leng (yyscan_t yyscanner );
852 
853 char *octave_tex_get_text (yyscan_t yyscanner );
854 
855 int octave_tex_get_lineno (yyscan_t yyscanner );
856 
857 void octave_tex_set_lineno (int line_number ,yyscan_t yyscanner );
858 
859 int octave_tex_get_column (yyscan_t yyscanner );
860 
861 void octave_tex_set_column (int column_no ,yyscan_t yyscanner );
862 
863 YYSTYPE * octave_tex_get_lval (yyscan_t yyscanner );
864 
865 void octave_tex_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
866 
867 /* Macros after this point can all be overridden by user definitions in
868  * section 1.
869  */
870 
871 #ifndef YY_SKIP_YYWRAP
872 #ifdef __cplusplus
873 extern "C" int octave_tex_wrap (yyscan_t yyscanner );
874 #else
875 extern int octave_tex_wrap (yyscan_t yyscanner );
876 #endif
877 #endif
878 
879  static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner);
880 
881 #ifndef yytext_ptr
882 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
883 #endif
884 
885 #ifdef YY_NEED_STRLEN
886 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
887 #endif
888 
889 #ifndef YY_NO_INPUT
890 
891 #ifdef __cplusplus
892 static int yyinput (yyscan_t yyscanner );
893 #else
894 static int input (yyscan_t yyscanner );
895 #endif
896 
897 #endif
898 
899 /* Amount of stuff to slurp up with each read. */
900 #ifndef YY_READ_BUF_SIZE
901 #ifdef __ia64__
902 /* On IA-64, the buffer size is 16k, not 8k */
903 #define YY_READ_BUF_SIZE 16384
904 #else
905 #define YY_READ_BUF_SIZE 8192
906 #endif /* __ia64__ */
907 #endif
908 
909 /* Copy whatever the last rule matched to the standard output. */
910 #ifndef ECHO
911 /* This used to be an fputs(), but since the string might contain NUL's,
912  * we now use fwrite().
913  */
914 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
915 #endif
916 
917 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
918  * is returned in "result".
919  */
920 #ifndef YY_INPUT
921 #define YY_INPUT(buf,result,max_size) \
922  if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
923  { \
924  int c = '*'; \
925  size_t n; \
926  for ( n = 0; n < max_size && \
927  (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
928  buf[n] = (char) c; \
929  if ( c == '\n' ) \
930  buf[n++] = (char) c; \
931  if ( c == EOF && ferror( yyin ) ) \
932  YY_FATAL_ERROR( "input in flex scanner failed" ); \
933  result = n; \
934  } \
935  else \
936  { \
937  errno=0; \
938  while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
939  { \
940  if( errno != EINTR) \
941  { \
942  YY_FATAL_ERROR( "input in flex scanner failed" ); \
943  break; \
944  } \
945  errno=0; \
946  clearerr(yyin); \
947  } \
948  }\
949 \
950 
951 #endif
952 
953 /* No semi-colon after return; correct usage is to write "yyterminate();" -
954  * we don't want an extra ';' after the "return" because that will cause
955  * some compilers to complain about unreachable statements.
956  */
957 #ifndef yyterminate
958 #define yyterminate() return YY_NULL
959 #endif
960 
961 /* Number of entries by which start-condition stack grows. */
962 #ifndef YY_START_STACK_INCR
963 #define YY_START_STACK_INCR 25
964 #endif
965 
966 /* Report a fatal error. */
967 #ifndef YY_FATAL_ERROR
968 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
969 #endif
970 
971 /* end tables serialization structures and prototypes */
972 
973 /* Default declaration of generated scanner - a define so the user can
974  * easily add parameters.
975  */
976 #ifndef YY_DECL
977 #define YY_DECL_IS_OURS 1
978 
979 extern int octave_tex_lex \
980  (YYSTYPE * yylval_param ,yyscan_t yyscanner);
981 
982 #define YY_DECL int octave_tex_lex \
983  (YYSTYPE * yylval_param , yyscan_t yyscanner)
984 #endif /* !YY_DECL */
985 
986 /* Code executed at the beginning of each rule, after yytext and yyleng
987  * have been set up.
988  */
989 #ifndef YY_USER_ACTION
990 #define YY_USER_ACTION
991 #endif
992 
993 /* Code executed at the end of each rule. */
994 #ifndef YY_BREAK
995 #define YY_BREAK break;
996 #endif
997 
998 #define YY_RULE_SETUP \
999  YY_USER_ACTION
1000 
1001 /** The main scanner function which does all the work.
1002  */
1004 {
1005  register yy_state_type yy_current_state;
1006  register char *yy_cp, *yy_bp;
1007  register int yy_act;
1008  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1009 
1010 #line 69 "corefcn/oct-tex-lexer.ll"
1011 
1012 
1013 
1014 // Numeric values
1015 
1016 
1017 #line 1018 "corefcn/oct-tex-lexer.cc"
1018 
1019  yylval = yylval_param;
1020 
1021  if ( !yyg->yy_init )
1022  {
1023  yyg->yy_init = 1;
1024 
1025 #ifdef YY_USER_INIT
1026  YY_USER_INIT;
1027 #endif
1028 
1029  if ( ! yyg->yy_start )
1030  yyg->yy_start = 1; /* first start state */
1031 
1032  if ( ! yyin )
1033  yyin = stdin;
1034 
1035  if ( ! yyout )
1036  yyout = stdout;
1037 
1038  if ( ! YY_CURRENT_BUFFER ) {
1039  octave_tex_ensure_buffer_stack (yyscanner);
1042  }
1043 
1044  octave_tex__load_buffer_state(yyscanner );
1045  }
1046 
1047  while ( 1 ) /* loops until end-of-file is reached */
1048  {
1049  yy_cp = yyg->yy_c_buf_p;
1050 
1051  /* Support of yytext. */
1052  *yy_cp = yyg->yy_hold_char;
1053 
1054  /* yy_bp points to the position in yy_ch_buf of the start of
1055  * the current run.
1056  */
1057  yy_bp = yy_cp;
1058 
1059  yy_current_state = yyg->yy_start;
1060 yy_match:
1061  do
1062  {
1063  register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1064  if ( yy_accept[yy_current_state] )
1065  {
1066  yyg->yy_last_accepting_state = yy_current_state;
1067  yyg->yy_last_accepting_cpos = yy_cp;
1068  }
1069  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1070  {
1071  yy_current_state = (int) yy_def[yy_current_state];
1072  if ( yy_current_state >= 465 )
1073  yy_c = yy_meta[(unsigned int) yy_c];
1074  }
1075  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1076  ++yy_cp;
1077  }
1078  while ( yy_base[yy_current_state] != 483 );
1079 
1080 yy_find_action:
1081  yy_act = yy_accept[yy_current_state];
1082  if ( yy_act == 0 )
1083  { /* have to back up */
1084  yy_cp = yyg->yy_last_accepting_cpos;
1085  yy_current_state = yyg->yy_last_accepting_state;
1086  yy_act = yy_accept[yy_current_state];
1087  }
1088 
1090 
1091 do_action: /* This label is used only to access EOF actions. */
1092 
1093  switch ( yy_act )
1094  { /* beginning of action switch */
1095  case 0: /* must back up */
1096  /* undo the effects of YY_DO_BEFORE_ACTION */
1097  *yy_cp = yyg->yy_hold_char;
1098  yy_cp = yyg->yy_last_accepting_cpos;
1099  yy_current_state = yyg->yy_last_accepting_state;
1100  goto yy_find_action;
1101 
1102 case 1:
1104 #line 75 "corefcn/oct-tex-lexer.ll"
1105 {
1106  int nread;
1107 
1108  nread = sscanf (yytext, "%lf", &(yylval->num));
1109  if (nread == 1)
1110  return NUM;
1111  }
1112  YY_BREAK
1113 case 2:
1115 #line 82 "corefcn/oct-tex-lexer.ll"
1116 { }
1117  YY_BREAK
1118 case 3:
1119 /* rule 3 can match eol */
1121 #line 83 "corefcn/oct-tex-lexer.ll"
1122 { yyless (0); BEGIN (INITIAL); }
1123  YY_BREAK
1124 case 4:
1126 #line 85 "corefcn/oct-tex-lexer.ll"
1127 { BEGIN (NUM_MODE); return START; }
1128  YY_BREAK
1129 case 5:
1130 /* rule 5 can match eol */
1132 #line 86 "corefcn/oct-tex-lexer.ll"
1133 { yyless (0); BEGIN (INITIAL); }
1134  YY_BREAK
1135 
1136 // Simple commands
1137 
1138 case 6:
1140 #line 92 "corefcn/oct-tex-lexer.ll"
1141 { return BF; }
1142  YY_BREAK
1143 case 7:
1145 #line 93 "corefcn/oct-tex-lexer.ll"
1146 { return IT; }
1147  YY_BREAK
1148 case 8:
1150 #line 94 "corefcn/oct-tex-lexer.ll"
1151 { return SL; }
1152  YY_BREAK
1153 case 9:
1155 #line 95 "corefcn/oct-tex-lexer.ll"
1156 { return RM; }
1157  YY_BREAK
1158 
1159 // Generic font commands
1160 
1161 case 10:
1163 #line 101 "corefcn/oct-tex-lexer.ll"
1164 { return FONTNAME; }
1165  YY_BREAK
1166 case 11:
1168 #line 102 "corefcn/oct-tex-lexer.ll"
1169 { BEGIN (MAYBE_NUM_MODE); return FONTSIZE; }
1170  YY_BREAK
1171 case 12:
1173 #line 103 "corefcn/oct-tex-lexer.ll"
1174 { BEGIN (MAYBE_NUM_MODE); return COLOR_RGB; }
1175  YY_BREAK
1176 case 13:
1178 #line 104 "corefcn/oct-tex-lexer.ll"
1179 { return COLOR; }
1180  YY_BREAK
1181 
1182 // Special characters
1183 
1184 case 14:
1186 #line 110 "corefcn/oct-tex-lexer.ll"
1187 { return START; }
1188  YY_BREAK
1189 case 15:
1191 #line 111 "corefcn/oct-tex-lexer.ll"
1192 { return END; }
1193  YY_BREAK
1194 case 16:
1196 #line 112 "corefcn/oct-tex-lexer.ll"
1197 { return SUPER; }
1198  YY_BREAK
1199 case 17:
1201 #line 113 "corefcn/oct-tex-lexer.ll"
1202 { return SUB; }
1203  YY_BREAK
1204 case 18:
1205 #line 116 "corefcn/oct-tex-lexer.ll"
1206 case 19:
1207 #line 117 "corefcn/oct-tex-lexer.ll"
1208 case 20:
1209 #line 118 "corefcn/oct-tex-lexer.ll"
1210 case 21:
1211 #line 119 "corefcn/oct-tex-lexer.ll"
1212 case 22:
1214 #line 119 "corefcn/oct-tex-lexer.ll"
1215 { yylval->ch = yytext[1]; return CH; }
1216  YY_BREAK
1217 
1218 // Symbols
1219 
1220 case 23:
1222 #line 125 "corefcn/oct-tex-lexer.ll"
1223 { yylval->sym = 0; return SYM; }
1224  YY_BREAK
1225 case 24:
1227 #line 126 "corefcn/oct-tex-lexer.ll"
1228 { yylval->sym = 1; return SYM; }
1229  YY_BREAK
1230 case 25:
1232 #line 127 "corefcn/oct-tex-lexer.ll"
1233 { yylval->sym = 2; return SYM; }
1234  YY_BREAK
1235 case 26:
1237 #line 128 "corefcn/oct-tex-lexer.ll"
1238 { yylval->sym = 3; return SYM; }
1239  YY_BREAK
1240 case 27:
1242 #line 129 "corefcn/oct-tex-lexer.ll"
1243 { yylval->sym = 4; return SYM; }
1244  YY_BREAK
1245 case 28:
1247 #line 130 "corefcn/oct-tex-lexer.ll"
1248 { yylval->sym = 5; return SYM; }
1249  YY_BREAK
1250 case 29:
1252 #line 131 "corefcn/oct-tex-lexer.ll"
1253 { yylval->sym = 6; return SYM; }
1254  YY_BREAK
1255 case 30:
1257 #line 132 "corefcn/oct-tex-lexer.ll"
1258 { yylval->sym = 7; return SYM; }
1259  YY_BREAK
1260 case 31:
1262 #line 133 "corefcn/oct-tex-lexer.ll"
1263 { yylval->sym = 8; return SYM; }
1264  YY_BREAK
1265 case 32:
1267 #line 134 "corefcn/oct-tex-lexer.ll"
1268 { yylval->sym = 9; return SYM; }
1269  YY_BREAK
1270 case 33:
1272 #line 135 "corefcn/oct-tex-lexer.ll"
1273 { yylval->sym = 10; return SYM; }
1274  YY_BREAK
1275 case 34:
1277 #line 136 "corefcn/oct-tex-lexer.ll"
1278 { yylval->sym = 11; return SYM; }
1279  YY_BREAK
1280 case 35:
1282 #line 137 "corefcn/oct-tex-lexer.ll"
1283 { yylval->sym = 12; return SYM; }
1284  YY_BREAK
1285 case 36:
1287 #line 138 "corefcn/oct-tex-lexer.ll"
1288 { yylval->sym = 13; return SYM; }
1289  YY_BREAK
1290 case 37:
1292 #line 139 "corefcn/oct-tex-lexer.ll"
1293 { yylval->sym = 14; return SYM; }
1294  YY_BREAK
1295 case 38:
1297 #line 140 "corefcn/oct-tex-lexer.ll"
1298 { yylval->sym = 15; return SYM; }
1299  YY_BREAK
1300 case 39:
1302 #line 141 "corefcn/oct-tex-lexer.ll"
1303 { yylval->sym = 16; return SYM; }
1304  YY_BREAK
1305 case 40:
1307 #line 142 "corefcn/oct-tex-lexer.ll"
1308 { yylval->sym = 17; return SYM; }
1309  YY_BREAK
1310 case 41:
1312 #line 143 "corefcn/oct-tex-lexer.ll"
1313 { yylval->sym = 18; return SYM; }
1314  YY_BREAK
1315 case 42:
1317 #line 144 "corefcn/oct-tex-lexer.ll"
1318 { yylval->sym = 19; return SYM; }
1319  YY_BREAK
1320 case 43:
1322 #line 145 "corefcn/oct-tex-lexer.ll"
1323 { yylval->sym = 20; return SYM; }
1324  YY_BREAK
1325 case 44:
1327 #line 146 "corefcn/oct-tex-lexer.ll"
1328 { yylval->sym = 21; return SYM; }
1329  YY_BREAK
1330 case 45:
1332 #line 147 "corefcn/oct-tex-lexer.ll"
1333 { yylval->sym = 22; return SYM; }
1334  YY_BREAK
1335 case 46:
1337 #line 148 "corefcn/oct-tex-lexer.ll"
1338 { yylval->sym = 23; return SYM; }
1339  YY_BREAK
1340 case 47:
1342 #line 149 "corefcn/oct-tex-lexer.ll"
1343 { yylval->sym = 24; return SYM; }
1344  YY_BREAK
1345 case 48:
1347 #line 150 "corefcn/oct-tex-lexer.ll"
1348 { yylval->sym = 25; return SYM; }
1349  YY_BREAK
1350 case 49:
1352 #line 151 "corefcn/oct-tex-lexer.ll"
1353 { yylval->sym = 26; return SYM; }
1354  YY_BREAK
1355 case 50:
1357 #line 152 "corefcn/oct-tex-lexer.ll"
1358 { yylval->sym = 27; return SYM; }
1359  YY_BREAK
1360 case 51:
1362 #line 153 "corefcn/oct-tex-lexer.ll"
1363 { yylval->sym = 28; return SYM; }
1364  YY_BREAK
1365 case 52:
1367 #line 154 "corefcn/oct-tex-lexer.ll"
1368 { yylval->sym = 29; return SYM; }
1369  YY_BREAK
1370 case 53:
1372 #line 155 "corefcn/oct-tex-lexer.ll"
1373 { yylval->sym = 30; return SYM; }
1374  YY_BREAK
1375 case 54:
1377 #line 156 "corefcn/oct-tex-lexer.ll"
1378 { yylval->sym = 31; return SYM; }
1379  YY_BREAK
1380 case 55:
1382 #line 157 "corefcn/oct-tex-lexer.ll"
1383 { yylval->sym = 32; return SYM; }
1384  YY_BREAK
1385 case 56:
1387 #line 158 "corefcn/oct-tex-lexer.ll"
1388 { yylval->sym = 33; return SYM; }
1389  YY_BREAK
1390 case 57:
1392 #line 159 "corefcn/oct-tex-lexer.ll"
1393 { yylval->sym = 34; return SYM; }
1394  YY_BREAK
1395 case 58:
1397 #line 160 "corefcn/oct-tex-lexer.ll"
1398 { yylval->sym = 35; return SYM; }
1399  YY_BREAK
1400 case 59:
1402 #line 161 "corefcn/oct-tex-lexer.ll"
1403 { yylval->sym = 36; return SYM; }
1404  YY_BREAK
1405 case 60:
1407 #line 162 "corefcn/oct-tex-lexer.ll"
1408 { yylval->sym = 37; return SYM; }
1409  YY_BREAK
1410 case 61:
1412 #line 163 "corefcn/oct-tex-lexer.ll"
1413 { yylval->sym = 38; return SYM; }
1414  YY_BREAK
1415 case 62:
1417 #line 164 "corefcn/oct-tex-lexer.ll"
1418 { yylval->sym = 39; return SYM; }
1419  YY_BREAK
1420 case 63:
1422 #line 165 "corefcn/oct-tex-lexer.ll"
1423 { yylval->sym = 40; return SYM; }
1424  YY_BREAK
1425 case 64:
1427 #line 166 "corefcn/oct-tex-lexer.ll"
1428 { yylval->sym = 41; return SYM; }
1429  YY_BREAK
1430 case 65:
1432 #line 167 "corefcn/oct-tex-lexer.ll"
1433 { yylval->sym = 42; return SYM; }
1434  YY_BREAK
1435 case 66:
1437 #line 168 "corefcn/oct-tex-lexer.ll"
1438 { yylval->sym = 43; return SYM; }
1439  YY_BREAK
1440 case 67:
1442 #line 169 "corefcn/oct-tex-lexer.ll"
1443 { yylval->sym = 44; return SYM; }
1444  YY_BREAK
1445 case 68:
1447 #line 170 "corefcn/oct-tex-lexer.ll"
1448 { yylval->sym = 45; return SYM; }
1449  YY_BREAK
1450 case 69:
1452 #line 171 "corefcn/oct-tex-lexer.ll"
1453 { yylval->sym = 46; return SYM; }
1454  YY_BREAK
1455 case 70:
1457 #line 172 "corefcn/oct-tex-lexer.ll"
1458 { yylval->sym = 47; return SYM; }
1459  YY_BREAK
1460 case 71:
1462 #line 173 "corefcn/oct-tex-lexer.ll"
1463 { yylval->sym = 48; return SYM; }
1464  YY_BREAK
1465 case 72:
1467 #line 174 "corefcn/oct-tex-lexer.ll"
1468 { yylval->sym = 49; return SYM; }
1469  YY_BREAK
1470 case 73:
1472 #line 175 "corefcn/oct-tex-lexer.ll"
1473 { yylval->sym = 50; return SYM; }
1474  YY_BREAK
1475 case 74:
1477 #line 176 "corefcn/oct-tex-lexer.ll"
1478 { yylval->sym = 51; return SYM; }
1479  YY_BREAK
1480 case 75:
1482 #line 177 "corefcn/oct-tex-lexer.ll"
1483 { yylval->sym = 52; return SYM; }
1484  YY_BREAK
1485 case 76:
1487 #line 178 "corefcn/oct-tex-lexer.ll"
1488 { yylval->sym = 53; return SYM; }
1489  YY_BREAK
1490 case 77:
1492 #line 179 "corefcn/oct-tex-lexer.ll"
1493 { yylval->sym = 54; return SYM; }
1494  YY_BREAK
1495 case 78:
1497 #line 180 "corefcn/oct-tex-lexer.ll"
1498 { yylval->sym = 55; return SYM; }
1499  YY_BREAK
1500 case 79:
1502 #line 181 "corefcn/oct-tex-lexer.ll"
1503 { yylval->sym = 56; return SYM; }
1504  YY_BREAK
1505 case 80:
1507 #line 182 "corefcn/oct-tex-lexer.ll"
1508 { yylval->sym = 57; return SYM; }
1509  YY_BREAK
1510 case 81:
1512 #line 183 "corefcn/oct-tex-lexer.ll"
1513 { yylval->sym = 58; return SYM; }
1514  YY_BREAK
1515 case 82:
1517 #line 184 "corefcn/oct-tex-lexer.ll"
1518 { yylval->sym = 59; return SYM; }
1519  YY_BREAK
1520 case 83:
1522 #line 185 "corefcn/oct-tex-lexer.ll"
1523 { yylval->sym = 60; return SYM; }
1524  YY_BREAK
1525 case 84:
1527 #line 186 "corefcn/oct-tex-lexer.ll"
1528 { yylval->sym = 61; return SYM; }
1529  YY_BREAK
1530 case 85:
1532 #line 187 "corefcn/oct-tex-lexer.ll"
1533 { yylval->sym = 62; return SYM; }
1534  YY_BREAK
1535 case 86:
1537 #line 188 "corefcn/oct-tex-lexer.ll"
1538 { yylval->sym = 63; return SYM; }
1539  YY_BREAK
1540 case 87:
1542 #line 189 "corefcn/oct-tex-lexer.ll"
1543 { yylval->sym = 64; return SYM; }
1544  YY_BREAK
1545 case 88:
1547 #line 190 "corefcn/oct-tex-lexer.ll"
1548 { yylval->sym = 65; return SYM; }
1549  YY_BREAK
1550 case 89:
1552 #line 191 "corefcn/oct-tex-lexer.ll"
1553 { yylval->sym = 66; return SYM; }
1554  YY_BREAK
1555 case 90:
1557 #line 192 "corefcn/oct-tex-lexer.ll"
1558 { yylval->sym = 67; return SYM; }
1559  YY_BREAK
1560 case 91:
1562 #line 193 "corefcn/oct-tex-lexer.ll"
1563 { yylval->sym = 68; return SYM; }
1564  YY_BREAK
1565 case 92:
1567 #line 194 "corefcn/oct-tex-lexer.ll"
1568 { yylval->sym = 69; return SYM; }
1569  YY_BREAK
1570 case 93:
1572 #line 195 "corefcn/oct-tex-lexer.ll"
1573 { yylval->sym = 70; return SYM; }
1574  YY_BREAK
1575 case 94:
1577 #line 196 "corefcn/oct-tex-lexer.ll"
1578 { yylval->sym = 71; return SYM; }
1579  YY_BREAK
1580 case 95:
1582 #line 197 "corefcn/oct-tex-lexer.ll"
1583 { yylval->sym = 72; return SYM; }
1584  YY_BREAK
1585 case 96:
1587 #line 198 "corefcn/oct-tex-lexer.ll"
1588 { yylval->sym = 73; return SYM; }
1589  YY_BREAK
1590 case 97:
1592 #line 199 "corefcn/oct-tex-lexer.ll"
1593 { yylval->sym = 74; return SYM; }
1594  YY_BREAK
1595 case 98:
1597 #line 200 "corefcn/oct-tex-lexer.ll"
1598 { yylval->sym = 75; return SYM; }
1599  YY_BREAK
1600 case 99:
1602 #line 201 "corefcn/oct-tex-lexer.ll"
1603 { yylval->sym = 76; return SYM; }
1604  YY_BREAK
1605 case 100:
1607 #line 202 "corefcn/oct-tex-lexer.ll"
1608 { yylval->sym = 77; return SYM; }
1609  YY_BREAK
1610 case 101:
1612 #line 203 "corefcn/oct-tex-lexer.ll"
1613 { yylval->sym = 78; return SYM; }
1614  YY_BREAK
1615 case 102:
1617 #line 204 "corefcn/oct-tex-lexer.ll"
1618 { yylval->sym = 79; return SYM; }
1619  YY_BREAK
1620 case 103:
1622 #line 205 "corefcn/oct-tex-lexer.ll"
1623 { yylval->sym = 80; return SYM; }
1624  YY_BREAK
1625 case 104:
1627 #line 206 "corefcn/oct-tex-lexer.ll"
1628 { yylval->sym = 81; return SYM; }
1629  YY_BREAK
1630 case 105:
1632 #line 207 "corefcn/oct-tex-lexer.ll"
1633 { yylval->sym = 82; return SYM; }
1634  YY_BREAK
1635 case 106:
1637 #line 208 "corefcn/oct-tex-lexer.ll"
1638 { yylval->sym = 83; return SYM; }
1639  YY_BREAK
1640 case 107:
1642 #line 209 "corefcn/oct-tex-lexer.ll"
1643 { yylval->sym = 84; return SYM; }
1644  YY_BREAK
1645 case 108:
1647 #line 210 "corefcn/oct-tex-lexer.ll"
1648 { yylval->sym = 85; return SYM; }
1649  YY_BREAK
1650 case 109:
1652 #line 211 "corefcn/oct-tex-lexer.ll"
1653 { yylval->sym = 86; return SYM; }
1654  YY_BREAK
1655 case 110:
1657 #line 212 "corefcn/oct-tex-lexer.ll"
1658 { yylval->sym = 87; return SYM; }
1659  YY_BREAK
1660 case 111:
1662 #line 213 "corefcn/oct-tex-lexer.ll"
1663 { yylval->sym = 88; return SYM; }
1664  YY_BREAK
1665 case 112:
1667 #line 214 "corefcn/oct-tex-lexer.ll"
1668 { yylval->sym = 89; return SYM; }
1669  YY_BREAK
1670 case 113:
1672 #line 215 "corefcn/oct-tex-lexer.ll"
1673 { yylval->sym = 90; return SYM; }
1674  YY_BREAK
1675 case 114:
1677 #line 216 "corefcn/oct-tex-lexer.ll"
1678 { yylval->sym = 91; return SYM; }
1679  YY_BREAK
1680 case 115:
1682 #line 217 "corefcn/oct-tex-lexer.ll"
1683 { yylval->sym = 92; return SYM; }
1684  YY_BREAK
1685 case 116:
1687 #line 218 "corefcn/oct-tex-lexer.ll"
1688 { yylval->sym = 93; return SYM; }
1689  YY_BREAK
1690 case 117:
1692 #line 219 "corefcn/oct-tex-lexer.ll"
1693 { yylval->sym = 94; return SYM; }
1694  YY_BREAK
1695 case 118:
1697 #line 220 "corefcn/oct-tex-lexer.ll"
1698 { yylval->sym = 95; return SYM; }
1699  YY_BREAK
1700 case 119:
1702 #line 221 "corefcn/oct-tex-lexer.ll"
1703 { yylval->sym = 96; return SYM; }
1704  YY_BREAK
1705 case 120:
1707 #line 222 "corefcn/oct-tex-lexer.ll"
1708 { yylval->sym = 97; return SYM; }
1709  YY_BREAK
1710 case 121:
1712 #line 223 "corefcn/oct-tex-lexer.ll"
1713 { yylval->sym = 98; return SYM; }
1714  YY_BREAK
1715 case 122:
1717 #line 224 "corefcn/oct-tex-lexer.ll"
1718 { yylval->sym = 99; return SYM; }
1719  YY_BREAK
1720 case 123:
1722 #line 225 "corefcn/oct-tex-lexer.ll"
1723 { yylval->sym = 100; return SYM; }
1724  YY_BREAK
1725 case 124:
1727 #line 226 "corefcn/oct-tex-lexer.ll"
1728 { yylval->sym = 101; return SYM; }
1729  YY_BREAK
1730 case 125:
1732 #line 227 "corefcn/oct-tex-lexer.ll"
1733 { yylval->sym = 102; return SYM; }
1734  YY_BREAK
1735 
1736 // Generic character
1737 
1738 case 126:
1739 /* rule 126 can match eol */
1740 #line 234 "corefcn/oct-tex-lexer.ll"
1741 case 127:
1742 /* rule 127 can match eol */
1744 #line 234 "corefcn/oct-tex-lexer.ll"
1745 { yylval->ch = yytext[0]; return CH; }
1746  YY_BREAK
1747 case 128:
1749 #line 236 "corefcn/oct-tex-lexer.ll"
1750 ECHO;
1751  YY_BREAK
1752 #line 1753 "corefcn/oct-tex-lexer.cc"
1753 case YY_STATE_EOF(INITIAL):
1754 case YY_STATE_EOF(NUM_MODE):
1756  yyterminate();
1757 
1758  case YY_END_OF_BUFFER:
1759  {
1760  /* Amount of text matched not including the EOB char. */
1761  int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1762 
1763  /* Undo the effects of YY_DO_BEFORE_ACTION. */
1764  *yy_cp = yyg->yy_hold_char;
1766 
1767  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1768  {
1769  /* We're scanning a new file or input source. It's
1770  * possible that this happened because the user
1771  * just pointed yyin at a new source and called
1772  * octave_tex_lex(). If so, then we have to assure
1773  * consistency between YY_CURRENT_BUFFER and our
1774  * globals. Here is the right place to do so, because
1775  * this is the first action (other than possibly a
1776  * back-up) that will match for the new input source.
1777  */
1778  yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1779  YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1780  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1781  }
1782 
1783  /* Note that here we test for yy_c_buf_p "<=" to the position
1784  * of the first EOB in the buffer, since yy_c_buf_p will
1785  * already have been incremented past the NUL character
1786  * (since all states make transitions on EOB to the
1787  * end-of-buffer state). Contrast this with the test
1788  * in input().
1789  */
1790  if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1791  { /* This was really a NUL. */
1792  yy_state_type yy_next_state;
1793 
1794  yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1795 
1796  yy_current_state = yy_get_previous_state( yyscanner );
1797 
1798  /* Okay, we're now positioned to make the NUL
1799  * transition. We couldn't have
1800  * yy_get_previous_state() go ahead and do it
1801  * for us because it doesn't know how to deal
1802  * with the possibility of jamming (and we don't
1803  * want to build jamming into it because then it
1804  * will run more slowly).
1805  */
1806 
1807  yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1808 
1809  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1810 
1811  if ( yy_next_state )
1812  {
1813  /* Consume the NUL. */
1814  yy_cp = ++yyg->yy_c_buf_p;
1815  yy_current_state = yy_next_state;
1816  goto yy_match;
1817  }
1818 
1819  else
1820  {
1821  yy_cp = yyg->yy_c_buf_p;
1822  goto yy_find_action;
1823  }
1824  }
1825 
1826  else switch ( yy_get_next_buffer( yyscanner ) )
1827  {
1828  case EOB_ACT_END_OF_FILE:
1829  {
1830  yyg->yy_did_buffer_switch_on_eof = 0;
1831 
1832  if ( octave_tex_wrap(yyscanner ) )
1833  {
1834  /* Note: because we've taken care in
1835  * yy_get_next_buffer() to have set up
1836  * yytext, we can now set up
1837  * yy_c_buf_p so that if some total
1838  * hoser (like flex itself) wants to
1839  * call the scanner after we return the
1840  * YY_NULL, it'll still work - another
1841  * YY_NULL will get returned.
1842  */
1843  yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1844 
1845  yy_act = YY_STATE_EOF(YY_START);
1846  goto do_action;
1847  }
1848 
1849  else
1850  {
1851  if ( ! yyg->yy_did_buffer_switch_on_eof )
1852  YY_NEW_FILE;
1853  }
1854  break;
1855  }
1856 
1857  case EOB_ACT_CONTINUE_SCAN:
1858  yyg->yy_c_buf_p =
1859  yyg->yytext_ptr + yy_amount_of_matched_text;
1860 
1861  yy_current_state = yy_get_previous_state( yyscanner );
1862 
1863  yy_cp = yyg->yy_c_buf_p;
1864  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1865  goto yy_match;
1866 
1867  case EOB_ACT_LAST_MATCH:
1868  yyg->yy_c_buf_p =
1869  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1870 
1871  yy_current_state = yy_get_previous_state( yyscanner );
1872 
1873  yy_cp = yyg->yy_c_buf_p;
1874  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1875  goto yy_find_action;
1876  }
1877  break;
1878  }
1879 
1880  default:
1882  "fatal flex scanner internal error--no action found" );
1883  } /* end of action switch */
1884  } /* end of scanning one token */
1885 } /* end of octave_tex_lex */
1886 
1887 /* yy_get_next_buffer - try to read in a new buffer
1888  *
1889  * Returns a code representing an action:
1890  * EOB_ACT_LAST_MATCH -
1891  * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1892  * EOB_ACT_END_OF_FILE - end of file
1893  */
1894 static int yy_get_next_buffer (yyscan_t yyscanner)
1895 {
1896  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1897  register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1898  register char *source = yyg->yytext_ptr;
1899  register int number_to_move, i;
1900  int ret_val;
1901 
1902  if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1904  "fatal flex scanner internal error--end of buffer missed" );
1905 
1906  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1907  { /* Don't try to fill the buffer, so this is an EOF. */
1908  if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1909  {
1910  /* We matched a single character, the EOB, so
1911  * treat this as a final EOF.
1912  */
1913  return EOB_ACT_END_OF_FILE;
1914  }
1915 
1916  else
1917  {
1918  /* We matched some text prior to the EOB, first
1919  * process it.
1920  */
1921  return EOB_ACT_LAST_MATCH;
1922  }
1923  }
1924 
1925  /* Try to read more data. */
1926 
1927  /* First move last chars to start of buffer. */
1928  number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
1929 
1930  for ( i = 0; i < number_to_move; ++i )
1931  *(dest++) = *(source++);
1932 
1933  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1934  /* don't do the read, it's not guaranteed to return an EOF,
1935  * just force an EOF
1936  */
1937  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1938 
1939  else
1940  {
1941  int num_to_read =
1942  YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1943 
1944  while ( num_to_read <= 0 )
1945  { /* Not enough room in the buffer - grow it. */
1946 
1947  /* just a shorter name for the current buffer */
1948  YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1949 
1950  int yy_c_buf_p_offset =
1951  (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1952 
1953  if ( b->yy_is_our_buffer )
1954  {
1955  int new_size = b->yy_buf_size * 2;
1956 
1957  if ( new_size <= 0 )
1958  b->yy_buf_size += b->yy_buf_size / 8;
1959  else
1960  b->yy_buf_size *= 2;
1961 
1962  b->yy_ch_buf = (char *)
1963  /* Include room in for 2 EOB chars. */
1964  octave_tex_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
1965  }
1966  else
1967  /* Can't grow it, we don't own it. */
1968  b->yy_ch_buf = 0;
1969 
1970  if ( ! b->yy_ch_buf )
1972  "fatal error - scanner input buffer overflow" );
1973 
1974  yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1975 
1976  num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1977  number_to_move - 1;
1978 
1979  }
1980 
1981  if ( num_to_read > YY_READ_BUF_SIZE )
1982  num_to_read = YY_READ_BUF_SIZE;
1983 
1984  /* Read in more data. */
1985  YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1986  yyg->yy_n_chars, (size_t) num_to_read );
1987 
1988  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1989  }
1990 
1991  if ( yyg->yy_n_chars == 0 )
1992  {
1993  if ( number_to_move == YY_MORE_ADJ )
1994  {
1995  ret_val = EOB_ACT_END_OF_FILE;
1996  octave_tex_restart(yyin ,yyscanner);
1997  }
1998 
1999  else
2000  {
2001  ret_val = EOB_ACT_LAST_MATCH;
2002  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2004  }
2005  }
2006 
2007  else
2008  ret_val = EOB_ACT_CONTINUE_SCAN;
2009 
2010  if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2011  /* Extend the array by 50%, plus the number we really need. */
2012  yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
2013  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) octave_tex_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
2014  if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2015  YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2016  }
2017 
2018  yyg->yy_n_chars += number_to_move;
2021 
2022  yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2023 
2024  return ret_val;
2025 }
2026 
2027 /* yy_get_previous_state - get the state just before the EOB char was reached */
2028 
2030 {
2031  register yy_state_type yy_current_state;
2032  register char *yy_cp;
2033  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2034 
2035  yy_current_state = yyg->yy_start;
2036 
2037  for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
2038  {
2039  register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2040  if ( yy_accept[yy_current_state] )
2041  {
2042  yyg->yy_last_accepting_state = yy_current_state;
2043  yyg->yy_last_accepting_cpos = yy_cp;
2044  }
2045  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2046  {
2047  yy_current_state = (int) yy_def[yy_current_state];
2048  if ( yy_current_state >= 465 )
2049  yy_c = yy_meta[(unsigned int) yy_c];
2050  }
2051  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2052  }
2053 
2054  return yy_current_state;
2055 }
2056 
2057 /* yy_try_NUL_trans - try to make a transition on the NUL character
2058  *
2059  * synopsis
2060  * next_state = yy_try_NUL_trans( current_state );
2061  */
2062  static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
2063 {
2064  register int yy_is_jam;
2065  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
2066  register char *yy_cp = yyg->yy_c_buf_p;
2067 
2068  register YY_CHAR yy_c = 1;
2069  if ( yy_accept[yy_current_state] )
2070  {
2071  yyg->yy_last_accepting_state = yy_current_state;
2072  yyg->yy_last_accepting_cpos = yy_cp;
2073  }
2074  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2075  {
2076  yy_current_state = (int) yy_def[yy_current_state];
2077  if ( yy_current_state >= 465 )
2078  yy_c = yy_meta[(unsigned int) yy_c];
2079  }
2080  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2081  yy_is_jam = (yy_current_state == 464);
2082 
2083  return yy_is_jam ? 0 : yy_current_state;
2084 }
2085 
2086  static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner)
2087 {
2088  register char *yy_cp;
2089  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2090 
2091  yy_cp = yyg->yy_c_buf_p;
2092 
2093  /* undo effects of setting up yytext */
2094  *yy_cp = yyg->yy_hold_char;
2095 
2096  if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2097  { /* need to shift things up to make room */
2098  /* +2 for EOB chars. */
2099  register int number_to_move = yyg->yy_n_chars + 2;
2100  register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
2101  YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
2102  register char *source =
2103  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
2104 
2105  while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2106  *--dest = *--source;
2107 
2108  yy_cp += (int) (dest - source);
2109  yy_bp += (int) (dest - source);
2110  YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
2111  yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
2112 
2113  if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2114  YY_FATAL_ERROR( "flex scanner push-back overflow" );
2115  }
2116 
2117  *--yy_cp = (char) c;
2118 
2119  yyg->yytext_ptr = yy_bp;
2120  yyg->yy_hold_char = *yy_cp;
2121  yyg->yy_c_buf_p = yy_cp;
2122 }
2123 
2124 #ifndef YY_NO_INPUT
2125 #ifdef __cplusplus
2126  static int yyinput (yyscan_t yyscanner)
2127 #else
2128  static int input (yyscan_t yyscanner)
2129 #endif
2130 
2131 {
2132  int c;
2133  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2134 
2135  *yyg->yy_c_buf_p = yyg->yy_hold_char;
2136 
2137  if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2138  {
2139  /* yy_c_buf_p now points to the character we want to return.
2140  * If this occurs *before* the EOB characters, then it's a
2141  * valid NUL; if not, then we've hit the end of the buffer.
2142  */
2143  if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2144  /* This was really a NUL. */
2145  *yyg->yy_c_buf_p = '\0';
2146 
2147  else
2148  { /* need more input */
2149  int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
2150  ++yyg->yy_c_buf_p;
2151 
2152  switch ( yy_get_next_buffer( yyscanner ) )
2153  {
2154  case EOB_ACT_LAST_MATCH:
2155  /* This happens because yy_g_n_b()
2156  * sees that we've accumulated a
2157  * token and flags that we need to
2158  * try matching the token before
2159  * proceeding. But for input(),
2160  * there's no matching to consider.
2161  * So convert the EOB_ACT_LAST_MATCH
2162  * to EOB_ACT_END_OF_FILE.
2163  */
2164 
2165  /* Reset buffer status. */
2166  octave_tex_restart(yyin ,yyscanner);
2167 
2168  /*FALLTHROUGH*/
2169 
2170  case EOB_ACT_END_OF_FILE:
2171  {
2172  if ( octave_tex_wrap(yyscanner ) )
2173  return EOF;
2174 
2175  if ( ! yyg->yy_did_buffer_switch_on_eof )
2176  YY_NEW_FILE;
2177 #ifdef __cplusplus
2178  return yyinput(yyscanner);
2179 #else
2180  return input(yyscanner);
2181 #endif
2182  }
2183 
2184  case EOB_ACT_CONTINUE_SCAN:
2185  yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
2186  break;
2187  }
2188  }
2189  }
2190 
2191  c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
2192  *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
2193  yyg->yy_hold_char = *++yyg->yy_c_buf_p;
2194 
2195  return c;
2196 }
2197 #endif /* ifndef YY_NO_INPUT */
2198 
2199 /** Immediately switch to a different input stream.
2200  * @param input_file A readable stream.
2201  * @param yyscanner The scanner object.
2202  * @note This function does not reset the start condition to @c INITIAL .
2203  */
2204  void octave_tex_restart (FILE * input_file , yyscan_t yyscanner)
2205 {
2206  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2207 
2208  if ( ! YY_CURRENT_BUFFER ){
2209  octave_tex_ensure_buffer_stack (yyscanner);
2212  }
2213 
2214  octave_tex__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
2215  octave_tex__load_buffer_state(yyscanner );
2216 }
2217 
2218 /** Switch to a different input buffer.
2219  * @param new_buffer The new input buffer.
2220  * @param yyscanner The scanner object.
2221  */
2222  void octave_tex__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2223 {
2224  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2225 
2226  /* TODO. We should be able to replace this entire function body
2227  * with
2228  * octave_tex_pop_buffer_state();
2229  * octave_tex_push_buffer_state(new_buffer);
2230  */
2231  octave_tex_ensure_buffer_stack (yyscanner);
2232  if ( YY_CURRENT_BUFFER == new_buffer )
2233  return;
2234 
2235  if ( YY_CURRENT_BUFFER )
2236  {
2237  /* Flush out information for old buffer. */
2238  *yyg->yy_c_buf_p = yyg->yy_hold_char;
2239  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2240  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2241  }
2242 
2243  YY_CURRENT_BUFFER_LVALUE = new_buffer;
2244  octave_tex__load_buffer_state(yyscanner );
2245 
2246  /* We don't actually know whether we did this switch during
2247  * EOF (octave_tex_wrap()) processing, but the only time this flag
2248  * is looked at is after octave_tex_wrap() is called, so it's safe
2249  * to go ahead and always set it.
2250  */
2251  yyg->yy_did_buffer_switch_on_eof = 1;
2252 }
2253 
2255 {
2256  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2257  yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2258  yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2259  yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2260  yyg->yy_hold_char = *yyg->yy_c_buf_p;
2261 }
2262 
2263 /** Allocate and initialize an input buffer state.
2264  * @param file A readable stream.
2265  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2266  * @param yyscanner The scanner object.
2267  * @return the allocated buffer state.
2268  */
2269  YY_BUFFER_STATE octave_tex__create_buffer (FILE * file, int size , yyscan_t yyscanner)
2270 {
2271  YY_BUFFER_STATE b;
2272 
2273  b = (YY_BUFFER_STATE) octave_tex_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
2274  if ( ! b )
2275  YY_FATAL_ERROR( "out of dynamic memory in octave_tex__create_buffer()" );
2276 
2277  b->yy_buf_size = size;
2278 
2279  /* yy_ch_buf has to be 2 characters longer than the size given because
2280  * we need to put in 2 end-of-buffer characters.
2281  */
2282  b->yy_ch_buf = (char *) octave_tex_alloc(b->yy_buf_size + 2 ,yyscanner );
2283  if ( ! b->yy_ch_buf )
2284  YY_FATAL_ERROR( "out of dynamic memory in octave_tex__create_buffer()" );
2285 
2286  b->yy_is_our_buffer = 1;
2287 
2288  octave_tex__init_buffer(b,file ,yyscanner);
2289 
2290  return b;
2291 }
2292 
2293 /** Destroy the buffer.
2294  * @param b a buffer created with octave_tex__create_buffer()
2295  * @param yyscanner The scanner object.
2296  */
2297  void octave_tex__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2298 {
2299  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2300 
2301  if ( ! b )
2302  return;
2303 
2304  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2306 
2307  if ( b->yy_is_our_buffer )
2308  octave_tex_free((void *) b->yy_ch_buf ,yyscanner );
2309 
2310  octave_tex_free((void *) b ,yyscanner );
2311 }
2312 
2313 #ifndef __cplusplus
2314 extern int isatty (int );
2315 #endif /* __cplusplus */
2316 
2317 /* Initializes or reinitializes a buffer.
2318  * This function is sometimes called more than once on the same buffer,
2319  * such as during a octave_tex_restart() or at EOF.
2320  */
2321  static void octave_tex__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
2322 
2323 {
2324  int oerrno = errno;
2325  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2326 
2327  octave_tex__flush_buffer(b ,yyscanner);
2328 
2329  b->yy_input_file = file;
2330  b->yy_fill_buffer = 1;
2331 
2332  /* If b is the current buffer, then octave_tex__init_buffer was _probably_
2333  * called from octave_tex_restart() or through yy_get_next_buffer.
2334  * In that case, we don't want to reset the lineno or column.
2335  */
2336  if (b != YY_CURRENT_BUFFER){
2337  b->yy_bs_lineno = 1;
2338  b->yy_bs_column = 0;
2339  }
2340 
2341  b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2342 
2343  errno = oerrno;
2344 }
2345 
2346 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2347  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2348  * @param yyscanner The scanner object.
2349  */
2350  void octave_tex__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2351 {
2352  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2353  if ( ! b )
2354  return;
2355 
2356  b->yy_n_chars = 0;
2357 
2358  /* We always need two end-of-buffer characters. The first causes
2359  * a transition to the end-of-buffer state. The second causes
2360  * a jam in that state.
2361  */
2364 
2365  b->yy_buf_pos = &b->yy_ch_buf[0];
2366 
2367  b->yy_at_bol = 1;
2369 
2370  if ( b == YY_CURRENT_BUFFER )
2371  octave_tex__load_buffer_state(yyscanner );
2372 }
2373 
2374 /** Pushes the new state onto the stack. The new state becomes
2375  * the current state. This function will allocate the stack
2376  * if necessary.
2377  * @param new_buffer The new state.
2378  * @param yyscanner The scanner object.
2379  */
2380 void octave_tex_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2381 {
2382  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2383  if (new_buffer == NULL)
2384  return;
2385 
2386  octave_tex_ensure_buffer_stack(yyscanner);
2387 
2388  /* This block is copied from octave_tex__switch_to_buffer. */
2389  if ( YY_CURRENT_BUFFER )
2390  {
2391  /* Flush out information for old buffer. */
2392  *yyg->yy_c_buf_p = yyg->yy_hold_char;
2393  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2394  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2395  }
2396 
2397  /* Only push if top exists. Otherwise, replace top. */
2398  if (YY_CURRENT_BUFFER)
2399  yyg->yy_buffer_stack_top++;
2400  YY_CURRENT_BUFFER_LVALUE = new_buffer;
2401 
2402  /* copied from octave_tex__switch_to_buffer. */
2403  octave_tex__load_buffer_state(yyscanner );
2404  yyg->yy_did_buffer_switch_on_eof = 1;
2405 }
2406 
2407 /** Removes and deletes the top of the stack, if present.
2408  * The next element becomes the new top.
2409  * @param yyscanner The scanner object.
2410  */
2412 {
2413  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2414  if (!YY_CURRENT_BUFFER)
2415  return;
2416 
2418  YY_CURRENT_BUFFER_LVALUE = NULL;
2419  if (yyg->yy_buffer_stack_top > 0)
2420  --yyg->yy_buffer_stack_top;
2421 
2422  if (YY_CURRENT_BUFFER) {
2423  octave_tex__load_buffer_state(yyscanner );
2424  yyg->yy_did_buffer_switch_on_eof = 1;
2425  }
2426 }
2427 
2428 /* Allocates the stack if it does not exist.
2429  * Guarantees space for at least one push.
2430  */
2432 {
2433  int num_to_alloc;
2434  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2435 
2436  if (!yyg->yy_buffer_stack) {
2437 
2438  /* First allocation is just for 2 elements, since we don't know if this
2439  * scanner will even need a stack. We use 2 instead of 1 to avoid an
2440  * immediate realloc on the next call.
2441  */
2442  num_to_alloc = 1;
2444  (num_to_alloc * sizeof(struct yy_buffer_state*)
2445  , yyscanner);
2446  if ( ! yyg->yy_buffer_stack )
2447  YY_FATAL_ERROR( "out of dynamic memory in octave_tex_ensure_buffer_stack()" );
2448 
2449  memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2450 
2451  yyg->yy_buffer_stack_max = num_to_alloc;
2452  yyg->yy_buffer_stack_top = 0;
2453  return;
2454  }
2455 
2456  if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
2457 
2458  /* Increase the buffer to prepare for a possible push. */
2459  int grow_size = 8 /* arbitrary grow size */;
2460 
2461  num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
2463  (yyg->yy_buffer_stack,
2464  num_to_alloc * sizeof(struct yy_buffer_state*)
2465  , yyscanner);
2466  if ( ! yyg->yy_buffer_stack )
2467  YY_FATAL_ERROR( "out of dynamic memory in octave_tex_ensure_buffer_stack()" );
2468 
2469  /* zero only the new slots.*/
2470  memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
2471  yyg->yy_buffer_stack_max = num_to_alloc;
2472  }
2473 }
2474 
2475 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2476  * @param base the character buffer
2477  * @param size the size in bytes of the character buffer
2478  * @param yyscanner The scanner object.
2479  * @return the newly allocated buffer state object.
2480  */
2481 YY_BUFFER_STATE octave_tex__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
2482 {
2483  YY_BUFFER_STATE b;
2484 
2485  if ( size < 2 ||
2486  base[size-2] != YY_END_OF_BUFFER_CHAR ||
2487  base[size-1] != YY_END_OF_BUFFER_CHAR )
2488  /* They forgot to leave room for the EOB's. */
2489  return 0;
2490 
2491  b = (YY_BUFFER_STATE) octave_tex_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
2492  if ( ! b )
2493  YY_FATAL_ERROR( "out of dynamic memory in octave_tex__scan_buffer()" );
2494 
2495  b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2496  b->yy_buf_pos = b->yy_ch_buf = base;
2497  b->yy_is_our_buffer = 0;
2498  b->yy_input_file = 0;
2499  b->yy_n_chars = b->yy_buf_size;
2500  b->yy_is_interactive = 0;
2501  b->yy_at_bol = 1;
2502  b->yy_fill_buffer = 0;
2504 
2505  octave_tex__switch_to_buffer(b ,yyscanner );
2506 
2507  return b;
2508 }
2509 
2510 /** Setup the input buffer state to scan a string. The next call to octave_tex_lex() will
2511  * scan from a @e copy of @a str.
2512  * @param yystr a NUL-terminated string to scan
2513  * @param yyscanner The scanner object.
2514  * @return the newly allocated buffer state object.
2515  * @note If you want to scan bytes that may contain NUL values, then use
2516  * octave_tex__scan_bytes() instead.
2517  */
2518 YY_BUFFER_STATE octave_tex__scan_string (yyconst char * yystr , yyscan_t yyscanner)
2519 {
2520 
2521  return octave_tex__scan_bytes(yystr,strlen(yystr) ,yyscanner);
2522 }
2523 
2524 /** Setup the input buffer state to scan the given bytes. The next call to octave_tex_lex() will
2525  * scan from a @e copy of @a bytes.
2526  * @param yybytes the byte buffer to scan
2527  * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2528  * @param yyscanner The scanner object.
2529  * @return the newly allocated buffer state object.
2530  */
2531 YY_BUFFER_STATE octave_tex__scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
2532 {
2533  YY_BUFFER_STATE b;
2534  char *buf;
2535  yy_size_t n;
2536  int i;
2537 
2538  /* Get memory for full buffer, including space for trailing EOB's. */
2539  n = _yybytes_len + 2;
2540  buf = (char *) octave_tex_alloc(n ,yyscanner );
2541  if ( ! buf )
2542  YY_FATAL_ERROR( "out of dynamic memory in octave_tex__scan_bytes()" );
2543 
2544  for ( i = 0; i < _yybytes_len; ++i )
2545  buf[i] = yybytes[i];
2546 
2547  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2548 
2549  b = octave_tex__scan_buffer(buf,n ,yyscanner);
2550  if ( ! b )
2551  YY_FATAL_ERROR( "bad buffer in octave_tex__scan_bytes()" );
2552 
2553  /* It's okay to grow etc. this buffer, and we should throw it
2554  * away when we're done.
2555  */
2556  b->yy_is_our_buffer = 1;
2557 
2558  return b;
2559 }
2560 
2561 #ifndef YY_EXIT_FAILURE
2562 #define YY_EXIT_FAILURE 2
2563 #endif
2564 
2565 static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
2566 {
2567  (void) fprintf( stderr, "%s\n", msg );
2568  exit( YY_EXIT_FAILURE );
2569 }
2570 
2571 /* Redefine yyless() so it works in section 3 code. */
2572 
2573 #undef yyless
2574 #define yyless(n) \
2575  do \
2576  { \
2577  /* Undo effects of setting up yytext. */ \
2578  int yyless_macro_arg = (n); \
2579  YY_LESS_LINENO(yyless_macro_arg);\
2580  yytext[yyleng] = yyg->yy_hold_char; \
2581  yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2582  yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2583  *yyg->yy_c_buf_p = '\0'; \
2584  yyleng = yyless_macro_arg; \
2585  } \
2586  while ( 0 )
2587 
2588 /* Accessor methods (get/set functions) to struct members. */
2589 
2590 /** Get the user-defined data for this scanner.
2591  * @param yyscanner The scanner object.
2592  */
2594 {
2595  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2596  return yyextra;
2597 }
2598 
2599 /** Get the current line number.
2600  * @param yyscanner The scanner object.
2601  */
2603 {
2604  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2605 
2606  if (! YY_CURRENT_BUFFER)
2607  return 0;
2608 
2609  return yylineno;
2610 }
2611 
2612 /** Get the current column number.
2613  * @param yyscanner The scanner object.
2614  */
2616 {
2617  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2618 
2619  if (! YY_CURRENT_BUFFER)
2620  return 0;
2621 
2622  return yycolumn;
2623 }
2624 
2625 /** Get the input stream.
2626  * @param yyscanner The scanner object.
2627  */
2628 FILE *octave_tex_get_in (yyscan_t yyscanner)
2629 {
2630  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2631  return yyin;
2632 }
2633 
2634 /** Get the output stream.
2635  * @param yyscanner The scanner object.
2636  */
2637 FILE *octave_tex_get_out (yyscan_t yyscanner)
2638 {
2639  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2640  return yyout;
2641 }
2642 
2643 /** Get the length of the current token.
2644  * @param yyscanner The scanner object.
2645  */
2647 {
2648  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2649  return yyleng;
2650 }
2651 
2652 /** Get the current token.
2653  * @param yyscanner The scanner object.
2654  */
2655 
2657 {
2658  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2659  return yytext;
2660 }
2661 
2662 /** Set the user-defined data. This data is never touched by the scanner.
2663  * @param user_defined The data to be associated with this scanner.
2664  * @param yyscanner The scanner object.
2665  */
2666 void octave_tex_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
2667 {
2668  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2669  yyextra = user_defined ;
2670 }
2671 
2672 /** Set the current line number.
2673  * @param line_number
2674  * @param yyscanner The scanner object.
2675  */
2676 void octave_tex_set_lineno (int line_number , yyscan_t yyscanner)
2677 {
2678  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2679 
2680  /* lineno is only valid if an input buffer exists. */
2681  if (! YY_CURRENT_BUFFER )
2682  yy_fatal_error( "octave_tex_set_lineno called with no buffer" , yyscanner);
2683 
2684  yylineno = line_number;
2685 }
2686 
2687 /** Set the current column.
2688  * @param line_number
2689  * @param yyscanner The scanner object.
2690  */
2691 void octave_tex_set_column (int column_no , yyscan_t yyscanner)
2692 {
2693  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2694 
2695  /* column is only valid if an input buffer exists. */
2696  if (! YY_CURRENT_BUFFER )
2697  yy_fatal_error( "octave_tex_set_column called with no buffer" , yyscanner);
2698 
2699  yycolumn = column_no;
2700 }
2701 
2702 /** Set the input stream. This does not discard the current
2703  * input buffer.
2704  * @param in_str A readable stream.
2705  * @param yyscanner The scanner object.
2706  * @see octave_tex__switch_to_buffer
2707  */
2708 void octave_tex_set_in (FILE * in_str , yyscan_t yyscanner)
2709 {
2710  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2711  yyin = in_str ;
2712 }
2713 
2714 void octave_tex_set_out (FILE * out_str , yyscan_t yyscanner)
2715 {
2716  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2717  yyout = out_str ;
2718 }
2719 
2721 {
2722  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2723  return yy_flex_debug;
2724 }
2725 
2726 void octave_tex_set_debug (int bdebug , yyscan_t yyscanner)
2727 {
2728  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2729  yy_flex_debug = bdebug ;
2730 }
2731 
2732 /* Accessor methods for yylval and yylloc */
2733 
2735 {
2736  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2737  return yylval;
2738 }
2739 
2740 void octave_tex_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
2741 {
2742  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2743  yylval = yylval_param;
2744 }
2745 
2746 /* User-visible API */
2747 
2748 /* octave_tex_lex_init is special because it creates the scanner itself, so it is
2749  * the ONLY reentrant function that doesn't take the scanner as the last argument.
2750  * That's why we explicitly handle the declaration, instead of using our macros.
2751  */
2752 
2753 int octave_tex_lex_init(yyscan_t* ptr_yy_globals)
2754 
2755 {
2756  if (ptr_yy_globals == NULL){
2757  errno = EINVAL;
2758  return 1;
2759  }
2760 
2761  *ptr_yy_globals = (yyscan_t) octave_tex_alloc ( sizeof( struct yyguts_t ), NULL );
2762 
2763  if (*ptr_yy_globals == NULL){
2764  errno = ENOMEM;
2765  return 1;
2766  }
2767 
2768  /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2769  memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2770 
2771  return yy_init_globals ( *ptr_yy_globals );
2772 }
2773 
2774 /* octave_tex_lex_init_extra has the same functionality as octave_tex_lex_init, but follows the
2775  * convention of taking the scanner as the last argument. Note however, that
2776  * this is a *pointer* to a scanner, as it will be allocated by this call (and
2777  * is the reason, too, why this function also must handle its own declaration).
2778  * The user defined value in the first argument will be available to octave_tex_alloc in
2779  * the yyextra field.
2780  */
2781 
2782 int octave_tex_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
2783 
2784 {
2785  struct yyguts_t dummy_yyguts;
2786 
2787  octave_tex_set_extra (yy_user_defined, &dummy_yyguts);
2788 
2789  if (ptr_yy_globals == NULL){
2790  errno = EINVAL;
2791  return 1;
2792  }
2793 
2794  *ptr_yy_globals = (yyscan_t) octave_tex_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2795 
2796  if (*ptr_yy_globals == NULL){
2797  errno = ENOMEM;
2798  return 1;
2799  }
2800 
2801  /* By setting to 0xAA, we expose bugs in
2802  yy_init_globals. Leave at 0x00 for releases. */
2803  memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2804 
2805  octave_tex_set_extra (yy_user_defined, *ptr_yy_globals);
2806 
2807  return yy_init_globals ( *ptr_yy_globals );
2808 }
2809 
2810 static int yy_init_globals (yyscan_t yyscanner)
2811 {
2812  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2813  /* Initialization is the same as for the non-reentrant scanner.
2814  * This function is called from octave_tex_lex_destroy(), so don't allocate here.
2815  */
2816 
2817  yyg->yy_buffer_stack = 0;
2818  yyg->yy_buffer_stack_top = 0;
2819  yyg->yy_buffer_stack_max = 0;
2820  yyg->yy_c_buf_p = (char *) 0;
2821  yyg->yy_init = 0;
2822  yyg->yy_start = 0;
2823 
2824  yyg->yy_start_stack_ptr = 0;
2825  yyg->yy_start_stack_depth = 0;
2826  yyg->yy_start_stack = NULL;
2827 
2828 /* Defined in main.c */
2829 #ifdef YY_STDINIT
2830  yyin = stdin;
2831  yyout = stdout;
2832 #else
2833  yyin = (FILE *) 0;
2834  yyout = (FILE *) 0;
2835 #endif
2836 
2837  /* For future reference: Set errno on error, since we are called by
2838  * octave_tex_lex_init()
2839  */
2840  return 0;
2841 }
2842 
2843 /* octave_tex_lex_destroy is for both reentrant and non-reentrant scanners. */
2845 {
2846  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2847 
2848  /* Pop the buffer stack, destroying each element. */
2849  while(YY_CURRENT_BUFFER){
2851  YY_CURRENT_BUFFER_LVALUE = NULL;
2852  octave_tex_pop_buffer_state(yyscanner);
2853  }
2854 
2855  /* Destroy the stack itself. */
2856  octave_tex_free(yyg->yy_buffer_stack ,yyscanner);
2857  yyg->yy_buffer_stack = NULL;
2858 
2859  /* Destroy the start condition stack. */
2860  octave_tex_free(yyg->yy_start_stack ,yyscanner );
2861  yyg->yy_start_stack = NULL;
2862 
2863  /* Reset the globals. This is important in a non-reentrant scanner so the next time
2864  * octave_tex_lex() is called, initialization will occur. */
2865  yy_init_globals( yyscanner);
2866 
2867  /* Destroy the main struct (reentrant only). */
2868  octave_tex_free ( yyscanner , yyscanner );
2869  yyscanner = NULL;
2870  return 0;
2871 }
2872 
2873 /*
2874  * Internal utility routines.
2875  */
2876 
2877 #ifndef yytext_ptr
2878 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
2879 {
2880  register int i;
2881  for ( i = 0; i < n; ++i )
2882  s1[i] = s2[i];
2883 }
2884 #endif
2885 
2886 #ifdef YY_NEED_STRLEN
2887 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
2888 {
2889  register int n;
2890  for ( n = 0; s[n]; ++n )
2891  ;
2892 
2893  return n;
2894 }
2895 #endif
2896 
2898 {
2899  return (void *) malloc( size );
2900 }
2901 
2902 void *octave_tex_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
2903 {
2904  /* The cast to (char *) in the following accommodates both
2905  * implementations that use char* generic pointers, and those
2906  * that use void* generic pointers. It works with the latter
2907  * because both ANSI C and C++ allow castless assignment from
2908  * any pointer type to void*, and deal with argument conversions
2909  * as though doing an assignment.
2910  */
2911  return (void *) realloc( (char *) ptr, size );
2912 }
2913 
2914 void octave_tex_free (void * ptr , yyscan_t yyscanner)
2915 {
2916  free( (char *) ptr ); /* see octave_tex_realloc() for (char *) cast */
2917 }
2918 
2919 #define YYTABLES_NAME "yytables"
2920 
2921 #line 236 "corefcn/oct-tex-lexer.ll"
2922 
2923 
2924 
2925 bool
2926 text_parser_tex::init_lexer (const std::string& s)
2927 {
2928  if (! scanner)
2930 
2931  if (scanner)
2932  {
2933  if (buffer_state)
2934  {
2935  octave_tex__delete_buffer (reinterpret_cast<YY_BUFFER_STATE> (buffer_state),
2936  scanner);
2937  buffer_state = 0;
2938  }
2939 
2940  buffer_state = octave_tex__scan_bytes (s.data (), s.length (), scanner);
2941  }
2942 
2943  return (scanner && buffer_state);
2944 }
2945 
2946 void
2948 {
2949  if (buffer_state)
2950  {
2951  octave_tex__delete_buffer (reinterpret_cast<YY_BUFFER_STATE> (buffer_state),
2952  scanner);
2953  buffer_state = 0;
2954  }
2955 
2956  if (scanner)
2957  {
2959  scanner = 0;
2960  }
2961 }
2962