1 /* A Bison parser, made by GNU Bison 2.5. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
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.
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.
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/>. */
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.
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
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. */
43 /* Identify Bison output. */
47 #define YYBISON_VERSION "2.5"
50 #define YYSKELETON_NAME "yacc.c"
61 /* Using locations. */
62 #define YYLSP_NEEDED 1
64 /* Substitute the variable and function names. */
65 #define yyparse scdocparse
66 #define yylex scdoclex
67 #define yyerror scdocerror
68 #define yylval scdoclval
69 #define yychar scdocchar
70 #define yydebug scdocdebug
71 #define yynerrs scdocnerrs
72 #define yylloc scdoclloc
74 /* Copy the first part of user declarations. */
76 /* Line 268 of yacc.c */
79 /************************************************************************
81 * Copyright 2012 Jonatan Liljedahl <lijon@kymatica.com>
83 * This program is free software: you can redistribute it and/or modify
84 * it under the terms of the GNU General Public License as published by
85 * the Free Software Foundation, either version 3 of the License, or
86 * (at your option) any later version.
88 * This program is distributed in the hope that it will be useful,
89 * but WITHOUT ANY WARRANTY; without even the implied warranty of
90 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
91 * GNU General Public License for more details.
93 * You should have received a copy of the GNU General Public License
94 * along with this program. If not, see <http://www.gnu.org/licenses/>.
96 ************************************************************************/
103 //#define YYLEX_PARAM &yylval, &yylloc
107 extern int scdoclineno
;
108 extern char *scdoctext
;
109 extern int scdoc_start_token
;
110 extern FILE *scdocin
;
111 //extern struct YYLTYPE scdoclloc;
113 //int scdoc_metadata_mode;
115 static const char * method_type
= NULL
;
117 static DocNode
* topnode
;
119 void scdocerror(const char *str
);
121 extern void error(const char *fmt
, ...);
122 extern void post(const char *fmt
, ...);
124 static inline bool stringEqual(const char * a
, const char * b
)
126 return strcmp(a
, b
) == 0;
131 /* Line 268 of yacc.c */
132 #line 133 "SCDoc.tab.cpp"
134 /* Enabling traces. */
139 /* Enabling verbose error messages. */
140 #ifdef YYERROR_VERBOSE
141 # undef YYERROR_VERBOSE
142 # define YYERROR_VERBOSE 1
144 # define YYERROR_VERBOSE 1
147 /* Enabling the token table. */
148 #ifndef YYTOKEN_TABLE
149 # define YYTOKEN_TABLE 0
156 /* Put the tokens into the symbol table, so that GDB and other debuggers
176 INSTANCEMETHODS
= 274,
183 DEFINITIONLIST
= 281,
210 BAD_METHODNAME
= 308,
219 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
220 typedef union YYSTYPE
223 /* Line 293 of yacc.c */
233 /* Line 293 of yacc.c */
234 #line 235 "SCDoc.tab.cpp"
236 # define YYSTYPE_IS_TRIVIAL 1
237 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
238 # define YYSTYPE_IS_DECLARED 1
241 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
242 typedef struct YYLTYPE
249 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
250 # define YYLTYPE_IS_DECLARED 1
251 # define YYLTYPE_IS_TRIVIAL 1
255 /* Copy the second part of user declarations. */
257 /* Line 343 of yacc.c */
260 //int scdoclex (YYSTYPE * yylval_param, struct YYLTYPE * yylloc_param );
264 /* Line 343 of yacc.c */
265 #line 266 "SCDoc.tab.cpp"
272 typedef YYTYPE_UINT8 yytype_uint8
;
274 typedef unsigned char yytype_uint8
;
278 typedef YYTYPE_INT8 yytype_int8
;
279 #elif (defined __STDC__ || defined __C99__FUNC__ \
280 || defined __cplusplus || defined _MSC_VER)
281 typedef signed char yytype_int8
;
283 typedef short int yytype_int8
;
287 typedef YYTYPE_UINT16 yytype_uint16
;
289 typedef unsigned short int yytype_uint16
;
293 typedef YYTYPE_INT16 yytype_int16
;
295 typedef short int yytype_int16
;
299 # ifdef __SIZE_TYPE__
300 # define YYSIZE_T __SIZE_TYPE__
301 # elif defined size_t
302 # define YYSIZE_T size_t
303 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
304 || defined __cplusplus || defined _MSC_VER)
305 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
306 # define YYSIZE_T size_t
308 # define YYSIZE_T unsigned int
312 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
315 # if defined YYENABLE_NLS && YYENABLE_NLS
317 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
318 # define YY_(msgid) dgettext ("bison-runtime", msgid)
322 # define YY_(msgid) msgid
326 /* Suppress unused-variable warnings by "using" E. */
327 #if ! defined lint || defined __GNUC__
328 # define YYUSE(e) ((void) (e))
330 # define YYUSE(e) /* empty */
333 /* Identity function, used to suppress warnings about constant conditions. */
337 #if (defined __STDC__ || defined __C99__FUNC__ \
338 || defined __cplusplus || defined _MSC_VER)
351 #if ! defined yyoverflow || YYERROR_VERBOSE
353 /* The parser invokes alloca or malloc; define the necessary symbols. */
355 # ifdef YYSTACK_USE_ALLOCA
356 # if YYSTACK_USE_ALLOCA
358 # define YYSTACK_ALLOC __builtin_alloca
359 # elif defined __BUILTIN_VA_ARG_INCR
360 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
362 # define YYSTACK_ALLOC __alloca
363 # elif defined _MSC_VER
364 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
365 # define alloca _alloca
367 # define YYSTACK_ALLOC alloca
368 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
369 || defined __cplusplus || defined _MSC_VER)
370 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
371 # ifndef EXIT_SUCCESS
372 # define EXIT_SUCCESS 0
379 # ifdef YYSTACK_ALLOC
380 /* Pacify GCC's `empty if-body' warning. */
381 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
382 # ifndef YYSTACK_ALLOC_MAXIMUM
383 /* The OS might guarantee only one guard page at the bottom of the stack,
384 and a page size can be as small as 4096 bytes. So we cannot safely
385 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
386 to allow for a few compiler-allocated temporary stack slots. */
387 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
390 # define YYSTACK_ALLOC YYMALLOC
391 # define YYSTACK_FREE YYFREE
392 # ifndef YYSTACK_ALLOC_MAXIMUM
393 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
395 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
396 && ! ((defined YYMALLOC || defined malloc) \
397 && (defined YYFREE || defined free)))
398 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
399 # ifndef EXIT_SUCCESS
400 # define EXIT_SUCCESS 0
404 # define YYMALLOC malloc
405 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
406 || defined __cplusplus || defined _MSC_VER)
407 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
412 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
413 || defined __cplusplus || defined _MSC_VER)
414 void free (void *); /* INFRINGES ON USER NAME SPACE */
418 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
421 #if (! defined yyoverflow \
422 && (! defined __cplusplus \
423 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
424 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
426 /* A type that is properly aligned for any stack member. */
429 yytype_int16 yyss_alloc
;
434 /* The size of the maximum gap between one aligned stack and the next. */
435 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
437 /* The size of an array large to enough to hold all stacks, each with
439 # define YYSTACK_BYTES(N) \
440 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
441 + 2 * YYSTACK_GAP_MAXIMUM)
443 # define YYCOPY_NEEDED 1
445 /* Relocate STACK from its old location to the new one. The
446 local variables YYSIZE and YYSTACKSIZE give the old and new number of
447 elements in the stack, and YYPTR gives the new location of the
448 stack. Advance YYPTR to a properly aligned location for the next
450 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
453 YYSIZE_T yynewbytes; \
454 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
455 Stack = &yyptr->Stack_alloc; \
456 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
457 yyptr += yynewbytes / sizeof (*yyptr); \
463 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
464 /* Copy COUNT objects from FROM to TO. The source and destination do
467 # if defined __GNUC__ && 1 < __GNUC__
468 # define YYCOPY(To, From, Count) \
469 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
471 # define YYCOPY(To, From, Count) \
475 for (yyi = 0; yyi < (Count); yyi++) \
476 (To)[yyi] = (From)[yyi]; \
481 #endif /* !YYCOPY_NEEDED */
483 /* YYFINAL -- State number of the termination state. */
485 /* YYLAST -- Last index in YYTABLE. */
488 /* YYNTOKENS -- Number of terminals. */
490 /* YYNNTS -- Number of nonterminals. */
492 /* YYNRULES -- Number of rules. */
494 /* YYNRULES -- Number of states. */
495 #define YYNSTATES 193
497 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
499 #define YYMAXUTOK 311
501 #define YYTRANSLATE(YYX) \
502 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
504 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
505 static const yytype_uint8 yytranslate
[] =
507 0, 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, 2, 2, 2, 2,
511 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
512 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
513 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
514 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
515 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
516 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
517 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
518 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
519 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
520 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
521 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
522 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
523 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
524 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
525 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
526 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
527 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
528 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
529 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
530 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
531 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
532 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
533 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
534 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
535 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
536 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
537 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
542 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
544 static const yytype_uint16 yyprhs
[] =
546 0, 0, 3, 5, 8, 13, 16, 20, 22, 23,
547 26, 28, 32, 36, 40, 42, 44, 46, 48, 50,
548 52, 54, 56, 58, 59, 62, 64, 66, 67, 73,
549 76, 78, 79, 82, 84, 86, 91, 93, 94, 97,
550 99, 101, 107, 111, 115, 116, 118, 120, 124, 126,
551 131, 133, 134, 136, 137, 140, 142, 147, 151, 154,
552 155, 158, 159, 161, 163, 166, 169, 171, 174, 176,
553 180, 184, 188, 192, 196, 200, 204, 206, 210, 213,
554 215, 217, 219, 223, 227, 229, 231, 233, 235, 237,
555 239, 241, 243, 245, 247, 249, 251, 253, 255, 257,
556 259, 261, 265, 268, 271, 274, 276, 280, 282, 286,
557 289, 293, 296, 298, 300, 302, 304, 306, 309, 311,
558 314, 316, 318, 320, 322, 324, 326, 328, 331, 333,
559 336, 339, 341, 343, 347
562 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
563 static const yytype_int8 yyrhs
[] =
565 58, 0, -1, 59, -1, 59, 1, -1, 54, 60,
566 61, 65, -1, 55, 66, -1, 56, 61, 65, -1,
567 106, -1, -1, 61, 62, -1, 62, -1, 63, 105,
568 106, -1, 7, 111, 106, -1, 6, 111, 106, -1,
569 3, -1, 4, -1, 5, -1, 8, -1, 18, -1,
570 19, -1, 17, -1, 20, -1, 66, -1, -1, 66,
571 67, -1, 67, -1, 73, -1, -1, 13, 68, 105,
572 106, 69, -1, 64, 69, -1, 70, -1, -1, 70,
573 71, -1, 71, -1, 73, -1, 14, 105, 106, 72,
574 -1, 73, -1, -1, 73, 74, -1, 74, -1, 85,
575 -1, 15, 77, 75, 106, 78, -1, 10, 104, 106,
576 -1, 12, 111, 107, -1, -1, 50, -1, 49, -1,
577 77, 48, 76, -1, 76, -1, 79, 80, 83, 84,
578 -1, 85, -1, -1, 81, -1, -1, 81, 82, -1,
579 82, -1, 16, 104, 106, 79, -1, 16, 106, 85,
580 -1, 21, 85, -1, -1, 22, 85, -1, -1, 86,
581 -1, 87, -1, 87, 88, -1, 86, 88, -1, 88,
582 -1, 86, 89, -1, 89, -1, 94, 85, 43, -1,
583 93, 95, 43, -1, 27, 97, 43, -1, 26, 101,
584 43, -1, 92, 109, 43, -1, 9, 104, 107, -1,
585 11, 111, 107, -1, 52, -1, 35, 105, 43, -1,
586 89, 90, -1, 90, -1, 103, -1, 47, -1, 91,
587 104, 43, -1, 28, 85, 43, -1, 51, -1, 32,
588 -1, 38, -1, 34, -1, 39, -1, 31, -1, 36,
589 -1, 37, -1, 33, -1, 40, -1, 41, -1, 42,
590 -1, 23, -1, 24, -1, 25, -1, 30, -1, 29,
591 -1, 95, 45, 85, -1, 45, 85, -1, 45, 98,
592 -1, 97, 96, -1, 96, -1, 98, 44, 79, -1,
593 79, -1, 99, 45, 85, -1, 45, 85, -1, 99,
594 44, 79, -1, 101, 100, -1, 100, -1, 103, -1,
595 47, -1, 46, -1, 48, -1, 104, 103, -1, 103,
596 -1, 105, 102, -1, 102, -1, 51, -1, 52, -1,
597 106, -1, 0, -1, 103, -1, 106, -1, 109, 108,
598 -1, 108, -1, 110, 46, -1, 110, 47, -1, 46,
599 -1, 47, -1, 111, 48, 110, -1, 110, -1
602 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
603 static const yytype_uint16 yyrline
[] =
605 0, 107, 107, 108, 111, 117, 121, 129, 130, 133,
606 134, 137, 138, 139, 142, 143, 144, 145, 148, 149,
607 150, 151, 154, 155, 158, 159, 160, 163, 163, 164,
608 167, 168, 171, 172, 173, 176, 179, 180, 183, 184,
609 185, 188, 195, 201, 206, 207, 218, 229, 230, 233,
610 242, 243, 246, 247, 250, 251, 254, 255, 258, 259,
611 262, 263, 271, 272, 275, 276, 277, 280, 281, 284,
612 285, 286, 287, 288, 289, 290, 293, 294, 297, 298,
613 301, 302, 303, 304, 305, 308, 309, 310, 311, 312,
614 313, 314, 315, 318, 319, 320, 323, 324, 325, 328,
615 329, 332, 333, 336, 339, 340, 343, 344, 347, 348,
616 351, 358, 359, 362, 363, 366, 367, 370, 371, 374,
617 375, 378, 379, 382, 383, 386, 387, 390, 391, 394,
618 395, 396, 397, 400, 401
622 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
623 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
624 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
625 static const char *const yytname
[] =
627 "\"end of file\"", "error", "$undefined", "CLASS", "TITLE", "SUMMARY",
628 "RELATED", "CATEGORIES", "REDIRECT", "CLASSTREE", "COPYMETHOD",
629 "KEYWORD", "PRIVATE", "SECTION", "SUBSECTION", "METHOD", "ARGUMENT",
630 "DESCRIPTION", "CLASSMETHODS", "INSTANCEMETHODS", "EXAMPLES", "RETURNS",
631 "DISCUSSION", "LIST", "TREE", "NUMBEREDLIST", "DEFINITIONLIST", "TABLE",
632 "FOOTNOTE", "NOTE", "WARNING", "CODE", "LINK", "ANCHOR", "SOFT", "IMAGE",
633 "TELETYPE", "MATH", "STRONG", "EMPHASIS", "\"CODE block\"",
634 "\"TELETYPE block\"", "\"MATH block\"", "\"::\"", "\"||\"", "\"##\"",
635 "\"text\"", "URL", "COMMA", "\"method name\"", "\"arguments string\"",
636 "\"newline\"", "\"empty lines\"", "\"bad method name\"", "START_FULL",
637 "START_PARTIAL", "START_METADATA", "$accept", "start", "document",
638 "eateol", "dochead", "headline", "headtag", "sectiontag", "optsections",
639 "sections", "section", "$@1", "optsubsections", "subsections",
640 "subsection", "optsubsubsections", "subsubsections", "subsubsection",
641 "optMETHODARGS", "methodname", "methnames", "methodbody", "optbody",
642 "optargs", "args", "arg", "optreturns", "optdiscussion", "body",
643 "blockA", "blockB", "bodyelem", "prose", "proseelem", "inlinetag",
644 "blocktag", "listtag", "rangetag", "listbody", "tablerow", "tablebody",
645 "tablecells", "defterms", "deflistrow", "deflistbody", "anywordurl",
646 "anyword", "words", "words2", "eol", "eoleof", "anywordnl", "wordsnl",
647 "nocommawords", "commalist", 0
652 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
654 static const yytype_uint16 yytoknum
[] =
656 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
657 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
658 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
659 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
660 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
661 305, 306, 307, 308, 309, 310, 311
665 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
666 static const yytype_uint8 yyr1
[] =
668 0, 57, 58, 58, 59, 59, 59, 60, 60, 61,
669 61, 62, 62, 62, 63, 63, 63, 63, 64, 64,
670 64, 64, 65, 65, 66, 66, 66, 68, 67, 67,
671 69, 69, 70, 70, 70, 71, 72, 72, 73, 73,
672 73, 74, 74, 74, 75, 75, 76, 77, 77, 78,
673 79, 79, 80, 80, 81, 81, 82, 82, 83, 83,
674 84, 84, 85, 85, 86, 86, 86, 87, 87, 88,
675 88, 88, 88, 88, 88, 88, 88, 88, 89, 89,
676 90, 90, 90, 90, 90, 91, 91, 91, 91, 91,
677 91, 91, 91, 92, 92, 92, 93, 93, 93, 94,
678 94, 95, 95, 96, 97, 97, 98, 98, 99, 99,
679 100, 101, 101, 102, 102, 103, 103, 104, 104, 105,
680 105, 106, 106, 107, 107, 108, 108, 109, 109, 110,
681 110, 110, 110, 111, 111
684 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
685 static const yytype_uint8 yyr2
[] =
687 0, 2, 1, 2, 4, 2, 3, 1, 0, 2,
688 1, 3, 3, 3, 1, 1, 1, 1, 1, 1,
689 1, 1, 1, 0, 2, 1, 1, 0, 5, 2,
690 1, 0, 2, 1, 1, 4, 1, 0, 2, 1,
691 1, 5, 3, 3, 0, 1, 1, 3, 1, 4,
692 1, 0, 1, 0, 2, 1, 4, 3, 2, 0,
693 2, 0, 1, 1, 2, 2, 1, 2, 1, 3,
694 3, 3, 3, 3, 3, 3, 1, 3, 2, 1,
695 1, 1, 3, 3, 1, 1, 1, 1, 1, 1,
696 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
697 1, 3, 2, 2, 2, 1, 3, 1, 3, 2,
698 3, 2, 1, 1, 1, 1, 1, 2, 1, 2,
699 1, 1, 1, 1, 1, 1, 1, 2, 1, 2,
703 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
704 Performed when YYTABLE doesn't specify something else to do. Zero
705 means the default is an error. */
706 static const yytype_uint8 yydefact
[] =
708 0, 8, 0, 0, 0, 0, 121, 122, 0, 7,
709 0, 0, 0, 0, 27, 0, 20, 18, 19, 21,
710 96, 97, 98, 0, 0, 0, 100, 99, 89, 85,
711 92, 87, 0, 90, 91, 86, 88, 93, 94, 95,
712 115, 81, 116, 84, 76, 31, 5, 25, 26, 39,
713 40, 62, 63, 66, 68, 79, 0, 0, 0, 0,
714 80, 14, 15, 16, 0, 0, 17, 23, 10, 0,
715 1, 3, 23, 118, 0, 0, 131, 132, 134, 0,
716 0, 0, 46, 48, 44, 0, 0, 112, 0, 51,
717 105, 0, 0, 114, 120, 113, 0, 0, 29, 30,
718 33, 34, 24, 38, 65, 67, 64, 78, 0, 125,
719 126, 128, 0, 0, 0, 0, 0, 0, 9, 6,
720 22, 0, 4, 124, 117, 123, 74, 42, 129, 130,
721 0, 75, 43, 0, 0, 45, 0, 109, 51, 0,
722 72, 111, 107, 50, 103, 71, 104, 83, 77, 119,
723 0, 32, 82, 73, 127, 102, 70, 0, 69, 13,
724 12, 11, 133, 31, 47, 51, 110, 108, 51, 37,
725 101, 28, 41, 53, 106, 35, 36, 0, 59, 52,
726 55, 0, 0, 0, 61, 54, 51, 57, 58, 0,
730 /* YYDEFGOTO[NTERM-NUM]. */
731 static const yytype_int16 yydefgoto
[] =
733 -1, 4, 5, 8, 67, 68, 69, 45, 119, 120,
734 47, 81, 98, 99, 100, 175, 48, 49, 136, 83,
735 84, 172, 142, 178, 179, 180, 184, 190, 50, 51,
736 52, 53, 54, 55, 56, 57, 58, 59, 114, 90,
737 91, 144, 86, 87, 88, 94, 60, 74, 96, 125,
738 126, 111, 112, 78, 79
741 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
743 #define YYPACT_NINF -125
744 static const yytype_int16 yypact
[] =
746 -4, 78, 226, 150, 19, 139, -125, -125, 150, -125,
747 -35, -35, 100, 100, -125, -21, -125, -125, -125, -125,
748 -125, -125, -125, -10, -6, 348, -125, -125, -125, -125,
749 -125, -125, 54, -125, -125, -125, -125, -125, -125, -125,
750 -125, -125, -125, -125, -125, 270, 125, -125, 30, -125,
751 -125, 348, 382, -125, 58, -125, -35, 25, -2, 348,
752 -125, -125, -125, -125, 100, 100, -125, 182, -125, 54,
753 -125, -125, 182, -125, 7, 25, -125, -125, 104, 16,
754 16, 54, -125, -125, -23, 348, 117, -125, 74, 348,
755 -125, 80, 32, -125, -125, -125, 35, 54, -125, 71,
756 -125, 30, -125, -125, -125, 58, -125, -125, -31, -125,
757 -125, -125, -22, 348, 83, 64, 62, 62, -125, -125,
758 125, -15, -125, -125, -125, -125, -125, -125, -125, -125,
759 100, -125, -125, -15, -21, -125, 78, -125, 348, 348,
760 -125, -125, -125, -125, 93, -125, -125, -125, -125, -125,
761 -15, -125, -125, -125, -125, -125, -125, 348, -125, -125,
762 -125, -125, 104, 270, -125, 348, -125, -125, 348, 314,
763 -125, -125, -125, 102, -125, -125, 30, 25, 101, 102,
764 -125, 25, 348, 348, 109, -125, 348, -125, -125, 348,
768 /* YYPGOTO[NTERM-NUM]. */
769 static const yytype_int16 yypgoto
[] =
771 -125, -125, -125, -125, 140, 26, -125, -125, 97, 157,
772 -41, -125, 8, -125, 75, -125, -42, -40, -125, 39,
773 -125, -125, -124, -125, -125, 0, -125, -125, -5, -125,
774 -125, 113, 124, -48, -125, -125, -125, -125, -125, 91,
775 -125, -125, -125, 95, -125, -87, -9, -7, -59, -1,
779 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
780 positive, shift that token. If negative, reduce the rule which
781 number is the opposite. If YYTABLE_NINF, syntax error. */
782 #define YYTABLE_NINF -3
783 static const yytype_int16 yytable
[] =
785 9, 73, 73, 101, 75, 102, 107, 123, 103, 149,
786 121, 40, 152, 42, 166, 40, 123, 42, 80, 70,
787 92, 153, 133, 95, 40, 134, 42, 135, 82, 6,
788 7, 40, 93, 42, 149, 85, 6, 7, 150, 89,
789 11, 173, 13, 113, 174, 15, 149, 73, 109, 108,
790 1, 2, 3, 40, 115, 42, 110, 107, 6, 7,
791 95, 103, 191, 149, 130, 124, 124, 6, 7, 116,
792 117, 40, 95, 42, 127, 147, 6, 7, 148, 102,
793 137, 40, 93, 42, 143, 97, 25, 95, 95, 28,
794 29, 30, 31, 118, 33, 34, 35, 36, 118, 124,
795 40, 93, 42, 109, 40, 41, 42, 158, 155, 43,
796 130, 110, 95, 6, 7, 159, 160, 140, 177, 85,
797 161, 101, 183, 145, 95, 89, 156, 176, 157, 6,
798 7, 189, 163, 143, 167, 165, 103, 168, 14, -2,
799 71, 95, 16, 17, 18, 19, 76, 77, 72, 169,
800 128, 129, 170, 61, 62, 63, 64, 65, 66, 46,
801 143, 138, 139, 143, 104, 106, 131, 132, 73, 122,
802 181, 171, 124, 164, 151, 105, 182, 187, 188, 185,
803 186, 143, 146, 141, 192, 61, 62, 63, 64, 65,
804 66, 10, 11, 12, 13, 14, 154, 15, 162, 16,
805 17, 18, 19, 0, 0, 20, 21, 22, 23, 24,
806 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
807 35, 36, 37, 38, 39, 0, 0, 0, 40, 41,
808 42, 0, 0, 43, 44, 10, 11, 12, 13, 14,
809 0, 15, 0, 16, 17, 18, 19, 0, 0, 20,
810 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
811 31, 32, 33, 34, 35, 36, 37, 38, 39, 0,
812 0, 0, 40, 41, 42, 0, 0, 43, 44, 10,
813 11, 12, 13, 0, 97, 15, 0, 0, 0, 0,
814 0, 0, 0, 20, 21, 22, 23, 24, 25, 26,
815 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
816 37, 38, 39, 0, 0, 0, 40, 41, 42, 0,
817 0, 43, 44, 10, 11, 12, 13, 0, 0, 15,
818 0, 0, 0, 0, 0, 0, 0, 20, 21, 22,
819 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
820 33, 34, 35, 36, 37, 38, 39, 10, 0, 12,
821 40, 41, 42, 0, 0, 43, 44, 0, 0, 0,
822 0, 20, 21, 22, 23, 24, 25, 26, 27, 28,
823 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
824 39, 10, 0, 12, 40, 41, 42, 0, 0, 43,
825 44, 0, 0, 0, 0, 20, 21, 22, 23, 24,
826 0, 26, 27, 0, 0, 0, 0, 32, 0, 0,
827 0, 0, 37, 38, 39, 0, 0, 0, 0, 0,
831 #define yypact_value_is_default(yystate) \
832 ((yystate) == (-125))
834 #define yytable_value_is_error(yytable_value) \
837 static const yytype_int16 yycheck
[] =
839 1, 10, 11, 45, 11, 46, 54, 0, 48, 96,
840 69, 46, 43, 48, 138, 46, 0, 48, 13, 0,
841 25, 43, 81, 32, 46, 48, 48, 50, 49, 51,
842 52, 46, 47, 48, 121, 45, 51, 52, 97, 45,
843 10, 165, 12, 45, 168, 15, 133, 56, 57, 56,
844 54, 55, 56, 46, 59, 48, 57, 105, 51, 52,
845 69, 101, 186, 150, 48, 74, 75, 51, 52, 64,
846 65, 46, 81, 48, 75, 43, 51, 52, 43, 120,
847 85, 46, 47, 48, 89, 14, 28, 96, 97, 31,
848 32, 33, 34, 67, 36, 37, 38, 39, 72, 108,
849 46, 47, 48, 112, 46, 47, 48, 43, 113, 51,
850 48, 112, 121, 51, 52, 116, 117, 43, 16, 45,
851 121, 163, 21, 43, 133, 45, 43, 169, 45, 51,
852 52, 22, 133, 138, 139, 136, 176, 44, 13, 0,
853 1, 150, 17, 18, 19, 20, 46, 47, 8, 150,
854 46, 47, 157, 3, 4, 5, 6, 7, 8, 2,
855 165, 44, 45, 168, 51, 52, 79, 80, 177, 72,
856 177, 163, 181, 134, 99, 51, 177, 182, 183, 179,
857 181, 186, 91, 88, 189, 3, 4, 5, 6, 7,
858 8, 9, 10, 11, 12, 13, 112, 15, 130, 17,
859 18, 19, 20, -1, -1, 23, 24, 25, 26, 27,
860 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
861 38, 39, 40, 41, 42, -1, -1, -1, 46, 47,
862 48, -1, -1, 51, 52, 9, 10, 11, 12, 13,
863 -1, 15, -1, 17, 18, 19, 20, -1, -1, 23,
864 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
865 34, 35, 36, 37, 38, 39, 40, 41, 42, -1,
866 -1, -1, 46, 47, 48, -1, -1, 51, 52, 9,
867 10, 11, 12, -1, 14, 15, -1, -1, -1, -1,
868 -1, -1, -1, 23, 24, 25, 26, 27, 28, 29,
869 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
870 40, 41, 42, -1, -1, -1, 46, 47, 48, -1,
871 -1, 51, 52, 9, 10, 11, 12, -1, -1, 15,
872 -1, -1, -1, -1, -1, -1, -1, 23, 24, 25,
873 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
874 36, 37, 38, 39, 40, 41, 42, 9, -1, 11,
875 46, 47, 48, -1, -1, 51, 52, -1, -1, -1,
876 -1, 23, 24, 25, 26, 27, 28, 29, 30, 31,
877 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
878 42, 9, -1, 11, 46, 47, 48, -1, -1, 51,
879 52, -1, -1, -1, -1, 23, 24, 25, 26, 27,
880 -1, 29, 30, -1, -1, -1, -1, 35, -1, -1,
881 -1, -1, 40, 41, 42, -1, -1, -1, -1, -1,
885 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
886 symbol of state STATE-NUM. */
887 static const yytype_uint8 yystos
[] =
889 0, 54, 55, 56, 58, 59, 51, 52, 60, 106,
890 9, 10, 11, 12, 13, 15, 17, 18, 19, 20,
891 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
892 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
893 46, 47, 48, 51, 52, 64, 66, 67, 73, 74,
894 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
895 103, 3, 4, 5, 6, 7, 8, 61, 62, 63,
896 0, 1, 61, 103, 104, 104, 46, 47, 110, 111,
897 111, 68, 49, 76, 77, 45, 99, 100, 101, 45,
898 96, 97, 85, 47, 102, 103, 105, 14, 69, 70,
899 71, 73, 67, 74, 88, 89, 88, 90, 104, 103,
900 106, 108, 109, 45, 95, 85, 111, 111, 62, 65,
901 66, 105, 65, 0, 103, 106, 107, 106, 46, 47,
902 48, 107, 107, 105, 48, 50, 75, 85, 44, 45,
903 43, 100, 79, 85, 98, 43, 96, 43, 43, 102,
904 105, 71, 43, 43, 108, 85, 43, 45, 43, 106,
905 106, 106, 110, 106, 76, 106, 79, 85, 44, 106,
906 85, 69, 78, 79, 79, 72, 73, 16, 80, 81,
907 82, 104, 106, 21, 83, 82, 106, 85, 85, 22,
911 #define yyerrok (yyerrstatus = 0)
912 #define yyclearin (yychar = YYEMPTY)
916 #define YYACCEPT goto yyacceptlab
917 #define YYABORT goto yyabortlab
918 #define YYERROR goto yyerrorlab
921 /* Like YYERROR except do call yyerror. This remains here temporarily
922 to ease the transition to the new meaning of YYERROR, for GCC.
923 Once GCC version 2 has supplanted version 1, this can go. However,
924 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
925 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
928 #define YYFAIL goto yyerrlab
930 /* This is here to suppress warnings from the GCC cpp's
931 -Wunused-macros. Normally we don't worry about that warning, but
932 some users do, and we want to make it easy for users to remove
933 YYFAIL uses, which will produce warnings from Bison 2.5. */
936 #define YYRECOVERING() (!!yyerrstatus)
938 #define YYBACKUP(Token, Value) \
940 if (yychar == YYEMPTY && yylen == 1) \
949 yyerror (YY_("syntax error: cannot back up")); \
956 #define YYERRCODE 256
959 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
960 If N is 0, then set CURRENT to the empty location which ends
961 the previous symbol: RHS[0] (always defined). */
963 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
964 #ifndef YYLLOC_DEFAULT
965 # define YYLLOC_DEFAULT(Current, Rhs, N) \
969 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
970 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
971 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
972 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
976 (Current).first_line = (Current).last_line = \
977 YYRHSLOC (Rhs, 0).last_line; \
978 (Current).first_column = (Current).last_column = \
979 YYRHSLOC (Rhs, 0).last_column; \
985 /* YY_LOCATION_PRINT -- Print the location on the stream.
986 This macro was not mandated originally: define only if we know
987 we won't break user code: when these are the locations we know. */
989 #ifndef YY_LOCATION_PRINT
990 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
991 # define YY_LOCATION_PRINT(File, Loc) \
992 fprintf (File, "%d.%d-%d.%d", \
993 (Loc).first_line, (Loc).first_column, \
994 (Loc).last_line, (Loc).last_column)
996 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1001 /* YYLEX -- calling `yylex' with the right arguments. */
1004 # define YYLEX yylex (YYLEX_PARAM)
1006 # define YYLEX yylex ()
1009 /* Enable debugging if requested. */
1013 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1014 # define YYFPRINTF fprintf
1017 # define YYDPRINTF(Args) \
1023 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1027 YYFPRINTF (stderr, "%s ", Title); \
1028 yy_symbol_print (stderr, \
1029 Type, Value, Location); \
1030 YYFPRINTF (stderr, "\n"); \
1035 /*--------------------------------.
1036 | Print this symbol on YYOUTPUT. |
1037 `--------------------------------*/
1040 #if (defined __STDC__ || defined __C99__FUNC__ \
1041 || defined __cplusplus || defined _MSC_VER)
1043 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1046 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1049 YYSTYPE
const * const yyvaluep
;
1050 YYLTYPE
const * const yylocationp
;
1055 YYUSE (yylocationp
);
1057 if (yytype
< YYNTOKENS
)
1058 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1070 /*--------------------------------.
1071 | Print this symbol on YYOUTPUT. |
1072 `--------------------------------*/
1074 #if (defined __STDC__ || defined __C99__FUNC__ \
1075 || defined __cplusplus || defined _MSC_VER)
1077 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
)
1080 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1083 YYSTYPE
const * const yyvaluep
;
1084 YYLTYPE
const * const yylocationp
;
1087 if (yytype
< YYNTOKENS
)
1088 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1090 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1092 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1093 YYFPRINTF (yyoutput
, ": ");
1094 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
);
1095 YYFPRINTF (yyoutput
, ")");
1098 /*------------------------------------------------------------------.
1099 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1101 `------------------------------------------------------------------*/
1103 #if (defined __STDC__ || defined __C99__FUNC__ \
1104 || defined __cplusplus || defined _MSC_VER)
1106 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1109 yy_stack_print (yybottom
, yytop
)
1110 yytype_int16
*yybottom
;
1111 yytype_int16
*yytop
;
1114 YYFPRINTF (stderr
, "Stack now");
1115 for (; yybottom
<= yytop
; yybottom
++)
1117 int yybot
= *yybottom
;
1118 YYFPRINTF (stderr
, " %d", yybot
);
1120 YYFPRINTF (stderr
, "\n");
1123 # define YY_STACK_PRINT(Bottom, Top) \
1126 yy_stack_print ((Bottom), (Top)); \
1130 /*------------------------------------------------.
1131 | Report that the YYRULE is going to be reduced. |
1132 `------------------------------------------------*/
1134 #if (defined __STDC__ || defined __C99__FUNC__ \
1135 || defined __cplusplus || defined _MSC_VER)
1137 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
)
1140 yy_reduce_print (yyvsp
, yylsp
, yyrule
)
1146 int yynrhs
= yyr2
[yyrule
];
1148 unsigned long int yylno
= yyrline
[yyrule
];
1149 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1151 /* The symbols being reduced. */
1152 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1154 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1155 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1156 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1157 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) );
1158 YYFPRINTF (stderr
, "\n");
1162 # define YY_REDUCE_PRINT(Rule) \
1165 yy_reduce_print (yyvsp, yylsp, Rule); \
1168 /* Nonzero means print parse trace. It is left uninitialized so that
1169 multiple parsers can coexist. */
1171 #else /* !YYDEBUG */
1172 # define YYDPRINTF(Args)
1173 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1174 # define YY_STACK_PRINT(Bottom, Top)
1175 # define YY_REDUCE_PRINT(Rule)
1176 #endif /* !YYDEBUG */
1179 /* YYINITDEPTH -- initial size of the parser's stacks. */
1181 # define YYINITDEPTH 200
1184 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1185 if the built-in stack extension method is used).
1187 Do not make this value too large; the results are undefined if
1188 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1189 evaluated with infinite-precision integer arithmetic. */
1192 # define YYMAXDEPTH 10000
1199 # if defined __GLIBC__ && defined _STRING_H
1200 # define yystrlen strlen
1202 /* Return the length of YYSTR. */
1203 #if (defined __STDC__ || defined __C99__FUNC__ \
1204 || defined __cplusplus || defined _MSC_VER)
1206 yystrlen (const char *yystr
)
1214 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1222 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1223 # define yystpcpy stpcpy
1225 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1227 #if (defined __STDC__ || defined __C99__FUNC__ \
1228 || defined __cplusplus || defined _MSC_VER)
1230 yystpcpy (char *yydest
, const char *yysrc
)
1233 yystpcpy (yydest
, yysrc
)
1239 const char *yys
= yysrc
;
1241 while ((*yyd
++ = *yys
++) != '\0')
1250 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1251 quotes and backslashes, so that it's suitable for yyerror. The
1252 heuristic is that double-quoting is unnecessary unless the string
1253 contains an apostrophe, a comma, or backslash (other than
1254 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1255 null, do not copy; instead, return the length of what the result
1258 yytnamerr (char *yyres
, const char *yystr
)
1263 char const *yyp
= yystr
;
1270 goto do_not_strip_quotes
;
1274 goto do_not_strip_quotes
;
1287 do_not_strip_quotes
: ;
1291 return yystrlen (yystr
);
1293 return yystpcpy (yyres
, yystr
) - yyres
;
1297 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1298 about the unexpected token YYTOKEN for the state stack whose top is
1301 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1302 not large enough to hold the message. In that case, also set
1303 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1304 required number of bytes is too large to store. */
1306 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1307 yytype_int16
*yyssp
, int yytoken
)
1309 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytoken
]);
1310 YYSIZE_T yysize
= yysize0
;
1312 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1313 /* Internationalized format string. */
1314 const char *yyformat
= 0;
1315 /* Arguments of yyformat. */
1316 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1317 /* Number of reported tokens (one for the "unexpected", one per
1321 /* There are many possibilities here to consider:
1322 - Assume YYFAIL is not used. It's too flawed to consider. See
1323 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1324 for details. YYERROR is fine as it does not invoke this
1326 - If this state is a consistent state with a default action, then
1327 the only way this function was invoked is if the default action
1328 is an error action. In that case, don't check for expected
1329 tokens because there are none.
1330 - The only way there can be no lookahead present (in yychar) is if
1331 this state is a consistent state with a default action. Thus,
1332 detecting the absence of a lookahead is sufficient to determine
1333 that there is no unexpected or expected token to report. In that
1334 case, just report a simple "syntax error".
1335 - Don't assume there isn't a lookahead just because this state is a
1336 consistent state with a default action. There might have been a
1337 previous inconsistent state, consistent state with a non-default
1338 action, or user semantic action that manipulated yychar.
1339 - Of course, the expected token list depends on states to have
1340 correct lookahead information, and it depends on the parser not
1341 to perform extra reductions after fetching a lookahead from the
1342 scanner and before detecting a syntax error. Thus, state merging
1343 (from LALR or IELR) and default reductions corrupt the expected
1344 token list. However, the list is correct for canonical LR with
1345 one exception: it will still contain any token that will not be
1346 accepted due to an error action in a later state.
1348 if (yytoken
!= YYEMPTY
)
1350 int yyn
= yypact
[*yyssp
];
1351 yyarg
[yycount
++] = yytname
[yytoken
];
1352 if (!yypact_value_is_default (yyn
))
1354 /* Start YYX at -YYN if negative to avoid negative indexes in
1355 YYCHECK. In other words, skip the first -YYN actions for
1356 this state because they are default actions. */
1357 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1358 /* Stay within bounds of both yycheck and yytname. */
1359 int yychecklim
= YYLAST
- yyn
+ 1;
1360 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1363 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1364 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
1365 && !yytable_value_is_error (yytable
[yyx
+ yyn
]))
1367 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1373 yyarg
[yycount
++] = yytname
[yyx
];
1374 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1375 if (! (yysize
<= yysize1
1376 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1385 # define YYCASE_(N, S) \
1389 YYCASE_(0, YY_("syntax error"));
1390 YYCASE_(1, YY_("syntax error, unexpected %s"));
1391 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1392 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1393 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1394 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1398 yysize1
= yysize
+ yystrlen (yyformat
);
1399 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1403 if (*yymsg_alloc
< yysize
)
1405 *yymsg_alloc
= 2 * yysize
;
1406 if (! (yysize
<= *yymsg_alloc
1407 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1408 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1412 /* Avoid sprintf, as that infringes on the user's name space.
1413 Don't have undefined behavior even if the translation
1414 produced a string with the wrong number of "%s"s. */
1418 while ((*yyp
= *yyformat
) != '\0')
1419 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1421 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1432 #endif /* YYERROR_VERBOSE */
1434 /*-----------------------------------------------.
1435 | Release the memory associated to this symbol. |
1436 `-----------------------------------------------*/
1439 #if (defined __STDC__ || defined __C99__FUNC__ \
1440 || defined __cplusplus || defined _MSC_VER)
1442 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1445 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1449 YYLTYPE
*yylocationp
;
1453 YYUSE (yylocationp
);
1457 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1461 case 46: /* "\"text\"" */
1463 /* Line 1391 of yacc.c */
1465 { free((yyvaluep
->str
)); };
1467 /* Line 1391 of yacc.c */
1468 #line 1469 "SCDoc.tab.cpp"
1470 case 47: /* "URL" */
1472 /* Line 1391 of yacc.c */
1474 { free((yyvaluep
->str
)); };
1476 /* Line 1391 of yacc.c */
1477 #line 1478 "SCDoc.tab.cpp"
1479 case 48: /* "COMMA" */
1481 /* Line 1391 of yacc.c */
1483 { free((yyvaluep
->str
)); };
1485 /* Line 1391 of yacc.c */
1486 #line 1487 "SCDoc.tab.cpp"
1488 case 49: /* "\"method name\"" */
1490 /* Line 1391 of yacc.c */
1492 { free((yyvaluep
->str
)); };
1494 /* Line 1391 of yacc.c */
1495 #line 1496 "SCDoc.tab.cpp"
1497 case 50: /* "\"arguments string\"" */
1499 /* Line 1391 of yacc.c */
1501 { free((yyvaluep
->str
)); };
1503 /* Line 1391 of yacc.c */
1504 #line 1505 "SCDoc.tab.cpp"
1506 case 59: /* "document" */
1508 /* Line 1391 of yacc.c */
1510 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1512 /* Line 1391 of yacc.c */
1513 #line 1514 "SCDoc.tab.cpp"
1515 case 61: /* "dochead" */
1517 /* Line 1391 of yacc.c */
1519 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1521 /* Line 1391 of yacc.c */
1522 #line 1523 "SCDoc.tab.cpp"
1524 case 62: /* "headline" */
1526 /* Line 1391 of yacc.c */
1528 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1530 /* Line 1391 of yacc.c */
1531 #line 1532 "SCDoc.tab.cpp"
1533 case 65: /* "optsections" */
1535 /* Line 1391 of yacc.c */
1537 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1539 /* Line 1391 of yacc.c */
1540 #line 1541 "SCDoc.tab.cpp"
1542 case 66: /* "sections" */
1544 /* Line 1391 of yacc.c */
1546 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1548 /* Line 1391 of yacc.c */
1549 #line 1550 "SCDoc.tab.cpp"
1551 case 67: /* "section" */
1553 /* Line 1391 of yacc.c */
1555 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1557 /* Line 1391 of yacc.c */
1558 #line 1559 "SCDoc.tab.cpp"
1560 case 69: /* "optsubsections" */
1562 /* Line 1391 of yacc.c */
1564 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1566 /* Line 1391 of yacc.c */
1567 #line 1568 "SCDoc.tab.cpp"
1569 case 70: /* "subsections" */
1571 /* Line 1391 of yacc.c */
1573 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1575 /* Line 1391 of yacc.c */
1576 #line 1577 "SCDoc.tab.cpp"
1578 case 71: /* "subsection" */
1580 /* Line 1391 of yacc.c */
1582 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1584 /* Line 1391 of yacc.c */
1585 #line 1586 "SCDoc.tab.cpp"
1587 case 72: /* "optsubsubsections" */
1589 /* Line 1391 of yacc.c */
1591 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1593 /* Line 1391 of yacc.c */
1594 #line 1595 "SCDoc.tab.cpp"
1596 case 73: /* "subsubsections" */
1598 /* Line 1391 of yacc.c */
1600 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1602 /* Line 1391 of yacc.c */
1603 #line 1604 "SCDoc.tab.cpp"
1605 case 74: /* "subsubsection" */
1607 /* Line 1391 of yacc.c */
1609 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1611 /* Line 1391 of yacc.c */
1612 #line 1613 "SCDoc.tab.cpp"
1614 case 75: /* "optMETHODARGS" */
1616 /* Line 1391 of yacc.c */
1618 { free((yyvaluep
->str
)); };
1620 /* Line 1391 of yacc.c */
1621 #line 1622 "SCDoc.tab.cpp"
1623 case 76: /* "methodname" */
1625 /* Line 1391 of yacc.c */
1627 { free((yyvaluep
->str
)); };
1629 /* Line 1391 of yacc.c */
1630 #line 1631 "SCDoc.tab.cpp"
1632 case 77: /* "methnames" */
1634 /* Line 1391 of yacc.c */
1636 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1638 /* Line 1391 of yacc.c */
1639 #line 1640 "SCDoc.tab.cpp"
1641 case 78: /* "methodbody" */
1643 /* Line 1391 of yacc.c */
1645 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1647 /* Line 1391 of yacc.c */
1648 #line 1649 "SCDoc.tab.cpp"
1650 case 79: /* "optbody" */
1652 /* Line 1391 of yacc.c */
1654 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1656 /* Line 1391 of yacc.c */
1657 #line 1658 "SCDoc.tab.cpp"
1659 case 80: /* "optargs" */
1661 /* Line 1391 of yacc.c */
1663 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1665 /* Line 1391 of yacc.c */
1666 #line 1667 "SCDoc.tab.cpp"
1668 case 81: /* "args" */
1670 /* Line 1391 of yacc.c */
1672 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1674 /* Line 1391 of yacc.c */
1675 #line 1676 "SCDoc.tab.cpp"
1677 case 82: /* "arg" */
1679 /* Line 1391 of yacc.c */
1681 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1683 /* Line 1391 of yacc.c */
1684 #line 1685 "SCDoc.tab.cpp"
1686 case 83: /* "optreturns" */
1688 /* Line 1391 of yacc.c */
1690 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1692 /* Line 1391 of yacc.c */
1693 #line 1694 "SCDoc.tab.cpp"
1695 case 84: /* "optdiscussion" */
1697 /* Line 1391 of yacc.c */
1699 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1701 /* Line 1391 of yacc.c */
1702 #line 1703 "SCDoc.tab.cpp"
1704 case 85: /* "body" */
1706 /* Line 1391 of yacc.c */
1708 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1710 /* Line 1391 of yacc.c */
1711 #line 1712 "SCDoc.tab.cpp"
1713 case 86: /* "blockA" */
1715 /* Line 1391 of yacc.c */
1717 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1719 /* Line 1391 of yacc.c */
1720 #line 1721 "SCDoc.tab.cpp"
1722 case 87: /* "blockB" */
1724 /* Line 1391 of yacc.c */
1726 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1728 /* Line 1391 of yacc.c */
1729 #line 1730 "SCDoc.tab.cpp"
1731 case 88: /* "bodyelem" */
1733 /* Line 1391 of yacc.c */
1735 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1737 /* Line 1391 of yacc.c */
1738 #line 1739 "SCDoc.tab.cpp"
1740 case 89: /* "prose" */
1742 /* Line 1391 of yacc.c */
1744 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1746 /* Line 1391 of yacc.c */
1747 #line 1748 "SCDoc.tab.cpp"
1749 case 90: /* "proseelem" */
1751 /* Line 1391 of yacc.c */
1753 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1755 /* Line 1391 of yacc.c */
1756 #line 1757 "SCDoc.tab.cpp"
1758 case 95: /* "listbody" */
1760 /* Line 1391 of yacc.c */
1762 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1764 /* Line 1391 of yacc.c */
1765 #line 1766 "SCDoc.tab.cpp"
1767 case 96: /* "tablerow" */
1769 /* Line 1391 of yacc.c */
1771 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1773 /* Line 1391 of yacc.c */
1774 #line 1775 "SCDoc.tab.cpp"
1776 case 97: /* "tablebody" */
1778 /* Line 1391 of yacc.c */
1780 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1782 /* Line 1391 of yacc.c */
1783 #line 1784 "SCDoc.tab.cpp"
1785 case 98: /* "tablecells" */
1787 /* Line 1391 of yacc.c */
1789 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1791 /* Line 1391 of yacc.c */
1792 #line 1793 "SCDoc.tab.cpp"
1794 case 99: /* "defterms" */
1796 /* Line 1391 of yacc.c */
1798 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1800 /* Line 1391 of yacc.c */
1801 #line 1802 "SCDoc.tab.cpp"
1803 case 100: /* "deflistrow" */
1805 /* Line 1391 of yacc.c */
1807 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1809 /* Line 1391 of yacc.c */
1810 #line 1811 "SCDoc.tab.cpp"
1812 case 101: /* "deflistbody" */
1814 /* Line 1391 of yacc.c */
1816 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1818 /* Line 1391 of yacc.c */
1819 #line 1820 "SCDoc.tab.cpp"
1821 case 102: /* "anywordurl" */
1823 /* Line 1391 of yacc.c */
1825 { free((yyvaluep
->str
)); };
1827 /* Line 1391 of yacc.c */
1828 #line 1829 "SCDoc.tab.cpp"
1830 case 103: /* "anyword" */
1832 /* Line 1391 of yacc.c */
1834 { free((yyvaluep
->str
)); };
1836 /* Line 1391 of yacc.c */
1837 #line 1838 "SCDoc.tab.cpp"
1839 case 104: /* "words" */
1841 /* Line 1391 of yacc.c */
1843 { free((yyvaluep
->str
)); };
1845 /* Line 1391 of yacc.c */
1846 #line 1847 "SCDoc.tab.cpp"
1848 case 105: /* "words2" */
1850 /* Line 1391 of yacc.c */
1852 { free((yyvaluep
->str
)); };
1854 /* Line 1391 of yacc.c */
1855 #line 1856 "SCDoc.tab.cpp"
1857 case 108: /* "anywordnl" */
1859 /* Line 1391 of yacc.c */
1861 { free((yyvaluep
->str
)); };
1863 /* Line 1391 of yacc.c */
1864 #line 1865 "SCDoc.tab.cpp"
1866 case 109: /* "wordsnl" */
1868 /* Line 1391 of yacc.c */
1870 { free((yyvaluep
->str
)); };
1872 /* Line 1391 of yacc.c */
1873 #line 1874 "SCDoc.tab.cpp"
1875 case 110: /* "nocommawords" */
1877 /* Line 1391 of yacc.c */
1879 { free((yyvaluep
->str
)); };
1881 /* Line 1391 of yacc.c */
1882 #line 1883 "SCDoc.tab.cpp"
1884 case 111: /* "commalist" */
1886 /* Line 1391 of yacc.c */
1888 { doc_node_free_tree((yyvaluep
->doc_node
)); };
1890 /* Line 1391 of yacc.c */
1891 #line 1892 "SCDoc.tab.cpp"
1900 /* Prevent warnings from -Wmissing-prototypes. */
1901 #ifdef YYPARSE_PARAM
1902 #if defined __STDC__ || defined __cplusplus
1903 int yyparse (void *YYPARSE_PARAM
);
1907 #else /* ! YYPARSE_PARAM */
1908 #if defined __STDC__ || defined __cplusplus
1913 #endif /* ! YYPARSE_PARAM */
1916 /* The lookahead symbol. */
1919 /* The semantic value of the lookahead symbol. */
1922 /* Location data for the lookahead symbol. */
1925 /* Number of syntax errors so far. */
1933 #ifdef YYPARSE_PARAM
1934 #if (defined __STDC__ || defined __C99__FUNC__ \
1935 || defined __cplusplus || defined _MSC_VER)
1937 yyparse (void *YYPARSE_PARAM
)
1940 yyparse (YYPARSE_PARAM
)
1941 void *YYPARSE_PARAM
;
1943 #else /* ! YYPARSE_PARAM */
1944 #if (defined __STDC__ || defined __C99__FUNC__ \
1945 || defined __cplusplus || defined _MSC_VER)
1956 /* Number of tokens to shift before error messages enabled. */
1959 /* The stacks and their tools:
1960 `yyss': related to states.
1961 `yyvs': related to semantic values.
1962 `yyls': related to locations.
1964 Refer to the stacks thru separate pointers, to allow yyoverflow
1965 to reallocate them elsewhere. */
1967 /* The state stack. */
1968 yytype_int16 yyssa
[YYINITDEPTH
];
1970 yytype_int16
*yyssp
;
1972 /* The semantic value stack. */
1973 YYSTYPE yyvsa
[YYINITDEPTH
];
1977 /* The location stack. */
1978 YYLTYPE yylsa
[YYINITDEPTH
];
1982 /* The locations where the error started and ended. */
1983 YYLTYPE yyerror_range
[3];
1985 YYSIZE_T yystacksize
;
1989 /* Lookahead token as an internal (translated) token number. */
1991 /* The variables used to return semantic value and location from the
1997 /* Buffer for error messages, and its allocated size. */
1999 char *yymsg
= yymsgbuf
;
2000 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
2003 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
2005 /* The number of symbols on the RHS of the reduced rule.
2006 Keep to zero when no symbol should be popped. */
2013 yystacksize
= YYINITDEPTH
;
2015 YYDPRINTF ((stderr
, "Starting parse\n"));
2020 yychar
= YYEMPTY
; /* Cause a token to be read. */
2022 /* Initialize stack pointers.
2023 Waste one element of value and location stack
2024 so that they stay on the same level as the state stack.
2025 The wasted elements are never initialized. */
2030 #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
2031 /* Initialize the default location before parsing starts. */
2032 yylloc
.first_line
= yylloc
.last_line
= 1;
2033 yylloc
.first_column
= yylloc
.last_column
= 1;
2038 /*------------------------------------------------------------.
2039 | yynewstate -- Push a new state, which is found in yystate. |
2040 `------------------------------------------------------------*/
2042 /* In all cases, when you get here, the value and location stacks
2043 have just been pushed. So pushing a state here evens the stacks. */
2049 if (yyss
+ yystacksize
- 1 <= yyssp
)
2051 /* Get the current used size of the three stacks, in elements. */
2052 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
2056 /* Give user a chance to reallocate the stack. Use copies of
2057 these so that the &'s don't force the real ones into
2059 YYSTYPE
*yyvs1
= yyvs
;
2060 yytype_int16
*yyss1
= yyss
;
2061 YYLTYPE
*yyls1
= yyls
;
2063 /* Each stack pointer address is followed by the size of the
2064 data in use in that stack, in bytes. This used to be a
2065 conditional around just the two extra args, but that might
2066 be undefined if yyoverflow is a macro. */
2067 yyoverflow (YY_("memory exhausted"),
2068 &yyss1
, yysize
* sizeof (*yyssp
),
2069 &yyvs1
, yysize
* sizeof (*yyvsp
),
2070 &yyls1
, yysize
* sizeof (*yylsp
),
2077 #else /* no yyoverflow */
2078 # ifndef YYSTACK_RELOCATE
2079 goto yyexhaustedlab
;
2081 /* Extend the stack our own way. */
2082 if (YYMAXDEPTH
<= yystacksize
)
2083 goto yyexhaustedlab
;
2085 if (YYMAXDEPTH
< yystacksize
)
2086 yystacksize
= YYMAXDEPTH
;
2089 yytype_int16
*yyss1
= yyss
;
2090 union yyalloc
*yyptr
=
2091 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
2093 goto yyexhaustedlab
;
2094 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
2095 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
2096 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
2097 # undef YYSTACK_RELOCATE
2099 YYSTACK_FREE (yyss1
);
2102 #endif /* no yyoverflow */
2104 yyssp
= yyss
+ yysize
- 1;
2105 yyvsp
= yyvs
+ yysize
- 1;
2106 yylsp
= yyls
+ yysize
- 1;
2108 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
2109 (unsigned long int) yystacksize
));
2111 if (yyss
+ yystacksize
- 1 <= yyssp
)
2115 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
2117 if (yystate
== YYFINAL
)
2127 /* Do appropriate processing given the current state. Read a
2128 lookahead token if we need one and don't already have one. */
2130 /* First try to decide what to do without reference to lookahead token. */
2131 yyn
= yypact
[yystate
];
2132 if (yypact_value_is_default (yyn
))
2135 /* Not known => get a lookahead token if don't already have one. */
2137 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2138 if (yychar
== YYEMPTY
)
2140 YYDPRINTF ((stderr
, "Reading a token: "));
2144 if (yychar
<= YYEOF
)
2146 yychar
= yytoken
= YYEOF
;
2147 YYDPRINTF ((stderr
, "Now at end of input.\n"));
2151 yytoken
= YYTRANSLATE (yychar
);
2152 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
2155 /* If the proper action on seeing token YYTOKEN is to reduce or to
2156 detect an error, take that action. */
2158 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
2163 if (yytable_value_is_error (yyn
))
2169 /* Count tokens shifted since error; after three, turn off error
2174 /* Shift the lookahead token. */
2175 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
2177 /* Discard the shifted token. */
2186 /*-----------------------------------------------------------.
2187 | yydefault -- do the default action for the current state. |
2188 `-----------------------------------------------------------*/
2190 yyn
= yydefact
[yystate
];
2196 /*-----------------------------.
2197 | yyreduce -- Do a reduction. |
2198 `-----------------------------*/
2200 /* yyn is the number of a rule to reduce with. */
2203 /* If YYLEN is nonzero, implement the default value of the action:
2206 Otherwise, the following line sets YYVAL to garbage.
2207 This behavior is undocumented and Bison
2208 users should not rely upon it. Assigning to YYVAL
2209 unconditionally makes the parser a bit smaller, and it avoids a
2210 GCC warning that YYVAL may be used uninitialized. */
2211 yyval
= yyvsp
[1-yylen
];
2213 /* Default location. */
2214 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
2215 YY_REDUCE_PRINT (yyn
);
2220 /* Line 1806 of yacc.c */
2222 { topnode
= (yyvsp
[(1) - (1)].doc_node
); }
2227 /* Line 1806 of yacc.c */
2229 { topnode
= NULL
; doc_node_free_tree((yyvsp
[(1) - (2)].doc_node
)); }
2234 /* Line 1806 of yacc.c */
2237 (yyval
.doc_node
) = doc_node_create("DOCUMENT");
2238 doc_node_add_child((yyval
.doc_node
), (yyvsp
[(3) - (4)].doc_node
));
2239 doc_node_add_child((yyval
.doc_node
), (yyvsp
[(4) - (4)].doc_node
));
2245 /* Line 1806 of yacc.c */
2248 (yyval
.doc_node
) = doc_node_make_take_children("BODY",NULL
,(yyvsp
[(2) - (2)].doc_node
));
2254 /* Line 1806 of yacc.c */
2257 (yyval
.doc_node
) = doc_node_create("DOCUMENT");
2258 doc_node_add_child((yyval
.doc_node
), (yyvsp
[(2) - (3)].doc_node
));
2259 doc_node_add_child((yyval
.doc_node
), (yyvsp
[(3) - (3)].doc_node
));
2265 /* Line 1806 of yacc.c */
2267 { (yyval
.doc_node
) = doc_node_add_child((yyvsp
[(1) - (2)].doc_node
),(yyvsp
[(2) - (2)].doc_node
)); }
2272 /* Line 1806 of yacc.c */
2274 { (yyval
.doc_node
) = doc_node_make("HEADER",NULL
,(yyvsp
[(1) - (1)].doc_node
)); }
2279 /* Line 1806 of yacc.c */
2281 { (yyval
.doc_node
) = doc_node_make((yyvsp
[(1) - (3)].id
),(yyvsp
[(2) - (3)].str
),NULL
); }
2286 /* Line 1806 of yacc.c */
2288 { (yyval
.doc_node
) = doc_node_make_take_children("CATEGORIES",NULL
,(yyvsp
[(2) - (3)].doc_node
)); }
2293 /* Line 1806 of yacc.c */
2295 { (yyval
.doc_node
) = doc_node_make_take_children("RELATED",NULL
,(yyvsp
[(2) - (3)].doc_node
)); }
2300 /* Line 1806 of yacc.c */
2302 { (yyval
.id
) = "TITLE"; }
2307 /* Line 1806 of yacc.c */
2309 { (yyval
.id
) = "TITLE"; }
2314 /* Line 1806 of yacc.c */
2316 { (yyval
.id
) = "SUMMARY"; }
2321 /* Line 1806 of yacc.c */
2323 { (yyval
.id
) = "REDIRECT"; }
2328 /* Line 1806 of yacc.c */
2330 { (yyval
.id
) = "CLASSMETHODS"; method_type
= "CMETHOD"; }
2335 /* Line 1806 of yacc.c */
2337 { (yyval
.id
) = "INSTANCEMETHODS"; method_type
= "IMETHOD"; }
2342 /* Line 1806 of yacc.c */
2344 { (yyval
.id
) = "DESCRIPTION"; method_type
= "METHOD"; }
2349 /* Line 1806 of yacc.c */
2351 { (yyval
.id
) = "EXAMPLES"; method_type
= "METHOD"; }
2356 /* Line 1806 of yacc.c */
2358 { (yyval
.doc_node
) = doc_node_make("BODY",NULL
,NULL
); }
2363 /* Line 1806 of yacc.c */
2365 { (yyval
.doc_node
) = doc_node_add_child((yyvsp
[(1) - (2)].doc_node
),(yyvsp
[(2) - (2)].doc_node
)); }
2370 /* Line 1806 of yacc.c */
2372 { (yyval
.doc_node
) = doc_node_make("BODY",NULL
,(yyvsp
[(1) - (1)].doc_node
)); }
2377 /* Line 1806 of yacc.c */
2379 { (yyval
.doc_node
) = doc_node_make_take_children("BODY",NULL
,(yyvsp
[(1) - (1)].doc_node
)); }
2384 /* Line 1806 of yacc.c */
2386 { method_type
= "METHOD"; }
2391 /* Line 1806 of yacc.c */
2393 { (yyval
.doc_node
) = doc_node_make_take_children("SECTION",(yyvsp
[(3) - (5)].str
),(yyvsp
[(5) - (5)].doc_node
)); }
2398 /* Line 1806 of yacc.c */
2400 { (yyval
.doc_node
) = doc_node_make_take_children((yyvsp
[(1) - (2)].id
), NULL
,(yyvsp
[(2) - (2)].doc_node
)); }
2405 /* Line 1806 of yacc.c */
2407 { (yyval
.doc_node
) = NULL
; }
2412 /* Line 1806 of yacc.c */
2414 { (yyval
.doc_node
) = doc_node_add_child((yyvsp
[(1) - (2)].doc_node
),(yyvsp
[(2) - (2)].doc_node
)); }
2419 /* Line 1806 of yacc.c */
2421 { (yyval
.doc_node
) = doc_node_make("(SUBSECTIONS)",NULL
,(yyvsp
[(1) - (1)].doc_node
)); }
2426 /* Line 1806 of yacc.c */
2428 { (yyval
.doc_node
) = doc_node_make_take_children("SUBSECTION", (yyvsp
[(2) - (4)].str
), (yyvsp
[(4) - (4)].doc_node
)); }
2433 /* Line 1806 of yacc.c */
2435 { (yyval
.doc_node
) = NULL
; }
2440 /* Line 1806 of yacc.c */
2442 { (yyval
.doc_node
) = doc_node_add_child((yyvsp
[(1) - (2)].doc_node
),(yyvsp
[(2) - (2)].doc_node
)); }
2447 /* Line 1806 of yacc.c */
2449 { (yyval
.doc_node
) = doc_node_make("(SUBSUBSECTIONS)",NULL
,(yyvsp
[(1) - (1)].doc_node
)); }
2454 /* Line 1806 of yacc.c */
2456 { (yyval
.doc_node
) = doc_node_make_take_children("(SUBSUBSECTIONS)",NULL
,(yyvsp
[(1) - (1)].doc_node
)); }
2461 /* Line 1806 of yacc.c */
2464 (yyvsp
[(2) - (5)].doc_node
)->id
= "METHODNAMES";
2465 (yyval
.doc_node
) = doc_node_make(method_type
,(yyvsp
[(3) - (5)].str
),(yyvsp
[(2) - (5)].doc_node
));
2466 doc_node_add_child((yyval
.doc_node
), (yyvsp
[(5) - (5)].doc_node
));
2467 // doc_node_add_child($2, $3);
2473 /* Line 1806 of yacc.c */
2475 { (yyval
.doc_node
) = doc_node_make(
2476 stringEqual(method_type
, "CMETHOD") ? "CCOPYMETHOD"
2477 : (stringEqual(method_type
, "IMETHOD") ? "ICOPYMETHOD"
2479 (yyvsp
[(2) - (3)].str
), NULL
2485 /* Line 1806 of yacc.c */
2487 { (yyval
.doc_node
) = doc_node_make_take_children( stringEqual(method_type
, "CMETHOD") ? "CPRIVATE"
2489 NULL
, (yyvsp
[(2) - (3)].doc_node
)); }
2494 /* Line 1806 of yacc.c */
2496 { (yyval
.str
) = NULL
; }
2501 /* Line 1806 of yacc.c */
2504 // $$ = doc_node_make("ARGSTRING",$1,NULL);
2505 (yyval
.str
) = (yyvsp
[(1) - (1)].str
);
2506 if(!stringEqual(method_type
, "METHOD")) {
2507 yyerror("METHOD argument string is not allowed inside CLASSMETHODS or INSTANCEMETHODS");
2515 /* Line 1806 of yacc.c */
2518 char *p
= (yyvsp
[(1) - (1)].str
)+strlen((yyvsp
[(1) - (1)].str
))-1;
2520 post("WARNING: SCDoc: In %s\n Property setter %s should be documented without underscore.\n", scdoc_current_file
, (yyvsp
[(1) - (1)].str
));
2523 (yyval
.str
) = (yyvsp
[(1) - (1)].str
);
2529 /* Line 1806 of yacc.c */
2531 { free((yyvsp
[(2) - (3)].str
)); (yyvsp
[(2) - (3)].str
) = NULL
; (yyval
.doc_node
) = doc_node_add_child((yyvsp
[(1) - (3)].doc_node
), doc_node_make("STRING",(yyvsp
[(3) - (3)].str
),NULL
)); }
2536 /* Line 1806 of yacc.c */
2538 { (yyval
.doc_node
) = doc_node_make("(METHODNAMES)",NULL
,doc_node_make("STRING",(yyvsp
[(1) - (1)].str
),NULL
)); }
2543 /* Line 1806 of yacc.c */
2546 (yyval
.doc_node
) = doc_node_make_take_children("METHODBODY",NULL
,(yyvsp
[(1) - (4)].doc_node
));
2547 doc_node_add_child((yyval
.doc_node
), (yyvsp
[(2) - (4)].doc_node
));
2548 doc_node_add_child((yyval
.doc_node
), (yyvsp
[(3) - (4)].doc_node
));
2549 doc_node_add_child((yyval
.doc_node
), (yyvsp
[(4) - (4)].doc_node
));
2555 /* Line 1806 of yacc.c */
2557 { (yyval
.doc_node
) = NULL
; }
2562 /* Line 1806 of yacc.c */
2564 { (yyval
.doc_node
) = NULL
; }
2569 /* Line 1806 of yacc.c */
2571 { (yyval
.doc_node
) = doc_node_add_child((yyvsp
[(1) - (2)].doc_node
),(yyvsp
[(2) - (2)].doc_node
)); }
2576 /* Line 1806 of yacc.c */
2578 { (yyval
.doc_node
) = doc_node_make("ARGUMENTS",NULL
,(yyvsp
[(1) - (1)].doc_node
)); }
2583 /* Line 1806 of yacc.c */
2585 { (yyval
.doc_node
) = doc_node_make_take_children("ARGUMENT", (yyvsp
[(2) - (4)].str
), (yyvsp
[(4) - (4)].doc_node
)); }
2590 /* Line 1806 of yacc.c */
2592 { (yyval
.doc_node
) = doc_node_make_take_children("ARGUMENT", NULL
, (yyvsp
[(3) - (3)].doc_node
)); }
2597 /* Line 1806 of yacc.c */
2599 { (yyval
.doc_node
) = doc_node_make_take_children("RETURNS",NULL
,(yyvsp
[(2) - (2)].doc_node
)); }
2604 /* Line 1806 of yacc.c */
2606 { (yyval
.doc_node
) = NULL
; }
2611 /* Line 1806 of yacc.c */
2613 { (yyval
.doc_node
) = doc_node_make_take_children("DISCUSSION",NULL
,(yyvsp
[(2) - (2)].doc_node
)); }
2618 /* Line 1806 of yacc.c */
2620 { (yyval
.doc_node
) = NULL
; }
2625 /* Line 1806 of yacc.c */
2627 { (yyval
.doc_node
) = doc_node_add_child((yyvsp
[(1) - (2)].doc_node
),(yyvsp
[(2) - (2)].doc_node
)); }
2632 /* Line 1806 of yacc.c */
2634 { (yyval
.doc_node
) = doc_node_add_child((yyvsp
[(1) - (2)].doc_node
),(yyvsp
[(2) - (2)].doc_node
)); }
2639 /* Line 1806 of yacc.c */
2641 { (yyval
.doc_node
) = doc_node_make("(SECTIONBODY)",NULL
,(yyvsp
[(1) - (1)].doc_node
)); }
2646 /* Line 1806 of yacc.c */
2648 { (yyval
.doc_node
) = doc_node_add_child((yyvsp
[(1) - (2)].doc_node
),(yyvsp
[(2) - (2)].doc_node
)); }
2653 /* Line 1806 of yacc.c */
2655 { (yyval
.doc_node
) = doc_node_make("(SECTIONBODY)",NULL
,(yyvsp
[(1) - (1)].doc_node
)); }
2660 /* Line 1806 of yacc.c */
2662 { (yyval
.doc_node
) = doc_node_make_take_children((yyvsp
[(1) - (3)].id
),NULL
,(yyvsp
[(2) - (3)].doc_node
)); }
2667 /* Line 1806 of yacc.c */
2669 { (yyval
.doc_node
) = doc_node_make_take_children((yyvsp
[(1) - (3)].id
),NULL
,(yyvsp
[(2) - (3)].doc_node
)); }
2674 /* Line 1806 of yacc.c */
2676 { (yyval
.doc_node
) = doc_node_make_take_children("TABLE",NULL
,(yyvsp
[(2) - (3)].doc_node
)); }
2681 /* Line 1806 of yacc.c */
2683 { (yyval
.doc_node
) = doc_node_make_take_children("DEFINITIONLIST",NULL
,(yyvsp
[(2) - (3)].doc_node
)); }
2688 /* Line 1806 of yacc.c */
2690 { (yyval
.doc_node
) = doc_node_make((yyvsp
[(1) - (3)].id
),(yyvsp
[(2) - (3)].str
),NULL
); }
2695 /* Line 1806 of yacc.c */
2697 { (yyval
.doc_node
) = doc_node_make("CLASSTREE",(yyvsp
[(2) - (3)].str
),NULL
); }
2702 /* Line 1806 of yacc.c */
2704 { (yyval
.doc_node
) = doc_node_make_take_children("KEYWORD",NULL
,(yyvsp
[(2) - (3)].doc_node
));
2705 // printf("keyword '%s'\n",$2->children[0]->text);
2711 /* Line 1806 of yacc.c */
2713 { (yyval
.doc_node
) = NULL
; }
2718 /* Line 1806 of yacc.c */
2720 { (yyval
.doc_node
) = doc_node_make("IMAGE",(yyvsp
[(2) - (3)].str
),NULL
); }
2725 /* Line 1806 of yacc.c */
2727 { (yyval
.doc_node
) = doc_node_add_child((yyvsp
[(1) - (2)].doc_node
), (yyvsp
[(2) - (2)].doc_node
)); }
2732 /* Line 1806 of yacc.c */
2734 { (yyval
.doc_node
) = doc_node_make("PROSE",NULL
,(yyvsp
[(1) - (1)].doc_node
)); }
2739 /* Line 1806 of yacc.c */
2741 { (yyval
.doc_node
) = doc_node_make(NODE_TEXT
,(yyvsp
[(1) - (1)].str
),NULL
); }
2746 /* Line 1806 of yacc.c */
2748 { (yyval
.doc_node
) = doc_node_make("LINK",(yyvsp
[(1) - (1)].str
),NULL
); }
2753 /* Line 1806 of yacc.c */
2755 { (yyval
.doc_node
) = doc_node_make((yyvsp
[(1) - (3)].id
),(yyvsp
[(2) - (3)].str
),NULL
); }
2760 /* Line 1806 of yacc.c */
2762 { (yyval
.doc_node
) = doc_node_make_take_children("FOOTNOTE",NULL
,(yyvsp
[(2) - (3)].doc_node
)); }
2767 /* Line 1806 of yacc.c */
2769 { (yyval
.doc_node
) = doc_node_create(NODE_NL
); }
2774 /* Line 1806 of yacc.c */
2776 { (yyval
.id
) = "LINK"; }
2781 /* Line 1806 of yacc.c */
2783 { (yyval
.id
) = "STRONG"; }
2788 /* Line 1806 of yacc.c */
2790 { (yyval
.id
) = "SOFT"; }
2795 /* Line 1806 of yacc.c */
2797 { (yyval
.id
) = "EMPHASIS"; }
2802 /* Line 1806 of yacc.c */
2804 { (yyval
.id
) = "CODE"; }
2809 /* Line 1806 of yacc.c */
2811 { (yyval
.id
) = "TELETYPE"; }
2816 /* Line 1806 of yacc.c */
2818 { (yyval
.id
) = "MATH"; }
2823 /* Line 1806 of yacc.c */
2825 { (yyval
.id
) = "ANCHOR"; }
2830 /* Line 1806 of yacc.c */
2832 { (yyval
.id
) = "CODEBLOCK"; }
2837 /* Line 1806 of yacc.c */
2839 { (yyval
.id
) = "TELETYPEBLOCK"; }
2844 /* Line 1806 of yacc.c */
2846 { (yyval
.id
) = "MATHBLOCK"; }
2851 /* Line 1806 of yacc.c */
2853 { (yyval
.id
) = "LIST"; }
2858 /* Line 1806 of yacc.c */
2860 { (yyval
.id
) = "TREE"; }
2865 /* Line 1806 of yacc.c */
2867 { (yyval
.id
) = "NUMBEREDLIST"; }
2872 /* Line 1806 of yacc.c */
2874 { (yyval
.id
) = "WARNING"; }
2879 /* Line 1806 of yacc.c */
2881 { (yyval
.id
) = "NOTE"; }
2886 /* Line 1806 of yacc.c */
2888 { (yyval
.doc_node
) = doc_node_add_child((yyvsp
[(1) - (3)].doc_node
), doc_node_make_take_children("ITEM",NULL
,(yyvsp
[(3) - (3)].doc_node
))); }
2893 /* Line 1806 of yacc.c */
2895 { (yyval
.doc_node
) = doc_node_make("(LISTBODY)",NULL
, doc_node_make_take_children("ITEM",NULL
,(yyvsp
[(2) - (2)].doc_node
))); }
2900 /* Line 1806 of yacc.c */
2902 { (yyval
.doc_node
) = doc_node_make_take_children("TABROW",NULL
,(yyvsp
[(2) - (2)].doc_node
)); }
2907 /* Line 1806 of yacc.c */
2909 { (yyval
.doc_node
) = doc_node_add_child((yyvsp
[(1) - (2)].doc_node
),(yyvsp
[(2) - (2)].doc_node
)); }
2914 /* Line 1806 of yacc.c */
2916 { (yyval
.doc_node
) = doc_node_make("(TABLEBODY)",NULL
,(yyvsp
[(1) - (1)].doc_node
)); }
2921 /* Line 1806 of yacc.c */
2923 { (yyval
.doc_node
) = doc_node_add_child((yyvsp
[(1) - (3)].doc_node
), doc_node_make_take_children("TABCOL",NULL
,(yyvsp
[(3) - (3)].doc_node
))); }
2928 /* Line 1806 of yacc.c */
2930 { (yyval
.doc_node
) = doc_node_make("(TABLECELLS)",NULL
, doc_node_make_take_children("TABCOL",NULL
,(yyvsp
[(1) - (1)].doc_node
))); }
2935 /* Line 1806 of yacc.c */
2937 { (yyval
.doc_node
) = doc_node_add_child((yyvsp
[(1) - (3)].doc_node
),doc_node_make_take_children("TERM",NULL
,(yyvsp
[(3) - (3)].doc_node
))); }
2942 /* Line 1806 of yacc.c */
2944 { (yyval
.doc_node
) = doc_node_make("(TERMS)",NULL
,doc_node_make_take_children("TERM",NULL
,(yyvsp
[(2) - (2)].doc_node
))); }
2949 /* Line 1806 of yacc.c */
2952 (yyval
.doc_node
) = doc_node_make_take_children("DEFLISTITEM", NULL
, (yyvsp
[(1) - (3)].doc_node
));
2953 doc_node_add_child((yyval
.doc_node
), doc_node_make_take_children("DEFINITION", NULL
, (yyvsp
[(3) - (3)].doc_node
)));
2959 /* Line 1806 of yacc.c */
2961 { (yyval
.doc_node
) = doc_node_add_child((yyvsp
[(1) - (2)].doc_node
),(yyvsp
[(2) - (2)].doc_node
)); }
2966 /* Line 1806 of yacc.c */
2968 { (yyval
.doc_node
) = doc_node_make("(DEFLISTBODY)",NULL
,(yyvsp
[(1) - (1)].doc_node
)); }
2973 /* Line 1806 of yacc.c */
2975 { (yyval
.str
) = strmerge((yyvsp
[(1) - (2)].str
),(yyvsp
[(2) - (2)].str
)); }
2980 /* Line 1806 of yacc.c */
2982 { (yyval
.str
) = strmerge((yyvsp
[(1) - (2)].str
),(yyvsp
[(2) - (2)].str
)); }
2987 /* Line 1806 of yacc.c */
2989 { (yyval
.str
) = strdup("\n"); }
2994 /* Line 1806 of yacc.c */
2996 { (yyval
.str
) = strmerge((yyvsp
[(1) - (2)].str
),(yyvsp
[(2) - (2)].str
)); }
3001 /* Line 1806 of yacc.c */
3003 { (yyval
.str
) = strmerge((yyvsp
[(1) - (2)].str
),(yyvsp
[(2) - (2)].str
)); }
3008 /* Line 1806 of yacc.c */
3010 { (yyval
.str
) = strmerge((yyvsp
[(1) - (2)].str
),(yyvsp
[(2) - (2)].str
)); }
3015 /* Line 1806 of yacc.c */
3017 { free((yyvsp
[(2) - (3)].str
)); (yyvsp
[(2) - (3)].str
)=NULL
; (yyval
.doc_node
) = doc_node_add_child((yyvsp
[(1) - (3)].doc_node
),doc_node_make("STRING",(yyvsp
[(3) - (3)].str
),NULL
)); }
3022 /* Line 1806 of yacc.c */
3024 { (yyval
.doc_node
) = doc_node_make("(COMMALIST)",NULL
,doc_node_make("STRING",(yyvsp
[(1) - (1)].str
),NULL
)); }
3029 /* Line 1806 of yacc.c */
3030 #line 3031 "SCDoc.tab.cpp"
3033 /* User semantic actions sometimes alter yychar, and that requires
3034 that yytoken be updated with the new translation. We take the
3035 approach of translating immediately before every use of yytoken.
3036 One alternative is translating here after every semantic action,
3037 but that translation would be missed if the semantic action invokes
3038 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
3039 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
3040 incorrect destructor might then be invoked immediately. In the
3041 case of YYERROR or YYBACKUP, subsequent parser actions might lead
3042 to an incorrect destructor call or verbose syntax error message
3043 before the lookahead is translated. */
3044 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
3048 YY_STACK_PRINT (yyss
, yyssp
);
3053 /* Now `shift' the result of the reduction. Determine what state
3054 that goes to, based on the state we popped back to and the rule
3055 number reduced by. */
3059 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
3060 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
3061 yystate
= yytable
[yystate
];
3063 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
3068 /*------------------------------------.
3069 | yyerrlab -- here on detecting error |
3070 `------------------------------------*/
3072 /* Make sure we have latest lookahead translation. See comments at
3073 user semantic actions for why this is necessary. */
3074 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
3076 /* If not already recovering from an error, report this error. */
3080 #if ! YYERROR_VERBOSE
3081 yyerror (YY_("syntax error"));
3083 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
3086 char const *yymsgp
= YY_("syntax error");
3087 int yysyntax_error_status
;
3088 yysyntax_error_status
= YYSYNTAX_ERROR
;
3089 if (yysyntax_error_status
== 0)
3091 else if (yysyntax_error_status
== 1)
3093 if (yymsg
!= yymsgbuf
)
3094 YYSTACK_FREE (yymsg
);
3095 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
3099 yymsg_alloc
= sizeof yymsgbuf
;
3100 yysyntax_error_status
= 2;
3104 yysyntax_error_status
= YYSYNTAX_ERROR
;
3109 if (yysyntax_error_status
== 2)
3110 goto yyexhaustedlab
;
3112 # undef YYSYNTAX_ERROR
3116 yyerror_range
[1] = yylloc
;
3118 if (yyerrstatus
== 3)
3120 /* If just tried and failed to reuse lookahead token after an
3121 error, discard it. */
3123 if (yychar
<= YYEOF
)
3125 /* Return failure if at end of input. */
3126 if (yychar
== YYEOF
)
3131 yydestruct ("Error: discarding",
3132 yytoken
, &yylval
, &yylloc
);
3137 /* Else will try to reuse lookahead token after shifting the error
3142 /*---------------------------------------------------.
3143 | yyerrorlab -- error raised explicitly by YYERROR. |
3144 `---------------------------------------------------*/
3147 /* Pacify compilers like GCC when the user code never invokes
3148 YYERROR and the label yyerrorlab therefore never appears in user
3150 if (/*CONSTCOND*/ 0)
3153 yyerror_range
[1] = yylsp
[1-yylen
];
3154 /* Do not reclaim the symbols of the rule which action triggered
3158 YY_STACK_PRINT (yyss
, yyssp
);
3163 /*-------------------------------------------------------------.
3164 | yyerrlab1 -- common code for both syntax error and YYERROR. |
3165 `-------------------------------------------------------------*/
3167 yyerrstatus
= 3; /* Each real token shifted decrements this. */
3171 yyn
= yypact
[yystate
];
3172 if (!yypact_value_is_default (yyn
))
3175 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
3183 /* Pop the current state because it cannot handle the error token. */
3187 yyerror_range
[1] = *yylsp
;
3188 yydestruct ("Error: popping",
3189 yystos
[yystate
], yyvsp
, yylsp
);
3192 YY_STACK_PRINT (yyss
, yyssp
);
3197 yyerror_range
[2] = yylloc
;
3198 /* Using YYLLOC is tempting, but would change the location of
3199 the lookahead. YYLOC is available though. */
3200 YYLLOC_DEFAULT (yyloc
, yyerror_range
, 2);
3203 /* Shift the error token. */
3204 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
3210 /*-------------------------------------.
3211 | yyacceptlab -- YYACCEPT comes here. |
3212 `-------------------------------------*/
3217 /*-----------------------------------.
3218 | yyabortlab -- YYABORT comes here. |
3219 `-----------------------------------*/
3224 #if !defined(yyoverflow) || YYERROR_VERBOSE
3225 /*-------------------------------------------------.
3226 | yyexhaustedlab -- memory exhaustion comes here. |
3227 `-------------------------------------------------*/
3229 yyerror (YY_("memory exhausted"));
3235 if (yychar
!= YYEMPTY
)
3237 /* Make sure we have latest lookahead translation. See comments at
3238 user semantic actions for why this is necessary. */
3239 yytoken
= YYTRANSLATE (yychar
);
3240 yydestruct ("Cleanup: discarding lookahead",
3241 yytoken
, &yylval
, &yylloc
);
3243 /* Do not reclaim the symbols of the rule which action triggered
3244 this YYABORT or YYACCEPT. */
3246 YY_STACK_PRINT (yyss
, yyssp
);
3247 while (yyssp
!= yyss
)
3249 yydestruct ("Cleanup: popping",
3250 yystos
[*yyssp
], yyvsp
, yylsp
);
3255 YYSTACK_FREE (yyss
);
3258 if (yymsg
!= yymsgbuf
)
3259 YYSTACK_FREE (yymsg
);
3261 /* Make sure YYID is used. */
3262 return YYID (yyresult
);
3267 /* Line 2067 of yacc.c */
3271 DocNode
* scdoc_parse_run(int mode
) {
3272 int modes
[] = {START_FULL
, START_PARTIAL
, START_METADATA
};
3273 if(mode
<0 || mode
>=sizeof(modes
)) {
3274 error("scdoc_parse_run(): unknown mode: %d\n",mode
);
3276 scdoc_start_token
= modes
[mode
];
3277 /* scdoc_start_token = START_FULL;
3278 scdoc_metadata_mode = 0;
3279 if(mode==SCDOC_PARSE_PARTIAL) {
3280 scdoc_start_token = START_PARTIAL;
3282 if(mode==SCDOC_PARSE_METADATA) {
3283 scdoc_metadata_mode = 1;
3286 method_type
= "METHOD";
3287 if(scdocparse()!=0) {
3293 void scdocerror(const char *str
)
3295 error("In %s:\n At line %d: %s\n\n",scdoc_current_file
,scdoclineno
,str
);
3297 /* FIXME: this does not work well, since the reported linenumber is often *after* the actual error line
3298 fseek(scdocin, 0, SEEK_SET);
3301 while(line!=scdoclineno && !feof(scdocin)) {
3302 int c = fgetc(scdocin);
3305 txt = fgets(buf, 256, scdocin);
3307 fprintf(stderr," %s\n-------------------\n", txt);