2 /* A Bison parser, made from ../../../lib/com_err/parse.y
3 by GNU Bison version 1.28 */
5 #define YYBISON 1 /* Identify Bison output. */
16 #line 1 "../../../lib/com_err/parse.y"
19 * Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
20 * (Royal Institute of Technology, Stockholm, Sweden).
21 * All rights reserved.
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
27 * 1. Redistributions of source code must retain the above copyright
28 * notice, this list of conditions and the following disclaimer.
30 * 2. Redistributions in binary form must reproduce the above copyright
31 * notice, this list of conditions and the following disclaimer in the
32 * documentation and/or other materials provided with the distribution.
34 * 3. Neither the name of the Institute nor the names of its contributors
35 * may be used to endorse or promote products derived from this software
36 * without specific prior written permission.
38 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
39 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
41 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
42 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
43 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
44 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
45 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
46 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
47 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 #include "compile_et.h"
54 RCSID("$Id: parse.y,v 1.15 2005/06/16 19:21:42 lha Exp $");
56 void yyerror (char *s);
57 static long name2number(const char *str);
61 /* This is for bison */
63 #if !defined(alloca) && !defined(HAVE_ALLOCA)
64 #define alloca(x) malloc(x)
68 #line 53 "../../../lib/com_err/parse.y"
87 #define YYTRANSLATE(x) ((unsigned)(x) <= 264 ? yytranslate[x] : 18)
89 static const char yytranslate[] = { 0,
90 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
91 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
92 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
93 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
94 2, 2, 2, 11, 2, 2, 2, 2, 2, 2,
95 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
96 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
97 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
98 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
99 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
100 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
101 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
102 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
103 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
104 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
105 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
106 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
107 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
108 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
109 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
110 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
111 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
112 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
113 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
114 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
115 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
120 static const short yyprhs[] = { 0,
121 0, 1, 4, 7, 9, 12, 15, 19, 21, 24,
125 static const short yyrhs[] = { -1,
126 13, 16, 0, 14, 15, 0, 15, 0, 7, 9,
127 0, 3, 9, 0, 3, 9, 9, 0, 17, 0,
128 16, 17, 0, 4, 10, 0, 5, 9, 0, 5,
129 0, 6, 9, 11, 9, 0, 8, 0
135 static const short yyrline[] = { 0,
136 64, 65, 68, 69, 72, 78, 84, 93, 94, 97,
142 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
144 static const char * const yytname[] = { "$","error","$undefined.","ET","INDEX",
145 "PREFIX","EC","ID","END","STRING","NUMBER","','","file","header","id","et","statements",
150 static const short yyr1[] = { 0,
151 12, 12, 13, 13, 14, 15, 15, 16, 16, 17,
155 static const short yyr2[] = { 0,
156 0, 2, 2, 1, 2, 2, 3, 1, 2, 2,
160 static const short yydefact[] = { 1,
161 0, 0, 0, 0, 4, 6, 5, 0, 12, 0,
162 14, 2, 8, 3, 7, 10, 11, 0, 9, 0,
166 static const short yydefgoto[] = { 22,
170 static const short yypact[] = { 0,
171 -3, -1, -4, 2,-32768, 1,-32768, 3, 5, 6,
172 -32768, -4,-32768,-32768,-32768,-32768,-32768, -2,-32768, 7,
173 -32768, 11, 12,-32768
176 static const short yypgoto[] = {-32768,
177 -32768,-32768, 13,-32768, 8
184 static const short yytable[] = { 8,
185 9, 10, 1, 11, 1, 6, 2, 7, 20, 15,
186 23, 24, 16, 17, 18, 21, 14, 0, 0, 19
189 static const short yycheck[] = { 4,
190 5, 6, 3, 8, 3, 9, 7, 9, 11, 9,
191 0, 0, 10, 9, 9, 9, 4, -1, -1, 12
193 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
194 #line 3 "/usr/share/bison.simple"
195 /* This file comes from bison-1.28. */
197 /* Skeleton output parser for bison,
198 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
200 This program is free software; you can redistribute it and/or modify
201 it under the terms of the GNU General Public License as published by
202 the Free Software Foundation; either version 2, or (at your option)
205 This program is distributed in the hope that it will be useful,
206 but WITHOUT ANY WARRANTY; without even the implied warranty of
207 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
208 GNU General Public License for more details.
210 You should have received a copy of the GNU General Public License
211 along with this program; if not, write to the Free Software
212 Foundation, Inc., 59 Temple Place - Suite 330,
213 Boston, MA 02111-1307, USA. */
215 /* As a special exception, when this file is copied by Bison into a
216 Bison output file, you may use that output file without restriction.
217 This special exception was added by the Free Software Foundation
218 in version 1.24 of Bison. */
220 /* This is the parser code that is written into each bison parser
221 when the %semantic_parser declaration is not specified in the grammar.
222 It was written by Richard Stallman by simplifying the hairy parser
223 used when %semantic_parser is specified. */
225 #ifndef YYSTACK_USE_ALLOCA
227 #define YYSTACK_USE_ALLOCA
228 #else /* alloca not defined */
230 #define YYSTACK_USE_ALLOCA
231 #define alloca __builtin_alloca
232 #else /* not GNU C. */
233 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
234 #define YYSTACK_USE_ALLOCA
236 #else /* not sparc */
237 /* We think this test detects Watcom and Microsoft C. */
238 /* This used to test MSDOS, but that is a bad idea
239 since that symbol is in the user namespace. */
240 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
241 #if 0 /* No need for malloc.h, which pollutes the namespace;
242 instead, just don't use alloca. */
245 #else /* not MSDOS, or __TURBOC__ */
247 /* I don't know what this was needed for, but it pollutes the namespace.
248 So I turned it off. rms, 2 May 1997. */
249 /* #include <malloc.h> */
251 #define YYSTACK_USE_ALLOCA
252 #else /* not MSDOS, or __TURBOC__, or _AIX */
254 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
255 and on HPUX 10. Eventually we can turn this on. */
256 #define YYSTACK_USE_ALLOCA
257 #define alloca __builtin_alloca
260 #endif /* not _AIX */
261 #endif /* not MSDOS, or __TURBOC__ */
262 #endif /* not sparc */
263 #endif /* not GNU C */
264 #endif /* alloca not defined */
265 #endif /* YYSTACK_USE_ALLOCA not defined */
267 #ifdef YYSTACK_USE_ALLOCA
268 #define YYSTACK_ALLOC alloca
270 #define YYSTACK_ALLOC malloc
273 /* Note: there must be only one dollar sign in this file.
274 It is replaced by the list of actions, each action
275 as one case of the switch. */
277 #define yyerrok (yyerrstatus = 0)
278 #define yyclearin (yychar = YYEMPTY)
281 #define YYACCEPT goto yyacceptlab
282 #define YYABORT goto yyabortlab
283 #define YYERROR goto yyerrlab1
284 /* Like YYERROR except do call yyerror.
285 This remains here temporarily to ease the
286 transition to the new meaning of YYERROR, for GCC.
287 Once GCC version 2 has supplanted version 1, this can go. */
288 #define YYFAIL goto yyerrlab
289 #define YYRECOVERING() (!!yyerrstatus)
290 #define YYBACKUP(token, value) \
292 if (yychar == YYEMPTY && yylen == 1) \
293 { yychar = (token), yylval = (value); \
294 yychar1 = YYTRANSLATE (yychar); \
299 { yyerror ("syntax error: cannot back up"); YYERROR; } \
303 #define YYERRCODE 256
306 #define YYLEX yylex()
312 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
314 #define YYLEX yylex(&yylval, &yylloc)
316 #else /* not YYLSP_NEEDED */
318 #define YYLEX yylex(&yylval, YYLEX_PARAM)
320 #define YYLEX yylex(&yylval)
322 #endif /* not YYLSP_NEEDED */
325 /* If nonreentrant, generate the variables here */
329 int yychar; /* the lookahead symbol */
330 YYSTYPE yylval; /* the semantic value of the */
331 /* lookahead symbol */
334 YYLTYPE yylloc; /* location data for the lookahead */
338 int yynerrs; /* number of parse errors so far */
339 #endif /* not YYPURE */
342 int yydebug; /* nonzero means print parse trace */
343 /* Since this is uninitialized, it does not stop multiple parsers
347 /* YYINITDEPTH indicates the initial size of the parser's stacks */
350 #define YYINITDEPTH 200
353 /* YYMAXDEPTH is the maximum size the stacks can grow to
354 (effective only if the built-in stack extension method is used). */
361 #define YYMAXDEPTH 10000
364 /* Define __yy_memcpy. Note that the size argument
365 should be passed with type unsigned int, because that is what the non-GCC
366 definitions require. With GCC, __builtin_memcpy takes an arg
367 of type size_t, but it can handle unsigned int. */
369 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
370 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
371 #else /* not GNU C or C++ */
374 /* This is the most reliable way to avoid incompatibilities
375 in available built-in functions on various systems. */
377 __yy_memcpy (to, from, count)
382 register char *f = from;
383 register char *t = to;
384 register int i = count;
390 #else /* __cplusplus */
392 /* This is the most reliable way to avoid incompatibilities
393 in available built-in functions on various systems. */
395 __yy_memcpy (char *to, char *from, unsigned int count)
397 register char *t = to;
398 register char *f = from;
399 register int i = count;
408 #line 217 "/usr/share/bison.simple"
410 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
411 into yyparse. The argument should have type void *.
412 It should actually point to an object.
413 Grammar actions can access the variable by casting it
414 to the proper pointer type. */
418 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
419 #define YYPARSE_PARAM_DECL
420 #else /* not __cplusplus */
421 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
422 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
423 #endif /* not __cplusplus */
424 #else /* not YYPARSE_PARAM */
425 #define YYPARSE_PARAM_ARG
426 #define YYPARSE_PARAM_DECL
427 #endif /* not YYPARSE_PARAM */
429 /* Prevent warning if -Wstrict-prototypes. */
432 int yyparse (void *);
439 yyparse(YYPARSE_PARAM_ARG)
442 register int yystate;
444 register short *yyssp;
445 register YYSTYPE *yyvsp;
446 int yyerrstatus; /* number of tokens to shift before error messages enabled */
447 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
449 short yyssa[YYINITDEPTH]; /* the state stack */
450 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
452 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
453 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
456 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
457 YYLTYPE *yyls = yylsa;
460 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
462 #define YYPOPSTACK (yyvsp--, yyssp--)
465 int yystacksize = YYINITDEPTH;
466 int yyfree_stacks = 0;
477 YYSTYPE yyval; /* the variable used to return */
478 /* semantic values from the action */
485 fprintf(stderr, "Starting parse\n");
491 yychar = YYEMPTY; /* Cause a token to be read. */
493 /* Initialize stack pointers.
494 Waste one element of value and location stack
495 so that they stay on the same level as the state stack.
496 The wasted elements are never initialized. */
504 /* Push a new state, which is found in yystate . */
505 /* In all cases, when you get here, the value and location stacks
506 have just been pushed. so pushing a state here evens the stacks. */
511 if (yyssp >= yyss + yystacksize - 1)
513 /* Give user a chance to reallocate the stack */
514 /* Use copies of these so that the &'s don't force the real ones into memory. */
515 YYSTYPE *yyvs1 = yyvs;
518 YYLTYPE *yyls1 = yyls;
521 /* Get the current used size of the three stacks, in elements. */
522 int size = yyssp - yyss + 1;
525 /* Each stack pointer address is followed by the size of
526 the data in use in that stack, in bytes. */
528 /* This used to be a conditional around just the two extra args,
529 but that might be undefined if yyoverflow is a macro. */
530 yyoverflow("parser stack overflow",
531 &yyss1, size * sizeof (*yyssp),
532 &yyvs1, size * sizeof (*yyvsp),
533 &yyls1, size * sizeof (*yylsp),
536 yyoverflow("parser stack overflow",
537 &yyss1, size * sizeof (*yyssp),
538 &yyvs1, size * sizeof (*yyvsp),
542 yyss = yyss1; yyvs = yyvs1;
546 #else /* no yyoverflow */
547 /* Extend the stack our own way. */
548 if (yystacksize >= YYMAXDEPTH)
550 yyerror("parser stack overflow");
562 if (yystacksize > YYMAXDEPTH)
563 yystacksize = YYMAXDEPTH;
564 #ifndef YYSTACK_USE_ALLOCA
567 yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
568 __yy_memcpy ((char *)yyss, (char *)yyss1,
569 size * (unsigned int) sizeof (*yyssp));
570 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
571 __yy_memcpy ((char *)yyvs, (char *)yyvs1,
572 size * (unsigned int) sizeof (*yyvsp));
574 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
575 __yy_memcpy ((char *)yyls, (char *)yyls1,
576 size * (unsigned int) sizeof (*yylsp));
578 #endif /* no yyoverflow */
580 yyssp = yyss + size - 1;
581 yyvsp = yyvs + size - 1;
583 yylsp = yyls + size - 1;
588 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
591 if (yyssp >= yyss + yystacksize - 1)
597 fprintf(stderr, "Entering state %d\n", yystate);
603 /* Do appropriate processing given the current state. */
604 /* Read a lookahead token if we need one and don't already have one. */
607 /* First try to decide what to do without reference to lookahead token. */
609 yyn = yypact[yystate];
613 /* Not known => get a lookahead token if don't already have one. */
615 /* yychar is either YYEMPTY or YYEOF
616 or a valid token in external form. */
618 if (yychar == YYEMPTY)
622 fprintf(stderr, "Reading a token: ");
627 /* Convert token to internal form (in yychar1) for indexing tables with */
629 if (yychar <= 0) /* This means end of input. */
632 yychar = YYEOF; /* Don't call YYLEX any more */
636 fprintf(stderr, "Now at end of input.\n");
641 yychar1 = YYTRANSLATE(yychar);
646 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
647 /* Give the individual parser a way to print the precise meaning
648 of a token, for further debugging info. */
650 YYPRINT (stderr, yychar, yylval);
652 fprintf (stderr, ")\n");
658 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
663 /* yyn is what to do for this token type in this state.
664 Negative => reduce, -yyn is rule number.
665 Positive => shift, yyn is new state.
666 New state is final state => don't bother to shift,
668 0, or most negative number => error. */
683 /* Shift the lookahead token. */
687 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
690 /* Discard the token being shifted unless it is eof. */
699 /* count tokens shifted since error; after three, turn off error status. */
700 if (yyerrstatus) yyerrstatus--;
705 /* Do the default action for the current state. */
708 yyn = yydefact[yystate];
712 /* Do a reduction. yyn is the number of a rule to reduce with. */
716 yyval = yyvsp[1-yylen]; /* implement default value of the action */
723 fprintf (stderr, "Reducing via rule %d (line %d), ",
726 /* Print the symbols being reduced, and their result. */
727 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
728 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
729 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
737 #line 73 "../../../lib/com_err/parse.y"
739 id_str = yyvsp[0].string;
743 #line 79 "../../../lib/com_err/parse.y"
745 base_id = name2number(yyvsp[0].string);
746 strlcpy(name, yyvsp[0].string, sizeof(name));
747 free(yyvsp[0].string);
751 #line 85 "../../../lib/com_err/parse.y"
753 base_id = name2number(yyvsp[-1].string);
754 strlcpy(name, yyvsp[0].string, sizeof(name));
755 free(yyvsp[-1].string);
756 free(yyvsp[0].string);
760 #line 98 "../../../lib/com_err/parse.y"
762 number = yyvsp[0].number;
766 #line 102 "../../../lib/com_err/parse.y"
769 asprintf (&prefix, "%s_", yyvsp[0].string);
772 free(yyvsp[0].string);
776 #line 110 "../../../lib/com_err/parse.y"
778 prefix = realloc(prefix, 1);
785 #line 117 "../../../lib/com_err/parse.y"
787 struct error_code *ec = malloc(sizeof(*ec));
794 if(prefix && *prefix != '\0') {
795 asprintf (&ec->name, "%s%s", prefix, yyvsp[-2].string);
796 if (ec->name == NULL)
798 free(yyvsp[-2].string);
800 ec->name = yyvsp[-2].string;
801 ec->string = yyvsp[0].string;
807 #line 137 "../../../lib/com_err/parse.y"
813 /* the action file gets copied in in place of this dollarsign */
814 #line 543 "/usr/share/bison.simple"
825 short *ssp1 = yyss - 1;
826 fprintf (stderr, "state stack now");
827 while (ssp1 != yyssp)
828 fprintf (stderr, " %d", *++ssp1);
829 fprintf (stderr, "\n");
839 yylsp->first_line = yylloc.first_line;
840 yylsp->first_column = yylloc.first_column;
841 yylsp->last_line = (yylsp-1)->last_line;
842 yylsp->last_column = (yylsp-1)->last_column;
847 yylsp->last_line = (yylsp+yylen-1)->last_line;
848 yylsp->last_column = (yylsp+yylen-1)->last_column;
852 /* Now "shift" the result of the reduction.
853 Determine what state that goes to,
854 based on the state we popped back to
855 and the rule number reduced by. */
859 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
860 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
861 yystate = yytable[yystate];
863 yystate = yydefgoto[yyn - YYNTBASE];
867 yyerrlab: /* here on detecting error */
870 /* If not already recovering from an error, report this error. */
874 #ifdef YYERROR_VERBOSE
875 yyn = yypact[yystate];
877 if (yyn > YYFLAG && yyn < YYLAST)
884 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
885 for (x = (yyn < 0 ? -yyn : 0);
886 x < (sizeof(yytname) / sizeof(char *)); x++)
887 if (yycheck[x + yyn] == x)
888 size += strlen(yytname[x]) + 15, count++;
889 msg = (char *) malloc(size + 15);
892 strcpy(msg, "parse error");
897 for (x = (yyn < 0 ? -yyn : 0);
898 x < (sizeof(yytname) / sizeof(char *)); x++)
899 if (yycheck[x + yyn] == x)
901 strcat(msg, count == 0 ? ", expecting `" : " or `");
902 strcat(msg, yytname[x]);
911 yyerror ("parse error; also virtual memory exceeded");
914 #endif /* YYERROR_VERBOSE */
915 yyerror("parse error");
919 yyerrlab1: /* here on error raised explicitly by an action */
921 if (yyerrstatus == 3)
923 /* if just tried and failed to reuse lookahead token after an error, discard it. */
925 /* return failure if at end of input */
931 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
937 /* Else will try to reuse lookahead token
938 after shifting the error token. */
940 yyerrstatus = 3; /* Each real token shifted decrements this */
944 yyerrdefault: /* current state does not do anything special for the error token. */
947 /* This is wrong; only states that explicitly want error tokens
948 should shift them. */
949 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
950 if (yyn) goto yydefault;
953 yyerrpop: /* pop the current state because it cannot handle the error token */
955 if (yyssp == yyss) YYABORT;
965 short *ssp1 = yyss - 1;
966 fprintf (stderr, "Error: state stack now");
967 while (ssp1 != yyssp)
968 fprintf (stderr, " %d", *++ssp1);
969 fprintf (stderr, "\n");
975 yyn = yypact[yystate];
980 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
999 fprintf(stderr, "Shifting error token, ");
1011 /* YYACCEPT comes here. */
1023 /* YYABORT comes here. */
1034 #line 142 "../../../lib/com_err/parse.y"
1038 name2number(const char *str)
1042 const char *x = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
1043 "abcdefghijklmnopqrstuvwxyz0123456789_";
1044 if(strlen(str) > 4) {
1045 yyerror("table name too long");
1048 for(p = str; *p; p++){
1049 char *q = strchr(x, *p);
1051 yyerror("invalid character in table name");
1054 num = (num << 6) + (q - x) + 1;
1057 if(num > 0x7fffffff)
1058 num = -(0xffffffff - num + 1);
1065 error_message ("%s\n", s);