Oh GACK! src-clean doesn't quite work that easily since cleandist rebuilds the
[unix-history] / gnu / usr.bin / gdb / gdb / m2-exp.tab.c
#ifndef lint
static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93";
#endif
#define YYBYACC 1
#define YYMAJOR 1
#define YYMINOR 9
#define yyclearin (yychar=(-1))
#define yyerrok (yyerrflag=0)
#define YYRECOVERING (yyerrflag!=0)
#define yyparse m2_parse
#define yylex m2_lex
#define yyerror m2_error
#define yychar m2_char
#define yyval m2_val
#define yylval m2_lval
#define yydebug m2_debug
#define yynerrs m2_nerrs
#define yyerrflag m2_errflag
#define yyss m2_ss
#define yyssp m2_ssp
#define yyvs m2_vs
#define yyvsp m2_vsp
#define yylhs m2_lhs
#define yylen m2_len
#define yydefred m2_defred
#define yydgoto m2_dgoto
#define yysindex m2_sindex
#define yyrindex m2_rindex
#define yygindex m2_gindex
#define yytable m2_table
#define yycheck m2_check
#define yyname m2_name
#define yyrule m2_rule
#define YYPREFIX "m2_"
#line 40 "./m2-exp.y"
#include "defs.h"
#include "expression.h"
#include "language.h"
#include "value.h"
#include "parser-defs.h"
#include "m2-lang.h"
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
as well as gratuitiously global symbol names, so we can have multiple
yacc generated parsers in gdb. Note that these are only the variables
produced by yacc. If other parser generators (bison, byacc, etc) produce
additional global names that conflict at link time, then those parser
generators need to be fixed instead of adding those names to this list. */
#define yymaxdepth m2_maxdepth
#define yyparse m2_parse
#define yylex m2_lex
#define yyerror m2_error
#define yylval m2_lval
#define yychar m2_char
#define yydebug m2_debug
#define yypact m2_pact
#define yyr1 m2_r1
#define yyr2 m2_r2
#define yydef m2_def
#define yychk m2_chk
#define yypgo m2_pgo
#define yyact m2_act
#define yyexca m2_exca
#define yyerrflag m2_errflag
#define yynerrs m2_nerrs
#define yyps m2_ps
#define yypv m2_pv
#define yys m2_s
#define yy_yys m2_yys
#define yystate m2_state
#define yytmp m2_tmp
#define yyv m2_v
#define yy_yyv m2_yyv
#define yyval m2_val
#define yylloc m2_lloc
#define yyreds m2_reds /* With YYDEBUG defined */
#define yytoks m2_toks /* With YYDEBUG defined */
#ifndef YYDEBUG
#define YYDEBUG 0 /* Default to no yydebug support */
#endif
int
yyparse PARAMS ((void));
static int
yylex PARAMS ((void));
void
yyerror PARAMS ((char *));
#if 0
static char *
make_qualname PARAMS ((char *, char *));
#endif
static int
parse_number PARAMS ((int));
/* The sign of the number being parsed. */
static int number_sign = 1;
/* The block that the module specified by the qualifer on an identifer is
contained in, */
#if 0
static struct block *modblock=0;
#endif
#line 121 "./m2-exp.y"
typedef union
{
LONGEST lval;
unsigned LONGEST ulval;
double dval;
struct symbol *sym;
struct type *tval;
struct stoken sval;
int voidval;
struct block *bval;
enum exp_opcode opcode;
struct internalvar *ivar;
struct type **tvec;
int *ivec;
} YYSTYPE;
#line 129 "y.tab.c"
#define INT 257
#define HEX 258
#define ERROR 259
#define UINT 260
#define M2_TRUE 261
#define M2_FALSE 262
#define CHAR 263
#define FLOAT 264
#define STRING 265
#define NAME 266
#define BLOCKNAME 267
#define IDENT 268
#define VARNAME 269
#define TYPENAME 270
#define SIZE 271
#define CAP 272
#define ORD 273
#define HIGH 274
#define ABS 275
#define MIN_FUNC 276
#define MAX_FUNC 277
#define FLOAT_FUNC 278
#define VAL 279
#define CHR 280
#define ODD 281
#define TRUNC 282
#define INC 283
#define DEC 284
#define INCL 285
#define EXCL 286
#define COLONCOLON 287
#define LAST 288
#define REGNAME 289
#define INTERNAL_VAR 290
#define ABOVE_COMMA 291
#define ASSIGN 292
#define LEQ 293
#define GEQ 294
#define NOTEQUAL 295
#define IN 296
#define OROR 297
#define LOGICAL_AND 298
#define DIV 299
#define MOD 300
#define UNARY 301
#define DOT 302
#define NOT 303
#define QID 304
#define YYERRCODE 256
short m2_lhs[] = { -1,
0, 0, 2, 1, 8, 1, 1, 1, 9, 9,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 3, 3, 12, 1, 13, 1, 10, 10, 10,
11, 11, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 6, 7, 7, 4, 4, 4, 4,
5,
};
short m2_len[] = { 2,
1, 1, 1, 2, 0, 3, 2, 2, 1, 1,
4, 4, 4, 4, 4, 4, 4, 6, 4, 4,
4, 2, 4, 6, 4, 6, 3, 1, 3, 6,
6, 3, 4, 0, 5, 0, 5, 0, 1, 3,
1, 3, 4, 4, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 1, 1, 1, 1, 1, 1, 1, 1,
1, 4, 1, 1, 1, 3, 1, 1, 3, 1,
1,
};
short m2_defred[] = { 0,
65, 66, 63, 64, 67, 68, 73, 80, 75, 81,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 70, 71, 78, 0,
5, 0, 9, 10, 0, 0, 0, 2, 28, 69,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 4, 0, 34, 36,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 45, 0, 0, 32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 29, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 27, 0, 0, 0, 0,
79, 76, 72, 11, 12, 14, 13, 15, 16, 17,
0, 19, 20, 21, 0, 23, 0, 25, 0, 0,
0, 0, 0, 0, 0, 44, 33, 0, 0, 0,
0, 0, 0, 35, 37, 18, 24, 26, 30, 31,
0,
};
short m2_dgoto[] = { 36,
66, 38, 39, 40, 47, 42, 43, 64, 44, 68,
164, 137, 138,
};
short m2_sindex[] = { 1597,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1779, -27, -21, -15, -10, -6, -3, -2, 18, 20,
24, 31, 38, 39, 59, 77, 0, 0, 0, 1597,
0, 1597, 0, 0, 1597, 0, 1670, 0, 0, 0,
-26, -256, 0, 1597, 1597, -24, -26, 1597, 1597, 1597,
1597, -218, -218, 1597, -218, 1597, 1597, 1597, 1597, 1597,
1597, 1597, -24, 1597, 939, 1670, -37, -17, 1597, 1597,
1597, 1597, 1597, 1597, 1597, 1597, -118, 1597, 1597, 1597,
1597, 1597, 1597, 1597, 1597, 1597, 0, -186, 0, 0,
1597, 1597, -259, -24, -30, 967, 1002, 1044, 1079, 78,
83, 1160, 74, 1268, 1323, 1351, 866, 894, 1183, 1404,
-24, 0, 1597, 1597, 0, 1727, -25, -25, -25, -25,
-25, -25, -25, 1597, 0, 8, 80, 192, 117, 49,
49, -24, -24, -24, -24, 0, 1597, 1597, 1449, -11,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1597, 0, 0, 0, 1597, 0, 1597, 0, 1597, 1597,
-24, 1670, 1670, -44, -20, 0, 0, 1484, 1512, 1547,
1617, 1628, 1597, 0, 0, 0, 0, 0, 0, 0,
1670,
};
short m2_rindex[] = { 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, -9, 0, 121, 0, 0, 0,
135, 0, 1, 0, 0, 12, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 40, 0, 0, -35, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, -9, 0, 68, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
106, 0, 0, 0, 0, 98, 568, 575, 598, 653,
677, 779, 838, -9, 0, 0, 561, 539, 502, 465,
489, 134, 145, 220, 411, 0, 0, -12, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
435, -18, -42, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-16,
};
short m2_gindex[] = { 0,
2066, 0, 61, 0, 341, 0, 0, 0, 0, -88,
0, 0, 0,
};
#define YYTABLESIZE 2239
short m2_table[] = { 173,
77, 41, 91, 140, 124, 39, 141, 142, 39, 91,
143, 22, 48, 91, 90, 90, 83, 81, 49, 82,
175, 84, 40, 114, 50, 40, 114, 42, 38, 51,
93, 38, 114, 52, 38, 77, 53, 54, 80, 7,
77, 77, 77, 77, 77, 77, 22, 77, 174, 165,
41, 10, 22, 22, 22, 22, 22, 55, 22, 56,
77, 77, 77, 57, 77, 89, 89, 8, 87, 87,
58, 22, 22, 22, 7, 22, 42, 59, 60, 136,
7, 7, 7, 7, 7, 92, 7, 113, 90, 39,
83, 77, 92, 77, 77, 84, 92, 62, 61, 7,
7, 7, 8, 7, 22, 6, 40, 115, 8, 8,
8, 8, 8, 167, 8, 38, 62, 151, 148, 90,
1, 83, 81, 149, 82, 77, 84, 8, 8, 8,
92, 8, 7, 47, 3, 0, 22, 125, 62, 89,
6, 62, 87, 80, 48, 0, 6, 6, 6, 6,
6, 10, 6, 0, 0, 0, 90, 0, 83, 81,
8, 82, 0, 84, 7, 6, 6, 6, 47, 6,
89, 0, 0, 87, 47, 47, 47, 47, 47, 48,
47, 0, 0, 0, 0, 48, 48, 48, 48, 48,
62, 48, 8, 47, 47, 47, 0, 47, 6, 0,
0, 0, 0, 0, 48, 48, 48, 89, 48, 0,
87, 0, 0, 0, 0, 0, 0, 0, 0, 49,
0, 0, 62, 0, 0, 0, 47, 0, 0, 0,
6, 90, 0, 83, 81, 0, 82, 48, 84, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 49, 80, 0, 0, 47, 0,
49, 49, 49, 49, 49, 0, 49, 0, 0, 48,
0, 78, 79, 85, 86, 0, 88, 88, 0, 49,
49, 49, 89, 49, 0, 87, 0, 74, 0, 0,
0, 0, 77, 77, 77, 77, 77, 77, 77, 77,
77, 0, 77, 22, 22, 22, 22, 22, 22, 22,
22, 22, 49, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 7, 7, 7, 7, 7, 7, 7, 7, 7,
41, 0, 0, 0, 49, 0, 0, 85, 86, 0,
88, 0, 0, 0, 0, 0, 0, 0, 0, 8,
8, 8, 8, 8, 8, 8, 8, 8, 0, 0,
0, 0, 0, 0, 0, 67, 0, 79, 85, 86,
0, 88, 0, 0, 0, 95, 0, 0, 0, 0,
0, 0, 100, 101, 0, 103, 0, 6, 6, 6,
6, 6, 6, 6, 6, 6, 0, 0, 0, 0,
50, 0, 0, 0, 0, 85, 86, 126, 88, 0,
0, 0, 0, 0, 0, 47, 47, 47, 47, 47,
47, 47, 47, 47, 43, 0, 48, 48, 48, 48,
48, 48, 48, 48, 48, 50, 0, 0, 0, 0,
0, 50, 50, 50, 50, 50, 0, 50, 0, 0,
0, 0, 0, 0, 51, 0, 0, 0, 0, 43,
50, 50, 50, 0, 50, 43, 43, 43, 43, 43,
0, 43, 0, 0, 0, 0, 0, 0, 52, 0,
85, 86, 0, 88, 43, 43, 43, 0, 43, 51,
0, 46, 0, 50, 0, 51, 0, 51, 51, 51,
0, 49, 49, 49, 49, 49, 49, 49, 49, 49,
0, 0, 0, 52, 51, 51, 51, 43, 51, 52,
0, 52, 52, 52, 0, 50, 46, 0, 60, 0,
0, 0, 46, 0, 0, 46, 0, 0, 52, 52,
52, 0, 52, 0, 0, 0, 0, 51, 0, 43,
61, 46, 46, 46, 0, 46, 0, 58, 0, 0,
0, 0, 0, 60, 59, 0, 0, 0, 0, 60,
0, 52, 60, 0, 0, 0, 0, 0, 0, 51,
0, 0, 0, 0, 46, 61, 0, 56, 60, 60,
60, 61, 58, 0, 61, 0, 0, 0, 58, 59,
0, 58, 0, 52, 0, 59, 0, 0, 59, 0,
61, 61, 61, 0, 0, 0, 46, 58, 58, 58,
0, 60, 56, 0, 59, 59, 59, 0, 56, 0,
0, 56, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 57, 61, 0, 0, 0, 56, 56, 56,
58, 0, 0, 60, 0, 0, 0, 59, 0, 0,
0, 0, 0, 0, 0, 0, 53, 0, 0, 0,
0, 0, 0, 0, 0, 61, 0, 57, 0, 0,
56, 0, 58, 57, 0, 0, 57, 0, 0, 59,
0, 0, 50, 50, 50, 50, 50, 50, 50, 50,
50, 53, 57, 57, 57, 0, 0, 53, 0, 0,
53, 0, 56, 0, 0, 0, 43, 43, 43, 43,
43, 43, 43, 43, 43, 0, 53, 53, 53, 0,
0, 0, 0, 0, 0, 57, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 51, 51, 51, 51,
51, 51, 51, 0, 0, 0, 0, 0, 0, 53,
0, 0, 0, 0, 0, 0, 0, 57, 54, 0,
52, 52, 52, 52, 52, 52, 52, 0, 0, 0,
0, 0, 0, 46, 46, 46, 46, 46, 46, 46,
0, 53, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 54, 0, 0, 0, 0, 0, 54,
0, 0, 54, 0, 0, 0, 0, 0, 0, 0,
60, 60, 60, 60, 60, 60, 60, 55, 54, 54,
54, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 61, 61, 61, 61, 61, 61, 0, 58,
58, 58, 58, 58, 0, 0, 59, 59, 59, 59,
59, 54, 55, 0, 0, 0, 0, 0, 55, 0,
0, 55, 0, 0, 0, 0, 0, 0, 0, 56,
56, 56, 56, 56, 0, 0, 0, 55, 55, 55,
76, 0, 0, 54, 0, 90, 156, 83, 81, 155,
82, 0, 84, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 70, 74, 71, 76, 80,
55, 0, 0, 90, 158, 83, 81, 157, 82, 0,
84, 0, 0, 0, 57, 57, 57, 57, 57, 0,
0, 0, 0, 70, 74, 71, 89, 80, 0, 87,
0, 0, 55, 0, 0, 0, 0, 0, 53, 53,
53, 53, 53, 76, 0, 0, 0, 0, 90, 112,
83, 81, 0, 82, 89, 84, 0, 87, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 70, 74,
71, 76, 80, 0, 0, 0, 90, 144, 83, 81,
0, 82, 0, 84, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 70, 74, 71, 89,
80, 0, 87, 0, 0, 0, 76, 0, 0, 0,
0, 90, 145, 83, 81, 0, 82, 0, 84, 0,
0, 0, 0, 0, 0, 0, 0, 89, 0, 0,
87, 70, 74, 71, 0, 80, 0, 0, 0, 0,
54, 54, 54, 54, 54, 0, 0, 0, 76, 0,
0, 0, 0, 90, 146, 83, 81, 0, 82, 0,
84, 0, 89, 0, 0, 87, 0, 0, 0, 0,
0, 0, 0, 70, 74, 71, 0, 80, 0, 0,
0, 0, 0, 76, 0, 0, 0, 0, 90, 147,
83, 81, 0, 82, 0, 84, 0, 0, 0, 55,
55, 55, 55, 55, 89, 0, 0, 87, 70, 74,
71, 0, 80, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 69, 72, 73,
75, 77, 78, 79, 85, 86, 0, 88, 0, 89,
0, 0, 87, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 69, 72, 73, 75, 77,
78, 79, 85, 86, 76, 88, 0, 0, 0, 90,
150, 83, 81, 0, 82, 0, 84, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 76, 0, 70,
74, 71, 90, 80, 83, 81, 159, 82, 0, 84,
69, 72, 73, 75, 77, 78, 79, 85, 86, 0,
88, 0, 70, 74, 71, 0, 80, 0, 0, 0,
89, 0, 0, 87, 0, 0, 0, 0, 69, 72,
73, 75, 77, 78, 79, 85, 86, 0, 88, 0,
0, 0, 0, 89, 0, 0, 87, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 69, 72, 73, 75, 77, 78, 79,
85, 86, 76, 88, 0, 0, 0, 90, 152, 83,
81, 0, 82, 0, 84, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 70, 74, 71,
0, 80, 0, 0, 0, 69, 72, 73, 75, 77,
78, 79, 85, 86, 0, 88, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 76, 89, 0,
0, 87, 90, 153, 83, 81, 0, 82, 0, 84,
69, 72, 73, 75, 77, 78, 79, 85, 86, 0,
88, 0, 70, 74, 71, 76, 80, 0, 0, 0,
90, 154, 83, 81, 0, 82, 0, 84, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
70, 74, 71, 89, 80, 0, 87, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 76, 0,
0, 89, 0, 90, 87, 83, 81, 160, 82, 0,
84, 69, 72, 73, 75, 77, 78, 79, 85, 86,
0, 88, 0, 70, 74, 71, 0, 80, 0, 0,
0, 0, 0, 0, 69, 72, 73, 75, 77, 78,
79, 85, 86, 76, 88, 0, 0, 0, 90, 166,
83, 81, 0, 82, 89, 84, 0, 87, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 70, 74,
71, 0, 80, 0, 0, 0, 0, 0, 76, 0,
0, 0, 0, 90, 176, 83, 81, 0, 82, 0,
84, 0, 0, 0, 0, 0, 0, 0, 0, 89,
0, 0, 87, 70, 74, 71, 76, 80, 0, 0,
0, 90, 177, 83, 81, 0, 82, 0, 84, 69,
72, 73, 75, 77, 78, 79, 85, 86, 0, 88,
0, 70, 74, 71, 89, 80, 0, 87, 0, 0,
0, 76, 0, 0, 0, 0, 90, 178, 83, 81,
0, 82, 0, 84, 0, 0, 0, 0, 0, 0,
0, 0, 89, 0, 0, 87, 70, 74, 71, 0,
80, 0, 0, 0, 69, 72, 73, 75, 77, 78,
79, 85, 86, 0, 88, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 32, 89, 0, 30,
87, 31, 69, 72, 73, 75, 77, 78, 79, 85,
86, 76, 88, 0, 0, 0, 90, 179, 83, 81,
0, 82, 76, 84, 0, 0, 0, 90, 180, 83,
81, 0, 82, 0, 84, 0, 70, 74, 71, 0,
80, 0, 0, 0, 0, 0, 0, 70, 74, 71,
0, 80, 0, 0, 0, 69, 72, 73, 75, 77,
78, 79, 85, 86, 76, 88, 0, 89, 0, 90,
87, 83, 81, 0, 82, 0, 84, 0, 89, 35,
0, 87, 34, 0, 0, 0, 0, 0, 0, 70,
74, 71, 0, 80, 0, 0, 0, 0, 0, 0,
69, 72, 73, 75, 77, 78, 79, 85, 86, 0,
88, 0, 0, 0, 0, 0, 0, 0, 0, 0,
89, 76, 0, 87, 0, 0, 90, 0, 83, 81,
0, 82, 0, 84, 0, 69, 72, 73, 75, 77,
78, 79, 85, 86, 0, 88, 70, 74, 71, 0,
80, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 69, 72, 73, 75, 77, 78, 79,
85, 86, 0, 88, 0, 0, 0, 89, 45, 0,
87, 30, 0, 31, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 69, 72,
73, 75, 77, 78, 79, 85, 86, 0, 88, 0,
0, 0, 0, 1, 0, 0, 2, 3, 4, 5,
6, 7, 8, 9, 0, 0, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 0, 27, 28, 29, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 33,
0, 35, 0, 0, 34, 0, 0, 0, 69, 72,
73, 75, 77, 78, 79, 85, 86, 0, 88, 69,
72, 73, 75, 77, 78, 79, 85, 86, 0, 88,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 69, 72, 73, 75, 77, 78, 79, 85, 86,
0, 88, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 72,
73, 75, 77, 78, 79, 85, 86, 0, 88, 0,
0, 0, 0, 0, 0, 1, 0, 0, 2, 3,
4, 5, 6, 7, 8, 9, 0, 0, 10, 11,
12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
22, 23, 24, 25, 26, 37, 27, 28, 29, 0,
0, 0, 0, 0, 0, 0, 46, 0, 0, 0,
0, 33, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 63, 0, 65, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 94,
65, 0, 0, 96, 97, 98, 99, 0, 0, 102,
0, 104, 105, 106, 107, 108, 109, 110, 0, 111,
0, 0, 0, 0, 116, 117, 118, 119, 120, 121,
122, 123, 0, 127, 128, 129, 130, 131, 132, 133,
134, 135, 0, 0, 0, 0, 139, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 161, 162,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 163, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 168, 0, 0, 0,
169, 0, 170, 0, 171, 172, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 181,
};
short m2_check[] = { 44,
0, 44, 40, 92, 123, 41, 266, 267, 44, 40,
41, 0, 40, 40, 40, 40, 42, 43, 40, 45,
41, 47, 41, 44, 40, 44, 44, 44, 41, 40,
287, 44, 44, 40, 44, 35, 40, 40, 64, 0,
40, 41, 42, 43, 44, 45, 35, 47, 93, 138,
93, 270, 41, 42, 43, 44, 45, 40, 47, 40,
60, 61, 62, 40, 64, 91, 91, 0, 94, 94,
40, 60, 61, 62, 35, 64, 93, 40, 40, 266,
41, 42, 43, 44, 45, 123, 47, 125, 40, 125,
42, 91, 123, 93, 94, 47, 123, 0, 40, 60,
61, 62, 35, 64, 93, 0, 125, 125, 41, 42,
43, 44, 45, 125, 47, 125, 40, 44, 41, 40,
0, 42, 43, 41, 45, 125, 47, 60, 61, 62,
123, 64, 93, 0, 0, -1, 125, 77, 41, 91,
35, 44, 94, 64, 0, -1, 41, 42, 43, 44,
45, 270, 47, -1, -1, -1, 40, -1, 42, 43,
93, 45, -1, 47, 125, 60, 61, 62, 35, 64,
91, -1, -1, 94, 41, 42, 43, 44, 45, 35,
47, -1, -1, -1, -1, 41, 42, 43, 44, 45,
93, 47, 125, 60, 61, 62, -1, 64, 93, -1,
-1, -1, -1, -1, 60, 61, 62, 91, 64, -1,
94, -1, -1, -1, -1, -1, -1, -1, -1, 0,
-1, -1, 125, -1, -1, -1, 93, -1, -1, -1,
125, 40, -1, 42, 43, -1, 45, 93, 47, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 35, 64, -1, -1, 125, -1,
41, 42, 43, 44, 45, -1, 47, -1, -1, 125,
-1, 297, 298, 299, 300, -1, 302, 302, -1, 60,
61, 62, 91, 64, -1, 94, -1, 287, -1, -1,
-1, -1, 292, 293, 294, 295, 296, 297, 298, 299,
300, -1, 302, 292, 293, 294, 295, 296, 297, 298,
299, 300, 93, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, 292, 293, 294, 295, 296, 297, 298, 299, 300,
0, -1, -1, -1, 125, -1, -1, 299, 300, -1,
302, -1, -1, -1, -1, -1, -1, -1, -1, 292,
293, 294, 295, 296, 297, 298, 299, 300, -1, -1,
-1, -1, -1, -1, -1, 35, -1, 298, 299, 300,
-1, 302, -1, -1, -1, 45, -1, -1, -1, -1,
-1, -1, 52, 53, -1, 55, -1, 292, 293, 294,
295, 296, 297, 298, 299, 300, -1, -1, -1, -1,
0, -1, -1, -1, -1, 299, 300, 77, 302, -1,
-1, -1, -1, -1, -1, 292, 293, 294, 295, 296,
297, 298, 299, 300, 0, -1, 292, 293, 294, 295,
296, 297, 298, 299, 300, 35, -1, -1, -1, -1,
-1, 41, 42, 43, 44, 45, -1, 47, -1, -1,
-1, -1, -1, -1, 0, -1, -1, -1, -1, 35,
60, 61, 62, -1, 64, 41, 42, 43, 44, 45,
-1, 47, -1, -1, -1, -1, -1, -1, 0, -1,
299, 300, -1, 302, 60, 61, 62, -1, 64, 35,
-1, 0, -1, 93, -1, 41, -1, 43, 44, 45,
-1, 292, 293, 294, 295, 296, 297, 298, 299, 300,
-1, -1, -1, 35, 60, 61, 62, 93, 64, 41,
-1, 43, 44, 45, -1, 125, 35, -1, 0, -1,
-1, -1, 41, -1, -1, 44, -1, -1, 60, 61,
62, -1, 64, -1, -1, -1, -1, 93, -1, 125,
0, 60, 61, 62, -1, 64, -1, 0, -1, -1,
-1, -1, -1, 35, 0, -1, -1, -1, -1, 41,
-1, 93, 44, -1, -1, -1, -1, -1, -1, 125,
-1, -1, -1, -1, 93, 35, -1, 0, 60, 61,
62, 41, 35, -1, 44, -1, -1, -1, 41, 35,
-1, 44, -1, 125, -1, 41, -1, -1, 44, -1,
60, 61, 62, -1, -1, -1, 125, 60, 61, 62,
-1, 93, 35, -1, 60, 61, 62, -1, 41, -1,
-1, 44, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, 0, 93, -1, -1, -1, 60, 61, 62,
93, -1, -1, 125, -1, -1, -1, 93, -1, -1,
-1, -1, -1, -1, -1, -1, 0, -1, -1, -1,
-1, -1, -1, -1, -1, 125, -1, 35, -1, -1,
93, -1, 125, 41, -1, -1, 44, -1, -1, 125,
-1, -1, 292, 293, 294, 295, 296, 297, 298, 299,
300, 35, 60, 61, 62, -1, -1, 41, -1, -1,
44, -1, 125, -1, -1, -1, 292, 293, 294, 295,
296, 297, 298, 299, 300, -1, 60, 61, 62, -1,
-1, -1, -1, -1, -1, 93, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 292, 293, 294, 295,
296, 297, 298, -1, -1, -1, -1, -1, -1, 93,
-1, -1, -1, -1, -1, -1, -1, 125, 0, -1,
292, 293, 294, 295, 296, 297, 298, -1, -1, -1,
-1, -1, -1, 292, 293, 294, 295, 296, 297, 298,
-1, 125, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 35, -1, -1, -1, -1, -1, 41,
-1, -1, 44, -1, -1, -1, -1, -1, -1, -1,
292, 293, 294, 295, 296, 297, 298, 0, 60, 61,
62, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, 292, 293, 294, 295, 296, 297, -1, 292,
293, 294, 295, 296, -1, -1, 292, 293, 294, 295,
296, 93, 35, -1, -1, -1, -1, -1, 41, -1,
-1, 44, -1, -1, -1, -1, -1, -1, -1, 292,
293, 294, 295, 296, -1, -1, -1, 60, 61, 62,
35, -1, -1, 125, -1, 40, 41, 42, 43, 44,
45, -1, 47, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 60, 61, 62, 35, 64,
93, -1, -1, 40, 41, 42, 43, 44, 45, -1,
47, -1, -1, -1, 292, 293, 294, 295, 296, -1,
-1, -1, -1, 60, 61, 62, 91, 64, -1, 94,
-1, -1, 125, -1, -1, -1, -1, -1, 292, 293,
294, 295, 296, 35, -1, -1, -1, -1, 40, 41,
42, 43, -1, 45, 91, 47, -1, 94, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 60, 61,
62, 35, 64, -1, -1, -1, 40, 41, 42, 43,
-1, 45, -1, 47, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 60, 61, 62, 91,
64, -1, 94, -1, -1, -1, 35, -1, -1, -1,
-1, 40, 41, 42, 43, -1, 45, -1, 47, -1,
-1, -1, -1, -1, -1, -1, -1, 91, -1, -1,
94, 60, 61, 62, -1, 64, -1, -1, -1, -1,
292, 293, 294, 295, 296, -1, -1, -1, 35, -1,
-1, -1, -1, 40, 41, 42, 43, -1, 45, -1,
47, -1, 91, -1, -1, 94, -1, -1, -1, -1,
-1, -1, -1, 60, 61, 62, -1, 64, -1, -1,
-1, -1, -1, 35, -1, -1, -1, -1, 40, 41,
42, 43, -1, 45, -1, 47, -1, -1, -1, 292,
293, 294, 295, 296, 91, -1, -1, 94, 60, 61,
62, -1, 64, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 292, 293, 294,
295, 296, 297, 298, 299, 300, -1, 302, -1, 91,
-1, -1, 94, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 292, 293, 294, 295, 296,
297, 298, 299, 300, 35, 302, -1, -1, -1, 40,
41, 42, 43, -1, 45, -1, 47, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 35, -1, 60,
61, 62, 40, 64, 42, 43, 44, 45, -1, 47,
292, 293, 294, 295, 296, 297, 298, 299, 300, -1,
302, -1, 60, 61, 62, -1, 64, -1, -1, -1,
91, -1, -1, 94, -1, -1, -1, -1, 292, 293,
294, 295, 296, 297, 298, 299, 300, -1, 302, -1,
-1, -1, -1, 91, -1, -1, 94, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 292, 293, 294, 295, 296, 297, 298,
299, 300, 35, 302, -1, -1, -1, 40, 41, 42,
43, -1, 45, -1, 47, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 60, 61, 62,
-1, 64, -1, -1, -1, 292, 293, 294, 295, 296,
297, 298, 299, 300, -1, 302, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 35, 91, -1,
-1, 94, 40, 41, 42, 43, -1, 45, -1, 47,
292, 293, 294, 295, 296, 297, 298, 299, 300, -1,
302, -1, 60, 61, 62, 35, 64, -1, -1, -1,
40, 41, 42, 43, -1, 45, -1, 47, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
60, 61, 62, 91, 64, -1, 94, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 35, -1,
-1, 91, -1, 40, 94, 42, 43, 44, 45, -1,
47, 292, 293, 294, 295, 296, 297, 298, 299, 300,
-1, 302, -1, 60, 61, 62, -1, 64, -1, -1,
-1, -1, -1, -1, 292, 293, 294, 295, 296, 297,
298, 299, 300, 35, 302, -1, -1, -1, 40, 41,
42, 43, -1, 45, 91, 47, -1, 94, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 60, 61,
62, -1, 64, -1, -1, -1, -1, -1, 35, -1,
-1, -1, -1, 40, 41, 42, 43, -1, 45, -1,
47, -1, -1, -1, -1, -1, -1, -1, -1, 91,
-1, -1, 94, 60, 61, 62, 35, 64, -1, -1,
-1, 40, 41, 42, 43, -1, 45, -1, 47, 292,
293, 294, 295, 296, 297, 298, 299, 300, -1, 302,
-1, 60, 61, 62, 91, 64, -1, 94, -1, -1,
-1, 35, -1, -1, -1, -1, 40, 41, 42, 43,
-1, 45, -1, 47, -1, -1, -1, -1, -1, -1,
-1, -1, 91, -1, -1, 94, 60, 61, 62, -1,
64, -1, -1, -1, 292, 293, 294, 295, 296, 297,
298, 299, 300, -1, 302, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 40, 91, -1, 43,
94, 45, 292, 293, 294, 295, 296, 297, 298, 299,
300, 35, 302, -1, -1, -1, 40, 41, 42, 43,
-1, 45, 35, 47, -1, -1, -1, 40, 41, 42,
43, -1, 45, -1, 47, -1, 60, 61, 62, -1,
64, -1, -1, -1, -1, -1, -1, 60, 61, 62,
-1, 64, -1, -1, -1, 292, 293, 294, 295, 296,
297, 298, 299, 300, 35, 302, -1, 91, -1, 40,
94, 42, 43, -1, 45, -1, 47, -1, 91, 123,
-1, 94, 126, -1, -1, -1, -1, -1, -1, 60,
61, 62, -1, 64, -1, -1, -1, -1, -1, -1,
292, 293, 294, 295, 296, 297, 298, 299, 300, -1,
302, -1, -1, -1, -1, -1, -1, -1, -1, -1,
91, 35, -1, 94, -1, -1, 40, -1, 42, 43,
-1, 45, -1, 47, -1, 292, 293, 294, 295, 296,
297, 298, 299, 300, -1, 302, 60, 61, 62, -1,
64, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 292, 293, 294, 295, 296, 297, 298,
299, 300, -1, 302, -1, -1, -1, 91, 40, -1,
94, 43, -1, 45, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 292, 293,
294, 295, 296, 297, 298, 299, 300, -1, 302, -1,
-1, -1, -1, 257, -1, -1, 260, 261, 262, 263,
264, 265, 266, 267, -1, -1, 270, 271, 272, 273,
274, 275, 276, 277, 278, 279, 280, 281, 282, 283,
284, 285, 286, -1, 288, 289, 290, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, 303,
-1, 123, -1, -1, 126, -1, -1, -1, 292, 293,
294, 295, 296, 297, 298, 299, 300, -1, 302, 292,
293, 294, 295, 296, 297, 298, 299, 300, -1, 302,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, 292, 293, 294, 295, 296, 297, 298, 299, 300,
-1, 302, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, 293,
294, 295, 296, 297, 298, 299, 300, -1, 302, -1,
-1, -1, -1, -1, -1, 257, -1, -1, 260, 261,
262, 263, 264, 265, 266, 267, -1, -1, 270, 271,
272, 273, 274, 275, 276, 277, 278, 279, 280, 281,
282, 283, 284, 285, 286, 0, 288, 289, 290, -1,
-1, -1, -1, -1, -1, -1, 11, -1, -1, -1,
-1, 303, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 30, -1, 32, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, 44,
45, -1, -1, 48, 49, 50, 51, -1, -1, 54,
-1, 56, 57, 58, 59, 60, 61, 62, -1, 64,
-1, -1, -1, -1, 69, 70, 71, 72, 73, 74,
75, 76, -1, 78, 79, 80, 81, 82, 83, 84,
85, 86, -1, -1, -1, -1, 91, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 113, 114,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, 137, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 151, -1, -1, -1,
155, -1, 157, -1, 159, 160, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 173,
};
#define YYFINAL 36
#ifndef YYDEBUG
#define YYDEBUG 0
#endif
#define YYMAXTOKEN 304
#if YYDEBUG
char *m2_name[] = {
"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,"'#'",0,0,"'&'",0,"'('","')'","'*'","'+'","','","'-'",0,"'/'",0,0,0,0,0,0,0,0,
0,0,0,0,"'<'","'='","'>'",0,"'@'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,"'['",0,"']'","'^'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,"'{'",0,"'}'","'~'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"INT","HEX","ERROR","UINT","M2_TRUE",
"M2_FALSE","CHAR","FLOAT","STRING","NAME","BLOCKNAME","IDENT","VARNAME",
"TYPENAME","SIZE","CAP","ORD","HIGH","ABS","MIN_FUNC","MAX_FUNC","FLOAT_FUNC",
"VAL","CHR","ODD","TRUNC","INC","DEC","INCL","EXCL","COLONCOLON","LAST",
"REGNAME","INTERNAL_VAR","ABOVE_COMMA","ASSIGN","LEQ","GEQ","NOTEQUAL","IN",
"OROR","LOGICAL_AND","DIV","MOD","UNARY","DOT","NOT","QID",
};
char *m2_rule[] = {
"$accept : start",
"start : exp",
"start : type_exp",
"type_exp : type",
"exp : exp '^'",
"$$1 :",
"exp : '-' $$1 exp",
"exp : '+' exp",
"exp : not_exp exp",
"not_exp : NOT",
"not_exp : '~'",
"exp : CAP '(' exp ')'",
"exp : ORD '(' exp ')'",
"exp : ABS '(' exp ')'",
"exp : HIGH '(' exp ')'",
"exp : MIN_FUNC '(' type ')'",
"exp : MAX_FUNC '(' type ')'",
"exp : FLOAT_FUNC '(' exp ')'",
"exp : VAL '(' type ',' exp ')'",
"exp : CHR '(' exp ')'",
"exp : ODD '(' exp ')'",
"exp : TRUNC '(' exp ')'",
"exp : SIZE exp",
"exp : INC '(' exp ')'",
"exp : INC '(' exp ',' exp ')'",
"exp : DEC '(' exp ')'",
"exp : DEC '(' exp ',' exp ')'",
"exp : exp DOT NAME",
"exp : set",
"exp : exp IN set",
"exp : INCL '(' exp ',' exp ')'",
"exp : EXCL '(' exp ',' exp ')'",
"set : '{' arglist '}'",
"set : type '{' arglist '}'",
"$$2 :",
"exp : exp '[' $$2 non_empty_arglist ']'",
"$$3 :",
"exp : exp '(' $$3 arglist ')'",
"arglist :",
"arglist : exp",
"arglist : arglist ',' exp",
"non_empty_arglist : exp",
"non_empty_arglist : non_empty_arglist ',' exp",
"exp : '{' type '}' exp",
"exp : type '(' exp ')'",
"exp : '(' exp ')'",
"exp : exp '@' exp",
"exp : exp '*' exp",
"exp : exp '/' exp",
"exp : exp DIV exp",
"exp : exp MOD exp",
"exp : exp '+' exp",
"exp : exp '-' exp",
"exp : exp '=' exp",
"exp : exp NOTEQUAL exp",
"exp : exp '#' exp",
"exp : exp LEQ exp",
"exp : exp GEQ exp",
"exp : exp '<' exp",
"exp : exp '>' exp",
"exp : exp LOGICAL_AND exp",
"exp : exp OROR exp",
"exp : exp ASSIGN exp",
"exp : M2_TRUE",
"exp : M2_FALSE",
"exp : INT",
"exp : UINT",
"exp : CHAR",
"exp : FLOAT",
"exp : variable",
"exp : LAST",
"exp : REGNAME",
"exp : SIZE '(' type ')'",
"exp : STRING",
"block : fblock",
"fblock : BLOCKNAME",
"fblock : block COLONCOLON BLOCKNAME",
"variable : fblock",
"variable : INTERNAL_VAR",
"variable : block COLONCOLON NAME",
"variable : NAME",
"type : TYPENAME",
};
#endif
#ifdef YYSTACKSIZE
#undef YYMAXDEPTH
#define YYMAXDEPTH YYSTACKSIZE
#else
#ifdef YYMAXDEPTH
#define YYSTACKSIZE YYMAXDEPTH
#else
#define YYSTACKSIZE 500
#define YYMAXDEPTH 500
#endif
#endif
int yydebug;
int yynerrs;
int yyerrflag;
int yychar;
short *yyssp;
YYSTYPE *yyvsp;
YYSTYPE yyval;
YYSTYPE yylval;
short yyss[YYSTACKSIZE];
YYSTYPE yyvs[YYSTACKSIZE];
#define yystacksize YYSTACKSIZE
#line 658 "./m2-exp.y"
#if 0 /* FIXME! */
int
overflow(a,b)
long a,b;
{
return (MAX_OF_TYPE(builtin_type_m2_int) - b) < a;
}
int
uoverflow(a,b)
unsigned long a,b;
{
return (MAX_OF_TYPE(builtin_type_m2_card) - b) < a;
}
#endif /* FIXME */
/* Take care of parsing a number (anything that starts with a digit).
Set yylval and return the token type; update lexptr.
LEN is the number of characters in it. */
/*** Needs some error checking for the float case ***/
static int
parse_number (olen)
int olen;
{
register char *p = lexptr;
register LONGEST n = 0;
register LONGEST prevn = 0;
register int c,i,ischar=0;
register int base = input_radix;
register int len = olen;
int unsigned_p = number_sign == 1 ? 1 : 0;
if(p[len-1] == 'H')
{
base = 16;
len--;
}
else if(p[len-1] == 'C' || p[len-1] == 'B')
{
base = 8;
ischar = p[len-1] == 'C';
len--;
}
/* Scan the number */
for (c = 0; c < len; c++)
{
if (p[c] == '.' && base == 10)
{
/* It's a float since it contains a point. */
yylval.dval = atof (p);
lexptr += len;
return FLOAT;
}
if (p[c] == '.' && base != 10)
error("Floating point numbers must be base 10.");
if (base == 10 && (p[c] < '0' || p[c] > '9'))
error("Invalid digit \'%c\' in number.",p[c]);
}
while (len-- > 0)
{
c = *p++;
n *= base;
if( base == 8 && (c == '8' || c == '9'))
error("Invalid digit \'%c\' in octal number.",c);
if (c >= '0' && c <= '9')
i = c - '0';
else
{
if (base == 16 && c >= 'A' && c <= 'F')
i = c - 'A' + 10;
else
return ERROR;
}
n+=i;
if(i >= base)
return ERROR;
if(!unsigned_p && number_sign == 1 && (prevn >= n))
unsigned_p=1; /* Try something unsigned */
/* Don't do the range check if n==i and i==0, since that special
case will give an overflow error. */
if(RANGE_CHECK && n!=i && i)
{
if((unsigned_p && (unsigned)prevn >= (unsigned)n) ||
((!unsigned_p && number_sign==-1) && -prevn <= -n))
range_error("Overflow on numeric constant.");
}
prevn=n;
}
lexptr = p;
if(*p == 'B' || *p == 'C' || *p == 'H')
lexptr++; /* Advance past B,C or H */
if (ischar)
{
yylval.ulval = n;
return CHAR;
}
else if ( unsigned_p && number_sign == 1)
{
yylval.ulval = n;
return UINT;
}
else if((unsigned_p && (n<0))) {
range_error("Overflow on numeric constant -- number too large.");
/* But, this can return if range_check == range_warn. */
}
yylval.lval = n;
return INT;
}
/* Some tokens */
static struct
{
char name[2];
int token;
} tokentab2[] =
{
{ {'<', '>'}, NOTEQUAL },
{ {':', '='}, ASSIGN },
{ {'<', '='}, LEQ },
{ {'>', '='}, GEQ },
{ {':', ':'}, COLONCOLON },
};
/* Some specific keywords */
struct keyword {
char keyw[10];
int token;
};
static struct keyword keytab[] =
{
{"OR" , OROR },
{"IN", IN },/* Note space after IN */
{"AND", LOGICAL_AND},
{"ABS", ABS },
{"CHR", CHR },
{"DEC", DEC },
{"NOT", NOT },
{"DIV", DIV },
{"INC", INC },
{"MAX", MAX_FUNC },
{"MIN", MIN_FUNC },
{"MOD", MOD },
{"ODD", ODD },
{"CAP", CAP },
{"ORD", ORD },
{"VAL", VAL },
{"EXCL", EXCL },
{"HIGH", HIGH },
{"INCL", INCL },
{"SIZE", SIZE },
{"FLOAT", FLOAT_FUNC },
{"TRUNC", TRUNC },
};
/* Read one token, getting characters through lexptr. */
/* This is where we will check to make sure that the language and the operators used are
compatible */
static int
yylex ()
{
register int c;
register int namelen;
register int i;
register char *tokstart;
register char quote;
retry:
tokstart = lexptr;
/* See if it is a special token of length 2 */
for( i = 0 ; i < sizeof tokentab2 / sizeof tokentab2[0] ; i++)
if(STREQN(tokentab2[i].name, tokstart, 2))
{
lexptr += 2;
return tokentab2[i].token;
}
switch (c = *tokstart)
{
case 0:
return 0;
case ' ':
case '\t':
case '\n':
lexptr++;
goto retry;
case '(':
paren_depth++;
lexptr++;
return c;
case ')':
if (paren_depth == 0)
return 0;
paren_depth--;
lexptr++;
return c;
case ',':
if (comma_terminates && paren_depth == 0)
return 0;
lexptr++;
return c;
case '.':
/* Might be a floating point number. */
if (lexptr[1] >= '0' && lexptr[1] <= '9')
break; /* Falls into number code. */
else
{
lexptr++;
return DOT;
}
/* These are character tokens that appear as-is in the YACC grammar */
case '+':
case '-':
case '*':
case '/':
case '^':
case '<':
case '>':
case '[':
case ']':
case '=':
case '{':
case '}':
case '#':
case '@':
case '~':
case '&':
lexptr++;
return c;
case '\'' :
case '"':
quote = c;
for (namelen = 1; (c = tokstart[namelen]) != quote && c != '\0'; namelen++)
if (c == '\\')
{
c = tokstart[++namelen];
if (c >= '0' && c <= '9')
{
c = tokstart[++namelen];
if (c >= '0' && c <= '9')
c = tokstart[++namelen];
}
}
if(c != quote)
error("Unterminated string or character constant.");
yylval.sval.ptr = tokstart + 1;
yylval.sval.length = namelen - 1;
lexptr += namelen + 1;
if(namelen == 2) /* Single character */
{
yylval.ulval = tokstart[1];
return CHAR;
}
else
return STRING;
}
/* Is it a number? */
/* Note: We have already dealt with the case of the token '.'.
See case '.' above. */
if ((c >= '0' && c <= '9'))
{
/* It's a number. */
int got_dot = 0, got_e = 0;
register char *p = tokstart;
int toktype;
for (++p ;; ++p)
{
if (!got_e && (*p == 'e' || *p == 'E'))
got_dot = got_e = 1;
else if (!got_dot && *p == '.')
got_dot = 1;
else if (got_e && (p[-1] == 'e' || p[-1] == 'E')
&& (*p == '-' || *p == '+'))
/* This is the sign of the exponent, not the end of the
number. */
continue;
else if ((*p < '0' || *p > '9') &&
(*p < 'A' || *p > 'F') &&
(*p != 'H')) /* Modula-2 hexadecimal number */
break;
}
toktype = parse_number (p - tokstart);
if (toktype == ERROR)
{
char *err_copy = (char *) alloca (p - tokstart + 1);
memcpy (err_copy, tokstart, p - tokstart);
err_copy[p - tokstart] = 0;
error ("Invalid number \"%s\".", err_copy);
}
lexptr = p;
return toktype;
}
if (!(c == '_' || c == '$'
|| (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))
/* We must have come across a bad character (e.g. ';'). */
error ("Invalid character '%c' in expression.", c);
/* It's a name. See how long it is. */
namelen = 0;
for (c = tokstart[namelen];
(c == '_' || c == '$' || (c >= '0' && c <= '9')
|| (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
c = tokstart[++namelen])
;
/* The token "if" terminates the expression and is NOT
removed from the input stream. */
if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
{
return 0;
}
lexptr += namelen;
/* Handle the tokens $digits; also $ (short for $0) and $$ (short for $$1)
and $$digits (equivalent to $<-digits> if you could type that).
Make token type LAST, and put the number (the digits) in yylval. */
if (*tokstart == '$')
{
register int negate = 0;
c = 1;
/* Double dollar means negate the number and add -1 as well.
Thus $$ alone means -1. */
if (namelen >= 2 && tokstart[1] == '$')
{
negate = 1;
c = 2;
}
if (c == namelen)
{
/* Just dollars (one or two) */
yylval.lval = - negate;
return LAST;
}
/* Is the rest of the token digits? */
for (; c < namelen; c++)
if (!(tokstart[c] >= '0' && tokstart[c] <= '9'))
break;
if (c == namelen)
{
yylval.lval = atoi (tokstart + 1 + negate);
if (negate)
yylval.lval = - yylval.lval;
return LAST;
}
}
/* Handle tokens that refer to machine registers:
$ followed by a register name. */
if (*tokstart == '$') {
for (c = 0; c < NUM_REGS; c++)
if (namelen - 1 == strlen (reg_names[c])
&& STREQN (tokstart + 1, reg_names[c], namelen - 1))
{
yylval.lval = c;
return REGNAME;
}
for (c = 0; c < num_std_regs; c++)
if (namelen - 1 == strlen (std_regs[c].name)
&& STREQN (tokstart + 1, std_regs[c].name, namelen - 1))
{
yylval.lval = std_regs[c].regnum;
return REGNAME;
}
}
/* Lookup special keywords */
for(i = 0 ; i < sizeof(keytab) / sizeof(keytab[0]) ; i++)
if(namelen == strlen(keytab[i].keyw) && STREQN(tokstart,keytab[i].keyw,namelen))
return keytab[i].token;
yylval.sval.ptr = tokstart;
yylval.sval.length = namelen;
/* Any other names starting in $ are debugger internal variables. */
if (*tokstart == '$')
{
yylval.ivar = (struct internalvar *) lookup_internalvar (copy_name (yylval.sval) + 1);
return INTERNAL_VAR;
}
/* Use token-type BLOCKNAME for symbols that happen to be defined as
functions. If this is not so, then ...
Use token-type TYPENAME for symbols that happen to be defined
currently as names of types; NAME for other symbols.
The caller is not constrained to care about the distinction. */
{
char *tmp = copy_name (yylval.sval);
struct symbol *sym;
if (lookup_partial_symtab (tmp))
return BLOCKNAME;
sym = lookup_symbol (tmp, expression_context_block,
VAR_NAMESPACE, 0, NULL);
if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK)
return BLOCKNAME;
if (lookup_typename (copy_name (yylval.sval), expression_context_block, 1))
return TYPENAME;
if(sym)
{
switch(sym->class)
{
case LOC_STATIC:
case LOC_REGISTER:
case LOC_ARG:
case LOC_REF_ARG:
case LOC_REGPARM:
case LOC_REGPARM_ADDR:
case LOC_LOCAL:
case LOC_LOCAL_ARG:
case LOC_BASEREG:
case LOC_BASEREG_ARG:
case LOC_CONST:
case LOC_CONST_BYTES:
case LOC_OPTIMIZED_OUT:
return NAME;
case LOC_TYPEDEF:
return TYPENAME;
case LOC_BLOCK:
return BLOCKNAME;
case LOC_UNDEF:
error("internal: Undefined class in m2lex()");
case LOC_LABEL:
error("internal: Unforseen case in m2lex()");
}
}
else
{
/* Built-in BOOLEAN type. This is sort of a hack. */
if(STREQN(tokstart,"TRUE",4))
{
yylval.ulval = 1;
return M2_TRUE;
}
else if(STREQN(tokstart,"FALSE",5))
{
yylval.ulval = 0;
return M2_FALSE;
}
}
/* Must be another type of name... */
return NAME;
}
}
#if 0 /* Unused */
static char *
make_qualname(mod,ident)
char *mod, *ident;
{
char *new = xmalloc(strlen(mod)+strlen(ident)+2);
strcpy(new,mod);
strcat(new,".");
strcat(new,ident);
return new;
}
#endif /* 0 */
void
yyerror(msg)
char *msg; /* unused */
{
printf("Parsing: %s\n",lexptr);
if (yychar < 256)
error("Invalid syntax in expression near character '%c'.",yychar);
else
error("Invalid syntax in expression");
}
#line 1366 "y.tab.c"
#define YYABORT goto yyabort
#define YYREJECT goto yyabort
#define YYACCEPT goto yyaccept
#define YYERROR goto yyerrlab
int
yyparse()
{
register int yym, yyn, yystate;
#if YYDEBUG
register char *yys;
extern char *getenv();
if (yys = getenv("YYDEBUG"))
{
yyn = *yys;
if (yyn >= '0' && yyn <= '9')
yydebug = yyn - '0';
}
#endif
yynerrs = 0;
yyerrflag = 0;
yychar = (-1);
yyssp = yyss;
yyvsp = yyvs;
*yyssp = yystate = 0;
yyloop:
if (yyn = yydefred[yystate]) goto yyreduce;
if (yychar < 0)
{
if ((yychar = yylex()) < 0) yychar = 0;
#if YYDEBUG
if (yydebug)
{
yys = 0;
if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
if (!yys) yys = "illegal-symbol";
printf("%sdebug: state %d, reading %d (%s)\n",
YYPREFIX, yystate, yychar, yys);
}
#endif
}
if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
{
#if YYDEBUG
if (yydebug)
printf("%sdebug: state %d, shifting to state %d\n",
YYPREFIX, yystate, yytable[yyn]);
#endif
if (yyssp >= yyss + yystacksize - 1)
{
goto yyoverflow;
}
*++yyssp = yystate = yytable[yyn];
*++yyvsp = yylval;
yychar = (-1);
if (yyerrflag > 0) --yyerrflag;
goto yyloop;
}
if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
{
yyn = yytable[yyn];
goto yyreduce;
}
if (yyerrflag) goto yyinrecovery;
#ifdef lint
goto yynewerror;
#endif
yynewerror:
yyerror("syntax error");
#ifdef lint
goto yyerrlab;
#endif
yyerrlab:
++yynerrs;
yyinrecovery:
if (yyerrflag < 3)
{
yyerrflag = 3;
for (;;)
{
if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&
yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
{
#if YYDEBUG
if (yydebug)
printf("%sdebug: state %d, error recovery shifting\
to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);
#endif
if (yyssp >= yyss + yystacksize - 1)
{
goto yyoverflow;
}
*++yyssp = yystate = yytable[yyn];
*++yyvsp = yylval;
goto yyloop;
}
else
{
#if YYDEBUG
if (yydebug)
printf("%sdebug: error recovery discarding state %d\n",
YYPREFIX, *yyssp);
#endif
if (yyssp <= yyss) goto yyabort;
--yyssp;
--yyvsp;
}
}
}
else
{
if (yychar == 0) goto yyabort;
#if YYDEBUG
if (yydebug)
{
yys = 0;
if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
if (!yys) yys = "illegal-symbol";
printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
YYPREFIX, yystate, yychar, yys);
}
#endif
yychar = (-1);
goto yyloop;
}
yyreduce:
#if YYDEBUG
if (yydebug)
printf("%sdebug: state %d, reducing by rule %d (%s)\n",
YYPREFIX, yystate, yyn, yyrule[yyn]);
#endif
yym = yylen[yyn];
yyval = yyvsp[1-yym];
switch (yyn)
{
case 3:
#line 197 "./m2-exp.y"
{ write_exp_elt_opcode(OP_TYPE);
write_exp_elt_type(yyvsp[0].tval);
write_exp_elt_opcode(OP_TYPE);
}
break;
case 4:
#line 206 "./m2-exp.y"
{ write_exp_elt_opcode (UNOP_IND); }
break;
case 5:
#line 209 "./m2-exp.y"
{ number_sign = -1; }
break;
case 6:
#line 211 "./m2-exp.y"
{ number_sign = 1;
write_exp_elt_opcode (UNOP_NEG); }
break;
case 7:
#line 216 "./m2-exp.y"
{ write_exp_elt_opcode(UNOP_PLUS); }
break;
case 8:
#line 220 "./m2-exp.y"
{ write_exp_elt_opcode (UNOP_LOGICAL_NOT); }
break;
case 11:
#line 228 "./m2-exp.y"
{ write_exp_elt_opcode (UNOP_CAP); }
break;
case 12:
#line 232 "./m2-exp.y"
{ write_exp_elt_opcode (UNOP_ORD); }
break;
case 13:
#line 236 "./m2-exp.y"
{ write_exp_elt_opcode (UNOP_ABS); }
break;
case 14:
#line 240 "./m2-exp.y"
{ write_exp_elt_opcode (UNOP_HIGH); }
break;
case 15:
#line 244 "./m2-exp.y"
{ write_exp_elt_opcode (UNOP_MIN);
write_exp_elt_type (yyvsp[-1].tval);
write_exp_elt_opcode (UNOP_MIN); }
break;
case 16:
#line 250 "./m2-exp.y"
{ write_exp_elt_opcode (UNOP_MAX);
write_exp_elt_type (yyvsp[-1].tval);
write_exp_elt_opcode (UNOP_MIN); }
break;
case 17:
#line 256 "./m2-exp.y"
{ write_exp_elt_opcode (UNOP_FLOAT); }
break;
case 18:
#line 260 "./m2-exp.y"
{ write_exp_elt_opcode (BINOP_VAL);
write_exp_elt_type (yyvsp[-3].tval);
write_exp_elt_opcode (BINOP_VAL); }
break;
case 19:
#line 266 "./m2-exp.y"
{ write_exp_elt_opcode (UNOP_CHR); }
break;
case 20:
#line 270 "./m2-exp.y"
{ write_exp_elt_opcode (UNOP_ODD); }
break;
case 21:
#line 274 "./m2-exp.y"
{ write_exp_elt_opcode (UNOP_TRUNC); }
break;
case 22:
#line 278 "./m2-exp.y"
{ write_exp_elt_opcode (UNOP_SIZEOF); }
break;
case 23:
#line 283 "./m2-exp.y"
{ write_exp_elt_opcode(UNOP_PREINCREMENT); }
break;
case 24:
#line 287 "./m2-exp.y"
{ write_exp_elt_opcode(BINOP_ASSIGN_MODIFY);
write_exp_elt_opcode(BINOP_ADD);
write_exp_elt_opcode(BINOP_ASSIGN_MODIFY); }
break;
case 25:
#line 293 "./m2-exp.y"
{ write_exp_elt_opcode(UNOP_PREDECREMENT);}
break;
case 26:
#line 297 "./m2-exp.y"
{ write_exp_elt_opcode(BINOP_ASSIGN_MODIFY);
write_exp_elt_opcode(BINOP_SUB);
write_exp_elt_opcode(BINOP_ASSIGN_MODIFY); }
break;
case 27:
#line 303 "./m2-exp.y"
{ write_exp_elt_opcode (STRUCTOP_STRUCT);
write_exp_string (yyvsp[0].sval);
write_exp_elt_opcode (STRUCTOP_STRUCT); }
break;
case 29:
#line 312 "./m2-exp.y"
{ error("Sets are not implemented.");}
break;
case 30:
#line 316 "./m2-exp.y"
{ error("Sets are not implemented.");}
break;
case 31:
#line 320 "./m2-exp.y"
{ error("Sets are not implemented.");}
break;
case 32:
#line 323 "./m2-exp.y"
{ error("Sets are not implemented.");}
break;
case 33:
#line 325 "./m2-exp.y"
{ error("Sets are not implemented.");}
break;
case 34:
#line 334 "./m2-exp.y"
{ start_arglist(); }
break;
case 35:
#line 336 "./m2-exp.y"
{ write_exp_elt_opcode (MULTI_SUBSCRIPT);
write_exp_elt_longcst ((LONGEST) end_arglist());
write_exp_elt_opcode (MULTI_SUBSCRIPT); }
break;
case 36:
#line 344 "./m2-exp.y"
{ start_arglist (); }
break;
case 37:
#line 346 "./m2-exp.y"
{ write_exp_elt_opcode (OP_FUNCALL);
write_exp_elt_longcst ((LONGEST) end_arglist ());
write_exp_elt_opcode (OP_FUNCALL); }
break;
case 39:
#line 355 "./m2-exp.y"
{ arglist_len = 1; }
break;
case 40:
#line 359 "./m2-exp.y"
{ arglist_len++; }
break;
case 41:
#line 364 "./m2-exp.y"
{ arglist_len = 1; }
break;
case 42:
#line 369 "./m2-exp.y"
{ arglist_len++; }
break;
case 43:
#line 374 "./m2-exp.y"
{ write_exp_elt_opcode (UNOP_MEMVAL);
write_exp_elt_type (yyvsp[-2].tval);
write_exp_elt_opcode (UNOP_MEMVAL); }
break;
case 44:
#line 380 "./m2-exp.y"
{ write_exp_elt_opcode (UNOP_CAST);
write_exp_elt_type (yyvsp[-3].tval);
write_exp_elt_opcode (UNOP_CAST); }
break;
case 45:
#line 386 "./m2-exp.y"
{ }
break;
case 46:
#line 394 "./m2-exp.y"
{ write_exp_elt_opcode (BINOP_REPEAT); }
break;
case 47:
#line 398 "./m2-exp.y"
{ write_exp_elt_opcode (BINOP_MUL); }
break;
case 48:
#line 402 "./m2-exp.y"
{ write_exp_elt_opcode (BINOP_DIV); }
break;
case 49:
#line 406 "./m2-exp.y"
{ write_exp_elt_opcode (BINOP_INTDIV); }
break;
case 50:
#line 410 "./m2-exp.y"
{ write_exp_elt_opcode (BINOP_REM); }
break;
case 51:
#line 414 "./m2-exp.y"
{ write_exp_elt_opcode (BINOP_ADD); }
break;
case 52:
#line 418 "./m2-exp.y"
{ write_exp_elt_opcode (BINOP_SUB); }
break;
case 53:
#line 422 "./m2-exp.y"
{ write_exp_elt_opcode (BINOP_EQUAL); }
break;
case 54:
#line 426 "./m2-exp.y"
{ write_exp_elt_opcode (BINOP_NOTEQUAL); }
break;
case 55:
#line 428 "./m2-exp.y"
{ write_exp_elt_opcode (BINOP_NOTEQUAL); }
break;
case 56:
#line 432 "./m2-exp.y"
{ write_exp_elt_opcode (BINOP_LEQ); }
break;
case 57:
#line 436 "./m2-exp.y"
{ write_exp_elt_opcode (BINOP_GEQ); }
break;
case 58:
#line 440 "./m2-exp.y"
{ write_exp_elt_opcode (BINOP_LESS); }
break;
case 59:
#line 444 "./m2-exp.y"
{ write_exp_elt_opcode (BINOP_GTR); }
break;
case 60:
#line 448 "./m2-exp.y"
{ write_exp_elt_opcode (BINOP_LOGICAL_AND); }
break;
case 61:
#line 452 "./m2-exp.y"
{ write_exp_elt_opcode (BINOP_LOGICAL_OR); }
break;
case 62:
#line 456 "./m2-exp.y"
{ write_exp_elt_opcode (BINOP_ASSIGN); }
break;
case 63:
#line 463 "./m2-exp.y"
{ write_exp_elt_opcode (OP_BOOL);
write_exp_elt_longcst ((LONGEST) yyvsp[0].ulval);
write_exp_elt_opcode (OP_BOOL); }
break;
case 64:
#line 469 "./m2-exp.y"
{ write_exp_elt_opcode (OP_BOOL);
write_exp_elt_longcst ((LONGEST) yyvsp[0].ulval);
write_exp_elt_opcode (OP_BOOL); }
break;
case 65:
#line 475 "./m2-exp.y"
{ write_exp_elt_opcode (OP_LONG);
write_exp_elt_type (builtin_type_m2_int);
write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
write_exp_elt_opcode (OP_LONG); }
break;
case 66:
#line 482 "./m2-exp.y"
{
write_exp_elt_opcode (OP_LONG);
write_exp_elt_type (builtin_type_m2_card);
write_exp_elt_longcst ((LONGEST) yyvsp[0].ulval);
write_exp_elt_opcode (OP_LONG);
}
break;
case 67:
#line 491 "./m2-exp.y"
{ write_exp_elt_opcode (OP_LONG);
write_exp_elt_type (builtin_type_m2_char);
write_exp_elt_longcst ((LONGEST) yyvsp[0].ulval);
write_exp_elt_opcode (OP_LONG); }
break;
case 68:
#line 499 "./m2-exp.y"
{ write_exp_elt_opcode (OP_DOUBLE);
write_exp_elt_type (builtin_type_m2_real);
write_exp_elt_dblcst (yyvsp[0].dval);
write_exp_elt_opcode (OP_DOUBLE); }
break;
case 70:
#line 510 "./m2-exp.y"
{ write_exp_elt_opcode (OP_LAST);
write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
write_exp_elt_opcode (OP_LAST); }
break;
case 71:
#line 516 "./m2-exp.y"
{ write_exp_elt_opcode (OP_REGISTER);
write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
write_exp_elt_opcode (OP_REGISTER); }
break;
case 72:
#line 522 "./m2-exp.y"
{ write_exp_elt_opcode (OP_LONG);
write_exp_elt_type (builtin_type_int);
write_exp_elt_longcst ((LONGEST) TYPE_LENGTH (yyvsp[-1].tval));
write_exp_elt_opcode (OP_LONG); }
break;
case 73:
#line 529 "./m2-exp.y"
{ write_exp_elt_opcode (OP_M2_STRING);
write_exp_string (yyvsp[0].sval);
write_exp_elt_opcode (OP_M2_STRING); }
break;
case 74:
#line 536 "./m2-exp.y"
{ yyval.bval = SYMBOL_BLOCK_VALUE(yyvsp[0].sym); }
break;
case 75:
#line 540 "./m2-exp.y"
{ struct symbol *sym
= lookup_symbol (copy_name (yyvsp[0].sval), expression_context_block,
VAR_NAMESPACE, 0, NULL);
yyval.sym = sym;}
break;
case 76:
#line 549 "./m2-exp.y"
{ struct symbol *tem
= lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval,
VAR_NAMESPACE, 0, NULL);
if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
error ("No function \"%s\" in specified context.",
copy_name (yyvsp[0].sval));
yyval.sym = tem;
}
break;
case 77:
#line 561 "./m2-exp.y"
{ write_exp_elt_opcode(OP_VAR_VALUE);
write_exp_elt_block (NULL);
write_exp_elt_sym (yyvsp[0].sym);
write_exp_elt_opcode (OP_VAR_VALUE); }
break;
case 78:
#line 569 "./m2-exp.y"
{ write_exp_elt_opcode (OP_INTERNALVAR);
write_exp_elt_intern (yyvsp[0].ivar);
write_exp_elt_opcode (OP_INTERNALVAR); }
break;
case 79:
#line 576 "./m2-exp.y"
{ struct symbol *sym;
sym = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval,
VAR_NAMESPACE, 0, NULL);
if (sym == 0)
error ("No symbol \"%s\" in specified context.",
copy_name (yyvsp[0].sval));
write_exp_elt_opcode (OP_VAR_VALUE);
/* block_found is set by lookup_symbol. */
write_exp_elt_block (block_found);
write_exp_elt_sym (sym);
write_exp_elt_opcode (OP_VAR_VALUE); }
break;
case 80:
#line 592 "./m2-exp.y"
{ struct symbol *sym;
int is_a_field_of_this;
sym = lookup_symbol (copy_name (yyvsp[0].sval),
expression_context_block,
VAR_NAMESPACE,
&is_a_field_of_this,
NULL);
if (sym)
{
if (symbol_read_needs_frame (sym))
{
if (innermost_block == 0 ||
contained_in (block_found,
innermost_block))
innermost_block = block_found;
}
write_exp_elt_opcode (OP_VAR_VALUE);
/* We want to use the selected frame, not
another more inner frame which happens to
be in the same block. */
write_exp_elt_block (NULL);
write_exp_elt_sym (sym);
write_exp_elt_opcode (OP_VAR_VALUE);
}
else
{
struct minimal_symbol *msymbol;
register char *arg = copy_name (yyvsp[0].sval);
msymbol = lookup_minimal_symbol (arg,
(struct objfile *) NULL);
if (msymbol != NULL)
{
write_exp_elt_opcode (OP_LONG);
write_exp_elt_type (builtin_type_long);
write_exp_elt_longcst ((LONGEST) SYMBOL_VALUE_ADDRESS (msymbol));
write_exp_elt_opcode (OP_LONG);
write_exp_elt_opcode (UNOP_MEMVAL);
if (msymbol -> type == mst_data ||
msymbol -> type == mst_bss)
write_exp_elt_type (builtin_type_int);
else if (msymbol -> type == mst_text)
write_exp_elt_type (lookup_function_type (builtin_type_int));
else
write_exp_elt_type (builtin_type_char);
write_exp_elt_opcode (UNOP_MEMVAL);
}
else if (!have_full_symbols () && !have_partial_symbols ())
error ("No symbol table is loaded. Use the \"symbol-file\" command.");
else
error ("No symbol \"%s\" in current context.",
copy_name (yyvsp[0].sval));
}
}
break;
case 81:
#line 652 "./m2-exp.y"
{ yyval.tval = lookup_typename (copy_name (yyvsp[0].sval),
expression_context_block, 0); }
break;
#line 1936 "y.tab.c"
}
yyssp -= yym;
yystate = *yyssp;
yyvsp -= yym;
yym = yylhs[yyn];
if (yystate == 0 && yym == 0)
{
#if YYDEBUG
if (yydebug)
printf("%sdebug: after reduction, shifting from state 0 to\
state %d\n", YYPREFIX, YYFINAL);
#endif
yystate = YYFINAL;
*++yyssp = YYFINAL;
*++yyvsp = yyval;
if (yychar < 0)
{
if ((yychar = yylex()) < 0) yychar = 0;
#if YYDEBUG
if (yydebug)
{
yys = 0;
if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
if (!yys) yys = "illegal-symbol";
printf("%sdebug: state %d, reading %d (%s)\n",
YYPREFIX, YYFINAL, yychar, yys);
}
#endif
}
if (yychar == 0) goto yyaccept;
goto yyloop;
}
if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
yystate = yytable[yyn];
else
yystate = yydgoto[yym];
#if YYDEBUG
if (yydebug)
printf("%sdebug: after reduction, shifting from state %d \
to state %d\n", YYPREFIX, *yyssp, yystate);
#endif
if (yyssp >= yyss + yystacksize - 1)
{
goto yyoverflow;
}
*++yyssp = yystate;
*++yyvsp = yyval;
goto yyloop;
yyoverflow:
yyerror("yacc stack overflow");
yyabort:
return (1);
yyaccept:
return (0);
}