xref: /openbsd/gnu/usr.bin/binutils/gdb/m2-exp.c (revision f6aab3d8)
1 /* A Bison parser, made by GNU Bison 1.875c.  */
2 
3 /* Skeleton parser for Yacc-like parsing with Bison,
4    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
5 
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)
9    any later version.
10 
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.
15 
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.  */
20 
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.  */
25 
26 /* Written by Richard Stallman by simplifying the original so called
27    ``semantic'' parser.  */
28 
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.  */
35 
36 /* Identify Bison output.  */
37 #define YYBISON 1
38 
39 /* Skeleton name.  */
40 #define YYSKELETON_NAME "yacc.c"
41 
42 /* Pure parsers.  */
43 #define YYPURE 0
44 
45 /* Using locations.  */
46 #define YYLSP_NEEDED 0
47 
48 
49 
50 /* Tokens.  */
51 #ifndef YYTOKENTYPE
52 # define YYTOKENTYPE
53    /* Put the tokens into the symbol table, so that GDB and other debuggers
54       know about them.  */
55    enum yytokentype {
56      INT = 258,
57      HEX = 259,
58      ERROR = 260,
59      UINT = 261,
60      M2_TRUE = 262,
61      M2_FALSE = 263,
62      CHAR = 264,
63      FLOAT = 265,
64      STRING = 266,
65      NAME = 267,
66      BLOCKNAME = 268,
67      IDENT = 269,
68      VARNAME = 270,
69      TYPENAME = 271,
70      SIZE = 272,
71      CAP = 273,
72      ORD = 274,
73      HIGH = 275,
74      ABS = 276,
75      MIN_FUNC = 277,
76      MAX_FUNC = 278,
77      FLOAT_FUNC = 279,
78      VAL = 280,
79      CHR = 281,
80      ODD = 282,
81      TRUNC = 283,
82      INC = 284,
83      DEC = 285,
84      INCL = 286,
85      EXCL = 287,
86      COLONCOLON = 288,
87      INTERNAL_VAR = 289,
88      ABOVE_COMMA = 290,
89      ASSIGN = 291,
90      IN = 292,
91      NOTEQUAL = 293,
92      GEQ = 294,
93      LEQ = 295,
94      OROR = 296,
95      LOGICAL_AND = 297,
96      MOD = 298,
97      DIV = 299,
98      UNARY = 300,
99      DOT = 301,
100      NOT = 302,
101      QID = 303
102    };
103 #endif
104 #define INT 258
105 #define HEX 259
106 #define ERROR 260
107 #define UINT 261
108 #define M2_TRUE 262
109 #define M2_FALSE 263
110 #define CHAR 264
111 #define FLOAT 265
112 #define STRING 266
113 #define NAME 267
114 #define BLOCKNAME 268
115 #define IDENT 269
116 #define VARNAME 270
117 #define TYPENAME 271
118 #define SIZE 272
119 #define CAP 273
120 #define ORD 274
121 #define HIGH 275
122 #define ABS 276
123 #define MIN_FUNC 277
124 #define MAX_FUNC 278
125 #define FLOAT_FUNC 279
126 #define VAL 280
127 #define CHR 281
128 #define ODD 282
129 #define TRUNC 283
130 #define INC 284
131 #define DEC 285
132 #define INCL 286
133 #define EXCL 287
134 #define COLONCOLON 288
135 #define INTERNAL_VAR 289
136 #define ABOVE_COMMA 290
137 #define ASSIGN 291
138 #define IN 292
139 #define NOTEQUAL 293
140 #define GEQ 294
141 #define LEQ 295
142 #define OROR 296
143 #define LOGICAL_AND 297
144 #define MOD 298
145 #define DIV 299
146 #define UNARY 300
147 #define DOT 301
148 #define NOT 302
149 #define QID 303
150 
151 
152 
153 
154 /* Copy the first part of user declarations.  */
155 #line 41 "m2-exp.y"
156 
157 
158 #include "defs.h"
159 #include "gdb_string.h"
160 #include "expression.h"
161 #include "language.h"
162 #include "value.h"
163 #include "parser-defs.h"
164 #include "m2-lang.h"
165 #include "bfd.h" /* Required by objfiles.h.  */
166 #include "symfile.h" /* Required by objfiles.h.  */
167 #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
168 #include "block.h"
169 
170 /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
171    as well as gratuitiously global symbol names, so we can have multiple
172    yacc generated parsers in gdb.  Note that these are only the variables
173    produced by yacc.  If other parser generators (bison, byacc, etc) produce
174    additional global names that conflict at link time, then those parser
175    generators need to be fixed instead of adding those names to this list. */
176 
177 #define	yymaxdepth m2_maxdepth
178 #define	yyparse	m2_parse
179 #define	yylex	m2_lex
180 #define	yyerror	m2_error
181 #define	yylval	m2_lval
182 #define	yychar	m2_char
183 #define	yydebug	m2_debug
184 #define	yypact	m2_pact
185 #define	yyr1	m2_r1
186 #define	yyr2	m2_r2
187 #define	yydef	m2_def
188 #define	yychk	m2_chk
189 #define	yypgo	m2_pgo
190 #define	yyact	m2_act
191 #define	yyexca	m2_exca
192 #define	yyerrflag m2_errflag
193 #define	yynerrs	m2_nerrs
194 #define	yyps	m2_ps
195 #define	yypv	m2_pv
196 #define	yys	m2_s
197 #define	yy_yys	m2_yys
198 #define	yystate	m2_state
199 #define	yytmp	m2_tmp
200 #define	yyv	m2_v
201 #define	yy_yyv	m2_yyv
202 #define	yyval	m2_val
203 #define	yylloc	m2_lloc
204 #define	yyreds	m2_reds		/* With YYDEBUG defined */
205 #define	yytoks	m2_toks		/* With YYDEBUG defined */
206 #define yyname	m2_name		/* With YYDEBUG defined */
207 #define yyrule	m2_rule		/* With YYDEBUG defined */
208 #define yylhs	m2_yylhs
209 #define yylen	m2_yylen
210 #define yydefred m2_yydefred
211 #define yydgoto	m2_yydgoto
212 #define yysindex m2_yysindex
213 #define yyrindex m2_yyrindex
214 #define yygindex m2_yygindex
215 #define yytable	 m2_yytable
216 #define yycheck	 m2_yycheck
217 
218 #ifndef YYDEBUG
219 #define	YYDEBUG 1		/* Default to yydebug support */
220 #endif
221 
222 #define YYFPRINTF parser_fprintf
223 
224 int yyparse (void);
225 
226 static int yylex (void);
227 
228 void yyerror (char *);
229 
230 #if 0
231 static char *make_qualname (char *, char *);
232 #endif
233 
234 static int parse_number (int);
235 
236 /* The sign of the number being parsed. */
237 static int number_sign = 1;
238 
239 /* The block that the module specified by the qualifer on an identifer is
240    contained in, */
241 #if 0
242 static struct block *modblock=0;
243 #endif
244 
245 
246 
247 /* Enabling traces.  */
248 #ifndef YYDEBUG
249 # define YYDEBUG 0
250 #endif
251 
252 /* Enabling verbose error messages.  */
253 #ifdef YYERROR_VERBOSE
254 # undef YYERROR_VERBOSE
255 # define YYERROR_VERBOSE 1
256 #else
257 # define YYERROR_VERBOSE 0
258 #endif
259 
260 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
261 #line 137 "m2-exp.y"
262 typedef union YYSTYPE {
263     LONGEST lval;
264     ULONGEST ulval;
265     DOUBLEST dval;
266     struct symbol *sym;
267     struct type *tval;
268     struct stoken sval;
269     int voidval;
270     struct block *bval;
271     enum exp_opcode opcode;
272     struct internalvar *ivar;
273 
274     struct type **tvec;
275     int *ivec;
276   } YYSTYPE;
277 /* Line 191 of yacc.c.  */
278 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
279 # define YYSTYPE_IS_DECLARED 1
280 # define YYSTYPE_IS_TRIVIAL 1
281 #endif
282 
283 
284 
285 /* Copy the second part of user declarations.  */
286 
287 
288 /* Line 214 of yacc.c.  */
289 
290 #if ! defined (yyoverflow) || YYERROR_VERBOSE
291 
292 # ifndef YYFREE
293 #  define YYFREE free
294 # endif
295 # ifndef YYMALLOC
296 #  define YYMALLOC xmalloc
297 # endif
298 
299 /* The parser invokes alloca or xmalloc; define the necessary symbols.  */
300 
301 # ifdef YYSTACK_USE_ALLOCA
302 #  if YYSTACK_USE_ALLOCA
303 #   define YYSTACK_ALLOC alloca
304 #  endif
305 # else
306 #  if defined (alloca) || defined (_ALLOCA_H)
307 #   define YYSTACK_ALLOC alloca
308 #  else
309 #   ifdef __GNUC__
310 #    define YYSTACK_ALLOC __builtin_alloca
311 #   endif
312 #  endif
313 # endif
314 
315 # ifdef YYSTACK_ALLOC
316    /* Pacify GCC's `empty if-body' warning. */
317 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
318 # else
319 #  if defined (__STDC__) || defined (__cplusplus)
320 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
321 #   define YYSIZE_T size_t
322 #  endif
323 #  define YYSTACK_ALLOC YYMALLOC
324 #  define YYSTACK_FREE YYFREE
325 # endif
326 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
327 
328 
329 #if (! defined (yyoverflow) \
330      && (! defined (__cplusplus) \
331 	 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
332 
333 /* A type that is properly aligned for any stack member.  */
334 union yyalloc
335 {
336   short yyss;
337   YYSTYPE yyvs;
338   };
339 
340 /* The size of the maximum gap between one aligned stack and the next.  */
341 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
342 
343 /* The size of an array large to enough to hold all stacks, each with
344    N elements.  */
345 # define YYSTACK_BYTES(N) \
346      ((N) * (sizeof (short) + sizeof (YYSTYPE))				\
347       + YYSTACK_GAP_MAXIMUM)
348 
349 /* Copy COUNT objects from FROM to TO.  The source and destination do
350    not overlap.  */
351 # ifndef YYCOPY
352 #  if defined (__GNUC__) && 1 < __GNUC__
353 #   define YYCOPY(To, From, Count) \
354       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
355 #  else
356 #   define YYCOPY(To, From, Count)		\
357       do					\
358 	{					\
359 	  register YYSIZE_T yyi;		\
360 	  for (yyi = 0; yyi < (Count); yyi++)	\
361 	    (To)[yyi] = (From)[yyi];		\
362 	}					\
363       while (0)
364 #  endif
365 # endif
366 
367 /* Relocate STACK from its old location to the new one.  The
368    local variables YYSIZE and YYSTACKSIZE give the old and new number of
369    elements in the stack, and YYPTR gives the new location of the
370    stack.  Advance YYPTR to a properly aligned location for the next
371    stack.  */
372 # define YYSTACK_RELOCATE(Stack)					\
373     do									\
374       {									\
375 	YYSIZE_T yynewbytes;						\
376 	YYCOPY (&yyptr->Stack, Stack, yysize);				\
377 	Stack = &yyptr->Stack;						\
378 	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
379 	yyptr += yynewbytes / sizeof (*yyptr);				\
380       }									\
381     while (0)
382 
383 #endif
384 
385 #if defined (__STDC__) || defined (__cplusplus)
386    typedef signed char yysigned_char;
387 #else
388    typedef short yysigned_char;
389 #endif
390 
391 /* YYFINAL -- State number of the termination state. */
392 #define YYFINAL  67
393 /* YYLAST -- Last index in YYTABLE.  */
394 #define YYLAST   848
395 
396 /* YYNTOKENS -- Number of terminals. */
397 #define YYNTOKENS  68
398 /* YYNNTS -- Number of nonterminals. */
399 #define YYNNTS  15
400 /* YYNRULES -- Number of rules. */
401 #define YYNRULES  80
402 /* YYNRULES -- Number of states. */
403 #define YYNSTATES  181
404 
405 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
406 #define YYUNDEFTOK  2
407 #define YYMAXUTOK   303
408 
409 #define YYTRANSLATE(YYX) 						\
410   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
411 
412 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
413 static const unsigned char yytranslate[] =
414 {
415        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
416        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
417        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
418        2,     2,     2,     2,     2,    41,     2,     2,    47,     2,
419       59,    64,    52,    50,    35,    51,     2,    53,     2,     2,
420        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
421       38,    40,    39,     2,    49,     2,     2,     2,     2,     2,
422        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
423        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
424        2,    58,     2,    67,    57,     2,     2,     2,     2,     2,
425        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
426        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
427        2,     2,     2,    65,     2,    66,    61,     2,     2,     2,
428        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
429        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
430        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
431        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
432        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
433        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
434        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
435        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
436        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
437        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
438        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
439        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
440        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
441        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
442       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
443       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
444       36,    37,    42,    43,    44,    45,    46,    48,    54,    55,
445       56,    60,    62,    63
446 };
447 
448 #if YYDEBUG
449 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
450    YYRHS.  */
451 static const unsigned short yyprhs[] =
452 {
453        0,     0,     3,     5,     7,     9,    12,    13,    17,    20,
454       23,    25,    27,    32,    37,    42,    47,    52,    57,    62,
455       69,    74,    79,    84,    87,    92,    99,   104,   111,   115,
456      117,   121,   128,   135,   139,   144,   145,   151,   152,   158,
457      159,   161,   165,   167,   171,   176,   181,   185,   189,   193,
458      197,   201,   205,   209,   213,   217,   221,   225,   229,   233,
459      237,   241,   245,   249,   253,   255,   257,   259,   261,   263,
460      265,   267,   272,   274,   276,   278,   282,   284,   286,   290,
461      292
462 };
463 
464 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
465 static const yysigned_char yyrhs[] =
466 {
467       69,     0,    -1,    71,    -1,    70,    -1,    82,    -1,    71,
468       57,    -1,    -1,    51,    72,    71,    -1,    50,    71,    -1,
469       73,    71,    -1,    62,    -1,    61,    -1,    18,    59,    71,
470       64,    -1,    19,    59,    71,    64,    -1,    21,    59,    71,
471       64,    -1,    20,    59,    71,    64,    -1,    22,    59,    82,
472       64,    -1,    23,    59,    82,    64,    -1,    24,    59,    71,
473       64,    -1,    25,    59,    82,    35,    71,    64,    -1,    26,
474       59,    71,    64,    -1,    27,    59,    71,    64,    -1,    28,
475       59,    71,    64,    -1,    17,    71,    -1,    29,    59,    71,
476       64,    -1,    29,    59,    71,    35,    71,    64,    -1,    30,
477       59,    71,    64,    -1,    30,    59,    71,    35,    71,    64,
478       -1,    71,    60,    12,    -1,    74,    -1,    71,    42,    74,
479       -1,    31,    59,    71,    35,    71,    64,    -1,    32,    59,
480       71,    35,    71,    64,    -1,    65,    77,    66,    -1,    82,
481       65,    77,    66,    -1,    -1,    71,    58,    75,    78,    67,
482       -1,    -1,    71,    59,    76,    77,    64,    -1,    -1,    71,
483       -1,    77,    35,    71,    -1,    71,    -1,    78,    35,    71,
484       -1,    65,    82,    66,    71,    -1,    82,    59,    71,    64,
485       -1,    59,    71,    64,    -1,    71,    49,    71,    -1,    71,
486       52,    71,    -1,    71,    53,    71,    -1,    71,    55,    71,
487       -1,    71,    54,    71,    -1,    71,    50,    71,    -1,    71,
488       51,    71,    -1,    71,    40,    71,    -1,    71,    43,    71,
489       -1,    71,    41,    71,    -1,    71,    45,    71,    -1,    71,
490       44,    71,    -1,    71,    38,    71,    -1,    71,    39,    71,
491       -1,    71,    48,    71,    -1,    71,    46,    71,    -1,    71,
492       37,    71,    -1,     7,    -1,     8,    -1,     3,    -1,     6,
493       -1,     9,    -1,    10,    -1,    81,    -1,    17,    59,    82,
494       64,    -1,    11,    -1,    80,    -1,    13,    -1,    79,    33,
495       13,    -1,    80,    -1,    34,    -1,    79,    33,    12,    -1,
496       12,    -1,    16,    -1
497 };
498 
499 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
500 static const unsigned short yyrline[] =
501 {
502        0,   205,   205,   206,   209,   218,   223,   222,   229,   233,
503      237,   238,   241,   245,   249,   253,   257,   263,   269,   273,
504      279,   283,   287,   291,   296,   300,   306,   310,   316,   322,
505      325,   329,   333,   337,   339,   349,   345,   359,   356,   366,
506      369,   373,   378,   383,   388,   394,   400,   408,   412,   416,
507      420,   424,   428,   432,   436,   440,   442,   446,   450,   454,
508      458,   462,   466,   470,   477,   483,   489,   496,   505,   513,
509      520,   523,   530,   537,   541,   550,   562,   570,   574,   590,
510      641
511 };
512 #endif
513 
514 #if YYDEBUG || YYERROR_VERBOSE
515 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
516    First, the terminals, then, starting at YYNTOKENS, nonterminals. */
517 static const char *const yytname[] =
518 {
519   "$end", "error", "$undefined", "INT", "HEX", "ERROR", "UINT", "M2_TRUE",
520   "M2_FALSE", "CHAR", "FLOAT", "STRING", "NAME", "BLOCKNAME", "IDENT",
521   "VARNAME", "TYPENAME", "SIZE", "CAP", "ORD", "HIGH", "ABS", "MIN_FUNC",
522   "MAX_FUNC", "FLOAT_FUNC", "VAL", "CHR", "ODD", "TRUNC", "INC", "DEC",
523   "INCL", "EXCL", "COLONCOLON", "INTERNAL_VAR", "','", "ABOVE_COMMA",
524   "ASSIGN", "'<'", "'>'", "'='", "'#'", "IN", "NOTEQUAL", "GEQ", "LEQ",
525   "OROR", "'&'", "LOGICAL_AND", "'@'", "'+'", "'-'", "'*'", "'/'", "MOD",
526   "DIV", "UNARY", "'^'", "'['", "'('", "DOT", "'~'", "NOT", "QID", "')'",
527   "'{'", "'}'", "']'", "$accept", "start", "type_exp", "exp", "@1",
528   "not_exp", "set", "@2", "@3", "arglist", "non_empty_arglist", "block",
529   "fblock", "variable", "type", 0
530 };
531 #endif
532 
533 # ifdef YYPRINT
534 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
535    token YYLEX-NUM.  */
536 static const unsigned short yytoknum[] =
537 {
538        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
539      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
540      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
541      285,   286,   287,   288,   289,    44,   290,   291,    60,    62,
542       61,    35,   292,   293,   294,   295,   296,    38,   297,    64,
543       43,    45,    42,    47,   298,   299,   300,    94,    91,    40,
544      301,   126,   302,   303,    41,   123,   125,    93
545 };
546 # endif
547 
548 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
549 static const unsigned char yyr1[] =
550 {
551        0,    68,    69,    69,    70,    71,    72,    71,    71,    71,
552       73,    73,    71,    71,    71,    71,    71,    71,    71,    71,
553       71,    71,    71,    71,    71,    71,    71,    71,    71,    71,
554       71,    71,    71,    74,    74,    75,    71,    76,    71,    77,
555       77,    77,    78,    78,    71,    71,    71,    71,    71,    71,
556       71,    71,    71,    71,    71,    71,    71,    71,    71,    71,
557       71,    71,    71,    71,    71,    71,    71,    71,    71,    71,
558       71,    71,    71,    79,    80,    80,    81,    81,    81,    81,
559       82
560 };
561 
562 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
563 static const unsigned char yyr2[] =
564 {
565        0,     2,     1,     1,     1,     2,     0,     3,     2,     2,
566        1,     1,     4,     4,     4,     4,     4,     4,     4,     6,
567        4,     4,     4,     2,     4,     6,     4,     6,     3,     1,
568        3,     6,     6,     3,     4,     0,     5,     0,     5,     0,
569        1,     3,     1,     3,     4,     4,     3,     3,     3,     3,
570        3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
571        3,     3,     3,     3,     1,     1,     1,     1,     1,     1,
572        1,     4,     1,     1,     1,     3,     1,     1,     3,     1,
573        1
574 };
575 
576 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
577    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
578    means the default is an error.  */
579 static const unsigned char yydefact[] =
580 {
581        0,    66,    67,    64,    65,    68,    69,    72,    79,    74,
582       80,     0,     0,     0,     0,     0,     0,     0,     0,     0,
583        0,     0,     0,     0,     0,     0,     0,    77,     0,     6,
584        0,    11,    10,    39,     0,     3,     2,     0,    29,     0,
585       76,    70,     4,     0,    23,     0,     0,     0,     0,     0,
586        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
587        0,     8,     0,     0,    40,     0,     0,     1,     0,     0,
588        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
589        0,     0,     0,     0,     0,     0,     5,    35,    37,     0,
590        9,     0,     0,    39,     0,     0,     0,     0,     0,     0,
591        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
592        7,    46,     0,    33,     0,    63,    59,    60,    54,    56,
593       39,    30,     0,    55,    58,    57,    62,    61,    47,    52,
594       53,    48,    49,    51,    50,     0,    39,    28,    78,    75,
595        0,     0,    71,    12,    13,    15,    14,    16,    17,    18,
596        0,    20,    21,    22,     0,    24,     0,    26,     0,     0,
597       41,    44,    42,     0,     0,    45,    34,     0,     0,     0,
598        0,     0,     0,    36,    38,    19,    25,    27,    31,    32,
599       43
600 };
601 
602 /* YYDEFGOTO[NTERM-NUM]. */
603 static const short yydefgoto[] =
604 {
605       -1,    34,    35,    64,    62,    37,    38,   135,   136,    65,
606      163,    39,    40,    41,    45
607 };
608 
609 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
610    STATE-NUM.  */
611 #define YYPACT_NINF -92
612 static const short yypact[] =
613 {
614      157,   -92,   -92,   -92,   -92,   -92,   -92,   -92,   -92,   -92,
615      -92,   217,   -53,   -27,   -18,   -17,    -8,     2,     8,    14,
616       28,    29,    30,    31,    32,    34,    35,   -92,   157,   -92,
617      157,   -92,   -92,   157,    44,   -92,   744,   157,   -92,    62,
618       64,   -92,   -34,   157,     6,   -34,   157,   157,   157,   157,
619       13,    13,   157,    13,   157,   157,   157,   157,   157,   157,
620      157,     6,   157,    79,   744,   -30,   -39,   -92,   157,   157,
621      157,   157,   157,   -15,   157,   157,   157,   157,   157,   157,
622      157,   157,   157,   157,   157,   157,   -92,   -92,   -92,    86,
623        6,    -4,   157,   157,   -25,   302,   330,   358,   386,    36,
624       37,   414,    67,   442,   470,   498,   246,   274,   694,   720,
625        6,   -92,   157,   -92,   157,   768,   -36,   -36,   -36,   -36,
626      157,   -92,    40,   -36,   -36,   -36,   144,   203,   779,   788,
627      788,     6,     6,     6,     6,   157,   157,   -92,   -92,   -92,
628      526,   -28,   -92,   -92,   -92,   -92,   -92,   -92,   -92,   -92,
629      157,   -92,   -92,   -92,   157,   -92,   157,   -92,   157,   157,
630      744,     6,   744,   -32,   -31,   -92,   -92,   554,   582,   610,
631      638,   666,   157,   -92,   -92,   -92,   -92,   -92,   -92,   -92,
632      744
633 };
634 
635 /* YYPGOTO[NTERM-NUM].  */
636 static const yysigned_char yypgoto[] =
637 {
638      -92,   -92,   -92,     0,   -92,   -92,    26,   -92,   -92,   -91,
639      -92,   -92,   -92,   -92,    53
640 };
641 
642 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
643    positive, shift that token.  If negative, reduce the rule which
644    number is the opposite.  If zero, do what YYDEFACT says.
645    If YYTABLE_NINF, syntax error.  */
646 #define YYTABLE_NINF -74
647 static const short yytable[] =
648 {
649       36,    10,   141,   172,   112,   112,    46,   112,   138,   139,
650       77,    44,    78,    79,    80,    81,    82,    83,    84,    85,
651       92,    86,    87,    88,    89,    92,    93,   114,    61,    10,
652       63,    93,    47,   174,    92,   173,   113,    90,   166,   142,
653       93,    48,    49,    63,    67,   164,    95,    96,    97,    98,
654      120,    50,   101,    42,   103,   104,   105,   106,   107,   108,
655      109,    51,   110,    86,    87,    88,    89,    52,   115,   116,
656      117,   118,   119,    53,   123,   124,   125,   126,   127,   128,
657      129,   130,   131,   132,   133,   134,    66,    54,    55,    56,
658       57,    58,   140,    59,    60,    91,    94,   -73,   137,   121,
659      147,   148,   150,    99,   100,    93,   102,     0,     0,     0,
660        0,     0,   160,     0,   161,     0,    68,    69,    70,    71,
661       72,    73,    74,    75,    76,    77,   122,    78,    79,    80,
662       81,    82,    83,    84,    85,   162,    86,    87,    88,    89,
663        0,     0,     0,   111,     0,     0,     0,     0,     0,     0,
664      167,     0,     0,     0,   168,     0,   169,     0,   170,   171,
665        1,     0,     0,     2,     3,     4,     5,     6,     7,     8,
666        9,     0,   180,    10,    11,    12,    13,    14,    15,    16,
667       17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
668        0,    27,    78,    79,    80,    81,    82,    83,    84,    85,
669        0,    86,    87,    88,    89,     0,     0,    28,    29,     0,
670        0,     0,     0,     0,     0,     0,    30,     0,    31,    32,
671        1,     0,    33,     2,     3,     4,     5,     6,     7,     8,
672        9,     0,     0,    10,    11,    12,    13,    14,    15,    16,
673       17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
674        0,    27,    79,    80,    81,    82,    83,    84,    85,     0,
675       86,    87,    88,    89,     0,     0,     0,    28,    29,     0,
676        0,     0,     0,     0,     0,     0,    43,     0,    31,    32,
677        0,   154,    33,    68,    69,    70,    71,    72,    73,    74,
678       75,    76,    77,     0,    78,    79,    80,    81,    82,    83,
679       84,    85,     0,    86,    87,    88,    89,     0,     0,   156,
680      155,    68,    69,    70,    71,    72,    73,    74,    75,    76,
681       77,     0,    78,    79,    80,    81,    82,    83,    84,    85,
682        0,    86,    87,    88,    89,     0,     0,     0,   157,    68,
683       69,    70,    71,    72,    73,    74,    75,    76,    77,     0,
684       78,    79,    80,    81,    82,    83,    84,    85,     0,    86,
685       87,    88,    89,     0,     0,     0,   143,    68,    69,    70,
686       71,    72,    73,    74,    75,    76,    77,     0,    78,    79,
687       80,    81,    82,    83,    84,    85,     0,    86,    87,    88,
688       89,     0,     0,     0,   144,    68,    69,    70,    71,    72,
689       73,    74,    75,    76,    77,     0,    78,    79,    80,    81,
690       82,    83,    84,    85,     0,    86,    87,    88,    89,     0,
691        0,     0,   145,    68,    69,    70,    71,    72,    73,    74,
692       75,    76,    77,     0,    78,    79,    80,    81,    82,    83,
693       84,    85,     0,    86,    87,    88,    89,     0,     0,     0,
694      146,    68,    69,    70,    71,    72,    73,    74,    75,    76,
695       77,     0,    78,    79,    80,    81,    82,    83,    84,    85,
696        0,    86,    87,    88,    89,     0,     0,     0,   149,    68,
697       69,    70,    71,    72,    73,    74,    75,    76,    77,     0,
698       78,    79,    80,    81,    82,    83,    84,    85,     0,    86,
699       87,    88,    89,     0,     0,     0,   151,    68,    69,    70,
700       71,    72,    73,    74,    75,    76,    77,     0,    78,    79,
701       80,    81,    82,    83,    84,    85,     0,    86,    87,    88,
702       89,     0,     0,     0,   152,    68,    69,    70,    71,    72,
703       73,    74,    75,    76,    77,     0,    78,    79,    80,    81,
704       82,    83,    84,    85,     0,    86,    87,    88,    89,     0,
705        0,     0,   153,    68,    69,    70,    71,    72,    73,    74,
706       75,    76,    77,     0,    78,    79,    80,    81,    82,    83,
707       84,    85,     0,    86,    87,    88,    89,     0,     0,     0,
708      165,    68,    69,    70,    71,    72,    73,    74,    75,    76,
709       77,     0,    78,    79,    80,    81,    82,    83,    84,    85,
710        0,    86,    87,    88,    89,     0,     0,     0,   175,    68,
711       69,    70,    71,    72,    73,    74,    75,    76,    77,     0,
712       78,    79,    80,    81,    82,    83,    84,    85,     0,    86,
713       87,    88,    89,     0,     0,     0,   176,    68,    69,    70,
714       71,    72,    73,    74,    75,    76,    77,     0,    78,    79,
715       80,    81,    82,    83,    84,    85,     0,    86,    87,    88,
716       89,     0,     0,     0,   177,    68,    69,    70,    71,    72,
717       73,    74,    75,    76,    77,     0,    78,    79,    80,    81,
718       82,    83,    84,    85,     0,    86,    87,    88,    89,     0,
719        0,     0,   178,    68,    69,    70,    71,    72,    73,    74,
720       75,    76,    77,     0,    78,    79,    80,    81,    82,    83,
721       84,    85,     0,    86,    87,    88,    89,     0,     0,   158,
722      179,    68,    69,    70,    71,    72,    73,    74,    75,    76,
723       77,     0,    78,    79,    80,    81,    82,    83,    84,    85,
724        0,    86,    87,    88,    89,   159,     0,    68,    69,    70,
725       71,    72,    73,    74,    75,    76,    77,     0,    78,    79,
726       80,    81,    82,    83,    84,    85,     0,    86,    87,    88,
727       89,    68,    69,    70,    71,    72,    73,    74,    75,    76,
728       77,     0,    78,    79,    80,    81,    82,    83,    84,    85,
729        0,    86,    87,    88,    89,   -74,    69,    70,    71,    72,
730       73,    74,    75,    76,    77,     0,    78,    79,    80,    81,
731       82,    83,    84,    85,     0,    86,    87,    88,    89,    80,
732       81,    82,    83,    84,    85,     0,    86,    87,    88,    89,
733       82,    83,    84,    85,     0,    86,    87,    88,    89
734 };
735 
736 static const short yycheck[] =
737 {
738        0,    16,    93,    35,    35,    35,    59,    35,    12,    13,
739       46,    11,    48,    49,    50,    51,    52,    53,    54,    55,
740       59,    57,    58,    59,    60,    59,    65,    66,    28,    16,
741       30,    65,    59,    64,    59,    67,    66,    37,    66,    64,
742       65,    59,    59,    43,     0,   136,    46,    47,    48,    49,
743       65,    59,    52,     0,    54,    55,    56,    57,    58,    59,
744       60,    59,    62,    57,    58,    59,    60,    59,    68,    69,
745       70,    71,    72,    59,    74,    75,    76,    77,    78,    79,
746       80,    81,    82,    83,    84,    85,    33,    59,    59,    59,
747       59,    59,    92,    59,    59,    33,    43,    33,    12,    73,
748       64,    64,    35,    50,    51,    65,    53,    -1,    -1,    -1,
749       -1,    -1,   112,    -1,   114,    -1,    37,    38,    39,    40,
750       41,    42,    43,    44,    45,    46,    73,    48,    49,    50,
751       51,    52,    53,    54,    55,   135,    57,    58,    59,    60,
752       -1,    -1,    -1,    64,    -1,    -1,    -1,    -1,    -1,    -1,
753      150,    -1,    -1,    -1,   154,    -1,   156,    -1,   158,   159,
754        3,    -1,    -1,     6,     7,     8,     9,    10,    11,    12,
755       13,    -1,   172,    16,    17,    18,    19,    20,    21,    22,
756       23,    24,    25,    26,    27,    28,    29,    30,    31,    32,
757       -1,    34,    48,    49,    50,    51,    52,    53,    54,    55,
758       -1,    57,    58,    59,    60,    -1,    -1,    50,    51,    -1,
759       -1,    -1,    -1,    -1,    -1,    -1,    59,    -1,    61,    62,
760        3,    -1,    65,     6,     7,     8,     9,    10,    11,    12,
761       13,    -1,    -1,    16,    17,    18,    19,    20,    21,    22,
762       23,    24,    25,    26,    27,    28,    29,    30,    31,    32,
763       -1,    34,    49,    50,    51,    52,    53,    54,    55,    -1,
764       57,    58,    59,    60,    -1,    -1,    -1,    50,    51,    -1,
765       -1,    -1,    -1,    -1,    -1,    -1,    59,    -1,    61,    62,
766       -1,    35,    65,    37,    38,    39,    40,    41,    42,    43,
767       44,    45,    46,    -1,    48,    49,    50,    51,    52,    53,
768       54,    55,    -1,    57,    58,    59,    60,    -1,    -1,    35,
769       64,    37,    38,    39,    40,    41,    42,    43,    44,    45,
770       46,    -1,    48,    49,    50,    51,    52,    53,    54,    55,
771       -1,    57,    58,    59,    60,    -1,    -1,    -1,    64,    37,
772       38,    39,    40,    41,    42,    43,    44,    45,    46,    -1,
773       48,    49,    50,    51,    52,    53,    54,    55,    -1,    57,
774       58,    59,    60,    -1,    -1,    -1,    64,    37,    38,    39,
775       40,    41,    42,    43,    44,    45,    46,    -1,    48,    49,
776       50,    51,    52,    53,    54,    55,    -1,    57,    58,    59,
777       60,    -1,    -1,    -1,    64,    37,    38,    39,    40,    41,
778       42,    43,    44,    45,    46,    -1,    48,    49,    50,    51,
779       52,    53,    54,    55,    -1,    57,    58,    59,    60,    -1,
780       -1,    -1,    64,    37,    38,    39,    40,    41,    42,    43,
781       44,    45,    46,    -1,    48,    49,    50,    51,    52,    53,
782       54,    55,    -1,    57,    58,    59,    60,    -1,    -1,    -1,
783       64,    37,    38,    39,    40,    41,    42,    43,    44,    45,
784       46,    -1,    48,    49,    50,    51,    52,    53,    54,    55,
785       -1,    57,    58,    59,    60,    -1,    -1,    -1,    64,    37,
786       38,    39,    40,    41,    42,    43,    44,    45,    46,    -1,
787       48,    49,    50,    51,    52,    53,    54,    55,    -1,    57,
788       58,    59,    60,    -1,    -1,    -1,    64,    37,    38,    39,
789       40,    41,    42,    43,    44,    45,    46,    -1,    48,    49,
790       50,    51,    52,    53,    54,    55,    -1,    57,    58,    59,
791       60,    -1,    -1,    -1,    64,    37,    38,    39,    40,    41,
792       42,    43,    44,    45,    46,    -1,    48,    49,    50,    51,
793       52,    53,    54,    55,    -1,    57,    58,    59,    60,    -1,
794       -1,    -1,    64,    37,    38,    39,    40,    41,    42,    43,
795       44,    45,    46,    -1,    48,    49,    50,    51,    52,    53,
796       54,    55,    -1,    57,    58,    59,    60,    -1,    -1,    -1,
797       64,    37,    38,    39,    40,    41,    42,    43,    44,    45,
798       46,    -1,    48,    49,    50,    51,    52,    53,    54,    55,
799       -1,    57,    58,    59,    60,    -1,    -1,    -1,    64,    37,
800       38,    39,    40,    41,    42,    43,    44,    45,    46,    -1,
801       48,    49,    50,    51,    52,    53,    54,    55,    -1,    57,
802       58,    59,    60,    -1,    -1,    -1,    64,    37,    38,    39,
803       40,    41,    42,    43,    44,    45,    46,    -1,    48,    49,
804       50,    51,    52,    53,    54,    55,    -1,    57,    58,    59,
805       60,    -1,    -1,    -1,    64,    37,    38,    39,    40,    41,
806       42,    43,    44,    45,    46,    -1,    48,    49,    50,    51,
807       52,    53,    54,    55,    -1,    57,    58,    59,    60,    -1,
808       -1,    -1,    64,    37,    38,    39,    40,    41,    42,    43,
809       44,    45,    46,    -1,    48,    49,    50,    51,    52,    53,
810       54,    55,    -1,    57,    58,    59,    60,    -1,    -1,    35,
811       64,    37,    38,    39,    40,    41,    42,    43,    44,    45,
812       46,    -1,    48,    49,    50,    51,    52,    53,    54,    55,
813       -1,    57,    58,    59,    60,    35,    -1,    37,    38,    39,
814       40,    41,    42,    43,    44,    45,    46,    -1,    48,    49,
815       50,    51,    52,    53,    54,    55,    -1,    57,    58,    59,
816       60,    37,    38,    39,    40,    41,    42,    43,    44,    45,
817       46,    -1,    48,    49,    50,    51,    52,    53,    54,    55,
818       -1,    57,    58,    59,    60,    37,    38,    39,    40,    41,
819       42,    43,    44,    45,    46,    -1,    48,    49,    50,    51,
820       52,    53,    54,    55,    -1,    57,    58,    59,    60,    50,
821       51,    52,    53,    54,    55,    -1,    57,    58,    59,    60,
822       52,    53,    54,    55,    -1,    57,    58,    59,    60
823 };
824 
825 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
826    symbol of state STATE-NUM.  */
827 static const unsigned char yystos[] =
828 {
829        0,     3,     6,     7,     8,     9,    10,    11,    12,    13,
830       16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
831       26,    27,    28,    29,    30,    31,    32,    34,    50,    51,
832       59,    61,    62,    65,    69,    70,    71,    73,    74,    79,
833       80,    81,    82,    59,    71,    82,    59,    59,    59,    59,
834       59,    59,    59,    59,    59,    59,    59,    59,    59,    59,
835       59,    71,    72,    71,    71,    77,    82,     0,    37,    38,
836       39,    40,    41,    42,    43,    44,    45,    46,    48,    49,
837       50,    51,    52,    53,    54,    55,    57,    58,    59,    60,
838       71,    33,    59,    65,    82,    71,    71,    71,    71,    82,
839       82,    71,    82,    71,    71,    71,    71,    71,    71,    71,
840       71,    64,    35,    66,    66,    71,    71,    71,    71,    71,
841       65,    74,    82,    71,    71,    71,    71,    71,    71,    71,
842       71,    71,    71,    71,    71,    75,    76,    12,    12,    13,
843       71,    77,    64,    64,    64,    64,    64,    64,    64,    64,
844       35,    64,    64,    64,    35,    64,    35,    64,    35,    35,
845       71,    71,    71,    78,    77,    64,    66,    71,    71,    71,
846       71,    71,    35,    67,    64,    64,    64,    64,    64,    64,
847       71
848 };
849 
850 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
851 # define YYSIZE_T __SIZE_TYPE__
852 #endif
853 #if ! defined (YYSIZE_T) && defined (size_t)
854 # define YYSIZE_T size_t
855 #endif
856 #if ! defined (YYSIZE_T)
857 # if defined (__STDC__) || defined (__cplusplus)
858 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
859 #  define YYSIZE_T size_t
860 # endif
861 #endif
862 #if ! defined (YYSIZE_T)
863 # define YYSIZE_T unsigned int
864 #endif
865 
866 #define yyerrok		(yyerrstatus = 0)
867 #define yyclearin	(yychar = YYEMPTY)
868 #define YYEMPTY		(-2)
869 #define YYEOF		0
870 
871 #define YYACCEPT	goto yyacceptlab
872 #define YYABORT		goto yyabortlab
873 #define YYERROR		goto yyerrorlab
874 
875 
876 /* Like YYERROR except do call yyerror.  This remains here temporarily
877    to ease the transition to the new meaning of YYERROR, for GCC.
878    Once GCC version 2 has supplanted version 1, this can go.  */
879 
880 #define YYFAIL		goto yyerrlab
881 
882 #define YYRECOVERING()  (!!yyerrstatus)
883 
884 #define YYBACKUP(Token, Value)					\
885 do								\
886   if (yychar == YYEMPTY && yylen == 1)				\
887     {								\
888       yychar = (Token);						\
889       yylval = (Value);						\
890       yytoken = YYTRANSLATE (yychar);				\
891       YYPOPSTACK;						\
892       goto yybackup;						\
893     }								\
894   else								\
895     { 								\
896       yyerror ("syntax error: cannot back up");\
897       YYERROR;							\
898     }								\
899 while (0)
900 
901 #define YYTERROR	1
902 #define YYERRCODE	256
903 
904 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
905    are run).  */
906 
907 #ifndef YYLLOC_DEFAULT
908 # define YYLLOC_DEFAULT(Current, Rhs, N)		\
909    ((Current).first_line   = (Rhs)[1].first_line,	\
910     (Current).first_column = (Rhs)[1].first_column,	\
911     (Current).last_line    = (Rhs)[N].last_line,	\
912     (Current).last_column  = (Rhs)[N].last_column)
913 #endif
914 
915 /* YYLEX -- calling `yylex' with the right arguments.  */
916 
917 #ifdef YYLEX_PARAM
918 # define YYLEX yylex (YYLEX_PARAM)
919 #else
920 # define YYLEX yylex ()
921 #endif
922 
923 /* Enable debugging if requested.  */
924 #if YYDEBUG
925 
926 # ifndef YYFPRINTF
927 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
928 #  define YYFPRINTF fprintf
929 # endif
930 
931 # define YYDPRINTF(Args)			\
932 do {						\
933   if (yydebug)					\
934     YYFPRINTF Args;				\
935 } while (0)
936 
937 # define YYDSYMPRINT(Args)			\
938 do {						\
939   if (yydebug)					\
940     yysymprint Args;				\
941 } while (0)
942 
943 # define YYDSYMPRINTF(Title, Token, Value, Location)		\
944 do {								\
945   if (yydebug)							\
946     {								\
947       YYFPRINTF (stderr, "%s ", Title);				\
948       yysymprint (stderr, 					\
949                   Token, Value);	\
950       YYFPRINTF (stderr, "\n");					\
951     }								\
952 } while (0)
953 
954 /*------------------------------------------------------------------.
955 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
956 | TOP (included).                                                   |
957 `------------------------------------------------------------------*/
958 
959 #if defined (__STDC__) || defined (__cplusplus)
960 static void
961 yy_stack_print (short *bottom, short *top)
962 #else
963 static void
964 yy_stack_print (bottom, top)
965     short *bottom;
966     short *top;
967 #endif
968 {
969   YYFPRINTF (stderr, "Stack now");
970   for (/* Nothing. */; bottom <= top; ++bottom)
971     YYFPRINTF (stderr, " %d", *bottom);
972   YYFPRINTF (stderr, "\n");
973 }
974 
975 # define YY_STACK_PRINT(Bottom, Top)				\
976 do {								\
977   if (yydebug)							\
978     yy_stack_print ((Bottom), (Top));				\
979 } while (0)
980 
981 
982 /*------------------------------------------------.
983 | Report that the YYRULE is going to be reduced.  |
984 `------------------------------------------------*/
985 
986 #if defined (__STDC__) || defined (__cplusplus)
987 static void
988 yy_reduce_print (int yyrule)
989 #else
990 static void
991 yy_reduce_print (yyrule)
992     int yyrule;
993 #endif
994 {
995   int yyi;
996   unsigned int yylno = yyrline[yyrule];
997   YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
998              yyrule - 1, yylno);
999   /* Print the symbols being reduced, and their result.  */
1000   for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
1001     YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
1002   YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
1003 }
1004 
1005 # define YY_REDUCE_PRINT(Rule)		\
1006 do {					\
1007   if (yydebug)				\
1008     yy_reduce_print (Rule);		\
1009 } while (0)
1010 
1011 /* Nonzero means print parse trace.  It is left uninitialized so that
1012    multiple parsers can coexist.  */
1013 int yydebug;
1014 #else /* !YYDEBUG */
1015 # define YYDPRINTF(Args)
1016 # define YYDSYMPRINT(Args)
1017 # define YYDSYMPRINTF(Title, Token, Value, Location)
1018 # define YY_STACK_PRINT(Bottom, Top)
1019 # define YY_REDUCE_PRINT(Rule)
1020 #endif /* !YYDEBUG */
1021 
1022 
1023 /* YYINITDEPTH -- initial size of the parser's stacks.  */
1024 #ifndef	YYINITDEPTH
1025 # define YYINITDEPTH 200
1026 #endif
1027 
1028 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1029    if the built-in stack extension method is used).
1030 
1031    Do not make this value too large; the results are undefined if
1032    SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
1033    evaluated with infinite-precision integer arithmetic.  */
1034 
1035 #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
1036 # undef YYMAXDEPTH
1037 #endif
1038 
1039 #ifndef YYMAXDEPTH
1040 # define YYMAXDEPTH 10000
1041 #endif
1042 
1043 
1044 
1045 #if YYERROR_VERBOSE
1046 
1047 # ifndef yystrlen
1048 #  if defined (__GLIBC__) && defined (_STRING_H)
1049 #   define yystrlen strlen
1050 #  else
1051 /* Return the length of YYSTR.  */
1052 static YYSIZE_T
1053 #   if defined (__STDC__) || defined (__cplusplus)
1054 yystrlen (const char *yystr)
1055 #   else
1056 yystrlen (yystr)
1057      const char *yystr;
1058 #   endif
1059 {
1060   register const char *yys = yystr;
1061 
1062   while (*yys++ != '\0')
1063     continue;
1064 
1065   return yys - yystr - 1;
1066 }
1067 #  endif
1068 # endif
1069 
1070 # ifndef yystpcpy
1071 #  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1072 #   define yystpcpy stpcpy
1073 #  else
1074 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1075    YYDEST.  */
1076 static char *
1077 #   if defined (__STDC__) || defined (__cplusplus)
1078 yystpcpy (char *yydest, const char *yysrc)
1079 #   else
1080 yystpcpy (yydest, yysrc)
1081      char *yydest;
1082      const char *yysrc;
1083 #   endif
1084 {
1085   register char *yyd = yydest;
1086   register const char *yys = yysrc;
1087 
1088   while ((*yyd++ = *yys++) != '\0')
1089     continue;
1090 
1091   return yyd - 1;
1092 }
1093 #  endif
1094 # endif
1095 
1096 #endif /* !YYERROR_VERBOSE */
1097 
1098 
1099 
1100 #if YYDEBUG
1101 /*--------------------------------.
1102 | Print this symbol on YYOUTPUT.  |
1103 `--------------------------------*/
1104 
1105 #if defined (__STDC__) || defined (__cplusplus)
1106 static void
1107 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
1108 #else
1109 static void
1110 yysymprint (yyoutput, yytype, yyvaluep)
1111     FILE *yyoutput;
1112     int yytype;
1113     YYSTYPE *yyvaluep;
1114 #endif
1115 {
1116   /* Pacify ``unused variable'' warnings.  */
1117   (void) yyvaluep;
1118 
1119   if (yytype < YYNTOKENS)
1120     {
1121       YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1122 # ifdef YYPRINT
1123       YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1124 # endif
1125     }
1126   else
1127     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1128 
1129   switch (yytype)
1130     {
1131       default:
1132         break;
1133     }
1134   YYFPRINTF (yyoutput, ")");
1135 }
1136 
1137 #endif /* ! YYDEBUG */
1138 /*-----------------------------------------------.
1139 | Release the memory associated to this symbol.  |
1140 `-----------------------------------------------*/
1141 
1142 #if defined (__STDC__) || defined (__cplusplus)
1143 static void
1144 yydestruct (int yytype, YYSTYPE *yyvaluep)
1145 #else
1146 static void
1147 yydestruct (yytype, yyvaluep)
1148     int yytype;
1149     YYSTYPE *yyvaluep;
1150 #endif
1151 {
1152   /* Pacify ``unused variable'' warnings.  */
1153   (void) yyvaluep;
1154 
1155   switch (yytype)
1156     {
1157 
1158       default:
1159         break;
1160     }
1161 }
1162 
1163 
1164 /* Prevent warnings from -Wmissing-prototypes.  */
1165 
1166 #ifdef YYPARSE_PARAM
1167 # if defined (__STDC__) || defined (__cplusplus)
1168 int yyparse (void *YYPARSE_PARAM);
1169 # else
1170 int yyparse ();
1171 # endif
1172 #else /* ! YYPARSE_PARAM */
1173 #if defined (__STDC__) || defined (__cplusplus)
1174 int yyparse (void);
1175 #else
1176 int yyparse ();
1177 #endif
1178 #endif /* ! YYPARSE_PARAM */
1179 
1180 
1181 
1182 /* The lookahead symbol.  */
1183 int yychar;
1184 
1185 /* The semantic value of the lookahead symbol.  */
1186 YYSTYPE yylval;
1187 
1188 /* Number of syntax errors so far.  */
1189 int yynerrs;
1190 
1191 
1192 
1193 /*----------.
1194 | yyparse.  |
1195 `----------*/
1196 
1197 #ifdef YYPARSE_PARAM
1198 # if defined (__STDC__) || defined (__cplusplus)
1199 int yyparse (void *YYPARSE_PARAM)
1200 # else
1201 int yyparse (YYPARSE_PARAM)
1202   void *YYPARSE_PARAM;
1203 # endif
1204 #else /* ! YYPARSE_PARAM */
1205 #if defined (__STDC__) || defined (__cplusplus)
1206 int
1207 yyparse (void)
1208 #else
1209 int
1210 yyparse ()
1211 
1212 #endif
1213 #endif
1214 {
1215 
1216   register int yystate;
1217   register int yyn;
1218   int yyresult;
1219   /* Number of tokens to shift before error messages enabled.  */
1220   int yyerrstatus;
1221   /* Lookahead token as an internal (translated) token number.  */
1222   int yytoken = 0;
1223 
1224   /* Three stacks and their tools:
1225      `yyss': related to states,
1226      `yyvs': related to semantic values,
1227      `yyls': related to locations.
1228 
1229      Refer to the stacks thru separate pointers, to allow yyoverflow
1230      to xreallocate them elsewhere.  */
1231 
1232   /* The state stack.  */
1233   short	yyssa[YYINITDEPTH];
1234   short *yyss = yyssa;
1235   register short *yyssp;
1236 
1237   /* The semantic value stack.  */
1238   YYSTYPE yyvsa[YYINITDEPTH];
1239   YYSTYPE *yyvs = yyvsa;
1240   register YYSTYPE *yyvsp;
1241 
1242 
1243 
1244 #define YYPOPSTACK   (yyvsp--, yyssp--)
1245 
1246   YYSIZE_T yystacksize = YYINITDEPTH;
1247 
1248   /* The variables used to return semantic value and location from the
1249      action routines.  */
1250   YYSTYPE yyval;
1251 
1252 
1253   /* When reducing, the number of symbols on the RHS of the reduced
1254      rule.  */
1255   int yylen;
1256 
1257   YYDPRINTF ((stderr, "Starting parse\n"));
1258 
1259   yystate = 0;
1260   yyerrstatus = 0;
1261   yynerrs = 0;
1262   yychar = YYEMPTY;		/* Cause a token to be read.  */
1263 
1264   /* Initialize stack pointers.
1265      Waste one element of value and location stack
1266      so that they stay on the same level as the state stack.
1267      The wasted elements are never initialized.  */
1268 
1269   yyssp = yyss;
1270   yyvsp = yyvs;
1271 
1272   goto yysetstate;
1273 
1274 /*------------------------------------------------------------.
1275 | yynewstate -- Push a new state, which is found in yystate.  |
1276 `------------------------------------------------------------*/
1277  yynewstate:
1278   /* In all cases, when you get here, the value and location stacks
1279      have just been pushed. so pushing a state here evens the stacks.
1280      */
1281   yyssp++;
1282 
1283  yysetstate:
1284   *yyssp = yystate;
1285 
1286   if (yyss + yystacksize - 1 <= yyssp)
1287     {
1288       /* Get the current used size of the three stacks, in elements.  */
1289       YYSIZE_T yysize = yyssp - yyss + 1;
1290 
1291 #ifdef yyoverflow
1292       {
1293 	/* Give user a chance to xreallocate the stack. Use copies of
1294 	   these so that the &'s don't force the real ones into
1295 	   memory.  */
1296 	YYSTYPE *yyvs1 = yyvs;
1297 	short *yyss1 = yyss;
1298 
1299 
1300 	/* Each stack pointer address is followed by the size of the
1301 	   data in use in that stack, in bytes.  This used to be a
1302 	   conditional around just the two extra args, but that might
1303 	   be undefined if yyoverflow is a macro.  */
1304 	yyoverflow ("parser stack overflow",
1305 		    &yyss1, yysize * sizeof (*yyssp),
1306 		    &yyvs1, yysize * sizeof (*yyvsp),
1307 
1308 		    &yystacksize);
1309 
1310 	yyss = yyss1;
1311 	yyvs = yyvs1;
1312       }
1313 #else /* no yyoverflow */
1314 # ifndef YYSTACK_RELOCATE
1315       goto yyoverflowlab;
1316 # else
1317       /* Extend the stack our own way.  */
1318       if (YYMAXDEPTH <= yystacksize)
1319 	goto yyoverflowlab;
1320       yystacksize *= 2;
1321       if (YYMAXDEPTH < yystacksize)
1322 	yystacksize = YYMAXDEPTH;
1323 
1324       {
1325 	short *yyss1 = yyss;
1326 	union yyalloc *yyptr =
1327 	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1328 	if (! yyptr)
1329 	  goto yyoverflowlab;
1330 	YYSTACK_RELOCATE (yyss);
1331 	YYSTACK_RELOCATE (yyvs);
1332 
1333 #  undef YYSTACK_RELOCATE
1334 	if (yyss1 != yyssa)
1335 	  YYSTACK_FREE (yyss1);
1336       }
1337 # endif
1338 #endif /* no yyoverflow */
1339 
1340       yyssp = yyss + yysize - 1;
1341       yyvsp = yyvs + yysize - 1;
1342 
1343 
1344       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1345 		  (unsigned long int) yystacksize));
1346 
1347       if (yyss + yystacksize - 1 <= yyssp)
1348 	YYABORT;
1349     }
1350 
1351   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1352 
1353   goto yybackup;
1354 
1355 /*-----------.
1356 | yybackup.  |
1357 `-----------*/
1358 yybackup:
1359 
1360 /* Do appropriate processing given the current state.  */
1361 /* Read a lookahead token if we need one and don't already have one.  */
1362 /* yyresume: */
1363 
1364   /* First try to decide what to do without reference to lookahead token.  */
1365 
1366   yyn = yypact[yystate];
1367   if (yyn == YYPACT_NINF)
1368     goto yydefault;
1369 
1370   /* Not known => get a lookahead token if don't already have one.  */
1371 
1372   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1373   if (yychar == YYEMPTY)
1374     {
1375       YYDPRINTF ((stderr, "Reading a token: "));
1376       yychar = YYLEX;
1377     }
1378 
1379   if (yychar <= YYEOF)
1380     {
1381       yychar = yytoken = YYEOF;
1382       YYDPRINTF ((stderr, "Now at end of input.\n"));
1383     }
1384   else
1385     {
1386       yytoken = YYTRANSLATE (yychar);
1387       YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1388     }
1389 
1390   /* If the proper action on seeing token YYTOKEN is to reduce or to
1391      detect an error, take that action.  */
1392   yyn += yytoken;
1393   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1394     goto yydefault;
1395   yyn = yytable[yyn];
1396   if (yyn <= 0)
1397     {
1398       if (yyn == 0 || yyn == YYTABLE_NINF)
1399 	goto yyerrlab;
1400       yyn = -yyn;
1401       goto yyreduce;
1402     }
1403 
1404   if (yyn == YYFINAL)
1405     YYACCEPT;
1406 
1407   /* Shift the lookahead token.  */
1408   YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1409 
1410   /* Discard the token being shifted unless it is eof.  */
1411   if (yychar != YYEOF)
1412     yychar = YYEMPTY;
1413 
1414   *++yyvsp = yylval;
1415 
1416 
1417   /* Count tokens shifted since error; after three, turn off error
1418      status.  */
1419   if (yyerrstatus)
1420     yyerrstatus--;
1421 
1422   yystate = yyn;
1423   goto yynewstate;
1424 
1425 
1426 /*-----------------------------------------------------------.
1427 | yydefault -- do the default action for the current state.  |
1428 `-----------------------------------------------------------*/
1429 yydefault:
1430   yyn = yydefact[yystate];
1431   if (yyn == 0)
1432     goto yyerrlab;
1433   goto yyreduce;
1434 
1435 
1436 /*-----------------------------.
1437 | yyreduce -- Do a reduction.  |
1438 `-----------------------------*/
1439 yyreduce:
1440   /* yyn is the number of a rule to reduce with.  */
1441   yylen = yyr2[yyn];
1442 
1443   /* If YYLEN is nonzero, implement the default value of the action:
1444      `$$ = $1'.
1445 
1446      Otherwise, the following line sets YYVAL to garbage.
1447      This behavior is undocumented and Bison
1448      users should not rely upon it.  Assigning to YYVAL
1449      unconditionally makes the parser a bit smaller, and it avoids a
1450      GCC warning that YYVAL may be used uninitialized.  */
1451   yyval = yyvsp[1-yylen];
1452 
1453 
1454   YY_REDUCE_PRINT (yyn);
1455   switch (yyn)
1456     {
1457         case 4:
1458 #line 210 "m2-exp.y"
1459     { write_exp_elt_opcode(OP_TYPE);
1460 		  write_exp_elt_type(yyvsp[0].tval);
1461 		  write_exp_elt_opcode(OP_TYPE);
1462 		}
1463     break;
1464 
1465   case 5:
1466 #line 219 "m2-exp.y"
1467     { write_exp_elt_opcode (UNOP_IND); }
1468     break;
1469 
1470   case 6:
1471 #line 223 "m2-exp.y"
1472     { number_sign = -1; }
1473     break;
1474 
1475   case 7:
1476 #line 225 "m2-exp.y"
1477     { number_sign = 1;
1478 			  write_exp_elt_opcode (UNOP_NEG); }
1479     break;
1480 
1481   case 8:
1482 #line 230 "m2-exp.y"
1483     { write_exp_elt_opcode(UNOP_PLUS); }
1484     break;
1485 
1486   case 9:
1487 #line 234 "m2-exp.y"
1488     { write_exp_elt_opcode (UNOP_LOGICAL_NOT); }
1489     break;
1490 
1491   case 12:
1492 #line 242 "m2-exp.y"
1493     { write_exp_elt_opcode (UNOP_CAP); }
1494     break;
1495 
1496   case 13:
1497 #line 246 "m2-exp.y"
1498     { write_exp_elt_opcode (UNOP_ORD); }
1499     break;
1500 
1501   case 14:
1502 #line 250 "m2-exp.y"
1503     { write_exp_elt_opcode (UNOP_ABS); }
1504     break;
1505 
1506   case 15:
1507 #line 254 "m2-exp.y"
1508     { write_exp_elt_opcode (UNOP_HIGH); }
1509     break;
1510 
1511   case 16:
1512 #line 258 "m2-exp.y"
1513     { write_exp_elt_opcode (UNOP_MIN);
1514 			  write_exp_elt_type (yyvsp[-1].tval);
1515 			  write_exp_elt_opcode (UNOP_MIN); }
1516     break;
1517 
1518   case 17:
1519 #line 264 "m2-exp.y"
1520     { write_exp_elt_opcode (UNOP_MAX);
1521 			  write_exp_elt_type (yyvsp[-1].tval);
1522 			  write_exp_elt_opcode (UNOP_MIN); }
1523     break;
1524 
1525   case 18:
1526 #line 270 "m2-exp.y"
1527     { write_exp_elt_opcode (UNOP_FLOAT); }
1528     break;
1529 
1530   case 19:
1531 #line 274 "m2-exp.y"
1532     { write_exp_elt_opcode (BINOP_VAL);
1533 			  write_exp_elt_type (yyvsp[-3].tval);
1534 			  write_exp_elt_opcode (BINOP_VAL); }
1535     break;
1536 
1537   case 20:
1538 #line 280 "m2-exp.y"
1539     { write_exp_elt_opcode (UNOP_CHR); }
1540     break;
1541 
1542   case 21:
1543 #line 284 "m2-exp.y"
1544     { write_exp_elt_opcode (UNOP_ODD); }
1545     break;
1546 
1547   case 22:
1548 #line 288 "m2-exp.y"
1549     { write_exp_elt_opcode (UNOP_TRUNC); }
1550     break;
1551 
1552   case 23:
1553 #line 292 "m2-exp.y"
1554     { write_exp_elt_opcode (UNOP_SIZEOF); }
1555     break;
1556 
1557   case 24:
1558 #line 297 "m2-exp.y"
1559     { write_exp_elt_opcode(UNOP_PREINCREMENT); }
1560     break;
1561 
1562   case 25:
1563 #line 301 "m2-exp.y"
1564     { write_exp_elt_opcode(BINOP_ASSIGN_MODIFY);
1565 			  write_exp_elt_opcode(BINOP_ADD);
1566 			  write_exp_elt_opcode(BINOP_ASSIGN_MODIFY); }
1567     break;
1568 
1569   case 26:
1570 #line 307 "m2-exp.y"
1571     { write_exp_elt_opcode(UNOP_PREDECREMENT);}
1572     break;
1573 
1574   case 27:
1575 #line 311 "m2-exp.y"
1576     { write_exp_elt_opcode(BINOP_ASSIGN_MODIFY);
1577 			  write_exp_elt_opcode(BINOP_SUB);
1578 			  write_exp_elt_opcode(BINOP_ASSIGN_MODIFY); }
1579     break;
1580 
1581   case 28:
1582 #line 317 "m2-exp.y"
1583     { write_exp_elt_opcode (STRUCTOP_STRUCT);
1584 			  write_exp_string (yyvsp[0].sval);
1585 			  write_exp_elt_opcode (STRUCTOP_STRUCT); }
1586     break;
1587 
1588   case 30:
1589 #line 326 "m2-exp.y"
1590     { error("Sets are not implemented.");}
1591     break;
1592 
1593   case 31:
1594 #line 330 "m2-exp.y"
1595     { error("Sets are not implemented.");}
1596     break;
1597 
1598   case 32:
1599 #line 334 "m2-exp.y"
1600     { error("Sets are not implemented.");}
1601     break;
1602 
1603   case 33:
1604 #line 338 "m2-exp.y"
1605     { error("Sets are not implemented.");}
1606     break;
1607 
1608   case 34:
1609 #line 340 "m2-exp.y"
1610     { error("Sets are not implemented.");}
1611     break;
1612 
1613   case 35:
1614 #line 349 "m2-exp.y"
1615     { start_arglist(); }
1616     break;
1617 
1618   case 36:
1619 #line 351 "m2-exp.y"
1620     { write_exp_elt_opcode (MULTI_SUBSCRIPT);
1621 			  write_exp_elt_longcst ((LONGEST) end_arglist());
1622 			  write_exp_elt_opcode (MULTI_SUBSCRIPT); }
1623     break;
1624 
1625   case 37:
1626 #line 359 "m2-exp.y"
1627     { start_arglist (); }
1628     break;
1629 
1630   case 38:
1631 #line 361 "m2-exp.y"
1632     { write_exp_elt_opcode (OP_FUNCALL);
1633 			  write_exp_elt_longcst ((LONGEST) end_arglist ());
1634 			  write_exp_elt_opcode (OP_FUNCALL); }
1635     break;
1636 
1637   case 40:
1638 #line 370 "m2-exp.y"
1639     { arglist_len = 1; }
1640     break;
1641 
1642   case 41:
1643 #line 374 "m2-exp.y"
1644     { arglist_len++; }
1645     break;
1646 
1647   case 42:
1648 #line 379 "m2-exp.y"
1649     { arglist_len = 1; }
1650     break;
1651 
1652   case 43:
1653 #line 384 "m2-exp.y"
1654     { arglist_len++; }
1655     break;
1656 
1657   case 44:
1658 #line 389 "m2-exp.y"
1659     { write_exp_elt_opcode (UNOP_MEMVAL);
1660 			  write_exp_elt_type (yyvsp[-2].tval);
1661 			  write_exp_elt_opcode (UNOP_MEMVAL); }
1662     break;
1663 
1664   case 45:
1665 #line 395 "m2-exp.y"
1666     { write_exp_elt_opcode (UNOP_CAST);
1667 			  write_exp_elt_type (yyvsp[-3].tval);
1668 			  write_exp_elt_opcode (UNOP_CAST); }
1669     break;
1670 
1671   case 46:
1672 #line 401 "m2-exp.y"
1673     { }
1674     break;
1675 
1676   case 47:
1677 #line 409 "m2-exp.y"
1678     { write_exp_elt_opcode (BINOP_REPEAT); }
1679     break;
1680 
1681   case 48:
1682 #line 413 "m2-exp.y"
1683     { write_exp_elt_opcode (BINOP_MUL); }
1684     break;
1685 
1686   case 49:
1687 #line 417 "m2-exp.y"
1688     { write_exp_elt_opcode (BINOP_DIV); }
1689     break;
1690 
1691   case 50:
1692 #line 421 "m2-exp.y"
1693     { write_exp_elt_opcode (BINOP_INTDIV); }
1694     break;
1695 
1696   case 51:
1697 #line 425 "m2-exp.y"
1698     { write_exp_elt_opcode (BINOP_REM); }
1699     break;
1700 
1701   case 52:
1702 #line 429 "m2-exp.y"
1703     { write_exp_elt_opcode (BINOP_ADD); }
1704     break;
1705 
1706   case 53:
1707 #line 433 "m2-exp.y"
1708     { write_exp_elt_opcode (BINOP_SUB); }
1709     break;
1710 
1711   case 54:
1712 #line 437 "m2-exp.y"
1713     { write_exp_elt_opcode (BINOP_EQUAL); }
1714     break;
1715 
1716   case 55:
1717 #line 441 "m2-exp.y"
1718     { write_exp_elt_opcode (BINOP_NOTEQUAL); }
1719     break;
1720 
1721   case 56:
1722 #line 443 "m2-exp.y"
1723     { write_exp_elt_opcode (BINOP_NOTEQUAL); }
1724     break;
1725 
1726   case 57:
1727 #line 447 "m2-exp.y"
1728     { write_exp_elt_opcode (BINOP_LEQ); }
1729     break;
1730 
1731   case 58:
1732 #line 451 "m2-exp.y"
1733     { write_exp_elt_opcode (BINOP_GEQ); }
1734     break;
1735 
1736   case 59:
1737 #line 455 "m2-exp.y"
1738     { write_exp_elt_opcode (BINOP_LESS); }
1739     break;
1740 
1741   case 60:
1742 #line 459 "m2-exp.y"
1743     { write_exp_elt_opcode (BINOP_GTR); }
1744     break;
1745 
1746   case 61:
1747 #line 463 "m2-exp.y"
1748     { write_exp_elt_opcode (BINOP_LOGICAL_AND); }
1749     break;
1750 
1751   case 62:
1752 #line 467 "m2-exp.y"
1753     { write_exp_elt_opcode (BINOP_LOGICAL_OR); }
1754     break;
1755 
1756   case 63:
1757 #line 471 "m2-exp.y"
1758     { write_exp_elt_opcode (BINOP_ASSIGN); }
1759     break;
1760 
1761   case 64:
1762 #line 478 "m2-exp.y"
1763     { write_exp_elt_opcode (OP_BOOL);
1764 			  write_exp_elt_longcst ((LONGEST) yyvsp[0].ulval);
1765 			  write_exp_elt_opcode (OP_BOOL); }
1766     break;
1767 
1768   case 65:
1769 #line 484 "m2-exp.y"
1770     { write_exp_elt_opcode (OP_BOOL);
1771 			  write_exp_elt_longcst ((LONGEST) yyvsp[0].ulval);
1772 			  write_exp_elt_opcode (OP_BOOL); }
1773     break;
1774 
1775   case 66:
1776 #line 490 "m2-exp.y"
1777     { write_exp_elt_opcode (OP_LONG);
1778 			  write_exp_elt_type (builtin_type_m2_int);
1779 			  write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
1780 			  write_exp_elt_opcode (OP_LONG); }
1781     break;
1782 
1783   case 67:
1784 #line 497 "m2-exp.y"
1785     {
1786 			  write_exp_elt_opcode (OP_LONG);
1787 			  write_exp_elt_type (builtin_type_m2_card);
1788 			  write_exp_elt_longcst ((LONGEST) yyvsp[0].ulval);
1789 			  write_exp_elt_opcode (OP_LONG);
1790 			}
1791     break;
1792 
1793   case 68:
1794 #line 506 "m2-exp.y"
1795     { write_exp_elt_opcode (OP_LONG);
1796 			  write_exp_elt_type (builtin_type_m2_char);
1797 			  write_exp_elt_longcst ((LONGEST) yyvsp[0].ulval);
1798 			  write_exp_elt_opcode (OP_LONG); }
1799     break;
1800 
1801   case 69:
1802 #line 514 "m2-exp.y"
1803     { write_exp_elt_opcode (OP_DOUBLE);
1804 			  write_exp_elt_type (builtin_type_m2_real);
1805 			  write_exp_elt_dblcst (yyvsp[0].dval);
1806 			  write_exp_elt_opcode (OP_DOUBLE); }
1807     break;
1808 
1809   case 71:
1810 #line 524 "m2-exp.y"
1811     { write_exp_elt_opcode (OP_LONG);
1812 			  write_exp_elt_type (builtin_type_int);
1813 			  write_exp_elt_longcst ((LONGEST) TYPE_LENGTH (yyvsp[-1].tval));
1814 			  write_exp_elt_opcode (OP_LONG); }
1815     break;
1816 
1817   case 72:
1818 #line 531 "m2-exp.y"
1819     { write_exp_elt_opcode (OP_M2_STRING);
1820 			  write_exp_string (yyvsp[0].sval);
1821 			  write_exp_elt_opcode (OP_M2_STRING); }
1822     break;
1823 
1824   case 73:
1825 #line 538 "m2-exp.y"
1826     { yyval.bval = SYMBOL_BLOCK_VALUE(yyvsp[0].sym); }
1827     break;
1828 
1829   case 74:
1830 #line 542 "m2-exp.y"
1831     { struct symbol *sym
1832 			    = lookup_symbol (copy_name (yyvsp[0].sval), expression_context_block,
1833 					     VAR_DOMAIN, 0, NULL);
1834 			  yyval.sym = sym;}
1835     break;
1836 
1837   case 75:
1838 #line 551 "m2-exp.y"
1839     { struct symbol *tem
1840 			    = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval,
1841 					     VAR_DOMAIN, 0, NULL);
1842 			  if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
1843 			    error ("No function \"%s\" in specified context.",
1844 				   copy_name (yyvsp[0].sval));
1845 			  yyval.sym = tem;
1846 			}
1847     break;
1848 
1849   case 76:
1850 #line 563 "m2-exp.y"
1851     { write_exp_elt_opcode(OP_VAR_VALUE);
1852 			  write_exp_elt_block (NULL);
1853 			  write_exp_elt_sym (yyvsp[0].sym);
1854 			  write_exp_elt_opcode (OP_VAR_VALUE); }
1855     break;
1856 
1857   case 78:
1858 #line 575 "m2-exp.y"
1859     { struct symbol *sym;
1860 			  sym = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval,
1861 					       VAR_DOMAIN, 0, NULL);
1862 			  if (sym == 0)
1863 			    error ("No symbol \"%s\" in specified context.",
1864 				   copy_name (yyvsp[0].sval));
1865 
1866 			  write_exp_elt_opcode (OP_VAR_VALUE);
1867 			  /* block_found is set by lookup_symbol.  */
1868 			  write_exp_elt_block (block_found);
1869 			  write_exp_elt_sym (sym);
1870 			  write_exp_elt_opcode (OP_VAR_VALUE); }
1871     break;
1872 
1873   case 79:
1874 #line 591 "m2-exp.y"
1875     { struct symbol *sym;
1876 			  int is_a_field_of_this;
1877 
1878  			  sym = lookup_symbol (copy_name (yyvsp[0].sval),
1879 					       expression_context_block,
1880 					       VAR_DOMAIN,
1881 					       &is_a_field_of_this,
1882 					       NULL);
1883 			  if (sym)
1884 			    {
1885 			      if (symbol_read_needs_frame (sym))
1886 				{
1887 				  if (innermost_block == 0 ||
1888 				      contained_in (block_found,
1889 						    innermost_block))
1890 				    innermost_block = block_found;
1891 				}
1892 
1893 			      write_exp_elt_opcode (OP_VAR_VALUE);
1894 			      /* We want to use the selected frame, not
1895 				 another more inner frame which happens to
1896 				 be in the same block.  */
1897 			      write_exp_elt_block (NULL);
1898 			      write_exp_elt_sym (sym);
1899 			      write_exp_elt_opcode (OP_VAR_VALUE);
1900 			    }
1901 			  else
1902 			    {
1903 			      struct minimal_symbol *msymbol;
1904 			      char *arg = copy_name (yyvsp[0].sval);
1905 
1906 			      msymbol =
1907 				lookup_minimal_symbol (arg, NULL, NULL);
1908 			      if (msymbol != NULL)
1909 				{
1910 				  write_exp_msymbol
1911 				    (msymbol,
1912 				     lookup_function_type (builtin_type_int),
1913 				     builtin_type_int);
1914 				}
1915 			      else if (!have_full_symbols () && !have_partial_symbols ())
1916 				error ("No symbol table is loaded.  Use the \"symbol-file\" command.");
1917 			      else
1918 				error ("No symbol \"%s\" in current context.",
1919 				       copy_name (yyvsp[0].sval));
1920 			    }
1921 			}
1922     break;
1923 
1924   case 80:
1925 #line 642 "m2-exp.y"
1926     { yyval.tval = lookup_typename (copy_name (yyvsp[0].sval),
1927 						expression_context_block, 0); }
1928     break;
1929 
1930 
1931     }
1932 
1933 /* Line 1000 of yacc.c.  */
1934 
1935   yyvsp -= yylen;
1936   yyssp -= yylen;
1937 
1938 
1939   YY_STACK_PRINT (yyss, yyssp);
1940 
1941   *++yyvsp = yyval;
1942 
1943 
1944   /* Now `shift' the result of the reduction.  Determine what state
1945      that goes to, based on the state we popped back to and the rule
1946      number reduced by.  */
1947 
1948   yyn = yyr1[yyn];
1949 
1950   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1951   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1952     yystate = yytable[yystate];
1953   else
1954     yystate = yydefgoto[yyn - YYNTOKENS];
1955 
1956   goto yynewstate;
1957 
1958 
1959 /*------------------------------------.
1960 | yyerrlab -- here on detecting error |
1961 `------------------------------------*/
1962 yyerrlab:
1963   /* If not already recovering from an error, report this error.  */
1964   if (!yyerrstatus)
1965     {
1966       ++yynerrs;
1967 #if YYERROR_VERBOSE
1968       yyn = yypact[yystate];
1969 
1970       if (YYPACT_NINF < yyn && yyn < YYLAST)
1971 	{
1972 	  YYSIZE_T yysize = 0;
1973 	  int yytype = YYTRANSLATE (yychar);
1974 	  const char* yyprefix;
1975 	  char *yymsg;
1976 	  int yyx;
1977 
1978 	  /* Start YYX at -YYN if negative to avoid negative indexes in
1979 	     YYCHECK.  */
1980 	  int yyxbegin = yyn < 0 ? -yyn : 0;
1981 
1982 	  /* Stay within bounds of both yycheck and yytname.  */
1983 	  int yychecklim = YYLAST - yyn;
1984 	  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1985 	  int yycount = 0;
1986 
1987 	  yyprefix = ", expecting ";
1988 	  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1989 	    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1990 	      {
1991 		yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
1992 		yycount += 1;
1993 		if (yycount == 5)
1994 		  {
1995 		    yysize = 0;
1996 		    break;
1997 		  }
1998 	      }
1999 	  yysize += (sizeof ("syntax error, unexpected ")
2000 		     + yystrlen (yytname[yytype]));
2001 	  yymsg = (char *) YYSTACK_ALLOC (yysize);
2002 	  if (yymsg != 0)
2003 	    {
2004 	      char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
2005 	      yyp = yystpcpy (yyp, yytname[yytype]);
2006 
2007 	      if (yycount < 5)
2008 		{
2009 		  yyprefix = ", expecting ";
2010 		  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
2011 		    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2012 		      {
2013 			yyp = yystpcpy (yyp, yyprefix);
2014 			yyp = yystpcpy (yyp, yytname[yyx]);
2015 			yyprefix = " or ";
2016 		      }
2017 		}
2018 	      yyerror (yymsg);
2019 	      YYSTACK_FREE (yymsg);
2020 	    }
2021 	  else
2022 	    yyerror ("syntax error; also virtual memory exhausted");
2023 	}
2024       else
2025 #endif /* YYERROR_VERBOSE */
2026 	yyerror ("syntax error");
2027     }
2028 
2029 
2030 
2031   if (yyerrstatus == 3)
2032     {
2033       /* If just tried and failed to reuse lookahead token after an
2034 	 error, discard it.  */
2035 
2036       if (yychar <= YYEOF)
2037         {
2038           /* If at end of input, pop the error token,
2039 	     then the rest of the stack, then return failure.  */
2040 	  if (yychar == YYEOF)
2041 	     for (;;)
2042 	       {
2043 		 YYPOPSTACK;
2044 		 if (yyssp == yyss)
2045 		   YYABORT;
2046 		 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
2047 		 yydestruct (yystos[*yyssp], yyvsp);
2048 	       }
2049         }
2050       else
2051 	{
2052 	  YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
2053 	  yydestruct (yytoken, &yylval);
2054 	  yychar = YYEMPTY;
2055 
2056 	}
2057     }
2058 
2059   /* Else will try to reuse lookahead token after shifting the error
2060      token.  */
2061   goto yyerrlab1;
2062 
2063 
2064 /*---------------------------------------------------.
2065 | yyerrorlab -- error raised explicitly by YYERROR.  |
2066 `---------------------------------------------------*/
2067 yyerrorlab:
2068 
2069 #ifdef __GNUC__
2070   /* Pacify GCC when the user code never invokes YYERROR and the label
2071      yyerrorlab therefore never appears in user code.  */
2072   if (0)
2073      goto yyerrorlab;
2074 #endif
2075 
2076   yyvsp -= yylen;
2077   yyssp -= yylen;
2078   yystate = *yyssp;
2079   goto yyerrlab1;
2080 
2081 
2082 /*-------------------------------------------------------------.
2083 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
2084 `-------------------------------------------------------------*/
2085 yyerrlab1:
2086   yyerrstatus = 3;	/* Each real token shifted decrements this.  */
2087 
2088   for (;;)
2089     {
2090       yyn = yypact[yystate];
2091       if (yyn != YYPACT_NINF)
2092 	{
2093 	  yyn += YYTERROR;
2094 	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2095 	    {
2096 	      yyn = yytable[yyn];
2097 	      if (0 < yyn)
2098 		break;
2099 	    }
2100 	}
2101 
2102       /* Pop the current state because it cannot handle the error token.  */
2103       if (yyssp == yyss)
2104 	YYABORT;
2105 
2106       YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
2107       yydestruct (yystos[yystate], yyvsp);
2108       YYPOPSTACK;
2109       yystate = *yyssp;
2110       YY_STACK_PRINT (yyss, yyssp);
2111     }
2112 
2113   if (yyn == YYFINAL)
2114     YYACCEPT;
2115 
2116   YYDPRINTF ((stderr, "Shifting error token, "));
2117 
2118   *++yyvsp = yylval;
2119 
2120 
2121   yystate = yyn;
2122   goto yynewstate;
2123 
2124 
2125 /*-------------------------------------.
2126 | yyacceptlab -- YYACCEPT comes here.  |
2127 `-------------------------------------*/
2128 yyacceptlab:
2129   yyresult = 0;
2130   goto yyreturn;
2131 
2132 /*-----------------------------------.
2133 | yyabortlab -- YYABORT comes here.  |
2134 `-----------------------------------*/
2135 yyabortlab:
2136   yyresult = 1;
2137   goto yyreturn;
2138 
2139 #ifndef yyoverflow
2140 /*----------------------------------------------.
2141 | yyoverflowlab -- parser overflow comes here.  |
2142 `----------------------------------------------*/
2143 yyoverflowlab:
2144   yyerror ("parser stack overflow");
2145   yyresult = 2;
2146   /* Fall through.  */
2147 #endif
2148 
2149 yyreturn:
2150 #ifndef yyoverflow
2151   if (yyss != yyssa)
2152     YYSTACK_FREE (yyss);
2153 #endif
2154   return yyresult;
2155 }
2156 
2157 
2158 #line 647 "m2-exp.y"
2159 
2160 
2161 #if 0  /* FIXME! */
2162 int
2163 overflow(a,b)
2164    long a,b;
2165 {
2166    return (MAX_OF_TYPE(builtin_type_m2_int) - b) < a;
2167 }
2168 
2169 int
2170 uoverflow(a,b)
2171    unsigned long a,b;
2172 {
2173    return (MAX_OF_TYPE(builtin_type_m2_card) - b) < a;
2174 }
2175 #endif /* FIXME */
2176 
2177 /* Take care of parsing a number (anything that starts with a digit).
2178    Set yylval and return the token type; update lexptr.
2179    LEN is the number of characters in it.  */
2180 
2181 /*** Needs some error checking for the float case ***/
2182 
2183 static int
2184 parse_number (olen)
2185      int olen;
2186 {
2187   char *p = lexptr;
2188   LONGEST n = 0;
2189   LONGEST prevn = 0;
2190   int c,i,ischar=0;
2191   int base = input_radix;
2192   int len = olen;
2193   int unsigned_p = number_sign == 1 ? 1 : 0;
2194 
2195   if(p[len-1] == 'H')
2196   {
2197      base = 16;
2198      len--;
2199   }
2200   else if(p[len-1] == 'C' || p[len-1] == 'B')
2201   {
2202      base = 8;
2203      ischar = p[len-1] == 'C';
2204      len--;
2205   }
2206 
2207   /* Scan the number */
2208   for (c = 0; c < len; c++)
2209   {
2210     if (p[c] == '.' && base == 10)
2211       {
2212 	/* It's a float since it contains a point.  */
2213 	yylval.dval = atof (p);
2214 	lexptr += len;
2215 	return FLOAT;
2216       }
2217     if (p[c] == '.' && base != 10)
2218        error("Floating point numbers must be base 10.");
2219     if (base == 10 && (p[c] < '0' || p[c] > '9'))
2220        error("Invalid digit \'%c\' in number.",p[c]);
2221  }
2222 
2223   while (len-- > 0)
2224     {
2225       c = *p++;
2226       n *= base;
2227       if( base == 8 && (c == '8' || c == '9'))
2228 	 error("Invalid digit \'%c\' in octal number.",c);
2229       if (c >= '0' && c <= '9')
2230 	i = c - '0';
2231       else
2232 	{
2233 	  if (base == 16 && c >= 'A' && c <= 'F')
2234 	    i = c - 'A' + 10;
2235 	  else
2236 	     return ERROR;
2237 	}
2238       n+=i;
2239       if(i >= base)
2240 	 return ERROR;
2241       if(!unsigned_p && number_sign == 1 && (prevn >= n))
2242 	 unsigned_p=1;		/* Try something unsigned */
2243       /* Don't do the range check if n==i and i==0, since that special
2244 	 case will give an overflow error. */
2245       if(RANGE_CHECK && n!=i && i)
2246       {
2247 	 if((unsigned_p && (unsigned)prevn >= (unsigned)n) ||
2248 	    ((!unsigned_p && number_sign==-1) && -prevn <= -n))
2249 	    range_error("Overflow on numeric constant.");
2250       }
2251 	 prevn=n;
2252     }
2253 
2254   lexptr = p;
2255   if(*p == 'B' || *p == 'C' || *p == 'H')
2256      lexptr++;			/* Advance past B,C or H */
2257 
2258   if (ischar)
2259   {
2260      yylval.ulval = n;
2261      return CHAR;
2262   }
2263   else if ( unsigned_p && number_sign == 1)
2264   {
2265      yylval.ulval = n;
2266      return UINT;
2267   }
2268   else if((unsigned_p && (n<0))) {
2269      range_error("Overflow on numeric constant -- number too large.");
2270      /* But, this can return if range_check == range_warn.  */
2271   }
2272   yylval.lval = n;
2273   return INT;
2274 }
2275 
2276 
2277 /* Some tokens */
2278 
2279 static struct
2280 {
2281    char name[2];
2282    int token;
2283 } tokentab2[] =
2284 {
2285     { {'<', '>'},    NOTEQUAL 	},
2286     { {':', '='},    ASSIGN	},
2287     { {'<', '='},    LEQ	},
2288     { {'>', '='},    GEQ	},
2289     { {':', ':'},    COLONCOLON },
2290 
2291 };
2292 
2293 /* Some specific keywords */
2294 
2295 struct keyword {
2296    char keyw[10];
2297    int token;
2298 };
2299 
2300 static struct keyword keytab[] =
2301 {
2302     {"OR" ,   OROR	 },
2303     {"IN",    IN         },/* Note space after IN */
2304     {"AND",   LOGICAL_AND},
2305     {"ABS",   ABS	 },
2306     {"CHR",   CHR	 },
2307     {"DEC",   DEC	 },
2308     {"NOT",   NOT	 },
2309     {"DIV",   DIV    	 },
2310     {"INC",   INC	 },
2311     {"MAX",   MAX_FUNC	 },
2312     {"MIN",   MIN_FUNC	 },
2313     {"MOD",   MOD	 },
2314     {"ODD",   ODD	 },
2315     {"CAP",   CAP	 },
2316     {"ORD",   ORD	 },
2317     {"VAL",   VAL	 },
2318     {"EXCL",  EXCL	 },
2319     {"HIGH",  HIGH       },
2320     {"INCL",  INCL	 },
2321     {"SIZE",  SIZE       },
2322     {"FLOAT", FLOAT_FUNC },
2323     {"TRUNC", TRUNC	 },
2324 };
2325 
2326 
2327 /* Read one token, getting characters through lexptr.  */
2328 
2329 /* This is where we will check to make sure that the language and the operators used are
2330    compatible  */
2331 
2332 static int
2333 yylex ()
2334 {
2335   int c;
2336   int namelen;
2337   int i;
2338   char *tokstart;
2339   char quote;
2340 
2341  retry:
2342 
2343   prev_lexptr = lexptr;
2344 
2345   tokstart = lexptr;
2346 
2347 
2348   /* See if it is a special token of length 2 */
2349   for( i = 0 ; i < (int) (sizeof tokentab2 / sizeof tokentab2[0]) ; i++)
2350      if(DEPRECATED_STREQN(tokentab2[i].name, tokstart, 2))
2351      {
2352 	lexptr += 2;
2353 	return tokentab2[i].token;
2354      }
2355 
2356   switch (c = *tokstart)
2357     {
2358     case 0:
2359       return 0;
2360 
2361     case ' ':
2362     case '\t':
2363     case '\n':
2364       lexptr++;
2365       goto retry;
2366 
2367     case '(':
2368       paren_depth++;
2369       lexptr++;
2370       return c;
2371 
2372     case ')':
2373       if (paren_depth == 0)
2374 	return 0;
2375       paren_depth--;
2376       lexptr++;
2377       return c;
2378 
2379     case ',':
2380       if (comma_terminates && paren_depth == 0)
2381 	return 0;
2382       lexptr++;
2383       return c;
2384 
2385     case '.':
2386       /* Might be a floating point number.  */
2387       if (lexptr[1] >= '0' && lexptr[1] <= '9')
2388 	break;			/* Falls into number code.  */
2389       else
2390       {
2391 	 lexptr++;
2392 	 return DOT;
2393       }
2394 
2395 /* These are character tokens that appear as-is in the YACC grammar */
2396     case '+':
2397     case '-':
2398     case '*':
2399     case '/':
2400     case '^':
2401     case '<':
2402     case '>':
2403     case '[':
2404     case ']':
2405     case '=':
2406     case '{':
2407     case '}':
2408     case '#':
2409     case '@':
2410     case '~':
2411     case '&':
2412       lexptr++;
2413       return c;
2414 
2415     case '\'' :
2416     case '"':
2417       quote = c;
2418       for (namelen = 1; (c = tokstart[namelen]) != quote && c != '\0'; namelen++)
2419 	if (c == '\\')
2420 	  {
2421 	    c = tokstart[++namelen];
2422 	    if (c >= '0' && c <= '9')
2423 	      {
2424 		c = tokstart[++namelen];
2425 		if (c >= '0' && c <= '9')
2426 		  c = tokstart[++namelen];
2427 	      }
2428 	  }
2429       if(c != quote)
2430 	 error("Unterminated string or character constant.");
2431       yylval.sval.ptr = tokstart + 1;
2432       yylval.sval.length = namelen - 1;
2433       lexptr += namelen + 1;
2434 
2435       if(namelen == 2)  	/* Single character */
2436       {
2437 	   yylval.ulval = tokstart[1];
2438 	   return CHAR;
2439       }
2440       else
2441 	 return STRING;
2442     }
2443 
2444   /* Is it a number?  */
2445   /* Note:  We have already dealt with the case of the token '.'.
2446      See case '.' above.  */
2447   if ((c >= '0' && c <= '9'))
2448     {
2449       /* It's a number.  */
2450       int got_dot = 0, got_e = 0;
2451       char *p = tokstart;
2452       int toktype;
2453 
2454       for (++p ;; ++p)
2455 	{
2456 	  if (!got_e && (*p == 'e' || *p == 'E'))
2457 	    got_dot = got_e = 1;
2458 	  else if (!got_dot && *p == '.')
2459 	    got_dot = 1;
2460 	  else if (got_e && (p[-1] == 'e' || p[-1] == 'E')
2461 		   && (*p == '-' || *p == '+'))
2462 	    /* This is the sign of the exponent, not the end of the
2463 	       number.  */
2464 	    continue;
2465 	  else if ((*p < '0' || *p > '9') &&
2466 		   (*p < 'A' || *p > 'F') &&
2467 		   (*p != 'H'))  /* Modula-2 hexadecimal number */
2468 	    break;
2469 	}
2470 	toktype = parse_number (p - tokstart);
2471         if (toktype == ERROR)
2472 	  {
2473 	    char *err_copy = (char *) alloca (p - tokstart + 1);
2474 
2475 	    memcpy (err_copy, tokstart, p - tokstart);
2476 	    err_copy[p - tokstart] = 0;
2477 	    error ("Invalid number \"%s\".", err_copy);
2478 	  }
2479 	lexptr = p;
2480 	return toktype;
2481     }
2482 
2483   if (!(c == '_' || c == '$'
2484 	|| (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))
2485     /* We must have come across a bad character (e.g. ';').  */
2486     error ("Invalid character '%c' in expression.", c);
2487 
2488   /* It's a name.  See how long it is.  */
2489   namelen = 0;
2490   for (c = tokstart[namelen];
2491        (c == '_' || c == '$' || (c >= '0' && c <= '9')
2492 	|| (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
2493        c = tokstart[++namelen])
2494     ;
2495 
2496   /* The token "if" terminates the expression and is NOT
2497      removed from the input stream.  */
2498   if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
2499     {
2500       return 0;
2501     }
2502 
2503   lexptr += namelen;
2504 
2505   /*  Lookup special keywords */
2506   for(i = 0 ; i < (int) (sizeof(keytab) / sizeof(keytab[0])) ; i++)
2507      if(namelen == strlen(keytab[i].keyw) && DEPRECATED_STREQN(tokstart,keytab[i].keyw,namelen))
2508 	   return keytab[i].token;
2509 
2510   yylval.sval.ptr = tokstart;
2511   yylval.sval.length = namelen;
2512 
2513   if (*tokstart == '$')
2514     {
2515       write_dollar_variable (yylval.sval);
2516       return INTERNAL_VAR;
2517     }
2518 
2519   /* Use token-type BLOCKNAME for symbols that happen to be defined as
2520      functions.  If this is not so, then ...
2521      Use token-type TYPENAME for symbols that happen to be defined
2522      currently as names of types; NAME for other symbols.
2523      The caller is not constrained to care about the distinction.  */
2524  {
2525 
2526 
2527     char *tmp = copy_name (yylval.sval);
2528     struct symbol *sym;
2529 
2530     if (lookup_partial_symtab (tmp))
2531       return BLOCKNAME;
2532     sym = lookup_symbol (tmp, expression_context_block,
2533 			 VAR_DOMAIN, 0, NULL);
2534     if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK)
2535       return BLOCKNAME;
2536     if (lookup_typename (copy_name (yylval.sval), expression_context_block, 1))
2537       return TYPENAME;
2538 
2539     if(sym)
2540     {
2541        switch(sym->aclass)
2542        {
2543        case LOC_STATIC:
2544        case LOC_REGISTER:
2545        case LOC_ARG:
2546        case LOC_REF_ARG:
2547        case LOC_REGPARM:
2548        case LOC_REGPARM_ADDR:
2549        case LOC_LOCAL:
2550        case LOC_LOCAL_ARG:
2551        case LOC_BASEREG:
2552        case LOC_BASEREG_ARG:
2553        case LOC_CONST:
2554        case LOC_CONST_BYTES:
2555        case LOC_OPTIMIZED_OUT:
2556        case LOC_COMPUTED:
2557        case LOC_COMPUTED_ARG:
2558 	  return NAME;
2559 
2560        case LOC_TYPEDEF:
2561 	  return TYPENAME;
2562 
2563        case LOC_BLOCK:
2564 	  return BLOCKNAME;
2565 
2566        case LOC_UNDEF:
2567 	  error("internal:  Undefined class in m2lex()");
2568 
2569        case LOC_LABEL:
2570        case LOC_UNRESOLVED:
2571 	  error("internal:  Unforseen case in m2lex()");
2572 
2573        default:
2574 	  error ("unhandled token in m2lex()");
2575 	  break;
2576        }
2577     }
2578     else
2579     {
2580        /* Built-in BOOLEAN type.  This is sort of a hack. */
2581        if(DEPRECATED_STREQN(tokstart,"TRUE",4))
2582        {
2583 	  yylval.ulval = 1;
2584 	  return M2_TRUE;
2585        }
2586        else if(DEPRECATED_STREQN(tokstart,"FALSE",5))
2587        {
2588 	  yylval.ulval = 0;
2589 	  return M2_FALSE;
2590        }
2591     }
2592 
2593     /* Must be another type of name... */
2594     return NAME;
2595  }
2596 }
2597 
2598 #if 0		/* Unused */
2599 static char *
2600 make_qualname(mod,ident)
2601    char *mod, *ident;
2602 {
2603    char *new = xmalloc(strlen(mod)+strlen(ident)+2);
2604 
2605    strcpy(new,mod);
2606    strcat(new,".");
2607    strcat(new,ident);
2608    return new;
2609 }
2610 #endif  /* 0 */
2611 
2612 void
2613 yyerror (msg)
2614      char *msg;
2615 {
2616   if (prev_lexptr)
2617     lexptr = prev_lexptr;
2618 
2619   error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr);
2620 }
2621 
2622 
2623