1 /* A Bison parser, made from ext_fcns.y, by GNU bison 1.75. */
3 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
26 /* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
29 /* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
36 /* Identify Bison output. */
42 /* Using locations. */
43 #define YYLSP_NEEDED 0
45 /* If NAME_PREFIX is specified substitute the variables and functions
47 #define yyparse Ext_fcnsParserparse
48 #define yylex Ext_fcnsParserlex
49 #define yyerror Ext_fcnsParsererror
50 #define yylval Ext_fcnsParserlval
51 #define yychar Ext_fcnsParserchar
52 #define yydebug Ext_fcnsParserdebug
53 #define yynerrs Ext_fcnsParsernerrs
59 /* Put the tokens into the symbol table, so that GDB and other debuggers
78 #define STRING_TOKEN 259
94 /* Copy the first part of user declarations. */
101 /* Some addn'l includes, necessary but not included by the
102 bison generated code.
107 /* prototypes for the parser callbacks.
110 #include "parse_ext_fcns.h"
112 /* Interface to ext_fcns parser */
114 void yyerror(char *s);
116 extern int flex_ext_fcns_lineno, flex_ext_fcns_ch;
119 extern ext_fcn_list *Ext_fcns;
125 /* Enabling traces. */
130 /* Enabling verbose error messages. */
131 #ifdef YYERROR_VERBOSE
132 # undef YYERROR_VERBOSE
133 # define YYERROR_VERBOSE 1
135 # define YYERROR_VERBOSE 0
139 #line 40 "ext_fcns.y"
142 ext_fcn_list *ext_fcn_list_t;
143 ext_fcn_def *ext_fcn_t;
144 ext_fcn_param_list *plist_t;
145 param_list *tplist_t;
146 ext_fcn_param *param_t;
147 ext_fcn_modifier_list *modif_t;
149 /* Line 193 of /usr/local/share/bison/yacc.c. */
150 #line 151 "ext_fcns.tab.cc"
151 # define YYSTYPE yystype
152 # define YYSTYPE_IS_TRIVIAL 1
156 typedef struct yyltype
163 # define YYLTYPE yyltype
164 # define YYLTYPE_IS_TRIVIAL 1
167 /* Copy the second part of user declarations. */
170 /* Line 213 of /usr/local/share/bison/yacc.c. */
171 #line 172 "ext_fcns.tab.cc"
173 #if ! defined (yyoverflow) || YYERROR_VERBOSE
175 /* The parser invokes alloca or malloc; define the necessary symbols. */
177 # if YYSTACK_USE_ALLOCA
178 # define YYSTACK_ALLOC alloca
180 # ifndef YYSTACK_USE_ALLOCA
181 # if defined (alloca) || defined (_ALLOCA_H)
182 # define YYSTACK_ALLOC alloca
185 # define YYSTACK_ALLOC __builtin_alloca
191 # ifdef YYSTACK_ALLOC
192 /* Pacify GCC's `empty if-body' warning. */
193 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
195 # if defined (__STDC__) || defined (__cplusplus)
196 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
197 # define YYSIZE_T size_t
199 # define YYSTACK_ALLOC malloc
200 # define YYSTACK_FREE free
202 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
205 #if (! defined (yyoverflow) \
206 && (! defined (__cplusplus) \
207 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
209 /* A type that is properly aligned for any stack member. */
216 /* The size of the maximum gap between one aligned stack and the next. */
217 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
219 /* The size of an array large to enough to hold all stacks, each with
221 # define YYSTACK_BYTES(N) \
222 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
225 /* Copy COUNT objects from FROM to TO. The source and destination do
229 # define YYCOPY(To, From, Count) \
230 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
232 # define YYCOPY(To, From, Count) \
235 register YYSIZE_T yyi; \
236 for (yyi = 0; yyi < (Count); yyi++) \
237 (To)[yyi] = (From)[yyi]; \
243 /* Relocate STACK from its old location to the new one. The
244 local variables YYSIZE and YYSTACKSIZE give the old and new number of
245 elements in the stack, and YYPTR gives the new location of the
246 stack. Advance YYPTR to a properly aligned location for the next
248 # define YYSTACK_RELOCATE(Stack) \
251 YYSIZE_T yynewbytes; \
252 YYCOPY (&yyptr->Stack, Stack, yysize); \
253 Stack = &yyptr->Stack; \
254 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
255 yyptr += yynewbytes / sizeof (*yyptr); \
261 #if defined (__STDC__) || defined (__cplusplus)
262 typedef signed char yysigned_char;
264 typedef short yysigned_char;
267 /* YYFINAL -- State number of the termination state. */
271 /* YYNTOKENS -- Number of terminals. */
273 /* YYNNTS -- Number of nonterminals. */
275 /* YYNRULES -- Number of rules. */
277 /* YYNRULES -- Number of states. */
278 #define YYNSTATES 117
280 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
282 #define YYMAXUTOK 270
284 #define YYTRANSLATE(X) \
285 ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK)
287 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
288 static const unsigned char yytranslate[] =
290 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
291 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
292 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
293 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
294 18, 19, 2, 2, 20, 2, 2, 2, 2, 2,
295 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
296 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
297 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
298 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
299 2, 16, 2, 17, 2, 2, 2, 2, 2, 2,
300 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
301 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
302 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
303 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
304 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
305 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
306 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
307 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
308 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
309 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
310 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
311 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
312 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
313 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
314 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
315 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
316 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
321 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
323 static const unsigned char yyprhs[] =
325 0, 0, 3, 5, 7, 10, 22, 31, 41, 48,
326 61, 71, 85, 96, 109, 119, 124, 125, 127, 129,
327 132, 136, 141, 143, 147, 151, 155, 159, 164, 169,
328 172, 173, 177, 179, 182, 185, 188, 192, 197, 202
331 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
332 static const yysigned_char yyrhs[] =
334 22, 0, -1, 23, -1, 24, -1, 23, 24, -1,
335 3, 29, 10, 16, 26, 17, 3, 18, 25, 19,
336 6, -1, 3, 29, 10, 3, 18, 25, 19, 6,
337 -1, 11, 16, 26, 17, 3, 16, 25, 17, 6,
338 -1, 11, 3, 16, 25, 17, 6, -1, 3, 29,
339 13, 16, 26, 17, 3, 3, 18, 25, 19, 6,
340 -1, 3, 29, 13, 3, 3, 18, 25, 19, 6,
341 -1, 3, 29, 12, 16, 26, 17, 3, 3, 3,
342 18, 25, 19, 6, -1, 3, 29, 12, 3, 3,
343 3, 18, 25, 19, 6, -1, 3, 29, 15, 16,
344 26, 17, 3, 3, 18, 25, 19, 6, -1, 3,
345 29, 15, 3, 3, 18, 25, 19, 6, -1, 3,
346 14, 3, 6, -1, -1, 27, -1, 3, -1, 3,
347 3, -1, 26, 20, 3, -1, 26, 20, 3, 3,
348 -1, 28, -1, 27, 20, 28, -1, 3, 29, 7,
349 -1, 3, 29, 8, -1, 3, 29, 9, -1, 3,
350 29, 7, 9, -1, 3, 29, 8, 9, -1, 3,
351 29, -1, -1, 18, 30, 19, -1, 3, -1, 3,
352 3, -1, 3, 4, -1, 3, 5, -1, 30, 20,
353 3, -1, 30, 20, 3, 3, -1, 30, 20, 3,
354 4, -1, 30, 20, 3, 5, -1
357 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
358 static const unsigned char yyrline[] =
360 0, 75, 75, 78, 79, 82, 84, 86, 88, 90,
361 92, 94, 96, 98, 100, 102, 107, 109, 112, 114,
362 115, 116, 119, 121, 124, 126, 127, 128, 129, 130,
363 134, 136, 139, 141, 142, 143, 144, 145, 146, 147
367 #if YYDEBUG || YYERROR_VERBOSE
368 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
369 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
370 static const char *const yytname[] =
372 "$end", "error", "$undefined", "NAME", "STRING_TOKEN", "INTNUM",
373 "SEMICOLON", "HANDLE", "CONST", "CLASS", "FUN", "PRED", "EXTR", "UDAF",
374 "STATE", "SFUN", "'['", "']'", "'('", "')'", "','", "$accept", "result",
375 "fcn_list", "fcn_def", "opt_param_commalist", "modifier_list",
376 "param_commalist", "param", "opt_type_param_commalist",
377 "type_param_commalist", 0
382 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
384 static const unsigned short yytoknum[] =
386 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
387 265, 266, 267, 268, 269, 270, 91, 93, 40, 41,
392 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
393 static const unsigned char yyr1[] =
395 0, 21, 22, 23, 23, 24, 24, 24, 24, 24,
396 24, 24, 24, 24, 24, 24, 25, 25, 26, 26,
397 26, 26, 27, 27, 28, 28, 28, 28, 28, 28,
398 29, 29, 30, 30, 30, 30, 30, 30, 30, 30
401 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
402 static const unsigned char yyr2[] =
404 0, 2, 1, 1, 2, 11, 8, 9, 6, 12,
405 9, 13, 10, 12, 9, 4, 0, 1, 1, 2,
406 3, 4, 1, 3, 3, 3, 3, 4, 4, 2,
407 0, 3, 1, 2, 2, 2, 3, 4, 4, 4
410 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
411 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
412 means the default is an error. */
413 static const unsigned char yydefact[] =
415 0, 30, 0, 0, 2, 3, 0, 0, 0, 0,
416 0, 1, 4, 0, 32, 0, 0, 0, 0, 0,
417 16, 18, 0, 15, 33, 34, 35, 31, 0, 0,
418 0, 0, 0, 0, 0, 0, 0, 30, 0, 17,
419 22, 19, 0, 0, 36, 16, 0, 0, 0, 0,
420 0, 0, 0, 29, 0, 0, 0, 20, 37, 38,
421 39, 0, 0, 0, 0, 16, 0, 16, 0, 24,
422 25, 26, 8, 23, 16, 21, 0, 0, 16, 0,
423 0, 0, 0, 0, 27, 28, 0, 6, 16, 0,
424 0, 0, 0, 0, 0, 0, 0, 0, 0, 10,
425 16, 14, 16, 7, 0, 12, 16, 0, 0, 5,
426 0, 0, 0, 0, 9, 13, 11
429 /* YYDEFGOTO[NTERM-NUM]. */
430 static const yysigned_char yydefgoto[] =
432 -1, 3, 4, 5, 38, 22, 39, 40, 8, 15
435 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
437 #define YYPACT_NINF -46
438 static const yysigned_char yypact[] =
440 8, -5, -2, 7, 8, -46, 25, 35, 11, 9,
441 50, -46, -46, 48, 41, 22, -1, 0, 1, 2,
442 53, 55, 10, -46, -46, -46, -46, -46, 56, 42,
443 50, 59, 50, 60, 50, 61, 50, 47, 49, 51,
444 -46, -46, 64, 65, 44, 53, 14, 66, 15, 52,
445 19, 54, 20, 43, 67, 53, 58, 72, -46, -46,
446 -46, 57, 74, 62, 75, 53, 76, 53, 78, 73,
447 77, -46, -46, -46, 53, -46, 79, 69, 53, 80,
448 70, 81, 71, 85, -46, -46, 82, -46, 53, 83,
449 88, 86, 87, 89, 90, 91, 84, 92, 93, -46,
450 53, -46, 53, -46, 94, -46, 53, 95, 96, -46,
451 97, 98, 100, 101, -46, -46, -46
454 /* YYPGOTO[NTERM-NUM]. */
455 static const yysigned_char yypgoto[] =
457 -46, -46, -46, 105, -45, -24, -46, 38, 99, -46
460 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
461 positive, shift that token. If negative, reduce the rule which
462 number is the opposite. If zero, do what YYDEFACT says.
463 If YYTABLE_NINF, parse error. */
464 #define YYTABLE_NINF -1
465 static const unsigned char yytable[] =
467 61, 9, 29, 31, 33, 35, 46, 11, 48, 6,
468 50, 1, 52, 7, 10, 30, 32, 34, 36, 2,
469 80, 16, 82, 17, 18, 20, 19, 42, 13, 86,
470 43, 62, 64, 89, 43, 43, 66, 68, 14, 43,
471 43, 27, 28, 96, 24, 25, 26, 58, 59, 60,
472 69, 70, 71, 21, 23, 107, 37, 108, 41, 44,
473 45, 110, 47, 49, 51, 7, 54, 56, 57, 63,
474 65, 55, 67, 72, 74, 75, 76, 77, 79, 81,
475 78, 83, 84, 90, 92, 87, 85, 88, 94, 91,
476 93, 98, 99, 73, 0, 101, 0, 103, 105, 95,
477 109, 0, 97, 104, 114, 100, 115, 116, 102, 12,
478 0, 106, 0, 0, 111, 112, 113, 0, 0, 0,
479 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
483 static const yysigned_char yycheck[] =
485 45, 3, 3, 3, 3, 3, 30, 0, 32, 14,
486 34, 3, 36, 18, 16, 16, 16, 16, 16, 11,
487 65, 10, 67, 12, 13, 16, 15, 17, 3, 74,
488 20, 17, 17, 78, 20, 20, 17, 17, 3, 20,
489 20, 19, 20, 88, 3, 4, 5, 3, 4, 5,
490 7, 8, 9, 3, 6, 100, 3, 102, 3, 3,
491 18, 106, 3, 3, 3, 18, 17, 3, 3, 3,
492 18, 20, 18, 6, 16, 3, 19, 3, 3, 3,
493 18, 3, 9, 3, 3, 6, 9, 18, 3, 19,
494 19, 3, 6, 55, -1, 6, -1, 6, 6, 17,
495 6, -1, 19, 19, 6, 18, 6, 6, 18, 4,
496 -1, 18, -1, -1, 19, 19, 19, -1, -1, -1,
497 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
498 -1, -1, -1, -1, -1, -1, 37
501 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
502 symbol of state STATE-NUM. */
503 static const unsigned char yystos[] =
505 0, 3, 11, 22, 23, 24, 14, 18, 29, 3,
506 16, 0, 24, 3, 3, 30, 10, 12, 13, 15,
507 16, 3, 26, 6, 3, 4, 5, 19, 20, 3,
508 16, 3, 16, 3, 16, 3, 16, 3, 25, 27,
509 28, 3, 17, 20, 3, 18, 26, 3, 26, 3,
510 26, 3, 26, 29, 17, 20, 3, 3, 3, 4,
511 5, 25, 17, 3, 17, 18, 17, 18, 17, 7,
512 8, 9, 6, 28, 16, 3, 19, 3, 18, 3,
513 25, 3, 25, 3, 9, 9, 25, 6, 18, 25,
514 3, 19, 3, 19, 3, 17, 25, 19, 3, 6,
515 18, 6, 18, 6, 19, 6, 18, 25, 25, 6,
516 25, 19, 19, 19, 6, 6, 6
519 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
520 # define YYSIZE_T __SIZE_TYPE__
522 #if ! defined (YYSIZE_T) && defined (size_t)
523 # define YYSIZE_T size_t
525 #if ! defined (YYSIZE_T)
526 # if defined (__STDC__) || defined (__cplusplus)
527 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
528 # define YYSIZE_T size_t
531 #if ! defined (YYSIZE_T)
532 # define YYSIZE_T unsigned int
535 #define yyerrok (yyerrstatus = 0)
536 #define yyclearin (yychar = YYEMPTY)
540 #define YYACCEPT goto yyacceptlab
541 #define YYABORT goto yyabortlab
542 #define YYERROR goto yyerrlab1
544 /* Like YYERROR except do call yyerror. This remains here temporarily
545 to ease the transition to the new meaning of YYERROR, for GCC.
546 Once GCC version 2 has supplanted version 1, this can go. */
548 #define YYFAIL goto yyerrlab
550 #define YYRECOVERING() (!!yyerrstatus)
552 #define YYBACKUP(Token, Value) \
554 if (yychar == YYEMPTY && yylen == 1) \
558 yychar1 = YYTRANSLATE (yychar); \
564 yyerror ("syntax error: cannot back up"); \
570 #define YYERRCODE 256
572 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
575 #ifndef YYLLOC_DEFAULT
576 # define YYLLOC_DEFAULT(Current, Rhs, N) \
577 Current.first_line = Rhs[1].first_line; \
578 Current.first_column = Rhs[1].first_column; \
579 Current.last_line = Rhs[N].last_line; \
580 Current.last_column = Rhs[N].last_column;
583 /* YYLEX -- calling `yylex' with the right arguments. */
585 #define YYLEX yylex ()
587 /* Enable debugging if requested. */
591 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
592 # define YYFPRINTF fprintf
595 # define YYDPRINTF(Args) \
600 # define YYDSYMPRINT(Args) \
605 /* Nonzero means print parse trace. It is left uninitialized so that
606 multiple parsers can coexist. */
609 # define YYDPRINTF(Args)
610 # define YYDSYMPRINT(Args)
611 #endif /* !YYDEBUG */
613 /* YYINITDEPTH -- initial size of the parser's stacks. */
615 # define YYINITDEPTH 200
618 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
619 if the built-in stack extension method is used).
621 Do not make this value too large; the results are undefined if
622 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
623 evaluated with infinite-precision integer arithmetic. */
630 # define YYMAXDEPTH 10000
638 # if defined (__GLIBC__) && defined (_STRING_H)
639 # define yystrlen strlen
641 /* Return the length of YYSTR. */
643 # if defined (__STDC__) || defined (__cplusplus)
644 yystrlen (const char *yystr)
650 register const char *yys = yystr;
652 while (*yys++ != '\0')
655 return yys - yystr - 1;
661 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
662 # define yystpcpy stpcpy
664 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
667 # if defined (__STDC__) || defined (__cplusplus)
668 yystpcpy (char *yydest, const char *yysrc)
670 yystpcpy (yydest, yysrc)
675 register char *yyd = yydest;
676 register const char *yys = yysrc;
678 while ((*yyd++ = *yys++) != '\0')
686 #endif /* !YYERROR_VERBOSE */
691 /*-----------------------------.
692 | Print this symbol on YYOUT. |
693 `-----------------------------*/
696 #if defined (__STDC__) || defined (__cplusplus)
697 yysymprint (FILE* yyout, int yytype, YYSTYPE yyvalue)
699 yysymprint (yyout, yytype, yyvalue)
705 /* Pacify ``unused variable'' warnings. */
708 if (yytype < YYNTOKENS)
710 YYFPRINTF (yyout, "token %s (", yytname[yytype]);
712 YYPRINT (yyout, yytoknum[yytype], yyvalue);
716 YYFPRINTF (yyout, "nterm %s (", yytname[yytype]);
723 YYFPRINTF (yyout, ")");
725 #endif /* YYDEBUG. */
728 /*-----------------------------------------------.
729 | Release the memory associated to this symbol. |
730 `-----------------------------------------------*/
733 #if defined (__STDC__) || defined (__cplusplus)
734 yydestruct (int yytype, YYSTYPE yyvalue)
736 yydestruct (yytype, yyvalue)
741 /* Pacify ``unused variable'' warnings. */
753 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
754 into yyparse. The argument should have type void *.
755 It should actually point to an object.
756 Grammar actions can access the variable by casting it
757 to the proper pointer type. */
760 # if defined (__STDC__) || defined (__cplusplus)
761 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
762 # define YYPARSE_PARAM_DECL
764 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
765 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
767 #else /* !YYPARSE_PARAM */
768 # define YYPARSE_PARAM_ARG
769 # define YYPARSE_PARAM_DECL
770 #endif /* !YYPARSE_PARAM */
772 /* Prevent warning if -Wstrict-prototypes. */
774 # ifdef YYPARSE_PARAM
775 int yyparse (void *);
782 /* The lookahead symbol. */
785 /* The semantic value of the lookahead symbol. */
788 /* Number of parse errors so far. */
793 yyparse (YYPARSE_PARAM_ARG)
797 register int yystate;
800 /* Number of tokens to shift before error messages enabled. */
802 /* Lookahead token as an internal (translated) token number. */
805 /* Three stacks and their tools:
806 `yyss': related to states,
807 `yyvs': related to semantic values,
808 `yyls': related to locations.
810 Refer to the stacks thru separate pointers, to allow yyoverflow
811 to reallocate them elsewhere. */
813 /* The state stack. */
814 short yyssa[YYINITDEPTH];
816 register short *yyssp;
818 /* The semantic value stack. */
819 YYSTYPE yyvsa[YYINITDEPTH];
820 YYSTYPE *yyvs = yyvsa;
821 register YYSTYPE *yyvsp;
825 #define YYPOPSTACK (yyvsp--, yyssp--)
827 YYSIZE_T yystacksize = YYINITDEPTH;
829 /* The variables used to return semantic value and location from the
834 /* When reducing, the number of symbols on the RHS of the reduced
838 YYDPRINTF ((stderr, "Starting parse\n"));
843 yychar = YYEMPTY; /* Cause a token to be read. */
845 /* Initialize stack pointers.
846 Waste one element of value and location stack
847 so that they stay on the same level as the state stack.
848 The wasted elements are never initialized. */
855 /*------------------------------------------------------------.
856 | yynewstate -- Push a new state, which is found in yystate. |
857 `------------------------------------------------------------*/
859 /* In all cases, when you get here, the value and location stacks
860 have just been pushed. so pushing a state here evens the stacks.
867 if (yyssp >= yyss + yystacksize - 1)
869 /* Get the current used size of the three stacks, in elements. */
870 YYSIZE_T yysize = yyssp - yyss + 1;
874 /* Give user a chance to reallocate the stack. Use copies of
875 these so that the &'s don't force the real ones into
877 YYSTYPE *yyvs1 = yyvs;
881 /* Each stack pointer address is followed by the size of the
882 data in use in that stack, in bytes. This used to be a
883 conditional around just the two extra args, but that might
884 be undefined if yyoverflow is a macro. */
885 yyoverflow ("parser stack overflow",
886 &yyss1, yysize * sizeof (*yyssp),
887 &yyvs1, yysize * sizeof (*yyvsp),
894 #else /* no yyoverflow */
895 # ifndef YYSTACK_RELOCATE
898 /* Extend the stack our own way. */
899 if (yystacksize >= YYMAXDEPTH)
902 if (yystacksize > YYMAXDEPTH)
903 yystacksize = YYMAXDEPTH;
907 union yyalloc *yyptr =
908 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
911 YYSTACK_RELOCATE (yyss);
912 YYSTACK_RELOCATE (yyvs);
914 # undef YYSTACK_RELOCATE
916 YYSTACK_FREE (yyss1);
919 #endif /* no yyoverflow */
921 yyssp = yyss + yysize - 1;
922 yyvsp = yyvs + yysize - 1;
925 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
926 (unsigned long int) yystacksize));
928 if (yyssp >= yyss + yystacksize - 1)
932 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
941 /* Do appropriate processing given the current state. */
942 /* Read a lookahead token if we need one and don't already have one. */
945 /* First try to decide what to do without reference to lookahead token. */
947 yyn = yypact[yystate];
948 if (yyn == YYPACT_NINF)
951 /* Not known => get a lookahead token if don't already have one. */
953 /* yychar is either YYEMPTY or YYEOF
954 or a valid token in external form. */
956 if (yychar == YYEMPTY)
958 YYDPRINTF ((stderr, "Reading a token: "));
962 /* Convert token to internal form (in yychar1) for indexing tables with. */
964 if (yychar <= 0) /* This means end of input. */
967 yychar = YYEOF; /* Don't call YYLEX any more. */
969 YYDPRINTF ((stderr, "Now at end of input.\n"));
973 yychar1 = YYTRANSLATE (yychar);
975 /* We have to keep this `#if YYDEBUG', since we use variables
976 which are defined only if `YYDEBUG' is set. */
977 YYDPRINTF ((stderr, "Next token is "));
978 YYDSYMPRINT ((stderr, yychar1, yylval));
979 YYDPRINTF ((stderr, "\n"));
982 /* If the proper action on seeing token YYCHAR1 is to reduce or to
983 detect an error, take that action. */
985 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yychar1)
990 if (yyn == 0 || yyn == YYTABLE_NINF)
999 /* Shift the lookahead token. */
1000 YYDPRINTF ((stderr, "Shifting token %d (%s), ",
1001 yychar, yytname[yychar1]));
1003 /* Discard the token being shifted unless it is eof. */
1004 if (yychar != YYEOF)
1010 /* Count tokens shifted since error; after three, turn off error
1019 /*-----------------------------------------------------------.
1020 | yydefault -- do the default action for the current state. |
1021 `-----------------------------------------------------------*/
1023 yyn = yydefact[yystate];
1029 /*-----------------------------.
1030 | yyreduce -- Do a reduction. |
1031 `-----------------------------*/
1033 /* yyn is the number of a rule to reduce with. */
1036 /* If YYLEN is nonzero, implement the default value of the action:
1039 Otherwise, the following line sets YYVAL to garbage.
1040 This behavior is undocumented and Bison
1041 users should not rely upon it. Assigning to YYVAL
1042 unconditionally makes the parser a bit smaller, and it avoids a
1043 GCC warning that YYVAL may be used uninitialized. */
1044 yyval = yyvsp[1-yylen];
1049 /* We have to keep this `#if YYDEBUG', since we use variables which
1050 are defined only if `YYDEBUG' is set. */
1055 YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
1056 yyn - 1, yyrline[yyn]);
1058 /* Print the symbols being reduced, and their result. */
1059 for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++)
1060 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
1061 YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1067 #line 75 "ext_fcns.y"
1068 {Ext_fcns = yyvsp[0].ext_fcn_list_t;}
1072 #line 78 "ext_fcns.y"
1073 {yyval.ext_fcn_list_t = new ext_fcn_list(yyvsp[0].ext_fcn_t);}
1077 #line 79 "ext_fcns.y"
1078 {yyval.ext_fcn_list_t = yyvsp[-1].ext_fcn_list_t->append_ext_fcn_def(yyvsp[0].ext_fcn_t);}
1082 #line 82 "ext_fcns.y"
1084 yyval.ext_fcn_t=new ext_fcn_def(yyvsp[-10].strval,yyvsp[-9].tplist_t,yyvsp[-6].modif_t,yyvsp[-4].strval,yyvsp[-2].plist_t); delete yyvsp[-6].modif_t; delete yyvsp[-2].plist_t; }
1088 #line 84 "ext_fcns.y"
1090 yyval.ext_fcn_t=new ext_fcn_def(yyvsp[-7].strval,yyvsp[-6].tplist_t,NULL,yyvsp[-4].strval,yyvsp[-2].plist_t); delete yyvsp[-2].plist_t; }
1094 #line 86 "ext_fcns.y"
1096 yyval.ext_fcn_t=new ext_fcn_def(yyvsp[-6].modif_t,yyvsp[-4].strval,yyvsp[-2].plist_t); delete yyvsp[-6].modif_t; delete yyvsp[-2].plist_t; }
1100 #line 88 "ext_fcns.y"
1102 yyval.ext_fcn_t=new ext_fcn_def(NULL,yyvsp[-4].strval,yyvsp[-2].plist_t); delete yyvsp[-2].plist_t; }
1106 #line 90 "ext_fcns.y"
1108 yyval.ext_fcn_t=new ext_fcn_def(yyvsp[-11].strval,yyvsp[-10].tplist_t,yyvsp[-7].modif_t,yyvsp[-5].strval,yyvsp[-4].strval,yyvsp[-2].plist_t); delete yyvsp[-7].modif_t; delete yyvsp[-2].plist_t; }
1112 #line 92 "ext_fcns.y"
1114 yyval.ext_fcn_t=new ext_fcn_def(yyvsp[-8].strval,yyvsp[-7].tplist_t,NULL,yyvsp[-5].strval,yyvsp[-4].strval, yyvsp[-2].plist_t); delete yyvsp[-2].plist_t; }
1118 #line 94 "ext_fcns.y"
1120 yyval.ext_fcn_t=new ext_fcn_def(yyvsp[-12].strval,yyvsp[-11].tplist_t,yyvsp[-8].modif_t,yyvsp[-6].strval,yyvsp[-5].strval, yyvsp[-4].strval, yyvsp[-2].plist_t); delete yyvsp[-8].modif_t; delete yyvsp[-2].plist_t; }
1124 #line 96 "ext_fcns.y"
1126 yyval.ext_fcn_t=new ext_fcn_def(yyvsp[-9].strval,yyvsp[-8].tplist_t,NULL,yyvsp[-6].strval,yyvsp[-5].strval, yyvsp[-4].strval, yyvsp[-2].plist_t); delete yyvsp[-2].plist_t; }
1130 #line 98 "ext_fcns.y"
1132 yyval.ext_fcn_t=ext_fcn_def::make_sfun_def(yyvsp[-11].strval,yyvsp[-10].tplist_t,yyvsp[-7].modif_t,yyvsp[-5].strval,yyvsp[-4].strval,yyvsp[-2].plist_t); delete yyvsp[-2].plist_t; }
1136 #line 100 "ext_fcns.y"
1138 yyval.ext_fcn_t=ext_fcn_def::make_sfun_def(yyvsp[-8].strval,yyvsp[-7].tplist_t,NULL,yyvsp[-5].strval,yyvsp[-4].strval,yyvsp[-2].plist_t); delete yyvsp[-2].plist_t; }
1142 #line 102 "ext_fcns.y"
1144 yyval.ext_fcn_t=ext_fcn_def::make_state_def(yyvsp[-3].strval,yyvsp[-1].strval); }
1148 #line 108 "ext_fcns.y"
1149 {yyval.plist_t = NULL;}
1153 #line 109 "ext_fcns.y"
1154 {yyval.plist_t = yyvsp[0].plist_t;}
1158 #line 113 "ext_fcns.y"
1159 {yyval.modif_t = new ext_fcn_modifier_list(yyvsp[0].strval);}
1163 #line 114 "ext_fcns.y"
1164 {yyval.modif_t = new ext_fcn_modifier_list(yyvsp[-1].strval, yyvsp[0].strval);}
1168 #line 115 "ext_fcns.y"
1169 {yyval.modif_t = yyvsp[-2].modif_t->append(yyvsp[0].strval); }
1173 #line 116 "ext_fcns.y"
1174 {yyval.modif_t = yyvsp[-3].modif_t->append(yyvsp[-1].strval, yyvsp[0].strval); }
1178 #line 120 "ext_fcns.y"
1179 {yyval.plist_t = new ext_fcn_param_list(yyvsp[0].param_t);}
1183 #line 121 "ext_fcns.y"
1184 {yyval.plist_t = yyvsp[-2].plist_t->append(yyvsp[0].param_t);}
1188 #line 125 "ext_fcns.y"
1189 { yyval.param_t = new ext_fcn_param(yyvsp[-2].strval,yyvsp[-1].tplist_t,1,0,0);}
1193 #line 126 "ext_fcns.y"
1194 { yyval.param_t = new ext_fcn_param(yyvsp[-2].strval,yyvsp[-1].tplist_t,0,1,0);}
1198 #line 127 "ext_fcns.y"
1199 { yyval.param_t = new ext_fcn_param(yyvsp[-2].strval,yyvsp[-1].tplist_t,0,0,1);}
1203 #line 128 "ext_fcns.y"
1204 { yyval.param_t = new ext_fcn_param(yyvsp[-3].strval,yyvsp[-2].tplist_t,1,0,1);}
1208 #line 129 "ext_fcns.y"
1209 { yyval.param_t = new ext_fcn_param(yyvsp[-3].strval,yyvsp[-2].tplist_t,0,1,1);}
1213 #line 131 "ext_fcns.y"
1214 { yyval.param_t = new ext_fcn_param(yyvsp[-1].strval,yyvsp[0].tplist_t,0,0,0);}
1218 #line 135 "ext_fcns.y"
1219 {yyval.tplist_t = NULL;}
1223 #line 136 "ext_fcns.y"
1224 {yyval.tplist_t = yyvsp[-1].tplist_t;}
1228 #line 140 "ext_fcns.y"
1229 {yyval.tplist_t = new param_list(yyvsp[0].strval);}
1233 #line 141 "ext_fcns.y"
1234 {yyval.tplist_t = new param_list(yyvsp[-1].strval,yyvsp[0].strval);}
1238 #line 142 "ext_fcns.y"
1239 {yyval.tplist_t = new param_list(yyvsp[-1].strval,yyvsp[0].strval);}
1243 #line 143 "ext_fcns.y"
1244 {yyval.tplist_t = new param_list(yyvsp[-1].strval,yyvsp[0].strval);}
1248 #line 144 "ext_fcns.y"
1249 {yyval.tplist_t = yyvsp[-2].tplist_t->append(yyvsp[0].strval);}
1253 #line 145 "ext_fcns.y"
1254 {yyval.tplist_t = yyvsp[-3].tplist_t->append(yyvsp[-1].strval,yyvsp[0].strval);}
1258 #line 146 "ext_fcns.y"
1259 {yyval.tplist_t = yyvsp[-3].tplist_t->append(yyvsp[-1].strval,yyvsp[0].strval);}
1263 #line 147 "ext_fcns.y"
1264 {yyval.tplist_t = yyvsp[-3].tplist_t->append(yyvsp[-1].strval,yyvsp[0].strval);}
1270 /* Line 1016 of /usr/local/share/bison/yacc.c. */
1271 #line 1272 "ext_fcns.tab.cc"
1280 short *yyssp1 = yyss - 1;
1281 YYFPRINTF (stderr, "state stack now");
1282 while (yyssp1 != yyssp)
1283 YYFPRINTF (stderr, " %d", *++yyssp1);
1284 YYFPRINTF (stderr, "\n");
1291 /* Now `shift' the result of the reduction. Determine what state
1292 that goes to, based on the state we popped back to and the rule
1293 number reduced by. */
1297 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1298 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1299 yystate = yytable[yystate];
1301 yystate = yydefgoto[yyn - YYNTOKENS];
1306 /*------------------------------------.
1307 | yyerrlab -- here on detecting error |
1308 `------------------------------------*/
1310 /* If not already recovering from an error, report this error. */
1315 yyn = yypact[yystate];
1317 if (YYPACT_NINF < yyn && yyn < YYLAST)
1319 YYSIZE_T yysize = 0;
1320 int yytype = YYTRANSLATE (yychar);
1325 /* Start YYX at -YYN if negative to avoid negative indexes in
1327 for (yyx = yyn < 0 ? -yyn : 0;
1328 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1329 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1330 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1331 yysize += yystrlen ("parse error, unexpected ") + 1;
1332 yysize += yystrlen (yytname[yytype]);
1333 yymsg = (char *) YYSTACK_ALLOC (yysize);
1336 char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1337 yyp = yystpcpy (yyp, yytname[yytype]);
1342 for (yyx = yyn < 0 ? -yyn : 0;
1343 yyx < (int) (sizeof (yytname) / sizeof (char *));
1345 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1347 const char *yyq = ! yycount ? ", expecting " : " or ";
1348 yyp = yystpcpy (yyp, yyq);
1349 yyp = yystpcpy (yyp, yytname[yyx]);
1354 YYSTACK_FREE (yymsg);
1357 yyerror ("parse error; also virtual memory exhausted");
1360 #endif /* YYERROR_VERBOSE */
1361 yyerror ("parse error");
1366 /*----------------------------------------------------.
1367 | yyerrlab1 -- error raised explicitly by an action. |
1368 `----------------------------------------------------*/
1370 if (yyerrstatus == 3)
1372 /* If just tried and failed to reuse lookahead token after an
1373 error, discard it. */
1375 /* Return failure if at end of input. */
1376 if (yychar == YYEOF)
1378 /* Pop the error token. */
1380 /* Pop the rest of the stack. */
1381 while (yyssp > yyss)
1383 YYDPRINTF ((stderr, "Error: popping "));
1384 YYDSYMPRINT ((stderr,
1387 YYDPRINTF ((stderr, "\n"));
1388 yydestruct (yystos[*yyssp], *yyvsp);
1394 YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1395 yychar, yytname[yychar1]));
1396 yydestruct (yychar1, yylval);
1400 /* Else will try to reuse lookahead token after shifting the error
1403 yyerrstatus = 3; /* Each real token shifted decrements this. */
1407 yyn = yypact[yystate];
1408 if (yyn != YYPACT_NINF)
1411 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1419 /* Pop the current state because it cannot handle the error token. */
1423 YYDPRINTF ((stderr, "Error: popping "));
1424 YYDSYMPRINT ((stderr,
1425 yystos[*yyssp], *yyvsp));
1426 YYDPRINTF ((stderr, "\n"));
1428 yydestruct (yystos[yystate], *yyvsp);
1436 short *yyssp1 = yyss - 1;
1437 YYFPRINTF (stderr, "Error: state stack now");
1438 while (yyssp1 != yyssp)
1439 YYFPRINTF (stderr, " %d", *++yyssp1);
1440 YYFPRINTF (stderr, "\n");
1448 YYDPRINTF ((stderr, "Shifting error token, "));
1457 /*-------------------------------------.
1458 | yyacceptlab -- YYACCEPT comes here. |
1459 `-------------------------------------*/
1464 /*-----------------------------------.
1465 | yyabortlab -- YYABORT comes here. |
1466 `-----------------------------------*/
1472 /*----------------------------------------------.
1473 | yyoverflowlab -- parser overflow comes here. |
1474 `----------------------------------------------*/
1476 yyerror ("parser stack overflow");
1484 YYSTACK_FREE (yyss);
1490 #line 152 "ext_fcns.y"