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-parser.cc
Go to the documentation of this file.
1 /* A Bison parser, made by GNU Bison 2.7.12-4996. */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5  Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
6 
7  This program is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 
20 /* As a special exception, you may create a larger work that contains
21  part or all of the Bison parser skeleton and distribute that work
22  under terms of your choice, so long as that work isn't itself a
23  parser generator using the skeleton or a modified version thereof
24  as a parser skeleton. Alternatively, if you modify or redistribute
25  the parser skeleton itself, you may (at your option) remove this
26  special exception, which will cause the skeleton and the resulting
27  Bison output files to be licensed under the GNU General Public
28  License without this special exception.
29 
30  This special exception was added by the Free Software Foundation in
31  version 2.2 of Bison. */
32 
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34  simplifying the original so-called "semantic" parser. */
35 
36 /* All symbols defined below should begin with yy or YY, to avoid
37  infringing on user name space. This should be done even for local
38  variables, as they might otherwise be expanded by user macros.
39  There are some unavoidable exceptions within include files to
40  define necessary library symbols; they are noted "INFRINGES ON
41  USER NAME SPACE" below. */
42 
43 /* Identify Bison output. */
44 #define YYBISON 1
45 
46 /* Bison version. */
47 #define YYBISON_VERSION "2.7.12-4996"
48 
49 /* Skeleton name. */
50 #define YYSKELETON_NAME "yacc.c"
51 
52 /* Pure parsers. */
53 #define YYPURE 1
54 
55 /* Push parsers. */
56 #define YYPUSH 0
57 
58 /* Pull parsers. */
59 #define YYPULL 1
60 
61 
62 /* Substitute the variable and function names. */
63 #define yyparse octave_tex_parse
64 #define yylex octave_tex_lex
65 #define yyerror octave_tex_error
66 #define yylval octave_tex_lval
67 #define yychar octave_tex_char
68 #define yydebug octave_tex_debug
69 #define yynerrs octave_tex_nerrs
70 
71 /* Copy the first part of user declarations. */
72 /* Line 371 of yacc.c */
73 #line 23 "../../libinterp/corefcn/oct-tex-parser.yy"
74 
75 #define YYDEBUG 1
76 
77 #ifdef HAVE_CONFIG_H
78 #include <config.h>
79 #endif
80 
81 #include "txt-eng.h"
82 #include "oct-tex-parser.h"
83 
84 extern int octave_tex_lex (YYSTYPE *, void *);
85 static void yyerror (text_parser_tex& parser, const char *s);
86 
87 #if defined (GNULIB_NAMESPACE)
88 // Calls to the following functions appear in the generated output from
89 // Bison without the namespace tag. Redefine them so we will use them
90 // via the gnulib namespace.
91 #define fclose GNULIB_NAMESPACE::fclose
92 #define fprintf GNULIB_NAMESPACE::fprintf
93 #define malloc GNULIB_NAMESPACE::malloc
94 #endif
95 
96 #define scanner parser.get_scanner ()
97 
98 /* Line 371 of yacc.c */
99 #line 100 "corefcn/oct-tex-parser.cc"
100 
101 # ifndef YY_NULL
102 # if defined __cplusplus && 201103L <= __cplusplus
103 # define YY_NULL nullptr
104 # else
105 # define YY_NULL 0
106 # endif
107 # endif
108 
109 /* Enabling verbose error messages. */
110 #ifdef YYERROR_VERBOSE
111 # undef YYERROR_VERBOSE
112 # define YYERROR_VERBOSE 1
113 #else
114 # define YYERROR_VERBOSE 0
115 #endif
116 
117 /* In a future release of Bison, this section will be replaced
118  by #include "y.tab.h". */
119 #ifndef YY_OCTAVE_TEX_COREFCN_OCT_TEX_PARSER_H_INCLUDED
120 # define YY_OCTAVE_TEX_COREFCN_OCT_TEX_PARSER_H_INCLUDED
121 /* Enabling traces. */
122 #ifndef YYDEBUG
123 # define YYDEBUG 0
124 #endif
125 #if YYDEBUG
126 extern int octave_tex_debug;
127 #endif
128 /* "%code requires" blocks. */
129 /* Line 387 of yacc.c */
130 #line 53 "../../libinterp/corefcn/oct-tex-parser.yy"
131 #include <string>
132 
133 /* Line 387 of yacc.c */
134 #line 135 "corefcn/oct-tex-parser.cc"
135 
136 /* Tokens. */
137 #ifndef YYTOKENTYPE
138 # define YYTOKENTYPE
139  /* Put the tokens into the symbol table, so that GDB and other debuggers
140  know about them. */
141  enum yytokentype {
142  BF = 258,
143  IT = 259,
144  SL = 260,
145  RM = 261,
146  FONTNAME = 262,
147  FONTSIZE = 263,
148  COLOR = 264,
149  COLOR_RGB = 265,
150  START = 266,
151  END = 267,
152  SUPER = 268,
153  SUB = 269,
154  CH = 270,
155  NUM = 271,
156  SYM = 272,
157  SCRIPT = 273,
158  STR = 274
159  };
160 #endif
161 /* Tokens. */
162 #define BF 258
163 #define IT 259
164 #define SL 260
165 #define RM 261
166 #define FONTNAME 262
167 #define FONTSIZE 263
168 #define COLOR 264
169 #define COLOR_RGB 265
170 #define START 266
171 #define END 267
172 #define SUPER 268
173 #define SUB 269
174 #define CH 270
175 #define NUM 271
176 #define SYM 272
177 #define SCRIPT 273
178 #define STR 274
179 
180 
181 
182 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
183 typedef union YYSTYPE
184 {
185 /* Line 387 of yacc.c */
186 #line 55 "../../libinterp/corefcn/oct-tex-parser.yy"
187 
188  /* Leaf symbols produced by the scanner */
189  char ch;
190  double num;
191  int sym;
192 
193  /* Used for string buffering */
194  std::string* str;
195 
196  /* Objects produced by the parser */
199 
200 
201 /* Line 387 of yacc.c */
202 #line 203 "corefcn/oct-tex-parser.cc"
203 } YYSTYPE;
204 # define YYSTYPE_IS_TRIVIAL 1
205 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
206 # define YYSTYPE_IS_DECLARED 1
207 #endif
208 
209 
210 #ifdef YYPARSE_PARAM
211 #if defined __STDC__ || defined __cplusplus
212 int octave_tex_parse (void *YYPARSE_PARAM);
213 #else
214 int octave_tex_parse ();
215 #endif
216 #else /* ! YYPARSE_PARAM */
217 #if defined __STDC__ || defined __cplusplus
219 #else
220 int octave_tex_parse ();
221 #endif
222 #endif /* ! YYPARSE_PARAM */
223 
224 #endif /* !YY_OCTAVE_TEX_COREFCN_OCT_TEX_PARSER_H_INCLUDED */
225 
226 /* Copy the second part of user declarations. */
227 
228 /* Line 390 of yacc.c */
229 #line 230 "corefcn/oct-tex-parser.cc"
230 
231 #ifdef short
232 # undef short
233 #endif
234 
235 #ifdef YYTYPE_UINT8
236 typedef YYTYPE_UINT8 yytype_uint8;
237 #else
238 typedef unsigned char yytype_uint8;
239 #endif
240 
241 #ifdef YYTYPE_INT8
242 typedef YYTYPE_INT8 yytype_int8;
243 #elif (defined __STDC__ || defined __C99__FUNC__ \
244  || defined __cplusplus || defined _MSC_VER)
245 typedef signed char yytype_int8;
246 #else
247 typedef short int yytype_int8;
248 #endif
249 
250 #ifdef YYTYPE_UINT16
251 typedef YYTYPE_UINT16 yytype_uint16;
252 #else
253 typedef unsigned short int yytype_uint16;
254 #endif
255 
256 #ifdef YYTYPE_INT16
257 typedef YYTYPE_INT16 yytype_int16;
258 #else
259 typedef short int yytype_int16;
260 #endif
261 
262 #ifndef YYSIZE_T
263 # ifdef __SIZE_TYPE__
264 # define YYSIZE_T __SIZE_TYPE__
265 # elif defined size_t
266 # define YYSIZE_T size_t
267 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
268  || defined __cplusplus || defined _MSC_VER)
269 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
270 # define YYSIZE_T size_t
271 # else
272 # define YYSIZE_T unsigned int
273 # endif
274 #endif
275 
276 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
277 
278 #ifndef YY_
279 # if defined YYENABLE_NLS && YYENABLE_NLS
280 # if ENABLE_NLS
281 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
282 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
283 # endif
284 # endif
285 # ifndef YY_
286 # define YY_(Msgid) Msgid
287 # endif
288 #endif
289 
290 #ifndef __attribute__
291 /* This feature is available in gcc versions 2.5 and later. */
292 # if (! defined __GNUC__ || __GNUC__ < 2 \
293  || (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
294 # define __attribute__(Spec) /* empty */
295 # endif
296 #endif
297 
298 /* Suppress unused-variable warnings by "using" E. */
299 #if ! defined lint || defined __GNUC__
300 # define YYUSE(E) ((void) (E))
301 #else
302 # define YYUSE(E) /* empty */
303 #endif
304 
305 
306 /* Identity function, used to suppress warnings about constant conditions. */
307 #ifndef lint
308 # define YYID(N) (N)
309 #else
310 #if (defined __STDC__ || defined __C99__FUNC__ \
311  || defined __cplusplus || defined _MSC_VER)
312 static int
313 YYID (int yyi)
314 #else
315 static int
316 YYID (yyi)
317  int yyi;
318 #endif
319 {
320  return yyi;
321 }
322 #endif
323 
324 #if ! defined yyoverflow || YYERROR_VERBOSE
325 
326 /* The parser invokes alloca or malloc; define the necessary symbols. */
327 
328 # ifdef YYSTACK_USE_ALLOCA
329 # if YYSTACK_USE_ALLOCA
330 # ifdef __GNUC__
331 # define YYSTACK_ALLOC __builtin_alloca
332 # elif defined __BUILTIN_VA_ARG_INCR
333 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
334 # elif defined _AIX
335 # define YYSTACK_ALLOC __alloca
336 # elif defined _MSC_VER
337 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
338 # define alloca _alloca
339 # else
340 # define YYSTACK_ALLOC alloca
341 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
342  || defined __cplusplus || defined _MSC_VER)
343 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
344  /* Use EXIT_SUCCESS as a witness for stdlib.h. */
345 # ifndef EXIT_SUCCESS
346 # define EXIT_SUCCESS 0
347 # endif
348 # endif
349 # endif
350 # endif
351 # endif
352 
353 # ifdef YYSTACK_ALLOC
354  /* Pacify GCC's `empty if-body' warning. */
355 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
356 # ifndef YYSTACK_ALLOC_MAXIMUM
357  /* The OS might guarantee only one guard page at the bottom of the stack,
358  and a page size can be as small as 4096 bytes. So we cannot safely
359  invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
360  to allow for a few compiler-allocated temporary stack slots. */
361 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
362 # endif
363 # else
364 # define YYSTACK_ALLOC YYMALLOC
365 # define YYSTACK_FREE YYFREE
366 # ifndef YYSTACK_ALLOC_MAXIMUM
367 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
368 # endif
369 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
370  && ! ((defined YYMALLOC || defined malloc) \
371  && (defined YYFREE || defined free)))
372 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
373 # ifndef EXIT_SUCCESS
374 # define EXIT_SUCCESS 0
375 # endif
376 # endif
377 # ifndef YYMALLOC
378 # define YYMALLOC malloc
379 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
380  || defined __cplusplus || defined _MSC_VER)
381 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
382 # endif
383 # endif
384 # ifndef YYFREE
385 # define YYFREE free
386 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
387  || defined __cplusplus || defined _MSC_VER)
388 void free (void *); /* INFRINGES ON USER NAME SPACE */
389 # endif
390 # endif
391 # endif
392 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
393 
394 
395 #if (! defined yyoverflow \
396  && (! defined __cplusplus \
397  || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
398 
399 /* A type that is properly aligned for any stack member. */
400 union yyalloc
401 {
404 };
405 
406 /* The size of the maximum gap between one aligned stack and the next. */
407 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
408 
409 /* The size of an array large to enough to hold all stacks, each with
410  N elements. */
411 # define YYSTACK_BYTES(N) \
412  ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
413  + YYSTACK_GAP_MAXIMUM)
414 
415 # define YYCOPY_NEEDED 1
416 
417 /* Relocate STACK from its old location to the new one. The
418  local variables YYSIZE and YYSTACKSIZE give the old and new number of
419  elements in the stack, and YYPTR gives the new location of the
420  stack. Advance YYPTR to a properly aligned location for the next
421  stack. */
422 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
423  do \
424  { \
425  YYSIZE_T yynewbytes; \
426  YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
427  Stack = &yyptr->Stack_alloc; \
428  yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
429  yyptr += yynewbytes / sizeof (*yyptr); \
430  } \
431  while (YYID (0))
432 
433 #endif
434 
435 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
436 /* Copy COUNT objects from SRC to DST. The source and destination do
437  not overlap. */
438 # ifndef YYCOPY
439 # if defined __GNUC__ && 1 < __GNUC__
440 # define YYCOPY(Dst, Src, Count) \
441  __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
442 # else
443 # define YYCOPY(Dst, Src, Count) \
444  do \
445  { \
446  YYSIZE_T yyi; \
447  for (yyi = 0; yyi < (Count); yyi++) \
448  (Dst)[yyi] = (Src)[yyi]; \
449  } \
450  while (YYID (0))
451 # endif
452 # endif
453 #endif /* !YYCOPY_NEEDED */
454 
455 /* YYFINAL -- State number of the termination state. */
456 #define YYFINAL 43
457 /* YYLAST -- Last index in YYTABLE. */
458 #define YYLAST 81
459 
460 /* YYNTOKENS -- Number of terminals. */
461 #define YYNTOKENS 20
462 /* YYNNTS -- Number of nonterminals. */
463 #define YYNNTS 14
464 /* YYNRULES -- Number of rules. */
465 #define YYNRULES 36
466 /* YYNRULES -- Number of states. */
467 #define YYNSTATES 55
468 
469 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
470 #define YYUNDEFTOK 2
471 #define YYMAXUTOK 274
472 
473 #define YYTRANSLATE(YYX) \
474  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
475 
476 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
477 static const yytype_uint8 yytranslate[] =
478 {
479  0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
480  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
481  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
482  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
483  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
484  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
485  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
486  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
487  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
488  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
489  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
490  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
491  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
492  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
493  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
494  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
495  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
496  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
497  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
498  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
499  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
500  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
501  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
502  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
503  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
504  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
505  5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
506  15, 16, 17, 18, 19
507 };
508 
509 #if YYDEBUG
510 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
511  YYRHS. */
512 static const yytype_uint8 yyprhs[] =
513 {
514  0, 0, 3, 5, 8, 10, 12, 14, 16, 18,
515  23, 28, 33, 40, 42, 44, 46, 48, 50, 52,
516  54, 56, 58, 60, 63, 66, 69, 72, 75, 78,
517  81, 84, 86, 89, 93, 96, 97
518 };
519 
520 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
521 static const yytype_int8 yyrhs[] =
522 {
523  33, 0, -1, 15, -1, 21, 15, -1, 17, -1,
524  3, -1, 4, -1, 5, -1, 6, -1, 8, 11,
525  16, 12, -1, 7, 11, 21, 12, -1, 9, 11,
526  21, 12, -1, 10, 11, 16, 16, 16, 12, -1,
527  21, -1, 32, -1, 22, -1, 23, -1, 24, -1,
528  25, -1, 26, -1, 28, -1, 29, -1, 30, -1,
529  13, 15, -1, 13, 32, -1, 13, 22, -1, 14,
530  15, -1, 14, 32, -1, 14, 22, -1, 29, 28,
531  -1, 28, 29, -1, 27, -1, 31, 27, -1, 11,
532  31, 12, -1, 11, 12, -1, -1, 31, -1
533 };
534 
535 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
536 static const yytype_uint8 yyrline[] =
537 {
538  0, 97, 97, 99, 103, 107, 109, 111, 113, 117,
539  121, 128, 133, 139, 144, 147, 148, 149, 150, 151,
540  152, 153, 154, 157, 159, 161, 165, 167, 169, 173,
541  175, 179, 181, 185, 187, 192, 193
542 };
543 #endif
544 
545 #if YYDEBUG || YYERROR_VERBOSE || 0
546 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
547  First, the terminals, then, starting at YYNTOKENS, nonterminals. */
548 static const char *const yytname[] =
549 {
550  "$end", "error", "$undefined", "BF", "IT", "SL", "RM", "FONTNAME",
551  "FONTSIZE", "COLOR", "COLOR_RGB", "START", "END", "SUPER", "SUB", "CH",
552  "NUM", "SYM", "SCRIPT", "STR", "$accept", "simple_string",
553  "symbol_element", "font_modifier_element", "fontsize_element",
554  "fontname_element", "color_element", "string_element",
555  "superscript_element", "subscript_element", "combined_script_element",
556  "string_element_list", "scoped_string_element_list", "string", YY_NULL
557 };
558 #endif
559 
560 # ifdef YYPRINT
561 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
562  token YYLEX-NUM. */
563 static const yytype_uint16 yytoknum[] =
564 {
565  0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
566  265, 266, 267, 268, 269, 270, 271, 272, 273, 274
567 };
568 # endif
569 
570 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
571 static const yytype_uint8 yyr1[] =
572 {
573  0, 20, 21, 21, 22, 23, 23, 23, 23, 24,
574  25, 26, 26, 27, 27, 27, 27, 27, 27, 27,
575  27, 27, 27, 28, 28, 28, 29, 29, 29, 30,
576  30, 31, 31, 32, 32, 33, 33
577 };
578 
579 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
580 static const yytype_uint8 yyr2[] =
581 {
582  0, 2, 1, 2, 1, 1, 1, 1, 1, 4,
583  4, 4, 6, 1, 1, 1, 1, 1, 1, 1,
584  1, 1, 1, 2, 2, 2, 2, 2, 2, 2,
585  2, 1, 2, 3, 2, 0, 1
586 };
587 
588 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
589  Performed when YYTABLE doesn't specify something else to do. Zero
590  means the default is an error. */
591 static const yytype_uint8 yydefact[] =
592 {
593  35, 5, 6, 7, 8, 0, 0, 0, 0, 0,
594  0, 0, 2, 4, 13, 15, 16, 17, 18, 19,
595  31, 20, 21, 22, 36, 14, 0, 0, 0, 0,
596  0, 34, 0, 23, 25, 24, 26, 28, 27, 3,
597  30, 29, 32, 1, 0, 0, 0, 0, 33, 10,
598  9, 11, 0, 0, 12
599 };
600 
601 /* YYDEFGOTO[NTERM-NUM]. */
602 static const yytype_int8 yydefgoto[] =
603 {
604  -1, 14, 15, 16, 17, 18, 19, 20, 21, 22,
605  23, 24, 25, 26
606 };
607 
608 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
609  STATE-NUM. */
610 #define YYPACT_NINF -4
611 static const yytype_int8 yypact[] =
612 {
613  27, -4, -4, -4, -4, 2, 17, 32, 37, -3,
614  34, 35, -4, -4, 40, -4, -4, -4, -4, -4,
615  -4, 45, 52, -4, 27, -4, 66, 54, 55, 54,
616  56, -4, 12, -4, -4, -4, -4, -4, -4, -4,
617  -4, -4, -4, -4, 41, 58, 42, 57, -4, -4,
618  -4, -4, 59, 62, -4
619 };
620 
621 /* YYPGOTO[NTERM-NUM]. */
622 static const yytype_int8 yypgoto[] =
623 {
624  -4, 31, 51, -4, -4, -4, -4, 15, 46, 60,
625  -4, 67, 53, -4
626 };
627 
628 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
629  positive, shift that token. If negative, reduce the rule which
630  number is the opposite. If YYTABLE_NINF, syntax error. */
631 #define YYTABLE_NINF -1
632 static const yytype_uint8 yytable[] =
633 {
634  1, 2, 3, 4, 5, 6, 7, 8, 9, 31,
635  10, 11, 12, 27, 13, 1, 2, 3, 4, 5,
636  6, 7, 8, 9, 48, 10, 11, 12, 28, 13,
637  1, 2, 3, 4, 5, 6, 7, 8, 9, 42,
638  10, 11, 12, 29, 13, 9, 9, 42, 30, 33,
639  36, 13, 13, 49, 51, 39, 39, 39, 44, 11,
640  46, 34, 37, 35, 38, 10, 43, 0, 41, 12,
641  50, 45, 47, 52, 54, 53, 32, 0, 0, 0,
642  0, 40
643 };
644 
645 #define yypact_value_is_default(Yystate) \
646  (!!((Yystate) == (-4)))
647 
648 #define yytable_value_is_error(Yytable_value) \
649  YYID (0)
650 
651 static const yytype_int8 yycheck[] =
652 {
653  3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
654  13, 14, 15, 11, 17, 3, 4, 5, 6, 7,
655  8, 9, 10, 11, 12, 13, 14, 15, 11, 17,
656  3, 4, 5, 6, 7, 8, 9, 10, 11, 24,
657  13, 14, 15, 11, 17, 11, 11, 32, 11, 15,
658  15, 17, 17, 12, 12, 15, 15, 15, 27, 14,
659  29, 10, 11, 10, 11, 13, 0, -1, 22, 15,
660  12, 16, 16, 16, 12, 16, 9, -1, -1, -1,
661  -1, 21
662 };
663 
664 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
665  symbol of state STATE-NUM. */
666 static const yytype_uint8 yystos[] =
667 {
668  0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
669  13, 14, 15, 17, 21, 22, 23, 24, 25, 26,
670  27, 28, 29, 30, 31, 32, 33, 11, 11, 11,
671  11, 12, 31, 15, 22, 32, 15, 22, 32, 15,
672  29, 28, 27, 0, 21, 16, 21, 16, 12, 12,
673  12, 12, 16, 16, 12
674 };
675 
676 #define yyerrok (yyerrstatus = 0)
677 #define yyclearin (yychar = YYEMPTY)
678 #define YYEMPTY (-2)
679 #define YYEOF 0
680 
681 #define YYACCEPT goto yyacceptlab
682 #define YYABORT goto yyabortlab
683 #define YYERROR goto yyerrorlab
684 
685 
686 /* Like YYERROR except do call yyerror. This remains here temporarily
687  to ease the transition to the new meaning of YYERROR, for GCC.
688  Once GCC version 2 has supplanted version 1, this can go. However,
689  YYFAIL appears to be in use. Nevertheless, it is formally deprecated
690  in Bison 2.4.2's NEWS entry, where a plan to phase it out is
691  discussed. */
692 
693 #define YYFAIL goto yyerrlab
694 #if defined YYFAIL
695  /* This is here to suppress warnings from the GCC cpp's
696  -Wunused-macros. Normally we don't worry about that warning, but
697  some users do, and we want to make it easy for users to remove
698  YYFAIL uses, which will produce warnings from Bison 2.5. */
699 #endif
700 
701 #define YYRECOVERING() (!!yyerrstatus)
702 
703 #define YYBACKUP(Token, Value) \
704 do \
705  if (yychar == YYEMPTY) \
706  { \
707  yychar = (Token); \
708  yylval = (Value); \
709  YYPOPSTACK (yylen); \
710  yystate = *yyssp; \
711  goto yybackup; \
712  } \
713  else \
714  { \
715  yyerror (parser, YY_("syntax error: cannot back up")); \
716  YYERROR; \
717  } \
718 while (YYID (0))
719 
720 /* Error token number */
721 #define YYTERROR 1
722 #define YYERRCODE 256
723 
724 
725 /* This macro is provided for backward compatibility. */
726 #ifndef YY_LOCATION_PRINT
727 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
728 #endif
729 
730 
731 /* YYLEX -- calling `yylex' with the right arguments. */
732 #ifdef YYLEX_PARAM
733 # define YYLEX yylex (&yylval, YYLEX_PARAM)
734 #else
735 # define YYLEX yylex (&yylval, scanner)
736 #endif
737 
738 /* Enable debugging if requested. */
739 #if YYDEBUG
740 
741 # ifndef YYFPRINTF
742 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
743 # define YYFPRINTF fprintf
744 # endif
745 
746 # define YYDPRINTF(Args) \
747 do { \
748  if (yydebug) \
749  YYFPRINTF Args; \
750 } while (YYID (0))
751 
752 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
753 do { \
754  if (yydebug) \
755  { \
756  YYFPRINTF (stderr, "%s ", Title); \
757  yy_symbol_print (stderr, \
758  Type, Value, parser); \
759  YYFPRINTF (stderr, "\n"); \
760  } \
761 } while (YYID (0))
762 
763 
764 /*--------------------------------.
765 | Print this symbol on YYOUTPUT. |
766 `--------------------------------*/
767 
768 /*ARGSUSED*/
769 #if (defined __STDC__ || defined __C99__FUNC__ \
770  || defined __cplusplus || defined _MSC_VER)
771 static void
772 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, text_parser_tex& parser)
773 #else
774 static void
775 yy_symbol_value_print (yyoutput, yytype, yyvaluep, parser)
776  FILE *yyoutput;
777  int yytype;
778  YYSTYPE const * const yyvaluep;
779  text_parser_tex& parser;
780 #endif
781 {
782  FILE *yyo = yyoutput;
783  YYUSE (yyo);
784  if (!yyvaluep)
785  return;
786  YYUSE (parser);
787 # ifdef YYPRINT
788  if (yytype < YYNTOKENS)
789  YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
790 # else
791  YYUSE (yyoutput);
792 # endif
793  YYUSE (yytype);
794 }
795 
796 
797 /*--------------------------------.
798 | Print this symbol on YYOUTPUT. |
799 `--------------------------------*/
800 
801 #if (defined __STDC__ || defined __C99__FUNC__ \
802  || defined __cplusplus || defined _MSC_VER)
803 static void
804 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, text_parser_tex& parser)
805 #else
806 static void
807 yy_symbol_print (yyoutput, yytype, yyvaluep, parser)
808  FILE *yyoutput;
809  int yytype;
810  YYSTYPE const * const yyvaluep;
811  text_parser_tex& parser;
812 #endif
813 {
814  if (yytype < YYNTOKENS)
815  YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
816  else
817  YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
818 
819  yy_symbol_value_print (yyoutput, yytype, yyvaluep, parser);
820  YYFPRINTF (yyoutput, ")");
821 }
822 
823 /*------------------------------------------------------------------.
824 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
825 | TOP (included). |
826 `------------------------------------------------------------------*/
827 
828 #if (defined __STDC__ || defined __C99__FUNC__ \
829  || defined __cplusplus || defined _MSC_VER)
830 static void
831 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
832 #else
833 static void
834 yy_stack_print (yybottom, yytop)
835  yytype_int16 *yybottom;
836  yytype_int16 *yytop;
837 #endif
838 {
839  YYFPRINTF (stderr, "Stack now");
840  for (; yybottom <= yytop; yybottom++)
841  {
842  int yybot = *yybottom;
843  YYFPRINTF (stderr, " %d", yybot);
844  }
845  YYFPRINTF (stderr, "\n");
846 }
847 
848 # define YY_STACK_PRINT(Bottom, Top) \
849 do { \
850  if (yydebug) \
851  yy_stack_print ((Bottom), (Top)); \
852 } while (YYID (0))
853 
854 
855 /*------------------------------------------------.
856 | Report that the YYRULE is going to be reduced. |
857 `------------------------------------------------*/
858 
859 #if (defined __STDC__ || defined __C99__FUNC__ \
860  || defined __cplusplus || defined _MSC_VER)
861 static void
862 yy_reduce_print (YYSTYPE *yyvsp, int yyrule, text_parser_tex& parser)
863 #else
864 static void
865 yy_reduce_print (yyvsp, yyrule, parser)
866  YYSTYPE *yyvsp;
867  int yyrule;
868  text_parser_tex& parser;
869 #endif
870 {
871  int yynrhs = yyr2[yyrule];
872  int yyi;
873  unsigned long int yylno = yyrline[yyrule];
874  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
875  yyrule - 1, yylno);
876  /* The symbols being reduced. */
877  for (yyi = 0; yyi < yynrhs; yyi++)
878  {
879  YYFPRINTF (stderr, " $%d = ", yyi + 1);
880  yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
881  &(yyvsp[(yyi + 1) - (yynrhs)])
882  , parser);
883  YYFPRINTF (stderr, "\n");
884  }
885 }
886 
887 # define YY_REDUCE_PRINT(Rule) \
888 do { \
889  if (yydebug) \
890  yy_reduce_print (yyvsp, Rule, parser); \
891 } while (YYID (0))
892 
893 /* Nonzero means print parse trace. It is left uninitialized so that
894  multiple parsers can coexist. */
895 int yydebug;
896 #else /* !YYDEBUG */
897 # define YYDPRINTF(Args)
898 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
899 # define YY_STACK_PRINT(Bottom, Top)
900 # define YY_REDUCE_PRINT(Rule)
901 #endif /* !YYDEBUG */
902 
903 
904 /* YYINITDEPTH -- initial size of the parser's stacks. */
905 #ifndef YYINITDEPTH
906 # define YYINITDEPTH 200
907 #endif
908 
909 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
910  if the built-in stack extension method is used).
911 
912  Do not make this value too large; the results are undefined if
913  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
914  evaluated with infinite-precision integer arithmetic. */
915 
916 #ifndef YYMAXDEPTH
917 # define YYMAXDEPTH 10000
918 #endif
919 
920 
921 #if YYERROR_VERBOSE
922 
923 # ifndef yystrlen
924 # if defined __GLIBC__ && defined _STRING_H
925 # define yystrlen strlen
926 # else
927 /* Return the length of YYSTR. */
928 #if (defined __STDC__ || defined __C99__FUNC__ \
929  || defined __cplusplus || defined _MSC_VER)
930 static YYSIZE_T
931 yystrlen (const char *yystr)
932 #else
933 static YYSIZE_T
934 yystrlen (yystr)
935  const char *yystr;
936 #endif
937 {
938  YYSIZE_T yylen;
939  for (yylen = 0; yystr[yylen]; yylen++)
940  continue;
941  return yylen;
942 }
943 # endif
944 # endif
945 
946 # ifndef yystpcpy
947 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
948 # define yystpcpy stpcpy
949 # else
950 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
951  YYDEST. */
952 #if (defined __STDC__ || defined __C99__FUNC__ \
953  || defined __cplusplus || defined _MSC_VER)
954 static char *
955 yystpcpy (char *yydest, const char *yysrc)
956 #else
957 static char *
958 yystpcpy (yydest, yysrc)
959  char *yydest;
960  const char *yysrc;
961 #endif
962 {
963  char *yyd = yydest;
964  const char *yys = yysrc;
965 
966  while ((*yyd++ = *yys++) != '\0')
967  continue;
968 
969  return yyd - 1;
970 }
971 # endif
972 # endif
973 
974 # ifndef yytnamerr
975 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
976  quotes and backslashes, so that it's suitable for yyerror. The
977  heuristic is that double-quoting is unnecessary unless the string
978  contains an apostrophe, a comma, or backslash (other than
979  backslash-backslash). YYSTR is taken from yytname. If YYRES is
980  null, do not copy; instead, return the length of what the result
981  would have been. */
982 static YYSIZE_T
983 yytnamerr (char *yyres, const char *yystr)
984 {
985  if (*yystr == '"')
986  {
987  YYSIZE_T yyn = 0;
988  char const *yyp = yystr;
989 
990  for (;;)
991  switch (*++yyp)
992  {
993  case '\'':
994  case ',':
995  goto do_not_strip_quotes;
996 
997  case '\\':
998  if (*++yyp != '\\')
999  goto do_not_strip_quotes;
1000  /* Fall through. */
1001  default:
1002  if (yyres)
1003  yyres[yyn] = *yyp;
1004  yyn++;
1005  break;
1006 
1007  case '"':
1008  if (yyres)
1009  yyres[yyn] = '\0';
1010  return yyn;
1011  }
1012  do_not_strip_quotes: ;
1013  }
1014 
1015  if (! yyres)
1016  return yystrlen (yystr);
1017 
1018  return yystpcpy (yyres, yystr) - yyres;
1019 }
1020 # endif
1021 
1022 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1023  about the unexpected token YYTOKEN for the state stack whose top is
1024  YYSSP.
1025 
1026  Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1027  not large enough to hold the message. In that case, also set
1028  *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1029  required number of bytes is too large to store. */
1030 static int
1031 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1032  yytype_int16 *yyssp, int yytoken)
1033 {
1034  YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
1035  YYSIZE_T yysize = yysize0;
1036  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1037  /* Internationalized format string. */
1038  const char *yyformat = YY_NULL;
1039  /* Arguments of yyformat. */
1040  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1041  /* Number of reported tokens (one for the "unexpected", one per
1042  "expected"). */
1043  int yycount = 0;
1044 
1045  /* There are many possibilities here to consider:
1046  - Assume YYFAIL is not used. It's too flawed to consider. See
1047  <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1048  for details. YYERROR is fine as it does not invoke this
1049  function.
1050  - If this state is a consistent state with a default action, then
1051  the only way this function was invoked is if the default action
1052  is an error action. In that case, don't check for expected
1053  tokens because there are none.
1054  - The only way there can be no lookahead present (in yychar) is if
1055  this state is a consistent state with a default action. Thus,
1056  detecting the absence of a lookahead is sufficient to determine
1057  that there is no unexpected or expected token to report. In that
1058  case, just report a simple "syntax error".
1059  - Don't assume there isn't a lookahead just because this state is a
1060  consistent state with a default action. There might have been a
1061  previous inconsistent state, consistent state with a non-default
1062  action, or user semantic action that manipulated yychar.
1063  - Of course, the expected token list depends on states to have
1064  correct lookahead information, and it depends on the parser not
1065  to perform extra reductions after fetching a lookahead from the
1066  scanner and before detecting a syntax error. Thus, state merging
1067  (from LALR or IELR) and default reductions corrupt the expected
1068  token list. However, the list is correct for canonical LR with
1069  one exception: it will still contain any token that will not be
1070  accepted due to an error action in a later state.
1071  */
1072  if (yytoken != YYEMPTY)
1073  {
1074  int yyn = yypact[*yyssp];
1075  yyarg[yycount++] = yytname[yytoken];
1076  if (!yypact_value_is_default (yyn))
1077  {
1078  /* Start YYX at -YYN if negative to avoid negative indexes in
1079  YYCHECK. In other words, skip the first -YYN actions for
1080  this state because they are default actions. */
1081  int yyxbegin = yyn < 0 ? -yyn : 0;
1082  /* Stay within bounds of both yycheck and yytname. */
1083  int yychecklim = YYLAST - yyn + 1;
1084  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1085  int yyx;
1086 
1087  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1088  if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1089  && !yytable_value_is_error (yytable[yyx + yyn]))
1090  {
1091  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1092  {
1093  yycount = 1;
1094  yysize = yysize0;
1095  break;
1096  }
1097  yyarg[yycount++] = yytname[yyx];
1098  {
1099  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
1100  if (! (yysize <= yysize1
1101  && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1102  return 2;
1103  yysize = yysize1;
1104  }
1105  }
1106  }
1107  }
1108 
1109  switch (yycount)
1110  {
1111 # define YYCASE_(N, S) \
1112  case N: \
1113  yyformat = S; \
1114  break
1115  YYCASE_(0, YY_("syntax error"));
1116  YYCASE_(1, YY_("syntax error, unexpected %s"));
1117  YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1118  YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1119  YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1120  YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1121 # undef YYCASE_
1122  }
1123 
1124  {
1125  YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1126  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1127  return 2;
1128  yysize = yysize1;
1129  }
1130 
1131  if (*yymsg_alloc < yysize)
1132  {
1133  *yymsg_alloc = 2 * yysize;
1134  if (! (yysize <= *yymsg_alloc
1135  && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1136  *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1137  return 1;
1138  }
1139 
1140  /* Avoid sprintf, as that infringes on the user's name space.
1141  Don't have undefined behavior even if the translation
1142  produced a string with the wrong number of "%s"s. */
1143  {
1144  char *yyp = *yymsg;
1145  int yyi = 0;
1146  while ((*yyp = *yyformat) != '\0')
1147  if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1148  {
1149  yyp += yytnamerr (yyp, yyarg[yyi++]);
1150  yyformat += 2;
1151  }
1152  else
1153  {
1154  yyp++;
1155  yyformat++;
1156  }
1157  }
1158  return 0;
1159 }
1160 #endif /* YYERROR_VERBOSE */
1161 
1162 /*-----------------------------------------------.
1163 | Release the memory associated to this symbol. |
1164 `-----------------------------------------------*/
1165 
1166 /*ARGSUSED*/
1167 #if (defined __STDC__ || defined __C99__FUNC__ \
1168  || defined __cplusplus || defined _MSC_VER)
1169 static void
1170 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, text_parser_tex& parser)
1171 #else
1172 static void
1173 yydestruct (yymsg, yytype, yyvaluep, parser)
1174  const char *yymsg;
1175  int yytype;
1176  YYSTYPE *yyvaluep;
1178 #endif
1179 {
1180  YYUSE (yyvaluep);
1181  YYUSE (parser);
1182 
1183  if (!yymsg)
1184  yymsg = "Deleting";
1185  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1186 
1187  switch (yytype)
1188  {
1189  case 15: /* CH */
1190 /* Line 1393 of yacc.c */
1191 #line 84 "../../libinterp/corefcn/oct-tex-parser.yy"
1192  { };
1193 /* Line 1393 of yacc.c */
1194 #line 1195 "corefcn/oct-tex-parser.cc"
1195  break;
1196  case 16: /* NUM */
1197 /* Line 1393 of yacc.c */
1198 #line 84 "../../libinterp/corefcn/oct-tex-parser.yy"
1199  { };
1200 /* Line 1393 of yacc.c */
1201 #line 1202 "corefcn/oct-tex-parser.cc"
1202  break;
1203  case 17: /* SYM */
1204 /* Line 1393 of yacc.c */
1205 #line 84 "../../libinterp/corefcn/oct-tex-parser.yy"
1206  { };
1207 /* Line 1393 of yacc.c */
1208 #line 1209 "corefcn/oct-tex-parser.cc"
1209  break;
1210  case 21: /* simple_string */
1211 /* Line 1393 of yacc.c */
1212 #line 85 "../../libinterp/corefcn/oct-tex-parser.yy"
1213  { delete ((*yyvaluep).str); };
1214 /* Line 1393 of yacc.c */
1215 #line 1216 "corefcn/oct-tex-parser.cc"
1216  break;
1217  case 22: /* symbol_element */
1218 /* Line 1393 of yacc.c */
1219 #line 85 "../../libinterp/corefcn/oct-tex-parser.yy"
1220  { delete ((*yyvaluep).e_base); };
1221 /* Line 1393 of yacc.c */
1222 #line 1223 "corefcn/oct-tex-parser.cc"
1223  break;
1224  case 23: /* font_modifier_element */
1225 /* Line 1393 of yacc.c */
1226 #line 85 "../../libinterp/corefcn/oct-tex-parser.yy"
1227  { delete ((*yyvaluep).e_base); };
1228 /* Line 1393 of yacc.c */
1229 #line 1230 "corefcn/oct-tex-parser.cc"
1230  break;
1231  case 24: /* fontsize_element */
1232 /* Line 1393 of yacc.c */
1233 #line 85 "../../libinterp/corefcn/oct-tex-parser.yy"
1234  { delete ((*yyvaluep).e_base); };
1235 /* Line 1393 of yacc.c */
1236 #line 1237 "corefcn/oct-tex-parser.cc"
1237  break;
1238  case 25: /* fontname_element */
1239 /* Line 1393 of yacc.c */
1240 #line 85 "../../libinterp/corefcn/oct-tex-parser.yy"
1241  { delete ((*yyvaluep).e_base); };
1242 /* Line 1393 of yacc.c */
1243 #line 1244 "corefcn/oct-tex-parser.cc"
1244  break;
1245  case 26: /* color_element */
1246 /* Line 1393 of yacc.c */
1247 #line 85 "../../libinterp/corefcn/oct-tex-parser.yy"
1248  { delete ((*yyvaluep).e_base); };
1249 /* Line 1393 of yacc.c */
1250 #line 1251 "corefcn/oct-tex-parser.cc"
1251  break;
1252  case 27: /* string_element */
1253 /* Line 1393 of yacc.c */
1254 #line 85 "../../libinterp/corefcn/oct-tex-parser.yy"
1255  { delete ((*yyvaluep).e_base); };
1256 /* Line 1393 of yacc.c */
1257 #line 1258 "corefcn/oct-tex-parser.cc"
1258  break;
1259  case 28: /* superscript_element */
1260 /* Line 1393 of yacc.c */
1261 #line 85 "../../libinterp/corefcn/oct-tex-parser.yy"
1262  { delete ((*yyvaluep).e_base); };
1263 /* Line 1393 of yacc.c */
1264 #line 1265 "corefcn/oct-tex-parser.cc"
1265  break;
1266  case 29: /* subscript_element */
1267 /* Line 1393 of yacc.c */
1268 #line 85 "../../libinterp/corefcn/oct-tex-parser.yy"
1269  { delete ((*yyvaluep).e_base); };
1270 /* Line 1393 of yacc.c */
1271 #line 1272 "corefcn/oct-tex-parser.cc"
1272  break;
1273  case 30: /* combined_script_element */
1274 /* Line 1393 of yacc.c */
1275 #line 85 "../../libinterp/corefcn/oct-tex-parser.yy"
1276  { delete ((*yyvaluep).e_base); };
1277 /* Line 1393 of yacc.c */
1278 #line 1279 "corefcn/oct-tex-parser.cc"
1279  break;
1280  case 31: /* string_element_list */
1281 /* Line 1393 of yacc.c */
1282 #line 85 "../../libinterp/corefcn/oct-tex-parser.yy"
1283  { delete ((*yyvaluep).e_list); };
1284 /* Line 1393 of yacc.c */
1285 #line 1286 "corefcn/oct-tex-parser.cc"
1286  break;
1287  case 32: /* scoped_string_element_list */
1288 /* Line 1393 of yacc.c */
1289 #line 85 "../../libinterp/corefcn/oct-tex-parser.yy"
1290  { delete ((*yyvaluep).e_list); };
1291 /* Line 1393 of yacc.c */
1292 #line 1293 "corefcn/oct-tex-parser.cc"
1293  break;
1294 
1295  default:
1296  break;
1297  }
1298 }
1299 
1300 
1301 
1302 
1303 /*----------.
1304 | yyparse. |
1305 `----------*/
1306 
1307 #ifdef YYPARSE_PARAM
1308 #if (defined __STDC__ || defined __C99__FUNC__ \
1309  || defined __cplusplus || defined _MSC_VER)
1310 int
1311 yyparse (void *YYPARSE_PARAM)
1312 #else
1313 int
1314 yyparse (YYPARSE_PARAM)
1315  void *YYPARSE_PARAM;
1316 #endif
1317 #else /* ! YYPARSE_PARAM */
1318 #if (defined __STDC__ || defined __C99__FUNC__ \
1319  || defined __cplusplus || defined _MSC_VER)
1320 int
1321 yyparse (text_parser_tex& parser)
1322 #else
1323 int
1324 yyparse (parser)
1325  text_parser_tex& parser;
1326 #endif
1327 #endif
1328 {
1329 /* The lookahead symbol. */
1330 int yychar;
1331 
1332 
1333 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
1334 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
1335 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
1336  _Pragma ("GCC diagnostic push") \
1337  _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
1338  _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
1339 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
1340  _Pragma ("GCC diagnostic pop")
1341 #else
1342 /* Default value used for initialization, for pacifying older GCCs
1343  or non-GCC compilers. */
1344 static YYSTYPE yyval_default;
1345 # define YY_INITIAL_VALUE(Value) = Value
1346 #endif
1347 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1348 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1349 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
1350 #endif
1351 #ifndef YY_INITIAL_VALUE
1352 # define YY_INITIAL_VALUE(Value) /* Nothing. */
1353 #endif
1354 
1355 /* The semantic value of the lookahead symbol. */
1356 YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
1357 
1358  /* Number of syntax errors so far. */
1359  int yynerrs;
1360 
1361  int yystate;
1362  /* Number of tokens to shift before error messages enabled. */
1363  int yyerrstatus;
1364 
1365  /* The stacks and their tools:
1366  `yyss': related to states.
1367  `yyvs': related to semantic values.
1368 
1369  Refer to the stacks through separate pointers, to allow yyoverflow
1370  to reallocate them elsewhere. */
1371 
1372  /* The state stack. */
1374  yytype_int16 *yyss;
1375  yytype_int16 *yyssp;
1376 
1377  /* The semantic value stack. */
1379  YYSTYPE *yyvs;
1380  YYSTYPE *yyvsp;
1381 
1383 
1384  int yyn;
1385  int yyresult;
1386  /* Lookahead token as an internal (translated) token number. */
1387  int yytoken = 0;
1388  /* The variables used to return semantic value and location from the
1389  action routines. */
1390  YYSTYPE yyval;
1391 
1392 #if YYERROR_VERBOSE
1393  /* Buffer for error messages, and its allocated size. */
1394  char yymsgbuf[128];
1395  char *yymsg = yymsgbuf;
1396  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1397 #endif
1398 
1399 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1400 
1401  /* The number of symbols on the RHS of the reduced rule.
1402  Keep to zero when no symbol should be popped. */
1403  int yylen = 0;
1404 
1405  yyssp = yyss = yyssa;
1406  yyvsp = yyvs = yyvsa;
1407  yystacksize = YYINITDEPTH;
1408 
1409  YYDPRINTF ((stderr, "Starting parse\n"));
1410 
1411  yystate = 0;
1412  yyerrstatus = 0;
1413  yynerrs = 0;
1414  yychar = YYEMPTY; /* Cause a token to be read. */
1415  goto yysetstate;
1416 
1417 /*------------------------------------------------------------.
1418 | yynewstate -- Push a new state, which is found in yystate. |
1419 `------------------------------------------------------------*/
1420  yynewstate:
1421  /* In all cases, when you get here, the value and location stacks
1422  have just been pushed. So pushing a state here evens the stacks. */
1423  yyssp++;
1424 
1425  yysetstate:
1426  *yyssp = yystate;
1427 
1428  if (yyss + yystacksize - 1 <= yyssp)
1429  {
1430  /* Get the current used size of the three stacks, in elements. */
1431  YYSIZE_T yysize = yyssp - yyss + 1;
1432 
1433 #ifdef yyoverflow
1434  {
1435  /* Give user a chance to reallocate the stack. Use copies of
1436  these so that the &'s don't force the real ones into
1437  memory. */
1438  YYSTYPE *yyvs1 = yyvs;
1439  yytype_int16 *yyss1 = yyss;
1440 
1441  /* Each stack pointer address is followed by the size of the
1442  data in use in that stack, in bytes. This used to be a
1443  conditional around just the two extra args, but that might
1444  be undefined if yyoverflow is a macro. */
1445  yyoverflow (YY_("memory exhausted"),
1446  &yyss1, yysize * sizeof (*yyssp),
1447  &yyvs1, yysize * sizeof (*yyvsp),
1448  &yystacksize);
1449 
1450  yyss = yyss1;
1451  yyvs = yyvs1;
1452  }
1453 #else /* no yyoverflow */
1454 # ifndef YYSTACK_RELOCATE
1455  goto yyexhaustedlab;
1456 # else
1457  /* Extend the stack our own way. */
1458  if (YYMAXDEPTH <= yystacksize)
1459  goto yyexhaustedlab;
1460  yystacksize *= 2;
1461  if (YYMAXDEPTH < yystacksize)
1462  yystacksize = YYMAXDEPTH;
1463 
1464  {
1465  yytype_int16 *yyss1 = yyss;
1466  union yyalloc *yyptr =
1467  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1468  if (! yyptr)
1469  goto yyexhaustedlab;
1470  YYSTACK_RELOCATE (yyss_alloc, yyss);
1471  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1472 # undef YYSTACK_RELOCATE
1473  if (yyss1 != yyssa)
1474  YYSTACK_FREE (yyss1);
1475  }
1476 # endif
1477 #endif /* no yyoverflow */
1478 
1479  yyssp = yyss + yysize - 1;
1480  yyvsp = yyvs + yysize - 1;
1481 
1482  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1483  (unsigned long int) yystacksize));
1484 
1485  if (yyss + yystacksize - 1 <= yyssp)
1486  YYABORT;
1487  }
1488 
1489  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1490 
1491  if (yystate == YYFINAL)
1492  YYACCEPT;
1493 
1494  goto yybackup;
1495 
1496 /*-----------.
1497 | yybackup. |
1498 `-----------*/
1499 yybackup:
1500 
1501  /* Do appropriate processing given the current state. Read a
1502  lookahead token if we need one and don't already have one. */
1503 
1504  /* First try to decide what to do without reference to lookahead token. */
1505  yyn = yypact[yystate];
1506  if (yypact_value_is_default (yyn))
1507  goto yydefault;
1508 
1509  /* Not known => get a lookahead token if don't already have one. */
1510 
1511  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1512  if (yychar == YYEMPTY)
1513  {
1514  YYDPRINTF ((stderr, "Reading a token: "));
1515  yychar = YYLEX;
1516  }
1517 
1518  if (yychar <= YYEOF)
1519  {
1520  yychar = yytoken = YYEOF;
1521  YYDPRINTF ((stderr, "Now at end of input.\n"));
1522  }
1523  else
1524  {
1525  yytoken = YYTRANSLATE (yychar);
1526  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1527  }
1528 
1529  /* If the proper action on seeing token YYTOKEN is to reduce or to
1530  detect an error, take that action. */
1531  yyn += yytoken;
1532  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1533  goto yydefault;
1534  yyn = yytable[yyn];
1535  if (yyn <= 0)
1536  {
1537  if (yytable_value_is_error (yyn))
1538  goto yyerrlab;
1539  yyn = -yyn;
1540  goto yyreduce;
1541  }
1542 
1543  /* Count tokens shifted since error; after three, turn off error
1544  status. */
1545  if (yyerrstatus)
1546  yyerrstatus--;
1547 
1548  /* Shift the lookahead token. */
1549  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1550 
1551  /* Discard the shifted token. */
1552  yychar = YYEMPTY;
1553 
1554  yystate = yyn;
1556  *++yyvsp = yylval;
1558 
1559  goto yynewstate;
1560 
1561 
1562 /*-----------------------------------------------------------.
1563 | yydefault -- do the default action for the current state. |
1564 `-----------------------------------------------------------*/
1565 yydefault:
1566  yyn = yydefact[yystate];
1567  if (yyn == 0)
1568  goto yyerrlab;
1569  goto yyreduce;
1570 
1571 
1572 /*-----------------------------.
1573 | yyreduce -- Do a reduction. |
1574 `-----------------------------*/
1575 yyreduce:
1576  /* yyn is the number of a rule to reduce with. */
1577  yylen = yyr2[yyn];
1578 
1579  /* If YYLEN is nonzero, implement the default value of the action:
1580  `$$ = $1'.
1581 
1582  Otherwise, the following line sets YYVAL to garbage.
1583  This behavior is undocumented and Bison
1584  users should not rely upon it. Assigning to YYVAL
1585  unconditionally makes the parser a bit smaller, and it avoids a
1586  GCC warning that YYVAL may be used uninitialized. */
1587  yyval = yyvsp[1-yylen];
1588 
1589 
1590  YY_REDUCE_PRINT (yyn);
1591  switch (yyn)
1592  {
1593  case 2:
1594 /* Line 1787 of yacc.c */
1595 #line 98 "../../libinterp/corefcn/oct-tex-parser.yy"
1596  { (yyval.str) = new std::string (1, (yyvsp[(1) - (1)].ch)); }
1597  break;
1598 
1599  case 3:
1600 /* Line 1787 of yacc.c */
1601 #line 100 "../../libinterp/corefcn/oct-tex-parser.yy"
1602  { (yyvsp[(1) - (2)].str)->append (1, (yyvsp[(2) - (2)].ch)); (yyval.str) = (yyvsp[(1) - (2)].str); }
1603  break;
1604 
1605  case 4:
1606 /* Line 1787 of yacc.c */
1607 #line 104 "../../libinterp/corefcn/oct-tex-parser.yy"
1608  { (yyval.e_base) = new text_element_symbol ((yyvsp[(1) - (1)].sym)); }
1609  break;
1610 
1611  case 5:
1612 /* Line 1787 of yacc.c */
1613 #line 108 "../../libinterp/corefcn/oct-tex-parser.yy"
1615  break;
1616 
1617  case 6:
1618 /* Line 1787 of yacc.c */
1619 #line 110 "../../libinterp/corefcn/oct-tex-parser.yy"
1621  break;
1622 
1623  case 7:
1624 /* Line 1787 of yacc.c */
1625 #line 112 "../../libinterp/corefcn/oct-tex-parser.yy"
1627  break;
1628 
1629  case 8:
1630 /* Line 1787 of yacc.c */
1631 #line 114 "../../libinterp/corefcn/oct-tex-parser.yy"
1633  break;
1634 
1635  case 9:
1636 /* Line 1787 of yacc.c */
1637 #line 118 "../../libinterp/corefcn/oct-tex-parser.yy"
1638  { (yyval.e_base) = new text_element_fontsize ((yyvsp[(3) - (4)].num)); }
1639  break;
1640 
1641  case 10:
1642 /* Line 1787 of yacc.c */
1643 #line 122 "../../libinterp/corefcn/oct-tex-parser.yy"
1644  {
1645  (yyval.e_base) = new text_element_fontname (*(yyvsp[(3) - (4)].str));
1646  delete (yyvsp[(3) - (4)].str);
1647  }
1648  break;
1649 
1650  case 11:
1651 /* Line 1787 of yacc.c */
1652 #line 129 "../../libinterp/corefcn/oct-tex-parser.yy"
1653  {
1654  (yyval.e_base) = new text_element_color (*(yyvsp[(3) - (4)].str));
1655  delete (yyvsp[(3) - (4)].str);
1656  }
1657  break;
1658 
1659  case 12:
1660 /* Line 1787 of yacc.c */
1661 #line 134 "../../libinterp/corefcn/oct-tex-parser.yy"
1662  {
1663  (yyval.e_base) = new text_element_color ((yyvsp[(3) - (6)].num), (yyvsp[(4) - (6)].num), (yyvsp[(5) - (6)].num));
1664  }
1665  break;
1666 
1667  case 13:
1668 /* Line 1787 of yacc.c */
1669 #line 140 "../../libinterp/corefcn/oct-tex-parser.yy"
1670  {
1671  (yyval.e_base) = new text_element_string (*(yyvsp[(1) - (1)].str));
1672  delete (yyvsp[(1) - (1)].str);
1673  }
1674  break;
1675 
1676  case 14:
1677 /* Line 1787 of yacc.c */
1678 #line 146 "../../libinterp/corefcn/oct-tex-parser.yy"
1679  { (yyval.e_base) = (yyvsp[(1) - (1)].e_list); }
1680  break;
1681 
1682  case 23:
1683 /* Line 1787 of yacc.c */
1684 #line 158 "../../libinterp/corefcn/oct-tex-parser.yy"
1685  { (yyval.e_base) = new text_element_superscript ((yyvsp[(2) - (2)].ch)); }
1686  break;
1687 
1688  case 24:
1689 /* Line 1787 of yacc.c */
1690 #line 160 "../../libinterp/corefcn/oct-tex-parser.yy"
1691  { (yyval.e_base) = new text_element_superscript ((yyvsp[(2) - (2)].e_list)); }
1692  break;
1693 
1694  case 25:
1695 /* Line 1787 of yacc.c */
1696 #line 162 "../../libinterp/corefcn/oct-tex-parser.yy"
1697  { (yyval.e_base) = new text_element_superscript ((yyvsp[(2) - (2)].e_base)); }
1698  break;
1699 
1700  case 26:
1701 /* Line 1787 of yacc.c */
1702 #line 166 "../../libinterp/corefcn/oct-tex-parser.yy"
1703  { (yyval.e_base) = new text_element_subscript ((yyvsp[(2) - (2)].ch)); }
1704  break;
1705 
1706  case 27:
1707 /* Line 1787 of yacc.c */
1708 #line 168 "../../libinterp/corefcn/oct-tex-parser.yy"
1709  { (yyval.e_base) = new text_element_subscript ((yyvsp[(2) - (2)].e_list)); }
1710  break;
1711 
1712  case 28:
1713 /* Line 1787 of yacc.c */
1714 #line 170 "../../libinterp/corefcn/oct-tex-parser.yy"
1715  { (yyval.e_base) = new text_element_subscript ((yyvsp[(2) - (2)].e_base)); }
1716  break;
1717 
1718  case 29:
1719 /* Line 1787 of yacc.c */
1720 #line 174 "../../libinterp/corefcn/oct-tex-parser.yy"
1721  { (yyval.e_base) = new text_element_combined ((yyvsp[(1) - (2)].e_base), (yyvsp[(2) - (2)].e_base)); }
1722  break;
1723 
1724  case 30:
1725 /* Line 1787 of yacc.c */
1726 #line 176 "../../libinterp/corefcn/oct-tex-parser.yy"
1727  { (yyval.e_base) = new text_element_combined ((yyvsp[(1) - (2)].e_base), (yyvsp[(2) - (2)].e_base)); }
1728  break;
1729 
1730  case 31:
1731 /* Line 1787 of yacc.c */
1732 #line 180 "../../libinterp/corefcn/oct-tex-parser.yy"
1733  { (yyval.e_list) = new text_element_list ((yyvsp[(1) - (1)].e_base)); }
1734  break;
1735 
1736  case 32:
1737 /* Line 1787 of yacc.c */
1738 #line 182 "../../libinterp/corefcn/oct-tex-parser.yy"
1739  { (yyvsp[(1) - (2)].e_list)->push_back ((yyvsp[(2) - (2)].e_base)); (yyval.e_list) = (yyvsp[(1) - (2)].e_list); }
1740  break;
1741 
1742  case 33:
1743 /* Line 1787 of yacc.c */
1744 #line 186 "../../libinterp/corefcn/oct-tex-parser.yy"
1745  { (yyval.e_list) = (yyvsp[(2) - (3)].e_list); }
1746  break;
1747 
1748  case 34:
1749 /* Line 1787 of yacc.c */
1750 #line 188 "../../libinterp/corefcn/oct-tex-parser.yy"
1751  { (yyval.e_list) = new text_element_list (); }
1752  break;
1753 
1754  case 35:
1755 /* Line 1787 of yacc.c */
1756 #line 192 "../../libinterp/corefcn/oct-tex-parser.yy"
1757  { parser.set_parse_result (new text_element_string ("")); }
1758  break;
1759 
1760  case 36:
1761 /* Line 1787 of yacc.c */
1762 #line 194 "../../libinterp/corefcn/oct-tex-parser.yy"
1763  { parser.set_parse_result ((yyvsp[(1) - (1)].e_list)); }
1764  break;
1765 
1766 
1767 /* Line 1787 of yacc.c */
1768 #line 1769 "corefcn/oct-tex-parser.cc"
1769  default: break;
1770  }
1771  /* User semantic actions sometimes alter yychar, and that requires
1772  that yytoken be updated with the new translation. We take the
1773  approach of translating immediately before every use of yytoken.
1774  One alternative is translating here after every semantic action,
1775  but that translation would be missed if the semantic action invokes
1776  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1777  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1778  incorrect destructor might then be invoked immediately. In the
1779  case of YYERROR or YYBACKUP, subsequent parser actions might lead
1780  to an incorrect destructor call or verbose syntax error message
1781  before the lookahead is translated. */
1782  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1783 
1784  YYPOPSTACK (yylen);
1785  yylen = 0;
1786  YY_STACK_PRINT (yyss, yyssp);
1787 
1788  *++yyvsp = yyval;
1789 
1790  /* Now `shift' the result of the reduction. Determine what state
1791  that goes to, based on the state we popped back to and the rule
1792  number reduced by. */
1793 
1794  yyn = yyr1[yyn];
1795 
1796  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1797  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1798  yystate = yytable[yystate];
1799  else
1800  yystate = yydefgoto[yyn - YYNTOKENS];
1801 
1802  goto yynewstate;
1803 
1804 
1805 /*------------------------------------.
1806 | yyerrlab -- here on detecting error |
1807 `------------------------------------*/
1808 yyerrlab:
1809  /* Make sure we have latest lookahead translation. See comments at
1810  user semantic actions for why this is necessary. */
1811  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1812 
1813  /* If not already recovering from an error, report this error. */
1814  if (!yyerrstatus)
1815  {
1816  ++yynerrs;
1817 #if ! YYERROR_VERBOSE
1818  yyerror (parser, YY_("syntax error"));
1819 #else
1820 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1821  yyssp, yytoken)
1822  {
1823  char const *yymsgp = YY_("syntax error");
1824  int yysyntax_error_status;
1825  yysyntax_error_status = YYSYNTAX_ERROR;
1826  if (yysyntax_error_status == 0)
1827  yymsgp = yymsg;
1828  else if (yysyntax_error_status == 1)
1829  {
1830  if (yymsg != yymsgbuf)
1831  YYSTACK_FREE (yymsg);
1832  yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1833  if (!yymsg)
1834  {
1835  yymsg = yymsgbuf;
1836  yymsg_alloc = sizeof yymsgbuf;
1837  yysyntax_error_status = 2;
1838  }
1839  else
1840  {
1841  yysyntax_error_status = YYSYNTAX_ERROR;
1842  yymsgp = yymsg;
1843  }
1844  }
1845  yyerror (parser, yymsgp);
1846  if (yysyntax_error_status == 2)
1847  goto yyexhaustedlab;
1848  }
1849 # undef YYSYNTAX_ERROR
1850 #endif
1851  }
1852 
1853 
1854 
1855  if (yyerrstatus == 3)
1856  {
1857  /* If just tried and failed to reuse lookahead token after an
1858  error, discard it. */
1859 
1860  if (yychar <= YYEOF)
1861  {
1862  /* Return failure if at end of input. */
1863  if (yychar == YYEOF)
1864  YYABORT;
1865  }
1866  else
1867  {
1868  yydestruct ("Error: discarding",
1869  yytoken, &yylval, parser);
1870  yychar = YYEMPTY;
1871  }
1872  }
1873 
1874  /* Else will try to reuse lookahead token after shifting the error
1875  token. */
1876  goto yyerrlab1;
1877 
1878 
1879 /*---------------------------------------------------.
1880 | yyerrorlab -- error raised explicitly by YYERROR. |
1881 `---------------------------------------------------*/
1882 yyerrorlab:
1883 
1884  /* Pacify compilers like GCC when the user code never invokes
1885  YYERROR and the label yyerrorlab therefore never appears in user
1886  code. */
1887  if (/*CONSTCOND*/ 0)
1888  goto yyerrorlab;
1889 
1890  /* Do not reclaim the symbols of the rule which action triggered
1891  this YYERROR. */
1892  YYPOPSTACK (yylen);
1893  yylen = 0;
1894  YY_STACK_PRINT (yyss, yyssp);
1895  yystate = *yyssp;
1896  goto yyerrlab1;
1897 
1898 
1899 /*-------------------------------------------------------------.
1900 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1901 `-------------------------------------------------------------*/
1902 yyerrlab1:
1903  yyerrstatus = 3; /* Each real token shifted decrements this. */
1904 
1905  for (;;)
1906  {
1907  yyn = yypact[yystate];
1908  if (!yypact_value_is_default (yyn))
1909  {
1910  yyn += YYTERROR;
1911  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1912  {
1913  yyn = yytable[yyn];
1914  if (0 < yyn)
1915  break;
1916  }
1917  }
1918 
1919  /* Pop the current state because it cannot handle the error token. */
1920  if (yyssp == yyss)
1921  YYABORT;
1922 
1923 
1924  yydestruct ("Error: popping",
1925  yystos[yystate], yyvsp, parser);
1926  YYPOPSTACK (1);
1927  yystate = *yyssp;
1928  YY_STACK_PRINT (yyss, yyssp);
1929  }
1930 
1932  *++yyvsp = yylval;
1934 
1935 
1936  /* Shift the error token. */
1937  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1938 
1939  yystate = yyn;
1940  goto yynewstate;
1941 
1942 
1943 /*-------------------------------------.
1944 | yyacceptlab -- YYACCEPT comes here. |
1945 `-------------------------------------*/
1946 yyacceptlab:
1947  yyresult = 0;
1948  goto yyreturn;
1949 
1950 /*-----------------------------------.
1951 | yyabortlab -- YYABORT comes here. |
1952 `-----------------------------------*/
1953 yyabortlab:
1954  yyresult = 1;
1955  goto yyreturn;
1956 
1957 #if !defined yyoverflow || YYERROR_VERBOSE
1958 /*-------------------------------------------------.
1959 | yyexhaustedlab -- memory exhaustion comes here. |
1960 `-------------------------------------------------*/
1961 yyexhaustedlab:
1962  yyerror (parser, YY_("memory exhausted"));
1963  yyresult = 2;
1964  /* Fall through. */
1965 #endif
1966 
1967 yyreturn:
1968  if (yychar != YYEMPTY)
1969  {
1970  /* Make sure we have latest lookahead translation. See comments at
1971  user semantic actions for why this is necessary. */
1972  yytoken = YYTRANSLATE (yychar);
1973  yydestruct ("Cleanup: discarding lookahead",
1974  yytoken, &yylval, parser);
1975  }
1976  /* Do not reclaim the symbols of the rule which action triggered
1977  this YYABORT or YYACCEPT. */
1978  YYPOPSTACK (yylen);
1979  YY_STACK_PRINT (yyss, yyssp);
1980  while (yyssp != yyss)
1981  {
1982  yydestruct ("Cleanup: popping",
1983  yystos[*yyssp], yyvsp, parser);
1984  YYPOPSTACK (1);
1985  }
1986 #ifndef yyoverflow
1987  if (yyss != yyssa)
1988  YYSTACK_FREE (yyss);
1989 #endif
1990 #if YYERROR_VERBOSE
1991  if (yymsg != yymsgbuf)
1992  YYSTACK_FREE (yymsg);
1993 #endif
1994  /* Make sure YYID is used. */
1995  return YYID (yyresult);
1996 }
1997 
1998 
1999 /* Line 2050 of yacc.c */
2000 #line 197 "../../libinterp/corefcn/oct-tex-parser.yy"
2001 
2002 
2003 text_element*
2004 text_parser_tex::parse (const std::string& s)
2005 {
2006  octave_tex_debug = 0;
2007 
2008  if (init_lexer (s))
2009  {
2010  result = 0;
2011 
2012  if (octave_tex_parse (*this) == 0)
2013  return result;
2014  }
2015 
2016  return new text_element_string (s);
2017 }
2018 
2019 static void
2020 yyerror (text_parser_tex&, const char *s)
2021 {
2022  fprintf (stderr, "TeX parse error: %s\n", s);
2023 }