nsgenbind
Loading...
Searching...
No Matches
nsgenbind-parser.c
Go to the documentation of this file.
1/* A Bison parser, made by GNU Bison 3.8.2. */
2
3/* Bison implementation for Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
6 Inc.
7
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <https://www.gnu.org/licenses/>. */
20
21/* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
30
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
33
34/* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
36
37/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
38 especially those whose name start with YY_ or yy_. They are
39 private implementation details that can be changed or removed. */
40
41/* All symbols defined below should begin with yy or YY, to avoid
42 infringing on user name space. This should be done even for local
43 variables, as they might otherwise be expanded by user macros.
44 There are some unavoidable exceptions within include files to
45 define necessary library symbols; they are noted "INFRINGES ON
46 USER NAME SPACE" below. */
47
48/* Identify Bison output, and Bison version. */
49#define YYBISON 30802
50
51/* Bison version string. */
52#define YYBISON_VERSION "3.8.2"
53
54/* Skeleton name. */
55#define YYSKELETON_NAME "yacc.c"
56
57/* Pure parsers. */
58#define YYPURE 1
59
60/* Push parsers. */
61#define YYPUSH 0
62
63/* Pull parsers. */
64#define YYPULL 1
65
66/* Substitute the type names. */
67#define YYSTYPE NSGENBIND_STYPE
68#define YYLTYPE NSGENBIND_LTYPE
69/* Substitute the variable and function names. */
70#define yyparse nsgenbind_parse
71#define yylex nsgenbind_lex
72#define yyerror nsgenbind_error
73#define yydebug nsgenbind_debug
74#define yynerrs nsgenbind_nerrs
75
76
77# ifndef YY_CAST
78# ifdef __cplusplus
79# define YY_CAST(Type, Val) static_cast<Type> (Val)
80# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
81# else
82# define YY_CAST(Type, Val) ((Type) (Val))
83# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
84# endif
85# endif
86# ifndef YY_NULLPTR
87# if defined __cplusplus
88# if 201103L <= __cplusplus
89# define YY_NULLPTR nullptr
90# else
91# define YY_NULLPTR 0
92# endif
93# else
94# define YY_NULLPTR ((void*)0)
95# endif
96# endif
97
98#include "nsgenbind-parser.h"
99/* Symbol kind. */
101{
103 YYSYMBOL_YYEOF = 0, /* "end of file" */
104 YYSYMBOL_YYerror = 1, /* error */
105 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
106 YYSYMBOL_TOK_BINDING = 3, /* TOK_BINDING */
107 YYSYMBOL_TOK_WEBIDL = 4, /* TOK_WEBIDL */
108 YYSYMBOL_TOK_PREFACE = 5, /* TOK_PREFACE */
109 YYSYMBOL_TOK_PROLOGUE = 6, /* TOK_PROLOGUE */
110 YYSYMBOL_TOK_EPILOGUE = 7, /* TOK_EPILOGUE */
111 YYSYMBOL_TOK_POSTFACE = 8, /* TOK_POSTFACE */
112 YYSYMBOL_TOK_CLASS = 9, /* TOK_CLASS */
113 YYSYMBOL_TOK_PRIVATE = 10, /* TOK_PRIVATE */
114 YYSYMBOL_TOK_INTERNAL = 11, /* TOK_INTERNAL */
115 YYSYMBOL_TOK_FLAGS = 12, /* TOK_FLAGS */
116 YYSYMBOL_TOK_TYPE = 13, /* TOK_TYPE */
117 YYSYMBOL_TOK_UNSHARED = 14, /* TOK_UNSHARED */
118 YYSYMBOL_TOK_SHARED = 15, /* TOK_SHARED */
119 YYSYMBOL_TOK_PROPERTY = 16, /* TOK_PROPERTY */
120 YYSYMBOL_TOK_INIT = 17, /* TOK_INIT */
121 YYSYMBOL_TOK_FINI = 18, /* TOK_FINI */
122 YYSYMBOL_TOK_METHOD = 19, /* TOK_METHOD */
123 YYSYMBOL_TOK_GETTER = 20, /* TOK_GETTER */
124 YYSYMBOL_TOK_SETTER = 21, /* TOK_SETTER */
125 YYSYMBOL_TOK_PROTOTYPE = 22, /* TOK_PROTOTYPE */
126 YYSYMBOL_TOK_DBLCOLON = 23, /* TOK_DBLCOLON */
127 YYSYMBOL_TOK_STRUCT = 24, /* TOK_STRUCT */
128 YYSYMBOL_TOK_UNION = 25, /* TOK_UNION */
129 YYSYMBOL_TOK_UNSIGNED = 26, /* TOK_UNSIGNED */
130 YYSYMBOL_TOK_IDENTIFIER = 27, /* TOK_IDENTIFIER */
131 YYSYMBOL_TOK_STRING_LITERAL = 28, /* TOK_STRING_LITERAL */
132 YYSYMBOL_TOK_CCODE_LITERAL = 29, /* TOK_CCODE_LITERAL */
133 YYSYMBOL_30_ = 30, /* ';' */
134 YYSYMBOL_31_ = 31, /* '{' */
135 YYSYMBOL_32_ = 32, /* '}' */
136 YYSYMBOL_33_ = 33, /* '*' */
137 YYSYMBOL_34_ = 34, /* ',' */
138 YYSYMBOL_35_ = 35, /* '(' */
139 YYSYMBOL_36_ = 36, /* ')' */
140 YYSYMBOL_YYACCEPT = 37, /* $accept */
141 YYSYMBOL_Input = 38, /* Input */
142 YYSYMBOL_Statements = 39, /* Statements */
143 YYSYMBOL_Statement = 40, /* Statement */
144 YYSYMBOL_Binding = 41, /* Binding */
145 YYSYMBOL_BindingArgs = 42, /* BindingArgs */
146 YYSYMBOL_BindingArg = 43, /* BindingArg */
147 YYSYMBOL_WebIDL = 44, /* WebIDL */
148 YYSYMBOL_CTypeSpecifier = 45, /* CTypeSpecifier */
149 YYSYMBOL_CType = 46, /* CType */
150 YYSYMBOL_CTypeIdent = 47, /* CTypeIdent */
151 YYSYMBOL_CBlock = 48, /* CBlock */
152 YYSYMBOL_ParameterList = 49, /* ParameterList */
153 YYSYMBOL_Method = 50, /* Method */
154 YYSYMBOL_MethodType = 51, /* MethodType */
155 YYSYMBOL_BindingAndMethodType = 52, /* BindingAndMethodType */
156 YYSYMBOL_MethodName = 53, /* MethodName */
157 YYSYMBOL_MethodDeclarator = 54, /* MethodDeclarator */
158 YYSYMBOL_Class = 55, /* Class */
159 YYSYMBOL_ClassArgs = 56, /* ClassArgs */
160 YYSYMBOL_ClassArg = 57, /* ClassArg */
161 YYSYMBOL_ClassFlags = 58, /* ClassFlags */
162 YYSYMBOL_Modifiers = 59, /* Modifiers */
163 YYSYMBOL_Modifier = 60 /* Modifier */
166
167
168
169/* Unqualified %code blocks. */
170#line 71 "src/nsgenbind-parser.y"
171
172/* parser for the binding generation config file
173 *
174 * This file is part of nsgenbind.
175 * Licensed under the MIT License,
176 * http://www.opensource.org/licenses/mit-license.php
177 * Copyright 2012 Vincent Sanders <vince@netsurf-browser.org>
178 */
179
180#include <stdio.h>
181#include <string.h>
182
183#define YYFPRINTF genbind_fprintf
184#define YY_LOCATION_PRINT(File, Loc) \
185 genbind_fprintf(File, "%d.%d-%d.%d", \
186 (Loc).first_line, (Loc).first_column, \
187 (Loc).last_line, (Loc).last_column)
188
189#include "utils.h"
190#include "nsgenbind-lexer.h"
191#include "webidl-ast.h"
192#include "nsgenbind-ast.h"
193
194static char *errtxt;
195
196static void nsgenbind_error(YYLTYPE *locp,
197 char *filename,
198 struct genbind_node **genbind_ast,
199 const char *str)
200{
201 int errlen;
202
203 UNUSED(genbind_ast);
205
206 errlen = snprintf(NULL, 0, "%s:%d:%s",
207 locp->filename, locp->first_line, str);
208 errtxt = malloc(errlen + 1);
209 snprintf(errtxt, errlen + 1, "%s:%d:%s",
210 locp->filename, locp->first_line, str);
211
212}
213
214static struct genbind_node *
215add_method(struct genbind_node **genbind_ast,
216 long methodtype,
217 struct genbind_node *declarator,
218 char *cdata,
219 long lineno,
220 char *filename)
221{
222 struct genbind_node *res_node;
223 struct genbind_node *method_node;
224 struct genbind_node *class_node;
225 struct genbind_node *cdata_node;
226 struct genbind_node *location_node;
227 char *class_name;
228
229 /* extract the class name from the declarator */
230 class_name = genbind_node_gettext(
234 declarator,
235 NULL,
237 NULL,
239
240 if (cdata == NULL) {
241 cdata_node = declarator;
242 } else {
244 declarator,
245 cdata);
246 }
247
250 cdata_node,
251 lineno),
252 strdup(filename));
253
254 /* generate method node */
256 NULL,
258 location_node,
259 methodtype));
260
261 class_node = genbind_node_find_type_ident(*genbind_ast,
262 NULL,
264 class_name);
265 if (class_node == NULL) {
266 /* no existing class so manufacture one and attach method */
269 method_node,
270 class_name));
271 } else {
272 /* update the existing class */
273
274 /* link member node into class_node */
275 genbind_node_add(class_node, method_node);
276
277 res_node = NULL; /* updating so no need to add a new node */
278 }
279 return res_node;
280}
281
282
283#line 284 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
284
285#ifdef short
286# undef short
287#endif
288
289/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
290 <limits.h> and (if available) <stdint.h> are included
291 so that the code can choose integer types of a good width. */
292
293#ifndef __PTRDIFF_MAX__
294# include <limits.h> /* INFRINGES ON USER NAME SPACE */
295# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
296# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
297# define YY_STDINT_H
298# endif
299#endif
300
301/* Narrow types that promote to a signed type and that can represent a
302 signed or unsigned integer of at least N bits. In tables they can
303 save space and decrease cache pressure. Promoting to a signed type
304 helps avoid bugs in integer arithmetic. */
305
306#ifdef __INT_LEAST8_MAX__
307typedef __INT_LEAST8_TYPE__ yytype_int8;
308#elif defined YY_STDINT_H
309typedef int_least8_t yytype_int8;
310#else
311typedef signed char yytype_int8;
312#endif
313
314#ifdef __INT_LEAST16_MAX__
315typedef __INT_LEAST16_TYPE__ yytype_int16;
316#elif defined YY_STDINT_H
317typedef int_least16_t yytype_int16;
318#else
319typedef short yytype_int16;
320#endif
321
322/* Work around bug in HP-UX 11.23, which defines these macros
323 incorrectly for preprocessor constants. This workaround can likely
324 be removed in 2023, as HPE has promised support for HP-UX 11.23
325 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
326 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
327#ifdef __hpux
328# undef UINT_LEAST8_MAX
329# undef UINT_LEAST16_MAX
330# define UINT_LEAST8_MAX 255
331# define UINT_LEAST16_MAX 65535
332#endif
333
334#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
335typedef __UINT_LEAST8_TYPE__ yytype_uint8;
336#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
337 && UINT_LEAST8_MAX <= INT_MAX)
338typedef uint_least8_t yytype_uint8;
339#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
340typedef unsigned char yytype_uint8;
341#else
342typedef short yytype_uint8;
343#endif
344
345#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
346typedef __UINT_LEAST16_TYPE__ yytype_uint16;
347#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
348 && UINT_LEAST16_MAX <= INT_MAX)
349typedef uint_least16_t yytype_uint16;
350#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
351typedef unsigned short yytype_uint16;
352#else
353typedef int yytype_uint16;
354#endif
355
356#ifndef YYPTRDIFF_T
357# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
358# define YYPTRDIFF_T __PTRDIFF_TYPE__
359# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
360# elif defined PTRDIFF_MAX
361# ifndef ptrdiff_t
362# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
363# endif
364# define YYPTRDIFF_T ptrdiff_t
365# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
366# else
367# define YYPTRDIFF_T long
368# define YYPTRDIFF_MAXIMUM LONG_MAX
369# endif
370#endif
371
372#ifndef YYSIZE_T
373# ifdef __SIZE_TYPE__
374# define YYSIZE_T __SIZE_TYPE__
375# elif defined size_t
376# define YYSIZE_T size_t
377# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
378# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
379# define YYSIZE_T size_t
380# else
381# define YYSIZE_T unsigned
382# endif
383#endif
384
385#define YYSIZE_MAXIMUM \
386 YY_CAST (YYPTRDIFF_T, \
387 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
388 ? YYPTRDIFF_MAXIMUM \
389 : YY_CAST (YYSIZE_T, -1)))
390
391#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
392
393
394/* Stored state numbers (used for stacks). */
396
397/* State numbers in computations. */
398typedef int yy_state_fast_t;
399
400#ifndef YY_
401# if defined YYENABLE_NLS && YYENABLE_NLS
402# if ENABLE_NLS
403# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
404# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
405# endif
406# endif
407# ifndef YY_
408# define YY_(Msgid) Msgid
409# endif
410#endif
411
412
413#ifndef YY_ATTRIBUTE_PURE
414# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
415# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
416# else
417# define YY_ATTRIBUTE_PURE
418# endif
419#endif
420
421#ifndef YY_ATTRIBUTE_UNUSED
422# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
423# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
424# else
425# define YY_ATTRIBUTE_UNUSED
426# endif
427#endif
428
429/* Suppress unused-variable warnings by "using" E. */
430#if ! defined lint || defined __GNUC__
431# define YY_USE(E) ((void) (E))
432#else
433# define YY_USE(E) /* empty */
434#endif
435
436/* Suppress an incorrect diagnostic about yylval being uninitialized. */
437#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
438# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
439# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
440 _Pragma ("GCC diagnostic push") \
441 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
442# else
443# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
444 _Pragma ("GCC diagnostic push") \
445 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
446 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
447# endif
448# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
449 _Pragma ("GCC diagnostic pop")
450#else
451# define YY_INITIAL_VALUE(Value) Value
452#endif
453#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
454# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
455# define YY_IGNORE_MAYBE_UNINITIALIZED_END
456#endif
457#ifndef YY_INITIAL_VALUE
458# define YY_INITIAL_VALUE(Value) /* Nothing. */
459#endif
460
461#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
462# define YY_IGNORE_USELESS_CAST_BEGIN \
463 _Pragma ("GCC diagnostic push") \
464 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
465# define YY_IGNORE_USELESS_CAST_END \
466 _Pragma ("GCC diagnostic pop")
467#endif
468#ifndef YY_IGNORE_USELESS_CAST_BEGIN
469# define YY_IGNORE_USELESS_CAST_BEGIN
470# define YY_IGNORE_USELESS_CAST_END
471#endif
472
473
474#define YY_ASSERT(E) ((void) (0 && (E)))
475
476#if 1
477
478/* The parser invokes alloca or malloc; define the necessary symbols. */
479
480# ifdef YYSTACK_USE_ALLOCA
481# if YYSTACK_USE_ALLOCA
482# ifdef __GNUC__
483# define YYSTACK_ALLOC __builtin_alloca
484# elif defined __BUILTIN_VA_ARG_INCR
485# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
486# elif defined _AIX
487# define YYSTACK_ALLOC __alloca
488# elif defined _MSC_VER
489# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
490# define alloca _alloca
491# else
492# define YYSTACK_ALLOC alloca
493# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
494# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
495 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
496# ifndef EXIT_SUCCESS
497# define EXIT_SUCCESS 0
498# endif
499# endif
500# endif
501# endif
502# endif
503
504# ifdef YYSTACK_ALLOC
505 /* Pacify GCC's 'empty if-body' warning. */
506# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
507# ifndef YYSTACK_ALLOC_MAXIMUM
508 /* The OS might guarantee only one guard page at the bottom of the stack,
509 and a page size can be as small as 4096 bytes. So we cannot safely
510 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
511 to allow for a few compiler-allocated temporary stack slots. */
512# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
513# endif
514# else
515# define YYSTACK_ALLOC YYMALLOC
516# define YYSTACK_FREE YYFREE
517# ifndef YYSTACK_ALLOC_MAXIMUM
518# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
519# endif
520# if (defined __cplusplus && ! defined EXIT_SUCCESS \
521 && ! ((defined YYMALLOC || defined malloc) \
522 && (defined YYFREE || defined free)))
523# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
524# ifndef EXIT_SUCCESS
525# define EXIT_SUCCESS 0
526# endif
527# endif
528# ifndef YYMALLOC
529# define YYMALLOC malloc
530# if ! defined malloc && ! defined EXIT_SUCCESS
531void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
532# endif
533# endif
534# ifndef YYFREE
535# define YYFREE free
536# if ! defined free && ! defined EXIT_SUCCESS
537void free (void *); /* INFRINGES ON USER NAME SPACE */
538# endif
539# endif
540# endif
541#endif /* 1 */
542
543#if (! defined yyoverflow \
544 && (! defined __cplusplus \
545 || (defined NSGENBIND_LTYPE_IS_TRIVIAL && NSGENBIND_LTYPE_IS_TRIVIAL \
546 && defined NSGENBIND_STYPE_IS_TRIVIAL && NSGENBIND_STYPE_IS_TRIVIAL)))
547
548/* A type that is properly aligned for any stack member. */
555
556/* The size of the maximum gap between one aligned stack and the next. */
557# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
558
559/* The size of an array large to enough to hold all stacks, each with
560 N elements. */
561# define YYSTACK_BYTES(N) \
562 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \
563 + YYSIZEOF (YYLTYPE)) \
564 + 2 * YYSTACK_GAP_MAXIMUM)
565
566# define YYCOPY_NEEDED 1
567
568/* Relocate STACK from its old location to the new one. The
569 local variables YYSIZE and YYSTACKSIZE give the old and new number of
570 elements in the stack, and YYPTR gives the new location of the
571 stack. Advance YYPTR to a properly aligned location for the next
572 stack. */
573# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
574 do \
575 { \
576 YYPTRDIFF_T yynewbytes; \
577 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
578 Stack = &yyptr->Stack_alloc; \
579 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
580 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
581 } \
582 while (0)
583
584#endif
585
586#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
587/* Copy COUNT objects from SRC to DST. The source and destination do
588 not overlap. */
589# ifndef YYCOPY
590# if defined __GNUC__ && 1 < __GNUC__
591# define YYCOPY(Dst, Src, Count) \
592 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
593# else
594# define YYCOPY(Dst, Src, Count) \
595 do \
596 { \
597 YYPTRDIFF_T yyi; \
598 for (yyi = 0; yyi < (Count); yyi++) \
599 (Dst)[yyi] = (Src)[yyi]; \
600 } \
601 while (0)
602# endif
603# endif
604#endif /* !YYCOPY_NEEDED */
605
606/* YYFINAL -- State number of the termination state. */
607#define YYFINAL 25
608/* YYLAST -- Last index in YYTABLE. */
609#define YYLAST 134
610
611/* YYNTOKENS -- Number of terminals. */
612#define YYNTOKENS 37
613/* YYNNTS -- Number of nonterminals. */
614#define YYNNTS 24
615/* YYNRULES -- Number of rules. */
616#define YYNRULES 61
617/* YYNSTATES -- Number of states. */
618#define YYNSTATES 104
619
620/* YYMAXUTOK -- Last valid token kind. */
621#define YYMAXUTOK 284
622
623
624/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
625 as returned by yylex, with out-of-bounds checking. */
626#define YYTRANSLATE(YYX) \
627 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
628 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
629 : YYSYMBOL_YYUNDEF)
630
631/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
632 as returned by yylex. */
633static const yytype_int8 yytranslate[] =
634{
635 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
636 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
637 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
638 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
639 35, 36, 33, 2, 34, 2, 2, 2, 2, 2,
640 2, 2, 2, 2, 2, 2, 2, 2, 2, 30,
641 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
642 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
643 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
644 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
645 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
646 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
647 2, 2, 2, 31, 2, 32, 2, 2, 2, 2,
648 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
649 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
650 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
651 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
652 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
653 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
654 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
655 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
656 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
657 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
658 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
659 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
660 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
661 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
662 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
663 25, 26, 27, 28, 29
664};
665
666#if NSGENBIND_DEBUG
667/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
668static const yytype_int16 yyrline[] =
669{
670 0, 259, 259, 266, 268, 273, 282, 284, 286, 290,
671 300, 302, 309, 311, 325, 335, 344, 353, 362, 369,
672 371, 378, 383, 392, 394, 402, 407, 418, 423, 430,
673 435, 440, 445, 450, 455, 460, 464, 469, 474, 479,
674 486, 491, 496, 504, 515, 526, 535, 546, 555, 559,
675 566, 571, 576, 586, 591, 604, 609, 617, 621, 628,
676 633, 638
677};
678#endif
679
681#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
682
683#if 1
684/* The user-facing name of the symbol whose (internal) number is
685 YYSYMBOL. No bounds checking. */
686static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
687
688/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
689 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
690static const char *const yytname[] =
691{
692 "\"end of file\"", "error", "\"invalid token\"", "TOK_BINDING",
693 "TOK_WEBIDL", "TOK_PREFACE", "TOK_PROLOGUE", "TOK_EPILOGUE",
694 "TOK_POSTFACE", "TOK_CLASS", "TOK_PRIVATE", "TOK_INTERNAL", "TOK_FLAGS",
695 "TOK_TYPE", "TOK_UNSHARED", "TOK_SHARED", "TOK_PROPERTY", "TOK_INIT",
696 "TOK_FINI", "TOK_METHOD", "TOK_GETTER", "TOK_SETTER", "TOK_PROTOTYPE",
697 "TOK_DBLCOLON", "TOK_STRUCT", "TOK_UNION", "TOK_UNSIGNED",
698 "TOK_IDENTIFIER", "TOK_STRING_LITERAL", "TOK_CCODE_LITERAL", "';'",
699 "'{'", "'}'", "'*'", "','", "'('", "')'", "$accept", "Input",
700 "Statements", "Statement", "Binding", "BindingArgs", "BindingArg",
701 "WebIDL", "CTypeSpecifier", "CType", "CTypeIdent", "CBlock",
702 "ParameterList", "Method", "MethodType", "BindingAndMethodType",
703 "MethodName", "MethodDeclarator", "Class", "ClassArgs", "ClassArg",
704 "ClassFlags", "Modifiers", "Modifier", YY_NULLPTR
705};
706
707static const char *
708yysymbol_name (yysymbol_kind_t yysymbol)
709{
710 return yytname[yysymbol];
711}
712#endif
713
714#define YYPACT_NINF (-42)
715
716#define yypact_value_is_default(Yyn) \
717 ((Yyn) == YYPACT_NINF)
718
719#define YYTABLE_NINF (-1)
720
721#define yytable_value_is_error(Yyn) \
722 0
723
724/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
725 STATE-NUM. */
726static const yytype_int8 yypact[] =
727{
728 6, -20, 13, -42, -42, -42, -42, 51, -42, -42,
729 -42, -42, -42, -42, 91, 26, -42, -42, -42, 65,
730 -42, -42, -42, 62, 64, -42, -42, -15, 37, 76,
731 63, 38, 28, -42, -42, 67, 66, -2, -42, -42,
732 68, 61, 61, 71, -42, 68, 69, 63, -42, -42,
733 -42, 70, 72, 73, 75, -42, -42, 74, 77, -42,
734 -17, -42, 78, 79, -42, 47, 80, 81, -42, -12,
735 23, 60, 82, -42, 36, -42, -42, -42, -42, 83,
736 61, -42, -42, -42, -42, -42, -42, -42, 86, -42,
737 -42, -42, 84, -42, -42, -42, -42, 22, 88, -42,
738 -42, -42, -42, -42
739};
740
741/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
742 Performed when YYTABLE does not specify something else to do. Zero
743 means the default is an error. */
744static const yytype_int8 yydefact[] =
745{
746 0, 0, 0, 36, 37, 38, 39, 0, 29, 30,
747 31, 32, 33, 34, 0, 2, 3, 6, 8, 0,
748 35, 7, 5, 0, 0, 1, 4, 0, 0, 0,
749 48, 0, 0, 23, 28, 27, 0, 0, 10, 12,
750 0, 0, 0, 0, 57, 0, 0, 48, 42, 41,
751 40, 0, 0, 0, 0, 18, 46, 19, 0, 25,
752 0, 24, 0, 0, 11, 0, 0, 0, 55, 0,
753 0, 0, 0, 49, 0, 16, 17, 15, 20, 21,
754 0, 45, 14, 9, 13, 50, 51, 53, 0, 59,
755 60, 61, 0, 58, 54, 47, 44, 0, 0, 26,
756 56, 52, 43, 22
757};
758
759/* YYPGOTO[NTERM-NUM]. */
760static const yytype_int8 yypgoto[] =
761{
762 -42, -42, -42, 101, -42, -42, 85, -42, -42, -42,
763 -41, -24, 29, -42, -42, 12, -42, -42, -42, 87,
764 -42, -42, -42, -42
765};
766
767/* YYDEFGOTO[NTERM-NUM]. */
768static const yytype_int8 yydefgoto[] =
769{
770 0, 14, 15, 16, 17, 37, 38, 39, 57, 58,
771 59, 35, 60, 18, 19, 20, 51, 28, 21, 46,
772 47, 69, 70, 93
773};
774
775/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
776 positive, shift that token. If negative, reduce the rule whose
777 number is the opposite. If YYTABLE_NINF, syntax error. */
778static const yytype_int8 yytable[] =
779{
780 66, 67, 36, 3, 4, 5, 6, 1, 31, 2,
781 22, 3, 4, 5, 6, 7, 65, 80, 87, 81,
782 32, 71, 88, 8, 9, 10, 11, 12, 13, 2,
783 63, 3, 4, 5, 6, 7, 89, 90, 91, 99,
784 23, 40, 45, 8, 9, 10, 11, 12, 13, 40,
785 92, 48, 52, 53, 54, 55, 80, 49, 102, 45,
786 52, 53, 54, 55, 56, 50, 33, 34, 3, 4,
787 5, 6, 96, 41, 42, 43, 61, 84, 24, 44,
788 36, 3, 4, 5, 6, 52, 53, 54, 55, 61,
789 94, 25, 27, 29, 62, 30, 61, 33, 68, 75,
790 76, 72, 77, 97, 79, 74, 98, 78, 82, 83,
791 85, 86, 95, 100, 101, 103, 26, 0, 0, 0,
792 0, 0, 64, 0, 0, 0, 0, 0, 0, 0,
793 0, 0, 0, 0, 73
794};
795
796static const yytype_int8 yycheck[] =
797{
798 41, 42, 4, 5, 6, 7, 8, 1, 23, 3,
799 30, 5, 6, 7, 8, 9, 40, 34, 30, 36,
800 35, 45, 34, 17, 18, 19, 20, 21, 22, 3,
801 32, 5, 6, 7, 8, 9, 13, 14, 15, 80,
802 27, 29, 30, 17, 18, 19, 20, 21, 22, 37,
803 27, 13, 24, 25, 26, 27, 34, 19, 36, 47,
804 24, 25, 26, 27, 36, 27, 29, 30, 5, 6,
805 7, 8, 36, 10, 11, 12, 29, 30, 27, 16,
806 4, 5, 6, 7, 8, 24, 25, 26, 27, 29,
807 30, 0, 27, 31, 28, 31, 29, 29, 27, 27,
808 27, 32, 27, 74, 27, 35, 23, 33, 30, 30,
809 30, 30, 30, 27, 30, 27, 15, -1, -1, -1,
810 -1, -1, 37, -1, -1, -1, -1, -1, -1, -1,
811 -1, -1, -1, -1, 47
812};
813
814/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
815 state STATE-NUM. */
816static const yytype_int8 yystos[] =
817{
818 0, 1, 3, 5, 6, 7, 8, 9, 17, 18,
819 19, 20, 21, 22, 38, 39, 40, 41, 50, 51,
820 52, 55, 30, 27, 27, 0, 40, 27, 54, 31,
821 31, 23, 35, 29, 30, 48, 4, 42, 43, 44,
822 52, 10, 11, 12, 16, 52, 56, 57, 13, 19,
823 27, 53, 24, 25, 26, 27, 36, 45, 46, 47,
824 49, 29, 28, 32, 43, 48, 47, 47, 27, 58,
825 59, 48, 32, 56, 35, 27, 27, 27, 33, 27,
826 34, 36, 30, 30, 30, 30, 30, 30, 34, 13,
827 14, 15, 27, 60, 30, 30, 36, 49, 23, 47,
828 27, 30, 36, 27
829};
830
831/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
832static const yytype_int8 yyr1[] =
833{
834 0, 37, 38, 39, 39, 39, 40, 40, 40, 41,
835 42, 42, 43, 43, 44, 45, 45, 45, 45, 46,
836 46, 47, 47, 48, 48, 49, 49, 50, 50, 51,
837 51, 51, 51, 51, 51, 51, 52, 52, 52, 52,
838 53, 53, 53, 54, 54, 54, 54, 55, 56, 56,
839 57, 57, 57, 57, 57, 58, 58, 59, 59, 60,
840 60, 60
841};
842
843/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
844static const yytype_int8 yyr2[] =
845{
846 0, 2, 1, 1, 2, 2, 1, 1, 1, 6,
847 1, 2, 1, 3, 3, 2, 2, 2, 1, 1,
848 2, 2, 4, 1, 2, 1, 3, 3, 3, 1,
849 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
850 1, 1, 1, 6, 5, 4, 3, 6, 0, 2,
851 3, 3, 4, 3, 3, 1, 3, 0, 2, 1,
852 1, 1
853};
854
855
856enum { YYENOMEM = -2 };
857
858#define yyerrok (yyerrstatus = 0)
859#define yyclearin (yychar = NSGENBIND_EMPTY)
860
861#define YYACCEPT goto yyacceptlab
862#define YYABORT goto yyabortlab
863#define YYERROR goto yyerrorlab
864#define YYNOMEM goto yyexhaustedlab
865
866
867#define YYRECOVERING() (!!yyerrstatus)
868
869#define YYBACKUP(Token, Value) \
870 do \
871 if (yychar == NSGENBIND_EMPTY) \
872 { \
873 yychar = (Token); \
874 yylval = (Value); \
875 YYPOPSTACK (yylen); \
876 yystate = *yyssp; \
877 goto yybackup; \
878 } \
879 else \
880 { \
881 yyerror (&yylloc, filename, genbind_ast, YY_("syntax error: cannot back up")); \
882 YYERROR; \
883 } \
884 while (0)
885
886/* Backward compatibility with an undocumented macro.
887 Use NSGENBIND_error or NSGENBIND_UNDEF. */
888#define YYERRCODE NSGENBIND_UNDEF
889
890/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
891 If N is 0, then set CURRENT to the empty location which ends
892 the previous symbol: RHS[0] (always defined). */
893
894#ifndef YYLLOC_DEFAULT
895# define YYLLOC_DEFAULT(Current, Rhs, N) \
896 do \
897 if (N) \
898 { \
899 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
900 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
901 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
902 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
903 } \
904 else \
905 { \
906 (Current).first_line = (Current).last_line = \
907 YYRHSLOC (Rhs, 0).last_line; \
908 (Current).first_column = (Current).last_column = \
909 YYRHSLOC (Rhs, 0).last_column; \
910 } \
911 while (0)
912#endif
913
914#define YYRHSLOC(Rhs, K) ((Rhs)[K])
915
916
917/* Enable debugging if requested. */
918#if NSGENBIND_DEBUG
919
920# ifndef YYFPRINTF
921# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
922# define YYFPRINTF fprintf
923# endif
924
925# define YYDPRINTF(Args) \
926do { \
927 if (yydebug) \
928 YYFPRINTF Args; \
929} while (0)
930
931
932/* YYLOCATION_PRINT -- Print the location on the stream.
933 This macro was not mandated originally: define only if we know
934 we won't break user code: when these are the locations we know. */
935
936# ifndef YYLOCATION_PRINT
937
938# if defined YY_LOCATION_PRINT
939
940 /* Temporary convenience wrapper in case some people defined the
941 undocumented and private YY_LOCATION_PRINT macros. */
942# define YYLOCATION_PRINT(File, Loc) YY_LOCATION_PRINT(File, *(Loc))
943
944# elif defined NSGENBIND_LTYPE_IS_TRIVIAL && NSGENBIND_LTYPE_IS_TRIVIAL
945
946/* Print *YYLOCP on YYO. Private, do not rely on its existence. */
947
949static int
950yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
951{
952 int res = 0;
953 int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
954 if (0 <= yylocp->first_line)
955 {
956 res += YYFPRINTF (yyo, "%d", yylocp->first_line);
957 if (0 <= yylocp->first_column)
958 res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
959 }
960 if (0 <= yylocp->last_line)
961 {
962 if (yylocp->first_line < yylocp->last_line)
963 {
964 res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
965 if (0 <= end_col)
966 res += YYFPRINTF (yyo, ".%d", end_col);
967 }
968 else if (0 <= end_col && yylocp->first_column < end_col)
969 res += YYFPRINTF (yyo, "-%d", end_col);
970 }
971 return res;
972}
973
974# define YYLOCATION_PRINT yy_location_print_
975
976 /* Temporary convenience wrapper in case some people defined the
977 undocumented and private YY_LOCATION_PRINT macros. */
978# define YY_LOCATION_PRINT(File, Loc) YYLOCATION_PRINT(File, &(Loc))
979
980# else
981
982# define YYLOCATION_PRINT(File, Loc) ((void) 0)
983 /* Temporary convenience wrapper in case some people defined the
984 undocumented and private YY_LOCATION_PRINT macros. */
985# define YY_LOCATION_PRINT YYLOCATION_PRINT
986
987# endif
988# endif /* !defined YYLOCATION_PRINT */
989
990
991# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
992do { \
993 if (yydebug) \
994 { \
995 YYFPRINTF (stderr, "%s ", Title); \
996 yy_symbol_print (stderr, \
997 Kind, Value, Location, filename, genbind_ast); \
998 YYFPRINTF (stderr, "\n"); \
999 } \
1000} while (0)
1001
1002
1003/*-----------------------------------.
1004| Print this symbol's value on YYO. |
1005`-----------------------------------*/
1006
1007static void
1008yy_symbol_value_print (FILE *yyo,
1009 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, char *filename, struct genbind_node **genbind_ast)
1010{
1011 FILE *yyoutput = yyo;
1012 YY_USE (yyoutput);
1013 YY_USE (yylocationp);
1014 YY_USE (filename);
1015 YY_USE (genbind_ast);
1016 if (!yyvaluep)
1017 return;
1019 YY_USE (yykind);
1021}
1022
1023
1024/*---------------------------.
1025| Print this symbol on YYO. |
1026`---------------------------*/
1027
1028static void
1029yy_symbol_print (FILE *yyo,
1030 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, char *filename, struct genbind_node **genbind_ast)
1031{
1032 YYFPRINTF (yyo, "%s %s (",
1033 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
1034
1035 YYLOCATION_PRINT (yyo, yylocationp);
1036 YYFPRINTF (yyo, ": ");
1037 yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, filename, genbind_ast);
1038 YYFPRINTF (yyo, ")");
1039}
1040
1041/*------------------------------------------------------------------.
1042| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1043| TOP (included). |
1044`------------------------------------------------------------------*/
1045
1046static void
1047yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
1048{
1049 YYFPRINTF (stderr, "Stack now");
1050 for (; yybottom <= yytop; yybottom++)
1051 {
1052 int yybot = *yybottom;
1053 YYFPRINTF (stderr, " %d", yybot);
1054 }
1055 YYFPRINTF (stderr, "\n");
1056}
1057
1058# define YY_STACK_PRINT(Bottom, Top) \
1059do { \
1060 if (yydebug) \
1061 yy_stack_print ((Bottom), (Top)); \
1062} while (0)
1063
1064
1065/*------------------------------------------------.
1066| Report that the YYRULE is going to be reduced. |
1067`------------------------------------------------*/
1068
1069static void
1070yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp,
1071 int yyrule, char *filename, struct genbind_node **genbind_ast)
1072{
1073 int yylno = yyrline[yyrule];
1074 int yynrhs = yyr2[yyrule];
1075 int yyi;
1076 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1077 yyrule - 1, yylno);
1078 /* The symbols being reduced. */
1079 for (yyi = 0; yyi < yynrhs; yyi++)
1080 {
1081 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1082 yy_symbol_print (stderr,
1083 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1084 &yyvsp[(yyi + 1) - (yynrhs)],
1085 &(yylsp[(yyi + 1) - (yynrhs)]), filename, genbind_ast);
1086 YYFPRINTF (stderr, "\n");
1087 }
1088}
1089
1090# define YY_REDUCE_PRINT(Rule) \
1091do { \
1092 if (yydebug) \
1093 yy_reduce_print (yyssp, yyvsp, yylsp, Rule, filename, genbind_ast); \
1094} while (0)
1095
1096/* Nonzero means print parse trace. It is left uninitialized so that
1097 multiple parsers can coexist. */
1099#else /* !NSGENBIND_DEBUG */
1100# define YYDPRINTF(Args) ((void) 0)
1101# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1102# define YY_STACK_PRINT(Bottom, Top)
1103# define YY_REDUCE_PRINT(Rule)
1104#endif /* !NSGENBIND_DEBUG */
1105
1106
1107/* YYINITDEPTH -- initial size of the parser's stacks. */
1108#ifndef YYINITDEPTH
1109# define YYINITDEPTH 200
1110#endif
1111
1112/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1113 if the built-in stack extension method is used).
1114
1115 Do not make this value too large; the results are undefined if
1116 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1117 evaluated with infinite-precision integer arithmetic. */
1118
1119#ifndef YYMAXDEPTH
1120# define YYMAXDEPTH 10000
1121#endif
1122
1123
1124/* Context of a parse error. */
1131
1132/* Put in YYARG at most YYARGN of the expected tokens given the
1133 current YYCTX, and return the number of tokens stored in YYARG. If
1134 YYARG is null, return the number of expected tokens (guaranteed to
1135 be less than YYNTOKENS). Return YYENOMEM on memory exhaustion.
1136 Return 0 if there are more than YYARGN expected tokens, yet fill
1137 YYARG up to YYARGN. */
1138static int
1139yypcontext_expected_tokens (const yypcontext_t *yyctx,
1140 yysymbol_kind_t yyarg[], int yyargn)
1141{
1142 /* Actual size of YYARG. */
1143 int yycount = 0;
1144 int yyn = yypact[+*yyctx->yyssp];
1145 if (!yypact_value_is_default (yyn))
1146 {
1147 /* Start YYX at -YYN if negative to avoid negative indexes in
1148 YYCHECK. In other words, skip the first -YYN actions for
1149 this state because they are default actions. */
1150 int yyxbegin = yyn < 0 ? -yyn : 0;
1151 /* Stay within bounds of both yycheck and yytname. */
1152 int yychecklim = YYLAST - yyn + 1;
1153 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1154 int yyx;
1155 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1156 if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror
1157 && !yytable_value_is_error (yytable[yyx + yyn]))
1158 {
1159 if (!yyarg)
1160 ++yycount;
1161 else if (yycount == yyargn)
1162 return 0;
1163 else
1164 yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);
1165 }
1166 }
1167 if (yyarg && yycount == 0 && 0 < yyargn)
1168 yyarg[0] = YYSYMBOL_YYEMPTY;
1169 return yycount;
1170}
1171
1172
1173
1174
1175#ifndef yystrlen
1176# if defined __GLIBC__ && defined _STRING_H
1177# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
1178# else
1179/* Return the length of YYSTR. */
1180static YYPTRDIFF_T
1181yystrlen (const char *yystr)
1182{
1183 YYPTRDIFF_T yylen;
1184 for (yylen = 0; yystr[yylen]; yylen++)
1185 continue;
1186 return yylen;
1187}
1188# endif
1189#endif
1190
1191#ifndef yystpcpy
1192# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1193# define yystpcpy stpcpy
1194# else
1195/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1196 YYDEST. */
1197static char *
1198yystpcpy (char *yydest, const char *yysrc)
1199{
1200 char *yyd = yydest;
1201 const char *yys = yysrc;
1202
1203 while ((*yyd++ = *yys++) != '\0')
1204 continue;
1205
1206 return yyd - 1;
1207}
1208# endif
1209#endif
1210
1211#ifndef yytnamerr
1212/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1213 quotes and backslashes, so that it's suitable for yyerror. The
1214 heuristic is that double-quoting is unnecessary unless the string
1215 contains an apostrophe, a comma, or backslash (other than
1216 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1217 null, do not copy; instead, return the length of what the result
1218 would have been. */
1219static YYPTRDIFF_T
1220yytnamerr (char *yyres, const char *yystr)
1221{
1222 if (*yystr == '"')
1223 {
1224 YYPTRDIFF_T yyn = 0;
1225 char const *yyp = yystr;
1226 for (;;)
1227 switch (*++yyp)
1228 {
1229 case '\'':
1230 case ',':
1231 goto do_not_strip_quotes;
1232
1233 case '\\':
1234 if (*++yyp != '\\')
1235 goto do_not_strip_quotes;
1236 else
1237 goto append;
1238
1239 append:
1240 default:
1241 if (yyres)
1242 yyres[yyn] = *yyp;
1243 yyn++;
1244 break;
1245
1246 case '"':
1247 if (yyres)
1248 yyres[yyn] = '\0';
1249 return yyn;
1250 }
1251 do_not_strip_quotes: ;
1252 }
1253
1254 if (yyres)
1255 return yystpcpy (yyres, yystr) - yyres;
1256 else
1257 return yystrlen (yystr);
1258}
1259#endif
1260
1261
1262static int
1263yy_syntax_error_arguments (const yypcontext_t *yyctx,
1264 yysymbol_kind_t yyarg[], int yyargn)
1265{
1266 /* Actual size of YYARG. */
1267 int yycount = 0;
1268 /* There are many possibilities here to consider:
1269 - If this state is a consistent state with a default action, then
1270 the only way this function was invoked is if the default action
1271 is an error action. In that case, don't check for expected
1272 tokens because there are none.
1273 - The only way there can be no lookahead present (in yychar) is if
1274 this state is a consistent state with a default action. Thus,
1275 detecting the absence of a lookahead is sufficient to determine
1276 that there is no unexpected or expected token to report. In that
1277 case, just report a simple "syntax error".
1278 - Don't assume there isn't a lookahead just because this state is a
1279 consistent state with a default action. There might have been a
1280 previous inconsistent state, consistent state with a non-default
1281 action, or user semantic action that manipulated yychar.
1282 - Of course, the expected token list depends on states to have
1283 correct lookahead information, and it depends on the parser not
1284 to perform extra reductions after fetching a lookahead from the
1285 scanner and before detecting a syntax error. Thus, state merging
1286 (from LALR or IELR) and default reductions corrupt the expected
1287 token list. However, the list is correct for canonical LR with
1288 one exception: it will still contain any token that will not be
1289 accepted due to an error action in a later state.
1290 */
1291 if (yyctx->yytoken != YYSYMBOL_YYEMPTY)
1292 {
1293 int yyn;
1294 if (yyarg)
1295 yyarg[yycount] = yyctx->yytoken;
1296 ++yycount;
1297 yyn = yypcontext_expected_tokens (yyctx,
1298 yyarg ? yyarg + 1 : yyarg, yyargn - 1);
1299 if (yyn == YYENOMEM)
1300 return YYENOMEM;
1301 else
1302 yycount += yyn;
1303 }
1304 return yycount;
1305}
1306
1307/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1308 about the unexpected token YYTOKEN for the state stack whose top is
1309 YYSSP.
1310
1311 Return 0 if *YYMSG was successfully written. Return -1 if *YYMSG is
1312 not large enough to hold the message. In that case, also set
1313 *YYMSG_ALLOC to the required number of bytes. Return YYENOMEM if the
1314 required number of bytes is too large to store. */
1315static int
1316yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
1317 const yypcontext_t *yyctx)
1318{
1319 enum { YYARGS_MAX = 5 };
1320 /* Internationalized format string. */
1321 const char *yyformat = YY_NULLPTR;
1322 /* Arguments of yyformat: reported tokens (one for the "unexpected",
1323 one per "expected"). */
1324 yysymbol_kind_t yyarg[YYARGS_MAX];
1325 /* Cumulated lengths of YYARG. */
1326 YYPTRDIFF_T yysize = 0;
1327
1328 /* Actual size of YYARG. */
1329 int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX);
1330 if (yycount == YYENOMEM)
1331 return YYENOMEM;
1332
1333 switch (yycount)
1334 {
1335#define YYCASE_(N, S) \
1336 case N: \
1337 yyformat = S; \
1338 break
1339 default: /* Avoid compiler warnings. */
1340 YYCASE_(0, YY_("syntax error"));
1341 YYCASE_(1, YY_("syntax error, unexpected %s"));
1342 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1343 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1344 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1345 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1346#undef YYCASE_
1347 }
1348
1349 /* Compute error message size. Don't count the "%s"s, but reserve
1350 room for the terminator. */
1351 yysize = yystrlen (yyformat) - 2 * yycount + 1;
1352 {
1353 int yyi;
1354 for (yyi = 0; yyi < yycount; ++yyi)
1355 {
1356 YYPTRDIFF_T yysize1
1357 = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]);
1358 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1359 yysize = yysize1;
1360 else
1361 return YYENOMEM;
1362 }
1363 }
1364
1365 if (*yymsg_alloc < yysize)
1366 {
1367 *yymsg_alloc = 2 * yysize;
1368 if (! (yysize <= *yymsg_alloc
1369 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1370 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1371 return -1;
1372 }
1373
1374 /* Avoid sprintf, as that infringes on the user's name space.
1375 Don't have undefined behavior even if the translation
1376 produced a string with the wrong number of "%s"s. */
1377 {
1378 char *yyp = *yymsg;
1379 int yyi = 0;
1380 while ((*yyp = *yyformat) != '\0')
1381 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1382 {
1383 yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]);
1384 yyformat += 2;
1385 }
1386 else
1387 {
1388 ++yyp;
1389 ++yyformat;
1390 }
1391 }
1392 return 0;
1393}
1394
1395
1396/*-----------------------------------------------.
1397| Release the memory associated to this symbol. |
1398`-----------------------------------------------*/
1399
1400static void
1401yydestruct (const char *yymsg,
1402 yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, char *filename, struct genbind_node **genbind_ast)
1403{
1404 YY_USE (yyvaluep);
1405 YY_USE (yylocationp);
1406 YY_USE (filename);
1407 YY_USE (genbind_ast);
1408 if (!yymsg)
1409 yymsg = "Deleting";
1410 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1411
1413 YY_USE (yykind);
1415}
1416
1417
1418
1419
1420
1421
1422/*----------.
1423| yyparse. |
1424`----------*/
1425
1426int
1427yyparse (char *filename, struct genbind_node **genbind_ast)
1428{
1429/* Lookahead token kind. */
1430int yychar;
1431
1432
1433/* The semantic value of the lookahead symbol. */
1434/* Default value used for initialization, for pacifying older GCCs
1435 or non-GCC compilers. */
1436YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1437YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1438
1439/* Location data for the lookahead symbol. */
1440static YYLTYPE yyloc_default
1441# if defined NSGENBIND_LTYPE_IS_TRIVIAL && NSGENBIND_LTYPE_IS_TRIVIAL
1442 = { 1, 1, 1, 1 }
1443# endif
1444;
1445YYLTYPE yylloc = yyloc_default;
1446
1447 /* Number of syntax errors so far. */
1448 int yynerrs = 0;
1449
1450 yy_state_fast_t yystate = 0;
1451 /* Number of tokens to shift before error messages enabled. */
1452 int yyerrstatus = 0;
1453
1454 /* Refer to the stacks through separate pointers, to allow yyoverflow
1455 to reallocate them elsewhere. */
1456
1457 /* Their size. */
1458 YYPTRDIFF_T yystacksize = YYINITDEPTH;
1459
1460 /* The state stack: array, bottom, top. */
1461 yy_state_t yyssa[YYINITDEPTH];
1462 yy_state_t *yyss = yyssa;
1463 yy_state_t *yyssp = yyss;
1464
1465 /* The semantic value stack: array, bottom, top. */
1466 YYSTYPE yyvsa[YYINITDEPTH];
1467 YYSTYPE *yyvs = yyvsa;
1468 YYSTYPE *yyvsp = yyvs;
1469
1470 /* The location stack: array, bottom, top. */
1471 YYLTYPE yylsa[YYINITDEPTH];
1472 YYLTYPE *yyls = yylsa;
1473 YYLTYPE *yylsp = yyls;
1474
1475 int yyn;
1476 /* The return value of yyparse. */
1477 int yyresult;
1478 /* Lookahead symbol kind. */
1480 /* The variables used to return semantic value and location from the
1481 action routines. */
1482 YYSTYPE yyval;
1483 YYLTYPE yyloc;
1484
1485 /* The locations where the error started and ended. */
1486 YYLTYPE yyerror_range[3];
1487
1488 /* Buffer for error messages, and its allocated size. */
1489 char yymsgbuf[128];
1490 char *yymsg = yymsgbuf;
1491 YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
1492
1493#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1494
1495 /* The number of symbols on the RHS of the reduced rule.
1496 Keep to zero when no symbol should be popped. */
1497 int yylen = 0;
1498
1499 YYDPRINTF ((stderr, "Starting parse\n"));
1500
1501 yychar = NSGENBIND_EMPTY; /* Cause a token to be read. */
1502
1503
1504/* User initialization code. */
1505#line 65 "src/nsgenbind-parser.y"
1506{
1510}
1511
1512#line 1513 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1513
1514 yylsp[0] = yylloc;
1515 goto yysetstate;
1516
1517
1518/*------------------------------------------------------------.
1519| yynewstate -- push a new state, which is found in yystate. |
1520`------------------------------------------------------------*/
1521yynewstate:
1522 /* In all cases, when you get here, the value and location stacks
1523 have just been pushed. So pushing a state here evens the stacks. */
1524 yyssp++;
1525
1526
1527/*--------------------------------------------------------------------.
1528| yysetstate -- set current state (the top of the stack) to yystate. |
1529`--------------------------------------------------------------------*/
1530yysetstate:
1531 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1532 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1534 *yyssp = YY_CAST (yy_state_t, yystate);
1536 YY_STACK_PRINT (yyss, yyssp);
1537
1538 if (yyss + yystacksize - 1 <= yyssp)
1539#if !defined yyoverflow && !defined YYSTACK_RELOCATE
1540 YYNOMEM;
1541#else
1542 {
1543 /* Get the current used size of the three stacks, in elements. */
1544 YYPTRDIFF_T yysize = yyssp - yyss + 1;
1545
1546# if defined yyoverflow
1547 {
1548 /* Give user a chance to reallocate the stack. Use copies of
1549 these so that the &'s don't force the real ones into
1550 memory. */
1551 yy_state_t *yyss1 = yyss;
1552 YYSTYPE *yyvs1 = yyvs;
1553 YYLTYPE *yyls1 = yyls;
1554
1555 /* Each stack pointer address is followed by the size of the
1556 data in use in that stack, in bytes. This used to be a
1557 conditional around just the two extra args, but that might
1558 be undefined if yyoverflow is a macro. */
1559 yyoverflow (YY_("memory exhausted"),
1560 &yyss1, yysize * YYSIZEOF (*yyssp),
1561 &yyvs1, yysize * YYSIZEOF (*yyvsp),
1562 &yyls1, yysize * YYSIZEOF (*yylsp),
1563 &yystacksize);
1564 yyss = yyss1;
1565 yyvs = yyvs1;
1566 yyls = yyls1;
1567 }
1568# else /* defined YYSTACK_RELOCATE */
1569 /* Extend the stack our own way. */
1570 if (YYMAXDEPTH <= yystacksize)
1571 YYNOMEM;
1572 yystacksize *= 2;
1573 if (YYMAXDEPTH < yystacksize)
1574 yystacksize = YYMAXDEPTH;
1575
1576 {
1577 yy_state_t *yyss1 = yyss;
1578 union yyalloc *yyptr =
1579 YY_CAST (union yyalloc *,
1580 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1581 if (! yyptr)
1582 YYNOMEM;
1583 YYSTACK_RELOCATE (yyss_alloc, yyss);
1584 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1585 YYSTACK_RELOCATE (yyls_alloc, yyls);
1586# undef YYSTACK_RELOCATE
1587 if (yyss1 != yyssa)
1588 YYSTACK_FREE (yyss1);
1589 }
1590# endif
1591
1592 yyssp = yyss + yysize - 1;
1593 yyvsp = yyvs + yysize - 1;
1594 yylsp = yyls + yysize - 1;
1595
1597 YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1598 YY_CAST (long, yystacksize)));
1600
1601 if (yyss + yystacksize - 1 <= yyssp)
1602 YYABORT;
1603 }
1604#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1605
1606
1607 if (yystate == YYFINAL)
1608 YYACCEPT;
1609
1610 goto yybackup;
1611
1612
1613/*-----------.
1614| yybackup. |
1615`-----------*/
1616yybackup:
1617 /* Do appropriate processing given the current state. Read a
1618 lookahead token if we need one and don't already have one. */
1619
1620 /* First try to decide what to do without reference to lookahead token. */
1621 yyn = yypact[yystate];
1622 if (yypact_value_is_default (yyn))
1623 goto yydefault;
1624
1625 /* Not known => get a lookahead token if don't already have one. */
1626
1627 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1628 if (yychar == NSGENBIND_EMPTY)
1629 {
1630 YYDPRINTF ((stderr, "Reading a token\n"));
1631 yychar = yylex (&yylval, &yylloc);
1632 }
1633
1634 if (yychar <= NSGENBIND_EOF)
1635 {
1636 yychar = NSGENBIND_EOF;
1637 yytoken = YYSYMBOL_YYEOF;
1638 YYDPRINTF ((stderr, "Now at end of input.\n"));
1639 }
1640 else if (yychar == NSGENBIND_error)
1641 {
1642 /* The scanner already issued an error message, process directly
1643 to error recovery. But do not keep the error token as
1644 lookahead, it is too special and may lead us to an endless
1645 loop in error recovery. */
1646 yychar = NSGENBIND_UNDEF;
1647 yytoken = YYSYMBOL_YYerror;
1648 yyerror_range[1] = yylloc;
1649 goto yyerrlab1;
1650 }
1651 else
1652 {
1653 yytoken = YYTRANSLATE (yychar);
1654 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1655 }
1656
1657 /* If the proper action on seeing token YYTOKEN is to reduce or to
1658 detect an error, take that action. */
1659 yyn += yytoken;
1660 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1661 goto yydefault;
1662 yyn = yytable[yyn];
1663 if (yyn <= 0)
1664 {
1665 if (yytable_value_is_error (yyn))
1666 goto yyerrlab;
1667 yyn = -yyn;
1668 goto yyreduce;
1669 }
1670
1671 /* Count tokens shifted since error; after three, turn off error
1672 status. */
1673 if (yyerrstatus)
1674 yyerrstatus--;
1675
1676 /* Shift the lookahead token. */
1677 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1678 yystate = yyn;
1680 *++yyvsp = yylval;
1682 *++yylsp = yylloc;
1683
1684 /* Discard the shifted token. */
1685 yychar = NSGENBIND_EMPTY;
1686 goto yynewstate;
1687
1688
1689/*-----------------------------------------------------------.
1690| yydefault -- do the default action for the current state. |
1691`-----------------------------------------------------------*/
1692yydefault:
1693 yyn = yydefact[yystate];
1694 if (yyn == 0)
1695 goto yyerrlab;
1696 goto yyreduce;
1697
1698
1699/*-----------------------------.
1700| yyreduce -- do a reduction. |
1701`-----------------------------*/
1702yyreduce:
1703 /* yyn is the number of a rule to reduce with. */
1704 yylen = yyr2[yyn];
1705
1706 /* If YYLEN is nonzero, implement the default value of the action:
1707 '$$ = $1'.
1708
1709 Otherwise, the following line sets YYVAL to garbage.
1710 This behavior is undocumented and Bison
1711 users should not rely upon it. Assigning to YYVAL
1712 unconditionally makes the parser a bit smaller, and it avoids a
1713 GCC warning that YYVAL may be used uninitialized. */
1714 yyval = yyvsp[1-yylen];
1715
1716 /* Default location. */
1717 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1718 yyerror_range[1] = yyloc;
1719 YY_REDUCE_PRINT (yyn);
1720 switch (yyn)
1721 {
1722 case 2: /* Input: Statements */
1723#line 260 "src/nsgenbind-parser.y"
1724 {
1725 *genbind_ast = (yyvsp[0].node);
1726 }
1727#line 1728 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1728 break;
1729
1730 case 4: /* Statements: Statements Statement */
1731#line 269 "src/nsgenbind-parser.y"
1732 {
1733 (yyval.node) = *genbind_ast = genbind_node_prepend((yyvsp[0].node), (yyvsp[-1].node));
1734 }
1735#line 1736 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1736 break;
1737
1738 case 5: /* Statements: error ';' */
1739#line 274 "src/nsgenbind-parser.y"
1740 {
1741 fprintf(stderr, "%s\n", errtxt);
1742 free(errtxt);
1743 YYABORT ;
1744 }
1745#line 1746 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1746 break;
1747
1748 case 9: /* Binding: TOK_BINDING TOK_IDENTIFIER '{' BindingArgs '}' ';' */
1749#line 291 "src/nsgenbind-parser.y"
1750 {
1752 NULL,
1754 (yyvsp[-2].node), (yyvsp[-4].text)));
1755 }
1756#line 1757 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1757 break;
1758
1759 case 11: /* BindingArgs: BindingArgs BindingArg */
1760#line 303 "src/nsgenbind-parser.y"
1761 {
1762 (yyval.node) = genbind_node_link((yyvsp[0].node), (yyvsp[-1].node));
1763 }
1764#line 1765 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1765 break;
1766
1767 case 13: /* BindingArg: BindingAndMethodType CBlock ';' */
1768#line 312 "src/nsgenbind-parser.y"
1769 {
1771 NULL,
1774 NULL,
1775 (yyvsp[-1].text)),
1776 (yyvsp[-2].value)));
1777 }
1778#line 1779 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1779 break;
1780
1781 case 14: /* WebIDL: TOK_WEBIDL TOK_STRING_LITERAL ';' */
1782#line 326 "src/nsgenbind-parser.y"
1783 {
1784 (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_WEBIDL, NULL, (yyvsp[-1].text));
1785 }
1786#line 1787 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1787 break;
1788
1789 case 15: /* CTypeSpecifier: TOK_UNSIGNED TOK_IDENTIFIER */
1790#line 336 "src/nsgenbind-parser.y"
1791 {
1794 NULL,
1795 strdup("unsigned")),
1796 (yyvsp[0].text));
1797 }
1798#line 1799 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1799 break;
1800
1801 case 16: /* CTypeSpecifier: TOK_STRUCT TOK_IDENTIFIER */
1802#line 345 "src/nsgenbind-parser.y"
1803 {
1806 NULL,
1807 strdup("struct")),
1808 (yyvsp[0].text));
1809 }
1810#line 1811 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1811 break;
1812
1813 case 17: /* CTypeSpecifier: TOK_UNION TOK_IDENTIFIER */
1814#line 354 "src/nsgenbind-parser.y"
1815 {
1818 NULL,
1819 strdup("union")),
1820 (yyvsp[0].text));
1821 }
1822#line 1823 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1823 break;
1824
1825 case 18: /* CTypeSpecifier: TOK_IDENTIFIER */
1826#line 363 "src/nsgenbind-parser.y"
1827 {
1828 (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_NAME, NULL, (yyvsp[0].text));
1829 }
1830#line 1831 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1831 break;
1832
1833 case 20: /* CType: CTypeSpecifier '*' */
1834#line 372 "src/nsgenbind-parser.y"
1835 {
1836 (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_NAME, (yyvsp[-1].node), strdup("*"));
1837 }
1838#line 1839 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1839 break;
1840
1841 case 21: /* CTypeIdent: CType TOK_IDENTIFIER */
1842#line 379 "src/nsgenbind-parser.y"
1843 {
1844 (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_IDENT, (yyvsp[-1].node), (yyvsp[0].text));
1845 }
1846#line 1847 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1847 break;
1848
1849 case 22: /* CTypeIdent: CType TOK_IDENTIFIER TOK_DBLCOLON TOK_IDENTIFIER */
1850#line 384 "src/nsgenbind-parser.y"
1851 {
1853 genbind_new_node(GENBIND_NODE_TYPE_IDENT, (yyvsp[-3].node), (yyvsp[-2].text)), (yyvsp[0].text));
1854 }
1855#line 1856 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1856 break;
1857
1858 case 24: /* CBlock: CBlock TOK_CCODE_LITERAL */
1859#line 395 "src/nsgenbind-parser.y"
1860 {
1861 (yyval.text) = genbind_strapp((yyvsp[-1].text), (yyvsp[0].text));
1862 }
1863#line 1864 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1864 break;
1865
1866 case 25: /* ParameterList: CTypeIdent */
1867#line 403 "src/nsgenbind-parser.y"
1868 {
1869 (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_PARAMETER, NULL, (yyvsp[0].node));
1870 }
1871#line 1872 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1872 break;
1873
1874 case 26: /* ParameterList: ParameterList ',' CTypeIdent */
1875#line 408 "src/nsgenbind-parser.y"
1876 {
1877 (yyval.node) = genbind_node_prepend((yyvsp[-2].node),
1880 NULL,
1881 (yyvsp[0].node)));
1882 }
1883#line 1884 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1884 break;
1885
1886 case 27: /* Method: MethodType MethodDeclarator CBlock */
1887#line 419 "src/nsgenbind-parser.y"
1888 {
1889 (yyval.node) = add_method(genbind_ast, (yyvsp[-2].value), (yyvsp[-1].node), (yyvsp[0].text), (yylsp[-2]).first_line, (yylsp[-2]).filename);
1890 }
1891#line 1892 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1892 break;
1893
1894 case 28: /* Method: MethodType MethodDeclarator ';' */
1895#line 424 "src/nsgenbind-parser.y"
1896 {
1897 (yyval.node) = add_method(genbind_ast, (yyvsp[-2].value), (yyvsp[-1].node), NULL, (yylsp[-2]).first_line, (yylsp[-2]).filename);
1898 }
1899#line 1900 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1900 break;
1901
1902 case 29: /* MethodType: TOK_INIT */
1903#line 431 "src/nsgenbind-parser.y"
1904 {
1905 (yyval.value) = GENBIND_METHOD_TYPE_INIT;
1906 }
1907#line 1908 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1908 break;
1909
1910 case 30: /* MethodType: TOK_FINI */
1911#line 436 "src/nsgenbind-parser.y"
1912 {
1913 (yyval.value) = GENBIND_METHOD_TYPE_FINI;
1914 }
1915#line 1916 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1916 break;
1917
1918 case 31: /* MethodType: TOK_METHOD */
1919#line 441 "src/nsgenbind-parser.y"
1920 {
1921 (yyval.value) = GENBIND_METHOD_TYPE_METHOD;
1922 }
1923#line 1924 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1924 break;
1925
1926 case 32: /* MethodType: TOK_GETTER */
1927#line 446 "src/nsgenbind-parser.y"
1928 {
1929 (yyval.value) = GENBIND_METHOD_TYPE_GETTER;
1930 }
1931#line 1932 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1932 break;
1933
1934 case 33: /* MethodType: TOK_SETTER */
1935#line 451 "src/nsgenbind-parser.y"
1936 {
1937 (yyval.value) = GENBIND_METHOD_TYPE_SETTER;
1938 }
1939#line 1940 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1940 break;
1941
1942 case 34: /* MethodType: TOK_PROTOTYPE */
1943#line 456 "src/nsgenbind-parser.y"
1944 {
1945 (yyval.value) = GENBIND_METHOD_TYPE_PROTOTYPE;
1946 }
1947#line 1948 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1948 break;
1949
1950 case 36: /* BindingAndMethodType: TOK_PREFACE */
1951#line 465 "src/nsgenbind-parser.y"
1952 {
1953 (yyval.value) = GENBIND_METHOD_TYPE_PREFACE;
1954 }
1955#line 1956 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1956 break;
1957
1958 case 37: /* BindingAndMethodType: TOK_PROLOGUE */
1959#line 470 "src/nsgenbind-parser.y"
1960 {
1961 (yyval.value) = GENBIND_METHOD_TYPE_PROLOGUE;
1962 }
1963#line 1964 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1964 break;
1965
1966 case 38: /* BindingAndMethodType: TOK_EPILOGUE */
1967#line 475 "src/nsgenbind-parser.y"
1968 {
1969 (yyval.value) = GENBIND_METHOD_TYPE_EPILOGUE;
1970 }
1971#line 1972 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1972 break;
1973
1974 case 39: /* BindingAndMethodType: TOK_POSTFACE */
1975#line 480 "src/nsgenbind-parser.y"
1976 {
1977 (yyval.value) = GENBIND_METHOD_TYPE_POSTFACE;
1978 }
1979#line 1980 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1980 break;
1981
1982 case 40: /* MethodName: TOK_IDENTIFIER */
1983#line 487 "src/nsgenbind-parser.y"
1984 {
1985 (yyval.text) = (yyvsp[0].text);
1986 }
1987#line 1988 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1988 break;
1989
1990 case 41: /* MethodName: TOK_METHOD */
1991#line 492 "src/nsgenbind-parser.y"
1992 {
1993 (yyval.text) = strdup("method");
1994 }
1995#line 1996 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
1996 break;
1997
1998 case 42: /* MethodName: TOK_TYPE */
1999#line 497 "src/nsgenbind-parser.y"
2000 {
2001 (yyval.text) = strdup("type");
2002 }
2003#line 2004 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
2004 break;
2005
2006 case 43: /* MethodDeclarator: TOK_IDENTIFIER TOK_DBLCOLON MethodName '(' ParameterList ')' */
2007#line 505 "src/nsgenbind-parser.y"
2008 {
2011 (yyvsp[-1].node),
2012 (yyvsp[-3].text)),
2014 NULL,
2015 (yyvsp[-5].text)));
2016 }
2017#line 2018 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
2018 break;
2019
2020 case 44: /* MethodDeclarator: TOK_IDENTIFIER TOK_DBLCOLON MethodName '(' ')' */
2021#line 516 "src/nsgenbind-parser.y"
2022 {
2025 NULL,
2026 (yyvsp[-2].text)),
2028 NULL,
2029 (yyvsp[-4].text)));
2030 }
2031#line 2032 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
2032 break;
2033
2034 case 45: /* MethodDeclarator: TOK_IDENTIFIER '(' ParameterList ')' */
2035#line 527 "src/nsgenbind-parser.y"
2036 {
2038 (yyvsp[-1].node),
2040 NULL,
2041 (yyvsp[-3].text)));
2042 }
2043#line 2044 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
2044 break;
2045
2046 case 46: /* MethodDeclarator: TOK_IDENTIFIER '(' ')' */
2047#line 536 "src/nsgenbind-parser.y"
2048 {
2049 (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_CLASS, NULL,
2051 NULL,
2052 (yyvsp[-2].text)));
2053 }
2054#line 2055 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
2055 break;
2056
2057 case 47: /* Class: TOK_CLASS TOK_IDENTIFIER '{' ClassArgs '}' ';' */
2058#line 547 "src/nsgenbind-parser.y"
2059 {
2060 (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_CLASS, NULL,
2061 genbind_new_node(GENBIND_NODE_TYPE_IDENT, (yyvsp[-2].node), (yyvsp[-4].text)));
2062 }
2063#line 2064 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
2064 break;
2065
2066 case 48: /* ClassArgs: %empty */
2067#line 555 "src/nsgenbind-parser.y"
2068 {
2069 (yyval.node) = NULL;
2070 }
2071#line 2072 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
2072 break;
2073
2074 case 49: /* ClassArgs: ClassArg ClassArgs */
2075#line 560 "src/nsgenbind-parser.y"
2076 {
2077 (yyval.node) = genbind_node_prepend((yyvsp[0].node), (yyvsp[-1].node));
2078 }
2079#line 2080 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
2080 break;
2081
2082 case 50: /* ClassArg: TOK_PRIVATE CTypeIdent ';' */
2083#line 567 "src/nsgenbind-parser.y"
2084 {
2085 (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_PRIVATE, NULL, (yyvsp[-1].node));
2086 }
2087#line 2088 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
2088 break;
2089
2090 case 51: /* ClassArg: TOK_INTERNAL CTypeIdent ';' */
2091#line 572 "src/nsgenbind-parser.y"
2092 {
2093 (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_INTERNAL, NULL, (yyvsp[-1].node));
2094 }
2095#line 2096 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
2096 break;
2097
2098 case 52: /* ClassArg: TOK_PROPERTY Modifiers TOK_IDENTIFIER ';' */
2099#line 577 "src/nsgenbind-parser.y"
2100 {
2101 (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_PROPERTY, NULL,
2104 NULL,
2105 (yyvsp[-1].text)),
2106 (yyvsp[-2].value)));
2107 }
2108#line 2109 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
2109 break;
2110
2111 case 53: /* ClassArg: TOK_FLAGS ClassFlags ';' */
2112#line 587 "src/nsgenbind-parser.y"
2113 {
2114 (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_FLAGS, NULL, (yyvsp[-1].node));
2115 }
2116#line 2117 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
2117 break;
2118
2119 case 54: /* ClassArg: BindingAndMethodType CBlock ';' */
2120#line 592 "src/nsgenbind-parser.y"
2121 {
2123 NULL,
2126 NULL,
2127 (yyvsp[-1].text)),
2128 (yyvsp[-2].value)));
2129 }
2130#line 2131 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
2131 break;
2132
2133 case 55: /* ClassFlags: TOK_IDENTIFIER */
2134#line 605 "src/nsgenbind-parser.y"
2135 {
2136 (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_IDENT, NULL, (yyvsp[0].text));
2137 }
2138#line 2139 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
2139 break;
2140
2141 case 56: /* ClassFlags: ClassFlags ',' TOK_IDENTIFIER */
2142#line 610 "src/nsgenbind-parser.y"
2143 {
2144 (yyval.node) = genbind_new_node(GENBIND_NODE_TYPE_IDENT, (yyvsp[-2].node), (yyvsp[0].text));
2145 }
2146#line 2147 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
2147 break;
2148
2149 case 57: /* Modifiers: %empty */
2150#line 617 "src/nsgenbind-parser.y"
2151 {
2152 (yyval.value) = GENBIND_TYPE_NONE;
2153 }
2154#line 2155 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
2155 break;
2156
2157 case 58: /* Modifiers: Modifiers Modifier */
2158#line 622 "src/nsgenbind-parser.y"
2159 {
2160 (yyval.value) |= (yyvsp[0].value);
2161 }
2162#line 2163 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
2163 break;
2164
2165 case 59: /* Modifier: TOK_TYPE */
2166#line 629 "src/nsgenbind-parser.y"
2167 {
2168 (yyval.value) = GENBIND_TYPE_TYPE;
2169 }
2170#line 2171 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
2171 break;
2172
2173 case 60: /* Modifier: TOK_UNSHARED */
2174#line 634 "src/nsgenbind-parser.y"
2175 {
2176 (yyval.value) = GENBIND_TYPE_UNSHARED;
2177 }
2178#line 2179 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
2179 break;
2180
2181 case 61: /* Modifier: TOK_SHARED */
2182#line 639 "src/nsgenbind-parser.y"
2183 {
2184 (yyval.value) = GENBIND_TYPE_NONE;
2185 }
2186#line 2187 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
2187 break;
2188
2189
2190#line 2191 "build-x86_64-linux-gnu-x86_64-linux-gnu-release-binary/nsgenbind-parser.c"
2191
2192 default: break;
2193 }
2194 /* User semantic actions sometimes alter yychar, and that requires
2195 that yytoken be updated with the new translation. We take the
2196 approach of translating immediately before every use of yytoken.
2197 One alternative is translating here after every semantic action,
2198 but that translation would be missed if the semantic action invokes
2199 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2200 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2201 incorrect destructor might then be invoked immediately. In the
2202 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2203 to an incorrect destructor call or verbose syntax error message
2204 before the lookahead is translated. */
2205 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
2206
2207 YYPOPSTACK (yylen);
2208 yylen = 0;
2209
2210 *++yyvsp = yyval;
2211 *++yylsp = yyloc;
2212
2213 /* Now 'shift' the result of the reduction. Determine what state
2214 that goes to, based on the state we popped back to and the rule
2215 number reduced by. */
2216 {
2217 const int yylhs = yyr1[yyn] - YYNTOKENS;
2218 const int yyi = yypgoto[yylhs] + *yyssp;
2219 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
2220 ? yytable[yyi]
2221 : yydefgoto[yylhs]);
2222 }
2223
2224 goto yynewstate;
2225
2226
2227/*--------------------------------------.
2228| yyerrlab -- here on detecting error. |
2229`--------------------------------------*/
2230yyerrlab:
2231 /* Make sure we have latest lookahead translation. See comments at
2232 user semantic actions for why this is necessary. */
2233 yytoken = yychar == NSGENBIND_EMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
2234 /* If not already recovering from an error, report this error. */
2235 if (!yyerrstatus)
2236 {
2237 ++yynerrs;
2238 {
2239 yypcontext_t yyctx
2240 = {yyssp, yytoken, &yylloc};
2241 char const *yymsgp = YY_("syntax error");
2242 int yysyntax_error_status;
2243 yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
2244 if (yysyntax_error_status == 0)
2245 yymsgp = yymsg;
2246 else if (yysyntax_error_status == -1)
2247 {
2248 if (yymsg != yymsgbuf)
2249 YYSTACK_FREE (yymsg);
2250 yymsg = YY_CAST (char *,
2251 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
2252 if (yymsg)
2253 {
2254 yysyntax_error_status
2255 = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
2256 yymsgp = yymsg;
2257 }
2258 else
2259 {
2260 yymsg = yymsgbuf;
2261 yymsg_alloc = sizeof yymsgbuf;
2262 yysyntax_error_status = YYENOMEM;
2263 }
2264 }
2265 yyerror (&yylloc, filename, genbind_ast, yymsgp);
2266 if (yysyntax_error_status == YYENOMEM)
2267 YYNOMEM;
2268 }
2269 }
2270
2271 yyerror_range[1] = yylloc;
2272 if (yyerrstatus == 3)
2273 {
2274 /* If just tried and failed to reuse lookahead token after an
2275 error, discard it. */
2276
2277 if (yychar <= NSGENBIND_EOF)
2278 {
2279 /* Return failure if at end of input. */
2280 if (yychar == NSGENBIND_EOF)
2281 YYABORT;
2282 }
2283 else
2284 {
2285 yydestruct ("Error: discarding",
2286 yytoken, &yylval, &yylloc, filename, genbind_ast);
2287 yychar = NSGENBIND_EMPTY;
2288 }
2289 }
2290
2291 /* Else will try to reuse lookahead token after shifting the error
2292 token. */
2293 goto yyerrlab1;
2294
2295
2296/*---------------------------------------------------.
2297| yyerrorlab -- error raised explicitly by YYERROR. |
2298`---------------------------------------------------*/
2299yyerrorlab:
2300 /* Pacify compilers when the user code never invokes YYERROR and the
2301 label yyerrorlab therefore never appears in user code. */
2302 if (0)
2303 YYERROR;
2304 ++yynerrs;
2305
2306 /* Do not reclaim the symbols of the rule whose action triggered
2307 this YYERROR. */
2308 YYPOPSTACK (yylen);
2309 yylen = 0;
2310 YY_STACK_PRINT (yyss, yyssp);
2311 yystate = *yyssp;
2312 goto yyerrlab1;
2313
2314
2315/*-------------------------------------------------------------.
2316| yyerrlab1 -- common code for both syntax error and YYERROR. |
2317`-------------------------------------------------------------*/
2318yyerrlab1:
2319 yyerrstatus = 3; /* Each real token shifted decrements this. */
2320
2321 /* Pop stack until we find a state that shifts the error token. */
2322 for (;;)
2323 {
2324 yyn = yypact[yystate];
2325 if (!yypact_value_is_default (yyn))
2326 {
2327 yyn += YYSYMBOL_YYerror;
2328 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
2329 {
2330 yyn = yytable[yyn];
2331 if (0 < yyn)
2332 break;
2333 }
2334 }
2335
2336 /* Pop the current state because it cannot handle the error token. */
2337 if (yyssp == yyss)
2338 YYABORT;
2339
2340 yyerror_range[1] = *yylsp;
2341 yydestruct ("Error: popping",
2342 YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp, filename, genbind_ast);
2343 YYPOPSTACK (1);
2344 yystate = *yyssp;
2345 YY_STACK_PRINT (yyss, yyssp);
2346 }
2347
2349 *++yyvsp = yylval;
2351
2352 yyerror_range[2] = yylloc;
2353 ++yylsp;
2354 YYLLOC_DEFAULT (*yylsp, yyerror_range, 2);
2355
2356 /* Shift the error token. */
2357 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
2358
2359 yystate = yyn;
2360 goto yynewstate;
2361
2362
2363/*-------------------------------------.
2364| yyacceptlab -- YYACCEPT comes here. |
2365`-------------------------------------*/
2366yyacceptlab:
2367 yyresult = 0;
2368 goto yyreturnlab;
2369
2370
2371/*-----------------------------------.
2372| yyabortlab -- YYABORT comes here. |
2373`-----------------------------------*/
2374yyabortlab:
2375 yyresult = 1;
2376 goto yyreturnlab;
2377
2378
2379/*-----------------------------------------------------------.
2380| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
2381`-----------------------------------------------------------*/
2382yyexhaustedlab:
2383 yyerror (&yylloc, filename, genbind_ast, YY_("memory exhausted"));
2384 yyresult = 2;
2385 goto yyreturnlab;
2386
2387
2388/*----------------------------------------------------------.
2389| yyreturnlab -- parsing is finished, clean up and return. |
2390`----------------------------------------------------------*/
2391yyreturnlab:
2392 if (yychar != NSGENBIND_EMPTY)
2393 {
2394 /* Make sure we have latest lookahead translation. See comments at
2395 user semantic actions for why this is necessary. */
2396 yytoken = YYTRANSLATE (yychar);
2397 yydestruct ("Cleanup: discarding lookahead",
2398 yytoken, &yylval, &yylloc, filename, genbind_ast);
2399 }
2400 /* Do not reclaim the symbols of the rule whose action triggered
2401 this YYABORT or YYACCEPT. */
2402 YYPOPSTACK (yylen);
2403 YY_STACK_PRINT (yyss, yyssp);
2404 while (yyssp != yyss)
2405 {
2406 yydestruct ("Cleanup: popping",
2407 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, filename, genbind_ast);
2408 YYPOPSTACK (1);
2409 }
2410#ifndef yyoverflow
2411 if (yyss != yyssa)
2412 YYSTACK_FREE (yyss);
2413#endif
2414 if (yymsg != yymsgbuf)
2415 YYSTACK_FREE (yymsg);
2416 return yyresult;
2417}
2418
2419#line 644 "src/nsgenbind-parser.y"
2420
unsigned long lineno
Definition html.idl:1562
DOMString filename
Definition html.idl:1561
struct genbind_node * genbind_node_prepend(struct genbind_node *list, struct genbind_node *inst)
struct genbind_node * genbind_node_find_type(struct genbind_node *node, struct genbind_node *prev, enum genbind_node_type type)
struct genbind_node * genbind_node_find_type_ident(struct genbind_node *node, struct genbind_node *prev, enum genbind_node_type type, const char *ident)
struct genbind_node * genbind_new_node(enum genbind_node_type type, struct genbind_node *l, void *r)
struct genbind_node * genbind_new_number_node(enum genbind_node_type type, struct genbind_node *l, int number)
struct genbind_node * genbind_node_getnode(struct genbind_node *node)
char * genbind_node_gettext(struct genbind_node *node)
struct genbind_node * genbind_node_link(struct genbind_node *tgt, struct genbind_node *src)
struct genbind_node * genbind_node_add(struct genbind_node *node, struct genbind_node *list)
char * genbind_strapp(char *a, char *b)
@ GENBIND_TYPE_TYPE
@ GENBIND_TYPE_NONE
@ GENBIND_TYPE_UNSHARED
@ GENBIND_METHOD_TYPE_INIT
@ GENBIND_METHOD_TYPE_PREFACE
@ GENBIND_METHOD_TYPE_METHOD
@ GENBIND_METHOD_TYPE_SETTER
@ GENBIND_METHOD_TYPE_PROLOGUE
@ GENBIND_METHOD_TYPE_GETTER
@ GENBIND_METHOD_TYPE_POSTFACE
@ GENBIND_METHOD_TYPE_PROTOTYPE
@ GENBIND_METHOD_TYPE_EPILOGUE
@ GENBIND_METHOD_TYPE_FINI
@ GENBIND_NODE_TYPE_PARAMETER
@ GENBIND_NODE_TYPE_BINDING
@ GENBIND_NODE_TYPE_INTERNAL
@ GENBIND_NODE_TYPE_MODIFIER
@ GENBIND_NODE_TYPE_WEBIDL
@ GENBIND_NODE_TYPE_METHOD_TYPE
@ GENBIND_NODE_TYPE_NAME
@ GENBIND_NODE_TYPE_FLAGS
@ GENBIND_NODE_TYPE_CLASS
@ GENBIND_NODE_TYPE_METHOD
@ GENBIND_NODE_TYPE_PROPERTY
@ GENBIND_NODE_TYPE_IDENT
@ GENBIND_NODE_TYPE_PRIVATE
@ GENBIND_NODE_TYPE_CDATA
@ GENBIND_NODE_TYPE_LINE
@ GENBIND_NODE_TYPE_FILE
#define YYSTYPE
YYLTYPE * yylloc
YYSTYPE * yylval
@ YYENOMEM
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
#define YYMAXDEPTH
#define YYSTACK_FREE
yysymbol_kind_t
@ YYSYMBOL_CTypeSpecifier
@ YYSYMBOL_TOK_STRUCT
@ YYSYMBOL_YYUNDEF
@ YYSYMBOL_BindingAndMethodType
@ YYSYMBOL_Statements
@ YYSYMBOL_TOK_GETTER
@ YYSYMBOL_TOK_FINI
@ YYSYMBOL_MethodName
@ YYSYMBOL_YYerror
@ YYSYMBOL_TOK_UNSIGNED
@ YYSYMBOL_ClassArg
@ YYSYMBOL_CTypeIdent
@ YYSYMBOL_CBlock
@ YYSYMBOL_TOK_UNSHARED
@ YYSYMBOL_TOK_INIT
@ YYSYMBOL_ClassArgs
@ YYSYMBOL_TOK_CLASS
@ YYSYMBOL_Input
@ YYSYMBOL_TOK_CCODE_LITERAL
@ YYSYMBOL_TOK_UNION
@ YYSYMBOL_TOK_STRING_LITERAL
@ YYSYMBOL_Method
@ YYSYMBOL_TOK_DBLCOLON
@ YYSYMBOL_32_
@ YYSYMBOL_35_
@ YYSYMBOL_ClassFlags
@ YYSYMBOL_TOK_IDENTIFIER
@ YYSYMBOL_TOK_SHARED
@ YYSYMBOL_TOK_SETTER
@ YYSYMBOL_TOK_INTERNAL
@ YYSYMBOL_Modifier
@ YYSYMBOL_Modifiers
@ YYSYMBOL_36_
@ YYSYMBOL_TOK_POSTFACE
@ YYSYMBOL_YYACCEPT
@ YYSYMBOL_30_
@ YYSYMBOL_BindingArgs
@ YYSYMBOL_BindingArg
@ YYSYMBOL_TOK_PROTOTYPE
@ YYSYMBOL_TOK_EPILOGUE
@ YYSYMBOL_ParameterList
@ YYSYMBOL_YYEOF
@ YYSYMBOL_Statement
@ YYSYMBOL_33_
@ YYSYMBOL_TOK_WEBIDL
@ YYSYMBOL_TOK_PROLOGUE
@ YYSYMBOL_34_
@ YYSYMBOL_YYEMPTY
@ YYSYMBOL_MethodType
@ YYSYMBOL_TOK_PREFACE
@ YYSYMBOL_TOK_METHOD
@ YYSYMBOL_Binding
@ YYSYMBOL_TOK_FLAGS
@ YYSYMBOL_TOK_BINDING
@ YYSYMBOL_MethodDeclarator
@ YYSYMBOL_TOK_PROPERTY
@ YYSYMBOL_Class
@ YYSYMBOL_31_
@ YYSYMBOL_TOK_TYPE
@ YYSYMBOL_WebIDL
@ YYSYMBOL_CType
@ YYSYMBOL_TOK_PRIVATE
#define YY_ASSERT(E)
#define YY_(Msgid)
#define YYNOMEM
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
#define YYNSTATES
#define YYSTYPE
#define YY_IGNORE_USELESS_CAST_END
short yytype_int16
#define YYABORT
#define YYSTACK_BYTES(N)
#define YY_REDUCE_PRINT(Rule)
#define YY_CAST(Type, Val)
#define yylex
#define YYCASE_(N, S)
#define YY_NULLPTR
#define YYFINAL
#define YY_ACCESSING_SYMBOL(State)
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
#define YY_INITIAL_VALUE(Value)
#define yyparse
#define YYNTOKENS
unsigned char yytype_uint8
#define YY_STACK_PRINT(Bottom, Top)
#define YYSIZE_T
#define YYSTACK_ALLOC_MAXIMUM
#define yydebug
#define YY_IGNORE_USELESS_CAST_BEGIN
void * malloc(YYSIZE_T)
#define YYLOCATION_PRINT(File, Loc)
#define YYPTRDIFF_T
#define yynerrs
#define YYACCEPT
#define yytable_value_is_error(Yyn)
#define YYTRANSLATE(YYX)
#define YY_ATTRIBUTE_UNUSED
#define YYPOPSTACK(N)
int yy_state_fast_t
unsigned short yytype_uint16
#define YYLAST
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
#define yypact_value_is_default(Yyn)
#define YYINITDEPTH
signed char yytype_int8
void free(void *)
#define YYERROR
#define YYSIZEOF(X)
#define YYFPRINTF
#define YYSTACK_ALLOC
yytype_int8 yy_state_t
#define YYDPRINTF(Args)
#define YY_USE(E)
#define yyerror
@ NSGENBIND_UNDEF
@ NSGENBIND_error
@ NSGENBIND_EMPTY
@ NSGENBIND_EOF
#define YYLLOC_DEFAULT(Current, Rhs, N)
char * filename
yysymbol_kind_t yytoken
yy_state_t * yyssp
YYLTYPE yyls_alloc
YYSTYPE yyvs_alloc
yy_state_t yyss_alloc
#define UNUSED(x)
Definition utils.h:50
yysymbol_kind_t
yytype_int16 yy_state_t