summaryrefslogtreecommitdiff
path: root/src/cmd/8a
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/8a')
-rw-r--r--src/cmd/8a/a.h55
-rw-r--r--src/cmd/8a/a.y26
-rw-r--r--src/cmd/8a/lex.c380
-rw-r--r--src/cmd/8a/y.tab.c1446
-rw-r--r--src/cmd/8a/y.tab.h50
5 files changed, 714 insertions, 1243 deletions
diff --git a/src/cmd/8a/a.h b/src/cmd/8a/a.h
index c5c22d7ba..adc388ca9 100644
--- a/src/cmd/8a/a.h
+++ b/src/cmd/8a/a.h
@@ -29,9 +29,9 @@
// THE SOFTWARE.
#include <bio.h>
+#include <link.h>
#include "../8l/8.out.h"
-
#ifndef EXTERN
#define EXTERN extern
#endif
@@ -45,10 +45,8 @@
typedef struct Sym Sym;
typedef struct Ref Ref;
-typedef struct Gen Gen;
typedef struct Io Io;
-typedef struct Hist Hist;
-typedef struct Gen2 Gen2;
+typedef struct Addr2 Addr2;
#define MAXALIGN 7
#define FPCHIP 1
@@ -97,37 +95,11 @@ struct Io
};
#define I ((Io*)0)
-EXTERN struct
-{
- Sym* sym;
- short type;
-} h[NSYM];
-
-struct Gen
-{
- double dval;
- char sval[8];
- int32 offset;
- int32 offset2;
- Sym* sym;
- short type;
- short index;
- short scale;
-};
-struct Gen2
-{
- Gen from;
- Gen to;
-};
-
-struct Hist
+struct Addr2
{
- Hist* link;
- char* name;
- int32 line;
- int32 offset;
+ Addr from;
+ Addr to;
};
-#define H ((Hist*)0)
enum
{
@@ -137,14 +109,11 @@ enum
CPREPROC,
};
-
-EXTERN char debug[256];
+EXTERN int debug[256];
EXTERN Sym* hash[NHASH];
EXTERN char** Dlist;
EXTERN int nDlist;
-EXTERN Hist* ehist;
EXTERN int newflag;
-EXTERN Hist* hist;
EXTERN char* hunk;
EXTERN char** include;
EXTERN Io* iofree;
@@ -155,10 +124,9 @@ EXTERN int nerrors;
EXTERN int32 nhunk;
EXTERN int ninclude;
EXTERN int32 nsymb;
-EXTERN Gen nullgen;
+EXTERN Addr nullgen;
EXTERN char* outfile;
EXTERN int pass;
-EXTERN char* pathname;
EXTERN int32 pc;
EXTERN int peekc;
EXTERN int32 stmtline;
@@ -168,6 +136,8 @@ EXTERN int thechar;
EXTERN char* thestring;
EXTERN int32 thunk;
EXTERN Biobuf obuf;
+EXTERN Link* ctxt;
+EXTERN Biobuf bstdout;
void* alloc(int32);
void* allocn(void*, int32, int32);
@@ -188,12 +158,9 @@ void cinit(void);
void checkscale(int);
void pinit(char*);
void cclean(void);
-int isreg(Gen*);
-void outcode(int, Gen2*);
+int isreg(Addr*);
+void outcode(int, Addr2*);
void outhist(void);
-void zaddr(Gen*, int);
-void zname(char*, int, int);
-void ieeedtod(Ieee*, double);
int filbuf(void);
Sym* getsym(void);
void domacro(void);
diff --git a/src/cmd/8a/a.y b/src/cmd/8a/a.y
index 13ccc985b..d7ff623da 100644
--- a/src/cmd/8a/a.y
+++ b/src/cmd/8a/a.y
@@ -44,8 +44,8 @@
} con2;
double dval;
char sval[8];
- Gen gen;
- Gen2 gen2;
+ Addr addr;
+ Addr2 addr2;
}
%left '|'
%left '^'
@@ -62,9 +62,9 @@
%token <sym> LNAME LLAB LVAR
%type <lval> con expr pointer offset
%type <con2> con2
-%type <gen> mem imm imm2 reg nam rel rem rim rom omem nmem
-%type <gen2> nonnon nonrel nonrem rimnon rimrem remrim
-%type <gen2> spec1 spec2 spec3 spec4 spec5 spec6 spec7 spec8 spec9 spec10 spec11 spec12
+%type <addr> mem imm imm2 reg nam rel rem rim rom omem nmem
+%type <addr2> nonnon nonrel nonrem rimnon rimrem remrim
+%type <addr2> spec1 spec2 spec3 spec4 spec5 spec6 spec7 spec8 spec9 spec10 spec11 spec12
%%
prog:
| prog
@@ -366,14 +366,12 @@ rel:
if(pass == 2)
yyerror("undefined label: %s", $1->name);
$$.type = D_BRANCH;
- $$.sym = $1;
$$.offset = $2;
}
| LLAB offset
{
$$ = nullgen;
$$.type = D_BRANCH;
- $$.sym = $1;
$$.offset = $1->value + $2;
}
@@ -431,31 +429,31 @@ imm:
{
$$ = nullgen;
$$.type = D_SCONST;
- memcpy($$.sval, $2, sizeof($$.sval));
+ memcpy($$.u.sval, $2, sizeof($$.u.sval));
}
| '$' LFCONST
{
$$ = nullgen;
$$.type = D_FCONST;
- $$.dval = $2;
+ $$.u.dval = $2;
}
| '$' '(' LFCONST ')'
{
$$ = nullgen;
$$.type = D_FCONST;
- $$.dval = $3;
+ $$.u.dval = $3;
}
| '$' '(' '-' LFCONST ')'
{
$$ = nullgen;
$$.type = D_FCONST;
- $$.dval = -$4;
+ $$.u.dval = -$4;
}
| '$' '-' LFCONST
{
$$ = nullgen;
$$.type = D_FCONST;
- $$.dval = -$3;
+ $$.u.dval = -$3;
}
imm2:
@@ -590,14 +588,14 @@ nam:
{
$$ = nullgen;
$$.type = $4;
- $$.sym = $1;
+ $$.sym = linklookup(ctxt, $1->name, 0);
$$.offset = $2;
}
| LNAME '<' '>' offset '(' LSB ')'
{
$$ = nullgen;
$$.type = D_STATIC;
- $$.sym = $1;
+ $$.sym = linklookup(ctxt, $1->name, 1);
$$.offset = $4;
}
diff --git a/src/cmd/8a/lex.c b/src/cmd/8a/lex.c
index f2ccc3361..32c099b75 100644
--- a/src/cmd/8a/lex.c
+++ b/src/cmd/8a/lex.c
@@ -57,56 +57,75 @@ pathchar(void)
return '/';
}
+int
+Lconv(Fmt *fp)
+{
+ return linklinefmt(ctxt, fp);
+}
+
+void
+dodef(char *p)
+{
+ if(nDlist%8 == 0)
+ Dlist = allocn(Dlist, nDlist*sizeof(char *),
+ 8*sizeof(char *));
+ Dlist[nDlist++] = p;
+}
+
+void
+usage(void)
+{
+ print("usage: %ca [options] file.c...\n", thechar);
+ flagprint(1);
+ errorexit();
+}
void
main(int argc, char *argv[])
{
char *p;
- int c;
thechar = '8';
thestring = "386";
+ ctxt = linknew(&link386);
+ ctxt->diag = yyerror;
+ ctxt->bso = &bstdout;
+ Binit(&bstdout, 1, OWRITE);
+ listinit8();
+ fmtinstall('L', Lconv);
+
+ // Allow GOARCH=thestring or GOARCH=thestringsuffix,
+ // but not other values.
+ p = getgoarch();
+ if(strncmp(p, thestring, strlen(thestring)) != 0)
+ sysfatal("cannot use %cc with GOARCH=%s", thechar, p);
+
ensuresymb(NSYMB);
memset(debug, 0, sizeof(debug));
cinit();
outfile = 0;
setinclude(".");
- ARGBEGIN {
- default:
- c = ARGC();
- if(c >= 0 && c < sizeof(debug))
- debug[c] = 1;
- break;
-
- case 'o':
- outfile = ARGF();
- break;
-
- case 'D':
- p = ARGF();
- if(p) {
- if (nDlist%8 == 0)
- Dlist = allocn(Dlist, nDlist*sizeof(char *),
- 8*sizeof(char *));
- Dlist[nDlist++] = p;
- }
- break;
-
- case 'I':
- p = ARGF();
- setinclude(p);
- break;
- } ARGEND
- if(*argv == 0) {
- print("usage: %ca [-options] file.s\n", thechar);
- errorexit();
- }
+
+ flagfn1("D", "name[=value]: add #define", dodef);
+ flagfn1("I", "dir: add dir to include path", setinclude);
+ flagcount("S", "print assembly and machine code", &debug['S']);
+ flagcount("m", "debug preprocessor macros", &debug['m']);
+ flagstr("o", "file: set output file", &outfile);
+ flagstr("trimpath", "prefix: remove prefix from recorded source file paths", &ctxt->trimpath);
+
+ flagparse(&argc, &argv, usage);
+ ctxt->debugasm = debug['S'];
+
+ if(argc < 1)
+ usage();
if(argc > 1){
print("can't assemble multiple files\n");
errorexit();
}
+
if(assemble(argv[0]))
errorexit();
+ Bflush(&bstdout);
exits(0);
}
@@ -145,30 +164,22 @@ assemble(char *file)
errorexit();
}
Binit(&obuf, of, OWRITE);
-
- pass = 1;
- pinit(file);
-
- Bprint(&obuf, "go object %s %s %s\n", getgoos(), thestring, getgoversion());
-
- for(i=0; i<nDlist; i++)
- dodefine(Dlist[i]);
- yyparse();
- if(nerrors) {
+ Bprint(&obuf, "go object %s %s %s\n", getgoos(), getgoarch(), getgoversion());
+ Bprint(&obuf, "!\n");
+
+ for(pass = 1; pass <= 2; pass++) {
+ pinit(file);
+ for(i=0; i<nDlist; i++)
+ dodefine(Dlist[i]);
+ yyparse();
cclean();
- return nerrors;
+ if(nerrors)
+ return nerrors;
}
- Bprint(&obuf, "\n!\n");
-
- pass = 2;
- outhist();
- pinit(file);
- for(i=0; i<nDlist; i++)
- dodefine(Dlist[i]);
- yyparse();
- cclean();
- return nerrors;
+ writeobj(ctxt, &obuf);
+ Bflush(&obuf);
+ return 0;
}
struct
@@ -225,6 +236,7 @@ struct
"ES", LSREG, D_ES,
"FS", LSREG, D_FS,
"GS", LSREG, D_GS,
+ "TLS", LSREG, D_TLS,
"GDTR", LBREG, D_GDTR,
"IDTR", LBREG, D_IDTR,
@@ -778,6 +790,7 @@ struct
"PSUBW", LTYPE3, APSUBW,
"PUNPCKHQDQ", LTYPE3, APUNPCKHQDQ,
"PUNPCKLQDQ", LTYPE3, APUNPCKLQDQ,
+ "PXOR", LTYPE3, APXOR,
"RCPPS", LTYPE3, ARCPPS,
"RCPSS", LTYPE3, ARCPSS,
"RSQRTPS", LTYPE3, ARSQRTPS,
@@ -810,15 +823,8 @@ cinit(void)
Sym *s;
int i;
- nullgen.sym = S;
- nullgen.offset = 0;
- if(FPCHIP)
- nullgen.dval = 0;
- for(i=0; i<sizeof(nullgen.sval); i++)
- nullgen.sval[i] = 0;
nullgen.type = D_NONE;
nullgen.index = D_NONE;
- nullgen.scale = 0;
nerrors = 0;
iostack = I;
@@ -834,13 +840,6 @@ cinit(void)
s->type = itab[i].type;
s->value = itab[i].value;
}
-
- pathname = allocn(pathname, 0, 100);
- if(getwd(pathname, 99) == 0) {
- pathname = allocn(pathname, 100, 900);
- if(getwd(pathname, 999) == 0)
- strcpy(pathname, "/???");
- }
}
void
@@ -868,252 +867,43 @@ syminit(Sym *s)
void
cclean(void)
{
- Gen2 g2;
+ Addr2 g2;
g2.from = nullgen;
g2.to = nullgen;
outcode(AEND, &g2);
- Bflush(&obuf);
}
-void
-zname(char *n, int t, int s)
-{
-
- BPUTLE2(&obuf, ANAME); /* as(2) */
- BPUTC(&obuf, t); /* type */
- BPUTC(&obuf, s); /* sym */
- while(*n) {
- BPUTC(&obuf, *n);
- n++;
- }
- BPUTC(&obuf, 0);
-}
+static Prog *lastpc;
void
-zaddr(Gen *a, int s)
+outcode(int a, Addr2 *g2)
{
- int32 l;
- int i, t;
- char *n;
- Ieee e;
-
- t = 0;
- if(a->index != D_NONE || a->scale != 0)
- t |= T_INDEX;
- if(a->offset != 0)
- t |= T_OFFSET;
- if(s != 0)
- t |= T_SYM;
-
- switch(a->type) {
- default:
- t |= T_TYPE;
- break;
- case D_FCONST:
- t |= T_FCONST;
- break;
- case D_CONST2:
- t |= T_OFFSET|T_OFFSET2;
- break;
- case D_SCONST:
- t |= T_SCONST;
- break;
- case D_NONE:
- break;
- }
- BPUTC(&obuf, t);
-
- if(t & T_INDEX) { /* implies index, scale */
- BPUTC(&obuf, a->index);
- BPUTC(&obuf, a->scale);
- }
- if(t & T_OFFSET) { /* implies offset */
- l = a->offset;
- BPUTLE4(&obuf, l);
- }
- if(t & T_OFFSET2) {
- l = a->offset2;
- BPUTLE4(&obuf, l);
- }
- if(t & T_SYM) /* implies sym */
- BPUTC(&obuf, s);
- if(t & T_FCONST) {
- ieeedtod(&e, a->dval);
- BPUTLE4(&obuf, e.l);
- BPUTLE4(&obuf, e.h);
- return;
- }
- if(t & T_SCONST) {
- n = a->sval;
- for(i=0; i<NSNAME; i++) {
- BPUTC(&obuf, *n);
- n++;
- }
- return;
- }
- if(t & T_TYPE)
- BPUTC(&obuf, a->type);
-}
-
-void
-outcode(int a, Gen2 *g2)
-{
- int sf, st, t;
- Sym *s;
-
+ Prog *p;
+ Plist *pl;
+
if(pass == 1)
goto out;
-jackpot:
- sf = 0;
- s = g2->from.sym;
- while(s != S) {
- sf = s->sym;
- if(sf < 0 || sf >= NSYM)
- sf = 0;
- t = g2->from.type;
- if(t == D_ADDR)
- t = g2->from.index;
- if(h[sf].type == t)
- if(h[sf].sym == s)
- break;
- zname(s->name, t, sym);
- s->sym = sym;
- h[sym].sym = s;
- h[sym].type = t;
- sf = sym;
- sym++;
- if(sym >= NSYM)
- sym = 1;
- break;
- }
- st = 0;
- s = g2->to.sym;
- while(s != S) {
- st = s->sym;
- if(st < 0 || st >= NSYM)
- st = 0;
- t = g2->to.type;
- if(t == D_ADDR)
- t = g2->to.index;
- if(h[st].type == t)
- if(h[st].sym == s)
- break;
- zname(s->name, t, sym);
- s->sym = sym;
- h[sym].sym = s;
- h[sym].type = t;
- st = sym;
- sym++;
- if(sym >= NSYM)
- sym = 1;
- if(st == sf)
- goto jackpot;
- break;
- }
- BPUTLE2(&obuf, a);
- BPUTLE4(&obuf, stmtline);
- zaddr(&g2->from, sf);
- zaddr(&g2->to, st);
+ p = malloc(sizeof *p);
+ memset(p, 0, sizeof *p);
+ p->as = a;
+ p->lineno = stmtline;
+ p->from = g2->from;
+ p->to = g2->to;
+ p->pc = pc;
+
+ if(lastpc == nil) {
+ pl = linknewplist(ctxt);
+ pl->firstpc = p;
+ } else
+ lastpc->link = p;
+ lastpc = p;
out:
if(a != AGLOBL && a != ADATA)
pc++;
}
-void
-outhist(void)
-{
- Gen g;
- Hist *h;
- char *p, *q, *op, c;
- int n;
- char *tofree;
- static int first = 1;
- static char *goroot, *goroot_final;
-
- if(first) {
- // Decide whether we need to rewrite paths from $GOROOT to $GOROOT_FINAL.
- first = 0;
- goroot = getenv("GOROOT");
- goroot_final = getenv("GOROOT_FINAL");
- if(goroot == nil)
- goroot = "";
- if(goroot_final == nil)
- goroot_final = goroot;
- if(strcmp(goroot, goroot_final) == 0) {
- goroot = nil;
- goroot_final = nil;
- }
- }
-
- tofree = nil;
-
- g = nullgen;
- c = pathchar();
- for(h = hist; h != H; h = h->link) {
- p = h->name;
- if(p != nil && goroot != nil) {
- n = strlen(goroot);
- if(strncmp(p, goroot, strlen(goroot)) == 0 && p[n] == '/') {
- tofree = smprint("%s%s", goroot_final, p+n);
- p = tofree;
- }
- }
- op = 0;
- if(systemtype(Windows) && p && p[1] == ':'){
- c = p[2];
- } else if(p && p[0] != c && h->offset == 0 && pathname){
- if(systemtype(Windows) && pathname[1] == ':') {
- op = p;
- p = pathname;
- c = p[2];
- } else if(pathname[0] == c){
- op = p;
- p = pathname;
- }
- }
- while(p) {
- q = strchr(p, c);
- if(q) {
- n = q-p;
- if(n == 0){
- n = 1; /* leading "/" */
- *p = '/'; /* don't emit "\" on windows */
- }
- q++;
- } else {
- n = strlen(p);
- q = 0;
- }
- if(n) {
- BPUTLE2(&obuf, ANAME);
- BPUTC(&obuf, D_FILE); /* type */
- BPUTC(&obuf, 1); /* sym */
- BPUTC(&obuf, '<');
- Bwrite(&obuf, p, n);
- BPUTC(&obuf, 0);
- }
- p = q;
- if(p == 0 && op) {
- p = op;
- op = 0;
- }
- }
- g.offset = h->offset;
-
- BPUTLE2(&obuf, AHISTORY);
- BPUTLE4(&obuf, h->line);
- zaddr(&nullgen, 0);
- zaddr(&g, 0);
-
- if(tofree) {
- free(tofree);
- tofree = nil;
- }
- }
-}
-
#include "../cc/lexbody"
#include "../cc/macbody"
diff --git a/src/cmd/8a/y.tab.c b/src/cmd/8a/y.tab.c
index aec4856f6..f48c9fe1f 100644
--- a/src/cmd/8a/y.tab.c
+++ b/src/cmd/8a/y.tab.c
@@ -1,21 +1,24 @@
-/* A Bison parser, made by GNU Bison 2.5. */
+/* A Bison parser, made by GNU Bison 2.3. */
-/* Bison implementation for Yacc-like parsers in C
-
- Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
+/* Skeleton implementation for Bison's Yacc-like parsers in C
+
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@@ -26,7 +29,7 @@
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
-
+
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
@@ -44,7 +47,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "2.5"
+#define YYBISON_VERSION "2.3"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -52,51 +55,11 @@
/* Pure parsers. */
#define YYPURE 0
-/* Push parsers. */
-#define YYPUSH 0
-
-/* Pull parsers. */
-#define YYPULL 1
-
/* Using locations. */
#define YYLSP_NEEDED 0
-/* Copy the first part of user declarations. */
-
-/* Line 268 of yacc.c */
-#line 31 "a.y"
-
-#include <u.h>
-#include <stdio.h> /* if we don't, bison will, and a.h re-#defines getc */
-#include <libc.h>
-#include "a.h"
-#include "../../pkg/runtime/funcdata.h"
-
-
-/* Line 268 of yacc.c */
-#line 80 "y.tab.c"
-
-/* Enabling traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-
-/* Enabling verbose error messages. */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 0
-#endif
-
-/* Enabling the token table. */
-#ifndef YYTOKEN_TABLE
-# define YYTOKEN_TABLE 0
-#endif
-
-
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
@@ -176,13 +139,38 @@
+/* Copy the first part of user declarations. */
+#line 31 "a.y"
+
+#include <u.h>
+#include <stdio.h> /* if we don't, bison will, and a.h re-#defines getc */
+#include <libc.h>
+#include "a.h"
+#include "../../pkg/runtime/funcdata.h"
+
+
+/* Enabling traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+
+/* Enabling verbose error messages. */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+/* Enabling the token table. */
+#ifndef YYTOKEN_TABLE
+# define YYTOKEN_TABLE 0
+#endif
+
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
-{
-
-/* Line 293 of yacc.c */
#line 38 "a.y"
-
+{
Sym *sym;
int32 lval;
struct {
@@ -191,25 +179,24 @@ typedef union YYSTYPE
} con2;
double dval;
char sval[8];
- Gen gen;
- Gen2 gen2;
-
-
-
-/* Line 293 of yacc.c */
-#line 201 "y.tab.c"
-} YYSTYPE;
-# define YYSTYPE_IS_TRIVIAL 1
+ Addr addr;
+ Addr2 addr2;
+}
+/* Line 193 of yacc.c. */
+#line 187 "y.tab.c"
+ YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
#endif
+
/* Copy the second part of user declarations. */
-/* Line 343 of yacc.c */
-#line 213 "y.tab.c"
+/* Line 216 of yacc.c. */
+#line 200 "y.tab.c"
#ifdef short
# undef short
@@ -284,14 +271,14 @@ typedef short int yytype_int16;
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static int
-YYID (int yyi)
+YYID (int i)
#else
static int
-YYID (yyi)
- int yyi;
+YYID (i)
+ int i;
#endif
{
- return yyi;
+ return i;
}
#endif
@@ -312,11 +299,11 @@ YYID (yyi)
# define alloca _alloca
# else
# define YYSTACK_ALLOC alloca
-# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
+# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# ifndef EXIT_SUCCESS
-# define EXIT_SUCCESS 0
+# ifndef _STDLIB_H
+# define _STDLIB_H 1
# endif
# endif
# endif
@@ -339,24 +326,24 @@ YYID (yyi)
# ifndef YYSTACK_ALLOC_MAXIMUM
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
# endif
-# if (defined __cplusplus && ! defined EXIT_SUCCESS \
+# if (defined __cplusplus && ! defined _STDLIB_H \
&& ! ((defined YYMALLOC || defined malloc) \
&& (defined YYFREE || defined free)))
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# ifndef EXIT_SUCCESS
-# define EXIT_SUCCESS 0
+# ifndef _STDLIB_H
+# define _STDLIB_H 1
# endif
# endif
# ifndef YYMALLOC
# define YYMALLOC malloc
-# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
+# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# ifndef YYFREE
# define YYFREE free
-# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
+# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif
@@ -372,9 +359,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
/* A type that is properly aligned for any stack member. */
union yyalloc
{
- yytype_int16 yyss_alloc;
- YYSTYPE yyvs_alloc;
-};
+ yytype_int16 yyss;
+ YYSTYPE yyvs;
+ };
/* The size of the maximum gap between one aligned stack and the next. */
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
@@ -385,27 +372,6 @@ union yyalloc
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)
-# define YYCOPY_NEEDED 1
-
-/* Relocate STACK from its old location to the new one. The
- local variables YYSIZE and YYSTACKSIZE give the old and new number of
- elements in the stack, and YYPTR gives the new location of the
- stack. Advance YYPTR to a properly aligned location for the next
- stack. */
-# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
- do \
- { \
- YYSIZE_T yynewbytes; \
- YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
- Stack = &yyptr->Stack_alloc; \
- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
- yyptr += yynewbytes / sizeof (*yyptr); \
- } \
- while (YYID (0))
-
-#endif
-
-#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
/* Copy COUNT objects from FROM to TO. The source and destination do
not overlap. */
# ifndef YYCOPY
@@ -423,7 +389,24 @@ union yyalloc
while (YYID (0))
# endif
# endif
-#endif /* !YYCOPY_NEEDED */
+
+/* Relocate STACK from its old location to the new one. The
+ local variables YYSIZE and YYSTACKSIZE give the old and new number of
+ elements in the stack, and YYPTR gives the new location of the
+ stack. Advance YYPTR to a properly aligned location for the next
+ stack. */
+# define YYSTACK_RELOCATE(Stack) \
+ do \
+ { \
+ YYSIZE_T yynewbytes; \
+ YYCOPY (&yyptr->Stack, Stack, yysize); \
+ Stack = &yyptr->Stack; \
+ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+ yyptr += yynewbytes / sizeof (*yyptr); \
+ } \
+ while (YYID (0))
+
+#endif
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 2
@@ -564,13 +547,13 @@ static const yytype_uint16 yyrline[] =
175, 180, 185, 192, 200, 205, 213, 218, 223, 232,
233, 236, 241, 251, 256, 266, 271, 276, 283, 288,
296, 304, 314, 323, 334, 335, 338, 339, 340, 344,
- 348, 349, 350, 353, 354, 357, 363, 372, 381, 386,
- 391, 396, 401, 406, 413, 419, 430, 436, 442, 448,
- 454, 462, 471, 476, 481, 486, 493, 494, 497, 503,
- 509, 515, 524, 533, 542, 547, 552, 558, 566, 576,
- 580, 589, 596, 605, 608, 612, 618, 619, 623, 626,
- 627, 631, 635, 639, 643, 649, 650, 654, 658, 662,
- 666, 670, 674, 678, 682, 686
+ 348, 349, 350, 353, 354, 357, 363, 371, 379, 384,
+ 389, 394, 399, 404, 411, 417, 428, 434, 440, 446,
+ 452, 460, 469, 474, 479, 484, 491, 492, 495, 501,
+ 507, 513, 522, 531, 540, 545, 550, 556, 564, 574,
+ 578, 587, 594, 603, 606, 610, 616, 617, 621, 624,
+ 625, 629, 633, 637, 641, 647, 648, 652, 656, 660,
+ 664, 668, 672, 676, 680, 684
};
#endif
@@ -585,12 +568,12 @@ static const char *const yytname[] =
"LTYPEM", "LTYPEI", "LTYPEG", "LTYPEXC", "LTYPEX", "LTYPEPC", "LTYPEF",
"LCONST", "LFP", "LPC", "LSB", "LBREG", "LLREG", "LSREG", "LFREG",
"LXREG", "LFCONST", "LSCONST", "LSP", "LNAME", "LLAB", "LVAR", "':'",
- "';'", "'='", "','", "'('", "')'", "'$'", "'~'", "$accept", "prog",
- "$@1", "line", "$@2", "$@3", "inst", "nonnon", "rimrem", "remrim",
- "rimnon", "nonrem", "nonrel", "spec1", "spec2", "spec3", "spec4",
- "spec5", "spec6", "spec7", "spec8", "spec9", "spec10", "spec11",
- "spec12", "rem", "rom", "rim", "rel", "reg", "imm", "imm2", "con2",
- "mem", "omem", "nmem", "nam", "offset", "pointer", "con", "expr", 0
+ "';'", "'='", "','", "'('", "')'", "'$'", "'~'", "$accept", "prog", "@1",
+ "line", "@2", "@3", "inst", "nonnon", "rimrem", "remrim", "rimnon",
+ "nonrem", "nonrel", "spec1", "spec2", "spec3", "spec4", "spec5", "spec6",
+ "spec7", "spec8", "spec9", "spec10", "spec11", "spec12", "rem", "rom",
+ "rim", "rel", "reg", "imm", "imm2", "con2", "mem", "omem", "nmem", "nam",
+ "offset", "pointer", "con", "expr", 0
};
#endif
@@ -646,8 +629,8 @@ static const yytype_uint8 yyr2[] =
3, 4, 4, 3, 3, 3
};
-/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
- Performed when YYTABLE doesn't specify something else to do. Zero
+/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+ STATE-NUM when YYTABLE doesn't specify something else to do. Zero
means the default is an error. */
static const yytype_uint8 yydefact[] =
{
@@ -738,7 +721,8 @@ static const yytype_int16 yypgoto[] =
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which
- number is the opposite. If YYTABLE_NINF, syntax error. */
+ number is the opposite. If zero, do what YYDEFACT says.
+ If YYTABLE_NINF, syntax error. */
#define YYTABLE_NINF -1
static const yytype_uint16 yytable[] =
{
@@ -799,12 +783,6 @@ static const yytype_uint16 yytable[] =
170, 171, 172, 173, 174, 175, 176
};
-#define yypact_value_is_default(yystate) \
- ((yystate) == (-104))
-
-#define yytable_value_is_error(yytable_value) \
- YYID (0)
-
static const yytype_int16 yycheck[] =
{
10, 10, 10, 13, 0, 13, 8, 13, 11, 10,
@@ -910,18 +888,9 @@ static const yytype_uint8 yystos[] =
/* Like YYERROR except do call yyerror. This remains here temporarily
to ease the transition to the new meaning of YYERROR, for GCC.
- Once GCC version 2 has supplanted version 1, this can go. However,
- YYFAIL appears to be in use. Nevertheless, it is formally deprecated
- in Bison 2.4.2's NEWS entry, where a plan to phase it out is
- discussed. */
+ Once GCC version 2 has supplanted version 1, this can go. */
#define YYFAIL goto yyerrlab
-#if defined YYFAIL
- /* This is here to suppress warnings from the GCC cpp's
- -Wunused-macros. Normally we don't worry about that warning, but
- some users do, and we want to make it easy for users to remove
- YYFAIL uses, which will produce warnings from Bison 2.5. */
-#endif
#define YYRECOVERING() (!!yyerrstatus)
@@ -931,6 +900,7 @@ do \
{ \
yychar = (Token); \
yylval = (Value); \
+ yytoken = YYTRANSLATE (yychar); \
YYPOPSTACK (1); \
goto yybackup; \
} \
@@ -972,10 +942,19 @@ while (YYID (0))
#endif
-/* This macro is provided for backward compatibility. */
+/* YY_LOCATION_PRINT -- Print the location on the stream.
+ This macro was not mandated originally: define only if we know
+ we won't break user code: when these are the locations we know. */
#ifndef YY_LOCATION_PRINT
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
+# define YY_LOCATION_PRINT(File, Loc) \
+ fprintf (File, "%d.%d-%d.%d", \
+ (Loc).first_line, (Loc).first_column, \
+ (Loc).last_line, (Loc).last_column)
+# else
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# endif
#endif
@@ -1079,20 +1058,17 @@ yy_symbol_print (yyoutput, yytype, yyvaluep)
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
-yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
+yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
#else
static void
-yy_stack_print (yybottom, yytop)
- yytype_int16 *yybottom;
- yytype_int16 *yytop;
+yy_stack_print (bottom, top)
+ yytype_int16 *bottom;
+ yytype_int16 *top;
#endif
{
YYFPRINTF (stderr, "Stack now");
- for (; yybottom <= yytop; yybottom++)
- {
- int yybot = *yybottom;
- YYFPRINTF (stderr, " %d", yybot);
- }
+ for (; bottom <= top; ++bottom)
+ YYFPRINTF (stderr, " %d", *bottom);
YYFPRINTF (stderr, "\n");
}
@@ -1126,11 +1102,11 @@ yy_reduce_print (yyvsp, yyrule)
/* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++)
{
- YYFPRINTF (stderr, " $%d = ", yyi + 1);
+ fprintf (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
&(yyvsp[(yyi + 1) - (yynrhs)])
);
- YYFPRINTF (stderr, "\n");
+ fprintf (stderr, "\n");
}
}
@@ -1167,6 +1143,7 @@ int yydebug;
# define YYMAXDEPTH 10000
#endif
+
#if YYERROR_VERBOSE
@@ -1269,142 +1246,115 @@ yytnamerr (char *yyres, const char *yystr)
}
# endif
-/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
- about the unexpected token YYTOKEN for the state stack whose top is
- YYSSP.
-
- Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
- not large enough to hold the message. In that case, also set
- *YYMSG_ALLOC to the required number of bytes. Return 2 if the
- required number of bytes is too large to store. */
-static int
-yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
- yytype_int16 *yyssp, int yytoken)
+/* Copy into YYRESULT an error message about the unexpected token
+ YYCHAR while in state YYSTATE. Return the number of bytes copied,
+ including the terminating null byte. If YYRESULT is null, do not
+ copy anything; just return the number of bytes that would be
+ copied. As a special case, return 0 if an ordinary "syntax error"
+ message will do. Return YYSIZE_MAXIMUM if overflow occurs during
+ size calculation. */
+static YYSIZE_T
+yysyntax_error (char *yyresult, int yystate, int yychar)
{
- YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
- YYSIZE_T yysize = yysize0;
- YYSIZE_T yysize1;
- enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
- /* Internationalized format string. */
- const char *yyformat = 0;
- /* Arguments of yyformat. */
- char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
- /* Number of reported tokens (one for the "unexpected", one per
- "expected"). */
- int yycount = 0;
-
- /* There are many possibilities here to consider:
- - Assume YYFAIL is not used. It's too flawed to consider. See
- <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
- for details. YYERROR is fine as it does not invoke this
- function.
- - If this state is a consistent state with a default action, then
- the only way this function was invoked is if the default action
- is an error action. In that case, don't check for expected
- tokens because there are none.
- - The only way there can be no lookahead present (in yychar) is if
- this state is a consistent state with a default action. Thus,
- detecting the absence of a lookahead is sufficient to determine
- that there is no unexpected or expected token to report. In that
- case, just report a simple "syntax error".
- - Don't assume there isn't a lookahead just because this state is a
- consistent state with a default action. There might have been a
- previous inconsistent state, consistent state with a non-default
- action, or user semantic action that manipulated yychar.
- - Of course, the expected token list depends on states to have
- correct lookahead information, and it depends on the parser not
- to perform extra reductions after fetching a lookahead from the
- scanner and before detecting a syntax error. Thus, state merging
- (from LALR or IELR) and default reductions corrupt the expected
- token list. However, the list is correct for canonical LR with
- one exception: it will still contain any token that will not be
- accepted due to an error action in a later state.
- */
- if (yytoken != YYEMPTY)
- {
- int yyn = yypact[*yyssp];
- yyarg[yycount++] = yytname[yytoken];
- if (!yypact_value_is_default (yyn))
- {
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. In other words, skip the first -YYN actions for
- this state because they are default actions. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn + 1;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yyx;
-
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
- && !yytable_value_is_error (yytable[yyx + yyn]))
- {
- if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
- {
- yycount = 1;
- yysize = yysize0;
- break;
- }
- yyarg[yycount++] = yytname[yyx];
- yysize1 = yysize + yytnamerr (0, yytname[yyx]);
- if (! (yysize <= yysize1
- && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
- return 2;
- yysize = yysize1;
- }
- }
- }
+ int yyn = yypact[yystate];
- switch (yycount)
- {
-# define YYCASE_(N, S) \
- case N: \
- yyformat = S; \
- break
- YYCASE_(0, YY_("syntax error"));
- YYCASE_(1, YY_("syntax error, unexpected %s"));
- YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
- YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
- YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
- YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
-# undef YYCASE_
- }
+ if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
+ return 0;
+ else
+ {
+ int yytype = YYTRANSLATE (yychar);
+ YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
+ YYSIZE_T yysize = yysize0;
+ YYSIZE_T yysize1;
+ int yysize_overflow = 0;
+ enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+ int yyx;
+
+# if 0
+ /* This is so xgettext sees the translatable formats that are
+ constructed on the fly. */
+ YY_("syntax error, unexpected %s");
+ YY_("syntax error, unexpected %s, expecting %s");
+ YY_("syntax error, unexpected %s, expecting %s or %s");
+ YY_("syntax error, unexpected %s, expecting %s or %s or %s");
+ YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
+# endif
+ char *yyfmt;
+ char const *yyf;
+ static char const yyunexpected[] = "syntax error, unexpected %s";
+ static char const yyexpecting[] = ", expecting %s";
+ static char const yyor[] = " or %s";
+ char yyformat[sizeof yyunexpected
+ + sizeof yyexpecting - 1
+ + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
+ * (sizeof yyor - 1))];
+ char const *yyprefix = yyexpecting;
+
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. */
+ int yyxbegin = yyn < 0 ? -yyn : 0;
+
+ /* Stay within bounds of both yycheck and yytname. */
+ int yychecklim = YYLAST - yyn + 1;
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+ int yycount = 1;
+
+ yyarg[0] = yytname[yytype];
+ yyfmt = yystpcpy (yyformat, yyunexpected);
+
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+ {
+ if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+ {
+ yycount = 1;
+ yysize = yysize0;
+ yyformat[sizeof yyunexpected - 1] = '\0';
+ break;
+ }
+ yyarg[yycount++] = yytname[yyx];
+ yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+ yysize_overflow |= (yysize1 < yysize);
+ yysize = yysize1;
+ yyfmt = yystpcpy (yyfmt, yyprefix);
+ yyprefix = yyor;
+ }
- yysize1 = yysize + yystrlen (yyformat);
- if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
- return 2;
- yysize = yysize1;
+ yyf = YY_(yyformat);
+ yysize1 = yysize + yystrlen (yyf);
+ yysize_overflow |= (yysize1 < yysize);
+ yysize = yysize1;
- if (*yymsg_alloc < yysize)
- {
- *yymsg_alloc = 2 * yysize;
- if (! (yysize <= *yymsg_alloc
- && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
- *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
- return 1;
- }
+ if (yysize_overflow)
+ return YYSIZE_MAXIMUM;
- /* Avoid sprintf, as that infringes on the user's name space.
- Don't have undefined behavior even if the translation
- produced a string with the wrong number of "%s"s. */
- {
- char *yyp = *yymsg;
- int yyi = 0;
- while ((*yyp = *yyformat) != '\0')
- if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
- {
- yyp += yytnamerr (yyp, yyarg[yyi++]);
- yyformat += 2;
- }
- else
- {
- yyp++;
- yyformat++;
- }
- }
- return 0;
+ if (yyresult)
+ {
+ /* Avoid sprintf, as that infringes on the user's name space.
+ Don't have undefined behavior even if the translation
+ produced a string with the wrong number of "%s"s. */
+ char *yyp = yyresult;
+ int yyi = 0;
+ while ((*yyp = *yyf) != '\0')
+ {
+ if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
+ {
+ yyp += yytnamerr (yyp, yyarg[yyi++]);
+ yyf += 2;
+ }
+ else
+ {
+ yyp++;
+ yyf++;
+ }
+ }
+ }
+ return yysize;
+ }
}
#endif /* YYERROR_VERBOSE */
+
/*-----------------------------------------------.
| Release the memory associated to this symbol. |
@@ -1436,9 +1386,10 @@ yydestruct (yymsg, yytype, yyvaluep)
break;
}
}
-
+
/* Prevent warnings from -Wmissing-prototypes. */
+
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
@@ -1454,16 +1405,18 @@ int yyparse ();
#endif /* ! YYPARSE_PARAM */
-/* The lookahead symbol. */
+
+/* The look-ahead symbol. */
int yychar;
-/* The semantic value of the lookahead symbol. */
+/* The semantic value of the look-ahead symbol. */
YYSTYPE yylval;
/* Number of syntax errors so far. */
int yynerrs;
+
/*----------.
| yyparse. |
`----------*/
@@ -1490,37 +1443,14 @@ yyparse ()
#endif
#endif
{
- int yystate;
- /* Number of tokens to shift before error messages enabled. */
- int yyerrstatus;
-
- /* The stacks and their tools:
- `yyss': related to states.
- `yyvs': related to semantic values.
-
- Refer to the stacks thru separate pointers, to allow yyoverflow
- to reallocate them elsewhere. */
-
- /* The state stack. */
- yytype_int16 yyssa[YYINITDEPTH];
- yytype_int16 *yyss;
- yytype_int16 *yyssp;
-
- /* The semantic value stack. */
- YYSTYPE yyvsa[YYINITDEPTH];
- YYSTYPE *yyvs;
- YYSTYPE *yyvsp;
-
- YYSIZE_T yystacksize;
-
+
+ int yystate;
int yyn;
int yyresult;
- /* Lookahead token as an internal (translated) token number. */
- int yytoken;
- /* The variables used to return semantic value and location from the
- action routines. */
- YYSTYPE yyval;
-
+ /* Number of tokens to shift before error messages enabled. */
+ int yyerrstatus;
+ /* Look-ahead token as an internal (translated) token number. */
+ int yytoken = 0;
#if YYERROR_VERBOSE
/* Buffer for error messages, and its allocated size. */
char yymsgbuf[128];
@@ -1528,28 +1458,51 @@ yyparse ()
YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
#endif
+ /* Three stacks and their tools:
+ `yyss': related to states,
+ `yyvs': related to semantic values,
+ `yyls': related to locations.
+
+ Refer to the stacks thru separate pointers, to allow yyoverflow
+ to reallocate them elsewhere. */
+
+ /* The state stack. */
+ yytype_int16 yyssa[YYINITDEPTH];
+ yytype_int16 *yyss = yyssa;
+ yytype_int16 *yyssp;
+
+ /* The semantic value stack. */
+ YYSTYPE yyvsa[YYINITDEPTH];
+ YYSTYPE *yyvs = yyvsa;
+ YYSTYPE *yyvsp;
+
+
+
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
+ YYSIZE_T yystacksize = YYINITDEPTH;
+
+ /* The variables used to return semantic value and location from the
+ action routines. */
+ YYSTYPE yyval;
+
+
/* The number of symbols on the RHS of the reduced rule.
Keep to zero when no symbol should be popped. */
int yylen = 0;
- yytoken = 0;
- yyss = yyssa;
- yyvs = yyvsa;
- yystacksize = YYINITDEPTH;
-
YYDPRINTF ((stderr, "Starting parse\n"));
yystate = 0;
yyerrstatus = 0;
yynerrs = 0;
- yychar = YYEMPTY; /* Cause a token to be read. */
+ yychar = YYEMPTY; /* Cause a token to be read. */
/* Initialize stack pointers.
Waste one element of value and location stack
so that they stay on the same level as the state stack.
The wasted elements are never initialized. */
+
yyssp = yyss;
yyvsp = yyvs;
@@ -1579,6 +1532,7 @@ yyparse ()
YYSTYPE *yyvs1 = yyvs;
yytype_int16 *yyss1 = yyss;
+
/* Each stack pointer address is followed by the size of the
data in use in that stack, in bytes. This used to be a
conditional around just the two extra args, but that might
@@ -1586,6 +1540,7 @@ yyparse ()
yyoverflow (YY_("memory exhausted"),
&yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp),
+
&yystacksize);
yyss = yyss1;
@@ -1608,8 +1563,9 @@ yyparse ()
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr)
goto yyexhaustedlab;
- YYSTACK_RELOCATE (yyss_alloc, yyss);
- YYSTACK_RELOCATE (yyvs_alloc, yyvs);
+ YYSTACK_RELOCATE (yyss);
+ YYSTACK_RELOCATE (yyvs);
+
# undef YYSTACK_RELOCATE
if (yyss1 != yyssa)
YYSTACK_FREE (yyss1);
@@ -1620,6 +1576,7 @@ yyparse ()
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
+
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
(unsigned long int) yystacksize));
@@ -1629,9 +1586,6 @@ yyparse ()
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
- if (yystate == YYFINAL)
- YYACCEPT;
-
goto yybackup;
/*-----------.
@@ -1640,16 +1594,16 @@ yyparse ()
yybackup:
/* Do appropriate processing given the current state. Read a
- lookahead token if we need one and don't already have one. */
+ look-ahead token if we need one and don't already have one. */
- /* First try to decide what to do without reference to lookahead token. */
+ /* First try to decide what to do without reference to look-ahead token. */
yyn = yypact[yystate];
- if (yypact_value_is_default (yyn))
+ if (yyn == YYPACT_NINF)
goto yydefault;
- /* Not known => get a lookahead token if don't already have one. */
+ /* Not known => get a look-ahead token if don't already have one. */
- /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
+ /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
if (yychar == YYEMPTY)
{
YYDPRINTF ((stderr, "Reading a token: "));
@@ -1675,22 +1629,26 @@ yybackup:
yyn = yytable[yyn];
if (yyn <= 0)
{
- if (yytable_value_is_error (yyn))
- goto yyerrlab;
+ if (yyn == 0 || yyn == YYTABLE_NINF)
+ goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
/* Count tokens shifted since error; after three, turn off error
status. */
if (yyerrstatus)
yyerrstatus--;
- /* Shift the lookahead token. */
+ /* Shift the look-ahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
- /* Discard the shifted token. */
- yychar = YYEMPTY;
+ /* Discard the shifted token unless it is eof. */
+ if (yychar != YYEOF)
+ yychar = YYEMPTY;
yystate = yyn;
*++yyvsp = yylval;
@@ -1730,8 +1688,6 @@ yyreduce:
switch (yyn)
{
case 3:
-
-/* Line 1806 of yacc.c */
#line 71 "a.y"
{
stmtline = lineno;
@@ -1739,8 +1695,6 @@ yyreduce:
break;
case 5:
-
-/* Line 1806 of yacc.c */
#line 78 "a.y"
{
if((yyvsp[(1) - (2)].sym)->value != pc)
@@ -1750,8 +1704,6 @@ yyreduce:
break;
case 7:
-
-/* Line 1806 of yacc.c */
#line 85 "a.y"
{
(yyvsp[(1) - (2)].sym)->type = LLAB;
@@ -1760,8 +1712,6 @@ yyreduce:
break;
case 12:
-
-/* Line 1806 of yacc.c */
#line 96 "a.y"
{
(yyvsp[(1) - (3)].sym)->type = LVAR;
@@ -1770,8 +1720,6 @@ yyreduce:
break;
case 13:
-
-/* Line 1806 of yacc.c */
#line 101 "a.y"
{
if((yyvsp[(1) - (3)].sym)->value != (yyvsp[(3) - (3)].lval))
@@ -1781,586 +1729,462 @@ yyreduce:
break;
case 14:
-
-/* Line 1806 of yacc.c */
#line 106 "a.y"
- { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+ { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 15:
-
-/* Line 1806 of yacc.c */
#line 107 "a.y"
- { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+ { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 16:
-
-/* Line 1806 of yacc.c */
#line 108 "a.y"
- { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+ { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 17:
-
-/* Line 1806 of yacc.c */
#line 109 "a.y"
- { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+ { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 18:
-
-/* Line 1806 of yacc.c */
#line 110 "a.y"
- { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+ { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 19:
-
-/* Line 1806 of yacc.c */
#line 111 "a.y"
- { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+ { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 20:
-
-/* Line 1806 of yacc.c */
#line 112 "a.y"
- { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+ { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 21:
-
-/* Line 1806 of yacc.c */
#line 113 "a.y"
- { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+ { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 22:
-
-/* Line 1806 of yacc.c */
#line 114 "a.y"
- { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+ { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 23:
-
-/* Line 1806 of yacc.c */
#line 115 "a.y"
- { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+ { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 24:
-
-/* Line 1806 of yacc.c */
#line 116 "a.y"
- { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+ { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 25:
-
-/* Line 1806 of yacc.c */
#line 117 "a.y"
- { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+ { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 26:
-
-/* Line 1806 of yacc.c */
#line 118 "a.y"
- { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+ { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 27:
-
-/* Line 1806 of yacc.c */
#line 119 "a.y"
- { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+ { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 28:
-
-/* Line 1806 of yacc.c */
#line 120 "a.y"
- { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+ { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 29:
-
-/* Line 1806 of yacc.c */
#line 121 "a.y"
- { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+ { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 30:
-
-/* Line 1806 of yacc.c */
#line 122 "a.y"
- { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+ { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 31:
-
-/* Line 1806 of yacc.c */
#line 123 "a.y"
- { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+ { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].addr2)); }
break;
case 32:
-
-/* Line 1806 of yacc.c */
#line 126 "a.y"
{
- (yyval.gen2).from = nullgen;
- (yyval.gen2).to = nullgen;
+ (yyval.addr2).from = nullgen;
+ (yyval.addr2).to = nullgen;
}
break;
case 33:
-
-/* Line 1806 of yacc.c */
#line 131 "a.y"
{
- (yyval.gen2).from = nullgen;
- (yyval.gen2).to = nullgen;
+ (yyval.addr2).from = nullgen;
+ (yyval.addr2).to = nullgen;
}
break;
case 34:
-
-/* Line 1806 of yacc.c */
#line 138 "a.y"
{
- (yyval.gen2).from = (yyvsp[(1) - (3)].gen);
- (yyval.gen2).to = (yyvsp[(3) - (3)].gen);
+ (yyval.addr2).from = (yyvsp[(1) - (3)].addr);
+ (yyval.addr2).to = (yyvsp[(3) - (3)].addr);
}
break;
case 35:
-
-/* Line 1806 of yacc.c */
#line 145 "a.y"
{
- (yyval.gen2).from = (yyvsp[(1) - (3)].gen);
- (yyval.gen2).to = (yyvsp[(3) - (3)].gen);
+ (yyval.addr2).from = (yyvsp[(1) - (3)].addr);
+ (yyval.addr2).to = (yyvsp[(3) - (3)].addr);
}
break;
case 36:
-
-/* Line 1806 of yacc.c */
#line 152 "a.y"
{
- (yyval.gen2).from = (yyvsp[(1) - (2)].gen);
- (yyval.gen2).to = nullgen;
+ (yyval.addr2).from = (yyvsp[(1) - (2)].addr);
+ (yyval.addr2).to = nullgen;
}
break;
case 37:
-
-/* Line 1806 of yacc.c */
#line 157 "a.y"
{
- (yyval.gen2).from = (yyvsp[(1) - (1)].gen);
- (yyval.gen2).to = nullgen;
+ (yyval.addr2).from = (yyvsp[(1) - (1)].addr);
+ (yyval.addr2).to = nullgen;
}
break;
case 38:
-
-/* Line 1806 of yacc.c */
#line 164 "a.y"
{
- (yyval.gen2).from = nullgen;
- (yyval.gen2).to = (yyvsp[(2) - (2)].gen);
+ (yyval.addr2).from = nullgen;
+ (yyval.addr2).to = (yyvsp[(2) - (2)].addr);
}
break;
case 39:
-
-/* Line 1806 of yacc.c */
#line 169 "a.y"
{
- (yyval.gen2).from = nullgen;
- (yyval.gen2).to = (yyvsp[(1) - (1)].gen);
+ (yyval.addr2).from = nullgen;
+ (yyval.addr2).to = (yyvsp[(1) - (1)].addr);
}
break;
case 40:
-
-/* Line 1806 of yacc.c */
#line 176 "a.y"
{
- (yyval.gen2).from = nullgen;
- (yyval.gen2).to = (yyvsp[(2) - (2)].gen);
+ (yyval.addr2).from = nullgen;
+ (yyval.addr2).to = (yyvsp[(2) - (2)].addr);
}
break;
case 41:
-
-/* Line 1806 of yacc.c */
#line 181 "a.y"
{
- (yyval.gen2).from = nullgen;
- (yyval.gen2).to = (yyvsp[(1) - (1)].gen);
+ (yyval.addr2).from = nullgen;
+ (yyval.addr2).to = (yyvsp[(1) - (1)].addr);
}
break;
case 42:
-
-/* Line 1806 of yacc.c */
#line 186 "a.y"
{
- (yyval.gen2).from = (yyvsp[(1) - (3)].gen);
- (yyval.gen2).to = (yyvsp[(3) - (3)].gen);
+ (yyval.addr2).from = (yyvsp[(1) - (3)].addr);
+ (yyval.addr2).to = (yyvsp[(3) - (3)].addr);
}
break;
case 43:
-
-/* Line 1806 of yacc.c */
#line 193 "a.y"
{
- (yyval.gen2).from = (yyvsp[(1) - (5)].gen);
- (yyval.gen2).from.scale = (yyvsp[(3) - (5)].lval);
- (yyval.gen2).to = (yyvsp[(5) - (5)].gen);
+ (yyval.addr2).from = (yyvsp[(1) - (5)].addr);
+ (yyval.addr2).from.scale = (yyvsp[(3) - (5)].lval);
+ (yyval.addr2).to = (yyvsp[(5) - (5)].addr);
}
break;
case 44:
-
-/* Line 1806 of yacc.c */
#line 201 "a.y"
{
- (yyval.gen2).from = (yyvsp[(1) - (3)].gen);
- (yyval.gen2).to = (yyvsp[(3) - (3)].gen);
+ (yyval.addr2).from = (yyvsp[(1) - (3)].addr);
+ (yyval.addr2).to = (yyvsp[(3) - (3)].addr);
}
break;
case 45:
-
-/* Line 1806 of yacc.c */
#line 206 "a.y"
{
- (yyval.gen2).from = (yyvsp[(1) - (5)].gen);
- (yyval.gen2).from.scale = (yyvsp[(3) - (5)].lval);
- (yyval.gen2).to = (yyvsp[(5) - (5)].gen);
+ (yyval.addr2).from = (yyvsp[(1) - (5)].addr);
+ (yyval.addr2).from.scale = (yyvsp[(3) - (5)].lval);
+ (yyval.addr2).to = (yyvsp[(5) - (5)].addr);
}
break;
case 46:
-
-/* Line 1806 of yacc.c */
#line 214 "a.y"
{
- (yyval.gen2).from = nullgen;
- (yyval.gen2).to = (yyvsp[(2) - (2)].gen);
+ (yyval.addr2).from = nullgen;
+ (yyval.addr2).to = (yyvsp[(2) - (2)].addr);
}
break;
case 47:
-
-/* Line 1806 of yacc.c */
#line 219 "a.y"
{
- (yyval.gen2).from = nullgen;
- (yyval.gen2).to = (yyvsp[(1) - (1)].gen);
+ (yyval.addr2).from = nullgen;
+ (yyval.addr2).to = (yyvsp[(1) - (1)].addr);
}
break;
case 48:
-
-/* Line 1806 of yacc.c */
#line 224 "a.y"
{
- (yyval.gen2).from = nullgen;
- (yyval.gen2).to = (yyvsp[(2) - (2)].gen);
- (yyval.gen2).to.index = (yyvsp[(2) - (2)].gen).type;
- (yyval.gen2).to.type = D_INDIR+D_ADDR;
+ (yyval.addr2).from = nullgen;
+ (yyval.addr2).to = (yyvsp[(2) - (2)].addr);
+ (yyval.addr2).to.index = (yyvsp[(2) - (2)].addr).type;
+ (yyval.addr2).to.type = D_INDIR+D_ADDR;
}
break;
case 51:
-
-/* Line 1806 of yacc.c */
#line 237 "a.y"
{
- (yyval.gen2).from = (yyvsp[(1) - (3)].gen);
- (yyval.gen2).to = (yyvsp[(3) - (3)].gen);
+ (yyval.addr2).from = (yyvsp[(1) - (3)].addr);
+ (yyval.addr2).to = (yyvsp[(3) - (3)].addr);
}
break;
case 52:
-
-/* Line 1806 of yacc.c */
#line 242 "a.y"
{
- (yyval.gen2).from = (yyvsp[(1) - (5)].gen);
- (yyval.gen2).to = (yyvsp[(3) - (5)].gen);
- if((yyval.gen2).from.index != D_NONE)
+ (yyval.addr2).from = (yyvsp[(1) - (5)].addr);
+ (yyval.addr2).to = (yyvsp[(3) - (5)].addr);
+ if((yyval.addr2).from.index != D_NONE)
yyerror("dp shift with lhs index");
- (yyval.gen2).from.index = (yyvsp[(5) - (5)].lval);
+ (yyval.addr2).from.index = (yyvsp[(5) - (5)].lval);
}
break;
case 53:
-
-/* Line 1806 of yacc.c */
#line 252 "a.y"
{
- (yyval.gen2).from = (yyvsp[(1) - (3)].gen);
- (yyval.gen2).to = (yyvsp[(3) - (3)].gen);
+ (yyval.addr2).from = (yyvsp[(1) - (3)].addr);
+ (yyval.addr2).to = (yyvsp[(3) - (3)].addr);
}
break;
case 54:
-
-/* Line 1806 of yacc.c */
#line 257 "a.y"
{
- (yyval.gen2).from = (yyvsp[(1) - (5)].gen);
- (yyval.gen2).to = (yyvsp[(3) - (5)].gen);
- if((yyval.gen2).to.index != D_NONE)
+ (yyval.addr2).from = (yyvsp[(1) - (5)].addr);
+ (yyval.addr2).to = (yyvsp[(3) - (5)].addr);
+ if((yyval.addr2).to.index != D_NONE)
yyerror("dp move with lhs index");
- (yyval.gen2).to.index = (yyvsp[(5) - (5)].lval);
+ (yyval.addr2).to.index = (yyvsp[(5) - (5)].lval);
}
break;
case 55:
-
-/* Line 1806 of yacc.c */
#line 267 "a.y"
{
- (yyval.gen2).from = (yyvsp[(1) - (2)].gen);
- (yyval.gen2).to = nullgen;
+ (yyval.addr2).from = (yyvsp[(1) - (2)].addr);
+ (yyval.addr2).to = nullgen;
}
break;
case 56:
-
-/* Line 1806 of yacc.c */
#line 272 "a.y"
{
- (yyval.gen2).from = (yyvsp[(1) - (1)].gen);
- (yyval.gen2).to = nullgen;
+ (yyval.addr2).from = (yyvsp[(1) - (1)].addr);
+ (yyval.addr2).to = nullgen;
}
break;
case 57:
-
-/* Line 1806 of yacc.c */
#line 277 "a.y"
{
- (yyval.gen2).from = (yyvsp[(1) - (3)].gen);
- (yyval.gen2).to = (yyvsp[(3) - (3)].gen);
+ (yyval.addr2).from = (yyvsp[(1) - (3)].addr);
+ (yyval.addr2).to = (yyvsp[(3) - (3)].addr);
}
break;
case 58:
-
-/* Line 1806 of yacc.c */
#line 284 "a.y"
{
- (yyval.gen2).from = (yyvsp[(1) - (3)].gen);
- (yyval.gen2).to = (yyvsp[(3) - (3)].gen);
+ (yyval.addr2).from = (yyvsp[(1) - (3)].addr);
+ (yyval.addr2).to = (yyvsp[(3) - (3)].addr);
}
break;
case 59:
-
-/* Line 1806 of yacc.c */
#line 289 "a.y"
{
- (yyval.gen2).from = (yyvsp[(1) - (5)].gen);
- (yyval.gen2).from.scale = (yyvsp[(3) - (5)].lval);
- (yyval.gen2).to = (yyvsp[(5) - (5)].gen);
+ (yyval.addr2).from = (yyvsp[(1) - (5)].addr);
+ (yyval.addr2).from.scale = (yyvsp[(3) - (5)].lval);
+ (yyval.addr2).to = (yyvsp[(5) - (5)].addr);
}
break;
case 60:
-
-/* Line 1806 of yacc.c */
#line 297 "a.y"
{
- (yyval.gen2).from = (yyvsp[(1) - (5)].gen);
- (yyval.gen2).to = (yyvsp[(3) - (5)].gen);
- (yyval.gen2).to.offset = (yyvsp[(5) - (5)].lval);
+ (yyval.addr2).from = (yyvsp[(1) - (5)].addr);
+ (yyval.addr2).to = (yyvsp[(3) - (5)].addr);
+ (yyval.addr2).to.offset = (yyvsp[(5) - (5)].lval);
}
break;
case 61:
-
-/* Line 1806 of yacc.c */
#line 305 "a.y"
{
- (yyval.gen2).from = (yyvsp[(3) - (5)].gen);
- (yyval.gen2).to = (yyvsp[(5) - (5)].gen);
- if((yyvsp[(1) - (5)].gen).type != D_CONST)
+ (yyval.addr2).from = (yyvsp[(3) - (5)].addr);
+ (yyval.addr2).to = (yyvsp[(5) - (5)].addr);
+ if((yyvsp[(1) - (5)].addr).type != D_CONST)
yyerror("illegal constant");
- (yyval.gen2).to.offset = (yyvsp[(1) - (5)].gen).offset;
+ (yyval.addr2).to.offset = (yyvsp[(1) - (5)].addr).offset;
}
break;
case 62:
-
-/* Line 1806 of yacc.c */
#line 315 "a.y"
{
- if((yyvsp[(1) - (3)].gen).type != D_CONST || (yyvsp[(3) - (3)].gen).type != D_CONST)
+ if((yyvsp[(1) - (3)].addr).type != D_CONST || (yyvsp[(3) - (3)].addr).type != D_CONST)
yyerror("arguments to PCDATA must be integer constants");
- (yyval.gen2).from = (yyvsp[(1) - (3)].gen);
- (yyval.gen2).to = (yyvsp[(3) - (3)].gen);
+ (yyval.addr2).from = (yyvsp[(1) - (3)].addr);
+ (yyval.addr2).to = (yyvsp[(3) - (3)].addr);
}
break;
case 63:
-
-/* Line 1806 of yacc.c */
#line 324 "a.y"
{
- if((yyvsp[(1) - (3)].gen).type != D_CONST)
+ if((yyvsp[(1) - (3)].addr).type != D_CONST)
yyerror("index for FUNCDATA must be integer constant");
- if((yyvsp[(3) - (3)].gen).type != D_EXTERN && (yyvsp[(3) - (3)].gen).type != D_STATIC)
+ if((yyvsp[(3) - (3)].addr).type != D_EXTERN && (yyvsp[(3) - (3)].addr).type != D_STATIC)
yyerror("value for FUNCDATA must be symbol reference");
- (yyval.gen2).from = (yyvsp[(1) - (3)].gen);
- (yyval.gen2).to = (yyvsp[(3) - (3)].gen);
+ (yyval.addr2).from = (yyvsp[(1) - (3)].addr);
+ (yyval.addr2).to = (yyvsp[(3) - (3)].addr);
}
break;
case 68:
-
-/* Line 1806 of yacc.c */
#line 341 "a.y"
{
- (yyval.gen) = (yyvsp[(2) - (2)].gen);
+ (yyval.addr) = (yyvsp[(2) - (2)].addr);
}
break;
case 69:
-
-/* Line 1806 of yacc.c */
#line 345 "a.y"
{
- (yyval.gen) = (yyvsp[(2) - (2)].gen);
+ (yyval.addr) = (yyvsp[(2) - (2)].addr);
}
break;
case 75:
-
-/* Line 1806 of yacc.c */
#line 358 "a.y"
{
- (yyval.gen) = nullgen;
- (yyval.gen).type = D_BRANCH;
- (yyval.gen).offset = (yyvsp[(1) - (4)].lval) + pc;
+ (yyval.addr) = nullgen;
+ (yyval.addr).type = D_BRANCH;
+ (yyval.addr).offset = (yyvsp[(1) - (4)].lval) + pc;
}
break;
case 76:
-
-/* Line 1806 of yacc.c */
#line 364 "a.y"
{
- (yyval.gen) = nullgen;
+ (yyval.addr) = nullgen;
if(pass == 2)
yyerror("undefined label: %s", (yyvsp[(1) - (2)].sym)->name);
- (yyval.gen).type = D_BRANCH;
- (yyval.gen).sym = (yyvsp[(1) - (2)].sym);
- (yyval.gen).offset = (yyvsp[(2) - (2)].lval);
+ (yyval.addr).type = D_BRANCH;
+ (yyval.addr).offset = (yyvsp[(2) - (2)].lval);
}
break;
case 77:
-
-/* Line 1806 of yacc.c */
-#line 373 "a.y"
+#line 372 "a.y"
{
- (yyval.gen) = nullgen;
- (yyval.gen).type = D_BRANCH;
- (yyval.gen).sym = (yyvsp[(1) - (2)].sym);
- (yyval.gen).offset = (yyvsp[(1) - (2)].sym)->value + (yyvsp[(2) - (2)].lval);
+ (yyval.addr) = nullgen;
+ (yyval.addr).type = D_BRANCH;
+ (yyval.addr).offset = (yyvsp[(1) - (2)].sym)->value + (yyvsp[(2) - (2)].lval);
}
break;
case 78:
-
-/* Line 1806 of yacc.c */
-#line 382 "a.y"
+#line 380 "a.y"
{
- (yyval.gen) = nullgen;
- (yyval.gen).type = (yyvsp[(1) - (1)].lval);
+ (yyval.addr) = nullgen;
+ (yyval.addr).type = (yyvsp[(1) - (1)].lval);
}
break;
case 79:
-
-/* Line 1806 of yacc.c */
-#line 387 "a.y"
+#line 385 "a.y"
{
- (yyval.gen) = nullgen;
- (yyval.gen).type = (yyvsp[(1) - (1)].lval);
+ (yyval.addr) = nullgen;
+ (yyval.addr).type = (yyvsp[(1) - (1)].lval);
}
break;
case 80:
-
-/* Line 1806 of yacc.c */
-#line 392 "a.y"
+#line 390 "a.y"
{
- (yyval.gen) = nullgen;
- (yyval.gen).type = (yyvsp[(1) - (1)].lval);
+ (yyval.addr) = nullgen;
+ (yyval.addr).type = (yyvsp[(1) - (1)].lval);
}
break;
case 81:
-
-/* Line 1806 of yacc.c */
-#line 397 "a.y"
+#line 395 "a.y"
{
- (yyval.gen) = nullgen;
- (yyval.gen).type = (yyvsp[(1) - (1)].lval);
+ (yyval.addr) = nullgen;
+ (yyval.addr).type = (yyvsp[(1) - (1)].lval);
}
break;
case 82:
-
-/* Line 1806 of yacc.c */
-#line 402 "a.y"
+#line 400 "a.y"
{
- (yyval.gen) = nullgen;
- (yyval.gen).type = D_SP;
+ (yyval.addr) = nullgen;
+ (yyval.addr).type = D_SP;
}
break;
case 83:
-
-/* Line 1806 of yacc.c */
-#line 407 "a.y"
+#line 405 "a.y"
{
- (yyval.gen) = nullgen;
- (yyval.gen).type = (yyvsp[(1) - (1)].lval);
+ (yyval.addr) = nullgen;
+ (yyval.addr).type = (yyvsp[(1) - (1)].lval);
}
break;
case 84:
-
-/* Line 1806 of yacc.c */
-#line 414 "a.y"
+#line 412 "a.y"
{
- (yyval.gen) = nullgen;
- (yyval.gen).type = D_CONST;
- (yyval.gen).offset = (yyvsp[(2) - (2)].lval);
+ (yyval.addr) = nullgen;
+ (yyval.addr).type = D_CONST;
+ (yyval.addr).offset = (yyvsp[(2) - (2)].lval);
}
break;
case 85:
-
-/* Line 1806 of yacc.c */
-#line 420 "a.y"
+#line 418 "a.y"
{
- (yyval.gen) = (yyvsp[(2) - (2)].gen);
- (yyval.gen).index = (yyvsp[(2) - (2)].gen).type;
- (yyval.gen).type = D_ADDR;
+ (yyval.addr) = (yyvsp[(2) - (2)].addr);
+ (yyval.addr).index = (yyvsp[(2) - (2)].addr).type;
+ (yyval.addr).type = D_ADDR;
/*
if($2.type == D_AUTO || $2.type == D_PARAM)
yyerror("constant cannot be automatic: %s",
@@ -2370,76 +2194,62 @@ yyreduce:
break;
case 86:
-
-/* Line 1806 of yacc.c */
-#line 431 "a.y"
+#line 429 "a.y"
{
- (yyval.gen) = nullgen;
- (yyval.gen).type = D_SCONST;
- memcpy((yyval.gen).sval, (yyvsp[(2) - (2)].sval), sizeof((yyval.gen).sval));
+ (yyval.addr) = nullgen;
+ (yyval.addr).type = D_SCONST;
+ memcpy((yyval.addr).u.sval, (yyvsp[(2) - (2)].sval), sizeof((yyval.addr).u.sval));
}
break;
case 87:
-
-/* Line 1806 of yacc.c */
-#line 437 "a.y"
+#line 435 "a.y"
{
- (yyval.gen) = nullgen;
- (yyval.gen).type = D_FCONST;
- (yyval.gen).dval = (yyvsp[(2) - (2)].dval);
+ (yyval.addr) = nullgen;
+ (yyval.addr).type = D_FCONST;
+ (yyval.addr).u.dval = (yyvsp[(2) - (2)].dval);
}
break;
case 88:
-
-/* Line 1806 of yacc.c */
-#line 443 "a.y"
+#line 441 "a.y"
{
- (yyval.gen) = nullgen;
- (yyval.gen).type = D_FCONST;
- (yyval.gen).dval = (yyvsp[(3) - (4)].dval);
+ (yyval.addr) = nullgen;
+ (yyval.addr).type = D_FCONST;
+ (yyval.addr).u.dval = (yyvsp[(3) - (4)].dval);
}
break;
case 89:
-
-/* Line 1806 of yacc.c */
-#line 449 "a.y"
+#line 447 "a.y"
{
- (yyval.gen) = nullgen;
- (yyval.gen).type = D_FCONST;
- (yyval.gen).dval = -(yyvsp[(4) - (5)].dval);
+ (yyval.addr) = nullgen;
+ (yyval.addr).type = D_FCONST;
+ (yyval.addr).u.dval = -(yyvsp[(4) - (5)].dval);
}
break;
case 90:
-
-/* Line 1806 of yacc.c */
-#line 455 "a.y"
+#line 453 "a.y"
{
- (yyval.gen) = nullgen;
- (yyval.gen).type = D_FCONST;
- (yyval.gen).dval = -(yyvsp[(3) - (3)].dval);
+ (yyval.addr) = nullgen;
+ (yyval.addr).type = D_FCONST;
+ (yyval.addr).u.dval = -(yyvsp[(3) - (3)].dval);
}
break;
case 91:
-
-/* Line 1806 of yacc.c */
-#line 463 "a.y"
+#line 461 "a.y"
{
- (yyval.gen) = nullgen;
- (yyval.gen).type = D_CONST2;
- (yyval.gen).offset = (yyvsp[(2) - (2)].con2).v1;
- (yyval.gen).offset2 = (yyvsp[(2) - (2)].con2).v2;
+ (yyval.addr) = nullgen;
+ (yyval.addr).type = D_CONST2;
+ (yyval.addr).offset = (yyvsp[(2) - (2)].con2).v1;
+ (yyval.addr).offset2 = (yyvsp[(2) - (2)].con2).v2;
}
break;
case 92:
-
-/* Line 1806 of yacc.c */
-#line 472 "a.y"
+#line 470 "a.y"
{
(yyval.con2).v1 = (yyvsp[(1) - (1)].lval);
(yyval.con2).v2 = ArgsSizeUnknown;
@@ -2447,9 +2257,7 @@ yyreduce:
break;
case 93:
-
-/* Line 1806 of yacc.c */
-#line 477 "a.y"
+#line 475 "a.y"
{
(yyval.con2).v1 = -(yyvsp[(2) - (2)].lval);
(yyval.con2).v2 = ArgsSizeUnknown;
@@ -2457,9 +2265,7 @@ yyreduce:
break;
case 94:
-
-/* Line 1806 of yacc.c */
-#line 482 "a.y"
+#line 480 "a.y"
{
(yyval.con2).v1 = (yyvsp[(1) - (3)].lval);
(yyval.con2).v2 = (yyvsp[(3) - (3)].lval);
@@ -2467,9 +2273,7 @@ yyreduce:
break;
case 95:
-
-/* Line 1806 of yacc.c */
-#line 487 "a.y"
+#line 485 "a.y"
{
(yyval.con2).v1 = -(yyvsp[(2) - (4)].lval);
(yyval.con2).v2 = (yyvsp[(4) - (4)].lval);
@@ -2477,370 +2281,290 @@ yyreduce:
break;
case 98:
-
-/* Line 1806 of yacc.c */
-#line 498 "a.y"
+#line 496 "a.y"
{
- (yyval.gen) = nullgen;
- (yyval.gen).type = D_INDIR+D_NONE;
- (yyval.gen).offset = (yyvsp[(1) - (1)].lval);
+ (yyval.addr) = nullgen;
+ (yyval.addr).type = D_INDIR+D_NONE;
+ (yyval.addr).offset = (yyvsp[(1) - (1)].lval);
}
break;
case 99:
-
-/* Line 1806 of yacc.c */
-#line 504 "a.y"
+#line 502 "a.y"
{
- (yyval.gen) = nullgen;
- (yyval.gen).type = D_INDIR+(yyvsp[(3) - (4)].lval);
- (yyval.gen).offset = (yyvsp[(1) - (4)].lval);
+ (yyval.addr) = nullgen;
+ (yyval.addr).type = D_INDIR+(yyvsp[(3) - (4)].lval);
+ (yyval.addr).offset = (yyvsp[(1) - (4)].lval);
}
break;
case 100:
-
-/* Line 1806 of yacc.c */
-#line 510 "a.y"
+#line 508 "a.y"
{
- (yyval.gen) = nullgen;
- (yyval.gen).type = D_INDIR+D_SP;
- (yyval.gen).offset = (yyvsp[(1) - (4)].lval);
+ (yyval.addr) = nullgen;
+ (yyval.addr).type = D_INDIR+D_SP;
+ (yyval.addr).offset = (yyvsp[(1) - (4)].lval);
}
break;
case 101:
-
-/* Line 1806 of yacc.c */
-#line 516 "a.y"
+#line 514 "a.y"
{
- (yyval.gen) = nullgen;
- (yyval.gen).type = D_INDIR+D_NONE;
- (yyval.gen).offset = (yyvsp[(1) - (6)].lval);
- (yyval.gen).index = (yyvsp[(3) - (6)].lval);
- (yyval.gen).scale = (yyvsp[(5) - (6)].lval);
- checkscale((yyval.gen).scale);
+ (yyval.addr) = nullgen;
+ (yyval.addr).type = D_INDIR+D_NONE;
+ (yyval.addr).offset = (yyvsp[(1) - (6)].lval);
+ (yyval.addr).index = (yyvsp[(3) - (6)].lval);
+ (yyval.addr).scale = (yyvsp[(5) - (6)].lval);
+ checkscale((yyval.addr).scale);
}
break;
case 102:
-
-/* Line 1806 of yacc.c */
-#line 525 "a.y"
+#line 523 "a.y"
{
- (yyval.gen) = nullgen;
- (yyval.gen).type = D_INDIR+(yyvsp[(3) - (9)].lval);
- (yyval.gen).offset = (yyvsp[(1) - (9)].lval);
- (yyval.gen).index = (yyvsp[(6) - (9)].lval);
- (yyval.gen).scale = (yyvsp[(8) - (9)].lval);
- checkscale((yyval.gen).scale);
+ (yyval.addr) = nullgen;
+ (yyval.addr).type = D_INDIR+(yyvsp[(3) - (9)].lval);
+ (yyval.addr).offset = (yyvsp[(1) - (9)].lval);
+ (yyval.addr).index = (yyvsp[(6) - (9)].lval);
+ (yyval.addr).scale = (yyvsp[(8) - (9)].lval);
+ checkscale((yyval.addr).scale);
}
break;
case 103:
-
-/* Line 1806 of yacc.c */
-#line 534 "a.y"
+#line 532 "a.y"
{
- (yyval.gen) = nullgen;
- (yyval.gen).type = D_INDIR+(yyvsp[(3) - (9)].lval);
- (yyval.gen).offset = (yyvsp[(1) - (9)].lval);
- (yyval.gen).index = (yyvsp[(6) - (9)].lval);
- (yyval.gen).scale = (yyvsp[(8) - (9)].lval);
- checkscale((yyval.gen).scale);
+ (yyval.addr) = nullgen;
+ (yyval.addr).type = D_INDIR+(yyvsp[(3) - (9)].lval);
+ (yyval.addr).offset = (yyvsp[(1) - (9)].lval);
+ (yyval.addr).index = (yyvsp[(6) - (9)].lval);
+ (yyval.addr).scale = (yyvsp[(8) - (9)].lval);
+ checkscale((yyval.addr).scale);
}
break;
case 104:
-
-/* Line 1806 of yacc.c */
-#line 543 "a.y"
+#line 541 "a.y"
{
- (yyval.gen) = nullgen;
- (yyval.gen).type = D_INDIR+(yyvsp[(2) - (3)].lval);
+ (yyval.addr) = nullgen;
+ (yyval.addr).type = D_INDIR+(yyvsp[(2) - (3)].lval);
}
break;
case 105:
-
-/* Line 1806 of yacc.c */
-#line 548 "a.y"
+#line 546 "a.y"
{
- (yyval.gen) = nullgen;
- (yyval.gen).type = D_INDIR+D_SP;
+ (yyval.addr) = nullgen;
+ (yyval.addr).type = D_INDIR+D_SP;
}
break;
case 106:
-
-/* Line 1806 of yacc.c */
-#line 553 "a.y"
+#line 551 "a.y"
{
- (yyval.gen) = nullgen;
- (yyval.gen).type = D_INDIR+(yyvsp[(3) - (4)].lval);
- (yyval.gen).offset = (yyvsp[(1) - (4)].lval);
+ (yyval.addr) = nullgen;
+ (yyval.addr).type = D_INDIR+(yyvsp[(3) - (4)].lval);
+ (yyval.addr).offset = (yyvsp[(1) - (4)].lval);
}
break;
case 107:
-
-/* Line 1806 of yacc.c */
-#line 559 "a.y"
+#line 557 "a.y"
{
- (yyval.gen) = nullgen;
- (yyval.gen).type = D_INDIR+D_NONE;
- (yyval.gen).index = (yyvsp[(2) - (5)].lval);
- (yyval.gen).scale = (yyvsp[(4) - (5)].lval);
- checkscale((yyval.gen).scale);
+ (yyval.addr) = nullgen;
+ (yyval.addr).type = D_INDIR+D_NONE;
+ (yyval.addr).index = (yyvsp[(2) - (5)].lval);
+ (yyval.addr).scale = (yyvsp[(4) - (5)].lval);
+ checkscale((yyval.addr).scale);
}
break;
case 108:
-
-/* Line 1806 of yacc.c */
-#line 567 "a.y"
+#line 565 "a.y"
{
- (yyval.gen) = nullgen;
- (yyval.gen).type = D_INDIR+(yyvsp[(2) - (8)].lval);
- (yyval.gen).index = (yyvsp[(5) - (8)].lval);
- (yyval.gen).scale = (yyvsp[(7) - (8)].lval);
- checkscale((yyval.gen).scale);
+ (yyval.addr) = nullgen;
+ (yyval.addr).type = D_INDIR+(yyvsp[(2) - (8)].lval);
+ (yyval.addr).index = (yyvsp[(5) - (8)].lval);
+ (yyval.addr).scale = (yyvsp[(7) - (8)].lval);
+ checkscale((yyval.addr).scale);
}
break;
case 109:
-
-/* Line 1806 of yacc.c */
-#line 577 "a.y"
+#line 575 "a.y"
{
- (yyval.gen) = (yyvsp[(1) - (1)].gen);
+ (yyval.addr) = (yyvsp[(1) - (1)].addr);
}
break;
case 110:
-
-/* Line 1806 of yacc.c */
-#line 581 "a.y"
+#line 579 "a.y"
{
- (yyval.gen) = (yyvsp[(1) - (6)].gen);
- (yyval.gen).index = (yyvsp[(3) - (6)].lval);
- (yyval.gen).scale = (yyvsp[(5) - (6)].lval);
- checkscale((yyval.gen).scale);
+ (yyval.addr) = (yyvsp[(1) - (6)].addr);
+ (yyval.addr).index = (yyvsp[(3) - (6)].lval);
+ (yyval.addr).scale = (yyvsp[(5) - (6)].lval);
+ checkscale((yyval.addr).scale);
}
break;
case 111:
-
-/* Line 1806 of yacc.c */
-#line 590 "a.y"
+#line 588 "a.y"
{
- (yyval.gen) = nullgen;
- (yyval.gen).type = (yyvsp[(4) - (5)].lval);
- (yyval.gen).sym = (yyvsp[(1) - (5)].sym);
- (yyval.gen).offset = (yyvsp[(2) - (5)].lval);
+ (yyval.addr) = nullgen;
+ (yyval.addr).type = (yyvsp[(4) - (5)].lval);
+ (yyval.addr).sym = linklookup(ctxt, (yyvsp[(1) - (5)].sym)->name, 0);
+ (yyval.addr).offset = (yyvsp[(2) - (5)].lval);
}
break;
case 112:
-
-/* Line 1806 of yacc.c */
-#line 597 "a.y"
+#line 595 "a.y"
{
- (yyval.gen) = nullgen;
- (yyval.gen).type = D_STATIC;
- (yyval.gen).sym = (yyvsp[(1) - (7)].sym);
- (yyval.gen).offset = (yyvsp[(4) - (7)].lval);
+ (yyval.addr) = nullgen;
+ (yyval.addr).type = D_STATIC;
+ (yyval.addr).sym = linklookup(ctxt, (yyvsp[(1) - (7)].sym)->name, 1);
+ (yyval.addr).offset = (yyvsp[(4) - (7)].lval);
}
break;
case 113:
-
-/* Line 1806 of yacc.c */
-#line 605 "a.y"
+#line 603 "a.y"
{
(yyval.lval) = 0;
}
break;
case 114:
-
-/* Line 1806 of yacc.c */
-#line 609 "a.y"
+#line 607 "a.y"
{
(yyval.lval) = (yyvsp[(2) - (2)].lval);
}
break;
case 115:
-
-/* Line 1806 of yacc.c */
-#line 613 "a.y"
+#line 611 "a.y"
{
(yyval.lval) = -(yyvsp[(2) - (2)].lval);
}
break;
case 117:
-
-/* Line 1806 of yacc.c */
-#line 620 "a.y"
+#line 618 "a.y"
{
(yyval.lval) = D_AUTO;
}
break;
case 120:
-
-/* Line 1806 of yacc.c */
-#line 628 "a.y"
+#line 626 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (1)].sym)->value;
}
break;
case 121:
-
-/* Line 1806 of yacc.c */
-#line 632 "a.y"
+#line 630 "a.y"
{
(yyval.lval) = -(yyvsp[(2) - (2)].lval);
}
break;
case 122:
-
-/* Line 1806 of yacc.c */
-#line 636 "a.y"
+#line 634 "a.y"
{
(yyval.lval) = (yyvsp[(2) - (2)].lval);
}
break;
case 123:
-
-/* Line 1806 of yacc.c */
-#line 640 "a.y"
+#line 638 "a.y"
{
(yyval.lval) = ~(yyvsp[(2) - (2)].lval);
}
break;
case 124:
-
-/* Line 1806 of yacc.c */
-#line 644 "a.y"
+#line 642 "a.y"
{
(yyval.lval) = (yyvsp[(2) - (3)].lval);
}
break;
case 126:
-
-/* Line 1806 of yacc.c */
-#line 651 "a.y"
+#line 649 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) + (yyvsp[(3) - (3)].lval);
}
break;
case 127:
-
-/* Line 1806 of yacc.c */
-#line 655 "a.y"
+#line 653 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) - (yyvsp[(3) - (3)].lval);
}
break;
case 128:
-
-/* Line 1806 of yacc.c */
-#line 659 "a.y"
+#line 657 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) * (yyvsp[(3) - (3)].lval);
}
break;
case 129:
-
-/* Line 1806 of yacc.c */
-#line 663 "a.y"
+#line 661 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) / (yyvsp[(3) - (3)].lval);
}
break;
case 130:
-
-/* Line 1806 of yacc.c */
-#line 667 "a.y"
+#line 665 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) % (yyvsp[(3) - (3)].lval);
}
break;
case 131:
-
-/* Line 1806 of yacc.c */
-#line 671 "a.y"
+#line 669 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (4)].lval) << (yyvsp[(4) - (4)].lval);
}
break;
case 132:
-
-/* Line 1806 of yacc.c */
-#line 675 "a.y"
+#line 673 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (4)].lval) >> (yyvsp[(4) - (4)].lval);
}
break;
case 133:
-
-/* Line 1806 of yacc.c */
-#line 679 "a.y"
+#line 677 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) & (yyvsp[(3) - (3)].lval);
}
break;
case 134:
-
-/* Line 1806 of yacc.c */
-#line 683 "a.y"
+#line 681 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) ^ (yyvsp[(3) - (3)].lval);
}
break;
case 135:
-
-/* Line 1806 of yacc.c */
-#line 687 "a.y"
+#line 685 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) | (yyvsp[(3) - (3)].lval);
}
break;
-
-/* Line 1806 of yacc.c */
-#line 2831 "y.tab.c"
+/* Line 1267 of yacc.c. */
+#line 2566 "y.tab.c"
default: break;
}
- /* User semantic actions sometimes alter yychar, and that requires
- that yytoken be updated with the new translation. We take the
- approach of translating immediately before every use of yytoken.
- One alternative is translating here after every semantic action,
- but that translation would be missed if the semantic action invokes
- YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
- if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
- incorrect destructor might then be invoked immediately. In the
- case of YYERROR or YYBACKUP, subsequent parser actions might lead
- to an incorrect destructor call or verbose syntax error message
- before the lookahead is translated. */
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
YYPOPSTACK (yylen);
@@ -2849,6 +2573,7 @@ yyreduce:
*++yyvsp = yyval;
+
/* Now `shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule
number reduced by. */
@@ -2868,10 +2593,6 @@ yyreduce:
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
- /* Make sure we have latest lookahead translation. See comments at
- user semantic actions for why this is necessary. */
- yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
-
/* If not already recovering from an error, report this error. */
if (!yyerrstatus)
{
@@ -2879,36 +2600,37 @@ yyerrlab:
#if ! YYERROR_VERBOSE
yyerror (YY_("syntax error"));
#else
-# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
- yyssp, yytoken)
{
- char const *yymsgp = YY_("syntax error");
- int yysyntax_error_status;
- yysyntax_error_status = YYSYNTAX_ERROR;
- if (yysyntax_error_status == 0)
- yymsgp = yymsg;
- else if (yysyntax_error_status == 1)
- {
- if (yymsg != yymsgbuf)
- YYSTACK_FREE (yymsg);
- yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
- if (!yymsg)
- {
- yymsg = yymsgbuf;
- yymsg_alloc = sizeof yymsgbuf;
- yysyntax_error_status = 2;
- }
- else
- {
- yysyntax_error_status = YYSYNTAX_ERROR;
- yymsgp = yymsg;
- }
- }
- yyerror (yymsgp);
- if (yysyntax_error_status == 2)
- goto yyexhaustedlab;
+ YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
+ if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
+ {
+ YYSIZE_T yyalloc = 2 * yysize;
+ if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
+ yyalloc = YYSTACK_ALLOC_MAXIMUM;
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+ yymsg = (char *) YYSTACK_ALLOC (yyalloc);
+ if (yymsg)
+ yymsg_alloc = yyalloc;
+ else
+ {
+ yymsg = yymsgbuf;
+ yymsg_alloc = sizeof yymsgbuf;
+ }
+ }
+
+ if (0 < yysize && yysize <= yymsg_alloc)
+ {
+ (void) yysyntax_error (yymsg, yystate, yychar);
+ yyerror (yymsg);
+ }
+ else
+ {
+ yyerror (YY_("syntax error"));
+ if (yysize != 0)
+ goto yyexhaustedlab;
+ }
}
-# undef YYSYNTAX_ERROR
#endif
}
@@ -2916,7 +2638,7 @@ yyerrlab:
if (yyerrstatus == 3)
{
- /* If just tried and failed to reuse lookahead token after an
+ /* If just tried and failed to reuse look-ahead token after an
error, discard it. */
if (yychar <= YYEOF)
@@ -2933,7 +2655,7 @@ yyerrlab:
}
}
- /* Else will try to reuse lookahead token after shifting the error
+ /* Else will try to reuse look-ahead token after shifting the error
token. */
goto yyerrlab1;
@@ -2967,7 +2689,7 @@ yyerrlab1:
for (;;)
{
yyn = yypact[yystate];
- if (!yypact_value_is_default (yyn))
+ if (yyn != YYPACT_NINF)
{
yyn += YYTERROR;
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
@@ -2990,6 +2712,9 @@ yyerrlab1:
YY_STACK_PRINT (yyss, yyssp);
}
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
*++yyvsp = yylval;
@@ -3014,7 +2739,7 @@ yyabortlab:
yyresult = 1;
goto yyreturn;
-#if !defined(yyoverflow) || YYERROR_VERBOSE
+#ifndef yyoverflow
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/
@@ -3025,14 +2750,9 @@ yyexhaustedlab:
#endif
yyreturn:
- if (yychar != YYEMPTY)
- {
- /* Make sure we have latest lookahead translation. See comments at
- user semantic actions for why this is necessary. */
- yytoken = YYTRANSLATE (yychar);
- yydestruct ("Cleanup: discarding lookahead",
- yytoken, &yylval);
- }
+ if (yychar != YYEOF && yychar != YYEMPTY)
+ yydestruct ("Cleanup: discarding lookahead",
+ yytoken, &yylval);
/* Do not reclaim the symbols of the rule which action triggered
this YYABORT or YYACCEPT. */
YYPOPSTACK (yylen);
diff --git a/src/cmd/8a/y.tab.h b/src/cmd/8a/y.tab.h
index 14637cb33..d19145548 100644
--- a/src/cmd/8a/y.tab.h
+++ b/src/cmd/8a/y.tab.h
@@ -1,21 +1,24 @@
-/* A Bison parser, made by GNU Bison 2.5. */
+/* A Bison parser, made by GNU Bison 2.3. */
-/* Bison interface for Yacc-like parsers in C
-
- Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
+/* Skeleton interface for Bison's Yacc-like parsers in C
+
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@@ -26,11 +29,10 @@
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
-
+
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
-
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
@@ -112,11 +114,8 @@
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
-{
-
-/* Line 2068 of yacc.c */
#line 38 "a.y"
-
+{
Sym *sym;
int32 lval;
struct {
@@ -125,19 +124,16 @@ typedef union YYSTYPE
} con2;
double dval;
char sval[8];
- Gen gen;
- Gen2 gen2;
-
-
-
-/* Line 2068 of yacc.c */
-#line 135 "y.tab.h"
-} YYSTYPE;
-# define YYSTYPE_IS_TRIVIAL 1
+ Addr addr;
+ Addr2 addr2;
+}
+/* Line 1529 of yacc.c. */
+#line 132 "y.tab.h"
+ YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
#endif
extern YYSTYPE yylval;
-