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