diff --git a/BUILD b/BUILD new file mode 100644 index 000000000..e69de29bb diff --git a/Tools/build/BUILD b/Tools/build/BUILD new file mode 100644 index 000000000..e69de29bb diff --git a/Tools/build/build.bzl b/Tools/build/build.bzl new file mode 100644 index 000000000..dbaee120f --- /dev/null +++ b/Tools/build/build.bzl @@ -0,0 +1,10 @@ +def bison(name, src): + CFILE = "%s.c" % name + HFILE = "%s.h" % name + native.genrule( + name = name, + srcs = [src], + outs = [CFILE, HFILE], + cmd = "bison --defines=$(location {}) --output=$(location {}) $<".format(HFILE, CFILE) + ) + diff --git a/Tools/esp/BUILD b/Tools/esp/BUILD new file mode 100644 index 000000000..a559a8b3a --- /dev/null +++ b/Tools/esp/BUILD @@ -0,0 +1,68 @@ +load("//Tools/build:build.bzl", "bison") + +cc_binary( + name = "esp", + srcs = [ + "assert.c", + "assert.h", + "class.h", + "code.c", + "code.h", + "cond.h", + "data.c", + "data.h", + "dword.h", + "esp.h", + "expr.c", + "expr.h", + "fixup.c", + "fixup.h", + "flopcode.h", + "flopcodes.h", + "keywords.h", + "lmem.c", + "main.c", + "model.h", + "object.c", + "object.h", + "opcodes.h", + "scan.c", + "scan.h", + "segment.h", + "symbol.c", + "symbol.h", + "table.c", + "table.h", + "type.c", + "type.h", + ":parse.c", + ], + deps = [ + "//Tools/include", + "//Tools/include/compat", + "//Tools/utils", + ":bisonlib", + ], +) + +cc_binary( + name = "printobj", + srcs = ["printobj.c"], + deps = [ + "//Tools/include", + "//Tools/include/compat", + "//Tools/utils", + ], +) + +cc_library( + name = "bisonlib", + srcs = [":parse.h"], + includes = [""] +) + +bison( + name = "parse", + src = "parse.y" +) + diff --git a/Tools/esp/assert.c b/Tools/esp/assert.c index e4f5ad9b4..7f309179d 100644 --- a/Tools/esp/assert.c +++ b/Tools/esp/assert.c @@ -24,10 +24,6 @@ * source pass in MASM. * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: assert.c,v 1.12 93/09/09 12:34:45 adam Exp $"; -#endif lint #include "esp.h" diff --git a/Tools/esp/assert.h b/Tools/esp/assert.h index e5f757968..19a5177c2 100644 --- a/Tools/esp/assert.h +++ b/Tools/esp/assert.h @@ -27,6 +27,8 @@ void __eprintf (); /* Defined in gnulib */ # ifdef __STDC__ +extern void abort(); + # define __assert(expression, file, line) \ (__eprintf ("Failed assertion " expression \ " at line %d of `" file "'.\n", line), \ diff --git a/Tools/esp/code.c b/Tools/esp/code.c index f4b9cd2b8..e3b68b918 100644 --- a/Tools/esp/code.c +++ b/Tools/esp/code.c @@ -82,10 +82,6 @@ * Code generators. All functions are FixProc's... * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: code.c,v 3.43 95/09/20 14:50:21 weber Exp $"; -#endif lint #include "esp.h" #include "fixup.h" @@ -587,6 +583,7 @@ FixupReadWriteCheck(int *addrPtr, /* IN/OUT: Address of inst start */ { case FR_UNDEF: return(FR_UNDEF); case FR_ERROR: return (FR_ERROR); + default:; } /* @@ -2203,6 +2200,7 @@ Code_Arith2(int *addrPtr, /* IN/OUT: Address of instruction start */ { case FR_UNDEF: return(FR_UNDEF); case FR_ERROR: return (FR_ERROR); + default:; } /* @@ -2459,6 +2457,7 @@ Code_BitNF(int *addrPtr, /* IN/OUT: Address of instruction start/end */ { case FR_UNDEF: return(FR_UNDEF); case FR_ERROR: return (FR_ERROR); + default:; } /* @@ -3248,7 +3247,6 @@ Code_DPShift(int *addrPtr, /* IN/OUT: Address of instruction start */ * + sib + 4 disp + db */ byte *ip = ibuf; int opSize; - int isDWord; /* 1 if opSize is 4, 0 if not */ ExprResult res1, res2; FixResult result; long count = (long)data; @@ -3277,7 +3275,6 @@ Code_DPShift(int *addrPtr, /* IN/OUT: Address of instruction start */ { return(FR_ERROR); } - isDWord = (opSize == 4) ? 1 : 0; if (RES_IS_CONST(res1.type) || RES_IS_CONST(res2.type)) { Notify(NOTIFY_ERROR, expr1->file, expr1->line, @@ -3785,7 +3782,6 @@ Code_Fcom(int *addrPtr, /* address of instruction start */ int fixAddr; OpCode *op = (OpCode *)data; int delay=0, startAddr, typesize; - byte regValue; @@ -3795,8 +3791,6 @@ Code_Fcom(int *addrPtr, /* address of instruction start */ ADD_FWAIT_FOR_8087(fixAddr, ip); - /* regValue contains register info for modrm byte */ - regValue = (byte)((op->value & 0xf000) >> 12); if (expr1 == NULL) /* if no operands, just stick in the opcode */ { *ip = (byte)((op->value & 0x0f00) >> 8); @@ -4488,7 +4482,7 @@ Code_Fxch(int *addrPtr, /* IN/OUT: Address of instruction start */ FixResult result; int fixAddr; OpCode *op = (OpCode *)data; - int delay, startAddr; + int delay; START_CODEGEN(pass, *addrPtr, FR_DONE, FR_ERROR); @@ -4532,7 +4526,6 @@ Code_Fxch(int *addrPtr, /* IN/OUT: Address of instruction start */ /* * Install the instruction itself. */ - startAddr = *addrPtr; if (res == NULL) /* no operands */ { CodeFinal(addrPtr, pass, ip-ibuf, prevSize, ibuf, res, -1, NullID, 0, delay); @@ -6722,6 +6715,7 @@ Code_Move(int *addrPtr, /* IN/OUT: Address of instruction start */ { case FR_UNDEF: return(FR_UNDEF); case FR_ERROR: return (FR_ERROR); + default:; } /* @@ -7079,7 +7073,6 @@ Code_NoArg(int *addrPtr, /* IN/OUT: Address of instruction start */ { OpCode *op = (OpCode *)data; byte ibuf[3], *ip = ibuf; - int len = 1; START_CODEGEN(pass, *addrPtr, FR_DONE, FR_ERROR); @@ -8619,7 +8612,6 @@ Code_Xchg(int *addrPtr, /* IN/OUT: Address of instruction start */ int opSize; int notByte; /* 0 if opSize is 1, 1 if not -- used * when forming opcodes */ - int isDWord; /* 1 if opSize is 4, 0 if not */ int delay, startAddr; START_CODEGEN(pass, *addrPtr, FR_DONE, FR_ERROR); @@ -8666,7 +8658,6 @@ Code_Xchg(int *addrPtr, /* IN/OUT: Address of instruction start */ } notByte = (opSize == 1) ? 0 : 1; - isDWord = (opSize == 4) ? 1 : 0; /* * Handle special case of exchanging AX with a word register... @@ -8744,19 +8735,19 @@ static const struct { word pop; int mask; } regsave[] = { - 0x50, 0x58, 1L << REG_AX, - 0x51, 0x59, 1L << REG_CX, - 0x52, 0x5a, 1L << REG_DX, - 0x53, 0x5b, 1L << REG_BX, - 0x54, 0x5c, 1L << REG_SP, - 0x55, 0x5d, 1L << REG_BP, - 0x56, 0x5e, 1L << REG_SI, - 0x57, 0x5f, 1L << REG_DI, - 0x06, 0x07, 1L << (REG_SEGBASE+REG_ES), - 0x16, 0x17, 1L << (REG_SEGBASE+REG_SS), - 0x1e, 0x1f, 1L << (REG_SEGBASE+REG_DS), - 0x0fa0, 0x0fa1, 1L << (REG_SEGBASE+REG_FS), - 0x0fa8, 0x0fa9, 1L << (REG_SEGBASE+REG_GS), + { 0x50, 0x58, 1L << REG_AX }, + { 0x51, 0x59, 1L << REG_CX }, + { 0x52, 0x5a, 1L << REG_DX }, + { 0x53, 0x5b, 1L << REG_BX }, + { 0x54, 0x5c, 1L << REG_SP }, + { 0x55, 0x5d, 1L << REG_BP }, + { 0x56, 0x5e, 1L << REG_SI }, + { 0x57, 0x5f, 1L << REG_DI }, + { 0x06, 0x07, 1L << (REG_SEGBASE+REG_ES) }, + { 0x16, 0x17, 1L << (REG_SEGBASE+REG_SS) }, + { 0x1e, 0x1f, 1L << (REG_SEGBASE+REG_DS) }, + { 0x0fa0, 0x0fa1, 1L << (REG_SEGBASE+REG_FS) }, + { 0x0fa8, 0x0fa9, 1L << (REG_SEGBASE+REG_GS) }, }; #define ALL_REG ((1L<tn_u.tn_array.tn_base, expr, type->tn_u.tn_array.tn_length); + default:; } } diff --git a/Tools/esp/esp.h b/Tools/esp/esp.h index 68195009f..479315ef1 100644 --- a/Tools/esp/esp.h +++ b/Tools/esp/esp.h @@ -20,7 +20,7 @@ #ifndef _ESP_H_ #define _ESP_H_ -#include +#include "config.h" #include #include #include @@ -30,6 +30,7 @@ #include #undef sprintf #include +#include #include #include @@ -37,10 +38,6 @@ #include /* String table definitions */ #include -#if !defined(_LINUX) -#define alloca(size) alloca_isnt_portable_you_goob_so_dont_use_it() -#endif - #define FALSE 0 #define TRUE (!FALSE) @@ -201,8 +198,8 @@ extern ID *libNames; /* Name(s) of library being assembled */ extern int numLibNames; /* parse.y */ -extern void yywarning(char *fmt, ...); -extern void yyerror(char *fmt, ...); +extern void yywarning(const char *fmt, ...); +extern void yyerror(const char *fmt, ...); extern int yyparse(void); extern int dot; extern int fall_thru; /* Set if .fall_thru directive was diff --git a/Tools/esp/expr.c b/Tools/esp/expr.c index 6b663c648..b03ea6280 100644 --- a/Tools/esp/expr.c +++ b/Tools/esp/expr.c @@ -27,10 +27,6 @@ * XXX: Eventually, this will have to support external constants. * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: expr.c,v 3.49 95/02/17 16:25:49 adam Exp $"; -#endif lint #include "esp.h" #include "expr.h" @@ -468,10 +464,10 @@ ExprExtractType(ExprResult *tos, /* Element to evaluate */ { TypePtr result; - switch ((int)tos->type) { - case (int)EXPR_TYPE_NAN: + switch ((intptr_t)tos->type) { + case (intptr_t)EXPR_TYPE_NAN: assert(0); /* should have been caught by caller */ - case (int)EXPR_TYPE_CONST: + case (intptr_t)EXPR_TYPE_CONST: /* * Deal with structure fields (typed constants...) */ @@ -479,17 +475,17 @@ ExprExtractType(ExprResult *tos, /* Element to evaluate */ result = (TypePtr)tos->rel.frame; break; } - case (int)EXPR_TYPE_STRING: - case (int)NULL: + case (intptr_t)EXPR_TYPE_STRING: + case (intptr_t)NULL: /* * Constant -- Null type */ result = NULL; break; - case (int)EXPR_TYPE_TYPE: + case (intptr_t)EXPR_TYPE_TYPE: result = tos->data.type; break; - case (int)EXPR_TYPE_SYM: + case (intptr_t)EXPR_TYPE_SYM: switch (tos->data.sym->type) { case SYM_STRUCT: case SYM_RECORD: @@ -558,7 +554,7 @@ ExprExtractType(ExprResult *tos, /* Element to evaluate */ return(0); } break; - case (int)EXPR_TYPE_SEGSYM: /* EXPR_SIZE relies on this... */ + case (intptr_t)EXPR_TYPE_SEGSYM: /* EXPR_SIZE relies on this... */ default: /* * Use type in the result @@ -605,13 +601,13 @@ ExprExtractSegReg(ExprResult *tos, /* Element to evaluate */ byte modrm; int result; - switch((int)tos->type) { - case (int)EXPR_TYPE_NAN: /* Caller should handle this case */ - case (int)EXPR_TYPE_CONST: + switch((intptr_t)tos->type) { + case (intptr_t)EXPR_TYPE_NAN: /* Caller should handle this case */ + case (intptr_t)EXPR_TYPE_CONST: assert(0); - case (int)EXPR_TYPE_STRING: - case (int)EXPR_TYPE_SEGSYM: + case (intptr_t)EXPR_TYPE_STRING: + case (intptr_t)EXPR_TYPE_SEGSYM: return(0); default: @@ -739,12 +735,12 @@ Expr_Status(ExprResult *result) * Figure if it's code-related, data-related, constant, * a register, uses direct addressing. */ - switch((int)result->type) { - case (int)EXPR_TYPE_NAN: + switch((intptr_t)result->type) { + case (intptr_t)EXPR_TYPE_NAN: value = 0; break; - case (int)EXPR_TYPE_CONST: - case (int)EXPR_TYPE_STRING: + case (intptr_t)EXPR_TYPE_CONST: + case (intptr_t)EXPR_TYPE_STRING: value |= EXPR_STAT_CONST; if (result->rel.sym) { /* @@ -754,9 +750,9 @@ Expr_Status(ExprResult *result) value |= EXPR_STAT_GLOBAL; } break; - case (int)EXPR_TYPE_SEGSYM: + case (intptr_t)EXPR_TYPE_SEGSYM: break; - case (int)NULL: + case (intptr_t)NULL: /* * See if it's a register (INDREG gives type NULL * too). @@ -1240,6 +1236,7 @@ ExprConvertSym(Expr *expr, /* Expression, for figuring any case SYM_TYPE: result->data.number = sym->u.typeDef.common.size; break; + default:; } } else { switch(result->data.type->tn_type) { @@ -1612,8 +1609,8 @@ ExprRelOp(Expr *expr, * just invert the result. These are the only cases with which we * need to deal as ExprConvertSym handles everything else. */ - switch((long)lhs->type) { - case (int)EXPR_TYPE_STRING: + switch((intptr_t)lhs->type) { + case (intptr_t)EXPR_TYPE_STRING: if (rhs->type == EXPR_TYPE_STRING) { resval = (strcmp(lhs->data.str, rhs->data.str) == 0); break; @@ -1623,7 +1620,7 @@ ExprRelOp(Expr *expr, return(0); } /*FALLTHRU*/ - case (int)EXPR_TYPE_CONST: + case (intptr_t)EXPR_TYPE_CONST: if (!ExprMangleString(expr, rhs, msgPtr, flags, statusPtr)) { return(0); } @@ -1704,8 +1701,8 @@ ExprRelOp(Expr *expr, * just invert the result. These are the only cases with which we * need to deal as ExprConvertSym handles everything else. */ - switch((long)lhs->type) { - case (int)EXPR_TYPE_STRING: + switch((intptr_t)lhs->type) { + case (intptr_t)EXPR_TYPE_STRING: if (rhs->type == EXPR_TYPE_STRING) { resval = (strcmp(lhs->data.str, rhs->data.str) >= 0); break; @@ -1715,7 +1712,7 @@ ExprRelOp(Expr *expr, return(0); } /*FALLTHRU*/ - case (int)EXPR_TYPE_CONST: + case (intptr_t)EXPR_TYPE_CONST: if (!ExprMangleString(expr, rhs, msgPtr, flags, statusPtr)) { return(0); } @@ -1777,8 +1774,8 @@ ExprRelOp(Expr *expr, * just invert the result. These are the only cases with which we * need to deal as ExprConvertSym handles everything else. */ - switch((long)lhs->type) { - case (int)EXPR_TYPE_STRING: + switch((intptr_t)lhs->type) { + case (intptr_t)EXPR_TYPE_STRING: if (rhs->type == EXPR_TYPE_STRING) { resval = (strcmp(lhs->data.str, rhs->data.str) > 0); break; @@ -1788,7 +1785,7 @@ ExprRelOp(Expr *expr, return(0); } /*FALLTHRU*/ - case (int)EXPR_TYPE_CONST: + case (intptr_t)EXPR_TYPE_CONST: if (!ExprMangleString(expr, rhs, msgPtr, flags, statusPtr)) { return(0); } @@ -1960,6 +1957,7 @@ ExprConstBinOp(Expr *expr, } } break; + default:; } lhs->rel.frame = NULL; return(1); @@ -2775,6 +2773,7 @@ ExprDotCombine(Expr *expr, case SYM_LOCAL: ltype = sym->u.localVar.type; break; + default:; } msg = "%i not a field in %i"; @@ -3344,11 +3343,11 @@ Expr_Eval(Expr *expr, /* Expression to evaluate */ elt++, n--; break; case EXPR_OFFSET: - switch ((int)tos->type) { - case (int)EXPR_TYPE_NAN: + switch ((intptr_t)tos->type) { + case (intptr_t)EXPR_TYPE_NAN: /* result remains NaN */ break; - case (int)EXPR_TYPE_CONST: + case (intptr_t)EXPR_TYPE_CONST: if (tos->rel.frame) { /* * Constant comes from a structure field. We're @@ -3358,9 +3357,9 @@ Expr_Eval(Expr *expr, /* Expression to evaluate */ */ break; } - case (int)EXPR_TYPE_STRING: - case (int)EXPR_TYPE_SEGSYM: - case (int)NULL: + case (intptr_t)EXPR_TYPE_STRING: + case (intptr_t)EXPR_TYPE_SEGSYM: + case (intptr_t)NULL: ExprError("invalid operand of OFFSET"); default: if (tos->data.ea.modrm != 0x06) { @@ -3373,7 +3372,7 @@ Expr_Eval(Expr *expr, /* Expression to evaluate */ tos->data.number = tos->data.ea.disp; tos->type = EXPR_TYPE_CONST; break; - case (int)EXPR_TYPE_SYM: + case (intptr_t)EXPR_TYPE_SYM: switch(tos->data.sym->type) { case SYM_BITFIELD: tos->data.number = @@ -3473,12 +3472,12 @@ Expr_Eval(Expr *expr, /* Expression to evaluate */ } tp = (void *)&(tos->type); - switch(*(long *)tp) + switch(*(intptr_t *)tp) { - case (int)EXPR_TYPE_NAN: + case (intptr_t)EXPR_TYPE_NAN: /* result remains NaN */ break; - case (int)EXPR_TYPE_CONST: + case (intptr_t)EXPR_TYPE_CONST: if (elt->op == EXPR_HIGH) { tos->data.number >>= 8; } @@ -3511,7 +3510,7 @@ Expr_Eval(Expr *expr, /* Expression to evaluate */ } tos->data.number &= 0xff; break; - case (int)EXPR_TYPE_STRING: + case (intptr_t)EXPR_TYPE_STRING: /* * XXX: This ordering is weird, but it's what MASM * does... @@ -3543,7 +3542,7 @@ Expr_Eval(Expr *expr, /* Expression to evaluate */ break; } /*FALLTHRU*/ - case (int)NULL: + case (intptr_t)NULL: invalid_high_low_operand: if (elt->op == EXPR_HIGH) { ExprError("invalid operand of HIGH"); @@ -3896,6 +3895,7 @@ Expr_Eval(Expr *expr, /* Expression to evaluate */ val = (1<<10); break; case SYM_CHUNK: val = (1<<11); break; + default:; } } else if (tos->type == EXPR_TYPE_SEGSYM) { /* segment constant */ @@ -3907,6 +3907,7 @@ Expr_Eval(Expr *expr, /* Expression to evaluate */ case SYM_ETYPE: val = (1<< 8)|(1<<11); break; case SYM_TYPE: val = (1<<11); break; case SYM_RECORD: val = (1<< 9)|(1<<11); break; + default:; } } else if (tos->data.type->tn_type == TYPE_NEAR) { /* near code */ @@ -4549,6 +4550,7 @@ Expr_Eval(Expr *expr, /* Expression to evaluate */ ExprError("cannot find low portion of expression"); case EXPR_HIGHPART: ExprError("cannot find high portion of expression"); + default:; } } } else if (elt->op == EXPR_LOWPART || elt->op == EXPR_HIGHPART){ diff --git a/Tools/esp/fixup.c b/Tools/esp/fixup.c index a0454df7c..4c682d480 100644 --- a/Tools/esp/fixup.c +++ b/Tools/esp/fixup.c @@ -32,10 +32,6 @@ * necessary that is. * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: fixup.c,v 1.22 95/02/17 16:26:00 adam Exp $"; -#endif lint #include "esp.h" #include diff --git a/Tools/esp/lmem.c b/Tools/esp/lmem.c index 3a1b224d7..523772c36 100644 --- a/Tools/esp/lmem.c +++ b/Tools/esp/lmem.c @@ -53,10 +53,6 @@ * address to be automatically adjusted when handles are inserted. * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: lmem.c,v 3.10 93/02/12 18:47:58 adam Exp $"; -#endif lint #include "esp.h" #include diff --git a/Tools/esp/main.c b/Tools/esp/main.c index 2c7a7714a..c826bc959 100644 --- a/Tools/esp/main.c +++ b/Tools/esp/main.c @@ -18,10 +18,6 @@ * Main module for Esp. Initialization and control. * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: main.c,v 1.58 95/04/27 18:07:55 jimmy Exp $"; -#endif lint #include #include diff --git a/Tools/esp/object.c b/Tools/esp/object.c index 539df7a28..b47410c1f 100644 --- a/Tools/esp/object.c +++ b/Tools/esp/object.c @@ -33,10 +33,6 @@ * have none. * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: object.c,v 1.32 94/05/15 15:07:49 adam Exp $"; -#endif lint #include "esp.h" #include "expr.h" @@ -1295,6 +1291,7 @@ ObjRelocType(SymbolPtr tag, /* VarData tag for which table is } break; } + default:; } } diff --git a/Tools/esp/parse.c b/Tools/esp/parse.c deleted file mode 100644 index 5f4c7825a..000000000 --- a/Tools/esp/parse.c +++ /dev/null @@ -1,11084 +0,0 @@ - -/* A Bison parser, made from parse.y - by GNU Bison version 1.28 */ - -#define YYBISON 1 /* Identify Bison output. */ - -#define MEMMODEL 257 -#define LANGUAGE 258 -#define EQU 259 -#define MACRO 260 -#define ALIGNMENT 261 -#define BREAK 262 -#define BYTEREG 263 -#define CAST 264 -#define COMBINE 265 -#define CONSTANT 266 -#define COPROCESSOR 267 -#define DEBUG 268 -#define DEF 269 -#define DWORDREG 270 -#define MASM 271 -#define PNTR 272 -#define PROCESSOR 273 -#define SEGREG 274 -#define SHOWM 275 -#define STATE 276 -#define WORDREG 277 -#define ST 278 -#define IFNDEF 279 -#define IFDEF 280 -#define IFDIF 281 -#define IFE 282 -#define IFIDN 283 -#define IFNB 284 -#define IFB 285 -#define IF 286 -#define IF1 287 -#define IF2 288 -#define FIRSTOP 289 -#define AND 290 -#define ARITH2 291 -#define ARPL 292 -#define BITNF 293 -#define BOUND 294 -#define CALL 295 -#define CMPS 296 -#define ENTER 297 -#define GROUP1 298 -#define IMUL 299 -#define IO 300 -#define INS 301 -#define INT 302 -#define JMP 303 -#define JUMP 304 -#define LDPTR 305 -#define LEA 306 -#define LEAVE 307 -#define LOCK 308 -#define LODS 309 -#define LOOP 310 -#define LSDT 311 -#define LSINFO 312 -#define MOV 313 -#define MOVS 314 -#define NAIO 315 -#define NAPRIV 316 -#define NASTRG 317 -#define NASTRGD 318 -#define NASTRGW 319 -#define NOARG 320 -#define NOARGD 321 -#define NOARGW 322 -#define NOT 323 -#define OR 324 -#define OPCODE 325 -#define OUTS 326 -#define POP 327 -#define PWORD 328 -#define PUSH 329 -#define REP 330 -#define RET 331 -#define RETF 332 -#define RETN 333 -#define SCAS 334 -#define SHIFT 335 -#define SHL 336 -#define SHLD 337 -#define SHR 338 -#define SHRD 339 -#define STOS 340 -#define TEST 341 -#define WREG1 342 -#define XCHG 343 -#define XLAT 344 -#define XLATB 345 -#define XOR 346 -#define FGROUP0 347 -#define FGROUP1 348 -#define FBIOP 349 -#define FCOM 350 -#define FUOP 351 -#define FZOP 352 -#define FFREE 353 -#define FINT 354 -#define FLDST 355 -#define FXCH 356 -#define LASTOP 357 -#define IDENT 358 -#define STRING 359 -#define PCTOUT 360 -#define MACARG 361 -#define STRUCT_INIT 362 -#define MACEXEC 363 -#define FIRSTSYM 364 -#define SYM 365 -#define STRUCT_SYM 366 -#define CLASS_SYM 367 -#define METHOD_SYM 368 -#define MODULE_SYM 369 -#define INSTVAR_SYM 370 -#define TYPE_SYM 371 -#define ETYPE_SYM 372 -#define RECORD_SYM 373 -#define EXPR_SYM 374 -#define LASTSYM 375 -#define PROTOMINOR_SYM 376 -#define EXPR 377 -#define PTYPE 378 -#define ABS 379 -#define ALIGN 380 -#define ASSERT 381 -#define ASSUME 382 -#define AT 383 -#define CATSTR 384 -#define CHUNK 385 -#define CLASS 386 -#define COMMENT 387 -#define CPUBLIC 388 -#define DEFAULT 389 -#define DEFETYPE 390 -#define DOT 391 -#define DOTENTER 392 -#define DOTLEAVE 393 -#define DOTTYPE 394 -#define DUP 395 -#define DYNAMIC 396 -#define ELSE 397 -#define END 398 -#define ENDC 399 -#define ENDIF 400 -#define ENDM 401 -#define ENDP 402 -#define ENDS 403 -#define ENUM 404 -#define EQ 405 -#define ERR 406 -#define ERRB 407 -#define ERRDEF 408 -#define ERRDIF 409 -#define ERRE 410 -#define ERRIDN 411 -#define ERRNB 412 -#define ERRNDEF 413 -#define ERRNZ 414 -#define EVEN 415 -#define EXITF 416 -#define EXITM 417 -#define EXPORT 418 -#define FALLTHRU 419 -#define FAR 420 -#define FIRST 421 -#define FLDMASK 422 -#define GE 423 -#define GLOBAL 424 -#define GROUP 425 -#define GT 426 -#define HANDLE 427 -#define HIGH 428 -#define HIGHPART 429 -#define INCLUDE 430 -#define INHERIT 431 -#define INST 432 -#define INSTR 433 -#define IOENABLE 434 -#define IRP 435 -#define IRPC 436 -#define LABEL 437 -#define LE 438 -#define LENGTH 439 -#define LMEM 440 -#define LOCAL 441 -#define LOCALIZE 442 -#define LOW 443 -#define LOWPART 444 -#define LT 445 -#define MASK 446 -#define MASTER 447 -#define METHOD 448 -#define MOD 449 -#define MODEL 450 -#define NE 451 -#define NEAR 452 -#define NORELOC 453 -#define NOTHING 454 -#define OFFPART 455 -#define OFFSET 456 -#define ON_STACK 457 -#define ORG 458 -#define PRIVATE 459 -#define PROC 460 -#define PROTOMINOR 461 -#define PROTORESET 462 -#define PTR 463 -#define PUBLIC 464 -#define RECORD 465 -#define RELOC 466 -#define REPT 467 -#define RESID 468 -#define SEG 469 -#define SEGMENT 470 -#define SEGREGOF 471 -#define SEGPART 472 -#define SIZE 473 -#define SIZESTR 474 -#define STATIC 475 -#define STRUC 476 -#define SUBSTR 477 -#define SUPER 478 -#define THIS 479 -#define TYPE 480 -#define UNDEF 481 -#define UNION 482 -#define UNREACHED 483 -#define USES 484 -#define VARDATA 485 -#define VARIANT 486 -#define VSEG 487 -#define WARN 488 -#define WIDTH 489 -#define WRITECHECK 490 -#define NOWRITECHECK 491 -#define READCHECK 492 -#define NOREADCHECK 493 -#define SHORT 494 -#define UNARY 495 - -#line 1 "parse.y" - -/*********************************************************************** - * PROJECT: PCGEOS - * MODULE: Esp -- parser - * FILE: parse.y - * - * AUTHOR: Adam de Boor: Aug 26, 1988 - * - * ROUTINES: - * Name Description - * ---- ----------- - * yyparse Main parsing function - * yyerror Error reporter for use when you know you've - * been called from the parser. - * yywarning Warning message producer for use when you know - * you've been called from the parser. - * Parse_Init Set up initial parser state - * Parse_DefineString Define a string equate. - * Parse_CheckClosure Make sure things are closed up properly at - * major code junctures (usually the end of a file) - * Parse_Complete Perform any final processing necessary when - * all source code has been read. - * Parse_FileChange Note a switch to a different source file. - * PushSegment Switch to a new segment. - * PopSegment Return to previous segment. - * - * REVISION HISTORY: - * Date Name Description - * ---- ---- ----------- - * 8/26/88 ardeb Initial version - * - * DESCRIPTION: - * A grammar to parse code for the assembler. - * - ***********************************************************************/ -#ifndef lint -static char *rcsid = "$Id: parse.y,v 3.73 95/09/20 14:46:15 weber Exp $"; -#endif lint - -#include - -#include "esp.h" -#include "code.h" -#include "expr.h" -#include "object.h" -#include "scan.h" -#include "type.h" -#include "data.h" - -#include - -#include - -#define YYERROR_VERBOSE /* Give the follow set in parse error messages */ - -/* - * Provide our own handler for the parser-stack overflow so the default one - * that uses "alloca" isn't used, since alloca is forbidden to us owing to - * the annoying hidden non-support of said function by our dearly beloved - * HighC from MetaWare, A.M.D.G. - */ -#define yyoverflow ParseStackOverflow -#define YYLTYPE byte /* We don't use this, so minimize overhead */ -static void ParseStackOverflow(char *, - short **, size_t, - YYSTYPE **, size_t, - int *); - -#include -/* - * Current expression. There are two staticly-allocated expressions for - * this parser (since no rule requires more than two operands of this - * type), with a third used to evaluate things that must be constant - * without interfering with either of the two main ones. - * - * The rules operand1 and operand2 decide which one to use, with curExpr - * pointing to the one into which elements are to be stuffed. - * - * Each static expression points to its corresponding defElts array at - * the beginning. A new array is allocated if the expression is too long - * to fit in the default area. - * - * If the one of the expressions needs to be saved. Expr_Copy should - * be called to copy things. - */ -#define DEF_EXPR_SIZE 128 /* Initial number of elements */ -static Expr *curExpr, /* Expression being parsed */ - expr1, /* Operand 1 */ - expr2, /* Operand 2 */ - texpr; /* Temporary expr for use in cexpr */ -static int curExprSize; /* # of elements allocated for curExpr */ -static ExprElt defElts1[DEF_EXPR_SIZE], - defElts2[DEF_EXPR_SIZE], - defTElts[DEF_EXPR_SIZE]; - -static Expr zeroExpr; -static ExprElt zeroElts[4]; /* EXPR_CONST, 0, EXPR_COMMA, linenum */ - -/* - * Array of all staticly-allocated Expr's for ASSUME directive and EnterProc. - */ -static Expr *exprs[] = { - &expr1, &expr2, &texpr -}; - -/* - * inStruct contains a pointer to the structure currently being defined. If - * it is NULL, no structure is being defined and data definitions are real. - */ -Symbol *inStruct=0; - -/* - * curClass points to the Symbol for the class currently being defined or - * to the class for which the current procedure is implementing a method. - * - * defClass is non-zero if defining a class and zero if just assembling - * a method handler. When defining a class, inStruct points to the partial- - * instance structure being defined. - * - * isPublic indicates if the methods/instance variables are to be - * considered public or not. - * - * methFlags indicates if the current method can be called statically, - * and whether it's an external method (OBJ_* constants defined in object.h) - * - * - * classProc holds an index to pass to Scan_DontUseOpProc when a class - * declaration is complete. - */ -Symbol *curClass=NULL; -int defClass=FALSE; -int isPublic=FALSE; -int methFlags; -int classProc=-1; - -/* - * curProtoMinor points to the Symbol for the protominor most recently seen - * in the current class declaration - * - */ - -Symbol *curProtoMinor=NULL; - -/* - * protoMinorSymbolSeg is the segment where we put protoMinor symbols if the - * current segment at the time was null - */ -Symbol *protoMinorSymbolSeg=NULL; - -/* - * ignore is set TRUE if anything being read will be ignored. This includes - * INCLUDE and MACRO directives. It is turned on while skipping false - * conditionals. - */ -int ignore=FALSE; - -/* - * Stack of nested if's. iflevel == -1 => no nested ifs in progress. The - * stack is necessary to handle elseifs properly. The way these things work - * is to process things normally if a conditional is true, but when it is - * false, to call Scan_ToEndif, which reads the file until the end of the - * conditional is reached. The terminating token, be it an ELSE, ELSEIF or - * ENDIF, is pushed back into the input stream, preceded by a newline, - * to be read next. - */ -#define MAX_IF_LEVEL 30 -IfDesc ifStack[MAX_IF_LEVEL]; -int iflevel=-1; - -/* - * curFile describes the current input file. The 'line' and 'file' fields - * are filled in only when the file is pushed on the stack of files when an - * INCLUDE directive is acted on. The 'name' field, however, is always valid. - * - * The current line number is in yylineno, while the stream being read from is - * in yyin. - */ -File *curFile; /* Info for current input file */ - -/* - * dot is the current offset in the current segment. The current segment is - * maintained in curSeg. - */ -int dot; -Symbol *curSeg; - -/* - * fall_thru is set whenever a .fall_thru directive is encountered. If code - * is generated when fall_thru is set, we generate a warning. If checkLabel - * isn't set for the segment when a procedure is ended while fall_thru is false, - * we also generate a warning if warn_fall_thru is set. - */ -int fall_thru = 0; - -/* - * curChunk is the symbol of the LMem chunk currently being defined. Null - * if none. - * lastChunk holds the most-recently defined chunk, for use by the LOCALIZE - * directive. - */ -Symbol *curChunk; -Symbol *lastChunk; -int lastChunkLine; /* Line number of the lastChunk */ -char lastChunkFile[66]; /* File name of the lastChunk */ - -/* - * Procedure-specific things (all reset by EndProc()). - * curProc Symbol of current procedure. - * localSize Size of local variables so far. - * frameSize Size of frame to be created (subtracted from frame pointer - * on entry; this is different from localSize if any local - * variables are initialized with pushes) - * usesMask Mask of registers used by procedure. - * enterNeeded Non-zero if .ENTER should be given for procedure (any of - * local variables being given, USES being encountered, - * or arguments being declared cause this to be set) - * enterSeen Non-zero if .ENTER directive seen in this procedure. - * leaveSeen Non-zero if .LEAVE directive seen in this procedure. - * frameNeeded related to enterNeeded but indicates if a stack frame - * needs to be set up. Can't just use REG_BP set in usesMask - * as someone could very well have a function that thrashes - * bp. - * frameSetup Set if frame pointer has already been setup, owing to - * push-initialized variables. - * isFirstLocalWord is set each time a local variable is defined and push- - * initialized. It is not pushed on the segment stack. - */ -Symbol *curProc=NULL; -int argOffset=0; -int localSize=0; -int frameSize=0; -dword usesMask=0; -int enterNeeded=FALSE; -int enterSeen=FALSE; -int leaveSeen=FALSE; -int frameNeeded=FALSE; -int frameSetup=FALSE; -int isFirstLocalWord; - -/* - * Arguments from the .MODEL directive. Used to control how procedures are - * declared. - */ -MemoryModel model = MM_SMALL; -Language language = LANG_C; - -/* - * Flag to indicate if we are doing memory write-checking. This form of - * checking causes the _writecheck macro to be invoked whenever esp detects - * that a write to memory is occuring. The macro is passed enough information - * that it should be able to attempt validate the passed address. - * - * By default this sort of checking is off, because it can incur a great - * expense. - */ -int writeCheck = FALSE; - -/* - * This is a similar flag that verifies that reads from memory locations are - * valid. - */ -int readCheck = FALSE; - -/* - * Stuff for defArgs: - * - * emptyIsConst is non-zero if the base type of the data being defined - * calls for a CONST(0) to be stored, as opposed to STRING(""), if an - * element of the initializer is empty. - * - * checkForStrings is used to get the proper array length from the - * initializer for a byte-sized variable. For each element in the initializer, - * the parser will see if the thing is a multi-character string w/o any - * other expression pieces (no 'hi'+3 or anything) and, if so, use the length - * of the string as the number of elements for that part of the initializer, - * rather than the 1 it usually uses. - */ -int emptyIsConst; /* Non-zero if CONST(0) on empty */ -int checkForStrings; /* Non-zero if should be on the lookout - * for string elements in initializer */ -int indir=0; /* Non-zero if indirecting in an operand. - * i.e. WORDREG gets stored as EXPR_INDREG, - * DWORDREG gets stored as EXPR_EINDREG, - * BYTEREG is illegal, etc. */ - -/* - * PREDEFINED STRING SYMBOLS: - * - * @CurSeg name of the current segment - * @Cpu bits describing current CPU setting - * @CurProc name of the current procedure - * @FileName name of the main file - * @CurClass name of the current class, either in a class - * declaration or in a method handler. - * @File name of the current file. - * @Line the current line number. This is handled specially - * by the scanner and returned as CONSTANT, not - * a string equate, as it changes so rapidly. - * @ArgSize number of bytes of arguments declared for the procedure - */ -static struct { - char *name; /* Name of predefined */ - MBlk *value; /* Record allocated to hold value -- no need to store - * the symbol again. When the value changes (e.g. - * for @CurSeg), we just copy the new value into the - * block and alter the length */ -} predefs[] = { - "@CurSeg", NULL, -#define PD_CURSEG 0 - "@Cpu", NULL, -#define PD_CPU 1 - "@CurProc", NULL, -#define PD_CURPROC 2 - "@FileName", NULL, -#define PD_FILENAME 3 - "@CurClass", NULL, -#define PD_CURCLASS 4 - "@File", NULL, -#define PD_FILE 5 - "@ArgSize", NULL, -#define PD_ARGSIZE 6 -}; - -#define PD_VAL_LEN (256-MACRO_BLOCK_SIZE) - -/* - * FUNCTION DECLARATIONS - * - * SkipToEndif skips to the end of a false conditional. - * - * SetDispSize takes a pointer to a YYSTYPE structure and figures out the - * smallest displacement permisible -- either 8- or 16-bit, never null. - * It is used by the ea rules after merging offsets. - * - * OVERRIDE produces the correct segment-override opcode given the segment - * register to use. - */ -#define OVERRIDE(reg) (0x26 | (reg << 3)) -static void ResetExpr(Expr *, ExprElt *); /* Reset curExpr, freeing any - * previously-allocated elts */ -static void StoreExprOp(ExprOp); -static void StoreExprString(ExprOp, char *); -static void StoreExprConst(long); -static void StoreExprFloatStack(long); -static void StoreExprIdent(ID); -static void StoreExprSymbol(Symbol *); -static void StoreExprType(TypePtr); -static void StoreExprReg(ExprOp, int); -static void DupExpr(int num, int start); -static void StoreSubExpr(Expr *); - -static void FilterGenerated(SymbolPtr sym); -void yyerror(char *fmt, ...); -void yywarning(char *fmt, ...); -static int ParseAdjustLocals(SymbolPtr, Opaque); -static int ParseCountLocals(SymbolPtr, Opaque); - -/* - * These two deal with the definition of a variable/instance variable/structure - * field. They implicitly take curExpr as the initial/default value for - * the thing. If advance is FALSE, then structOffset/dot are not advanced - * (used by the LABEL directive). - */ -static void DefineData(ID name, TypePtr type, int advance, int usebase); -static void DefineDataSym(Symbol *sym, TypePtr type, int advance, - int usebase); - -/* - * Verifies that a label isn't multiply defined and was declared global or - * public in the proper segment. - */ -static void CheckAndSetLabel(SymType type, Symbol *sym, int near); - -/* - * Begins a procedure, resolving the procedure pointer for unresolved local - * variables and recording the symbol for the procedure for later use. - */ -static void EnterProc(SymbolPtr proc); - -/* - * Finishes out the current procedure, performing error checking on the - * various special things we support. - */ -static void EndProc(ID name); -static void AddArg(ID name, TypePtr type); - -static void EnterClass(SymbolPtr class); -static void EndClass(void); -static int CheckRelated(Symbol *curClass, Symbol *otherClass); - -/* - * Deal with an IF or ELSEIF token. Condition stored in curExpr and - * must evaluate to a numeric constant. - */ -static void HandleIF(int isElse); - -/* - * Redefine a string equate. - */ -static void RedefineString(SymbolPtr sym, MBlk *val); - -/* - * Search a string for an occurrence of another string. - */ -static long FindSubstring(char *string, char *substring); - -/* - * Fixup procedure to verify the target of .fall_thru pseudo-op during pass 2 - */ -static FixResult ParseFallThruCheck(int *dotPtr, int prevSize, int pass, - Expr *expr1, Expr *expr2, Opaque data); - -/* - * See if the passed ID is one of the library names specified on the command - * line. - */ -static int ParseIsLibName(ID id); - -static void ParseSetLastChunkWarningInfo (void); -static void ParseLocalizationCheck (void); - -/* - * Segment-stack definitions. - * - * The stack contains not only the value of dot and the segment involved, - * but all the other crufty state variables for the definition of procedures, - * classes and chunks. - */ -typedef struct _SegStack { - struct _SegStack *next; - SymbolPtr seg; /* Segment */ - SymbolPtr inStruct; /* Current structure */ - /* - * Procedure stuff - */ - SymbolPtr curProc; /* Current procedure */ - int localSize; - int frameSize; - int frameSetup; - dword usesMask; - int enterNeeded; - int enterSeen; - int leaveSeen; - int frameNeeded; - int fall_thru; - /* - * Chunk state - */ - SymbolPtr curChunk; - /* - * Class state - */ - SymbolPtr curClass; - int defClass; - int isPublic; - int classProc; -} SegStack; - -SegStack *segStack = NULL; - -/****************************************************************************** - * - * EXPRESSION FUNCTIONS - * - * These are up here with the variables so they can be inlined by the compiler - * if reasonable. - *****************************************************************************/ - -/*********************************************************************** - * CopyExprCheckingIfZero - *********************************************************************** - * SYNOPSIS: Copy the passed expression, unless it's a constant - * zero, in which case use the static zeroExpr instead - * CALLED BY: recordField, DefineData, DefineDataSym - * RETURN: Expr * to use - * SIDE EFFECTS: elements for the passed expression will be stolen if - * the expression is copied and those elements are - * dynamically allocated - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 4/ 9/92 Initial Revision - * - ***********************************************************************/ -static Expr * -CopyExprCheckingIfZero(Expr *expr) -{ - if ((curExpr->numElts == 4) && - (curExpr->elts[2].op == EXPR_COMMA) && - (curExpr->elts[0].op == EXPR_CONST) && - (curExpr->elts[1].value == 0)) - { - return &zeroExpr; - } else if ((curExpr->numElts == 2) && - (curExpr->elts[0].op == EXPR_CONST) && - (curExpr->elts[1].value == 0)) - { - return &zeroExpr; - } else { - return Expr_Copy(expr, TRUE); - } -} - -/*********************************************************************** - * ResetExpr - *********************************************************************** - * SYNOPSIS: Reset curExpr to its default state. - * CALLED BY: yyparse - * RETURN: Nothing - * SIDE EFFECTS: If curExpr.elts points anywhere but at defElts, - * it is freed. - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 3/ 7/89 Initial Revision - * - ***********************************************************************/ -static void -ResetExpr(Expr *expr, /* Static Expr structure to use */ - ExprElt *elts) /* Array of DEF_EXPR_SIZE elements to use */ -{ - if (expr->numElts > DEF_EXPR_SIZE) { - /* - * If expression held more than DEF_EXPR_SIZE elements, the elts array - * must have been dynamically allocated, so free it now before it - * goes away. - */ - free((char *)expr->elts); - } - curExpr = expr; - curExpr->elts = elts; - curExpr->numElts = 0; - curExprSize = DEF_EXPR_SIZE; - curExpr->line = yylineno; - curExpr->file = curFile->name; - curExpr->idents = 0; - curExpr->musteval = 0; -} - -/*********************************************************************** - * RestoreExpr - *********************************************************************** - * SYNOPSIS: Restore the current expression following something that - * used texpr. - * CALLED BY: (INTERNAL) yyparse - * RETURN: nothing - * SIDE EFFECTS:curExpr and curExprSize are set - * texpr is reset - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 3/22/95 Initial Revision - * - ***********************************************************************/ -static void -RestoreExpr(struct _exprSave *saved) -{ - ResetExpr(&texpr, defTElts); - curExpr = saved->curExpr; - curExprSize = saved->curExprSize; -} - -/*********************************************************************** - * CheckExprRoom - *********************************************************************** - * SYNOPSIS: Make sure curExpr has enough room for desired thing. - * CALLED BY: StoreExprOp, StoreExprSymbol, StoreExprString, - * StoreExprReg, StoreExprConst - * RETURN: Elt in which to store desired things. - * SIDE EFFECTS: curExpr.elts and curExprSize may change. - * curExpr.numElts is updated by the given amount. - * - * STRATEGY: None, really. - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 3/ 7/89 Initial Revision - * - ***********************************************************************/ -inline static ExprElt * -CheckExprRoom(int numNeeded) -{ - ExprElt *result; - - if (curExpr->numElts + numNeeded > curExprSize) { - int oldSize = curExprSize; - - do { - curExprSize += DEF_EXPR_SIZE; - } while (curExpr->numElts + numNeeded > curExprSize); - - if (oldSize != DEF_EXPR_SIZE) { - /* - * Use realloc to get more memory and possibly copy the stuff over - */ - curExpr->elts = - (ExprElt *)realloc_tagged((char *)curExpr->elts, - curExprSize * sizeof(ExprElt)); - } else { - /* - * Allocate a buffer for the expression and copy over the stuff - * we've already got. - */ - ExprElt *oldElts = curExpr->elts; - - curExpr->elts = - (ExprElt *)malloc_tagged(curExprSize * sizeof(ExprElt), - TAG_EXPR_ELTS); - bcopy(oldElts, curExpr->elts, curExpr->numElts * sizeof(ExprElt)); - } - } - - /* - * Figure where the caller can store stuff. - */ - result = curExpr->elts + curExpr->numElts; - - /* - * Up the number of elements stored. - */ - curExpr->numElts += numNeeded; - - /* - * Return the place to the caller - */ - return(result); -} - - -/*********************************************************************** - * StoreExprOp - *********************************************************************** - * SYNOPSIS: Store an ExprOp in the expression - * CALLED BY: yyparse. - * RETURN: Nothing - * SIDE EFFECTS: ... - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 3/ 7/89 Initial Revision - * - ***********************************************************************/ -static void -StoreExprOp(ExprOp op) -{ - ExprElt *elt = CheckExprRoom(1); - - elt->op = op; -} - - -/*********************************************************************** - * StoreExprString - *********************************************************************** - * SYNOPSIS: Store a string value preceded by an ExprOp - * CALLED BY: yyparse - * RETURN: Nothing - * SIDE EFFECTS: ... - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 3/ 7/89 Initial Revision - * - ***********************************************************************/ -static void -StoreExprString(ExprOp op, char *string) -{ - ExprElt *elt = CheckExprRoom(1 + ExprStrElts(string)); - - elt->op = op; - strcpy((char *)(elt+1), string); -} - -/*********************************************************************** - * StoreExprConst - *********************************************************************** - * SYNOPSIS: Store a short constant - * CALLED BY: yyparse - * RETURN: Nothing - * SIDE EFFECTS: ... - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 3/ 7/89 Initial Revision - * - ***********************************************************************/ -static void -StoreExprConst(long value) -{ - ExprElt *elt = CheckExprRoom(2); - - elt->op = EXPR_CONST; - elt[1].value = value; -} - -/*********************************************************************** - * StoreExprFloatStack - *********************************************************************** - * SYNOPSIS: Store a short constant - * CALLED BY: yyparse - * RETURN: Nothing - * SIDE EFFECTS: ... - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 3/ 7/89 Initial Revision - * - ***********************************************************************/ -static void -StoreExprFloatStack(long value) -{ - ExprElt *elt = CheckExprRoom(2); - - elt->op = EXPR_FLOATSTACK; - elt[1].value = value; -} - -/*********************************************************************** - * StoreExprIdent - *********************************************************************** - * SYNOPSIS: Store an identifier - * CALLED BY: yyparse - * RETURN: Nothing - * SIDE EFFECTS: ... - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 3/ 7/89 Initial Revision - * - ***********************************************************************/ -static void -StoreExprIdent(ID id) -{ - ExprElt *elt = CheckExprRoom(2); - - curExpr->idents = 1; - - elt->op = EXPR_IDENT; - elt[1].ident = id; -} - -/*********************************************************************** - * StoreExprComma - *********************************************************************** - * SYNOPSIS: Store a comma operator in the current expression. - * CALLED BY: yyparse - * RETURN: nothing - * SIDE EFFECTS:... - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 8/15/91 Initial Revision - * - ***********************************************************************/ -static void -StoreExprComma(void) -{ - ExprElt *elt = CheckExprRoom(2); - - elt->op = EXPR_COMMA; - elt[1].value = yylineno; -} - - -/*********************************************************************** - * StoreExprSymbol - *********************************************************************** - * SYNOPSIS: Store a Symbol * in the expression - * CALLED BY: yyparse - * RETURN: Nothing - * SIDE EFFECTS: ... - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 3/ 7/89 Initial Revision - * - ***********************************************************************/ -static void -StoreExprSymbol(Symbol *sym) -{ - ExprElt *elt = CheckExprRoom(2); - - elt->op = EXPR_SYMOP; - elt[1].sym = sym; -} - -/*********************************************************************** - * StoreExprType - *********************************************************************** - * SYNOPSIS: Store a TypePtr in the expression - * CALLED BY: yyparse - * RETURN: Nothing - * SIDE EFFECTS: ... - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 3/ 7/89 Initial Revision - * - ***********************************************************************/ -static void -StoreExprType(TypePtr type) -{ - ExprElt *elt = CheckExprRoom(2); - - elt->op = EXPR_TYPE; - elt[1].type = type; -} - -/*********************************************************************** - * StoreExprReg - *********************************************************************** - * SYNOPSIS: Store some sort of register in curExpr - * CALLED BY: yyparse - * RETURN: Nothing - * SIDE EFFECTS: ... - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 3/ 7/89 Initial Revision - * - ***********************************************************************/ -static void -StoreExprReg(ExprOp regOp, int regNum) -{ - ExprElt *elt = CheckExprRoom(2); - - elt->op = regOp; - elt[1].reg = regNum; -} - - -/*********************************************************************** - * DupExpr - *********************************************************************** - * SYNOPSIS: Duplicate a portion of curExpr a specified number - * of times to implement the DUP operator. - * CALLED BY: def rule - * RETURN: Nothing - * SIDE EFFECTS: The expression is expanded. Each copy is separated from - * each other copy by EXPR_COMMA elements, the whole effect - * being as if all the elements were typed individually - * with commas between them. - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 4/ 3/89 Initial Revision - * - ***********************************************************************/ -static void -DupExpr(int numCopies, /* Number of copies to make */ - int startElt) /* Element at which to start */ -{ - ExprElt *elt, *source; - int numElts; - int copySize; - int eltsPerCopy; - - assert(numCopies > 0); - - /* - * No need to place an EXPR_COMMA element before each copy, since - * defList places one at the end... - */ - eltsPerCopy = curExpr->numElts - startElt; - copySize = eltsPerCopy * sizeof(ExprElt); - numElts = eltsPerCopy * numCopies; - - elt = CheckExprRoom(numElts); - - source = curExpr->elts+startElt; - - while(numCopies--) { - /* - * Copy in the expression. - */ - bcopy(source, elt, copySize); - /* - * Shift focus past copy - */ - elt += eltsPerCopy; - } -} - - -/*********************************************************************** - * StoreSubExpr - *********************************************************************** - * SYNOPSIS: Store a subexpression in the current expression - * CALLED BY: yyparse (EXPR token) - * RETURN: Nothing - * SIDE EFFECTS: ... - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 4/ 4/89 Initial Revision - * - ***********************************************************************/ -static void -StoreSubExpr(Expr *expr) -{ - ExprElt *elt; - Expr part; - - /* - * Deal with subexpressions that contain EXPR_COMMA, as zero-initialized - * bitfields do these days... - */ - part.elts = NULL; /* So Expr_NextPart knows this is the first - * time */ - Expr_NextPart(expr, &part, FALSE); - - elt = CheckExprRoom(part.numElts); - - bcopy(part.elts, elt, part.numElts * sizeof(ExprElt)); - curExpr->idents = curExpr->idents || part.idents; -} -#include - -#ifndef __cplusplus -#ifndef __STDC__ -#define const -#endif -#endif - - - -#define YYFINAL 980 -#define YYFLAG -32768 -#define YYNTBASE 258 - -#define YYTRANSLATE(x) ((unsigned)(x) <= 495 ? yytranslate[x] : 402) - -static const short yytranslate[] = { 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 254, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 256, 2, 2, 252, - 253, 247, 245, 255, 246, 250, 248, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 249, 2, 2, - 257, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 243, 2, 244, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 240, 2, 241, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 242, 251 -}; - -#if YYDEBUG != 0 -static const short yyprhs[] = { 0, - 0, 2, 4, 7, 9, 12, 15, 19, 21, 24, - 28, 31, 34, 37, 40, 42, 45, 48, 52, 55, - 58, 60, 63, 66, 69, 73, 77, 81, 82, 88, - 89, 95, 99, 103, 106, 108, 110, 111, 112, 114, - 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, - 138, 142, 146, 149, 151, 155, 158, 161, 163, 165, - 169, 172, 174, 176, 178, 180, 183, 184, 187, 189, - 190, 194, 196, 199, 202, 204, 208, 210, 214, 216, - 218, 219, 221, 223, 226, 228, 231, 233, 236, 239, - 242, 245, 248, 251, 254, 257, 261, 264, 267, 272, - 279, 282, 284, 288, 291, 292, 298, 299, 305, 308, - 310, 312, 315, 317, 320, 324, 326, 328, 330, 334, - 338, 342, 345, 348, 351, 356, 363, 365, 367, 371, - 375, 379, 382, 383, 388, 389, 394, 395, 399, 401, - 405, 407, 408, 411, 413, 417, 420, 422, 426, 427, - 429, 430, 437, 438, 441, 445, 451, 459, 469, 473, - 475, 478, 479, 482, 485, 489, 494, 499, 504, 506, - 510, 512, 514, 516, 518, 520, 522, 524, 526, 528, - 530, 532, 534, 536, 540, 543, 546, 549, 552, 555, - 558, 562, 566, 568, 570, 572, 576, 579, 582, 586, - 591, 593, 594, 599, 605, 608, 609, 611, 613, 614, - 617, 619, 622, 627, 634, 638, 642, 648, 652, 658, - 664, 666, 668, 670, 673, 676, 679, 683, 687, 691, - 695, 699, 703, 707, 711, 713, 715, 717, 719, 721, - 723, 725, 727, 729, 733, 737, 739, 740, 741, 742, - 745, 748, 751, 754, 757, 759, 761, 763, 765, 767, - 771, 775, 776, 782, 784, 787, 788, 795, 799, 804, - 809, 813, 815, 817, 819, 821, 823, 825, 827, 829, - 831, 833, 835, 838, 840, 843, 846, 849, 852, 855, - 858, 862, 866, 870, 874, 878, 882, 886, 889, 892, - 895, 899, 903, 907, 911, 915, 919, 923, 927, 931, - 935, 939, 942, 945, 948, 951, 954, 957, 960, 963, - 966, 969, 972, 975, 978, 981, 984, 987, 990, 992, - 997, 999, 1002, 1005, 1006, 1009, 1012, 1015, 1017, 1019, - 1021, 1023, 1025, 1027, 1030, 1034, 1036, 1040, 1042, 1044, - 1045, 1050, 1055, 1059, 1066, 1071, 1074, 1076, 1081, 1086, - 1090, 1091, 1094, 1096, 1098, 1100, 1103, 1106, 1107, 1112, - 1113, 1118, 1120, 1122, 1125, 1127, 1131, 1133, 1135, 1138, - 1141, 1143, 1144, 1147, 1148, 1153, 1154, 1162, 1166, 1167, - 1175, 1179, 1182, 1183, 1191, 1194, 1196, 1198, 1200, 1204, - 1206, 1208, 1210, 1212, 1215, 1218, 1219, 1224, 1225, 1230, - 1232, 1234, 1238, 1242, 1248, 1254, 1256, 1258, 1260, 1261, - 1265, 1269, 1271, 1273, 1275, 1279, 1280, 1282, 1285, 1287, - 1289, 1291, 1293, 1296, 1298, 1300, 1302, 1306, 1308, 1313, - 1315, 1317, 1321, 1324, 1326, 1328, 1331, 1333, 1335, 1337, - 1339, 1342, 1346, 1350, 1353, 1356, 1357, 1359, 1363, 1365, - 1367, 1369, 1371, 1376, 1381, 1386, 1391, 1396, 1399, 1404, - 1407, 1412, 1414, 1417, 1422, 1424, 1427, 1430, 1432, 1435, - 1438, 1441, 1443, 1446, 1448, 1451, 1453, 1455, 1457, 1459, - 1461, 1463, 1465, 1467, 1470, 1477, 1482, 1487, 1492, 1495, - 1498, 1501, 1506, 1511, 1513, 1516, 1519, 1522, 1527, 1532, - 1537, 1540, 1542, 1544, 1546, 1550, 1552, 1557, 1560, 1562, - 1566, 1568, 1571, 1573, 1577, 1579, 1582, 1584, 1587, 1590, - 1592, 1594, 1597, 1599, 1602, 1604, 1607, 1609, 1611, 1614, - 1616, 1618, 1620, 1625, 1628, 1630, 1632, 1639, 1646, 1649, - 1654, 1657, 1662, 1665, 1667, 1669, 1671, 1673, 1675, 1677, - 1680, 1682, 1684, 1686, 1688, 1691, 1692, 1698, 1701, 1704, - 1707, 1709, 1711, 1712, 1716, 1717, 1721, 1723, 1726, 1727, - 1731, 1733, 1736, 1741, 1744, 1746, 1748, 1750, 1752, 1754, - 1758, 1761, 1764, 1768, 1772, 1775, 1781, 1785, 1791, 1795, - 1799, 1802, 1804, 1806, 1808, 1811, 1814, 1817, 1822, 1825, - 1830, 1833, 1836 -}; - -static const short yyrhs[] = { 259, - 0, 262, 0, 259, 262, 0, 254, 0, 401, 254, - 0, 260, 254, 0, 260, 401, 254, 0, 255, 0, - 255, 260, 0, 264, 274, 254, 0, 264, 254, 0, - 263, 254, 0, 296, 254, 0, 274, 254, 0, 254, - 0, 1, 254, 0, 144, 254, 0, 144, 332, 254, - 0, 256, 262, 0, 104, 1, 0, 265, 0, 265, - 249, 0, 104, 249, 0, 111, 249, 0, 12, 137, - 249, 0, 104, 183, 328, 0, 111, 183, 328, 0, - 0, 104, 206, 268, 266, 270, 0, 0, 111, 206, - 268, 267, 270, 0, 198, 269, 277, 0, 166, 269, - 277, 0, 269, 277, 0, 41, 0, 49, 0, 0, - 0, 273, 0, 120, 0, 113, 0, 112, 0, 114, - 0, 115, 0, 116, 0, 117, 0, 118, 0, 119, - 0, 122, 0, 104, 249, 325, 0, 111, 249, 325, - 0, 271, 249, 325, 0, 249, 325, 0, 272, 0, - 273, 261, 272, 0, 111, 148, 0, 104, 148, 0, - 148, 0, 276, 0, 275, 261, 276, 0, 275, 276, - 0, 16, 0, 23, 0, 9, 0, 20, 0, 230, - 275, 0, 0, 230, 275, 0, 283, 0, 0, 283, - 278, 279, 0, 280, 0, 279, 280, 0, 75, 281, - 0, 282, 0, 281, 261, 282, 0, 332, 0, 284, - 187, 325, 0, 104, 0, 111, 0, 0, 271, 0, - 138, 0, 138, 285, 0, 139, 0, 139, 229, 0, - 177, 0, 177, 198, 0, 177, 166, 0, 177, 104, - 0, 177, 111, 0, 104, 6, 0, 109, 6, 0, - 104, 5, 0, 111, 5, 0, 111, 5, 105, 0, - 104, 286, 0, 111, 286, 0, 223, 105, 261, 336, - 0, 223, 105, 261, 336, 261, 336, 0, 130, 287, - 0, 105, 0, 105, 261, 287, 0, 213, 336, 0, - 0, 181, 104, 288, 261, 108, 0, 0, 182, 104, - 289, 261, 108, 0, 109, 290, 0, 109, 0, 291, - 0, 291, 290, 0, 107, 0, 256, 336, 0, 256, - 336, 255, 0, 5, 0, 257, 0, 332, 0, 104, - 292, 293, 0, 120, 292, 293, 0, 118, 292, 336, - 0, 104, 294, 0, 120, 294, 0, 220, 105, 0, - 179, 332, 261, 105, 0, 179, 332, 261, 105, 261, - 105, 0, 15, 0, 328, 0, 104, 295, 302, 0, - 111, 295, 302, 0, 116, 295, 302, 0, 295, 302, - 0, 0, 104, 131, 297, 300, 0, 0, 111, 131, - 298, 300, 0, 0, 131, 299, 300, 0, 301, 0, - 250, 295, 302, 0, 325, 0, 0, 111, 145, 0, - 145, 0, 178, 295, 302, 0, 329, 303, 0, 304, - 0, 303, 261, 304, 0, 0, 306, 0, 0, 306, - 141, 305, 252, 303, 253, 0, 0, 307, 337, 0, - 188, 308, 105, 0, 188, 308, 105, 261, 336, 0, - 188, 308, 105, 261, 336, 261, 336, 0, 188, 308, - 105, 261, 336, 261, 336, 261, 336, 0, 188, 308, - 69, 0, 309, 0, 111, 261, 0, 0, 170, 311, - 0, 210, 314, 0, 312, 249, 325, 0, 312, 249, - 131, 301, 0, 312, 249, 183, 166, 0, 312, 249, - 183, 198, 0, 310, 0, 311, 261, 310, 0, 104, - 0, 111, 0, 120, 0, 113, 0, 112, 0, 114, - 0, 115, 0, 116, 0, 117, 0, 118, 0, 119, - 0, 312, 0, 313, 0, 314, 261, 313, 0, 104, - 222, 0, 112, 222, 0, 112, 149, 0, 104, 228, - 0, 112, 228, 0, 112, 144, 0, 104, 211, 315, - 0, 104, 226, 325, 0, 316, 0, 317, 0, 320, - 0, 320, 255, 316, 0, 260, 318, 0, 319, 144, - 0, 320, 260, 318, 0, 320, 255, 260, 318, 0, - 104, 0, 0, 319, 249, 326, 321, 0, 319, 328, - 249, 326, 321, 0, 257, 332, 0, 0, 10, 0, - 12, 0, 0, 323, 207, 0, 323, 0, 323, 322, - 0, 323, 322, 261, 336, 0, 323, 322, 261, 336, - 261, 336, 0, 104, 136, 324, 0, 104, 150, 118, - 0, 104, 150, 118, 261, 336, 0, 111, 150, 118, - 0, 111, 150, 118, 261, 336, 0, 326, 141, 252, - 325, 253, 0, 328, 0, 12, 0, 120, 0, 235, - 111, 0, 235, 119, 0, 235, 1, 0, 326, 245, - 326, 0, 326, 246, 326, 0, 326, 247, 326, 0, - 326, 248, 326, 0, 326, 195, 326, 0, 326, 82, - 326, 0, 326, 84, 326, 0, 252, 336, 253, 0, - 112, 0, 118, 0, 119, 0, 117, 0, 124, 0, - 10, 0, 166, 0, 198, 0, 18, 0, 18, 250, - 325, 0, 18, 250, 104, 0, 327, 0, 0, 0, - 0, 329, 337, 0, 330, 337, 0, 329, 340, 0, - 330, 340, 0, 331, 337, 0, 16, 0, 23, 0, - 9, 0, 20, 0, 227, 0, 337, 249, 337, 0, - 337, 209, 337, 0, 0, 240, 328, 241, 338, 337, - 0, 327, 0, 242, 337, 0, 0, 119, 108, 339, - 252, 337, 253, 0, 243, 341, 244, 0, 337, 243, - 341, 244, 0, 243, 341, 244, 337, 0, 252, 337, - 253, 0, 105, 0, 108, 0, 115, 0, 123, 0, - 120, 0, 114, 0, 116, 0, 113, 0, 104, 0, - 111, 0, 137, 0, 225, 328, 0, 12, 0, 12, - 137, 0, 337, 218, 0, 337, 201, 0, 337, 175, - 0, 337, 190, 0, 224, 337, 0, 337, 245, 337, - 0, 337, 250, 337, 0, 337, 246, 337, 0, 337, - 247, 337, 0, 337, 248, 337, 0, 337, 195, 337, - 0, 337, 168, 337, 0, 246, 337, 0, 245, 337, - 0, 69, 337, 0, 337, 84, 337, 0, 337, 82, - 337, 0, 337, 151, 337, 0, 337, 197, 337, 0, - 337, 191, 337, 0, 337, 184, 337, 0, 337, 172, - 337, 0, 337, 169, 337, 0, 337, 36, 337, 0, - 337, 70, 337, 0, 337, 92, 337, 0, 174, 337, - 0, 189, 337, 0, 215, 337, 0, 216, 337, 0, - 217, 337, 0, 233, 337, 0, 202, 337, 0, 226, - 337, 0, 185, 337, 0, 219, 337, 0, 235, 337, - 0, 192, 337, 0, 167, 337, 0, 140, 337, 0, - 173, 337, 0, 214, 337, 0, 150, 337, 0, 24, - 0, 24, 252, 12, 253, 0, 337, 0, 342, 337, - 0, 342, 1, 0, 0, 343, 347, 0, 343, 1, - 0, 343, 200, 0, 128, 0, 216, 0, 215, 0, - 115, 0, 200, 0, 104, 0, 344, 332, 0, 20, - 249, 345, 0, 346, 0, 347, 261, 346, 0, 216, - 0, 255, 0, 0, 104, 348, 186, 349, 0, 115, - 348, 186, 349, 0, 104, 348, 351, 0, 350, 336, - 261, 336, 261, 336, 0, 350, 336, 261, 336, 0, - 350, 336, 0, 350, 0, 115, 348, 129, 336, 0, - 104, 348, 129, 336, 0, 115, 348, 351, 0, 0, - 351, 352, 0, 7, 0, 11, 0, 105, 0, 115, - 149, 0, 104, 149, 0, 0, 104, 171, 353, 356, - 0, 0, 115, 171, 354, 356, 0, 104, 0, 115, - 0, 215, 111, 0, 355, 0, 356, 261, 355, 0, - 194, 0, 221, 0, 205, 221, 0, 221, 205, 0, - 142, 0, 0, 357, 358, 0, 0, 357, 170, 360, - 358, 0, 0, 104, 359, 113, 361, 261, 365, 277, - 0, 104, 359, 1, 0, 0, 111, 359, 113, 362, - 261, 365, 277, 0, 111, 359, 1, 0, 132, 113, - 0, 0, 359, 364, 261, 113, 363, 261, 365, 0, - 359, 1, 0, 111, 0, 104, 0, 366, 0, 365, - 261, 366, 0, 114, 0, 135, 0, 212, 0, 1, - 0, 111, 147, 0, 104, 147, 0, 0, 104, 132, - 367, 369, 0, 0, 113, 132, 368, 369, 0, 113, - 0, 12, 0, 113, 261, 193, 0, 113, 261, 232, - 0, 113, 261, 193, 261, 232, 0, 113, 261, 232, - 261, 193, 0, 1, 0, 205, 0, 134, 0, 0, - 104, 357, 370, 0, 104, 357, 371, 0, 118, 0, - 114, 0, 104, 0, 104, 231, 372, 0, 0, 325, - 0, 207, 373, 0, 122, 0, 104, 0, 208, 0, - 134, 0, 134, 375, 0, 116, 0, 1, 0, 374, - 0, 375, 261, 374, 0, 332, 0, 332, 252, 333, - 253, 0, 1, 0, 376, 0, 377, 261, 376, 0, - 199, 377, 0, 205, 0, 22, 0, 230, 380, 0, - 379, 0, 113, 0, 104, 0, 378, 0, 380, 378, - 0, 380, 261, 378, 0, 104, 164, 332, 0, 113, - 145, 0, 113, 381, 0, 0, 332, 0, 332, 261, - 333, 0, 37, 0, 36, 0, 70, 0, 92, 0, - 382, 332, 261, 333, 0, 38, 332, 261, 333, 0, - 39, 332, 261, 333, 0, 40, 332, 261, 333, 0, - 41, 332, 261, 333, 0, 41, 332, 0, 42, 332, - 261, 333, 0, 42, 332, 0, 43, 332, 261, 333, - 0, 95, 0, 95, 334, 0, 95, 334, 261, 335, - 0, 96, 0, 96, 334, 0, 99, 334, 0, 93, - 0, 94, 332, 0, 100, 332, 0, 101, 334, 0, - 102, 0, 102, 334, 0, 98, 0, 383, 332, 0, - 44, 0, 69, 0, 66, 0, 68, 0, 67, 0, - 63, 0, 65, 0, 64, 0, 45, 332, 0, 45, - 332, 261, 333, 261, 336, 0, 45, 332, 261, 333, - 0, 46, 332, 261, 333, 0, 47, 332, 261, 333, - 0, 48, 332, 0, 49, 332, 0, 50, 332, 0, - 51, 332, 261, 333, 0, 52, 332, 261, 333, 0, - 53, 0, 55, 332, 0, 56, 332, 0, 57, 332, - 0, 58, 332, 261, 333, 0, 59, 332, 261, 333, - 0, 60, 332, 261, 333, 0, 60, 332, 0, 61, - 0, 62, 0, 385, 0, 385, 20, 249, 0, 384, - 0, 72, 332, 261, 333, 0, 73, 386, 0, 387, - 0, 387, 261, 386, 0, 332, 0, 75, 388, 0, - 389, 0, 388, 261, 389, 0, 332, 0, 74, 332, - 0, 390, 0, 390, 274, 0, 329, 391, 0, 76, - 0, 54, 0, 20, 249, 0, 77, 0, 77, 332, - 0, 392, 0, 392, 332, 0, 79, 0, 78, 0, - 80, 332, 0, 81, 0, 82, 0, 84, 0, 393, - 332, 261, 333, 0, 393, 332, 0, 9, 0, 336, - 0, 83, 332, 261, 333, 261, 394, 0, 85, 332, - 261, 333, 261, 394, 0, 86, 332, 0, 87, 332, - 261, 333, 0, 88, 332, 0, 89, 332, 261, 333, - 0, 90, 332, 0, 90, 0, 14, 0, 21, 0, - 17, 0, 8, 0, 165, 0, 165, 332, 0, 229, - 0, 19, 0, 13, 0, 180, 0, 127, 332, 0, - 0, 127, 332, 395, 261, 105, 0, 396, 7, 0, - 396, 336, 0, 396, 1, 0, 161, 0, 126, 0, - 0, 203, 397, 105, 0, 0, 234, 398, 105, 0, - 106, 0, 204, 332, 0, 0, 71, 399, 105, 0, - 196, 0, 400, 3, 0, 400, 3, 261, 4, 0, - 400, 1, 0, 236, 0, 237, 0, 238, 0, 239, - 0, 401, 0, 32, 331, 337, 0, 33, 331, 0, - 34, 331, 0, 31, 105, 331, 0, 26, 104, 331, - 0, 26, 331, 0, 27, 105, 255, 105, 331, 0, - 28, 331, 337, 0, 29, 105, 255, 105, 331, 0, - 30, 105, 331, 0, 25, 104, 331, 0, 25, 331, - 0, 143, 0, 146, 0, 152, 0, 152, 105, 0, - 153, 105, 0, 154, 104, 0, 155, 105, 255, 105, - 0, 156, 336, 0, 157, 105, 255, 105, 0, 158, - 105, 0, 159, 104, 0, 160, 336, 0 -}; - -#endif - -#if YYDEBUG != 0 -static const short yyrline[] = { 0, - 1089, 1098, 1102, 1111, 1112, 1113, 1114, 1116, 1117, 1119, - 1120, 1121, 1122, 1123, 1124, 1125, 1129, 1136, 1148, 1157, - 1171, 1172, 1180, 1191, 1201, 1228, 1245, 1263, 1271, 1271, - 1278, 1279, 1280, 1281, 1296, 1297, 1298, 1301, 1302, 1305, - 1305, 1305, 1305, 1305, 1306, 1306, 1306, 1306, 1306, 1308, - 1312, 1320, 1326, 1336, 1337, 1340, 1358, 1364, 1381, 1382, - 1383, 1385, 1387, 1388, 1389, 1391, 1405, 1406, 1408, 1409, - 1450, 1460, 1461, 1463, 1472, 1473, 1482, 1516, 1546, 1547, - 1555, 1556, 1564, 1575, 1594, 1606, 1622, 1635, 1651, 1667, - 1677, 1697, 1702, 1714, 1723, 1732, 1758, 1762, 1767, 1799, - 1838, 1847, 1867, 1893, 1894, 1894, 1903, 1903, 1913, 1914, - 1921, 1922, 1924, 1935, 1958, 1991, 1992, 1994, 2026, 2030, - 2054, 2062, 2066, 2077, 2086, 2109, 2183, 2199, 2260, 2269, - 2278, 2284, 2300, 2315, 2315, 2358, 2358, 2371, 2373, 2382, - 2412, 2413, 2415, 2440, 2459, 2519, 2524, 2525, 2530, 2546, - 2574, 2624, 2651, 2659, 2672, 2679, 2687, 2696, 2706, 2719, - 2741, 2750, 2769, 2776, 2781, 2877, 2919, 2934, 2950, 2951, - 2958, 2962, 2975, 2988, 3001, 3002, 3003, 3004, 3005, 3006, - 3007, 3009, 3034, 3035, 3043, 3052, 3074, 3089, 3093, 3115, - 3133, 3203, 3208, 3209, 3216, 3221, 3234, 3236, 3237, 3246, - 3261, 3262, 3264, 3270, 3276, 3280, 3293, 3294, 3296, 3300, - 3309, 3316, 3323, 3330, 3341, 3346, 3355, 3364, 3383, 3412, - 3416, 3423, 3427, 3446, 3455, 3467, 3476, 3477, 3478, 3479, - 3489, 3499, 3503, 3507, 3513, 3514, 3515, 3516, 3517, 3518, - 3528, 3529, 3530, 3532, 3533, 3546, 3554, 3555, 3556, 3568, - 3569, 3570, 3571, 3572, 3636, 3644, 3662, 3674, 3675, 3686, - 3687, 3691, 3692, 3695, 3696, 3697, 3708, 3712, 3713, 3714, - 3715, 3716, 3721, 3726, 3727, 3728, 3729, 3743, 3757, 3758, - 3759, 3760, 3778, 3787, 3788, 3807, 3808, 3809, 3810, 3811, - 3812, 3813, 3814, 3815, 3816, 3817, 3818, 3819, 3820, 3821, - 3822, 3823, 3824, 3825, 3826, 3827, 3828, 3829, 3830, 3831, - 3832, 3833, 3834, 3835, 3836, 3837, 3838, 3839, 3840, 3841, - 3842, 3843, 3844, 3845, 3846, 3847, 3848, 3849, 3851, 3852, - 3853, 3855, 3856, 3858, 3869, 3873, 3877, 3888, 3893, 3893, - 3894, 3895, 3896, 3911, 3935, 3949, 3950, 3952, 3957, 3957, - 3958, 3975, 3993, 4011, 4022, 4032, 4043, 4054, 4066, 4076, - 4156, 4165, 4192, 4196, 4200, 4208, 4244, 4261, 4262, 4262, - 4271, 4280, 4284, 4292, 4297, 4308, 4328, 4333, 4334, 4335, - 4336, 4337, 4340, 4345, 4346, 4354, 4372, 4376, 4393, 4427, - 4431, 4448, 4470, 4482, 4488, 4494, 4508, 4524, 4525, 4527, - 4547, 4562, 4576, 4588, 4609, 4618, 4624, 4643, 4649, 4671, - 4681, 4695, 4700, 4709, 4714, 4719, 4736, 4740, 4744, 4753, - 4776, 4840, 4841, 4851, 4873, 4892, 4893, 4896, 4902, 4906, - 4962, 4972, 4986, 4988, 4992, 5028, 5029, 5031, 5050, 5061, - 5097, 5098, 5100, 5105, 5109, 5114, 5116, 5142, 5143, 5152, - 5153, 5154, 5156, 5165, 5188, 5200, 5204, 5209, 5222, 5222, - 5222, 5222, 5223, 5227, 5231, 5235, 5239, 5243, 5247, 5251, - 5255, 5260, 5264, 5268, 5272, 5276, 5280, 5284, 5288, 5292, - 5296, 5300, 5304, 5308, 5312, 5317, 5317, 5318, 5318, 5318, - 5319, 5319, 5319, 5320, 5324, 5328, 5332, 5336, 5340, 5344, - 5348, 5352, 5356, 5360, 5364, 5368, 5372, 5377, 5382, 5386, - 5390, 5394, 5399, 5404, 5409, 5422, 5426, 5430, 5432, 5437, - 5443, 5449, 5451, 5452, 5454, 5459, 5464, 5465, 5473, 5485, - 5486, 5487, 5498, 5530, 5542, 5546, 5551, 5552, 5554, 5559, - 5560, 5561, 5563, 5567, 5578, 5587, 5597, 5601, 5605, 5609, - 5613, 5618, 5622, 5626, 5636, 5637, 5638, 5639, 5640, 5641, - 5661, 5662, 5667, 5672, 5677, 5681, 5681, 5685, 5736, 5785, - 5789, 5808, 5813, 5814, 5839, 5840, 5905, 5915, 5967, 5968, - 5974, 5979, 5984, 5990, 5999, 6005, 6011, 6017, 6029, 6031, - 6036, 6044, 6052, 6059, 6065, 6076, 6084, 6091, 6099, 6106, - 6112, 6118, 6140, 6150, 6151, 6157, 6165, 6172, 6181, 6188, - 6197, 6206, 6213 -}; -#endif - - -#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) - -static const char * const yytname[] = { "$","error","$undefined.","MEMMODEL", -"LANGUAGE","EQU","MACRO","ALIGNMENT","BREAK","BYTEREG","CAST","COMBINE","CONSTANT", -"COPROCESSOR","DEBUG","DEF","DWORDREG","MASM","PNTR","PROCESSOR","SEGREG","SHOWM", -"STATE","WORDREG","ST","IFNDEF","IFDEF","IFDIF","IFE","IFIDN","IFNB","IFB","IF", -"IF1","IF2","FIRSTOP","AND","ARITH2","ARPL","BITNF","BOUND","CALL","CMPS","ENTER", -"GROUP1","IMUL","IO","INS","INT","JMP","JUMP","LDPTR","LEA","LEAVE","LOCK","LODS", -"LOOP","LSDT","LSINFO","MOV","MOVS","NAIO","NAPRIV","NASTRG","NASTRGD","NASTRGW", -"NOARG","NOARGD","NOARGW","NOT","OR","OPCODE","OUTS","POP","PWORD","PUSH","REP", -"RET","RETF","RETN","SCAS","SHIFT","SHL","SHLD","SHR","SHRD","STOS","TEST","WREG1", -"XCHG","XLAT","XLATB","XOR","FGROUP0","FGROUP1","FBIOP","FCOM","FUOP","FZOP", -"FFREE","FINT","FLDST","FXCH","LASTOP","IDENT","STRING","PCTOUT","MACARG","STRUCT_INIT", -"MACEXEC","FIRSTSYM","SYM","STRUCT_SYM","CLASS_SYM","METHOD_SYM","MODULE_SYM", -"INSTVAR_SYM","TYPE_SYM","ETYPE_SYM","RECORD_SYM","EXPR_SYM","LASTSYM","PROTOMINOR_SYM", -"EXPR","PTYPE","ABS","ALIGN","ASSERT","ASSUME","AT","CATSTR","CHUNK","CLASS", -"COMMENT","CPUBLIC","DEFAULT","DEFETYPE","DOT","DOTENTER","DOTLEAVE","DOTTYPE", -"DUP","DYNAMIC","ELSE","END","ENDC","ENDIF","ENDM","ENDP","ENDS","ENUM","EQ", -"ERR","ERRB","ERRDEF","ERRDIF","ERRE","ERRIDN","ERRNB","ERRNDEF","ERRNZ","EVEN", -"EXITF","EXITM","EXPORT","FALLTHRU","FAR","FIRST","FLDMASK","GE","GLOBAL","GROUP", -"GT","HANDLE","HIGH","HIGHPART","INCLUDE","INHERIT","INST","INSTR","IOENABLE", -"IRP","IRPC","LABEL","LE","LENGTH","LMEM","LOCAL","LOCALIZE","LOW","LOWPART", -"LT","MASK","MASTER","METHOD","MOD","MODEL","NE","NEAR","NORELOC","NOTHING", -"OFFPART","OFFSET","ON_STACK","ORG","PRIVATE","PROC","PROTOMINOR","PROTORESET", -"PTR","PUBLIC","RECORD","RELOC","REPT","RESID","SEG","SEGMENT","SEGREGOF","SEGPART", -"SIZE","SIZESTR","STATIC","STRUC","SUBSTR","SUPER","THIS","TYPE","UNDEF","UNION", -"UNREACHED","USES","VARDATA","VARIANT","VSEG","WARN","WIDTH","WRITECHECK","NOWRITECHECK", -"READCHECK","NOREADCHECK","'{'","'}'","SHORT","'['","']'","'+'","'-'","'*'", -"'/'","':'","'.'","UNARY","'('","')'","'\\n'","','","'%'","'='","errcheck","file", -"multiEOL","flexiComma","line","labeled_op","ref_label","label","@1","@2","procArgs1", -"procCallFlag","procArgsArgDeclStart","sym","procArg","procArgsArgDecls","op", -"usesArgs","usesReg","procUsesArgs","@3","pushLocals","pushLocal","pushLocalOperandList", -"pushLocalOperand","localDecl","localID","inherit","strop","catstrargs","@4", -"@5","macroArgList","macroArg","equ","equ_value","numstrop","defT","dataDef", -"@6","@7","@8","chunkDef","chunktype","defArgs","defList","def","@9","def2", -"@10","locOptChunkSym","optChunkSym","globalDef","globalDefs","globalSym","pubSym", -"pubDefs","recordDefs","recordLineDef","recordMLineDef","recordMLineBody","recordFieldName", -"recordField","recordFieldVal","etypeSize","etypeFlags","etypeArgs","fulltype", -"lexpr","optype","type","setExpr1","setExpr2","setTExpr","operand1","operand2", -"foperand1","foperand2","cexpr","operand","@11","@12","foperand","indir","indirStart", -"assume","assumeSegSegOp","assumeSeg","assumeArg","assumeArgs","segment","optComma", -"lmemSegDef","segAttrs","segAttr","@13","@14","groupElement","groupList","method", -"methodStatic","methodDecl","@15","@16","@17","@18","extMethodSym","methodList", -"methodListItem","@19","@20","classDeclArgs","methodFlags","rangeSym","vardataType", -"protoMinorSym","cpubDef","cpubDefs","nrDef","nrDefs","classUsesArg","classUsesSym", -"classUsesArgs","classDefArgs","arith2Inst","group1Inst","noArgInst","naStrgInst", -"popOperandList","popOperand","pushOperandList","pushOperand","prefix","prefixInst", -"retInst","shiftInst","CLorCexpr","@21","align","@22","@23","@24","model","conditional", NULL -}; -#endif - -static const short yyr1[] = { 0, - 258, 259, 259, 260, 260, 260, 260, 261, 261, 262, - 262, 262, 262, 262, 262, 262, 262, 262, 262, 263, - 264, 264, 265, 265, 265, 263, 263, 266, 263, 267, - 263, 268, 268, 268, 269, 269, 269, 270, 270, 271, - 271, 271, 271, 271, 271, 271, 271, 271, 271, 272, - 272, 272, 272, 273, 273, 263, 263, 274, 275, 275, - 275, 276, 276, 276, 276, 274, 277, 277, 263, 278, - 263, 279, 279, 280, 281, 281, 282, 283, 284, 284, - 284, 284, 274, 274, 274, 274, 285, 285, 285, 285, - 285, 263, 263, 263, 263, 263, 263, 263, 286, 286, - 286, 287, 287, 274, 288, 274, 289, 274, 274, 274, - 290, 290, 291, 291, 291, 292, 292, 293, 263, 263, - 263, 263, 263, 294, 294, 294, 295, 295, 296, 296, - 296, 296, 297, 263, 298, 263, 299, 263, 300, 300, - 301, 301, 263, 274, 274, 302, 303, 303, 304, 304, - 305, 304, 307, 306, 274, 274, 274, 274, 274, 308, - 309, 309, 274, 274, 310, 310, 310, 310, 311, 311, - 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, - 312, 313, 314, 314, 263, 263, 263, 263, 263, 263, - 263, 263, 315, 315, 316, 316, 317, 318, 318, 318, - 319, 319, 320, 320, 321, 321, 322, 322, 323, 323, - 324, 324, 324, 324, 263, 263, 263, 263, 263, 325, - 325, 326, 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 327, 327, 327, 327, 327, 327, - 327, 327, 327, 328, 328, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 337, 337, 337, 337, 337, - 337, 338, 337, 337, 337, 339, 337, 337, 337, 337, - 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, - 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, - 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, - 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, - 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, - 337, 337, 337, 337, 337, 337, 337, 337, 340, 340, - 340, 341, 341, 342, 274, 274, 274, 343, 344, 344, - 345, 345, 345, 345, 346, 347, 347, 348, 349, 349, - 350, 350, 263, 263, 263, 263, 263, 263, 263, 263, - 351, 351, 352, 352, 352, 263, 263, 353, 263, 354, - 263, 355, 355, 355, 356, 356, 357, 358, 358, 358, - 358, 358, 359, 360, 359, 361, 263, 263, 362, 263, - 263, 263, 363, 274, 274, 364, 364, 365, 365, 366, - 366, 366, 366, 263, 263, 367, 263, 368, 263, 369, - 369, 369, 369, 369, 369, 369, 370, 370, 370, 263, - 263, 371, 371, 371, 263, 372, 372, 263, 373, 373, - 263, 274, 274, 374, 374, 375, 375, 376, 376, 376, - 377, 377, 274, 274, 274, 274, 378, 379, 379, 380, - 380, 380, 263, 263, 274, 381, 381, 381, 382, 382, - 382, 382, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 383, 383, 384, 384, 384, - 385, 385, 385, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 386, 386, - 387, 274, 388, 388, 389, 274, 274, 274, 390, 391, - 391, 391, 274, 274, 274, 274, 392, 392, 274, 393, - 393, 393, 274, 274, 394, 394, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 395, 274, 274, 274, 274, - 274, 396, 397, 274, 398, 274, 274, 274, 399, 274, - 400, 274, 274, 274, 274, 274, 274, 274, 274, 401, - 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, - 401, 401, 401, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274 -}; - -static const short yyr2[] = { 0, - 1, 1, 2, 1, 2, 2, 3, 1, 2, 3, - 2, 2, 2, 2, 1, 2, 2, 3, 2, 2, - 1, 2, 2, 2, 3, 3, 3, 0, 5, 0, - 5, 3, 3, 2, 1, 1, 0, 0, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, - 3, 3, 2, 1, 3, 2, 2, 1, 1, 3, - 2, 1, 1, 1, 1, 2, 0, 2, 1, 0, - 3, 1, 2, 2, 1, 3, 1, 3, 1, 1, - 0, 1, 1, 2, 1, 2, 1, 2, 2, 2, - 2, 2, 2, 2, 2, 3, 2, 2, 4, 6, - 2, 1, 3, 2, 0, 5, 0, 5, 2, 1, - 1, 2, 1, 2, 3, 1, 1, 1, 3, 3, - 3, 2, 2, 2, 4, 6, 1, 1, 3, 3, - 3, 2, 0, 4, 0, 4, 0, 3, 1, 3, - 1, 0, 2, 1, 3, 2, 1, 3, 0, 1, - 0, 6, 0, 2, 3, 5, 7, 9, 3, 1, - 2, 0, 2, 2, 3, 4, 4, 4, 1, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 3, 2, 2, 2, 2, 2, 2, - 3, 3, 1, 1, 1, 3, 2, 2, 3, 4, - 1, 0, 4, 5, 2, 0, 1, 1, 0, 2, - 1, 2, 4, 6, 3, 3, 5, 3, 5, 5, - 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, - 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 3, 3, 1, 0, 0, 0, 2, - 2, 2, 2, 2, 1, 1, 1, 1, 1, 3, - 3, 0, 5, 1, 2, 0, 6, 3, 4, 4, - 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 1, 2, 2, 2, 2, 2, 2, - 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 1, 4, - 1, 2, 2, 0, 2, 2, 2, 1, 1, 1, - 1, 1, 1, 2, 3, 1, 3, 1, 1, 0, - 4, 4, 3, 6, 4, 2, 1, 4, 4, 3, - 0, 2, 1, 1, 1, 2, 2, 0, 4, 0, - 4, 1, 1, 2, 1, 3, 1, 1, 2, 2, - 1, 0, 2, 0, 4, 0, 7, 3, 0, 7, - 3, 2, 0, 7, 2, 1, 1, 1, 3, 1, - 1, 1, 1, 2, 2, 0, 4, 0, 4, 1, - 1, 3, 3, 5, 5, 1, 1, 1, 0, 3, - 3, 1, 1, 1, 3, 0, 1, 2, 1, 1, - 1, 1, 2, 1, 1, 1, 3, 1, 4, 1, - 1, 3, 2, 1, 1, 2, 1, 1, 1, 1, - 2, 3, 3, 2, 2, 0, 1, 3, 1, 1, - 1, 1, 4, 4, 4, 4, 4, 2, 4, 2, - 4, 1, 2, 4, 1, 2, 2, 1, 2, 2, - 2, 1, 2, 1, 2, 1, 1, 1, 1, 1, - 1, 1, 1, 2, 6, 4, 4, 4, 2, 2, - 2, 4, 4, 1, 2, 2, 2, 4, 4, 4, - 2, 1, 1, 1, 3, 1, 4, 2, 1, 3, - 1, 2, 1, 3, 1, 2, 1, 2, 2, 1, - 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, - 1, 1, 4, 2, 1, 1, 6, 6, 2, 4, - 2, 4, 2, 1, 1, 1, 1, 1, 1, 2, - 1, 1, 1, 1, 2, 0, 5, 2, 2, 2, - 1, 1, 0, 3, 0, 3, 1, 2, 0, 3, - 1, 2, 4, 2, 1, 1, 1, 1, 1, 3, - 2, 2, 3, 3, 2, 5, 3, 5, 3, 3, - 2, 1, 1, 1, 2, 2, 2, 4, 2, 4, - 2, 2, 2 -}; - -static const short yydefact[] = { 0, - 0, 558, 240, 0, 563, 555, 127, 557, 243, 562, - 556, 445, 249, 249, 0, 249, 0, 0, 0, 249, - 249, 249, 460, 459, 247, 247, 247, 247, 247, 247, - 486, 247, 247, 247, 247, 247, 247, 247, 247, 504, - 247, 247, 247, 247, 247, 247, 512, 513, 491, 493, - 492, 488, 490, 489, 487, 461, 579, 247, 247, 247, - 247, 247, 538, 537, 247, 540, 541, 247, 542, 247, - 247, 247, 247, 247, 247, 462, 478, 247, 247, 247, - 484, 247, 247, 247, 247, 0, 577, 110, 80, 235, - 247, 43, 44, 45, 238, 236, 237, 40, 49, 239, - 572, 247, 338, 137, 0, 0, 83, 85, 602, 247, - 144, 603, 58, 604, 0, 0, 0, 249, 0, 0, - 0, 249, 571, 247, 241, 0, 0, 564, 0, 0, - 162, 377, 581, 242, 0, 573, 247, 444, 0, 431, - 0, 249, 561, 0, 575, 585, 586, 587, 588, 15, - 0, 0, 2, 0, 247, 21, 82, 0, 69, 0, - 247, 0, 246, 128, 0, 0, 249, 382, 0, 247, - 247, 516, 514, 247, 247, 247, 0, 0, 589, 16, - 0, 0, 249, 601, 249, 595, 0, 0, 0, 249, - 249, 0, 591, 592, 0, 0, 0, 0, 468, 470, - 0, 494, 0, 0, 499, 500, 501, 0, 0, 505, - 506, 507, 0, 0, 511, 0, 0, 521, 518, 519, - 526, 525, 522, 523, 534, 539, 0, 0, 549, 0, - 551, 0, 553, 479, 0, 473, 476, 477, 480, 481, - 483, 20, 116, 92, 235, 238, 236, 237, 0, 133, - 406, 209, 405, 57, 367, 0, 247, 368, 247, 0, - 37, 202, 348, 0, 185, 0, 0, 188, 426, 23, - 117, 97, 247, 122, 247, 361, 382, 0, 93, 113, - 249, 109, 111, 95, 135, 143, 404, 56, 0, 0, - 37, 24, 98, 247, 0, 190, 187, 186, 189, 408, - 454, 457, 455, 366, 370, 361, 247, 116, 249, 247, - 123, 565, 142, 392, 435, 434, 436, 433, 87, 84, - 86, 17, 0, 605, 606, 607, 0, 0, 609, 0, - 611, 612, 613, 560, 171, 172, 175, 174, 176, 177, - 178, 179, 180, 181, 173, 169, 163, 0, 247, 105, - 107, 0, 0, 160, 440, 438, 441, 443, 0, 578, - 430, 429, 428, 182, 183, 164, 104, 64, 62, 65, - 63, 449, 448, 66, 59, 450, 447, 446, 0, 19, - 3, 12, 110, 247, 11, 0, 22, 14, 0, 0, - 132, 153, 13, 0, 531, 530, 529, 336, 0, 337, - 346, 335, 356, 381, 384, 0, 378, 383, 395, 397, - 396, 0, 0, 485, 0, 528, 536, 544, 570, 568, - 569, 584, 582, 25, 222, 245, 223, 0, 249, 244, - 0, 221, 600, 594, 0, 257, 284, 255, 243, 258, - 256, 0, 280, 272, 273, 281, 279, 277, 274, 278, - 237, 276, 275, 282, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 259, 0, 0, 0, 0, 334, 0, 0, 0, - 264, 597, 0, 599, 593, 590, 250, 8, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 580, 248, 247, 247, 248, 248, 248, 248, - 329, 331, 252, 248, 102, 101, 142, 0, 211, 215, - 216, 453, 0, 0, 26, 35, 36, 37, 37, 28, - 67, 201, 4, 202, 191, 193, 194, 0, 195, 0, - 124, 0, 192, 427, 425, 119, 118, 129, 249, 350, - 353, 424, 423, 422, 418, 417, 420, 421, 388, 386, - 114, 112, 96, 142, 218, 27, 30, 130, 391, 389, - 0, 248, 0, 249, 350, 360, 131, 121, 120, 0, - 0, 138, 139, 141, 0, 90, 91, 89, 88, 18, - 0, 254, 0, 0, 0, 145, 0, 0, 161, 159, - 155, 248, 0, 574, 0, 0, 61, 0, 451, 576, - 10, 247, 71, 72, 78, 146, 147, 150, 0, 532, - 0, 0, 249, 382, 379, 380, 0, 248, 515, 248, - 0, 226, 224, 225, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 249, 285, 300, 266, 325, 328, 324, - 326, 312, 320, 313, 323, 318, 327, 314, 315, 316, - 321, 290, 283, 319, 317, 322, 0, 265, 0, 0, - 299, 298, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 288, 0, 289, 0, 0, 0, 287, 0, - 286, 334, 0, 0, 0, 0, 0, 0, 249, 9, - 0, 464, 465, 466, 467, 469, 471, 496, 497, 498, - 502, 503, 508, 509, 510, 517, 520, 524, 0, 0, - 550, 552, 0, 0, 474, 0, 134, 416, 411, 410, - 407, 207, 208, 210, 212, 249, 372, 373, 0, 375, - 369, 0, 67, 67, 38, 0, 34, 6, 197, 0, - 0, 0, 0, 0, 202, 5, 249, 359, 349, 351, - 363, 364, 365, 362, 0, 115, 136, 249, 38, 0, - 409, 458, 371, 358, 352, 0, 247, 437, 608, 610, - 170, 142, 0, 165, 0, 0, 249, 0, 442, 184, - 60, 452, 74, 75, 77, 73, 153, 151, 154, 343, - 341, 342, 340, 339, 247, 345, 347, 355, 385, 393, - 463, 543, 583, 234, 232, 233, 0, 231, 227, 228, - 229, 230, 596, 0, 262, 268, 333, 332, 271, 309, - 310, 302, 301, 311, 303, 297, 308, 307, 306, 305, - 296, 304, 261, 0, 291, 293, 294, 295, 260, 292, - 598, 251, 249, 249, 249, 0, 253, 103, 0, 249, - 217, 374, 0, 125, 33, 32, 0, 0, 42, 41, - 44, 45, 46, 47, 48, 40, 0, 29, 0, 54, - 39, 68, 198, 0, 202, 7, 206, 0, 196, 99, - 0, 219, 31, 0, 567, 140, 166, 167, 168, 106, - 108, 156, 439, 247, 148, 0, 344, 249, 0, 0, - 0, 0, 270, 269, 495, 545, 546, 547, 548, 330, - 412, 413, 213, 376, 0, 0, 0, 53, 0, 0, - 202, 199, 247, 203, 206, 249, 403, 400, 401, 402, - 67, 398, 67, 249, 76, 153, 354, 0, 220, 0, - 263, 0, 0, 249, 126, 50, 51, 52, 55, 200, - 205, 204, 100, 0, 387, 390, 157, 0, 394, 267, - 414, 415, 214, 399, 249, 152, 158, 0, 0, 0 -}; - -static const short yydefgoto[] = { 978, - 152, 534, 964, 153, 154, 155, 156, 745, 769, 530, - 531, 878, 157, 880, 881, 158, 374, 375, 747, 389, - 613, 614, 793, 794, 159, 160, 320, 272, 516, 597, - 598, 282, 283, 273, 546, 274, 161, 162, 517, 564, - 313, 582, 583, 391, 616, 617, 906, 618, 619, 353, - 354, 346, 347, 348, 365, 366, 535, 536, 537, 749, - 750, 751, 934, 735, 519, 520, 584, 431, 481, 432, - 195, 701, 328, 218, 702, 236, 725, 917, 512, 912, - 824, 513, 669, 670, 166, 805, 806, 401, 402, 276, - 760, 167, 551, 764, 523, 573, 740, 741, 168, 408, - 169, 624, 765, 770, 909, 412, 941, 942, 518, 571, - 731, 557, 558, 545, 363, 317, 318, 357, 358, 376, - 377, 378, 303, 170, 171, 172, 173, 219, 220, 223, - 224, 174, 397, 175, 176, 918, 580, 177, 359, 379, - 216, 178, 179 -}; - -static const short yypact[] = { 1625, - -155,-32768,-32768, 5,-32768,-32768,-32768,-32768, -124,-32768, --32768,-32768, 97, 134, 92,-32768, 113, 143, 149,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768, 12,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768, 24,-32768,-32768,-32768, 40, 67, --32768,-32768,-32768,-32768, 87, 1392,-32768, 33, 225, 63, - -39,-32768, -21, 676, 72, 30, 101, -1,-32768,-32768, --32768,-32768,-32768,-32768, 201, 7, 154, 129,-32768, 117, --32768,-32768,-32768, 262, 269, 272, 273,-32768, 287, 288, - 285,-32768,-32768, 140,-32768, 986, 676,-32768, 292, 302, - 296,-32768,-32768,-32768, 1982,-32768,-32768,-32768, 124,-32768, - 986,-32768,-32768, 123,-32768,-32768,-32768,-32768,-32768,-32768, - 1625, 1196,-32768, 164, 2370, 168,-32768, 167, 349, 235, --32768, 171,-32768,-32768, 221, 64, 172, -29, 77,-32768, --32768,-32768, 407, 2604, 174,-32768, 1830, 156,-32768,-32768, - 181, 347,-32768,-32768,-32768,-32768, 177, 2933, 178,-32768, --32768, 2933,-32768,-32768, 2933, 180, 180, 180, 180, 180, - 180, 180, 180, 180,-32768,-32768,-32768, 180, 180,-32768, --32768,-32768, 180, 180, 180, 332, 180,-32768,-32768, 180, --32768,-32768, 180,-32768,-32768,-32768, 180, 180,-32768, 180, --32768, 180,-32768,-32768, 2781, 180,-32768,-32768,-32768,-32768, --32768,-32768, 184,-32768,-32768,-32768,-32768,-32768, 334,-32768, --32768,-32768,-32768,-32768,-32768, 322,-32768,-32768,-32768, 489, - 36, 695,-32768, 336,-32768, 341, 424,-32768, 424,-32768, --32768,-32768,-32768,-32768,-32768, -24, 384, 81,-32768,-32768, --32768,-32768, -33, 342,-32768,-32768,-32768,-32768, 338, 489, - 36,-32768,-32768,-32768, 91,-32768,-32768,-32768,-32768,-32768, --32768, 180,-32768,-32768,-32768, -11,-32768,-32768,-32768,-32768, --32768, 195, 443,-32768,-32768,-32768,-32768, 180, 34,-32768, --32768,-32768, 203,-32768,-32768,-32768, 207, 2933,-32768, 208, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768, 180, 209,-32768,-32768, --32768, 180, 120,-32768,-32768, 217,-32768, 180, 376,-32768, --32768,-32768,-32768,-32768,-32768, 180,-32768,-32768,-32768,-32768, --32768,-32768,-32768, 28,-32768,-32768,-32768, -42, 377,-32768, --32768,-32768, -33, 229,-32768, 230,-32768,-32768, 410, 424, --32768, -85,-32768, 238,-32768,-32768,-32768,-32768, 240,-32768, --32768, 180, 180,-32768,-32768, 271, 298,-32768,-32768,-32768, --32768, 180, 180,-32768, 241,-32768,-32768, 180,-32768,-32768, --32768,-32768, 180,-32768,-32768,-32768,-32768, 66,-32768,-32768, - 155,-32768,-32768,-32768, 396,-32768, 369,-32768,-32768,-32768, --32768, 2933,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - 404,-32768,-32768,-32768, 2933, 2933, 2933, 2933, 2933, 2933, - 2933, 2933, 2933, 2933, 2933, 2933, 2933, 2933, 2933, 489, - 2933,-32768, 2933, 2933, 489, 2933,-32768, 2933, 2933, 2933, --32768, 3209, 411,-32768,-32768, 3209, 3209, 821,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - 267, 3209,-32768,-32768, 180,-32768, 443, 96, 69,-32768, - 180,-32768, 6, 180,-32768,-32768,-32768, 150, 150,-32768, - 291,-32768,-32768, 740,-32768,-32768,-32768, 468, 268, 270, --32768, 180,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 280, - 160,-32768,-32768,-32768,-32768, 271,-32768,-32768,-32768,-32768, - 282,-32768,-32768, 443, 180,-32768,-32768,-32768,-32768,-32768, - 96,-32768, 6,-32768, 280, 160,-32768,-32768,-32768, 180, - 676,-32768,-32768,-32768, 74,-32768,-32768,-32768,-32768,-32768, - 423, 3209, 442, 986, 162,-32768, 180, 180,-32768,-32768, - 180,-32768, 1982,-32768, 986, 389,-32768, 60,-32768,-32768, --32768,-32768, 410,-32768,-32768, 180,-32768, 398, 2933,-32768, - 295, 529,-32768, 103,-32768,-32768, 437,-32768,-32768,-32768, - 553,-32768,-32768,-32768, 306, 88, 88, 313, 88, 88, - 88, 88, 88,-32768,-32768, 1287,-32768, 3354, 316, 316, - 316, 86, 316, 86, 316, 86, 316, 86, 86, 86, - 316, 316,-32768, 86, 86, 316, 327, 3354, 325, 2134, --32768,-32768, 3019, 2933, 2933, 2933, 2933, 2933, 2933, 2933, - 2933, 2933,-32768, 2933,-32768, 2933, 2933, 2933,-32768, 2933, --32768,-32768, 2933, 2933, 2933, 2933, 2933, 2933,-32768, 945, - 2933,-32768,-32768,-32768,-32768,-32768,-32768, 180,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 180, 180, --32768,-32768, 558, 2781,-32768, 334,-32768,-32768,-32768, 180, --32768,-32768,-32768,-32768, 180,-32768,-32768,-32768, 461,-32768, - 180, 469, 291, 291, 917, 389,-32768,-32768,-32768, 434, - 714, 319, 88, 326, 472,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768, 180,-32768,-32768,-32768, 917, 180, --32768,-32768, 180,-32768,-32768, 474,-32768,-32768,-32768,-32768, --32768, 424, -19,-32768, 476, 483,-32768, 324,-32768,-32768, --32768,-32768, 180,-32768,-32768,-32768, 93,-32768, 3209,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768, 180,-32768,-32768, --32768,-32768,-32768,-32768, 132, 132, 424,-32768, 132, 132, --32768,-32768,-32768, 344,-32768, 2933,-32768, 3209,-32768, 1287, - 876, 114, 114, 876, 1714, 3244, 1714, 1714, 1714, 1714, - 86, 1714, 284, 350, 114, 114, 86, 86, 104,-32768, --32768, 3209,-32768, 584, 584, 345,-32768,-32768, -69,-32768, --32768,-32768, 6, 180,-32768,-32768, 353, 354,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768, 424,-32768, 355,-32768, - 180, 28,-32768, 821, 740,-32768, 138, 88,-32768, 180, - 51,-32768,-32768, 51,-32768,-32768,-32768,-32768,-32768,-32768, --32768, 180,-32768,-32768,-32768, 358,-32768,-32768, 180, 359, - 2933, 2933, 752,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - 180, 180, 180,-32768, 506, 424, 424,-32768, 424, 917, - 740,-32768,-32768,-32768, 138,-32768,-32768,-32768,-32768,-32768, - -4,-32768, -4,-32768,-32768, 18,-32768, 51,-32768, 3120, - 3244, 382, 422,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768, 51,-32768,-32768, 180, 65, 180,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768, 616, 618,-32768 -}; - -static const short yypgoto[] = {-32768, --32768, -439, 102, 200,-32768,-32768,-32768,-32768,-32768, 328, - -141, -149, -662, -309,-32768, -6, -122, -373, -671,-32768, --32768, 16,-32768, -279,-32768,-32768,-32768, 541, -95,-32768, --32768, 352,-32768, 157, 323, 538, -25,-32768,-32768,-32768, --32768, -398, -145, -269, -307, -157,-32768,-32768,-32768,-32768, --32768, 48,-32768, -132, 38,-32768,-32768, -110,-32768, -787, - -259, -255, -289,-32768,-32768,-32768, -166, -506, 0, 2, - 32, 133, 20, -15, 2849, 331,-32768, -52, 477,-32768, --32768, -76, -43,-32768,-32768,-32768,-32768, 31,-32768, 557, - 79,-32768, 346,-32768,-32768,-32768, -207, 84, 572, 37, - 163,-32768,-32768,-32768,-32768,-32768, -790, -304,-32768,-32768, - 99,-32768,-32768,-32768,-32768, 78,-32768, 59,-32768, -324, --32768,-32768,-32768,-32768,-32768,-32768,-32768, 166,-32768,-32768, - 169,-32768,-32768,-32768,-32768, -187,-32768,-32768,-32768,-32768, --32768,-32768, -257 -}; - - -#define YYLAST 3604 - - -static const short yytable[] = { 163, - 607, 164, 538, 308, 540, 548, 539, 315, 364, 196, - 197, 198, 199, 200, 201, 430, 202, 203, 204, 205, - 206, 207, 208, 209, 568, 210, 211, 212, 213, 214, - 215, 165, 184, 186, 308, 188, 368, 577, 279, 192, - 193, 194, 217, 369, 221, 222, 225, 370, 700, 226, - 371, 937, 227, 609, 228, 229, 230, 231, 232, 233, - 275, 372, 234, 294, 398, 329, 632, 239, 307, 333, - 373, 865, 866, 280, 315, 302, 526, 409, 732, 596, - 733, 559, 879, 399, 527, 163, 312, 164, 163, 367, - 164, 569, 300, 163, 323, 164, 728, 932, 180, 425, - 543, 349, 544, 943, 549, 301, 879, 729, 334, 737, - 235, 235, 404, 235, 403, 235, 235, 574, 727, 356, - 738, 360, 316, 921, 421, 182, 163, 304, 164, 815, - 816, 368, 818, 819, 820, 821, 822, 586, 369, 280, - 405, 181, 370, 960, 587, 371, 898, -41, 386, 305, - 163, 163, 164, 164, 413, 414, 422, 969, 423, 417, - 418, 550, 922, 372, 938, 767, 761, 416, -149, -149, - 762, 3, 373, 425, 575, 406, 633, 259, 899, 9, - 410, 163, 165, 165, 634, 939, 165, 411, 600, 316, - 526, 407, 392, 560, 263, 676, 187, 677, 527, 588, - 183, 528, 433, 570, 434, 165, 296, 427, 730, 484, - 485, 297, 488, 636, -456, 637, -47, 189, 264, 636, - 739, 637, 281, 615, 601, 746, 372, 361, 561, 284, - 540, 589, 791, 529, 3, 373, 636, 185, 637, 7, - 394, 522, 9, 524, 404, 362, 887, 190, 278, -42, - 488, 295, 309, 191, 310, 271, 578, 547, -46, 163, - -432, 525, 940, 400, 763, -533, 163, 879, 163, 965, - -149, 966, -149, 245, 395, 734, 752, -554, 246, 247, - 248, 427, 488, 792, 298, 100, 271, -48, 281, 163, - 299, 566, 782, -472, 547, 638, 396, 489, 490, 491, - 492, 493, 494, 495, 496, 497, 392, 406, 687, 498, - 499, 885, 163, 314, 500, 501, 502, 976, 504, 488, - -475, 505, 428, 407, 506, 392, 639, 125, 507, 508, - 319, 509, 639, 510, 697, 698, 245, 514, 392, 429, - -482, 246, 247, 248, 783, -149, -149, -149, 100, 639, - 380, 381,-32768, 698, 249, 285, 3, 321, 425, 134, - 695, 696, 697, 698, 9, 676, 324, 677, 302, 286, - 322, 287, 288, 325, 289, 326, 635, 327, 642, 643, - 392, 935, 640, 641, 642, 643, 743, 744, 332, 163, - 125, 330, 331, -559, 933, 350, 428, 368, 800, 640, - 641, 642, 643, 572, 369, 351, 352, 290, 370, 801, - 237, 371, 238, 429, 240, 241, 387, 382, 132, 585, - 388, 390, 134, -70, 393, -357, 415, -535, 784, 424, - 291, 435, 483, 3, 488, 425, 503, -94, 515, 521, - 541, 9, 752, 3, 931, 542, 563, 266, 594, -566, - 426, 9, 3, 599, 425, 565, 590, 595, 245, 603, - 9, 591, 593, 246, 247, 248, 427, 605, 602, 163, - 100, 663, 364, 292, 163, 606, 667, 3, 687, 608, - 604, 610, -456, 611, 612, 9, 620, 552, 621, 629, - 222, 625, 690, 540, 802, 538, 758, 553, 3, 539, - 644, 554, 626, 622, 623, 645, 9, 896, 607, 803, - 804, 647, 125, 627, 628, 699, 163, 555, 723, 630, - 746, 774, 755, 756, 631, 404, 692, 779, 693, 694, - 695, 696, 697, 698, 759, 245, 766, 163, 798, 754, - 246, 247, 248, 427, 134, 245, 780, 100, 399, 810, - 246, 247, 248, 405, 245, 777, 813, 100, 814, 246, - 247, 248, 427, 163, 817, 698, 100, 825, 826, 856, - 808, 862, 886, 864, 888, 532, 903, 883, 895, 245, - 163, 428, 164, 900, 246, 247, 248, 356, 556, 125, - 901, 100, 916, 914, 163, 911, 795, 920, 429, 125, - 245, 926, 927, 929, 407, 246, 247, 248, 125, 946, - 955, 949, 100, 971, 972, 979, 726, 980, 567, 893, - 959, 134, 736, 882, 945, 742, 540, 752, 796, 293, - 858, 134, 579, 125, 562, 311, 897, -419, 968, 905, - 134, 781, 790, 757, 889, 962, 724, 857, 844, 306, - 910, 576, 807, 775, 125, 924, 773, 277, 428, 974, - 809, 789, 778, 823, 482, 134, 768, 919, 486, 771, - 717, 487, 0, 752, 718, 429, 0, 428, 0, 0, - 0, 776, 753, 861, 0, 3, 134, 0, 0, 0, - 7, 0, 581, 9, 429, 0, 0, 0, 785, 786, - 0, 0, 787, 0, 890, 0, 0, 0, 0, 0, - 928, 0, 0, 0, 0, 892, 753, 797, 851, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 0, - 0, 0, 0, 0, 902, 0, 0, 0, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 0, 163, - 0, 754, 0, 0, 0, 0, 0, 0, 0, 956, - 957, 0, 958, 0, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 0, 0, 0, 0, 0, 0, - 0, 163, 0, 0, 0, 0, 0, 245, 0, 907, - 0, 0, 246, 247, 248, 0, 0, 0, 532, 100, - 915, 0, 0, 0, 592, 0, 0, 923, 392, 853, - 0, 0, 0, 0, 0, 0, 163, 0, 0, 0, - 854, 855, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 859, 0, 676, 0, 677, 860, 109, 0, 0, - 112, 125, 863, 532, 0, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 947, 109, 0, 0, 112, - 0, 0, 0, 0, 0, 0, 891, 0, 0, 0, - 0, 894, 0, 134, 863, 0, 163, 0, 0, 0, - 0, 0, 109, 963, 0, 112, 0, 0, 795, 0, - 0, 967, 0, 0, 904, 0, 0, 0, 0, 0, - 0, 973, 0, 0, 0, 0, 0, 0, 0, 908, - 0, 674, 0, 0, 0, 0, 0, 961, 646, 0, - 0, 0, 977, 0, 0, 163, 163, 0, 163, 0, - 0, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 687, 664, 533, 665, - 666, 0, 668, 0, 671, 672, 673, 676, 0, 677, - 0, 0, 0, 109, 0, 925, 112, 533, 884, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 0, - 0, 0, 930, 606, 0, 0, 0, 0, 0, 0, - 0, 936, 0, 748, 692, 0, 693, 694, 695, 696, - 697, 698, 0, 944, 0, 0, 0, 0, 0, 0, - 948, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 867, 0, 952, 953, 954, 0, 679, 868, 869, 870, - 92, 871, 872, 873, 874, 875, 876, 0, 99, 0, - 0, 0, 0, 0, 681, 0, 0, 682, 0, 0, - 683, 0, 0, 0, 0, 0, 0, 0, 0, 684, - 0, 0, 0, 0, 0, 685, 686, 0, 975, 797, - 687, 0, 688, 0, 533, 0, 689, 0, 0, 0, - 0, 0, 0, 0, 690, 0, 0, 109, 0, 335, - 112, 0, 0, 691, 0, 799, 336, 337, 338, 339, - 340, 341, 342, 343, 344, 345, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 692, 0, - 693, 694, 695, 696, 697, 698, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 828, 0, 0, 0, - 830, 831, 832, 833, 834, 835, 836, 837, 838, 0, - 839, 0, 840, 841, 842, 877, 843, 0, 0, 845, - 846, 847, 848, 849, 850, 0, 0, 852, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, -1, 1, 0, 748, 0, - 0, 0, 0, 2, 0, 3, 0, 4, 5, 6, - 7, 0, 8, 9, 10, -247, 11, 12, 0, 0, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 0, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, -247, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, -247, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 0, 76, 77, 78, - 79, 80, 0, 81, 82, 83, 84, 85, 0, 86, - 0, 87, 913, 0, 88, 0, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 0, 99, 0, 100, - 0, 101, 102, 103, 0, 0, 104, 105, 0, 106, - 0, 0, 0, 107, 108, 0, 0, 0, 109, 110, - 111, 112, 0, 113, 0, 0, 0, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 0, 0, 0, - 124, 125, 0, 0, 0, 126, 0, 0, 676, 0, - 677, 0, 0, 127, 0, 128, 129, 130, 0, 0, - 0, 0, -81, 131, 0, 0, 0, 950, 951, 132, - 0, 133, 242, 134, 135, 0, 243, 244, 136, 137, - 138, 3, 139, 140, 0, 141, 7, 0, 142, 9, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 143, 144, 0, 0, 0, 145, - 0, 146, 147, 148, 149, 0, 0, 679, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 150, - 0, 151, 0, 0, 0, 681, 0, 0, 682, 0, - 0, 683, 0, 0, 0, 0, 0, 0, 0, 0, - 684, 0, 0, 0, 0, 0, 685, 686, 0, 0, - 0, 687, 0, 688, 0, 0, 0, 689, 0, 0, - 0, 0, 0, 0, 0, 690, 0, 0, 0, 0, - 0, 0, 0, 245, 691, 0, 0, 0, 246, 247, - 248, 0, 0, 0, 0, 100, 0, 0, 0, 0, - 0, 249, 250, 251, 0, 0, 0, 252, 0, 692, - 0, 693, 694, 695, 696, 697, 698, 0, 253, 254, - 255, 256, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 257, 0, 125, 0, 0, - 0, 0, 258, 0, 0, 0, 0, 0, 0, 0, - 259, 0, 0, 0, 260, 0, 0, 0, -79, 0, - 0, 0, 0, 0, 0, 132, 0, 0, 0, 134, - 0, 0, 0, 0, 0, 0, 0, 261, 0, 0, - 0, 0, 262, 0, 0, 0, 0, 263, 0, 0, - 0, 264, 0, 265, 266, 0, 0, 267, 0, 268, - 0, 0, 269, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 2, 0, 3, 0, 4, 5, 6, 7, - 270, 8, 9, 10, -247, 11, 12, 0, 271, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 0, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, -247, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - -247, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 0, 76, 77, 78, 79, - 80, 0, 81, 82, 83, 84, 85, 0, 86, 0, - 87, 0, 0, 88, 0, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 0, 99, 0, 100, 0, - 101, 102, 103, 0, 0, 104, 105, 0, 106, 0, - 0, 0, 107, 108, 0, 0, 0, 109, 110, 111, - 112, 0, 113, 0, 0, 0, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 0, 0, 0, 124, - 125, 0, 0, 0, 126, 676, 0, 677, 0, 0, - 0, 0, 127, 0, 128, 129, 130, 0, 0, 0, - 0, -81, 131, 0, 0, 0, 0, 0, 132, 0, - 133, 0, 134, 135, 0, 0, 0, 136, 137, 138, - 419, 139, 140, 0, 141, 0, 420, 142, -249, -249, - 0, -249, 0, 0, 0, -249, 0, -249, 0, -249, - 0, 0, -249, 143, 144, 0, 0, 0, 145, 0, - 146, 147, 148, 149,-32768, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 150, 0, - 151, 0,-32768, 0, 0,-32768, 0, 0, 683, 0, - 0, 0, 0, 0, 0, 0, 0,-32768, -249, 0, - 0, 0, 0, 685,-32768, 0, 0, 0, 687, 0, --32768, 0, 0, 0, 689, 0, 0, 0, 0, 0, - 0, 0, 690, 0, 0, 0, 0, 0, 0, 0, - 0, 691, 0, -249, -249, 0, 0, -249, 0, 0, - -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, - 0, 0, -249, -249, 0, 0, 692, 0, 693, 694, - 695, 696, 697, 698, 0, 0, -249, 0, 0, -249, - 0, 0, 0, 0, 0, 0, 0, 0, 0, -249, - 0, 0, 355, 0, 0, 0, 0, 0, 0, 0, - -247, -247, 0, -247, 0, -249, -249, -247, 0, -247, - 0, -247, -249, -249, -247, 0, 0, 0, 0, 0, - 0, 0, 0, 0, -249, 0, 0, 0, -249, 0, - 0, -249, 0, 0, 0, 0, 0, -249, 0, 0, - 0, -249, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, -249, -249, -249, -249, 0, -249, 0, - -247, 0, 0, -249, -249, -249, -249, 0, 0, 0, - 0, 0, -249, 0, -249, 0, 0, 0, 0, -249, - 0, -249, -249, 0, -249, -249, 0, 0, 0, 0, - 0, -249, 0, 0, 0, -247, -247, 0, 0, -247, - 0, 0, -247, -247, -247, -247, -247, -247, -247, -247, - -247, -247, 0, 0, -247, -247, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, -247, 0, - 0, -247, 0, 0, 0, 0, 0, 0, 0, 0, - 0, -247, 0, 0, 827, 0, 0, 0, 0, 0, - 0, 0, 436, 3, 0, 437, 0, -247, -247, 438, - 0, 439, 0, 440, -247, -247, 441, 0, 0, 0, - 0, 0, 0, 0, 0, 0, -247, 0, 0, 0, - -247, 0, 0, -247, 0, 0, 0, 0, 0, -247, - 0, 0, 0, -247, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, -247, -247, -247, -247, 0, - -247, 0, 442, 0, 0, -247, -247, -247, -247, 0, - 0, 0, 0, 0, -247, 0, -247, 0, 0, 0, - 0, -247, 0, -247, -247, 0, -247, -247, 0, 0, - 0, 0, 0, -247, 0, 0, 0, 443, 444, 0, - 0, 445, 0, 0, 446, 245, 447, 448, 449, 450, - 246, 247, 451, 452, 0, 0, 453, 100, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 454, 0, 0, 455, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 456, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 125, - 457, 0, 0, 0, 0, 0, 458, 459, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 460, 0, - 0, 0, 461, 0, 0, 462, 0, 0, 0, 0, - 0, 134, 0, 0, 0, 463, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 464, 465, 466, - 467, 0, 468, 0, 0, 0, 0, 469, 470, 471, - 472, 0, 0, 0, 0, 0, 473, 0, 474, 0, - 0, 0, 0, 475, 0, 476, 477, 2, 478, 479, - 0, 0, 5, 6, 0, 480, 8, 0, 10, 0, - 11, 12, 0, 0, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 0, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 0, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 0, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 0, 76, 77, 78, 79, 80, 0, 81, 82, 83, - 84, 85, 0, 0, 0, 87, 0, 0, 383, 0, - 0, 0, 384, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 101, 102, 103, 0, 0, - 0, 0, 0, 106, 0, 0, 0, 107, 108, 0, - 0, 0, 109, 0, 111, 112, 0, 113, 0, 0, - 0, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 0, 0, 0, 124, 0, 0, 0, 0, 126, - 0, 0, 0, 0, 0, 0, 0, 127, 0, 128, - 129, 130, 0, 0, 0, 0, 0, 131, 0, 0, - 0, 0, 0, 132, 0, 133, 0, 0, 135, 0, - 0, 0, 136, 137, 138, 0, 0, 0, 0, 141, - 0, 0, 142, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 143, 144, - 0, 0, 0, 145, 0, 146, 147, 148, 149, 0, - 0, 2, 0, 0, 0, 0, 5, 6, 0, 0, - 8, 0, 10, 385, 11, 12, 0, 0, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 0, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 0, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 0, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 0, 76, 77, 78, 79, 80, - 0, 81, 82, 83, 84, 85, 0, 0, 0, 87, - 0, 0, 383, 0, 0, 0, 384, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 101, - 102, 103, 0, 0, 0, 0, 0, 106, 0, 0, - 0, 107, 108, 0, 0, 0, 109, 0, 111, 112, - 0, 113, 0, 0, 0, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 0, 0, 0, 124, 0, - 0, 0, 0, 126, 0, 0, 0, 0, 0, 0, - 0, 127, 0, 128, 129, 130, 0, 0, 0, 436, - 3, 131, 437, 0, 0, 0, 438, 132, 439, 133, - 440, 0, 135, 441, 511, 0, 136, 137, 138, 0, - 0, 0, 0, 141, 0, 0, 142, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 143, 144, 0, 0, 0, 145, 0, 146, - 147, 148, 149, 0, 0, 0, 0, 0, 0, 442, - 0, 0, 0, 0, 0, 0, 0, -527, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 443, 444, 0, 0, 445, 0, - 0, 446, 245, 447, 448, 449, 450, 246, 247, 451, - 452, 0, 0, 453, 100, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 454, 0, 0, - 455, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 456, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 436, 3, 0, 437, 0, 125, 457, 438, 0, - 439, 0, 440, 458, 459, 441, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 460, 0, 0, 0, 461, - 0, 0, 462, 0, 0, 0, 0, 0, 134, 0, - 0, 0, 463, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 464, 465, 466, 467, 0, 468, - 0, 442, 0, 0, 469, 470, 471, 472, 0, 0, - 0, 0, 0, 473, 0, 474, 0, 0, 0, 0, - 475, 0, 476, 477, 0, 478, 479, 0, 0, 0, - 0, 0, 480, 0, 0, 0, 443, 444, 0, 0, - 445, 0, 0, 446, 245, 447, 448, 449, 450, 246, - 247, 451, 452, 0, 674, 453, 100, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 454, - 0, 0, 455, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 456, 0, 0, 0, 0, 0, 675, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 125, 457, - 676, 0, 677, 0, 0, 458, 459, 0, 0, 0, - 678, 0, 0, 0, 0, 0, 0, 460, 0, 0, - 0, 461, 0, 0, 462, 0, 0, 0, 0, 0, - 134, 0, 0, 0, 463, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 464, 465, 466, 467, - 0, 468, 0, 0, 0, 674, 469, 470, 471, 472, - 0, 0, 0, 0, 0, 473, 0, 474, 0, 679, - 0, 0, 475, 0, 476, 477, 0, 478, 479, 0, - 0, 0, 0, 0, 480, 0, 680, 681, 0, 675, - 682, 0, 0, 683, 0, 0, 0, 0, 0, 0, - 0, 676, 684, 677, 0, 0, 0, 0, 685, 686, - 0, 678, 0, 687, 0, 688, 0, 0, 0, 689, - 0, 0, 0, 0, 0, 0, 0, 690, 0, 0, - 0, 0, 0, 0, 0, 0, 691, 0, 0, 0, - 0, 0, 0, 0, 674, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 692, 0, 693, 694, 695, 696, 697, 698, 0, - 679, 829, 0, 0, 0, 0, 0, 0, 675, 674, - 0, 0, 0, 0, 0, 0, 0, 680, 681, 0, - 676, 682, 677, 0, 683, 0, 0, 0, 0, 0, - 678, 0, 0, 684, 0, 0, 0, 0, 0, 685, - 686, 0, 0, 675, 687, 0, 688, 0, 0, 0, - 689, 0, 0, 0, 0, 676, 0, 677, 690, 0, - 0, 0, 0, 0, 0, 678, 0, 691, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 0, 716, 0, 0, 719, 720, 721, 722, 679, - 0, 0, 692, 0, 693, 694, 695, 696, 697, 698, - 0, 0, 970, 0, 0, 0, 680, 681, 0, 0, - 682, 0, 0, 683, 0, 0, 0, 0, 0, 674, - 0, 0, 684, 0, 679, 0, 0, 0, 685, 686, - 0, 0, 0, 687, 0, 688, 0, 0, 0, 689, - 0,-32768, 681, 0, 0, 682, 0, 690, 683, 0, - 772, 0, 0, 675, 0, 0, 691, 684, 0, 0, - 0, 0, 0, 685, 686, 676, 0, 677, 687, 0, - 688, 0, 0, 0, 689, 678, 0, 0, 0, 0, - 788, 692, 690, 693, 694, 695, 696, 697, 698, 0, - 0, 691, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 811, 0, 812, 0, - 0, 0, 0, 0, 0, 0, 692, 0, 693, 694, - 695, 696, 697, 698, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 679, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 681, 0, 0, 682, 0, 0, 683, 0, - 0, 0, 0, 0, 0, 0, 0, 684, 0, 0, - 0, 0, 0, 685, 686, 0, 0, 0, 687, 0, - 688, 0, 0, 0, 689, 0, 0, 0, 0, 0, - 0, 0, 690, 0, 0, 0, 0, 0, 0, 0, - 0, 691, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 692, 0, 693, 694, - 695, 696, 697, 698 -}; - -static const short yycheck[] = { 0, - 374, 0, 262, 5, 262, 275, 262, 1, 141, 25, - 26, 27, 28, 29, 30, 182, 32, 33, 34, 35, - 36, 37, 38, 39, 294, 41, 42, 43, 44, 45, - 46, 0, 13, 14, 5, 16, 9, 307, 6, 20, - 21, 22, 58, 16, 60, 61, 62, 20, 488, 65, - 23, 1, 68, 378, 70, 71, 72, 73, 74, 75, - 86, 104, 78, 89, 1, 118, 1, 83, 94, 122, - 113, 743, 744, 107, 1, 91, 41, 1, 10, 349, - 12, 1, 745, 20, 49, 86, 102, 86, 89, 142, - 89, 1, 132, 94, 110, 94, 1, 885, 254, 12, - 267, 127, 269, 894, 129, 145, 769, 12, 124, 104, - 79, 80, 142, 82, 167, 84, 85, 129, 517, 135, - 115, 137, 116, 193, 177, 250, 127, 149, 127, 636, - 637, 9, 639, 640, 641, 642, 643, 104, 16, 107, - 170, 137, 20, 931, 111, 23, 166, 187, 155, 171, - 151, 152, 151, 152, 170, 171, 1, 948, 3, 175, - 176, 186, 232, 104, 114, 564, 7, 174, 254, 255, - 11, 10, 113, 12, 186, 205, 111, 179, 198, 18, - 104, 182, 151, 152, 119, 135, 155, 111, 69, 116, - 41, 221, 161, 113, 216, 82, 105, 84, 49, 166, - 104, 166, 183, 113, 185, 174, 144, 120, 113, 190, - 191, 149, 255, 82, 254, 84, 187, 105, 220, 82, - 215, 84, 256, 390, 105, 230, 104, 104, 281, 5, - 488, 198, 606, 198, 10, 113, 82, 104, 84, 15, - 20, 257, 18, 259, 142, 122, 753, 105, 86, 187, - 255, 89, 96, 105, 98, 257, 309, 273, 187, 260, - 254, 260, 212, 200, 105, 254, 267, 930, 269, 941, - 253, 943, 255, 112, 54, 207, 534, 254, 117, 118, - 119, 120, 255, 608, 222, 124, 257, 187, 256, 290, - 228, 290, 131, 254, 310, 141, 76, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 275, 205, 195, 208, - 209, 751, 313, 113, 213, 214, 215, 253, 217, 255, - 254, 220, 235, 221, 223, 294, 195, 166, 227, 228, - 177, 230, 195, 232, 249, 250, 112, 236, 307, 252, - 254, 117, 118, 119, 183, 253, 254, 255, 124, 195, - 151, 152, 249, 250, 130, 131, 10, 229, 12, 198, - 247, 248, 249, 250, 18, 82, 105, 84, 384, 145, - 254, 147, 148, 105, 150, 104, 429, 105, 247, 248, - 349, 888, 245, 246, 247, 248, 528, 529, 104, 390, - 166, 105, 105, 254, 257, 104, 235, 9, 104, 245, - 246, 247, 248, 302, 16, 104, 111, 183, 20, 115, - 80, 23, 82, 252, 84, 85, 249, 254, 194, 318, - 254, 187, 198, 75, 254, 254, 20, 254, 595, 249, - 206, 255, 255, 10, 255, 12, 105, 254, 105, 118, - 105, 18, 700, 10, 884, 105, 105, 223, 347, 255, - 104, 18, 10, 352, 12, 118, 254, 249, 112, 358, - 18, 255, 255, 117, 118, 119, 120, 366, 252, 470, - 124, 470, 605, 249, 475, 374, 475, 10, 195, 378, - 105, 105, 254, 254, 75, 18, 249, 104, 249, 249, - 506, 221, 209, 751, 200, 755, 549, 114, 10, 755, - 105, 118, 205, 402, 403, 137, 18, 777, 882, 215, - 216, 108, 166, 412, 413, 105, 517, 134, 252, 418, - 230, 574, 255, 254, 423, 142, 243, 105, 245, 246, - 247, 248, 249, 250, 255, 112, 255, 538, 141, 538, - 117, 118, 119, 120, 198, 112, 105, 124, 20, 113, - 117, 118, 119, 170, 112, 581, 4, 124, 253, 117, - 118, 119, 120, 564, 252, 250, 124, 241, 244, 12, - 623, 111, 254, 105, 249, 104, 253, 144, 105, 112, - 581, 235, 581, 108, 117, 118, 119, 603, 205, 166, - 108, 124, 9, 244, 595, 252, 612, 253, 252, 166, - 112, 249, 249, 249, 221, 117, 118, 119, 166, 252, - 105, 253, 124, 232, 193, 0, 515, 0, 291, 769, - 930, 198, 521, 746, 904, 524, 884, 885, 613, 89, - 726, 198, 310, 166, 283, 98, 782, 254, 946, 797, - 198, 594, 605, 542, 755, 935, 514, 724, 692, 93, - 817, 306, 622, 575, 166, 863, 573, 86, 235, 964, - 624, 603, 585, 644, 188, 198, 565, 855, 192, 571, - 505, 195, -1, 931, 506, 252, -1, 235, -1, -1, - -1, 580, 249, 736, -1, 10, 198, -1, -1, -1, - 15, -1, 250, 18, 252, -1, -1, -1, 597, 598, - -1, -1, 601, -1, 757, -1, -1, -1, -1, -1, - 877, -1, -1, -1, -1, 768, 249, 616, 699, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, -1, - -1, -1, -1, -1, 787, -1, -1, -1, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, -1, 750, - -1, 750, -1, -1, -1, -1, -1, -1, -1, 926, - 927, -1, 929, -1, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, -1, -1, -1, -1, -1, -1, - -1, 782, -1, -1, -1, -1, -1, 112, -1, 805, - -1, -1, 117, 118, 119, -1, -1, -1, 104, 124, - 853, -1, -1, -1, 328, -1, -1, 860, 777, 708, - -1, -1, -1, -1, -1, -1, 817, -1, -1, -1, - 719, 720, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 730, -1, 82, -1, 84, 735, 143, -1, -1, - 146, 166, 741, 104, -1, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 908, 143, -1, -1, 146, - -1, -1, -1, -1, -1, -1, 765, -1, -1, -1, - -1, 770, -1, 198, 773, -1, 877, -1, -1, -1, - -1, -1, 143, 936, -1, 146, -1, -1, 904, -1, - -1, 944, -1, -1, 793, -1, -1, -1, -1, -1, - -1, 954, -1, -1, -1, -1, -1, -1, -1, 808, - -1, 36, -1, -1, -1, -1, -1, 933, 442, -1, - -1, -1, 975, -1, -1, 926, 927, -1, 929, -1, - -1, 455, 456, 457, 458, 459, 460, 461, 462, 463, - 464, 465, 466, 467, 468, 469, 195, 471, 254, 473, - 474, -1, 476, -1, 478, 479, 480, 82, -1, 84, - -1, -1, -1, 143, -1, 864, 146, 254, 255, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, -1, - -1, -1, 881, 882, -1, -1, -1, -1, -1, -1, - -1, 890, -1, 254, 243, -1, 245, 246, 247, 248, - 249, 250, -1, 902, -1, -1, -1, -1, -1, -1, - 909, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 104, -1, 921, 922, 923, -1, 151, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, -1, 122, -1, - -1, -1, -1, -1, 169, -1, -1, 172, -1, -1, - 175, -1, -1, -1, -1, -1, -1, -1, -1, 184, - -1, -1, -1, -1, -1, 190, 191, -1, 967, 968, - 195, -1, 197, -1, 254, -1, 201, -1, -1, -1, - -1, -1, -1, -1, 209, -1, -1, 143, -1, 104, - 146, -1, -1, 218, -1, 619, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 243, -1, - 245, 246, 247, 248, 249, 250, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 670, -1, -1, -1, - 674, 675, 676, 677, 678, 679, 680, 681, 682, -1, - 684, -1, 686, 687, 688, 249, 690, -1, -1, 693, - 694, 695, 696, 697, 698, -1, -1, 701, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 0, 1, -1, 254, -1, - -1, -1, -1, 8, -1, 10, -1, 12, 13, 14, - 15, -1, 17, 18, 19, 20, 21, 22, -1, -1, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, - 95, 96, -1, 98, 99, 100, 101, 102, -1, 104, - -1, 106, 826, -1, 109, -1, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, -1, 122, -1, 124, - -1, 126, 127, 128, -1, -1, 131, 132, -1, 134, - -1, -1, -1, 138, 139, -1, -1, -1, 143, 144, - 145, 146, -1, 148, -1, -1, -1, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, -1, -1, -1, - 165, 166, -1, -1, -1, 170, -1, -1, 82, -1, - 84, -1, -1, 178, -1, 180, 181, 182, -1, -1, - -1, -1, 187, 188, -1, -1, -1, 911, 912, 194, - -1, 196, 1, 198, 199, -1, 5, 6, 203, 204, - 205, 10, 207, 208, -1, 210, 15, -1, 213, 18, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 229, 230, -1, -1, -1, 234, - -1, 236, 237, 238, 239, -1, -1, 151, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 254, - -1, 256, -1, -1, -1, 169, -1, -1, 172, -1, - -1, 175, -1, -1, -1, -1, -1, -1, -1, -1, - 184, -1, -1, -1, -1, -1, 190, 191, -1, -1, - -1, 195, -1, 197, -1, -1, -1, 201, -1, -1, - -1, -1, -1, -1, -1, 209, -1, -1, -1, -1, - -1, -1, -1, 112, 218, -1, -1, -1, 117, 118, - 119, -1, -1, -1, -1, 124, -1, -1, -1, -1, - -1, 130, 131, 132, -1, -1, -1, 136, -1, 243, - -1, 245, 246, 247, 248, 249, 250, -1, 147, 148, - 149, 150, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 164, -1, 166, -1, -1, - -1, -1, 171, -1, -1, -1, -1, -1, -1, -1, - 179, -1, -1, -1, 183, -1, -1, -1, 187, -1, - -1, -1, -1, -1, -1, 194, -1, -1, -1, 198, - -1, -1, -1, -1, -1, -1, -1, 206, -1, -1, - -1, -1, 211, -1, -1, -1, -1, 216, -1, -1, - -1, 220, -1, 222, 223, -1, -1, 226, -1, 228, - -1, -1, 231, -1, -1, 1, -1, -1, -1, -1, - -1, -1, 8, -1, 10, -1, 12, 13, 14, 15, - 249, 17, 18, 19, 20, 21, 22, -1, 257, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, -1, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, - 96, -1, 98, 99, 100, 101, 102, -1, 104, -1, - 106, -1, -1, 109, -1, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, -1, 122, -1, 124, -1, - 126, 127, 128, -1, -1, 131, 132, -1, 134, -1, - -1, -1, 138, 139, -1, -1, -1, 143, 144, 145, - 146, -1, 148, -1, -1, -1, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, -1, -1, -1, 165, - 166, -1, -1, -1, 170, 82, -1, 84, -1, -1, - -1, -1, 178, -1, 180, 181, 182, -1, -1, -1, - -1, 187, 188, -1, -1, -1, -1, -1, 194, -1, - 196, -1, 198, 199, -1, -1, -1, 203, 204, 205, - 1, 207, 208, -1, 210, -1, 7, 213, 9, 10, - -1, 12, -1, -1, -1, 16, -1, 18, -1, 20, - -1, -1, 23, 229, 230, -1, -1, -1, 234, -1, - 236, 237, 238, 239, 151, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 254, -1, - 256, -1, 169, -1, -1, 172, -1, -1, 175, -1, - -1, -1, -1, -1, -1, -1, -1, 184, 69, -1, - -1, -1, -1, 190, 191, -1, -1, -1, 195, -1, - 197, -1, -1, -1, 201, -1, -1, -1, -1, -1, - -1, -1, 209, -1, -1, -1, -1, -1, -1, -1, - -1, 218, -1, 104, 105, -1, -1, 108, -1, -1, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - -1, -1, 123, 124, -1, -1, 243, -1, 245, 246, - 247, 248, 249, 250, -1, -1, 137, -1, -1, 140, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 150, - -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, - 9, 10, -1, 12, -1, 166, 167, 16, -1, 18, - -1, 20, 173, 174, 23, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 185, -1, -1, -1, 189, -1, - -1, 192, -1, -1, -1, -1, -1, 198, -1, -1, - -1, 202, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 214, 215, 216, 217, -1, 219, -1, - 69, -1, -1, 224, 225, 226, 227, -1, -1, -1, - -1, -1, 233, -1, 235, -1, -1, -1, -1, 240, - -1, 242, 243, -1, 245, 246, -1, -1, -1, -1, - -1, 252, -1, -1, -1, 104, 105, -1, -1, 108, - -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, -1, -1, 123, 124, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 137, -1, - -1, 140, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 150, -1, -1, 1, -1, -1, -1, -1, -1, - -1, -1, 9, 10, -1, 12, -1, 166, 167, 16, - -1, 18, -1, 20, 173, 174, 23, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 185, -1, -1, -1, - 189, -1, -1, 192, -1, -1, -1, -1, -1, 198, - -1, -1, -1, 202, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 214, 215, 216, 217, -1, - 219, -1, 69, -1, -1, 224, 225, 226, 227, -1, - -1, -1, -1, -1, 233, -1, 235, -1, -1, -1, - -1, 240, -1, 242, 243, -1, 245, 246, -1, -1, - -1, -1, -1, 252, -1, -1, -1, 104, 105, -1, - -1, 108, -1, -1, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, -1, -1, 123, 124, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 137, -1, -1, 140, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 150, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 166, - 167, -1, -1, -1, -1, -1, 173, 174, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 185, -1, - -1, -1, 189, -1, -1, 192, -1, -1, -1, -1, - -1, 198, -1, -1, -1, 202, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 214, 215, 216, - 217, -1, 219, -1, -1, -1, -1, 224, 225, 226, - 227, -1, -1, -1, -1, -1, 233, -1, 235, -1, - -1, -1, -1, 240, -1, 242, 243, 8, 245, 246, - -1, -1, 13, 14, -1, 252, 17, -1, 19, -1, - 21, 22, -1, -1, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, -1, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, -1, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, -1, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - -1, 92, 93, 94, 95, 96, -1, 98, 99, 100, - 101, 102, -1, -1, -1, 106, -1, -1, 109, -1, - -1, -1, 113, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 126, 127, 128, -1, -1, - -1, -1, -1, 134, -1, -1, -1, 138, 139, -1, - -1, -1, 143, -1, 145, 146, -1, 148, -1, -1, - -1, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, -1, -1, -1, 165, -1, -1, -1, -1, 170, - -1, -1, -1, -1, -1, -1, -1, 178, -1, 180, - 181, 182, -1, -1, -1, -1, -1, 188, -1, -1, - -1, -1, -1, 194, -1, 196, -1, -1, 199, -1, - -1, -1, 203, 204, 205, -1, -1, -1, -1, 210, - -1, -1, 213, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 229, 230, - -1, -1, -1, 234, -1, 236, 237, 238, 239, -1, - -1, 8, -1, -1, -1, -1, 13, 14, -1, -1, - 17, -1, 19, 254, 21, 22, -1, -1, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, -1, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, -1, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, -1, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, - -1, 98, 99, 100, 101, 102, -1, -1, -1, 106, - -1, -1, 109, -1, -1, -1, 113, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 126, - 127, 128, -1, -1, -1, -1, -1, 134, -1, -1, - -1, 138, 139, -1, -1, -1, 143, -1, 145, 146, - -1, 148, -1, -1, -1, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, -1, -1, -1, 165, -1, - -1, -1, -1, 170, -1, -1, -1, -1, -1, -1, - -1, 178, -1, 180, 181, 182, -1, -1, -1, 9, - 10, 188, 12, -1, -1, -1, 16, 194, 18, 196, - 20, -1, 199, 23, 24, -1, 203, 204, 205, -1, - -1, -1, -1, 210, -1, -1, 213, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 229, 230, -1, -1, -1, 234, -1, 236, - 237, 238, 239, -1, -1, -1, -1, -1, -1, 69, - -1, -1, -1, -1, -1, -1, -1, 254, -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, 104, 105, -1, -1, 108, -1, - -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, -1, -1, 123, 124, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 137, -1, -1, - 140, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 150, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 9, 10, -1, 12, -1, 166, 167, 16, -1, - 18, -1, 20, 173, 174, 23, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 185, -1, -1, -1, 189, - -1, -1, 192, -1, -1, -1, -1, -1, 198, -1, - -1, -1, 202, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 214, 215, 216, 217, -1, 219, - -1, 69, -1, -1, 224, 225, 226, 227, -1, -1, - -1, -1, -1, 233, -1, 235, -1, -1, -1, -1, - 240, -1, 242, 243, -1, 245, 246, -1, -1, -1, - -1, -1, 252, -1, -1, -1, 104, 105, -1, -1, - 108, -1, -1, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, -1, 36, 123, 124, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 137, - -1, -1, 140, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 150, -1, -1, -1, -1, -1, 70, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 166, 167, - 82, -1, 84, -1, -1, 173, 174, -1, -1, -1, - 92, -1, -1, -1, -1, -1, -1, 185, -1, -1, - -1, 189, -1, -1, 192, -1, -1, -1, -1, -1, - 198, -1, -1, -1, 202, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 214, 215, 216, 217, - -1, 219, -1, -1, -1, 36, 224, 225, 226, 227, - -1, -1, -1, -1, -1, 233, -1, 235, -1, 151, - -1, -1, 240, -1, 242, 243, -1, 245, 246, -1, - -1, -1, -1, -1, 252, -1, 168, 169, -1, 70, - 172, -1, -1, 175, -1, -1, -1, -1, -1, -1, - -1, 82, 184, 84, -1, -1, -1, -1, 190, 191, - -1, 92, -1, 195, -1, 197, -1, -1, -1, 201, - -1, -1, -1, -1, -1, -1, -1, 209, -1, -1, - -1, -1, -1, -1, -1, -1, 218, -1, -1, -1, - -1, -1, -1, -1, 36, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 243, -1, 245, 246, 247, 248, 249, 250, -1, - 151, 253, -1, -1, -1, -1, -1, -1, 70, 36, - -1, -1, -1, -1, -1, -1, -1, 168, 169, -1, - 82, 172, 84, -1, 175, -1, -1, -1, -1, -1, - 92, -1, -1, 184, -1, -1, -1, -1, -1, 190, - 191, -1, -1, 70, 195, -1, 197, -1, -1, -1, - 201, -1, -1, -1, -1, 82, -1, 84, 209, -1, - -1, -1, -1, -1, -1, 92, -1, 218, 490, 491, - 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, - 502, -1, 504, -1, -1, 507, 508, 509, 510, 151, - -1, -1, 243, -1, 245, 246, 247, 248, 249, 250, - -1, -1, 253, -1, -1, -1, 168, 169, -1, -1, - 172, -1, -1, 175, -1, -1, -1, -1, -1, 36, - -1, -1, 184, -1, 151, -1, -1, -1, 190, 191, - -1, -1, -1, 195, -1, 197, -1, -1, -1, 201, - -1, 168, 169, -1, -1, 172, -1, 209, 175, -1, - 572, -1, -1, 70, -1, -1, 218, 184, -1, -1, - -1, -1, -1, 190, 191, 82, -1, 84, 195, -1, - 197, -1, -1, -1, 201, 92, -1, -1, -1, -1, - 602, 243, 209, 245, 246, 247, 248, 249, 250, -1, - -1, 218, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 628, -1, 630, -1, - -1, -1, -1, -1, -1, -1, 243, -1, 245, 246, - 247, 248, 249, 250, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 151, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 169, -1, -1, 172, -1, -1, 175, -1, - -1, -1, -1, -1, -1, -1, -1, 184, -1, -1, - -1, -1, -1, 190, 191, -1, -1, -1, 195, -1, - 197, -1, -1, -1, 201, -1, -1, -1, -1, -1, - -1, -1, 209, -1, -1, -1, -1, -1, -1, -1, - -1, 218, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 243, -1, 245, 246, - 247, 248, 249, 250 -}; -#define YYPURE 1 - -/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "/usr/local/share/bison.simple" -/* This file comes from bison-1.28. */ - -/* Skeleton output parser for bison, - Copyright (C) 1984, 1989, 1990 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 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, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* This is the parser code that is written into each bison parser - when the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ - -#ifndef YYSTACK_USE_ALLOCA -#ifdef alloca -#define YYSTACK_USE_ALLOCA -#else /* alloca not defined */ -#ifdef __GNUC__ -#define YYSTACK_USE_ALLOCA -#define alloca __builtin_alloca -#else /* not GNU C. */ -#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) -#define YYSTACK_USE_ALLOCA -#include -#else /* not sparc */ -/* We think this test detects Watcom and Microsoft C. */ -/* This used to test MSDOS, but that is a bad idea - since that symbol is in the user namespace. */ -#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) -#if 0 /* No need for malloc.h, which pollutes the namespace; - instead, just don't use alloca. */ -#include -#endif -#else /* not MSDOS, or __TURBOC__ */ -#if defined(_AIX) -/* I don't know what this was needed for, but it pollutes the namespace. - So I turned it off. rms, 2 May 1997. */ -/* #include */ - #pragma alloca -#define YYSTACK_USE_ALLOCA -#else /* not MSDOS, or __TURBOC__, or _AIX */ -#if 0 -#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, - and on HPUX 10. Eventually we can turn this on. */ -#define YYSTACK_USE_ALLOCA -#define alloca __builtin_alloca -#endif /* __hpux */ -#endif -#endif /* not _AIX */ -#endif /* not MSDOS, or __TURBOC__ */ -#endif /* not sparc */ -#endif /* not GNU C */ -#endif /* alloca not defined */ -#endif /* YYSTACK_USE_ALLOCA not defined */ - -#ifdef YYSTACK_USE_ALLOCA -#define YYSTACK_ALLOC alloca -#else -#define YYSTACK_ALLOC malloc -#endif - -/* Note: there must be only one dollar sign in this file. - It is replaced by the list of actions, each action - as one case of the switch. */ - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY -2 -#define YYEOF 0 -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrlab1 -/* 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. */ -#define YYFAIL goto yyerrlab -#define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(token, value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { yychar = (token), yylval = (value); \ - yychar1 = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ - goto yybackup; \ - } \ - else \ - { yyerror ("syntax error: cannot back up"); YYERROR; } \ -while (0) - -#define YYTERROR 1 -#define YYERRCODE 256 - -#ifndef YYPURE -#define YYLEX yylex() -#endif - -#ifdef YYPURE -#ifdef YYLSP_NEEDED -#ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) -#else -#define YYLEX yylex(&yylval, &yylloc) -#endif -#else /* not YYLSP_NEEDED */ -#ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, YYLEX_PARAM) -#else -#define YYLEX yylex(&yylval) -#endif -#endif /* not YYLSP_NEEDED */ -#endif - -/* If nonreentrant, generate the variables here */ - -#ifndef YYPURE - -int yychar; /* the lookahead symbol */ -YYSTYPE yylval; /* the semantic value of the */ - /* lookahead symbol */ - -#ifdef YYLSP_NEEDED -YYLTYPE yylloc; /* location data for the lookahead */ - /* symbol */ -#endif - -int yynerrs; /* number of parse errors so far */ -#endif /* not YYPURE */ - -#if YYDEBUG != 0 -int yydebug; /* nonzero means print parse trace */ -/* Since this is uninitialized, it does not stop multiple parsers - from coexisting. */ -#endif - -/* YYINITDEPTH indicates the initial size of the parser's stacks */ - -#ifndef YYINITDEPTH -#define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH is the maximum size the stacks can grow to - (effective only if the built-in stack extension method is used). */ - -#if YYMAXDEPTH == 0 -#undef YYMAXDEPTH -#endif - -#ifndef YYMAXDEPTH -#define YYMAXDEPTH 10000 -#endif - -/* Define __yy_memcpy. Note that the size argument - should be passed with type unsigned int, because that is what the non-GCC - definitions require. With GCC, __builtin_memcpy takes an arg - of type size_t, but it can handle unsigned int. */ - -#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ -#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) -#else /* not GNU C or C++ */ -#ifndef __cplusplus - -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (to, from, count) - char *to; - char *from; - unsigned int count; -{ - register char *f = from; - register char *t = to; - register int i = count; - - while (i-- > 0) - *t++ = *f++; -} - -#else /* __cplusplus */ - -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (char *to, char *from, unsigned int count) -{ - register char *t = to; - register char *f = from; - register int i = count; - - while (i-- > 0) - *t++ = *f++; -} - -#endif -#endif - -#line 217 "/usr/local/share/bison.simple" - -/* The user can define YYPARSE_PARAM as the name of an argument to be passed - into yyparse. The argument should have type void *. - It should actually point to an object. - Grammar actions can access the variable by casting it - to the proper pointer type. */ - -#ifdef YYPARSE_PARAM -#ifdef __cplusplus -#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM -#define YYPARSE_PARAM_DECL -#else /* not __cplusplus */ -#define YYPARSE_PARAM_ARG YYPARSE_PARAM -#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; -#endif /* not __cplusplus */ -#else /* not YYPARSE_PARAM */ -#define YYPARSE_PARAM_ARG -#define YYPARSE_PARAM_DECL -#endif /* not YYPARSE_PARAM */ - -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ -#ifdef YYPARSE_PARAM -int yyparse (void *); -#else -int yyparse (void); -#endif -#endif - -int -yyparse(YYPARSE_PARAM_ARG) - YYPARSE_PARAM_DECL -{ - register int yystate; - register int yyn; - register short *yyssp; - register YYSTYPE *yyvsp; - int yyerrstatus; /* number of tokens to shift before error messages enabled */ - int yychar1 = 0; /* lookahead token as an internal (translated) token number */ - - short yyssa[YYINITDEPTH]; /* the state stack */ - YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ - - short *yyss = yyssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ - -#ifdef YYLSP_NEEDED - YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ - YYLTYPE *yyls = yylsa; - YYLTYPE *yylsp; - -#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) -#else -#define YYPOPSTACK (yyvsp--, yyssp--) -#endif - - int yystacksize = YYINITDEPTH; - int yyfree_stacks = 0; - -#ifdef YYPURE - int yychar; - YYSTYPE yylval; - int yynerrs; -#ifdef YYLSP_NEEDED - YYLTYPE yylloc; -#endif -#endif - - YYSTYPE yyval; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ - - int yylen; - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Starting parse\n"); -#endif - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - 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 - 1; - yyvsp = yyvs; -#ifdef YYLSP_NEEDED - yylsp = yyls; -#endif - -/* Push a new state, which is found in yystate . */ -/* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. */ -yynewstate: - - *++yyssp = yystate; - - if (yyssp >= yyss + yystacksize - 1) - { - /* Give user a chance to reallocate the stack */ - /* Use copies of these so that the &'s don't force the real ones into memory. */ - YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; -#ifdef YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; -#endif - - /* Get the current used size of the three stacks, in elements. */ - int size = yyssp - yyss + 1; - -#ifdef yyoverflow - /* Each stack pointer address is followed by the size of - the data in use in that stack, in bytes. */ -#ifdef YYLSP_NEEDED - /* This used to be a conditional around just the two extra args, - but that might be undefined if yyoverflow is a macro. */ - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yyls1, size * sizeof (*yylsp), - &yystacksize); -#else - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yystacksize); -#endif - - yyss = yyss1; yyvs = yyvs1; -#ifdef YYLSP_NEEDED - yyls = yyls1; -#endif -#else /* no yyoverflow */ - /* Extend the stack our own way. */ - if (yystacksize >= YYMAXDEPTH) - { - yyerror("parser stack overflow"); - if (yyfree_stacks) - { - free ((malloc_t) yyss); - free ((malloc_t) yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif - } - return 2; - } - yystacksize *= 2; - if (yystacksize > YYMAXDEPTH) - yystacksize = YYMAXDEPTH; -#ifndef YYSTACK_USE_ALLOCA - yyfree_stacks = 1; -#endif - yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); - __yy_memcpy ((char *)yyss, (char *)yyss1, - size * (unsigned int) sizeof (*yyssp)); - yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); - __yy_memcpy ((char *)yyvs, (char *)yyvs1, - size * (unsigned int) sizeof (*yyvsp)); -#ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); - __yy_memcpy ((char *)yyls, (char *)yyls1, - size * (unsigned int) sizeof (*yylsp)); -#endif -#endif /* no yyoverflow */ - - yyssp = yyss + size - 1; - yyvsp = yyvs + size - 1; -#ifdef YYLSP_NEEDED - yylsp = yyls + size - 1; -#endif - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Stack size increased to %d\n", yystacksize); -#endif - - if (yyssp >= yyss + yystacksize - 1) - YYABORT; - } - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Entering state %d\n", yystate); -#endif - - goto yybackup; - yybackup: - -/* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to lookahead token. */ - - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* yychar is either YYEMPTY or YYEOF - or a valid token in external form. */ - - if (yychar == YYEMPTY) - { -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Reading a token: "); -#endif - yychar = YYLEX; - } - - /* Convert token to internal form (in yychar1) for indexing tables with */ - - if (yychar <= 0) /* This means end of input. */ - { - yychar1 = 0; - yychar = YYEOF; /* Don't call YYLEX any more */ - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Now at end of input.\n"); -#endif - } - else - { - yychar1 = YYTRANSLATE(yychar); - -#if YYDEBUG != 0 - if (yydebug) - { - fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); - /* Give the individual parser a way to print the precise meaning - of a token, for further debugging info. */ -#ifdef YYPRINT - YYPRINT (stderr, yychar, yylval); -#endif - fprintf (stderr, ")\n"); - } -#endif - } - - yyn += yychar1; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) - goto yydefault; - - yyn = yytable[yyn]; - - /* yyn is what to do for this token type in this state. - Negative => reduce, -yyn is rule number. - Positive => shift, yyn is new state. - New state is final state => don't bother to shift, - just return success. - 0, or most negative number => error. */ - - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto yyerrlab; - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the lookahead token. */ - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); -#endif - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; -#ifdef YYLSP_NEEDED - *++yylsp = yylloc; -#endif - - /* count tokens shifted since error; after three, turn off error status. */ - if (yyerrstatus) yyerrstatus--; - - yystate = yyn; - goto yynewstate; - -/* Do the default action for the current state. */ -yydefault: - - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - -/* Do a reduction. yyn is the number of a rule to reduce with. */ -yyreduce: - yylen = yyr2[yyn]; - if (yylen > 0) - yyval = yyvsp[1-yylen]; /* implement default value of the action */ - -#if YYDEBUG != 0 - if (yydebug) - { - int i; - - fprintf (stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); - - /* Print the symbols being reduced, and their result. */ - for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) - fprintf (stderr, "%s ", yytname[yyrhs[i]]); - fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); - } -#endif - - - switch (yyn) { - -case 1: -#line 1090 "parse.y" -{ - if (yynerrs) { - YYABORT; - } else { - YYACCEPT; - } - ; - break;} -case 2: -#line 1099 "parse.y" -{ - defStruct = FALSE; - ; - break;} -case 3: -#line 1103 "parse.y" -{ - defStruct = FALSE; - ; - break;} -case 16: -#line 1126 "parse.y" -{ - defStruct = 0; - ; - break;} -case 17: -#line 1130 "parse.y" -{ - /* - * Boogie, dude - */ - YYACCEPT; - ; - break;} -case 18: -#line 1137 "parse.y" -{ - /* - * Record entry point, and boogie - */ - entryPoint = Expr_Copy(&expr1, TRUE); - YYACCEPT; - ; - break;} -case 20: -#line 1158 "parse.y" -{ - /* - * General error handler - */ - if (yychar > FIRSTOP && yychar < LASTOP) { - yyerror("missing colon for code label %i", yyvsp[-1].ident); - } else { - yyerror("expected symbol-definition directive for %i", - yyvsp[-1].ident); - } - yyerrok; - ; - break;} -case 21: -#line 1171 "parse.y" -{; - break;} -case 22: -#line 1173 "parse.y" -{ - Sym_Reference(yyvsp[-1].sym); - ; - break;} -case 23: -#line 1181 "parse.y" -{ - /* - * Regular near label -- enter it as a FAR so that - * it can be called as a procedure - */ - yyval.sym = Sym_Enter(yyvsp[-1].ident, curProc ? SYM_LOCALLABEL : SYM_LABEL, - dot, TRUE); - curSeg->u.segment.data->lastLabel = dot; - FilterGenerated(yyval.sym); - ; - break;} -case 24: -#line 1192 "parse.y" -{ - if (yyvsp[-1].sym->type == SYM_LOCALLABEL) { - yyerror("%i is already a local label in this procedure", - yyvsp[-1].sym->name); - } else { - CheckAndSetLabel(SYM_LABEL, yyvsp[-1].sym, TRUE); - } - yyval.sym = yyvsp[-1].sym; - ; - break;} -case 25: -#line 1202 "parse.y" -{ - if (curProc == NULL) { - yyerror("local labels must occur within a procedure"); - YYERROR; - } else { - char name[12]; - ID id; - - /* - * Form the name and enter it into the string table - */ - sprintf(name, "%d$", yyvsp[-2].number); - id = ST_EnterNoLen(output, symStrings, name); - - /* - * Enter the thing as a local label, but mark it as - * something that shouldn't be written out. - */ - yyval.sym = Sym_Enter(id, SYM_LOCALLABEL, dot, TRUE); - yyval.sym->flags |= SYM_NOWRITE; - curSeg->u.segment.data->lastLabel = dot; - } - ; - break;} -case 26: -#line 1229 "parse.y" -{ - SymbolPtr sym; - - if (yyvsp[0].type->tn_type == TYPE_NEAR) { - sym = Sym_Enter(yyvsp[-2].ident, SYM_LABEL, dot, TRUE); - curSeg->u.segment.data->lastLabel = dot; - FilterGenerated(sym); - } else if (yyvsp[0].type->tn_type == TYPE_FAR) { - sym = Sym_Enter(yyvsp[-2].ident, SYM_LABEL, dot, FALSE); - curSeg->u.segment.data->lastLabel = dot; - FilterGenerated(sym); - } else { - ResetExpr(&expr1, defElts1); - DefineData(yyvsp[-2].ident, yyvsp[0].type, FALSE, FALSE); - } - ; - break;} -case 27: -#line 1246 "parse.y" -{ - if (yyvsp[0].type->tn_type == TYPE_NEAR) { - CheckAndSetLabel(SYM_LABEL, yyvsp[-2].sym, TRUE); - } else if (yyvsp[0].type->tn_type == TYPE_FAR) { - CheckAndSetLabel(SYM_LABEL, yyvsp[-2].sym, FALSE); - } else { - ResetExpr(&expr1, defElts1); - DefineDataSym(yyvsp[-2].sym, yyvsp[0].type, FALSE, FALSE); - } - ; - break;} -case 28: -#line 1264 "parse.y" -{ - Symbol *sym; - sym = Sym_Enter(yyvsp[-2].ident, SYM_PROC, dot, yyvsp[0].number); - - EnterProc(sym); - ; - break;} -case 30: -#line 1272 "parse.y" -{ - CheckAndSetLabel(SYM_PROC, yyvsp[-2].sym, yyvsp[0].number & SYM_NEAR); - yyvsp[-2].sym->u.proc.flags |= yyvsp[0].number; - EnterProc(yyvsp[-2].sym); - ; - break;} -case 32: -#line 1279 "parse.y" -{ yyval.number = yyvsp[-1].number | SYM_NEAR; ; - break;} -case 33: -#line 1280 "parse.y" -{ yyval.number = yyvsp[-1].number; ; - break;} -case 34: -#line 1282 "parse.y" -{ - /* - * If the current memory model is small or compact, - * the procedure defaults to near, else it defaults to - * far. - */ - if (model == MM_SMALL || model == MM_COMPACT) { - yyval.number = yyvsp[-1].number | SYM_NEAR; - } else { - yyval.number = yyvsp[-1].number; - } - ; - break;} -case 35: -#line 1296 "parse.y" -{ yyval.number = SYM_NO_JMP; ; - break;} -case 36: -#line 1297 "parse.y" -{ yyval.number = SYM_NO_CALL; ; - break;} -case 37: -#line 1298 "parse.y" -{ yyval.number = 0; ; - break;} -case 50: -#line 1309 "parse.y" -{ - AddArg(yyvsp[-2].ident, yyvsp[0].type); - ; - break;} -case 51: -#line 1313 "parse.y" -{ - if ((yyvsp[-2].sym->type != SYM_VAR) || warn_shadow) { - yywarning("definition of %i as argument shadows global symbol", - yyvsp[-2].sym->name); - } - AddArg(yyvsp[-2].sym->name, yyvsp[0].type); - ; - break;} -case 52: -#line 1321 "parse.y" -{ - yywarning("definition of %i as argument shadows global symbol", - yyvsp[-2].sym->name); - AddArg(yyvsp[-2].sym->name, yyvsp[0].type); - ; - break;} -case 53: -#line 1327 "parse.y" -{ - /* - * Declaring extra stuff on stack that needn't be - * referenced. - */ - AddArg(NullID, yyvsp[0].type); - ; - break;} -case 56: -#line 1341 "parse.y" -{ - if (curProc != yyvsp[-1].sym) { - if (curProc == NULL) { - yyerror("ENDP for %i outside of any procedure", - yyvsp[-1].sym->name); - } else { - yyerror("ENDP for %i inside %i", - yyvsp[-1].sym->name, curProc->name); - } - yynerrs++; - } else { - /* - * Reset procedure-specific state variables - */ - EndProc(curProc->name); - } - ; - break;} -case 57: -#line 1359 "parse.y" -{ - yyerror("procedure %i not defined, so can't be ended", yyvsp[-1].ident); - yynerrs++; - ; - break;} -case 58: -#line 1365 "parse.y" -{ - /* - * Just terminate the current procedure. - */ - if (curProc == NULL) { - yyerror("ENDP outside of any procedure"); - yynerrs++; - } else { - EndProc(curProc->name); - } - ; - break;} -case 60: -#line 1382 "parse.y" -{ yyval.number = yyvsp[-2].number | yyvsp[0].number; ; - break;} -case 61: -#line 1383 "parse.y" -{ yyval.number = yyvsp[-1].number | yyvsp[0].number; ; - break;} -case 62: -#line 1385 "parse.y" -{ yyval.number = (1L << yyvsp[0].number) | - (1L << (yyvsp[0].number + REG_DI + REG_GS + 2)); ; - break;} -case 63: -#line 1387 "parse.y" -{ yyval.number = 1L << yyvsp[0].number; ; - break;} -case 64: -#line 1388 "parse.y" -{ yyval.number = 1L << (yyvsp[0].number & 0x3); ; - break;} -case 65: -#line 1389 "parse.y" -{ yyval.number = 1L << (yyvsp[0].number + REG_DI + 1); ; - break;} -case 66: -#line 1392 "parse.y" -{ - if (enterSeen || leaveSeen) { - /* - * Generated code was incorrect -- give error - */ - yyerror("\"uses\" too late: .ENTER or .LEAVE already given for procedure %i", - curProc->name); - yynerrs++; - } - usesMask |= yyvsp[0].number; - enterNeeded = TRUE; - ; - break;} -case 68: -#line 1406 "parse.y" -{ usesMask |= yyvsp[0].number; enterNeeded = TRUE; ; - break;} -case 69: -#line 1408 "parse.y" -{; - break;} -case 70: -#line 1410 "parse.y" -{ - /* - * Initialize first-local-var flag. Doing it here avoids - * a spurious error if we bitch b/c this isn't the first - * push-initialized variable and the hoser's initializing - * this variable with BP (it'll still bitch if the push - * bp isn't the first push instruction, though). - */ - isFirstLocalWord = TRUE; - if (frameSize != yyvsp[0].number) { - yyerror("all push-initialized local variables must be declared first"); - yynerrs++; - } else { - /* - * Set special flag for pushLocal rule so it can tell - * if it's the first one (to deal with push bp). - * Besides, we need to know for sure ourselves, and - * "push bp" handling requires us to reduce localSize - * by two, so we couldn't rely on that anymore anyway. - */ - int numLocals; - - numLocals = 0; - Sym_ForEachLocal(curProc, ParseCountLocals, - (Opaque)&numLocals); - if (numLocals == 1) { - /* - * First initialized local variable, so perform - * first part of frame setup now. - */ - Code_PrologueSaveFP(); - - frameSetup = TRUE; - - isFirstLocalWord = TRUE; - } - frameSize -= yyvsp[0].number; - } - ; - break;} -case 71: -#line 1450 "parse.y" -{ - if (yyvsp[0].number * 2 < yyvsp[-2].number) { - yyerror("not enough PUSHes to initialize local variable"); - yynerrs++; - } else if (yyvsp[0].number * 2 > yyvsp[-2].number) { - yyerror("too many PUSHes initializing local variable"); - yynerrs++; - } - ; - break;} -case 72: -#line 1460 "parse.y" -{ yyval.number = yyvsp[0].number; ; - break;} -case 73: -#line 1461 "parse.y" -{ yyval.number = yyvsp[-1].number + yyvsp[0].number; ; - break;} -case 74: -#line 1464 "parse.y" -{ - /* - * Return number of words pushed. - */ - yyval.number = yyvsp[0].number; - ; - break;} -case 75: -#line 1472 "parse.y" -{ yyval.number = 1; ; - break;} -case 76: -#line 1474 "parse.y" -{ - /* - * Count another word pushed. - */ - yyval.number = yyvsp[-2].number + 1; - ; - break;} -case 77: -#line 1483 "parse.y" -{ - if ((expr1.elts[0].op == EXPR_WORDREG) && - (expr1.elts[1].reg == REG_BP)) - { - /* - * Wheee. Variable being initialized by pushing BP, so - * (a) this must be the very first local variable, and - * (b) this must be the first word of the variable being - * pushed, so we can use the automatic "push bp" of the - * prologue as this push. - * - * If these special conditions are met, we adjust "all" - * (the current one is the only one) locals by +2 to - * overlap with the bp saved by Code_PrologueSaveFP(). - */ - if (!isFirstLocalWord) { - yyerror("a local variable push-initialized with BP must be the first variable in the frame, with BP the first word pushed"); - yynerrs++; - } else { - Sym_ForEachLocal(curProc, ParseAdjustLocals, - (Opaque)2); - /* - * Adjust for word not actually in the local frame. - */ - localSize -= 2; - } - } else { - (void)Code_Push(&dot, 0, 1, &expr1, NULL, (Opaque)NULL); - } - isFirstLocalWord = FALSE; - ; - break;} -case 78: -#line 1517 "parse.y" -{ - yyval.number = 0; - - if (enterSeen || leaveSeen) { - yyerror("\"local\" too late: .ENTER or .LEAVE already given for procedure %i", - curProc->name); - yynerrs++; - } else if (!curProc) { - yyerror("LOCAL directive for %i when not in a procedure", - yyvsp[-2].ident); - yynerrs++; - } else { - /* - * Add the size of the variable to the current - * frame size to get the offset for the variable. - * No need to word-align the thing as we'll do that - * when we encounter the ENTER. - */ - yyval.number = Type_Size(yyvsp[0].type); - - localSize += yyval.number; frameSize += yyval.number; - - (void)Sym_Enter(yyvsp[-2].ident, SYM_LOCAL, -localSize, yyvsp[0].type); - - frameNeeded = enterNeeded = TRUE; - } - ; - break;} -case 80: -#line 1548 "parse.y" -{ - if ((yyvsp[0].sym->type != SYM_VAR) || warn_shadow) { - yywarning("definition of %i as local variable shadows global symbol", - yyvsp[0].sym->name); - } - yyval.ident = yyvsp[0].sym->name - ; - break;} -case 81: -#line 1555 "parse.y" -{ yyval.ident = NullID; ; - break;} -case 82: -#line 1557 "parse.y" -{ - yywarning("definition of %i as local variable shadows global symbol", - yyvsp[0].sym->name); - yyval.ident = yyvsp[0].sym->name; - ; - break;} -case 83: -#line 1565 "parse.y" -{ - if (curProc != NULL) { - Code_Prologue(frameNeeded, usesMask, frameSize, - frameSetup); - enterSeen = TRUE; - } else { - yyerror(".ENTER is outside any procedure"); - yynerrs++; - } - ; - break;} -case 84: -#line 1576 "parse.y" -{ - if (curProc != NULL) { - /* - * Inherit the frame from our caller. This allows us to - * use the same local variables through several frames - * so long as BP isn't changed. Typically, all the local - * vars will be defined in a structure and a single - * variable of that structure declared. Using the - * INHERIT kewyord turns off the frameNeeded flag. - */ - frameNeeded = FALSE; - Code_Prologue(FALSE, usesMask, 0, 1); - enterSeen = TRUE; - } else { - yyerror(".ENTER is outside any procedure"); - yynerrs++; - } - ; - break;} -case 85: -#line 1595 "parse.y" -{ - if (curProc != NULL) { - /* Use localSize, not frameSize, so we know about - * push-initialized locals... */ - Code_Epilogue(frameNeeded, usesMask, localSize); - leaveSeen = TRUE; - } else { - yyerror(".LEAVE is outside any procedure"); - yynerrs++; - } - ; - break;} -case 86: -#line 1607 "parse.y" -{ - /* - * This is a special form of .leave that allows weird - * functions that never return, but set up a stack - * frame, to shut us up... - */ - if (curProc != NULL) { - leaveSeen = TRUE; - curSeg->u.segment.data->checkLabel=TRUE; - } else { - yyerror(".LEAVE is outside any procedure"); - yynerrs++; - } - ; - break;} -case 87: -#line 1623 "parse.y" -{ - /* - * All local variables and arguments are marked as - * referenced to avoid annoying warnings when one has - * inherited some variables that one doesn't use, since - * one must inherit all variables to keep the frames - * consistent. - */ - if (curProc != NULL) { - Sym_ReferenceAllLocals(curProc); - } - ; - break;} -case 88: -#line 1636 "parse.y" -{ - /* - * Inherit from a near procedure. Adjust offsets of all - * declared args down (to account for extra word of return - * address in the current function) if current procedure is - * far. - */ - if (curProc != NULL && !(curProc->u.proc.flags & SYM_NEAR)) - { - Sym_AdjustArgOffset(curProc, -2); - } - if (curProc != NULL) { - Sym_ReferenceAllLocals(curProc); - } - ; - break;} -case 89: -#line 1652 "parse.y" -{ - /* - * Inherit from a far procedure. Adjust offsets of all - * declared args up (to account for extra word of return - * address in function where frame was set up) if - * current procedure is near. - */ - if (curProc != NULL && (curProc->u.proc.flags & SYM_NEAR)) - { - Sym_AdjustArgOffset(curProc, 2); - } - if (curProc != NULL) { - Sym_ReferenceAllLocals(curProc); - } - ; - break;} -case 90: -#line 1668 "parse.y" -{ - /* - * Inherit from a procedure that's not yet defined. - */ - if (curProc != NULL) { - Sym_Enter(yyvsp[0].ident, SYM_INHERIT, NullSymbol, curFile->name, - yylineno); - } - ; - break;} -case 91: -#line 1678 "parse.y" -{ - /* - * Inherit from a known procedure. - */ - if (yyvsp[0].sym->type != SYM_PROC) { - yyerror("cannot inherit locals from non-procedure %i", - yyvsp[0].sym->name); - yynerrs++; - } else if (curProc != NULL) { - Sym_Enter(yyvsp[0].sym->name, SYM_INHERIT, yyvsp[0].sym, curFile->name, - yylineno); - } - ; - break;} -case 92: -#line 1698 "parse.y" -{ - Sym_Enter(yyvsp[-1].ident, SYM_MACRO, yyvsp[0].macro.text, yyvsp[0].macro.numArgs, - yyvsp[0].macro.numLocals); - ; - break;} -case 93: -#line 1703 "parse.y" -{ - /* - * Macro redefinitions -- can't free the old text since - * blocks are allocated in chunks, so just store in the - * new parameters. - */ - - yyvsp[-1].sym->u.macro.text = yyvsp[0].macro.text; - yyvsp[-1].sym->u.macro.numArgs = yyvsp[0].macro.numArgs; - yyvsp[-1].sym->u.macro.numLocals = yyvsp[0].macro.numLocals; - ; - break;} -case 94: -#line 1715 "parse.y" -{ - /* - * Nothing follows, so must be a string equate. Value - * has been parsed into pieces by the scanner and - * is the value of the EQU token - */ - Sym_Enter(yyvsp[-1].ident, SYM_STRING, yyvsp[0].block); - ; - break;} -case 95: -#line 1724 "parse.y" -{ - if (yychar != '\n') { - yyerror("%i cannot be redefined as an equate", - yyvsp[-1].sym->name); - } else { - RedefineString(yyvsp[-1].sym, yyvsp[0].block); - } - ; - break;} -case 96: -#line 1733 "parse.y" -{ - /* - * This can happen if you redefine a string equate - * with another string equate. Form the string into - * a macro block and call RedefineString. - */ - int len = strlen(yyvsp[0].string); - MBlk *val; - - if (len > 0) { - val = (MBlk *)malloc_tagged(sizeof(MArg)+len, - TAG_MBLK); - - val->next = (MBlk *)NULL; - val->length = len; - val->dynamic = TRUE; - bcopy(yyvsp[0].string, val->text, len); - } else { - val = NULL; - } - - free(yyvsp[0].string); - - RedefineString(yyvsp[-2].sym, val); - ; - break;} -case 97: -#line 1759 "parse.y" -{ - Sym_Enter(yyvsp[-1].ident, SYM_STRING, yyvsp[0].block); - ; - break;} -case 98: -#line 1763 "parse.y" -{ - RedefineString(yyvsp[-1].sym, yyvsp[0].block); - ; - break;} -case 99: -#line 1768 "parse.y" -{ - /* - * Substring from position to end (1-origin) - */ - int len = strlen(yyvsp[-2].string); - - /* - * We like zero-origin... - */ - yyvsp[0].number -= 1; - - if (yyvsp[0].number < 0) { - yyerror("invalid start position %d (must be >= 1)", - yyvsp[0].number+1); - yyval.block = NULL; - yynerrs++; - } else if (yyvsp[0].number >= len) { - yyerror("start position %d too big (string is %d byte%s long)", - yyvsp[0].number+1, len, len == 1 ? "" : "s"); - yyval.block = NULL; - yynerrs++; - } else { - yyval.block = (MBlk *)malloc_tagged(sizeof(MArg)+(len-yyvsp[0].number), - TAG_MBLK); - yyval.block->dynamic = TRUE; - yyval.block->next = (MBlk *)NULL; - yyval.block->length = len-yyvsp[0].number; - bcopy(yyvsp[-2].string+yyvsp[0].number, yyval.block->text, len-yyvsp[0].number); - } - free(yyvsp[-2].string); - ; - break;} -case 100: -#line 1800 "parse.y" -{ - /* - * Substring from position of given length. - */ - int len = strlen(yyvsp[-4].string); - - /* - * We like zero-origin... - */ - yyvsp[-2].number -= 1; - - if (yyvsp[-2].number < 0) { - yyerror("invalid start position %d (must be >= 1)", - yyvsp[-2].number+1); - yyval.block = NULL; - yynerrs++; - } else if (yyvsp[-2].number >= len) { - yyerror("start position %d too big (string is %d byte%s long)", - yyvsp[-2].number+1, len, len == 1 ? "" : "s"); - yyval.block = NULL; - yynerrs++; - } else if (yyvsp[-2].number+yyvsp[0].number > len) { - yyerror("length %d too big (string is %d byte%s long)", - yyvsp[0].number, len, len == 1 ? "" : "s"); - yyval.block = NULL; - yynerrs++; - } else if (yyvsp[0].number > 0) { - yyval.block = (MBlk *)malloc_tagged(sizeof(MArg)+yyvsp[0].number, - TAG_MBLK); - yyval.block->dynamic = TRUE; - yyval.block->next = (MBlk *)NULL; - yyval.block->length = yyvsp[0].number; - bcopy(yyvsp[-4].string+yyvsp[-2].number, yyval.block->text, yyvsp[0].number); - } else { - yyval.block = NULL; - } - free(yyvsp[-4].string); - ; - break;} -case 101: -#line 1838 "parse.y" -{ yyval.block = yyvsp[0].block; ; - break;} -case 102: -#line 1848 "parse.y" -{ - /* - * Convert the string into a macro block. - */ - int len = strlen(yyvsp[0].string); - - if (len > 0) { - yyval.block = (MBlk *)malloc_tagged(sizeof(MArg)+len, - TAG_MBLK); - yyval.block->dynamic = TRUE; - yyval.block->length = len; - yyval.block->next = NULL; - bcopy(yyvsp[0].string, yyval.block->text, len); - } else { - yyval.block = NULL; - } - - free(yyvsp[0].string); - ; - break;} -case 103: -#line 1868 "parse.y" -{ - /* - * Convert the string into a macro block and link to the - * next block in the list. - */ - int len = strlen(yyvsp[-2].string); - - if (len > 0) { - yyval.block = (MBlk *)malloc_tagged(sizeof(MArg)+len, - TAG_MBLK); - yyval.block->dynamic = TRUE; - yyval.block->length = len; - yyval.block->next = yyvsp[0].block; - bcopy(yyvsp[-2].string, yyval.block->text, len); - } else { - /* - * Zero-length string, so just use the chain from - * the strings to our right. - */ - yyval.block = yyvsp[0].block; - } - - free(yyvsp[-2].string); - ; - break;} -case 104: -#line 1893 "parse.y" -{ yyrepeat(yyvsp[0].number); ; - break;} -case 105: -#line 1894 "parse.y" -{ defStruct = 1; ; - break;} -case 106: -#line 1895 "parse.y" -{ - char *id = ST_Lock(output, yyvsp[-3].ident); - - yyirp(id, yyvsp[0].string); - free(yyvsp[0].string); - ST_Unlock(output, yyvsp[-3].ident); - defStruct = 0; - ; - break;} -case 107: -#line 1903 "parse.y" -{ defStruct = 1; ; - break;} -case 108: -#line 1904 "parse.y" -{ - char *id = ST_Lock(output, yyvsp[-3].ident); - - yyirpc(id, yyvsp[0].string); - free(yyvsp[0].string); - - ST_Unlock(output, yyvsp[-3].ident); - defStruct = 0; - ; - break;} -case 109: -#line 1913 "parse.y" -{ yystartmacro(yyvsp[-1].sym, yyvsp[0].arg); ; - break;} -case 110: -#line 1914 "parse.y" -{ yystartmacro(yyvsp[0].sym, NULL); ; - break;} -case 112: -#line 1922 "parse.y" -{ yyval.arg = yyvsp[-1].arg; yyval.arg->next = yyvsp[0].arg; ; - break;} -case 113: -#line 1925 "parse.y" -{ - yyval.arg = (Arg *)malloc_tagged(sizeof(Arg), - TAG_MACRO_ARG); - yyval.arg->next = NULL; - yyval.arg->value = yyvsp[0].string; - yyval.arg->freeIt = TRUE; - ; - break;} -case 114: -#line 1936 "parse.y" -{ - yyval.arg = (Arg *)malloc_tagged(sizeof(Arg), - TAG_MACRO_ARG); - yyval.arg->next = 0; - yyval.arg->value = (char *)malloc_tagged(12, TAG_MACRO_ARG_VALUE); - yyval.arg->freeIt = TRUE; - - sprintf(yyval.arg->value, "%d", yyvsp[0].number); - noSymTrans = TRUE; - /* - * If the look-ahead token is a newline, we do *not* - * want to switch back to parsing macro arguments. - */ - if (yychar != '\n') { - yylex = yymacarglex; - } - ; - break;} -case 115: -#line 1959 "parse.y" -{ - yyval.arg = (Arg *)malloc_tagged(sizeof(Arg), TAG_MACRO_ARG); - yyval.arg->next = 0; - yyval.arg->value = (char *)malloc_tagged(12, - TAG_MACRO_ARG_VALUE); - yyval.arg->freeIt = TRUE; - - sprintf(yyval.arg->value, "%d", yyvsp[-1].number); - noSymTrans = TRUE; - /* - * If the look-ahead token is a newline, we do *not* - * want to switch back to parsing macro arguments. - */ - if (yychar != '\n') { - yylex = yymacarglex; - } - ; - break;} -case 116: -#line 1991 "parse.y" -{ yyval.number = TRUE; ; - break;} -case 117: -#line 1992 "parse.y" -{ yyval.number = FALSE; ; - break;} -case 118: -#line 1995 "parse.y" -{ - ExprResult result; - byte status; - - if (!Expr_Eval(&expr1, &result, - EXPR_RECURSIVE | EXPR_NOREF, - &status)) - { - /* - * Give error now, rather than each time the constant - * is used, then pretend the value was a constant 0. - */ - yyerror((char *)result.type); - yynerrs++; - ResetExpr(&expr1, defElts1); - StoreExprConst(0L); - } else if ((status & EXPR_STAT_DEFINED) && - !(status & EXPR_STAT_DELAY) && - (result.type == EXPR_TYPE_CONST) && - !result.rel.sym) - { - /* - * If it evaluates to a constant, replace the - * expression with the final result. This prevents - * us from generating recursive EXPR_SYMs - */ - ResetExpr(&expr1, defElts1); - StoreExprConst(result.data.number); - } - ; - break;} -case 119: -#line 2027 "parse.y" -{ - Sym_Enter(yyvsp[-2].ident, SYM_NUMBER, Expr_Copy(&expr1, TRUE), yyvsp[-1].number); - ; - break;} -case 120: -#line 2031 "parse.y" -{ - if (yyvsp[-2].sym->u.equate.rdonly) { - /* - * Generate a warning if the new value differs from the - * old. - */ - if ((yyvsp[-2].sym->u.equate.value->numElts != 2) || - (expr1.numElts != 2) || - (yyvsp[-2].sym->u.equate.value->elts[0].op != EXPR_CONST) || - (expr1.elts[0].op != EXPR_CONST) || - (yyvsp[-2].sym->u.equate.value->elts[1].value != - expr1.elts[1].value)) - { - yywarning("%i redefined", yyvsp[-2].sym->name); - } - } else if (yyvsp[-1].number) { - yywarning("%i was defined with '=' before", - yyvsp[-2].sym->name); - } - yyvsp[-2].sym->u.equate.rdonly = yyvsp[-1].number; - Expr_Free(yyvsp[-2].sym->u.equate.value); - yyvsp[-2].sym->u.equate.value = Expr_Copy(&expr1, TRUE); - ; - break;} -case 121: -#line 2055 "parse.y" -{ - /* - * This can be used to set the value given to the next - * member added to the type. - */ - yyvsp[-2].sym->u.eType.nextVal = yyvsp[0].number; - ; - break;} -case 122: -#line 2063 "parse.y" -{ - Sym_Enter(yyvsp[-1].ident, SYM_NUMBER, yyvsp[0].expr, FALSE); - ; - break;} -case 123: -#line 2067 "parse.y" -{ - if (yyvsp[-1].sym->u.equate.rdonly) { - yywarning("%i redefined with string operator", - yyvsp[-1].sym->name); - } - Expr_Free(yyvsp[-1].sym->u.equate.value); - - yyvsp[-1].sym->u.equate.value = yyvsp[0].expr; - ; - break;} -case 124: -#line 2078 "parse.y" -{ - ResetExpr(&expr1, defElts1); - StoreExprConst((long)strlen(yyvsp[0].string)); - free(yyvsp[0].string); - - yyval.expr = Expr_Copy(&expr1, TRUE); - malloc_settag((void *)yyval.expr, TAG_EQUATE_EXPR); - ; - break;} -case 125: -#line 2087 "parse.y" -{ - if (expr1.elts[0].op != EXPR_STRING) { - yyerror("two-operand INSTR directive requires string as first operand"); - yynerrs++; - ResetExpr(&expr1, defElts1); - StoreExprConst(0L); - free(yyvsp[0].string); - } else { - long n = FindSubstring(expr1.elts[1].str, yyvsp[0].string); - - free(yyvsp[0].string); - ResetExpr(&expr1, defElts1); - /* - * Wants the index to be 1-origin with 0 => no such - * substring around. - */ - StoreExprConst(n+1); - } - - yyval.expr = Expr_Copy(&expr1, TRUE); - malloc_settag((void *)yyval.expr, TAG_EQUATE_EXPR); - ; - break;} -case 126: -#line 2110 "parse.y" -{ - ExprResult result; - int start; - - /* - * Evaluate the expression we just parsed, disallowing - * any undefined symbols. XXX: What about scope - * checks for methods and instance variables? Still - * enabled at the moment... - */ - if (!Expr_Eval(&expr1, &result, EXPR_NOUNDEF|EXPR_FINALIZE, - NULL)) - { - /* - * Give error message we got back - */ - yyerror((char *)result.type); - yynerrs++; - ResetExpr(&expr1, defElts1); - StoreExprConst(0L); - } else if (result.type == EXPR_TYPE_CONST && - !result.rel.sym) - { - /* - * Use the value we got back, converting it to 0-origin - */ - start = result.data.number-1; - ResetExpr(&expr1, defElts1); - - if (start < 0) { - yyerror("search start must be >= 1"); - yynerrs++; - StoreExprConst(0); - } else if (start >= strlen(yyvsp[-2].string)) { - yyerror("search start %d is beyond end of string", - start+1); - yynerrs++; - StoreExprConst(0); - } else { - /* - * Find the index, converting it to 1-origin. - * Since FindSubstring returns -1 if the substring - * can't be found, this also takes care of - * evaluating to 0 if the string can't be found. - */ - StoreExprConst(FindSubstring(yyvsp[-2].string+start,yyvsp[0].string)+1); - } - } else { - /* - * Expression valid but not constant -- choke. - */ - yyerror("numeric constant expected for search start"); - yynerrs++; - ResetExpr(&expr1, defElts1); - StoreExprConst(0L); - } - free(yyvsp[-2].string); - free(yyvsp[0].string); - - yyval.expr = Expr_Copy(&expr1, TRUE); - malloc_settag((void *)yyval.expr, TAG_EQUATE_EXPR); - ; - break;} -case 127: -#line 2184 "parse.y" -{ - /* - * Has to be numeric, so set emptyIsConst true, then - * convert the data size into a type description. - */ - emptyIsConst = 1; - if (yyvsp[0].number == 0) { - yyval.type = Type_Char(1); - } else if (yyvsp[0].number == 'z') { - yyval.type = Type_Char(2); - } else { - yyval.type = Type_Int(yyvsp[0].number); - } - checkForStrings = (yyvsp[0].number >= -1 && yyvsp[0].number <= 1); - ; - break;} -case 128: -#line 2200 "parse.y" -{ - /* - * Set emptyIsConst true if type isn't complex (array or - * a structured type whose initializer must be a string). - * Note that we have to be careful of typedefs here (and - * later on). If $1 is a typedef, reduce it to its - * basest type. This allows us to properly handle - * array typedef initializers, for example. - */ - TypePtr checkType = yyvsp[0].type; - - while (checkType->tn_type == TYPE_STRUCT && - checkType->tn_u.tn_struct->type == SYM_TYPE) - { - checkType = checkType->tn_u.tn_struct->u.typeDef.type; - } - emptyIsConst = - !(checkType->tn_type==TYPE_ARRAY || - (checkType->tn_type==TYPE_STRUCT && - (checkType->tn_u.tn_struct->type==SYM_STRUCT || - checkType->tn_u.tn_struct->type==SYM_RECORD || - checkType->tn_u.tn_struct->type==SYM_UNION))); - - /* - * If defining an array, structure, record or union, we - * allow for comments and newlines inside <> strings in - * the scanner (the scanner strips all newlines and comments - * from the string before returning it) - */ - defStruct = !emptyIsConst; - - /* - * If type descriptor describes either an array of - * bytes/chars or it is "char" or "byte", we have to - * be careful about strings and count each character as - * an individual element... - */ - checkForStrings = - ((checkType->tn_type == TYPE_ARRAY && - Type_Size(checkType->tn_u.tn_array.tn_base)==1) || - (checkType->tn_type == TYPE_CHAR) || - (checkType->tn_type == TYPE_INT && - checkType->tn_u.tn_int == 1)) -; - yyval.type = yyvsp[0].type; - - if ((checkType->tn_type == TYPE_STRUCT) && - (checkType->tn_u.tn_struct == inStruct)) - { - yyerror("recursive structure/union"); - yynerrs++; - } else if ((checkType->tn_type == TYPE_STRUCT) && - (checkType->tn_u.tn_struct->u.typesym.size == 0)) - { - yyerror("illegal use of zero-sized structure"); - yynerrs++; - YYERROR; - } - ; - break;} -case 129: -#line 2261 "parse.y" -{ - if (yyvsp[0].number != 1) { - DefineData(yyvsp[-2].ident, Type_Array(yyvsp[0].number, yyvsp[-1].type), TRUE, TRUE); - } else { - DefineData(yyvsp[-2].ident, yyvsp[-1].type, TRUE, FALSE); - } - defStruct = FALSE; - ; - break;} -case 130: -#line 2270 "parse.y" -{ - if (yyvsp[0].number != 1) { - DefineDataSym(yyvsp[-2].sym, Type_Array(yyvsp[0].number, yyvsp[-1].type), TRUE, TRUE); - } else { - DefineDataSym(yyvsp[-2].sym, yyvsp[-1].type, TRUE, FALSE); - } - defStruct = FALSE; - ; - break;} -case 131: -#line 2279 "parse.y" -{ - yyerror("%i is already an instance variable for %i", - yyvsp[-2].sym->name, yyvsp[-2].sym->u.instvar.class->name); - yynerrs++; - ; - break;} -case 132: -#line 2285 "parse.y" -{ - if (yyvsp[0].number != 1) { - DefineData(NullID, Type_Array(yyvsp[0].number, yyvsp[-1].type), TRUE, TRUE); - } else { - DefineData(NullID, yyvsp[-1].type, TRUE, FALSE); - } - defStruct = FALSE; - ; - break;} -case 133: -#line 2301 "parse.y" -{ - yyval.ident = NullID; - if (curSeg->u.segment.data->comb != SEG_LMEM) { - yyerror("CHUNK directive is not allowed inside non-lmem segment %i", - curSeg->name); - yynerrs++; - } else if (curChunk) { - yyerror("Nested CHUNK declarations are not allowed (defining %i now)", - curChunk->name); - yynerrs++; - } else { - yyval.ident = yyvsp[-1].ident; - } - ; - break;} -case 135: -#line 2316 "parse.y" -{ - yyval.ident = NullID; - if (curSeg->u.segment.data->comb != SEG_LMEM) { - yyerror("CHUNK directive is not allowed inside non-lmem segment %i", - curSeg->name); - yynerrs++; - } else if (curChunk) { - yyerror("Nested CHUNK declarations are not allowed (defining %i now)", - curChunk->name); - yynerrs++; - } else if ((yyvsp[-1].sym->type == SYM_CHUNK) && - ((yyvsp[-1].sym->flags & SYM_UNDEF) == 0)) - { - yyerror("chunk %i is already defined", yyvsp[-1].sym->name); - yynerrs++; - } else if ((yyvsp[-1].sym->type == SYM_CHUNK) && - (yyvsp[-1].sym->flags & SYM_UNDEF)) - { - /* - * Declared global before with :chunk, so it's ok. - */ - yyval.ident = yyvsp[-1].sym->name; - if (!LMem_UsesHandles(curSeg)) { - /* - * Chunk will be redefined as a SYM_VAR, so - * prevent death. - * XXX: this should be in LMem module. - */ - yyvsp[-1].sym->type = SYM_VAR; - } - } else if ((LMem_UsesHandles(curSeg) && - (yyvsp[-1].sym->type != SYM_CHUNK)) || - (!LMem_UsesHandles(curSeg) && - (yyvsp[-1].sym->type != SYM_VAR))) - { - yyerror("%i is already something other than a chunk", - yyvsp[-1].sym->name); - yynerrs++; - } else { - yyval.ident = yyvsp[-1].sym->name; - } - ; - break;} -case 137: -#line 2359 "parse.y" -{ - yyval.ident = NullID; - if (curSeg->u.segment.data->comb != SEG_LMEM) { - yyerror("CHUNK directive is not allowed inside non-lmem segment %i", - curSeg->name); - yynerrs++; - } else if (curChunk) { - yyerror("Nested CHUNK declarations are not allowed (defining %i now)", - curChunk->name); - yynerrs++; - } - ; - break;} -case 139: -#line 2374 "parse.y" -{ - if ( warn_localize && localizationRequired ){ - Parse_LastChunkWarning("Missing @localize instruction"); - localizationRequired = 0; - } - lastChunk = curChunk = LMem_DefineChunk(yyvsp[0].type, yyvsp[-1].ident); - ParseSetLastChunkWarningInfo(); - ; - break;} -case 140: -#line 2383 "parse.y" -{ - SymbolPtr chunk; - if (yyvsp[0].number > 1) { - TypePtr t = Type_Array(yyvsp[0].number, yyvsp[-1].type); - - if ( warn_localize && localizationRequired ){ - Parse_LastChunkWarning("Missing @localize instruction"); - localizationRequired = 0; - } - lastChunk = chunk = LMem_DefineChunk(t, yyvsp[-3].ident); - ParseSetLastChunkWarningInfo(); - DefineData(NullID, t, TRUE, TRUE); - } else { - if ( warn_localize && localizationRequired ){ - Parse_LastChunkWarning("Missing @localize instruction"); - localizationRequired = 0; - } - lastChunk = chunk = LMem_DefineChunk(yyvsp[-1].type, yyvsp[-3].ident); - ParseSetLastChunkWarningInfo(); - DefineData(NullID, yyvsp[-1].type, TRUE, FALSE); - } - defStruct = FALSE; - - if (chunk != NullSymbol) { - LMem_EndChunk(chunk); - ParseLocalizationCheck(); - } - ; - break;} -case 142: -#line 2413 "parse.y" -{ yyval.type = Type_Void(); ; - break;} -case 143: -#line 2416 "parse.y" -{ - if (curChunk == NULL) { - yyerror("not defining a chunk, so %i can't be ending", - yyvsp[-1].sym->name); - yynerrs++; - } else if (yyvsp[-1].sym != curChunk) { - yyerror("%i is not the current chunk (%i is)", - yyvsp[-1].sym->name, curChunk->name); - yynerrs++; - } else { - /* - * Note: Need to set curChunk to NULL before calling - * LMem_EndChunk as that will in turn call PopSegment, - * which will be upset if curChunk is non-null, call - * LMem_EndChunk, which will call PopSegment, ... - */ - SymbolPtr chunk = curChunk; - - curChunk = NULL; - LMem_EndChunk(chunk); - ParseLocalizationCheck(); - } - ; - break;} -case 144: -#line 2441 "parse.y" -{ - if (curChunk == NULL) { - yyerror("not defining a chunk, so you can't end it"); - yynerrs++; - } else { - /* - * Note: Need to set curChunk to NULL before calling - * LMem_EndChunk as that will in turn call PopSegment, - * which will be upset if curChunk is non-null, call - * LMem_EndChunk, which will call PopSegment, ... - */ - SymbolPtr chunk = curChunk; - - curChunk = NULL; - LMem_EndChunk(chunk); - ParseLocalizationCheck(); - } - ; - break;} -case 145: -#line 2460 "parse.y" -{ - /* - * Pretend code can't be reached so Data_Enter won't - * bitch about in-line data. - */ - int prevLast = curSeg->u.segment.data->lastLabel; - - /* - * Following taken from the START_CODEGEN macro in - * code.c.... - */ - if (warn_unreach && curSeg->u.segment.data->checkLabel && - ((dot) != curSeg->u.segment.data->lastLabel)) - { - yywarning("code cannot be reached"); - } - if (fall_thru) - { - yywarning("code generated after .fall_thru"); - } - if (do_bblock && - (curSeg->u.segment.data->checkLabel || - curSeg->u.segment.data->blockStart || - ((dot) == curSeg->u.segment.data->lastLabel))) - { - Code_ProfileBBlock(&dot); - } - - curSeg->u.segment.data->checkLabel = TRUE; - curSeg->u.segment.data->lastLabel = dot-1; - /* - * Now enter the data into the segment. - */ - if (yyvsp[0].number > 1) { - DefineData(NullID, Type_Array(yyvsp[0].number, yyvsp[-1].type), TRUE, TRUE); - } else { - DefineData(NullID, yyvsp[-1].type, TRUE, FALSE); - } - /* - * Set checkLabel false to avoid multiple code-cannot-be- - * reached warnings. - */ - curSeg->u.segment.data->checkLabel = FALSE; - curSeg->u.segment.data->lastLabel = prevLast; - /* - * Set blockStart to true, as we don't know what type of - * instruction we just put in, and it's better to have too - * many profile markers than too few... - */ - curSeg->u.segment.data->blockStart = TRUE; - defStruct = FALSE; - ; - break;} -case 146: -#line 2520 "parse.y" -{ - yyval.number = yyvsp[0].number; - ; - break;} -case 148: -#line 2526 "parse.y" -{ - yyval.number = yyvsp[-2].number + yyvsp[0].number; - ; - break;} -case 149: -#line 2531 "parse.y" -{ - yyval.number = 1; - if (emptyIsConst) { - /* - * Non-structured type -- store a constant 0 - */ - StoreExprConst(0); - } else { - /* - * Structured type -- store an empty string. - */ - StoreExprString(EXPR_INIT, ""); - } - StoreExprComma(); - ; - break;} -case 150: -#line 2547 "parse.y" -{ - if (checkForStrings && - (curExpr->elts[yyvsp[0].number].op == EXPR_STRING)) - { - int nelts = ExprStrElts(curExpr->elts[yyvsp[0].number+1].str); - int len = strlen(curExpr->elts[yyvsp[0].number+1].str); - - if (curExpr->numElts == yyvsp[0].number+1+nelts && len > 1) { - /* - * If we're defining byte-data and this component - * is a multi-character string all its own (i.e. - * without any accompanying operators), then - * we want to use the length of the string to be - * the number of elements for the definition. - * Otherwise, we'd say - * db "hi there" - * is an array of 1 byte, and we'd be wrong. - */ - yyval.number = len; - } else { - yyval.number = 1; - } - } else { - yyval.number = 1; - } - StoreExprComma(); - ; - break;} -case 151: -#line 2575 "parse.y" -{ - /* - * Record the number of elements for proper duplication. - * The number must be a constant. We default the thing to - * 1 in case of error to avoid confusing DupExpr. - */ - Expr cexpr; - ExprResult result; - int value = 1; - - /* - * Manufacture a new expression that points to the - * elements we just entered, disallowing any - * undefined symbols. - */ - cexpr = *curExpr; - cexpr.elts += yyvsp[-1].number; - cexpr.numElts -= yyvsp[-1].number; - - if (!Expr_Eval(&cexpr, &result, EXPR_NOUNDEF|EXPR_FINALIZE, - NULL)) - { - /* - * Give error message we got back - */ - yyerror((char *)result.type); - yynerrs++; - } else if (result.type == EXPR_TYPE_CONST && - !result.rel.sym) - { - /* - * Use the result we got back - */ - value = result.data.number; - } else { - yyerror("invalid length for DUP operator"); - yynerrs++; - } - - /* - * Reset current expression back to where it was before - * we usurped it to store the length - */ - curExpr->numElts = yyvsp[-1].number; - /* - * Record the length of the array as our semantic value - */ - yyval.number = value; - ; - break;} -case 152: -#line 2625 "parse.y" -{ - /* - * Copy all elements between start and now the number of - * times indicated by the cexpr. We reduce that number - * by one b/c we've already got one copy... - */ - if (yyvsp[-3].number > 1) { - DupExpr(yyvsp[-3].number-1, yyvsp[-5].number); - } else if (yyvsp[-3].number == 0) { - /* - * No duplications, so return the expression to the - * state it was in before this whole hoax was - * perpetrated on us. - */ - curExpr->numElts = yyvsp[-5].number; - } - yyval.number = yyvsp[-3].number * yyvsp[-1].number; - ; - break;} -case 153: -#line 2652 "parse.y" -{ - /* - * Record current element count in case DUP operator given - */ - yyval.number = curExpr->numElts; - ; - break;} -case 154: -#line 2659 "parse.y" -{ - /* - * Return initial element count as our value - */ - yyval.number = yyvsp[-1].number; - ; - break;} -case 155: -#line 2673 "parse.y" -{ - if (localize) { - yyvsp[-1].sym->u.chunk.loc->instructions = yyvsp[0].string; - } - localizationRequired = 0; - ; - break;} -case 156: -#line 2680 "parse.y" -{ - if (localize) { - yyvsp[-3].sym->u.chunk.loc->instructions = yyvsp[-2].string; - yyvsp[-3].sym->u.chunk.loc->max = yyvsp[0].number; - } - localizationRequired = 0; - ; - break;} -case 157: -#line 2688 "parse.y" -{ - if (localize) { - yyvsp[-5].sym->u.chunk.loc->instructions = yyvsp[-4].string; - yyvsp[-5].sym->u.chunk.loc->min = yyvsp[-2].number; - yyvsp[-5].sym->u.chunk.loc->max = yyvsp[0].number; - } - localizationRequired = 0; - ; - break;} -case 158: -#line 2697 "parse.y" -{ - if (localize) { - yyvsp[-7].sym->u.chunk.loc->instructions = yyvsp[-6].string; - yyvsp[-7].sym->u.chunk.loc->min = yyvsp[-4].number; - yyvsp[-7].sym->u.chunk.loc->max = yyvsp[-2].number; - yyvsp[-7].sym->u.chunk.loc->dataTypeHint = yyvsp[0].number; - } - localizationRequired = 0; - ; - break;} -case 159: -#line 2707 "parse.y" -{ - if (localize) { - /* - * mark it as not localizable for localize.c - */ - yyvsp[-1].sym->u.chunk.loc->min = -1; - yyvsp[-1].sym->u.chunk.loc->max = -1; - } - localizationRequired = 0; - ; - break;} -case 160: -#line 2720 "parse.y" -{ - if (localize) { - /* - * Make sure the thing has a localization record. - */ - if (yyvsp[0].sym->u.chunk.loc == 0) { - yyvsp[0].sym->u.chunk.loc = Sym_AllocLoc(yyvsp[0].sym, CDT_unknown); - } - /* - * Free any previous instructions and warn the user of - * the redefinition. - */ - if (yyvsp[0].sym->u.chunk.loc->instructions != 0) { - yywarning("localization instructions already given for %i", yyvsp[0].sym->name); - free(yyvsp[0].sym->u.chunk.loc->instructions); - } - } - yyval.sym = yyvsp[0].sym; - ; - break;} -case 161: -#line 2742 "parse.y" -{ - if (yyvsp[-1].sym->type == SYM_CHUNK) { - yyval.sym = yyvsp[-1].sym; - } else { - yyerror("%i is not an lmem chunk.", yyvsp[-1].sym->name); - YYERROR; - } - ; - break;} -case 162: -#line 2751 "parse.y" -{ - if (lastChunk == 0) { - yyerror("You haven't defined an lmem chunk yet, so there's nothing to localize."); - YYERROR; - } else if (lastChunk->name == NullID) { - yyerror("The most-recent chunk cannot be localized as it has no name"); - YYERROR; - } else { - yyval.sym = lastChunk; - } - ; - break;} -case 163: -#line 2770 "parse.y" -{ - /* - * Process macros again... - */ - ignore = FALSE; - ; - break;} -case 164: -#line 2777 "parse.y" -{ - ignore = FALSE; - ; - break;} -case 165: -#line 2782 "parse.y" -{ - switch(yyvsp[-2].sym->type) { - case SYM_PUBLIC: - /* - * Transform to the proper, undefined type of - * symbol. - */ - switch(yyvsp[0].type->tn_type) { - case TYPE_NEAR: - yyvsp[-2].sym->type = SYM_PROC; - yyvsp[-2].sym->u.proc.flags = SYM_NEAR; - yyvsp[-2].sym->u.proc.locals = NULL; - break; - case TYPE_FAR: - yyvsp[-2].sym->type = SYM_PROC; - yyvsp[-2].sym->u.proc.flags = 0; - yyvsp[-2].sym->u.proc.locals = NULL; - break; - default: - yyvsp[-2].sym->type = SYM_VAR; - yyvsp[-2].sym->u.var.type = yyvsp[0].type; - break; - } - yyvsp[-2].sym->u.addrsym.offset = 0; - yyvsp[-2].sym->flags |= SYM_UNDEF; - break; - case SYM_MACRO: - case SYM_SEGMENT: - case SYM_GROUP: - case SYM_ETYPE: - case SYM_TYPE: - case SYM_STRUCT: - case SYM_RECORD: - case SYM_LOCAL: - case SYM_LOCALLABEL: - yyerror("%i: inappropriate symbol type for GLOBAL", - yyvsp[-2].sym->name); - yynerrs++; - break; - default: - /* - * Make sure the type corresponds to the existing - * one. - */ - switch(yyvsp[0].type->tn_type) { - case TYPE_NEAR: - if (!Sym_IsNear(yyvsp[-2].sym)) { - yyerror("%i: type mismatch: not a near procedure or label", - yyvsp[-2].sym->name); - yynerrs++; - } - break; - case TYPE_FAR: - if ((yyvsp[-2].sym->type != SYM_LABEL && - yyvsp[-2].sym->type != SYM_PROC) || - Sym_IsNear(yyvsp[-2].sym)) - { - yyerror("%i: type mismatch: not a far procedure or label", - yyvsp[-2].sym->name); - yynerrs++; - } - break; - default: - { - TypePtr type; - - switch(yyvsp[-2].sym->type) { - case SYM_VAR: - type = yyvsp[-2].sym->u.var.type; - break; - case SYM_INSTVAR: - type = yyvsp[-2].sym->u.instvar.type; - break; - case SYM_FIELD: - type = yyvsp[-2].sym->u.field.type; - break; - default: - type = NULL; - break; - } - if (!Type_Equal(type, yyvsp[0].type)) { - yyerror("%i: type mismatch", - yyvsp[-2].sym->name); - yynerrs++; - } - break; - } - } -#if 0 -/* if symbol already exists, it is unlikely to be undefined, wot? */ - yyvsp[-2].sym->flags |= SYM_UNDEF; -#endif - break; - } - ; - break;} -case 166: -#line 2878 "parse.y" -{ - if (yyvsp[-3].sym->type == SYM_PUBLIC) { - /* - * Transform to undefined chunk... - */ - if ((curSeg->u.segment.data->comb != SEG_LMEM) && - (curSeg->u.segment.data->comb != SEG_GLOBAL)) - { - yyerror("%i: segment mismatch (chunk symbol can't be in non-lmem segment)", - yyvsp[-3].sym->name); - yynerrs++; - } else { - /* - * Switch the segment to be the heap part of the - * group so glue doesn't bitch. Note we only do - * this if not defining a chunk. If defining a - * chunk, we're already in the correct subsegment. - */ - yyvsp[-3].sym->type = SYM_CHUNK; - if (curChunk == NULL && - curSeg->u.segment.data->comb == SEG_LMEM) - { - yyvsp[-3].sym->segment = curSeg->u.segment.data->pair; - } - yyvsp[-3].sym->flags = SYM_UNDEF|SYM_GLOBAL; - yyvsp[-3].sym->u.chunk.common.offset = 0; - yyvsp[-3].sym->u.chunk.handle = 0; - yyvsp[-3].sym->u.chunk.type = yyvsp[0].type; - } - } else if (yyvsp[-3].sym->type == SYM_CHUNK) { - if (!Type_Equal(yyvsp[-3].sym->u.chunk.type, yyvsp[0].type)) { - yyerror("%i: type mismatch", - yyvsp[-3].sym->name); - yynerrs++; - } - } else { - yyerror("%i: type mismatch: not a chunk symbol", - yyvsp[-3].sym->name); - yynerrs++; - } - ; - break;} -case 167: -#line 2920 "parse.y" -{ - if (yyvsp[-3].sym->type == SYM_PUBLIC) { - /* - * Transform to undefined FAR label - */ - yyvsp[-3].sym->type = SYM_LABEL; - yyvsp[-3].sym->flags = SYM_UNDEF|SYM_GLOBAL; - yyvsp[-3].sym->u.label.near = 0; - } else if (yyvsp[-3].sym->type != SYM_LABEL || yyvsp[-3].sym->u.label.near) { - yyerror("%i: type mismatch: wasn't a far label before", - yyvsp[-3].sym->name); - yynerrs++; - } - ; - break;} -case 168: -#line 2935 "parse.y" -{ - if (yyvsp[-3].sym->type == SYM_PUBLIC) { - /* - * Transform to undefined NEAR label - */ - yyvsp[-3].sym->type = SYM_LABEL; - yyvsp[-3].sym->flags = SYM_UNDEF|SYM_GLOBAL; - yyvsp[-3].sym->u.label.near = TRUE; - } else if (yyvsp[-3].sym->type != SYM_LABEL || !yyvsp[-3].sym->u.label.near) { - yyerror("%i: type mismatch: wasn't a near label before", - yyvsp[-3].sym->name); - yynerrs++; - } - ; - break;} -case 171: -#line 2959 "parse.y" -{ - yyval.sym = Sym_Enter(yyvsp[0].ident, SYM_PUBLIC, curFile->name, yylineno); - ; - break;} -case 172: -#line 2963 "parse.y" -{ - yyval.sym = yyvsp[0].sym; - yyval.sym->flags |= SYM_GLOBAL; - /* - * If symbol was previously declared within the global - * (nameless) segment, switch it to be this segment - * instead. - */ - if (yyval.sym->segment->name == NullID) { - yyval.sym->segment = curSeg; - } - ; - break;} -case 173: -#line 2976 "parse.y" -{ - yyval.sym = yyvsp[0].sym; - yyval.sym->flags |= SYM_GLOBAL; - /* - * If symbol was previously declared within the global - * (nameless) segment, switch it to be this segment - * instead. - */ - if (yyval.sym->segment->name == NullID) { - yyval.sym->segment = curSeg; - } - ; - break;} -case 174: -#line 2989 "parse.y" -{ - yyval.sym = yyvsp[0].sym; - yyval.sym->flags |= SYM_GLOBAL; - /* - * If symbol was previously declared within the global - * (nameless) segment, switch it to be this segment - * instead. - */ - if (yyval.sym->segment->name == NullID) { - yyval.sym->segment = curSeg; - } - ; - break;} -case 182: -#line 3010 "parse.y" -{ - switch(yyvsp[0].sym->type) { - case SYM_MACRO: - case SYM_SEGMENT: - case SYM_GROUP: - case SYM_ETYPE: - case SYM_TYPE: - case SYM_STRUCT: - case SYM_RECORD: - case SYM_LOCAL: - case SYM_LOCALLABEL: - yyerror("%i: inappropriate symbol type for PUBLIC", - yyvsp[0].sym->name); - yynerrs++; - break; - default: - /* - * Anything else can safely be marked global. - */ - yyvsp[0].sym->flags |= SYM_GLOBAL; - break; - } - ; - break;} -case 185: -#line 3044 "parse.y" -{ - if (inStruct) { - yyerror("already defining %i; nested definitions not allowed", - inStruct->name); - } else { - inStruct = Sym_Enter(yyvsp[-1].ident, SYM_STRUCT); - } - ; - break;} -case 186: -#line 3053 "parse.y" -{ - if (yyvsp[-1].sym->type != SYM_STRUCT) { - yyerror("cannot redefine union %i", yyvsp[-1].sym->name); - yynerrs++; - } else if (yyvsp[-1].sym->u.typesym.size == 0) { - /* - * Structure was referenced before either by - * declaring it empty or by declaring something - * to be a pointer to it. - * Allow a true definition now. Set the segment - * of the symbol to match the current one, rather - * than the one where it was first used... - */ - inStruct = yyvsp[-1].sym; - yyvsp[-1].sym->flags &= ~SYM_NOWRITE; - yyvsp[-1].sym->segment = curSeg; - } else { - yyerror("cannot redefine structure %i", yyvsp[-1].sym->name); - yynerrs++; - } - ; - break;} -case 187: -#line 3075 "parse.y" -{ - if (yyvsp[-1].sym != inStruct) { - if (inStruct) { - yyerror("cannot end struct/union %i while in %i", - yyvsp[-1].sym->name, inStruct->name); - } else { - yyerror("not defining any struct/union, so can't end %i", - yyvsp[-1].sym->name); - } - yynerrs++; - } else { - inStruct = NullSymbol; - } - ; - break;} -case 188: -#line 3090 "parse.y" -{ - inStruct = Sym_Enter(yyvsp[-1].ident, SYM_UNION); - ; - break;} -case 189: -#line 3094 "parse.y" -{ - if (yyvsp[-1].sym->type != SYM_UNION) { - yyerror("cannot redefine structure %i", yyvsp[-1].sym->name); - yynerrs++; - } else if (yyvsp[-1].sym->u.typesym.size == 0) { - /* - * Union was referenced before either by - * declaring it empty or by declaring something - * to be a pointer to it. - * Allow a true definition now. Set the segment - * of the symbol to match the current one, rather - * than the one where it was first used... - */ - inStruct = yyvsp[-1].sym; - yyvsp[-1].sym->flags &= ~SYM_NOWRITE; - yyvsp[-1].sym->segment = curSeg; - } else { - yyerror("cannot redefine union %i", yyvsp[-1].sym->name); - yynerrs++; - } - ; - break;} -case 190: -#line 3116 "parse.y" -{ - if (yyvsp[-1].sym != inStruct) { - if (inStruct) { - yyerror("cannot end struct/union %i while in %i", - yyvsp[-1].sym->name, inStruct->name); - } else { - yyerror("not defining any struct/union, so can't end %i", - yyvsp[-1].sym->name); - } - yynerrs++; - } else { - inStruct = NullSymbol; - } - ; - break;} -case 191: -#line 3134 "parse.y" -{ - /* - * Create a symbol for the thing and point the 'first' - * field at the list of BITFIELD symbols returned by - * recordDefs. - * - * The first element of that list will be the one with - * the highest bit offset (offsets are allocated from - * the right), so from it we can figure out how many - * bytes the record should take, as well as forming the - * overall mask for the type. - */ - SymbolPtr sym = Sym_Enter(yyvsp[-2].ident, SYM_RECORD); - SymbolPtr fld; - - sym->u.record.first = yyvsp[0].sym; - - if (yyvsp[0].sym) { - int limit = (yyvsp[0].sym->u.bitField.offset + - yyvsp[0].sym->u.bitField.width); - - if (limit > 16) { - yyerror("record may not be larger than a word"); - yynerrs++; - } - - sym->u.record.mask = (1 << limit) - 1; - sym->u.record.common.size = (limit+7)/8; - /* - * Now traverse the list to get to the last - * one and link it back to the record type. - * Sure this is inefficient, but no more so - * than creating the record symbol first and - * carrying it along as $0 through all the - * recordDefs rules... Besides, you're never - * going to have more than 32 of these things, - * even on a '386, so bugger off if you don't - * like this :) - */ - for (fld = yyvsp[0].sym; - fld->u.bitField.common.next; - fld = fld->u.bitField.common.next) - { - if (fld->name == NullID) { - /* - * Remove nameless fields from the record mask. - * This allows the NOT record_sym to test the - * unused bits... - */ - sym->u.record.mask &= - ~(((1<<(fld->u.bitField.offset+ - fld->u.bitField.width))-1) ^ - ((1<u.bitField.offset)-1)); - } - } - if (fld->name == NullID) { - /* - * Remove nameless fields from the record mask. - * This allows the NOT record_sym to test the - * unused bits... - */ - sym->u.record.mask &= - ~(((1<<(fld->u.bitField.offset+ - fld->u.bitField.width))-1) ^ - ((1<u.bitField.offset)-1)); - } - fld->u.bitField.common.next = sym; - } - ; - break;} -case 192: -#line 3204 "parse.y" -{ - Sym_Enter(yyvsp[-2].ident, SYM_TYPE, yyvsp[0].type); - ; - break;} -case 195: -#line 3217 "parse.y" -{ - yyvsp[0].sym->u.bitField.common.next = NULL; - yyval.sym = yyvsp[0].sym; - ; - break;} -case 196: -#line 3222 "parse.y" -{ - yyvsp[-2].sym->u.bitField.offset = yyvsp[0].sym->u.bitField.offset + - yyvsp[0].sym->u.bitField.width; - yyvsp[-2].sym->u.bitField.common.next = yyvsp[0].sym; - yyval.sym = yyvsp[-2].sym; - ; - break;} -case 197: -#line 3234 "parse.y" -{ yyval.sym = yyvsp[0].sym; ; - break;} -case 198: -#line 3236 "parse.y" -{ yyval.sym = NULL; ; - break;} -case 199: -#line 3238 "parse.y" -{ - if (yyvsp[0].sym != NULL) { - yyvsp[-2].sym->u.bitField.offset = yyvsp[0].sym->u.bitField.offset + - yyvsp[0].sym->u.bitField.width; - } - yyvsp[-2].sym->u.bitField.common.next = yyvsp[0].sym; - yyval.sym = yyvsp[-2].sym; - ; - break;} -case 200: -#line 3247 "parse.y" -{ - if (yyvsp[0].sym != NULL) { - yyvsp[-3].sym->u.bitField.offset = yyvsp[0].sym->u.bitField.offset + - yyvsp[0].sym->u.bitField.width; - } - yyvsp[-3].sym->u.bitField.common.next = yyvsp[0].sym; - yyval.sym = yyvsp[-3].sym; - ; - break;} -case 202: -#line 3262 "parse.y" -{ yyval.ident = NullID; ; - break;} -case 203: -#line 3265 "parse.y" -{ - yyval.sym = Sym_Enter(yyvsp[-3].ident, SYM_BITFIELD, 0, yyvsp[-1].number, - CopyExprCheckingIfZero(&expr1), - (TypePtr)NULL); - ; - break;} -case 204: -#line 3271 "parse.y" -{ - yyval.sym = Sym_Enter(yyvsp[-4].ident, SYM_BITFIELD, 0, yyvsp[-1].number, - CopyExprCheckingIfZero(&expr1), yyvsp[-3].type); - ; - break;} -case 205: -#line 3277 "parse.y" -{ - /* Value left in expr1 */ - ; - break;} -case 206: -#line 3281 "parse.y" -{ - /* - * Fields with no value default to 0 - */ - ResetExpr(&expr1, defElts1); - StoreExprConst(0); - ; - break;} -case 209: -#line 3297 "parse.y" -{ - yyval.number = 0; - ; - break;} -case 210: -#line 3301 "parse.y" -{ - yyval.number = yyvsp[-1].number | SYM_ETYPE_PROTOMINOR; - if (curProtoMinor != NullSymbol) { - yywarning("protominor %i still active. Are you sure you want that?", - curProtoMinor->name); - } - ; - break;} -case 211: -#line 3310 "parse.y" -{ - yyval.etype.size = 2; - yyval.etype.start = 0; - yyval.etype.skip = 1; - yyval.etype.flags = yyvsp[0].number; - ; - break;} -case 212: -#line 3317 "parse.y" -{ - yyval.etype.size = yyvsp[0].number; - yyval.etype.start = 0; - yyval.etype.skip = 1; - yyval.etype.flags = yyvsp[-1].number; - ; - break;} -case 213: -#line 3324 "parse.y" -{ - yyval.etype.size = yyvsp[-2].number; - yyval.etype.start = yyvsp[0].number; - yyval.etype.skip = 1; - yyval.etype.flags = yyvsp[-3].number; - ; - break;} -case 214: -#line 3331 "parse.y" -{ - yyval.etype.size = yyvsp[-4].number; - yyval.etype.start = yyvsp[-2].number; - yyval.etype.skip = yyvsp[0].number; - if (yyvsp[0].number == 0) { - yywarning("are you sure you want a skip value of 0?"); - } - yyval.etype.flags = yyvsp[-5].number; - ; - break;} -case 215: -#line 3342 "parse.y" -{ - Sym_Enter(yyvsp[-2].ident, SYM_ETYPE, yyvsp[0].etype.start, yyvsp[0].etype.skip, yyvsp[0].etype.size, - yyvsp[0].etype.flags); - ; - break;} -case 216: -#line 3347 "parse.y" -{ - SymbolPtr e; - - e = Sym_Enter(yyvsp[-2].ident, SYM_ENUM, yyvsp[0].sym, yyvsp[0].sym->u.eType.nextVal); - if (yyvsp[0].sym->u.eType.flags & SYM_ETYPE_PROTOMINOR) { - e->u.econst.protoMinor = curProtoMinor; - } - ; - break;} -case 217: -#line 3356 "parse.y" -{ - SymbolPtr e; - - e = Sym_Enter(yyvsp[-4].ident, SYM_ENUM, yyvsp[-2].sym, yyvsp[0].number); - if (yyvsp[-2].sym->u.eType.flags & SYM_ETYPE_PROTOMINOR) { - e->u.econst.protoMinor = curProtoMinor; - } - ; - break;} -case 218: -#line 3365 "parse.y" -{ - if (yyvsp[-2].sym->type != SYM_ENUM) { - yyerror("%i: type mismatch: wasn't an enum before", - yyvsp[-2].sym->name); - yynerrs++; - } else { - /* - * Let Sym_Enter worry about linkage etc. - */ - SymbolPtr e; - - e = Sym_Enter(yyvsp[-2].sym->name,SYM_ENUM, yyvsp[0].sym, - yyvsp[0].sym->u.eType.nextVal); - if (yyvsp[0].sym->u.eType.flags & SYM_ETYPE_PROTOMINOR) { - e->u.econst.protoMinor = curProtoMinor; - } - } - ; - break;} -case 219: -#line 3384 "parse.y" -{ - if (yyvsp[-4].sym->type != SYM_ENUM) { - yyerror("%i: type mismatch: wasn't an enum before", - yyvsp[-4].sym->name); - yynerrs++; - } else { - /* - * Let Sym_Enter worry about linkage etc. - */ - SymbolPtr e; - - e = Sym_Enter(yyvsp[-4].sym->name,SYM_ENUM, yyvsp[-2].sym, yyvsp[0].number); - if (yyvsp[-2].sym->u.eType.flags & SYM_ETYPE_PROTOMINOR) { - e->u.econst.protoMinor = curProtoMinor; - } - } - ; - break;} -case 220: -#line 3413 "parse.y" -{ - yyval.type = Type_Array(yyvsp[-4].number, yyvsp[-1].type); - ; - break;} -case 222: -#line 3424 "parse.y" -{ - yyval.number = yyvsp[0].number; - ; - break;} -case 223: -#line 3428 "parse.y" -{ - ExprResult result; - - yyval.number = 0; - if (!Expr_Eval(yyvsp[0].sym->u.equate.value, &result, - EXPR_NOUNDEF|EXPR_FINALIZE, NULL)) - { - yyerror((char *)result.type); - yynerrs++; - } else if (result.type == EXPR_TYPE_CONST && - !result.rel.sym) - { - yyval.number = result.data.number; - } else { - yyerror("equate %i is not constant", yyvsp[0].sym->name); - yynerrs++; - } - ; - break;} -case 224: -#line 3447 "parse.y" -{ - if (yyvsp[0].sym->type != SYM_BITFIELD) { - yyerror("invalid operand of WIDTH (%i)", yyvsp[0].sym->name); - } else { - yyval.number = yyvsp[0].sym->u.bitField.width; - yynerrs++; - } - ; - break;} -case 225: -#line 3456 "parse.y" -{ - /* - * Width of a record is just the position of the last - * bit in the mask, which we can find by nuking all the - * preceding bits and calling ffs to find the remaining - * one. - */ - word m = yyvsp[0].sym->u.record.mask; - - yyval.number = ffs(m ^ (m >> 1)); - ; - break;} -case 226: -#line 3468 "parse.y" -{ - if (yychar == IDENT) { - yyerror("%i not defined yet and cannot be forward-referenced here", - yyvsp[0].ident); - } else { - yyerror("invalid operand of WIDTH"); - } - ; - break;} -case 227: -#line 3476 "parse.y" -{ yyval.number = yyvsp[-2].number + yyvsp[0].number; ; - break;} -case 228: -#line 3477 "parse.y" -{ yyval.number = yyvsp[-2].number - yyvsp[0].number; ; - break;} -case 229: -#line 3478 "parse.y" -{ yyval.number = yyvsp[-2].number * yyvsp[0].number; ; - break;} -case 230: -#line 3480 "parse.y" -{ - if (yyvsp[0].number == 0) { - yyerror("divide by 0"); - yynerrs++; - yyval.number = 0; - } else { - yyval.number = yyvsp[-2].number / yyvsp[0].number; - } - ; - break;} -case 231: -#line 3490 "parse.y" -{ - if (yyvsp[0].number == 0) { - yyerror("mod by 0"); - yynerrs++; - yyval.number = 0; - } else { - yyval.number = yyvsp[-2].number % yyvsp[0].number; - } - ; - break;} -case 232: -#line 3500 "parse.y" -{ - yyval.number = yyvsp[-2].number << yyvsp[0].number; - ; - break;} -case 233: -#line 3504 "parse.y" -{ - yyval.number = yyvsp[-2].number >> yyvsp[0].number; - ; - break;} -case 234: -#line 3508 "parse.y" -{ - yyval.number = yyvsp[-1].number; - ; - break;} -case 235: -#line 3513 "parse.y" -{ yyval.type = Type_Struct(yyvsp[0].sym); ; - break;} -case 236: -#line 3514 "parse.y" -{ yyval.type = Type_Struct(yyvsp[0].sym); ; - break;} -case 237: -#line 3515 "parse.y" -{ yyval.type = Type_Struct(yyvsp[0].sym); ; - break;} -case 238: -#line 3516 "parse.y" -{ yyval.type = Type_Struct(yyvsp[0].sym); ; - break;} -case 240: -#line 3519 "parse.y" -{ - if (yyvsp[0].number == 0) { - yyval.type = Type_Char(1); - } else if (yyvsp[0].number == 'z') { - yyval.type = Type_Char(2); - } else { - yyval.type = Type_Int(yyvsp[0].number); - } - ; - break;} -case 241: -#line 3528 "parse.y" -{ yyval.type = Type_Far(); ; - break;} -case 242: -#line 3529 "parse.y" -{ yyval.type = Type_Near(); ; - break;} -case 243: -#line 3530 "parse.y" -{ yyval.type = Type_Ptr(yyvsp[0].number, Type_Void()); ; - break;} -case 244: -#line 3532 "parse.y" -{ yyval.type = Type_Ptr(yyvsp[-2].number, yyvsp[0].type); ; - break;} -case 245: -#line 3534 "parse.y" -{ - /* - * Assume it's a structure of some sort. Create a 0-sized - * SYM_STRUCT symbol for it -- Swat will know it's - * external if it has no fields... - */ - SymbolPtr ssym = Sym_Enter(yyvsp[0].ident, SYM_STRUCT); - - ssym->flags |= SYM_NOWRITE; - - yyval.type = Type_Ptr(yyvsp[-2].number,Type_Struct(ssym)); - ; - break;} -case 247: -#line 3554 "parse.y" -{ ResetExpr(&expr1, defElts1); ; - break;} -case 248: -#line 3555 "parse.y" -{ ResetExpr(&expr2, defElts2); ; - break;} -case 249: -#line 3557 "parse.y" -{ - /* - * Save previous expression state and reset the temporary - * expression for our own use. - */ - yyval.exprSave.curExpr = curExpr; - yyval.exprSave.curExprSize = curExprSize; - - ResetExpr(&texpr, defTElts); - ; - break;} -case 254: -#line 3573 "parse.y" -{ - ExprResult result; - - yyval.number = 0; - - /* - * Evaluate the expression we just parsed, disallowing - * any undefined symbols. XXX: What about scope - * checks for methods and instance variables? Still - * enabled at the moment... - */ - if (!Expr_Eval(&texpr, &result, EXPR_NOUNDEF|EXPR_FINALIZE, - NULL)) - { - /* - * Give error message we got back - */ - yyerror((char *)result.type); - yynerrs++; - yyval.number = 0; - } else if (result.type == EXPR_TYPE_CONST && - !result.rel.sym) - { - /* - * Use the value we got back - */ - yyval.number = result.data.number; - } else if (result.type == EXPR_TYPE_STRING) { - /* - * Make sure the string constant is small enough. By - * definition, only single or double-character - * strings will fit in a single word... - */ - if (strlen(result.data.str) > 2) { - yyerror("string \"%s\" too long -- 2 characters max", - result.data.str); - yynerrs++; - yyval.number = 0; - } else { - yyval.number = result.data.str[0]|(result.data.str[1] << 8); - } - } else { - /* - * Expression valid but not constant -- choke. - */ - yyerror("constant expected"); - yynerrs++; - yyval.number = 0; - } - - /* - * Free any extra elements and go back to the - * interrupted expression. - */ - RestoreExpr(&yyvsp[-1].exprSave); - ; - break;} -case 255: -#line 3637 "parse.y" -{ - if (indir) { - StoreExprReg(EXPR_EINDREG, yyvsp[0].number); - } else { - StoreExprReg(EXPR_DWORDREG, yyvsp[0].number); - } - ; - break;} -case 256: -#line 3645 "parse.y" -{ - if (indir) { - if (yyvsp[0].number != REG_BP && yyvsp[0].number != REG_SI && yyvsp[0].number != REG_DI && - yyvsp[0].number != REG_BX) - { - yyerror("illegal register for indirection"); - yynerrs++; - /* Fake a valid register to prevent Expr_Eval - from dying. */ - StoreExprReg(EXPR_INDREG, REG_SI); - } else { - StoreExprReg(EXPR_INDREG, yyvsp[0].number); - } - } else { - StoreExprReg(EXPR_WORDREG, yyvsp[0].number); - } - ; - break;} -case 257: -#line 3663 "parse.y" -{ - if (indir) { - yyerror("cannot indirect through a byte-sized register"); - yynerrs++; - /* Fake a valid register to prevent Expr_Eval - from dying. */ - StoreExprReg(EXPR_INDREG, REG_SI); - } else { - StoreExprReg(EXPR_BYTEREG, yyvsp[0].number); - } - ; - break;} -case 258: -#line 3674 "parse.y" -{ StoreExprReg(EXPR_SEGREG, yyvsp[0].number); ; - break;} -case 259: -#line 3676 "parse.y" -{ - /* - * Undefined things count as 0, since we don't do any sort - * of compression or object record stuff to isolate - * undefined regions...This probably shouldn't be - * allowed in a general expression, but it makes it easier - * in "def" if we do this here. - */ - StoreExprConst(0); - ; - break;} -case 260: -#line 3686 "parse.y" -{ StoreExprOp(EXPR_OVERRIDE); ; - break;} -case 261: -#line 3688 "parse.y" -{ - StoreExprOp(EXPR_CAST); - ; - break;} -case 262: -#line 3691 "parse.y" -{ StoreExprType(yyvsp[-1].type); ; - break;} -case 263: -#line 3692 "parse.y" -{ - StoreExprOp(EXPR_CAST); - ; - break;} -case 264: -#line 3695 "parse.y" -{ StoreExprType(yyvsp[0].type); ; - break;} -case 265: -#line 3696 "parse.y" -{ StoreExprOp(EXPR_SHORT); ; - break;} -case 266: -#line 3698 "parse.y" -{ - if (yyvsp[-1].sym->u.record.first == NULL) { - yyerror("cannot initialize record %i -- it has no fields", - yyvsp[-1].sym->name); - free(yyvsp[0].string); - YYERROR; - } else { - Data_EncodeRecord(yyvsp[-1].sym, yyvsp[0].string); - } - ; - break;} -case 267: -#line 3709 "parse.y" -{ - free(yyvsp[-4].string); - ; - break;} -case 269: -#line 3713 "parse.y" -{ StoreExprOp(EXPR_PLUS); ; - break;} -case 270: -#line 3714 "parse.y" -{ StoreExprOp(EXPR_PLUS); ; - break;} -case 272: -#line 3717 "parse.y" -{ - StoreExprString(EXPR_STRING, yyvsp[0].string); - free(yyvsp[0].string); - ; - break;} -case 273: -#line 3722 "parse.y" -{ - StoreExprString(EXPR_INIT, yyvsp[0].string); - free(yyvsp[0].string); - ; - break;} -case 274: -#line 3726 "parse.y" -{ StoreExprSymbol(yyvsp[0].sym); ; - break;} -case 275: -#line 3727 "parse.y" -{ StoreSubExpr(yyvsp[0].expr); ; - break;} -case 276: -#line 3728 "parse.y" -{ StoreSubExpr(yyvsp[0].sym->u.equate.value); ; - break;} -case 277: -#line 3730 "parse.y" -{ - /* - * Make sure it's accessible - */ - if (!(yyvsp[0].sym->u.method.flags & SYM_METH_PUBLIC) && - warn_private && - !CheckRelated(curClass, yyvsp[0].sym->u.method.class)) - { - yywarning("private method %i used outside class %i", - yyvsp[0].sym->name, yyvsp[0].sym->u.method.class->name); - } - StoreExprSymbol(yyvsp[0].sym); - ; - break;} -case 278: -#line 3744 "parse.y" -{ - /* - * Make sure it's accessible - */ - if (! (yyvsp[0].sym->u.instvar.flags & SYM_VAR_PUBLIC) && - warn_private && - !CheckRelated(curClass, yyvsp[0].sym->u.instvar.class)) - { - yywarning("private instance variable %i used outside class %i", - yyvsp[0].sym->name, yyvsp[0].sym->u.instvar.class->name); - } - StoreExprSymbol(yyvsp[0].sym); - ; - break;} -case 279: -#line 3757 "parse.y" -{ StoreExprSymbol(yyvsp[0].sym); ; - break;} -case 280: -#line 3758 "parse.y" -{ StoreExprIdent(yyvsp[0].ident); ; - break;} -case 281: -#line 3759 "parse.y" -{ StoreExprSymbol(yyvsp[0].sym); ; - break;} -case 282: -#line 3761 "parse.y" -{ - /* - * Handle the use of this specially when defining a - * structure, where it refers to the current structOffset - */ - if (inStruct) { - StoreExprConst(inStruct->u.typesym.size); - } else { - /* - * We use a nameless local label for all occurrences of - * DOT. There's no need to refer to the thing again, - * but it does need to be in the segment's address - * chain so it can be shifted as necessary. - */ - StoreExprSymbol(Sym_Enter(NullID, SYM_LABEL,dot,TRUE)); - } - ; - break;} -case 283: -#line 3779 "parse.y" -{ - if (yyvsp[0].type == Type_Near() || yyvsp[0].type == Type_Far()) { - StoreExprSymbol(Sym_Enter(NullID, SYM_LABEL, dot, - yyvsp[0].type->tn_type==TYPE_NEAR)); - } else { - StoreExprSymbol(Sym_Enter(NullID, SYM_VAR, dot, yyvsp[0].type)); - } - ; - break;} -case 284: -#line 3787 "parse.y" -{ StoreExprConst(yyvsp[0].number); ; - break;} -case 285: -#line 3789 "parse.y" -{ - /* - * Local label -- find the thing, if possible, else - * store IDENT - */ - ID id; - char buf[20]; - SymbolPtr sym; - - sprintf(buf, "%d$", yyvsp[-1].number); - id = ST_EnterNoLen(output, symStrings, buf); - sym = Sym_Find(id, SYM_LOCALLABEL, FALSE); - if (sym != NULL) { - StoreExprSymbol(sym); - } else { - StoreExprIdent(id); - } - ; - break;} -case 286: -#line 3807 "parse.y" -{ StoreExprOp(EXPR_SEGPART); ; - break;} -case 287: -#line 3808 "parse.y" -{ StoreExprOp(EXPR_OFFPART); ; - break;} -case 288: -#line 3809 "parse.y" -{ StoreExprOp(EXPR_HIGHPART); ; - break;} -case 289: -#line 3810 "parse.y" -{ StoreExprOp(EXPR_LOWPART); ; - break;} -case 290: -#line 3811 "parse.y" -{ StoreExprOp(EXPR_SUPER); ; - break;} -case 291: -#line 3812 "parse.y" -{ StoreExprOp(EXPR_PLUS); ; - break;} -case 292: -#line 3813 "parse.y" -{ StoreExprOp(EXPR_DOT); ; - break;} -case 293: -#line 3814 "parse.y" -{ StoreExprOp(EXPR_MINUS); ; - break;} -case 294: -#line 3815 "parse.y" -{ StoreExprOp(EXPR_TIMES); ; - break;} -case 295: -#line 3816 "parse.y" -{ StoreExprOp(EXPR_DIV); ; - break;} -case 296: -#line 3817 "parse.y" -{ StoreExprOp(EXPR_MOD); ; - break;} -case 297: -#line 3818 "parse.y" -{ StoreExprOp(EXPR_FMASK); ; - break;} -case 298: -#line 3819 "parse.y" -{ StoreExprOp(EXPR_NEG); ; - break;} -case 299: -#line 3820 "parse.y" -{ /* Do nothing */ ; - break;} -case 300: -#line 3821 "parse.y" -{ StoreExprOp(EXPR_NOT); ; - break;} -case 301: -#line 3822 "parse.y" -{ StoreExprOp(EXPR_SHR); ; - break;} -case 302: -#line 3823 "parse.y" -{ StoreExprOp(EXPR_SHL); ; - break;} -case 303: -#line 3824 "parse.y" -{ StoreExprOp(EXPR_EQ); ; - break;} -case 304: -#line 3825 "parse.y" -{ StoreExprOp(EXPR_NEQ); ; - break;} -case 305: -#line 3826 "parse.y" -{ StoreExprOp(EXPR_LT); ; - break;} -case 306: -#line 3827 "parse.y" -{ StoreExprOp(EXPR_LE); ; - break;} -case 307: -#line 3828 "parse.y" -{ StoreExprOp(EXPR_GT); ; - break;} -case 308: -#line 3829 "parse.y" -{ StoreExprOp(EXPR_GE); ; - break;} -case 309: -#line 3830 "parse.y" -{ StoreExprOp(EXPR_AND); ; - break;} -case 310: -#line 3831 "parse.y" -{ StoreExprOp(EXPR_OR); ; - break;} -case 311: -#line 3832 "parse.y" -{ StoreExprOp(EXPR_XOR); ; - break;} -case 312: -#line 3833 "parse.y" -{ StoreExprOp(EXPR_HIGH); ; - break;} -case 313: -#line 3834 "parse.y" -{ StoreExprOp(EXPR_LOW); ; - break;} -case 314: -#line 3835 "parse.y" -{ StoreExprOp(EXPR_SEG); ; - break;} -case 315: -#line 3836 "parse.y" -{ StoreExprOp(EXPR_SEG); ; - break;} -case 316: -#line 3837 "parse.y" -{ StoreExprOp(EXPR_SEGREGOF); ; - break;} -case 317: -#line 3838 "parse.y" -{ StoreExprOp(EXPR_VSEG); ; - break;} -case 318: -#line 3839 "parse.y" -{ StoreExprOp(EXPR_OFFSET); ; - break;} -case 319: -#line 3840 "parse.y" -{ StoreExprOp(EXPR_TYPEOP); ; - break;} -case 320: -#line 3841 "parse.y" -{ StoreExprOp(EXPR_LENGTH); ; - break;} -case 321: -#line 3842 "parse.y" -{ StoreExprOp(EXPR_SIZE); ; - break;} -case 322: -#line 3843 "parse.y" -{ StoreExprOp(EXPR_WIDTH); ; - break;} -case 323: -#line 3844 "parse.y" -{ StoreExprOp(EXPR_MASK); ; - break;} -case 324: -#line 3845 "parse.y" -{ StoreExprOp(EXPR_FIRST); ; - break;} -case 325: -#line 3846 "parse.y" -{ StoreExprOp(EXPR_DOTTYPE); ; - break;} -case 326: -#line 3847 "parse.y" -{ StoreExprOp(EXPR_HANDLE); ; - break;} -case 327: -#line 3848 "parse.y" -{ StoreExprOp(EXPR_RESID); ; - break;} -case 328: -#line 3849 "parse.y" -{ StoreExprOp(EXPR_ENUM); ; - break;} -case 329: -#line 3851 "parse.y" -{StoreExprFloatStack(0L);; - break;} -case 330: -#line 3852 "parse.y" -{StoreExprFloatStack(yyvsp[-1].number);; - break;} -case 332: -#line 3855 "parse.y" -{indir=0; StoreExprOp(EXPR_INDIRECT); ; - break;} -case 333: -#line 3856 "parse.y" -{indir = 0; ; - break;} -case 334: -#line 3858 "parse.y" -{indir = 1; ; - break;} -case 335: -#line 3870 "parse.y" -{ - Scan_DontUseOpProc(yyvsp[-1].number); - ; - break;} -case 336: -#line 3874 "parse.y" -{ - Scan_DontUseOpProc(yyvsp[-1].number); - ; - break;} -case 337: -#line 3878 "parse.y" -{ - int i; - - for (i = NumElts(exprs)-1; i >= 0; i--) { - bzero(exprs[i]->segments, sizeof(exprs[i]->segments)); - } - - Scan_DontUseOpProc(yyvsp[-1].number); - ; - break;} -case 338: -#line 3889 "parse.y" -{ - yyval.number = Scan_UseOpProc(findSegToken); - ; - break;} -case 342: -#line 3895 "parse.y" -{ yyval.sym = NullSymbol; ; - break;} -case 343: -#line 3897 "parse.y" -{ - if (makeDepend) { - /* - * If creating dependencies, ignore undefined - * segments, as they might be defined in a .rdef - * file...which will go away eventually, but until - * it does, it's really annoying. - */ - yyval.sym = NullSymbol; - } else { - yyerror("%i is neither a segment nor a group", yyvsp[0].ident); - YYERROR; - } - ; - break;} -case 344: -#line 3912 "parse.y" -{ - ExprResult result; - - StoreExprOp(EXPR_SEG); - if (!Expr_Eval(&expr1, &result, EXPR_NOUNDEF|EXPR_FINALIZE, - NULL)) - { - /* - * Give error message we got back. - */ - yyerror((char *)result.type); - yynerrs++; - } else { - /* - * Result must be a segment constant b/c the last - * thing we stuck in was an EXPR_SEG operator. - */ - assert(result.type == EXPR_TYPE_CONST && - result.rel.type == FIX_SEGMENT); - yyval.sym = result.rel.frame; - } - ; - break;} -case 345: -#line 3936 "parse.y" -{ - /* - * Bind the segment symbol to the register in all the - * temporary expressions. SEGREG gives us a number from - * 0 to 5... - */ - int i; - - for (i = NumElts(exprs)-1; i >= 0; i--) { - exprs[i]->segments[yyvsp[-2].number] = yyvsp[0].sym; - } - ; - break;} -case 348: -#line 3953 "parse.y" -{ - yyval.number = Scan_UseOpProc(findSegToken); - ; - break;} -case 351: -#line 3959 "parse.y" -{ - /* - * Declaration of a segment as an LMem group whose - * data are (possibly) defined in a different object - * file. We need to have LMem create the segments - * but not fill them in. - */ - Scan_DontUseOpProc(yyvsp[-2].number); - - if (ParseIsLibName(yyvsp[-3].ident)) { - yyerror("cannot create a non-library segment whose name matches the permanent name of this library"); - yyval.sym = NullSymbol; - } else { - yyval.sym = LMem_CreateSegment(yyvsp[-3].ident); - } - ; - break;} -case 352: -#line 3976 "parse.y" -{ - Scan_DontUseOpProc(yyvsp[-2].number); - - if ((yyvsp[-3].sym->type != SYM_GROUP) || - (yyvsp[-3].sym->u.group.nSegs != 2) || - (yyvsp[-3].sym->u.group.segs[0]->u.segment.data->comb!=SEG_LMEM)|| - (yyvsp[-3].sym->u.group.segs[1]->u.segment.data->comb!=SEG_LMEM)) - { - yyerror("cannot redefine segment %i as an lmem segment", - yyvsp[-3].sym->name); - yynerrs++; - yyval.sym = NullSymbol; - } else { - yyval.sym = yyvsp[-3].sym; - } - ; - break;} -case 353: -#line 3994 "parse.y" -{ - Scan_DontUseOpProc(yyvsp[-1].number); - - if (!ParseIsLibName(yyvsp[-2].ident)) { - PushSegment(Sym_Enter(yyvsp[-2].ident, SYM_SEGMENT, yyvsp[0].seg.comb, - yyvsp[0].seg.align, yyvsp[0].seg.class)); - } else if (yyvsp[0].seg.comb != SEG_LIBRARY) { - yyerror("cannot create a non-library segment whose name matches the permanent name of this library"); - } else { - /* - * When defining symbols for this library, always - * enter the global scope, thereby exiting any library - * segment scopes we might be in currently. - */ - PushSegment(global); - } - ; - break;} -case 354: -#line 4012 "parse.y" -{ - /* - * Create an LMem segment. $2 is the segment type. - * $4 is the flags for the segment. $6 is the extra - * free space requested. - */ - if (yyvsp[-5].sym != NullSymbol) { - LMem_InitSegment(yyvsp[-5].sym, yyvsp[-4].number, yyvsp[-2].number, yyvsp[0].number); - } - ; - break;} -case 355: -#line 4023 "parse.y" -{ - /* - * Create an LMem segment. $2 is the segment type. - * $4 is the flags for the segment. - */ - if (yyvsp[-3].sym != NullSymbol) { - LMem_InitSegment(yyvsp[-3].sym, yyvsp[-2].number, yyvsp[0].number, 0); - } - ; - break;} -case 356: -#line 4033 "parse.y" -{ - /* - * Like above, except defaults flags to 0, since - * for now, none of them should be set anyway :) - */ - - if (yyvsp[-1].sym != NullSymbol) { - LMem_InitSegment(yyvsp[-1].sym, yyvsp[0].number, 0, 0); - } - ; - break;} -case 357: -#line 4044 "parse.y" -{ - /* - * Push to the data portion of the group to allow the - * user to continue entering data or to add chunks or - * whatever. - */ - if (yyvsp[0].sym != NullSymbol) { - PushSegment(yyvsp[0].sym->u.group.segs[0]); - } - ; - break;} -case 358: -#line 4055 "parse.y" -{ - if ((yyvsp[-3].sym->type != SYM_SEGMENT) || - (yyvsp[-3].sym->u.segment.data->comb != SEG_ABSOLUTE)) - { - yyerror("cannot redefine %i as an absolute segment", - yyvsp[-3].sym->name); - yynerrs++; - } - Scan_DontUseOpProc(yyvsp[-2].number); - PushSegment(yyvsp[-3].sym); /* XXX */ - ; - break;} -case 359: -#line 4067 "parse.y" -{ - Scan_DontUseOpProc(yyvsp[-2].number); - if (ParseIsLibName(yyvsp[-3].ident)) { - yyerror("cannot create a non-library segment whose name matches the permanent name of this library"); - } else { - PushSegment(Sym_Enter(yyvsp[-3].ident, SYM_SEGMENT, SEG_ABSOLUTE, - yyvsp[0].number)); - } - ; - break;} -case 360: -#line 4077 "parse.y" -{ - Scan_DontUseOpProc(yyvsp[-1].number); - - if (yyvsp[-2].sym->type == SYM_GROUP) { - /* - * User only allowed to do this for LMem segments, - * which are groups masquerading as segments. - * An LMem segment (group) may only have two segment - * elements and both must be marked as LMem segments. - * Anything else is a faux pas. - */ - if ((yyvsp[-2].sym->u.group.nSegs != 2) || - (yyvsp[-2].sym->u.group.segs[0]->u.segment.data->comb!=SEG_LMEM) || - (yyvsp[-2].sym->u.group.segs[1]->u.segment.data->comb!=SEG_LMEM)) - { - yyerror("%i is not a segment", yyvsp[-2].sym->name); - yynerrs++; - } else { - /* - * Switch to the data segment of the LMem group, - * since not w/in a chunk. - */ - PushSegment(yyvsp[-2].sym->u.group.segs[0]); - } - } else if (yyvsp[-2].sym->type != SYM_SEGMENT) { - yyerror("%i is not a segment", yyvsp[-2].sym->name); - yynerrs++; - } else { - /* - * Check each type of attribute for conflicts with - * existing ones. An attribute was given if it is - * non-zero in the segAttrs semantic value. - */ - if (yyvsp[0].seg.comb) { - if (yyvsp[-2].sym->u.segment.data->comb && - (yyvsp[-2].sym->u.segment.data->comb != yyvsp[0].seg.comb)) - { - yyerror("inconsistent combine types for %i", - yyvsp[-2].sym->name); - yynerrs++; - } else if (yyvsp[0].seg.comb == SEG_LMEM) { - yyerror("lmem segments must be denoted as such when first declared"); - yynerrs++; - } else { - yyvsp[-2].sym->u.segment.data->comb = yyvsp[0].seg.comb; - } - } - if (yyvsp[0].seg.align) { - if (yyvsp[-2].sym->u.segment.data->align && - (yyvsp[-2].sym->u.segment.data->align != yyvsp[0].seg.align)) - { - yyerror("inconsistent alignments for %i", - yyvsp[-2].sym->name); - yynerrs++; - } else { - yyvsp[-2].sym->u.segment.data->align = yyvsp[0].seg.align; - } - } - if (yyvsp[0].seg.class) { - if (yyvsp[-2].sym->u.segment.data->class && - yyvsp[-2].sym->u.segment.data->class != yyvsp[0].seg.class) - { - yyerror("inconsistent classes for %i", - yyvsp[-2].sym->name); - yynerrs++; - } else { - yyvsp[-2].sym->u.segment.data->class = yyvsp[0].seg.class; - } - } - /* - * Enter into the segment. - */ - PushSegment(yyvsp[-2].sym); - } - ; - break;} -case 361: -#line 4157 "parse.y" -{ - /* - * Initialize our return value; this always gets reduced - * first. - */ - yyval.seg.align = yyval.seg.comb = 0; yyval.seg.class = NullID; - yyval.seg.flags = 0; - ; - break;} -case 362: -#line 4166 "parse.y" -{ - yyval.seg = yyvsp[-1].seg; - if (yyvsp[-1].seg.flags & yyvsp[0].seg.flags) { - yyerror("duplicate definition of segment %s attribute", - yyvsp[0].seg.flags == SA_COMBINE ? "combine type" : - (yyvsp[0].seg.flags == SA_ALIGNMENT ? "alignment" : - "class")); - } else { - /* - * Copy appropriate value from $2 into final value. - */ - switch (yyvsp[0].seg.flags) { - case SA_COMBINE: - yyval.seg.comb = yyvsp[0].seg.comb; - break; - case SA_ALIGNMENT: - yyval.seg.align = yyvsp[0].seg.align; - break; - case SA_CLASS: - yyval.seg.class = yyvsp[0].seg.class; - break; - } - yyval.seg.flags |= yyvsp[0].seg.flags; - } - ; - break;} -case 363: -#line 4193 "parse.y" -{ - yyval.seg.align = yyvsp[0].number; yyval.seg.flags = SA_ALIGNMENT; - ; - break;} -case 364: -#line 4197 "parse.y" -{ - yyval.seg.comb = yyvsp[0].number; yyval.seg.flags = SA_COMBINE; - ; - break;} -case 365: -#line 4201 "parse.y" -{ - yyval.seg.class = ST_EnterNoLen(output, permStrings, yyvsp[0].string); - yyval.seg.flags = SA_CLASS; - free(yyvsp[0].string); - ; - break;} -case 366: -#line 4209 "parse.y" -{ - if (yyvsp[-1].sym->type == SYM_GROUP) { - /* - * User only allowed to do this for LMem segments, - * which are groups masquerading as segments. - * An LMem segment (group) may only have two segment - * elements and both must be marked as LMem segments. - * Anything else is a faux pas. - */ - if ((yyvsp[-1].sym->u.group.nSegs != 2) || - (yyvsp[-1].sym->u.group.segs[0]->u.segment.data->comb!=SEG_LMEM) || - (yyvsp[-1].sym->u.group.segs[1]->u.segment.data->comb!=SEG_LMEM)) - { - yyerror("%i is not a segment", yyvsp[-1].sym->name); - yynerrs++; - } else if ((curSeg != yyvsp[-1].sym->u.group.segs[0]) && - (curSeg != yyvsp[-1].sym->u.group.segs[1])) - { - yyerror("%i is not current segment (%i is)", - yyvsp[-1].sym->name, curSeg->name); - yynerrs++; - } else { - PopSegment(); - } - } else if (yyvsp[-1].sym->type != SYM_SEGMENT) { - yyerror("%i is not a segment", yyvsp[-1].sym->name); - yynerrs++; - } else if (yyvsp[-1].sym != curSeg) { - yyerror("%i is not the current segment (%i is)", - yyvsp[-1].sym->name, curSeg->name); - yynerrs++; - } else { - PopSegment(); - } - ; - break;} -case 367: -#line 4245 "parse.y" -{ - if (!ParseIsLibName(yyvsp[-1].ident)) { - yyerror("cannot end segment/structure %i as it doesn't exist", yyvsp[-1].ident); - yynerrs++; - } else if (curSeg != global || segStack == NULL) { - yyerror("%i is not the current segment (%i is)", - yyvsp[-1].ident, curSeg->name); - yynerrs++; - } else { - /* - * Get out of the global scope we entered when we - * were asked to enter the segment - */ - PopSegment(); - } - ; - break;} -case 368: -#line 4261 "parse.y" -{ yyval.sym=Sym_Enter(yyvsp[-1].ident,SYM_GROUP,0); ; - break;} -case 370: -#line 4263 "parse.y" -{ - if (yyvsp[-1].sym->type != SYM_GROUP) { - yyerror("%i is not a group", yyvsp[-1].sym->name); - yynerrs++; - } - yyval.sym = yyvsp[-1].sym; /* Pass to groupList even if bogus */ - ; - break;} -case 372: -#line 4281 "parse.y" -{ - yyval.sym = Sym_Enter(yyvsp[0].ident, SYM_SEGMENT,0,0,0); - ; - break;} -case 373: -#line 4285 "parse.y" -{ - if (yyvsp[0].sym->type != SYM_SEGMENT) { - yyerror("%i is not a segment", yyvsp[0].sym->name); - yynerrs++; - } - yyval.sym = yyvsp[0].sym; - ; - break;} -case 374: -#line 4293 "parse.y" -{ - yyval.sym = yyvsp[0].sym->segment; - ; - break;} -case 375: -#line 4298 "parse.y" -{ - /* - * Propagate the group symbol to the $1 position for later - * incarnations of this rule - */ - yyval.sym = yyvsp[-1].sym; - if (yyval.sym->type == SYM_GROUP) { - Sym_AddToGroup(yyval.sym, yyvsp[0].sym); - } - ; - break;} -case 376: -#line 4309 "parse.y" -{ - yyval.sym = yyvsp[-2].sym; /* Propagate */ - if (yyval.sym->type == SYM_GROUP) { - Sym_AddToGroup(yyval.sym, yyvsp[0].sym); - } - ; - break;} -case 377: -#line 4329 "parse.y" -{ - yyval.number = Scan_UseOpProc(findClassToken); - ; - break;} -case 378: -#line 4333 "parse.y" -{ yyval.number = OBJ_STATIC; ; - break;} -case 379: -#line 4334 "parse.y" -{ yyval.number = OBJ_PRIVSTATIC; ; - break;} -case 380: -#line 4335 "parse.y" -{ yyval.number = OBJ_PRIVSTATIC; ; - break;} -case 381: -#line 4336 "parse.y" -{ yyval.number = OBJ_DYNAMIC; ; - break;} -case 382: -#line 4337 "parse.y" -{ yyval.number = OBJ_DYNAMIC_CALLABLE; ; - break;} -case 383: -#line 4341 "parse.y" -{ - yyval.number = yyvsp[-1].number; - methFlags = yyvsp[0].number; - ; - break;} -case 384: -#line 4345 "parse.y" -{ ignore = FALSE; ; - break;} -case 385: -#line 4346 "parse.y" -{ - yyval.number = yyvsp[-3].number; - methFlags = OBJ_EXTERN | yyvsp[0].number; - ; - break;} -case 386: -#line 4355 "parse.y" -{ - EnterProc(Sym_Enter(yyvsp[-2].ident, SYM_PROC, dot, 0)); - /* - * If marked external, it needs to be made global so it - * will link successfully with the module that has the - * class record. - */ - if (methFlags & OBJ_EXTERN) { - curProc->flags |= SYM_GLOBAL; - } - EnterClass(yyvsp[0].sym); - /* - * Create expression for use by Obj_EnterHandler. - */ - ResetExpr(&expr1, defElts1); - StoreExprSymbol(curProc); - ; - break;} -case 387: -#line 4373 "parse.y" -{ - Scan_DontUseOpProc(yyvsp[-5].number); - ; - break;} -case 388: -#line 4377 "parse.y" -{ - /* - * Generate special messages if given an identifier (class - * not defined) or something symbol other than a class - * (symbol not a class). Anything else we leave as a generic - * parse error. - */ - if (yychar == IDENT) { - yyerror("class %i not defined", yyvsp[0].ident); - yynerrs++; - } else if (yychar > FIRSTSYM && yychar < LASTSYM) { - yyerror("%i not a class", yyvsp[0].sym->name); - yynerrs++; - } - Scan_DontUseOpProc(yyvsp[-1].number); - ; - break;} -case 389: -#line 4394 "parse.y" -{ - CheckAndSetLabel(SYM_PROC, yyvsp[-2].sym, 0); - /* - * Prepare for creating expression for use by - * Obj_EnterHandler. - */ - ResetExpr(&expr1, defElts1); - if (yyvsp[-2].sym->type != SYM_PROC) { - yyerror("%i cannnot be a method handler as it's not a procedure", - yyvsp[-2].sym->name); - yynerrs++; - /* - * Tell methodList not to do anything. - */ - curExpr = NULL; - } else { - EnterProc(yyvsp[-2].sym); - EnterClass(yyvsp[0].sym); - /* - * Store the name of the procedure for use by - * Obj_EnterHandler - */ - StoreExprSymbol(curProc); - /* - * If marked external, it needs to be made global so it - * will link successfully with the module that has the - * class record. - */ - if (methFlags & OBJ_EXTERN) { - curProc->flags |= SYM_GLOBAL; - } - } - ; - break;} -case 390: -#line 4428 "parse.y" -{ - Scan_DontUseOpProc(yyvsp[-5].number); - ; - break;} -case 391: -#line 4432 "parse.y" -{ - /* - * Generate special messages if given an identifier (class - * not defined) or something symbol other than a class - * (symbol not a class). Anything else we leave as a generic - * parse error. - */ - if (yychar == IDENT) { - yyerror("class %i not defined", yyvsp[0].ident); - yynerrs++; - } else if (yychar > FIRSTSYM && yychar < LASTSYM) { - yyerror("%i not a class", yyvsp[0].sym->name); - yynerrs++; - } - Scan_DontUseOpProc(yyvsp[-1].number); - ; - break;} -case 392: -#line 4449 "parse.y" -{ - /* - * Make the current procedure into a "friend" of the given - * class, to use the C++ term. This allows it to access - * private methods and instance variables of the class - * without getting a warning. - */ - if (curProc == NULL) { - yyerror("friend declaration for %i must be inside a procedure", - yyvsp[0].sym->name); - yynerrs++; - } else if (curClass && curClass != yyvsp[0].sym) { - yyerror("%i is already bound to class `%i'", - curProc->name, curClass->name); - yynerrs++; - } else { - EnterClass(yyvsp[0].sym); - defClass = FALSE; - } - ; - break;} -case 393: -#line 4471 "parse.y" -{ - yyval.extMeth.curProc = curProc; - yyval.extMeth.curClass = curClass; - curClass = yyvsp[0].sym; - curProc = yyvsp[-2].sym; - /* - * Create expression for use by Obj_EnterHandler. - */ - ResetExpr(&expr1, defElts1); - StoreExprSymbol(curProc); - ; - break;} -case 394: -#line 4483 "parse.y" -{ - curClass = yyvsp[-2].extMeth.curClass; - curProc = yyvsp[-2].extMeth.curProc; - Scan_DontUseOpProc(yyvsp[-6].number); - ; - break;} -case 395: -#line 4489 "parse.y" -{ - Scan_DontUseOpProc(yyvsp[-1].number); - ; - break;} -case 396: -#line 4495 "parse.y" -{ - /* - * Make sure the specified method is a far procedure. - */ - if (yyvsp[0].sym->type != SYM_PROC || Sym_IsNear(yyvsp[0].sym)) - { - yyerror("methods must be FAR procedures"); - yynerrs++; - YYERROR; - } else { - yyval.sym = yyvsp[0].sym; - } - ; - break;} -case 397: -#line 4509 "parse.y" -{ - /* - * Manufacture an undefined far SYM_PROC symbol for the - * thing... - */ - yyval.sym = Sym_Enter(yyvsp[0].ident, SYM_PUBLIC, curFile->name, yylineno); - yyval.sym->type = SYM_PROC; - yyval.sym->u.proc.flags = 0; - yyval.sym->u.proc.locals = NULL; - yyval.sym->u.addrsym.offset = 0; - yyval.sym->flags |= SYM_UNDEF; - yyval.sym->segment = global; - ; - break;} -case 400: -#line 4528 "parse.y" -{ - if (curExpr) { - if (!CheckRelated(curClass, yyvsp[0].sym->u.method.class)) { - yywarning("%i is not a valid method for %i", - yyvsp[0].sym->name, curClass->name); - } - - if (curClass->flags & SYM_UNDEF) { - if (!(methFlags & OBJ_EXTERN)) { - yyerror("class record for %i is not defined yet", - curClass->name); - yynerrs++; - } - } else { - Obj_EnterHandler(curClass, curProc, yyvsp[0].sym, curExpr, - methFlags & OBJ_STATIC_MASK); - } - } - ; - break;} -case 401: -#line 4548 "parse.y" -{ - if (curExpr) { - if (curClass->flags & SYM_UNDEF) { - if (!(methFlags & OBJ_EXTERN)) { - yyerror("class record for %i is not defined yet", - curClass->name); - yynerrs++; - } - } else { - Obj_EnterDefault(curClass, curProc, curExpr, - methFlags & OBJ_STATIC_MASK); - } - } - ; - break;} -case 402: -#line 4563 "parse.y" -{ - if (curExpr) { - if (curClass->flags & SYM_UNDEF) { - if (!(methFlags & OBJ_EXTERN)) { - yyerror("class record for %i is not defined yet", - curClass->name); - yynerrs++; - } - } else { - Obj_EnterReloc(curClass, curProc, curExpr); - } - } - ; - break;} -case 403: -#line 4577 "parse.y" -{ - /* - * Elaborate a bit if the method constant isn't defined. - */ - if (yychar == IDENT) { - yyerror("message %i not defined", yyvsp[0].ident); - yyclearin; - } - ; - break;} -case 404: -#line 4589 "parse.y" -{ - if (curProc != yyvsp[-1].sym) { - if (curProc == NULL) { - yyerror("ENDM for %i is outside of any method", - yyvsp[-1].sym->name); - } else { - yyerror("ENDM for %i is inside %i", - yyvsp[-1].sym->name, curProc->name); - } - yynerrs++; - } else if (curClass == NULL) { - yyerror("ENDM for non-method %i", yyvsp[-1].sym->name); - yynerrs++; - } else { - /* - * Reset procedure-specific state variables - */ - EndProc(curProc->name); - } - ; - break;} -case 405: -#line 4610 "parse.y" -{ - yyerror("method %i not defined, so can't be ended", yyvsp[-1].ident); - yynerrs++; - ; - break;} -case 406: -#line 4619 "parse.y" -{ - yyval.number = classProc; - classProc = Scan_UseOpProc(findClassToken); - ; - break;} -case 407: -#line 4624 "parse.y" -{ - if (curClass) { - yyerror("nested class declarations are not allowed (in %i now)", - curClass->name); - yynerrs++; - Scan_DontUseOpProc(classProc); - classProc = yyvsp[-1].number; - } else if (yyvsp[0].classDecl.class != (SymbolPtr)1) { - EnterClass(Obj_DeclareClass(yyvsp[-3].ident, yyvsp[0].classDecl.class, yyvsp[0].classDecl.flags)); - defClass = TRUE; - isPublic = FALSE; - - /* - * Since we're declaring a new class, we have to - * reset the protominor symbol - */ - curProtoMinor = NullSymbol; - } - ; - break;} -case 408: -#line 4644 "parse.y" -{ - yyval.number = classProc; - classProc = Scan_UseOpProc(findClassToken); - ; - break;} -case 409: -#line 4649 "parse.y" -{ - if (((yyvsp[-3].sym->flags & SYM_UNDEF) == 0) || - (yyvsp[-3].sym->u.class.instance != NULL)) - { - yyerror("class %i is already defined", yyvsp[-3].sym->name); - yynerrs++; - Scan_DontUseOpProc(classProc); - classProc = yyvsp[-1].number; - } else if (curClass) { - yyerror("nested class declarations are not allowed (in %i now)", - curClass->name); - yynerrs++; - Scan_DontUseOpProc(classProc); - classProc = yyvsp[-1].number; - } else if (yyvsp[0].classDecl.class != (SymbolPtr)1) { - EnterClass(Obj_DeclareClass(yyvsp[-3].sym->name, yyvsp[0].classDecl.class, - yyvsp[0].classDecl.flags)); - defClass = TRUE; - isPublic = FALSE; - } - ; - break;} -case 410: -#line 4672 "parse.y" -{ - if (yyvsp[0].sym->u.class.data->flags & SYM_CLASS_FORWARD) { - yyerror("%i must be defined before it can be used as a superclass.", - yyvsp[0].sym->name); - YYERROR; - } - yyval.classDecl.class = yyvsp[0].sym; - yyval.classDecl.flags = 0; - ; - break;} -case 411: -#line 4682 "parse.y" -{ - /* - * Class with no super class. NOTE: This is *only* for - * MetaClass, hence it accepts neither "master" nor - * "variant". - */ - if (yyvsp[0].number != 0) { - yyerror("superclass must be another class or 0"); - yynerrs++; - } - yyval.classDecl.class = NULL; - yyval.classDecl.flags = 0; - ; - break;} -case 412: -#line 4696 "parse.y" -{ - yyval.classDecl.class = yyvsp[-2].sym; - yyval.classDecl.flags = SYM_CLASS_MASTER; - ; - break;} -case 413: -#line 4701 "parse.y" -{ - /* - * By definition, a variant class must be the beginning - * of a group, so it must be a master class. - */ - yyval.classDecl.class = yyvsp[-2].sym; - yyval.classDecl.flags = SYM_CLASS_MASTER | SYM_CLASS_VARIANT; - ; - break;} -case 414: -#line 4710 "parse.y" -{ - yyval.classDecl.class = yyvsp[-4].sym; - yyval.classDecl.flags = SYM_CLASS_MASTER | SYM_CLASS_VARIANT; - ; - break;} -case 415: -#line 4715 "parse.y" -{ - yyval.classDecl.class = yyvsp[-4].sym; - yyval.classDecl.flags = SYM_CLASS_MASTER | SYM_CLASS_VARIANT; - ; - break;} -case 416: -#line 4720 "parse.y" -{ - if (yychar == '\n' || - yychar == MASTER || - yychar == VARIANT) - { - yyerror("class declaration missing superclass"); - } else { - yyerror("superclass must be another class or 0"); - } - yyval.classDecl.class = (SymbolPtr)1; - yyval.classDecl.flags = 0; - ; - break;} -case 417: -#line 4737 "parse.y" -{ - yyval.number = 0; - ; - break;} -case 418: -#line 4741 "parse.y" -{ - yyval.number = SYM_METH_PUBLIC; - ; - break;} -case 419: -#line 4745 "parse.y" -{ - /* - * A method is public unless explicitly designated as - * private. - */ - yyval.number = SYM_METH_PUBLIC; - ; - break;} -case 420: -#line 4754 "parse.y" -{ - if (!defClass) { - yyerror("MESSAGE declaration for %i not inside class declaration", - yyvsp[-2].ident); - yynerrs++; - } else { - SymbolPtr methodSym; - Obj_CheckMessageBounds(curClass); - methodSym = Sym_Enter(yyvsp[-2].ident, SYM_METHOD, curClass, yyvsp[0].number); - - /* - * Point the new message's protominor pointer at - * the current protominor symbol. - */ - - methodSym->u.method.common.protoMinor = curProtoMinor; - } - Scan_DontUseOpProc(yyvsp[-1].number); - ; - break;} -case 421: -#line 4777 "parse.y" -{ - if (yyvsp[0].sym->type == SYM_METHOD) { - /* - * 1.X-style exported message range - */ - SymbolPtr class = yyvsp[0].sym->u.method.class; - SymbolPtr methods = class->u.class.data->methods; - SymbolPtr methodSym; - int offset; - - /* - * Switch counter for the Methods enumerated type to be - * that of the indicated method plus its current offset, - * then up the offset by one in case there's a next - * time. - */ - offset = (yyvsp[0].sym->u.method.flags & SYM_METH_RANGE_LENGTH) >> - SYM_METH_RANGE_LENGTH_OFFSET; - - methods->u.eType.nextVal = - yyvsp[0].sym->u.method.common.value + offset; - - yyvsp[0].sym->u.method.flags = - (yyvsp[0].sym->u.method.flags & ~SYM_METH_RANGE_LENGTH) | - ((offset+1) << SYM_METH_RANGE_LENGTH_OFFSET); - - methodSym = Sym_Enter(yyvsp[-2].ident, SYM_METHOD, class, SYM_METH_PUBLIC); - methodSym->u.method.common.protoMinor = curProtoMinor; - - } else { - SymbolPtr range; - - range = Sym_Find(yyvsp[0].sym->name, SYM_METHOD, FALSE); - - if (range == NullSymbol) { - yyerror("%i is not an exported message range, so you cannot import %i into it", - yyvsp[0].sym->name, yyvsp[-2].ident); - } else if (yyvsp[0].sym->u.eType.nextVal == - (range->u.method.common.value + - ((range->u.method.flags & SYM_METH_RANGE_LENGTH) >> - SYM_METH_RANGE_LENGTH_OFFSET))) - { - yyerror("too many messages imported into %i", range->name); - } else { - SymbolPtr class = range->u.method.class; - SymbolPtr msg; - - msg = Sym_Enter(yyvsp[-2].ident, SYM_ENUM, yyvsp[0].sym, - yyvsp[0].sym->u.eType.nextVal); - - msg->type = SYM_METHOD; - msg->u.method.common.protoMinor = curProtoMinor; - msg->u.method.class = class; - msg->u.method.flags = SYM_METH_PUBLIC; - } - } - Scan_DontUseOpProc(yyvsp[-1].number); - ; - break;} -case 423: -#line 4842 "parse.y" -{ - if (geosRelease >= 2) { - yyerror("%i is not an exported message range.", - yyvsp[0].sym->name); - YYERROR; - } else { - yyval.sym = yyvsp[0].sym; - } - ; - break;} -case 424: -#line 4852 "parse.y" -{ - /* - * See if this thing is an exported message range by looking - * explicitly for a SYM_METHOD symbol of the same name. - */ - yyval.sym = Sym_Find(yyvsp[0].ident, SYM_METHOD, FALSE); - if (yyval.sym != NullSymbol) { - /* - * It is indeed. Create the appropriate enumerated - * type, starting at the value bound to the METHOD - * symbol, increasing by 1, and taking 2 bytes to - * hold it. - */ - yyval.sym = Sym_Enter(yyvsp[0].ident, SYM_ETYPE, yyval.sym->u.method.common.value, - 1, 2, 0); - } else { - yyerror("%i is not an exported message range.", yyvsp[0].ident); - YYERROR; - } - ; - break;} -case 425: -#line 4874 "parse.y" -{ - if (!curClass || !defClass) { - yyerror("VarData can only be declared while declaring a class"); - } else { - SymbolPtr varSym; - Obj_CheckVarDataBounds(curClass); - varSym = Sym_Enter(yyvsp[-2].ident, SYM_VARDATA, - curClass->u.class.data->vardata, - curClass->u.class.data->vardata->u.eType.nextVal, - yyvsp[0].type); - /* - * Point the new vardata's protominor pointer at - * the current protominor symbol. - */ - varSym->u.varData.common.protoMinor = curProtoMinor; - } - ; - break;} -case 426: -#line 4892 "parse.y" -{ yyval.type = (TypePtr)NULL; ; - break;} -case 428: -#line 4897 "parse.y" -{ - curProtoMinor = yyvsp[0].sym; - ; - break;} -case 429: -#line 4903 "parse.y" -{ - yyval.sym = yyvsp[0].sym; - ; - break;} -case 430: -#line 4907 "parse.y" -{ - /* - * We can't enter it into the (null) segment, since - * that would cause Sym_SetAddress to die, so if - * there's no current segment, we'll make one - */ - - if (curSeg->name == NullID) { - - /* - * If there's already a bogus segment for us to - * use, we'll just use it. Otherwise, we need a - * new one. - * 12/21/94: use word alignment to flag special - * proto minor segment in Glue -- ardeb - */ - - if (protoMinorSymbolSeg == NullSymbol) { - char name[25]; - ID bogusId; - - sprintf(name, "ProtoMinorSymbolSegment"); - bogusId = ST_EnterNoLen(output, symStrings, name); - protoMinorSymbolSeg = Sym_Enter(bogusId, - SYM_SEGMENT, - SEG_LIBRARY, - 1, NullID); - } - - /* - * Make the bogus segment the current segment so - * that our symbol ends up there - */ - - PushSegment(protoMinorSymbolSeg); - } - - /* - * Enter the protominor symbol into the current segment - * as an undefined global. - */ - curProtoMinor = Sym_Enter(yyvsp[0].ident, SYM_PROTOMINOR); - curProtoMinor->flags |= SYM_GLOBAL|SYM_UNDEF; - yyval.sym = curProtoMinor; - - /* - * Clean up the segment stack if we had to use a - * bogus segment. - */ - if (curSeg == protoMinorSymbolSeg) { - PopSegment(); - } - ; - break;} -case 431: -#line 4963 "parse.y" -{ - curProtoMinor = NullSymbol; - ; - break;} -case 432: -#line 4973 "parse.y" -{ - if (!curClass || !defClass) { - yyerror("PUBLIC when not declaring a class"); - yynerrs++; - } else { - isPublic = TRUE; - } - /* - * Scan turns on ignoring when PUBLIC seen. We need to - * turn it off again... - */ - ignore = FALSE; - ; - break;} -case 434: -#line 4989 "parse.y" -{ - yyvsp[0].sym->u.instvar.flags |= SYM_VAR_PUBLIC; - ; - break;} -case 435: -#line 4993 "parse.y" -{ - switch(yychar) { - case IDENT: - /* - * Assume "public" came too soon. - */ - yyerror("instance variable %i not defined yet", - yyvsp[0].ident); - break; - case SYM: - case EXPR_SYM: - case CLASS_SYM: - case STRUCT_SYM: - case METHOD_SYM: - case MODULE_SYM: - case TYPE_SYM: - case ETYPE_SYM: - case RECORD_SYM: - case PROTOMINOR_SYM: - /* - * Can only declare instance variables public - * here, mate. - */ - yyerror("symbol %i is not an instance variable, so it cannot be given as the argument for PUBLIC inside a class definition", - yyvsp[0].sym->name); - break; - } - /* - * Biff the erroneous token and move on to the next element - * in the list by allowing errors to happen. - */ - yyclearin; - yyerrok; - ; - break;} -case 438: -#line 5032 "parse.y" -{ - if ((expr1.numElts == 2) && - (expr1.elts[0].op == EXPR_SYMOP) && - (expr1.elts[1].sym->type == SYM_VARDATA)) - { - /* - * If only element of the operand is a VARDATA tag, - * it means the user doesn't want a relocation table - * for anything in the associated data, so pass NULL - * to Obj_NoReloc to indicate this, along with the - * tag from the bowels of the expression. - */ - Obj_NoReloc(curClass, expr1.elts[1].sym, NULL); - } else { - Obj_NoReloc(curClass, NullSymbol, &expr1); - } - - ; - break;} -case 439: -#line 5051 "parse.y" -{ - if ((expr1.numElts != 2) || - (expr1.elts[0].op != EXPR_SYMOP) || - (expr1.elts[1].sym->type != SYM_VARDATA)) - { - yyerror("this form of noreloc operand requires a defined vardata type before the parenthesized field that's not to be relocated"); - } else { - Obj_NoReloc(curClass, expr1.elts[1].sym, &expr2); - } - ; - break;} -case 440: -#line 5062 "parse.y" -{ - switch(yychar) { - case IDENT: - /* - * Assume "noreloc" came too soon. - */ - yyerror("instance variable %i not defined yet", - yyvsp[0].ident); - break; - case SYM: - case EXPR_SYM: - case CLASS_SYM: - case STRUCT_SYM: - case METHOD_SYM: - case PROTOMINOR_SYM: - case MODULE_SYM: - case TYPE_SYM: - case ETYPE_SYM: - case RECORD_SYM: - /* - * Can only declare instance variables public - * here, mate. - */ - yyerror("symbol %i is not an instance variable", - yyvsp[0].sym->name); - break; - } - /* - * Biff the erroneous token and move on to the next element - * in the list by allowing errors to happen. - */ - yyclearin; - yyerrok; - ; - break;} -case 444: -#line 5106 "parse.y" -{ - isPublic = FALSE; - ; - break;} -case 445: -#line 5110 "parse.y" -{ - yyerror("state variables are not supported"); - yynerrs++; - ; - break;} -case 447: -#line 5117 "parse.y" -{ - if (!curClass || !defClass) { - yyerror("not in class declaration"); - yynerrs++; - } else { - ClassData *cd = curClass->u.class.data; - - /* - * Make room for another symbol in the list of used - * classes - */ - cd->numUsed += 1; - cd = (ClassData *)realloc((void *)cd, - sizeof(ClassData) + - (cd->numUsed * - sizeof(SymbolPtr))); - curClass->u.class.data = cd; - - /* - * Stick the indicated one into the list - */ - cd->used[cd->numUsed-1] = yyvsp[0].sym; - } - ; - break;} -case 449: -#line 5144 "parse.y" -{ - /* - * Assume this thing will be declared a class later and - * enter a forward declaration for it. - */ - yyval.sym = Obj_DeclareClass(yyvsp[0].ident, NullSymbol, SYM_CLASS_FORWARD); - ; - break;} -case 453: -#line 5157 "parse.y" -{ - if (!curClass || !defClass) { - yyerror("cannot export a message range when not defining a class"); - yynerrs++; - } else { - Obj_ExportMessages(curClass, yyvsp[-2].ident, &expr1); - } - ; - break;} -case 454: -#line 5166 "parse.y" -{ - if (!curClass || !defClass) { - yyerror("ENDC when not defining class %i", yyvsp[-1].sym->name); - yynerrs++; - } else { - defClass = FALSE; - EndClass(); - Scan_DontUseOpProc(classProc); - classProc = -1; - - /* - * We'll reset curProtoMinor here as well so that - * wacky things like exported message ranges don't - * inherit this class's curProtoMinor. - */ - curProtoMinor = NullSymbol; - } - ; - break;} -case 455: -#line 5189 "parse.y" -{ - if (yyvsp[-1].sym->u.class.data->flags & SYM_CLASS_FORWARD) { - yyerror("class %i not defined", yyvsp[-1].sym->name); - } else if (yyvsp[-1].sym->flags & SYM_UNDEF) { - Obj_DefineClass(yyvsp[-1].sym, yyvsp[0].classDef.flags, yyvsp[0].classDef.initRoutine); - } else { - yyerror("class %i is multiply defined", yyvsp[-1].sym->name); - yynerrs++; - } - ; - break;} -case 456: -#line 5201 "parse.y" -{ - yyval.classDef.initRoutine = yyval.classDef.flags = (Expr *)NULL; - ; - break;} -case 457: -#line 5205 "parse.y" -{ - yyval.classDef.flags = &expr1; - yyval.classDef.initRoutine = (Expr *)NULL; - ; - break;} -case 458: -#line 5210 "parse.y" -{ - yyval.classDef.flags = &expr1; - yyval.classDef.initRoutine = &expr2; - ; - break;} -case 463: -#line 5224 "parse.y" -{ - (void)Code_Arith2(&dot, 0, 1, &expr1, &expr2, (Opaque)yyvsp[-3].opcode); - ; - break;} -case 464: -#line 5228 "parse.y" -{ - (void)Code_Arpl(&dot, 0, 1, &expr1, &expr2, (Opaque)yyvsp[-3].opcode); - ; - break;} -case 465: -#line 5232 "parse.y" -{ - (void)Code_BitNF(&dot, 0, 1, &expr1, &expr2, (Opaque)yyvsp[-3].opcode); - ; - break;} -case 466: -#line 5236 "parse.y" -{ - (void)Code_Bound(&dot, 0, 1, &expr1, &expr2, (Opaque)yyvsp[-3].opcode); - ; - break;} -case 467: -#line 5240 "parse.y" -{ - Code_CallStatic(&dot, 0, 1, &expr1, &expr2, (Opaque)yyvsp[-3].opcode); - ; - break;} -case 468: -#line 5244 "parse.y" -{ - (void)Code_Call(&dot, 0, 1, &expr1, NULL, (Opaque)yyvsp[-1].opcode); - ; - break;} -case 469: -#line 5248 "parse.y" -{ - (void)Code_String(&dot, 0, 1, &expr1, &expr2, (Opaque)yyvsp[-3].opcode); - ; - break;} -case 470: -#line 5252 "parse.y" -{ - (void)Code_String(&dot, 0, 1, NULL, &expr1, (Opaque)yyvsp[-1].opcode); - ; - break;} -case 471: -#line 5256 "parse.y" -{ - (void)Code_EnterLeave(&dot, 0, 1, &expr1, &expr2, - (Opaque)yyvsp[-3].opcode); - ; - break;} -case 472: -#line 5261 "parse.y" -{ - (void)Code_Fbiop(&dot, 0, 1, NULL, NULL, (Opaque)yyvsp[0].opcode); - ; - break;} -case 473: -#line 5265 "parse.y" -{ - (void)Code_Fbiop(&dot, 0, 1, &expr1, NULL, (Opaque)yyvsp[-1].opcode); - ; - break;} -case 474: -#line 5269 "parse.y" -{ - (void)Code_Fbiop(&dot, 0, 1, &expr1, &expr2, (Opaque)yyvsp[-3].opcode); - ; - break;} -case 475: -#line 5273 "parse.y" -{ - (void)Code_Fcom(&dot, 0, 1, NULL, NULL, (Opaque)yyvsp[0].opcode); - ; - break;} -case 476: -#line 5277 "parse.y" -{ - (void)Code_Fcom(&dot, 0, 1, &expr1, NULL, (Opaque)yyvsp[-1].opcode); - ; - break;} -case 477: -#line 5281 "parse.y" -{ - (void)Code_Ffree(&dot, 0, 1, &expr1, NULL, (Opaque)1); - ; - break;} -case 478: -#line 5285 "parse.y" -{ - (void)Code_Fgroup0(&dot, 0, 1,NULL, NULL, (Opaque)yyvsp[0].opcode); - ; - break;} -case 479: -#line 5289 "parse.y" -{ - (void)Code_Fgroup1(&dot, 0, 1, &expr1, NULL,(Opaque)yyvsp[-1].opcode); - ; - break;} -case 480: -#line 5293 "parse.y" -{ - (void)Code_Fint(&dot, 0, 1, &expr1, NULL, (Opaque)yyvsp[-1].opcode); - ; - break;} -case 481: -#line 5297 "parse.y" -{ - (void)Code_Fldst(&dot, 0, 1, &expr1, NULL, (Opaque)yyvsp[-1].opcode); - ; - break;} -case 482: -#line 5301 "parse.y" -{ - (void)Code_Fxch(&dot, 0, 1, NULL, NULL, (Opaque)yyvsp[0].opcode); - ; - break;} -case 483: -#line 5305 "parse.y" -{ - (void)Code_Fxch(&dot, 0, 1, &expr1, NULL, (Opaque)yyvsp[-1].opcode); - ; - break;} -case 484: -#line 5309 "parse.y" -{ - (void)Code_Fzop(&dot, 0, 1, NULL, NULL, (Opaque)yyvsp[0].opcode); - ; - break;} -case 485: -#line 5313 "parse.y" -{ - (void)Code_Group1(&dot, 0, 1, &expr1, NULL, (Opaque)yyvsp[-1].opcode); - ; - break;} -case 494: -#line 5321 "parse.y" -{ - (void)Code_Group1(&dot, 0, 1, &expr1, NULL, (Opaque)yyvsp[-1].opcode); - ; - break;} -case 495: -#line 5325 "parse.y" -{ - (void)Code_Imul(&dot, 0, 1, &expr1, &expr2, (Opaque)yyvsp[0].number); - ; - break;} -case 496: -#line 5329 "parse.y" -{ - (void)Code_Imul(&dot, 0, 1, &expr1, &expr2, (Opaque)0); - ; - break;} -case 497: -#line 5333 "parse.y" -{ - (void)Code_IO(&dot, 0, 1, &expr1, &expr2, (Opaque)yyvsp[-3].opcode); - ; - break;} -case 498: -#line 5337 "parse.y" -{ - (void)Code_Ins(&dot, 0, 1, &expr1, &expr2, (Opaque)yyvsp[-3].opcode); - ; - break;} -case 499: -#line 5341 "parse.y" -{ - (void)Code_Int(&dot, 0, 1, &expr1, NULL, (Opaque)yyvsp[-1].opcode); - ; - break;} -case 500: -#line 5345 "parse.y" -{ - (void)Code_Jmp(&dot, 0, 1, &expr1, NULL, (Opaque)yyvsp[-1].opcode); - ; - break;} -case 501: -#line 5349 "parse.y" -{ - (void)Code_Jcc(&dot, 0, 1, &expr1, NULL, (Opaque)yyvsp[-1].opcode); - ; - break;} -case 502: -#line 5353 "parse.y" -{ - (void)Code_LDPtr(&dot, 0, 1, &expr1, &expr2, (Opaque)yyvsp[-3].opcode); - ; - break;} -case 503: -#line 5357 "parse.y" -{ - (void)Code_Lea(&dot, 0, 1, &expr1, &expr2, (Opaque)yyvsp[-3].opcode); - ; - break;} -case 504: -#line 5361 "parse.y" -{ - (void)Code_EnterLeave(&dot, 0, 1, NULL, NULL, (Opaque)yyvsp[0].opcode); - ; - break;} -case 505: -#line 5365 "parse.y" -{ - (void)Code_String(&dot, 0, 1, NULL, &expr1, (Opaque)yyvsp[-1].opcode); - ; - break;} -case 506: -#line 5369 "parse.y" -{ - (void)Code_Loop(&dot, 0, 1, &expr1, NULL, (Opaque)yyvsp[-1].opcode); - ; - break;} -case 507: -#line 5373 "parse.y" -{ - /* Load/Store GDT/IDT */ - (void)Code_LSDt(&dot, 0, 1, &expr1, NULL, (Opaque)yyvsp[-1].opcode); - ; - break;} -case 508: -#line 5378 "parse.y" -{ - /* Load Selector Info: LAR/LSL */ - (void)Code_LSInfo(&dot, 0, 1, &expr1, &expr2, (Opaque)yyvsp[-3].opcode); - ; - break;} -case 509: -#line 5383 "parse.y" -{ - (void)Code_Move(&dot, 0, 1, &expr1, &expr2, (Opaque)yyvsp[-3].opcode); - ; - break;} -case 510: -#line 5387 "parse.y" -{ - (void)Code_String(&dot, 0, 1, &expr1, &expr2, (Opaque)yyvsp[-3].opcode); - ; - break;} -case 511: -#line 5391 "parse.y" -{ - (void)Code_String(&dot, 0, 1, NULL, &expr1, (Opaque)yyvsp[-1].opcode); - ; - break;} -case 512: -#line 5395 "parse.y" -{ - /* I/O instruction w/o arg */ - (void)Code_NoArgIO(&dot, 0, 1, NULL, NULL, (Opaque)yyvsp[0].opcode); - ; - break;} -case 513: -#line 5400 "parse.y" -{ - /* privileged instruction w/o arg */ - (void)Code_NoArgPriv(&dot, 0, 1, NULL, NULL, (Opaque)yyvsp[0].opcode); - ; - break;} -case 514: -#line 5405 "parse.y" -{ - /* String Inst w/o override */ - (void)Code_NoArg(&dot, 0, 1, NULL, NULL, (Opaque)yyvsp[0].opcode); - ; - break;} -case 515: -#line 5410 "parse.y" -{ - /* - * Invoke Code_Override ourselves, allowing us to - * use Code_NoArg to store the instruction itself - */ - if (yyvsp[-1].number != REG_DS) { - ResetExpr(&expr1, defElts1); - StoreExprReg(EXPR_SEGREG, yyvsp[-1].number); - Code_Override(&dot, 0, 1, &expr1, 0, (Opaque)NULL); - } - (void)Code_NoArg(&dot, 0, 1, NULL, NULL, (Opaque)yyvsp[-2].opcode); - ; - break;} -case 516: -#line 5423 "parse.y" -{ - (void)Code_NoArg(&dot, 0, 1, NULL, NULL, (Opaque)yyvsp[0].opcode); - ; - break;} -case 517: -#line 5427 "parse.y" -{ - (void)Code_Outs(&dot, 0, 1, &expr1, &expr2, (Opaque)yyvsp[-3].opcode); - ; - break;} -case 518: -#line 5430 "parse.y" -{; - break;} -case 519: -#line 5433 "parse.y" -{ - (void)Code_Pop(&dot, 0, 1, yyvsp[0].expr, NULL, (Opaque)NULL); - Expr_Free(yyvsp[0].expr); - ; - break;} -case 520: -#line 5438 "parse.y" -{ - (void)Code_Pop(&dot, 0, 1, yyvsp[-2].expr, NULL, (Opaque)NULL); - Expr_Free(yyvsp[-2].expr); - ; - break;} -case 521: -#line 5444 "parse.y" -{ - yyval.expr = Expr_Copy(&expr1, TRUE); - malloc_settag((void *)yyval.expr, TAG_POP_OPERAND); - ; - break;} -case 522: -#line 5449 "parse.y" -{; - break;} -case 525: -#line 5455 "parse.y" -{ - (void)Code_Push(&dot, 0, 1, &expr1, NULL, (Opaque)NULL); - ; - break;} -case 526: -#line 5460 "parse.y" -{ - /* Load/Store LDT/TR/MSW; Verify selector */ - (void)Code_PWord(&dot, 0, 1, &expr1, NULL, (Opaque)yyvsp[-1].opcode); - ; - break;} -case 529: -#line 5474 "parse.y" -{ - /* - * Call the procedure to handle the prefix. - */ - (*yyvsp[0].prefix.proc)(&dot, 0, 1, &expr1, NULL, (Opaque)yyvsp[0].prefix.op); - ; - break;} -case 530: -#line 5485 "parse.y" -{ yyval.prefix.proc = Code_Rep; yyval.prefix.op = yyvsp[0].opcode; ; - break;} -case 531: -#line 5486 "parse.y" -{ yyval.prefix.proc = Code_Lock; yyval.prefix.op = yyvsp[0].opcode; ; - break;} -case 532: -#line 5488 "parse.y" -{ - /* - * Little more work here -- have to store the segment - * register in question. - */ - StoreExprReg(EXPR_SEGREG, yyvsp[-1].number); - yyval.prefix.proc = Code_Override; - yyval.prefix.op = (OpCode *)NULL; - ; - break;} -case 533: -#line 5499 "parse.y" -{ - if (curProc) { - Expr *arg = (Expr *)NULL; - - /* - * If language isn't C and there are actually args - * for the procedure, and they weren't just inherited, - * generate an expression for the number of bytes in - * the parameters and pass that as the argument to - * Code_Ret to have it pop the args off the stack upon - * return. - */ - if (language != LANG_C) { - int argSize = argOffset - - (Sym_IsNear(curProc) ? 4 : 6); - - if (argSize != 0 && frameNeeded) { - ResetExpr(&expr1, defElts1); - StoreExprConst(argSize); - arg = &expr1; - } - } - (void)Code_Ret(&dot, 0, 1, arg, - (Expr *)!Sym_IsNear(curProc), - (Opaque)yyvsp[0].opcode); - } else { - yywarning("RET outside of procedure -- defaulting to RETF"); - (void)Code_Ret(&dot, 0, 1, NULL, (Expr *)1, - (Opaque)yyvsp[0].opcode); - } - ; - break;} -case 534: -#line 5531 "parse.y" -{ - if (curProc) { - (void)Code_Ret(&dot, 0, 1, &expr1, - (Expr *)!Sym_IsNear(curProc), - (Opaque)yyvsp[-1].opcode); - } else { - yywarning("RET outside of procedure -- defaulting to RETF"); - (void)Code_Ret(&dot, 0, 1, &expr1, (Expr *)1, - (Opaque)yyvsp[-1].opcode); - } - ; - break;} -case 535: -#line 5543 "parse.y" -{ - (void)Code_Ret(&dot, 0, 1, NULL, NULL, (Opaque)yyvsp[0].opcode); - ; - break;} -case 536: -#line 5547 "parse.y" -{ - (void)Code_Ret(&dot, 0, 1, &expr1, NULL, (Opaque)yyvsp[-1].opcode); - ; - break;} -case 539: -#line 5555 "parse.y" -{ - (void)Code_String(&dot, 0, 1, &expr1, NULL, (Opaque)yyvsp[-1].opcode); - ; - break;} -case 543: -#line 5564 "parse.y" -{ - (void)Code_Shift(&dot, 0, 1, &expr1, &expr2, (Opaque)yyvsp[-3].opcode); - ; - break;} -case 544: -#line 5568 "parse.y" -{ - /* - * Perform single-bit shift - */ - ResetExpr(&expr2, defElts2); - StoreExprConst(1); - - (void)Code_Shift(&dot, 0, 1, &expr1, &expr2, (Opaque)yyvsp[-1].opcode); - ; - break;} -case 545: -#line 5579 "parse.y" -{ - if (yyvsp[0].number != REG_CL) { - yyerror("can only shift by CL or a constant"); - yynerrs++; - } else { - yyval.number = -1; - } - ; - break;} -case 546: -#line 5588 "parse.y" -{ - if (yyvsp[0].number == -1) { - yyerror("isn't that a funny shift count?"); - yynerrs++; - } else { - yyval.number = yyvsp[0].number; - } - ; - break;} -case 547: -#line 5598 "parse.y" -{ - (void)Code_DPShiftLeft(&dot, 0, 1, &expr1, &expr2, (Opaque)yyvsp[0].number); - ; - break;} -case 548: -#line 5602 "parse.y" -{ - (void)Code_DPShiftRight(&dot, 0, 1, &expr1, &expr2, (Opaque)yyvsp[0].number); - ; - break;} -case 549: -#line 5606 "parse.y" -{ - (void)Code_String(&dot, 0, 1, &expr1, NULL, (Opaque)yyvsp[-1].opcode); - ; - break;} -case 550: -#line 5610 "parse.y" -{ - (void)Code_Test(&dot, 0, 1, &expr1, &expr2, (Opaque)yyvsp[-3].opcode); - ; - break;} -case 551: -#line 5614 "parse.y" -{ - /* INC/DEC */ - (void)Code_IncDec(&dot, 0, 1, &expr1, NULL, (Opaque)yyvsp[-1].opcode); - ; - break;} -case 552: -#line 5619 "parse.y" -{ - (void)Code_Xchg(&dot, 0, 1, &expr1, &expr2, (Opaque)yyvsp[-3].opcode); - ; - break;} -case 553: -#line 5623 "parse.y" -{ - (void)Code_String(&dot, 0, 1, NULL, &expr1, (Opaque)yyvsp[-1].opcode); - ; - break;} -case 554: -#line 5627 "parse.y" -{ - (void)Code_NoArg(&dot, 0, 1, NULL, NULL, (Opaque)yyvsp[0].opcode); - ; - break;} -case 555: -#line 5636 "parse.y" -{ lexdebug = yydebug = yyvsp[0].number; ; - break;} -case 556: -#line 5637 "parse.y" -{ showmacro = yyvsp[0].number; ; - break;} -case 557: -#line 5638 "parse.y" -{ masmCompatible = yyvsp[0].number; ; - break;} -case 558: -#line 5639 "parse.y" -{ _asm int 3; ; - break;} -case 559: -#line 5640 "parse.y" -{ fall_thru = 1; ; - break;} -case 560: -#line 5642 "parse.y" -{ - /* - * Set flag allowing procedure to be closed without - * appropriate unconditional branch or return. - */ - fall_thru = 1; - /* - * Register a fixup for the second pass for us to evaluate - * the operand and make sure its offset matches the offset - * of the .fall_thru. - */ - Fix_Register(FC_UNDEF, - ParseFallThruCheck, - dot, - 0, - Expr_Copy(&expr1, TRUE), - 0, - (Opaque)0); - ; - break;} -case 561: -#line 5661 "parse.y" -{ curSeg->u.segment.data->checkLabel=TRUE; ; - break;} -case 562: -#line 5663 "parse.y" -{ - procType &= ~PROC_MASK; procType |= yyvsp[0].number; - sprintf(predefs[PD_CPU].value->text, "0x%04x", procType); - ; - break;} -case 563: -#line 5668 "parse.y" -{ - procType &= ~PROC_CO_MASK; procType |= yyvsp[0].number; - sprintf(predefs[PD_CPU].value->text, "0x%04x", procType); - ; - break;} -case 564: -#line 5673 "parse.y" -{ - procType |= PROC_IO; - sprintf(predefs[PD_CPU].value->text, "0x%04x", procType); - ; - break;} -case 565: -#line 5678 "parse.y" -{ - Assert_Enter(&expr1, NULL); - ; - break;} -case 566: -#line 5681 "parse.y" -{ defStruct = 0; ; - break;} -case 567: -#line 5682 "parse.y" -{ - Assert_Enter(&expr1, yyvsp[0].string); - ; - break;} -case 568: -#line 5686 "parse.y" -{ - if (inStruct) { - int diff = - ((inStruct->u.sType.common.size+yyvsp[0].number)&~yyvsp[0].number)- - inStruct->u.sType.common.size; - - if (diff != 0) { - /* - * Create a nameless array field to take up - * the slack. Need to create a DupExpr of 0 bytes - * as initializing with an empty string causes - * nothing to be actually entered... - */ - ResetExpr(&expr1, defElts1); - StoreExprConst(0); - StoreExprComma(); - if (diff > 1) { - DupExpr(diff-1, 0); - (void)Sym_Enter(NullID, SYM_FIELD, inStruct, - Type_Array(diff, Type_Int(1)), - Expr_Copy(curExpr, TRUE)); - } else { - (void)Sym_Enter(NullID, SYM_FIELD, inStruct, - Type_Int(1), - &zeroExpr); - } - } - } else { - int segSize; - - dot += yyvsp[0].number; - dot &= ~yyvsp[0].number; - - /* - * Make sure the bytes are actually in the segment... - * in case this alignment comes at the very end of - * the segment and needs to be propagated to the - * linker. - */ - segSize = Table_Size(curSeg->u.segment.code); - - if (segSize < dot) { - (void)Table_StoreZeroes(curSeg->u.segment.code, - dot - segSize, - segSize); - } - - } - Scan_DontUseOpProc(yyvsp[-1].number); - ; - break;} -case 569: -#line 5737 "parse.y" -{ - if (inStruct) { - int diff = - (((inStruct->u.sType.common.size+yyvsp[0].number-1)/yyvsp[0].number)*yyvsp[0].number)- - inStruct->u.sType.common.size; - - if (diff != 0) { - /* - * Create a nameless array field to take up - * the slack. Need to create a DupExpr of 0 bytes - * as initializing with an empty string causes - * nothing to be actually entered... - */ - ResetExpr(&expr1, defElts1); - StoreExprConst(0); - StoreExprComma(); - if (diff > 1) { - DupExpr(diff-1, 0); - (void)Sym_Enter(NullID, SYM_FIELD, inStruct, - Type_Array(diff, Type_Int(1)), - Expr_Copy(curExpr, TRUE)); - } else { - (void)Sym_Enter(NullID, SYM_FIELD, inStruct, - Type_Int(1), - &zeroExpr); - } - } - } else { - int segSize; - - dot = ((dot + yyvsp[0].number - 1) / yyvsp[0].number) * yyvsp[0].number; - - /* - * Make sure the bytes are actually in the segment... - * in case this alignment comes at the very end of - * the segment and needs to be propagated to the - * linker. - */ - segSize = Table_Size(curSeg->u.segment.code); - - if (segSize < dot) { - (void)Table_StoreZeroes(curSeg->u.segment.code, - dot - segSize, - segSize); - } - } - Scan_DontUseOpProc(yyvsp[-1].number); - ; - break;} -case 570: -#line 5786 "parse.y" -{ - Scan_DontUseOpProc(yyvsp[-1].number); - ; - break;} -case 571: -#line 5790 "parse.y" -{ - if (inStruct) { - /* - * Create a nameless byte field to take up - * the slack. The thing is initialized with a 0 - * constant as initializing with an empty string causes - * nothing to be entered. - */ - if (inStruct->u.sType.common.size & 1) { - Sym_Enter(NullID, SYM_FIELD, inStruct, - Type_Int(1), &zeroExpr); - } - } else { - dot += 1; - dot &= ~1; - } - ; - break;} -case 572: -#line 5809 "parse.y" -{ - yyval.number = Scan_UseOpProc(findSegToken); - ; - break;} -case 573: -#line 5813 "parse.y" -{ snarfLine=1; ; - break;} -case 574: -#line 5814 "parse.y" -{ - ID desc; - char *cp; - - if (!curProc) { - yyerror("on_stack only valid inside a procedure"); - yynerrs++; - } else { - curProc->u.proc.flags |= SYM_WEIRD; - /* - * Trim off trailing spaces or comments - */ - cp = index(yyvsp[0].string, ';'); - if (cp == NULL) { - cp = yyvsp[0].string+strlen(yyvsp[0].string); - } - while (isspace(*--cp)) { - ; - } - cp[1] = '\0'; - desc = ST_Enter(output, permStrings, yyvsp[0].string, cp-yyvsp[0].string+1); - Sym_Enter(NullID, SYM_ONSTACK, dot, desc); - } - free(yyvsp[0].string); - ; - break;} -case 575: -#line 5839 "parse.y" -{ snarfLine = 1; ; - break;} -case 576: -#line 5840 "parse.y" -{ - char *cp; - char *start; - char savec; - int i; - - start = yyvsp[0].string; - - for (start=yyvsp[0].string; *start!='\0' && *start!=';'; start=cp) { - while (isspace(*start) || *start == ',') { - start++; - } - for (cp = start; - !isspace(*cp) && (*cp != '\0') && (*cp != ',') && - (*cp != ';'); - cp++) - { - ; - } - if (cp == start) { - break; - } - savec = *cp; - *cp = '\0'; - if ((*start == '@') && - ((start[1] == '+') || (start[1] == '-'))) - { - for (i = 0; i < numWarnOpts; i++) { - if (strcmp(warnOpts[i].flag, start+2) == 0) { - break; - } - } - } - else { - for (i = 0; i < numWarnOpts; i++) { - if (strcmp(warnOpts[i].flag, start+1) == 0) { - break; - } - } - } - - if (i == numWarnOpts) { - yyerror("unknown .warn option: %s", start); - yynerrs++; - } else if (*start == '+') { - *warnOpts[i].var = 1; - } else if (*start == '-') { - *warnOpts[i].var = 0; - } else if (*start == '@') { - if (start[1] == '+') { - warnOpts[i].defval = 1; - } else if (start[1] == '-') { - warnOpts[i].defval = 0; - } - *warnOpts[i].var = warnOpts[i].defval; - } else { - yyerror("unknown .warn command '%c'", - *start); - yynerrs++; - } - - *cp = savec; - } - free(yyvsp[0].string); - ; - break;} -case 577: -#line 5906 "parse.y" -{ - if (makeDepend != TRUE) - { - fputs(yyvsp[0].string, stderr); - putc('\n', stderr); - fflush(stderr); - } - free(yyvsp[0].string); - ; - break;} -case 578: -#line 5916 "parse.y" -{ - ExprResult result; - - if (!Expr_Eval(&expr1, &result, - EXPR_NOUNDEF|EXPR_FINALIZE|EXPR_NOT_OPERAND, - NULL)) - { - /* - * Give error message we got back - */ - yyerror((char *)result.type); - yynerrs++; - } else if (result.type == EXPR_TYPE_CONST) - { - /* - * Use the value we got back - */ - if (result.rel.sym) { - yyerror("org: constant expected"); - yynerrs++; - } else { - dot = result.data.number; - } - } else if (result.type == EXPR_TYPE_STRING) { - yyerror("org: argument may not be a string"); - yynerrs++; - } else if (result.data.ea.modrm != MR_DIRECT) { - yyerror("org: argument must be constant or a direct address"); - yynerrs++; - } else { - if (result.rel.sym) { - if ((result.rel.frame != curSeg) && - (result.rel.frame != curSeg->segment)) - { - yyerror("org: address not in current segment"); - } else if (result.rel.sym->flags & SYM_UNDEF) { - yyerror("org: symbol %i's address must be defined", result.rel.sym->name); - } else { - /* - * Add in the symbol's offset, since the - * expression evaluator won't have. - */ - dot = (word)(result.data.ea.disp + - result.rel.sym->u.addrsym.offset); - } - } else { - /*XXX: Should we disallow this? */ - dot = result.data.ea.disp; - } - } - ; - break;} -case 579: -#line 5967 "parse.y" -{ snarfLine = 1; ; - break;} -case 580: -#line 5968 "parse.y" -{ - yywarning("%s not supported -- rest of line discarded", - yyvsp[-2].opcode->name); - free(yyvsp[0].string); - ; - break;} -case 581: -#line 5975 "parse.y" -{ - yyval.number = Scan_UseOpProc(findModelToken); - ; - break;} -case 582: -#line 5980 "parse.y" -{ - Scan_DontUseOpProc(yyvsp[-1].number); - model = yyvsp[0].model; - ; - break;} -case 583: -#line 5985 "parse.y" -{ - Scan_DontUseOpProc(yyvsp[-3].number); - model = yyvsp[-2].model; - language = yyvsp[0].lang; - ; - break;} -case 584: -#line 5991 "parse.y" -{ - Scan_DontUseOpProc(yyvsp[-1].number); - yyerrok; - if (yychar != '\n') { - yyclearin; - } - ; - break;} -case 585: -#line 6000 "parse.y" -{ - /* Turn on memory-write checking */ - writeCheck = TRUE; - ; - break;} -case 586: -#line 6006 "parse.y" -{ - /* Turn off memory-write checking */ - writeCheck = FALSE; - ; - break;} -case 587: -#line 6012 "parse.y" -{ - /* Turn on memory-read checking */ - readCheck = TRUE; - ; - break;} -case 588: -#line 6018 "parse.y" -{ - /* Turn off memory-read checking */ - readCheck = FALSE; - ; - break;} -case 590: -#line 6032 "parse.y" -{ - HandleIF(yyvsp[-2].number); - RestoreExpr(&yyvsp[-1].exprSave); - ; - break;} -case 591: -#line 6037 "parse.y" -{ - yywarning("%sIF1 is meaningless (only one source pass)", - yyvsp[-1].number ? "ELSE" : ""); - StoreExprConst(1); - HandleIF(yyvsp[-1].number); - RestoreExpr(&yyvsp[0].exprSave); - ; - break;} -case 592: -#line 6045 "parse.y" -{ - yywarning("%sIF2 is meaningless (only one source pass)", - yyvsp[-1].number ? "ELSE" : ""); - StoreExprConst(1); - HandleIF(yyvsp[-1].number); - RestoreExpr(&yyvsp[0].exprSave); - ; - break;} -case 593: -#line 6053 "parse.y" -{ - StoreExprConst(*yyvsp[-1].string == '\0'); - free(yyvsp[-1].string); - HandleIF(yyvsp[-2].number); - RestoreExpr(&yyvsp[0].exprSave); - ; - break;} -case 594: -#line 6060 "parse.y" -{ - StoreExprConst(Sym_Find(yyvsp[-1].ident, SYM_ANY, FALSE) != 0); - HandleIF(yyvsp[-2].number); - RestoreExpr(&yyvsp[0].exprSave); - ; - break;} -case 595: -#line 6066 "parse.y" -{ - /* - * Masm supports empty ifdefs to allow one to use it - * to test for a macro argument having been given... - * Gross. - */ - StoreExprConst(0); - HandleIF(yyvsp[-1].number); - RestoreExpr(&yyvsp[0].exprSave); - ; - break;} -case 596: -#line 6077 "parse.y" -{ - StoreExprConst(strcmp(yyvsp[-3].string, yyvsp[-1].string) != 0); - free(yyvsp[-3].string); - free(yyvsp[-1].string); - HandleIF(yyvsp[-4].number); - RestoreExpr(&yyvsp[0].exprSave); - ; - break;} -case 597: -#line 6085 "parse.y" -{ - StoreExprConst(0); - StoreExprOp(EXPR_EQ); - HandleIF(yyvsp[-2].number); - RestoreExpr(&yyvsp[-1].exprSave); - ; - break;} -case 598: -#line 6092 "parse.y" -{ - StoreExprConst(strcmp(yyvsp[-3].string, yyvsp[-1].string)==0); - free(yyvsp[-3].string); - free(yyvsp[-1].string); - HandleIF(yyvsp[-4].number); - RestoreExpr(&yyvsp[0].exprSave); - ; - break;} -case 599: -#line 6100 "parse.y" -{ - StoreExprConst(*yyvsp[-1].string != '\0'); - free(yyvsp[-1].string); - HandleIF(yyvsp[-2].number); - RestoreExpr(&yyvsp[0].exprSave); - ; - break;} -case 600: -#line 6107 "parse.y" -{ - StoreExprConst(!Sym_Find(yyvsp[-1].ident, SYM_ANY, FALSE)); - HandleIF(yyvsp[-2].number); - RestoreExpr(&yyvsp[0].exprSave); - ; - break;} -case 601: -#line 6113 "parse.y" -{ - StoreExprConst(1); - HandleIF(yyvsp[-1].number); - RestoreExpr(&yyvsp[0].exprSave); - ; - break;} -case 602: -#line 6119 "parse.y" -{ - if (iflevel == -1) { - yyerror("IF-less ELSE"); - yynerrs++; - } else if (ifStack[iflevel].value == -1) { - yyerror("Already had an ELSE for this level"); - yynerrs++; - } else if (ifStack[iflevel].value) { - /* - * Remember ELSE and go to the endif - */ - ifStack[iflevel].value = -1; - Scan_ToEndif(FALSE); - } else { - /* - * IF was false, so continue parsing, but remember - * we had an ELSE already. - */ - ifStack[iflevel].value = -1; - } - ; - break;} -case 603: -#line 6141 "parse.y" -{ - if (iflevel == -1) { - yyerror("IF-less ENDIF"); - yynerrs++; - } else { - iflevel -= 1; - } - ; - break;} -case 604: -#line 6150 "parse.y" -{ yyerror(".ERR encountered"); yynerrs++;; - break;} -case 605: -#line 6152 "parse.y" -{ - yyerror(".ERR encountered: %s", yyvsp[0].string); - free(yyvsp[0].string); - yynerrs++; - ; - break;} -case 606: -#line 6158 "parse.y" -{ - if (*yyvsp[0].string == '\0') { - yyerror(".ERRB: String blank"); - yynerrs++; - } - free(yyvsp[0].string); - ; - break;} -case 607: -#line 6166 "parse.y" -{ - if (Sym_Find(yyvsp[0].ident, SYM_ANY, FALSE) != NULL) { - yyerror(".ERRDEF: Symbol %i defined", yyvsp[0].ident); - yynerrs++; - } - ; - break;} -case 608: -#line 6173 "parse.y" -{ - if (strcmp(yyvsp[-2].string, yyvsp[0].string) != 0) { - yyerror(".ERRDIF: <%s> and <%s> differ", - yyvsp[-2].string, yyvsp[0].string); - yynerrs++; - } - free(yyvsp[-2].string); free(yyvsp[0].string); - ; - break;} -case 609: -#line 6182 "parse.y" -{ - if (yyvsp[0].number == 0) { - yyerror(".ERRE: expression is zero"); - yynerrs++; - } - ; - break;} -case 610: -#line 6189 "parse.y" -{ - if (strcmp(yyvsp[-2].string, yyvsp[0].string) == 0) { - yyerror(".ERRIDN: <%s> and <%s> are identical", - yyvsp[-2].string, yyvsp[0].string); - yynerrs++; - } - free(yyvsp[-2].string); free(yyvsp[0].string); - ; - break;} -case 611: -#line 6198 "parse.y" -{ - if (*yyvsp[0].string != '\0') { - yyerror(".ERRNB: <%s> isn't blank", - yyvsp[0].string); - yynerrs++; - } - free(yyvsp[0].string); - ; - break;} -case 612: -#line 6207 "parse.y" -{ - if (Sym_Find(yyvsp[0].ident, SYM_ANY, FALSE) == NULL) { - yyerror(".ERRNDEF: %i isn't defined", yyvsp[0].ident); - yynerrs++; - } - ; - break;} -case 613: -#line 6214 "parse.y" -{ - if (yyvsp[0].number != 0) { - yyerror(".ERRNZ: expression is non-zero"); - yynerrs++; - } - ; - break;} -} - /* the action file gets copied in in place of this dollarsign */ -#line 543 "/usr/local/share/bison.simple" - - yyvsp -= yylen; - yyssp -= yylen; -#ifdef YYLSP_NEEDED - yylsp -= yylen; -#endif - -#if YYDEBUG != 0 - if (yydebug) - { - short *ssp1 = yyss - 1; - fprintf (stderr, "state stack now"); - while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - - *++yyvsp = yyval; - -#ifdef YYLSP_NEEDED - yylsp++; - if (yylen == 0) - { - yylsp->first_line = yylloc.first_line; - yylsp->first_column = yylloc.first_column; - yylsp->last_line = (yylsp-1)->last_line; - yylsp->last_column = (yylsp-1)->last_column; - yylsp->text = 0; - } - else - { - yylsp->last_line = (yylsp+yylen-1)->last_line; - yylsp->last_column = (yylsp+yylen-1)->last_column; - } -#endif - - /* 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. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTBASE] + *yyssp; - if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTBASE]; - - goto yynewstate; - -yyerrlab: /* here on detecting error */ - - if (! yyerrstatus) - /* If not already recovering from an error, report this error. */ - { - ++yynerrs; - -#ifdef YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (yyn > YYFLAG && yyn < YYLAST) - { - int size = 0; - char *msg; - int x, count; - - count = 0; - /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - size += strlen(yytname[x]) + 15, count++; - msg = (char *) malloc(size + 15); - if (msg != 0) - { - strcpy(msg, "parse error"); - - if (count < 5) - { - count = 0; - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - { - strcat(msg, count == 0 ? ", expecting `" : " or `"); - strcat(msg, yytname[x]); - strcat(msg, "'"); - count++; - } - } - yyerror(msg); - free(msg); - } - else - yyerror ("parse error; also virtual memory exceeded"); - } - else -#endif /* YYERROR_VERBOSE */ - yyerror("parse error"); - } - - goto yyerrlab1; -yyerrlab1: /* here on error raised explicitly by an action */ - - if (yyerrstatus == 3) - { - /* if just tried and failed to reuse lookahead token after an error, discard it. */ - - /* return failure if at end of input */ - if (yychar == YYEOF) - YYABORT; - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); -#endif - - yychar = YYEMPTY; - } - - /* Else will try to reuse lookahead token - after shifting the error token. */ - - yyerrstatus = 3; /* Each real token shifted decrements this */ - - goto yyerrhandle; - -yyerrdefault: /* current state does not do anything special for the error token. */ - -#if 0 - /* This is wrong; only states that explicitly want error tokens - should shift them. */ - yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ - if (yyn) goto yydefault; -#endif - -yyerrpop: /* pop the current state because it cannot handle the error token */ - - if (yyssp == yyss) YYABORT; - yyvsp--; - yystate = *--yyssp; -#ifdef YYLSP_NEEDED - yylsp--; -#endif - -#if YYDEBUG != 0 - if (yydebug) - { - short *ssp1 = yyss - 1; - fprintf (stderr, "Error: state stack now"); - while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - -yyerrhandle: - - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yyerrdefault; - - yyn += YYTERROR; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) - goto yyerrdefault; - - yyn = yytable[yyn]; - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrpop; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto yyerrpop; - - if (yyn == YYFINAL) - YYACCEPT; - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Shifting error token, "); -#endif - - *++yyvsp = yylval; -#ifdef YYLSP_NEEDED - *++yylsp = yylloc; -#endif - - yystate = yyn; - goto yynewstate; - - yyacceptlab: - /* YYACCEPT comes here. */ - if (yyfree_stacks) - { - free ((malloc_t) yyss); - free ((malloc_t) yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif - } - return 0; - - yyabortlab: - /* YYABORT comes here. */ - if (yyfree_stacks) - { - free ((malloc_t) yyss); - free ((malloc_t) yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif - } - return 1; -} -#line 6221 "parse.y" - - - -/*********************************************************************** - * ParseStackOverflow - *********************************************************************** - * SYNOPSIS: Enlarge the parser's internal stacks. - * CALLED BY: yyparse() - * RETURN: Nothing. *maxDepth left unaltered if we don't want to - * allow the increase. yyerror is called with msg if so. - * SIDE EFFECTS: - * - * STRATEGY: This implementation relies on the "errcheck" rule - * freeing stacks up, if necessary. Sadly, there's no - * opportunity to do this, so it be a core leak... - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 8/31/88 Initial Revision - * - ***********************************************************************/ -static void -ParseStackOverflow(char *msg, /* Message if we decide not to */ - short **state, /* Current state stack */ - size_t stateSize, /* Current state stack size */ - YYSTYPE **vals, /* Current value stack */ - size_t valsSize, /* Current value stack size */ - int *maxDepth) /* Current maximum stack depth of - * all stacks */ -{ - *maxDepth *= 2; - - if (malloc_size((malloc_t) *state) != 0) { - /* - * we've been called before. Just use realloc() - */ - *state = (short *)realloc_tagged((char *)*state, stateSize * 2); - *vals = (YYSTYPE *)realloc_tagged((char *)*vals, valsSize * 2); - } else { - short *newstate; - YYSTYPE *newvals; - - newstate = (short *)malloc_tagged(stateSize * 2, - TAG_PARSER_STACK); - newvals = (YYSTYPE *)malloc_tagged(valsSize * 2, - TAG_PARSER_STACK); - - bcopy(*state, newstate, stateSize); - bcopy(*vals, newvals, valsSize); - - *state = newstate; - *vals = newvals; - } -} - -/*********************************************************************** - * yyerror - *********************************************************************** - * SYNOPSIS: Print an error message with the current line # - * CALLED BY: yyparse() and others - * RETURN: Nothing - * SIDE EFFECTS: A message be printed. 'errors' is incremented - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 8/31/88 Initial Revision - * - ***********************************************************************/ -/*VARARGS1*/ -void -yyerror(char *fmt, ...) -{ - va_list args; - - va_start(args, fmt); - - NotifyInt(NOTIFY_ERROR, curFile->name, yylineno, fmt, args); - - va_end(args); -} - - -/*********************************************************************** - * FilterGenerated - *********************************************************************** - * SYNOPSIS: Filter out any generated symbols now. - * CALLED BY: DefineData, various rules - * RETURN: Nothing - * SIDE EFFECTS: If the symbol's name begins with two question marks, - * its NOWRITE flag is set. - * - * STRATEGY: - * Any symbol that begins with two question marks is understood to be - * generated and hence of no interest to the programmer, so it doesn't - * get written to the object file. - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 2/19/90 Initial Revision - * - ***********************************************************************/ -static void -FilterGenerated(SymbolPtr sym) -{ - if (sym != NULL && sym->name != NullID) { - char *name = ST_Lock(output, sym->name); - - if ((*name == '?') && (name[1] == '?')) { - sym->flags |= SYM_NOWRITE; - } - ST_Unlock(output, sym->name); - } -} - -/*********************************************************************** - * yywarning - *********************************************************************** - * SYNOPSIS: Print a warning message with the current line # - * CALLED BY: yyparse() and others - * RETURN: Nothing - * SIDE EFFECTS: A message be printed - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 8/31/88 Initial Revision - * - ***********************************************************************/ -/*VARARGS1*/ -void -yywarning(char *fmt, ...) -{ - va_list args; - - va_start(args, fmt); - - NotifyInt(NOTIFY_WARNING, curFile->name, yylineno, fmt, args); - - va_end(args); -} - -/*********************************************************************** - * EnterClass - *********************************************************************** - * SYNOPSIS: Deal with things required on entry to a class, - * either the declaration of one or the definition - * of a method handler for one. - * CALLED BY: yyparse in various rules - * RETURN: nothing - * SIDE EFFECTS: curClass is set, the @CurClass string altered - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 10/22/89 Initial Revision - * - ***********************************************************************/ -static void -EnterClass(SymbolPtr class) -{ - char *name; - - curClass = class; - - /* - * Set the @CurClass equate to match the current procedure name. - */ - name = ST_Lock(output, curClass->name); - predefs[PD_CURCLASS].value->length = strlen(name); - bcopy(name, - predefs[PD_CURCLASS].value->text, - predefs[PD_CURCLASS].value->length); - ST_Unlock(output, curClass->name); -} - -/*********************************************************************** - * EndClass - *********************************************************************** - * SYNOPSIS: Finish out things in the current class - * CALLED BY: EndProc and yyparse. - * RETURN: Nothing - * SIDE EFFECTS: @CurClass is emptied, curClass is zeroed. - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 10/22/89 Initial Revision - * - ***********************************************************************/ -static void -EndClass(void) -{ - curClass = NULL; - - predefs[PD_CURCLASS].value->length = 0; -} - - -/*********************************************************************** - * EnterProc - *********************************************************************** - * SYNOPSIS: Start a new procedure - * CALLED BY: yyparse - * RETURN: Nothing - * SIDE EFFECTS: all symbols in the locals list have their procedure - * pointer altered to the one being entered. - * curProc is set to the passed procedure. - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 6/11/89 Initial Revision - * - ***********************************************************************/ -static void -EnterProc(SymbolPtr proc) -{ - char *name; - int i; - - curSeg->u.segment.data->lastLabel = dot; - curSeg->u.segment.data->checkLabel = FALSE; - - /* - * Bitch if procedure is nested. - */ - if (curProc) { - yyerror("procedure %i may not nest inside procedure %i", - proc->name, curProc->name); - } else if (proc->type == SYM_PROC) { - curProc = proc; - - /* - * Set the @CurProc equate to match the current procedure name. - */ - name = ST_Lock(output, curProc->name); - predefs[PD_CURPROC].value->length = strlen(name); - bcopy(name, - predefs[PD_CURPROC].value->text, - predefs[PD_CURPROC].value->length); - ST_Unlock(output, curProc->name); - - /* - * Set the curProc field for the temporary expressions. - */ - for (i = NumElts(exprs)-1; i >= 0; i--) { - exprs[i]->curProc = curProc; - } - - /* - * Set the initial argument offset. - */ - if (Sym_IsNear(curProc)) { - argOffset = 4; /* saved BP + 2-byte ret addr */ - } else { - argOffset = 6; /* saved BP + 4-byte ret addr */ - } - } -} - -/*********************************************************************** - * EndProc - *********************************************************************** - * SYNOPSIS: Finish out a procedure - * CALLED BY: yyparse (ENDM and ENDP rules) - * RETURN: Nothing - * SIDE EFFECTS: curProc, curClass set to NULL, localOffset, usesMask, - * and enterSeen set to 0. - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 5/23/89 Initial Revision - * - ***********************************************************************/ -static void -EndProc(ID name) -{ - int i; - - if (!enterSeen && enterNeeded) { - if (localSize) { - yywarning("local variables declared for %i but no .ENTER given", - name); - } - if (usesMask) { - yywarning("USES given for %i, but no .ENTER", name); - } - if (!localSize && !usesMask) { - yywarning("arguments declared for %i but no .ENTER given", - name); - } - } else if (enterSeen && !leaveSeen) { - yywarning(".ENTER given for %i, but no .LEAVE in sight", name); - } - - if (warn_fall_thru && !curSeg->u.segment.data->checkLabel && !fall_thru) { - yywarning("execution falls out of %i with no .FALL_THRU in sight", - name); - } - - curProc = NULL; - EndClass(); - frameSize = localSize = 0; - usesMask = 0; - fall_thru = frameSetup = frameNeeded = enterNeeded = leaveSeen = - enterSeen = FALSE; - - for (i = NumElts(exprs)-1; i >= 0; i--) { - exprs[i]->curProc = NULL; - } - - /* - * Zero out the @CurProc predef quickly. - */ - predefs[PD_CURPROC].value->length = 0; - predefs[PD_ARGSIZE].value->length = 0; - - curSeg->u.segment.data->checkLabel = TRUE; -} - - -/*********************************************************************** - * AddArg - *********************************************************************** - * SYNOPSIS: Add another argument to the current procedure - * CALLED BY: yyparse for any of four argument rules - * RETURN: Nothing - * SIDE EFFECTS: @ArgSize is adjusted, argOffset is adjusted - * - * STRATEGY: - * If symbol name given, create a LOCAL symbol with the current - * argOffset as its offset. - * - * Adjust argOffset by the size of the type given for the arg and - * set @ArgSize to match. - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 12/ 8/89 Initial Revision - * - ***********************************************************************/ -static void -AddArg(ID name, /* Argument name */ - TypePtr type) /* Argument type */ -{ - int size = Type_Size(type); - int argBase = Sym_IsNear(curProc) ? 4 : 6; - - if (language != LANG_C) { - /* - * If arguments pushed in left-to-right order, we need to shift the - * existing arguments up by the size of this argument. - */ - Sym_AdjustArgOffset(curProc, size); - - if (name != NullID) { - /* - * Make this arg the first one. - * XXX: should be able to use just argOffset, but then we'd need - * something else to track the argument size. This seems - * easier for now. Besides, we were needing to check - * Sym_IsNear(curProc) to set @ArgSize anyway... - */ - (void)Sym_Enter(name, SYM_LOCAL, argBase, type, curProc); - frameNeeded = enterNeeded = TRUE; - } - } else if (name != NullID) { - (void)Sym_Enter(name, SYM_LOCAL, argOffset, type, curProc); - frameNeeded = enterNeeded = TRUE; - } - - argOffset += size; - - sprintf(predefs[PD_ARGSIZE].value->text, "%d", argOffset - argBase); - predefs[PD_ARGSIZE].value->length = strlen(predefs[PD_ARGSIZE].value->text); - - curProc->u.proc.flags |= SYM_NO_JMP; -} - - -/*********************************************************************** - * CheckAndSetLabel - *********************************************************************** - * SYNOPSIS: Make sure a label/proc isn't being multiply defined - * and set its data properly. - * CALLED BY: yyparse (label and labeled_op rules) - * RETURN: Nothing - * SIDE EFFECTS: error messages, altered states... - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 3/27/89 Initial Revision - * - ***********************************************************************/ -static void -CheckAndSetLabel(SymType type, /* Symbol type */ - Symbol *sym, /* Symbol to check */ - int near) /* TRUE if near label */ -{ - if (curSeg == NULL || curSeg->u.segment.data->comb == SEG_GLOBAL) { - yyerror("%s %i is not in any segment", - type == SYM_LABEL ? "label" : "procedure", sym->name); - } else if ((sym->segment != curSeg) && (sym->segment->name != NullID)) { - yyerror("%i is declared in segment %i, defined in %i", - sym->name, sym->segment->name, curSeg->name); - if (sym->type == type) { - goto def_sym; /* Define it anyway to avoid later errors */ - } - } else if (((sym->flags & SYM_UNDEF) && - ((sym->type != type) && - (sym->type != (type == SYM_LABEL ? SYM_PROC : SYM_LABEL)))) || - (!(sym->flags & SYM_UNDEF) && (sym->type != type))) - { - /* - * Undefined and not either a label or a procedure, or defined and - * not of the given type -- choke. (XXX: Give line/file of previous - * definition?). Do *not* define the thing anyway. In the case of - * a procedure, we will be expecting the proc.locals field to contain - * something meaningful, which it won't. - */ - yyerror("%i is already defined as something other than a %s", - sym->name, type == SYM_LABEL ? "label" : "procedure"); - } else if (!(sym->flags & SYM_UNDEF)) { - yyerror("%i multiply defined", sym->name); - } else if (Sym_IsNear(sym) ? !near : near) { - yyerror(near ? "near %s %i previously declared far" : - "far %s %i previously declared near", - type == SYM_LABEL ? "label" : "procedure", - sym->name); - goto def_sym; /* Define it anyway to avoid later errors */ - } else { -def_sym: - /* Set segment, to deal with declaration in global segment */ - sym->segment = curSeg; - sym->type = type; /* Make sure it's the correct type... */ - sym->flags &= ~SYM_UNDEF; - if (sym->type == SYM_LABEL) { - sym->u.label.unreach = curSeg->u.segment.data->checkLabel; - } - - Sym_SetAddress(sym, dot); - curSeg->u.segment.data->lastLabel = dot; - } -} - - -/*********************************************************************** - * DefineData - *********************************************************************** - * SYNOPSIS: Define a data element by name - * CALLED BY: yyparse - * RETURN: Nothing - * SIDE EFFECTS: Lots - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 6/30/89 Initial Revision - * - ***********************************************************************/ -static void -DefineData(ID name, /* Name of symbol to define */ - TypePtr type, /* Type of data */ - int advance, /* TRUE if should enter curExpr and advance - * dot */ - int usebase) /* TRUE if the type is an array put together - * by the parser, as opposed to a real - * array typedef. Tells us to pass the base - * type and length to Data_Enter separately */ -{ - SymbolPtr sym; - - if (curSeg == NULL || curSeg->u.segment.data->comb == SYM_GLOBAL) { - yyerror("%i is not in any segment", name); - } - - if (type->tn_type == TYPE_NEAR || type->tn_type == TYPE_FAR) { - yyerror("why are you defining a code label with data?"); - return; - } else if (inStruct) { - /* - * Defining a structure -- create a field with curExpr as its - * default value. - * - * NOTE: The test for inStruct MUST come before that for - * curClass && defClass to allow class-related structures to be - * defined w/in a class declaration. - */ - Expr *expr; - - if (advance) { - expr = CopyExprCheckingIfZero(curExpr); - } else { - expr = NULL; - } - sym = Sym_Enter(name, SYM_FIELD, inStruct, type, expr); - } else if (curClass && defClass) { - /* - * Defining a class -- create an instance variable with curExpr as - * its default value. - */ - Expr *expr; - - if (advance) { - /* - * If default value for field is a zero constant, use the static - * zeroExpr, rather than allocating a whole new expression that - * means the same thing... - */ - expr = CopyExprCheckingIfZero(curExpr); - } else { - expr = NULL; - } - sym = Sym_Enter(name, SYM_INSTVAR, curClass, type, expr, - isPublic); - } else { - /* - * Defining a regular variable. - */ - sym = Sym_Enter(name, SYM_VAR, dot, type); - - if (advance) { - /* - * Enter the data definition if not just a label. May need to - * copy the curExpr in case of recursive parser call. - */ - int maxElts = 0; /* As many as needed... */ - - if (usebase) { - maxElts = type->tn_u.tn_array.tn_length; - type = type->tn_u.tn_array.tn_base; - } - - switch(type->tn_type) { - case TYPE_STRUCT: - case TYPE_ARRAY: - { - /* - * These are things that could cause the parser to be - * called recursively, so we need to duplicate the - * current expression before trying to enter the data. - */ - Expr *expr = Expr_Copy(curExpr, TRUE); - Data_Enter(&dot, type, expr, maxElts); - Expr_Free(expr); - break; - } - default: - Data_Enter(&dot, type, curExpr, 0); - break; - } - } - } - FilterGenerated(sym); -} - - -/*********************************************************************** - * DefineDataSym - *********************************************************************** - * SYNOPSIS: Define the data for a symbol - * CALLED BY: DefineData, yyparse - * RETURN: Nothing - * SIDE EFFECTS: Lots - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 6/30/89 Initial Revision - * - ***********************************************************************/ -static void -DefineDataSym(SymbolPtr sym, /* Symbol for which to define data */ - TypePtr type, /* Type of data being defined */ - int advance, /* TRUE if should enter curExpr - * and advance dot */ - int usebase) /* TRUE if the type is an array put - * together by the parser, as opposed - * to a real array typedef. Tells us - * to pass the base type and length to - * Data_Enter separately */ -{ - if ((sym->flags & SYM_UNDEF) == 0) { - yyerror("%i already defined", sym->name); - } else if (sym->type != SYM_VAR) { - /* - * Since we're defining data here, this thing should have been declared - * as a variable. - */ - yyerror("declaration mismatch (should be variable)"); - goto def_sym; /* Define it anyway to avoid later errors */ - } else if ((sym->segment != curSeg) && (sym->segment->name != NullID)) { - yyerror("%i is declared in segment %i, defined in %i", sym->name, - sym->segment->name, curSeg->name); - goto def_sym; /* Define it anyway to avoid later errors */ - } else if (!Type_Equal(sym->u.var.type, type) && - (!usebase || - !Type_Equal(sym->u.var.type, type->tn_u.tn_array.tn_base))) - { - /* - * Type didn't match previous declaration. Note comparison with - * element type of array if usebase true. This allows indeterminate - * definitions (e.g. geosStr db "geosec.exe",0) to be declared - * global with just their base type (e.g. global geosStr:byte) - */ - yyerror("declaration mismatch (different data types)"); - goto def_sym; /* Define it anyway to avoid later errors */ - } else if (inStruct) { - /* - * Defining a structure -- need to convert the VAR to a FIELD and - * link it in... - * - * NOTE: The test for inStruct MUST come before that for - * curClass && defClass to allow class-related structures to be - * defined w/in a class declaration. - */ - Expr *expr; - - if (advance) { - expr = CopyExprCheckingIfZero(curExpr); - } else { - expr = NULL; - } - Sym_Enter(sym->name, SYM_FIELD, inStruct, type, expr); - } else if (curClass && defClass) { - /* - * Defining a class -- convert the VAR to an INSTVAR and link it - * into the instance structure. - */ - Expr *expr; - - if (advance) { - /* - * If default value for field is a zero constant, use the static - * zeroExpr, rather than allocating a whole new expression that - * means the same thing... - */ - expr = CopyExprCheckingIfZero(curExpr); - } else { - expr = NULL; - } - Sym_Enter(sym->name, SYM_INSTVAR, curClass, type, expr, isPublic); - } else { - /* - * Just a regular variable definition -- set the addrsym.offset and - * deal with the data... - */ -def_sym: - /* Set segment, to deal with declaration in global segment */ - sym->segment = curSeg; - - /* Set type to handle global definition as pointer to void, which will - * match actual pointer definition */ - sym->u.var.type = type; - - sym->flags &= ~SYM_UNDEF; - - Sym_SetAddress(sym, dot); - - if (advance) { - /* - * Enter the data definition if not just a label. May need to - * copy the curExpr in case of recursive parser call. - */ - int maxElts = 0; /* As many as needed... */ - - if (usebase) { - maxElts = type->tn_u.tn_array.tn_length; - type = type->tn_u.tn_array.tn_base; - } - - switch(type->tn_type) { - case TYPE_STRUCT: - case TYPE_ARRAY: - { - /* - * These are things that could cause the parser to be - * called recursively, so we need to duplicate the - * current expression before trying to enter the data. - */ - Expr *expr = Expr_Copy(curExpr, TRUE); - Data_Enter(&dot, type, expr, maxElts); - Expr_Free(expr); - break; - } - default: - Data_Enter(&dot, type, curExpr, 0); - break; - } - } - } -} - - -/*********************************************************************** - * Parse_Init - *********************************************************************** - * SYNOPSIS: Initialize parser state. - * CALLED BY: main - * RETURN: nothing - * SIDE EFFECTS: curSeg is set and the predefined STRING symbols - * are created. - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 8/29/89 Initial Revision - * - ***********************************************************************/ -void -Parse_Init(SymbolPtr global) -{ - int i; - char *name; - char *cp; - - /* - * Set the initial segment - */ - curSeg = global; - - /* - * Allocate a 256-byte MBlk record for each predefined string symbol, - * then enter the symbol into the table. - */ - for (i = NumElts(predefs)-1; i >= 0; i--) { - ID id; - - predefs[i].value = (MBlk *)malloc(sizeof(MBlk)+PD_VAL_LEN); - predefs[i].value->length = 0; - predefs[i].value->dynamic = TRUE; - predefs[i].value->next = NULL; - - id = ST_EnterNoLen(output, symStrings, predefs[i].name); - (void)Sym_Enter(id, SYM_STRING, predefs[i].value); - } - - /* - * Setup the initial @Cpu... - */ - sprintf(predefs[PD_CPU].value->text, "0%04xh", procType); - predefs[PD_CPU].value->length = strlen(predefs[PD_CPU].value->text); - - /* - * The @FileName gets set to the base of the first file. - */ - name = ST_Lock(output, curFile->name); - /* - * Point CP at the final component. - */ - cp = rindex(name, PATHNAME_SLASH); - if (cp++ == NULL) { - cp = name; - } - /* - * Copy the final component in. - */ - predefs[PD_FILENAME].value->length = strlen(cp); - bcopy(cp, - predefs[PD_FILENAME].value->text, - predefs[PD_FILENAME].value->length); - /* - * See if there's a suffix on the thing. - */ - cp = rindex(cp, '.'); - if (cp != NULL) { - /* - * Yup -- remove the length of the suffix from the length of the - * equate. - */ - predefs[PD_FILENAME].value->length -= strlen(cp); - } - ST_Unlock(output, curFile->name); - - curFile->iflevel = iflevel; - curFile->chunk = NULL; - - Parse_FileChange(TRUE); - - ResetExpr(&zeroExpr, zeroElts); - StoreExprConst(0); - StoreExprComma(); -} - - -/*********************************************************************** - * Parse_DefineString - *********************************************************************** - * SYNOPSIS: Define a string equate - * CALLED BY: main - * RETURN: Nothing - * SIDE EFFECTS: A SYM_STRING symbol is entered into the current - * scope (which should be global). - * - * STRATEGY: Not much. Allocates a single MBlk to hold the value, - * maps the name to an ID and enters the combination - * into the symbol table. - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 10/15/89 Initial Revision - * - ***********************************************************************/ -void -Parse_DefineString(char *name, - char *value) -{ - ID id = ST_EnterNoLen(output, symStrings, name); - MBlk *block; - int vlen = strlen(value); - SymbolPtr sym; - - sym = Sym_Find(id, SYM_STRING, FALSE); - - block = (MBlk *)malloc(sizeof(MArg) + vlen); - block->next = NULL; - block->length = vlen; - block->dynamic = TRUE; - bcopy(value, block->text, vlen); - - if (sym != NULL) { - if (sym->type != SYM_STRING) { - yyerror("cannot redefine %i as a string equate", id); - free((malloc_t)block); - } else { - MBlk *mp, *next; - - for (mp = sym->u.string.value; mp != NULL; mp = next) { - next = mp->next; - if (mp->dynamic) { - free((malloc_t)mp); - } - } - sym->u.string.value = block; - } - } else { - Sym_Enter(id, SYM_STRING, block); - } -} - - -/*********************************************************************** - * Parse_CheckClosure - *********************************************************************** - * SYNOPSIS: Make sure no important things are being left open - * CALLED BY: Parse_Complete, PopSegment, yystdwrap - * RETURN: non-zero if chunk was closed. This is used by - * PopSegment to deal with recursive call by LMem_EndChunk - * SIDE EFFECTS: An error may be generated. - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 10/27/89 Initial Revision - * - ***********************************************************************/ -int -Parse_CheckClosure(int *okPtr, - int checkSegStack) -{ - int retval = 0; - - *okPtr = 1; /* Assume user not a bozo */ - - /* - * Always close the current protominor thing, without generating a warning. - */ - curProtoMinor = NullSymbol; - - /* - * Make sure things aren't being left open/unresolved... - */ - if (curProc != NULL) { - if (curClass != NULL) { - Notify(NOTIFY_ERROR, curFile->name, -1, - "Method %i missing ENDM", curProc->name); - *okPtr = 0; - } else { - Notify(NOTIFY_ERROR, curFile->name, -1, - "Procedure %i missing ENDP", curProc->name); - *okPtr = 0; - } - } else if (curClass != NULL) { - Notify(NOTIFY_ERROR, curFile->name, -1, - "Class declaration for %i missing ENDC", curClass->name); - *okPtr = 0; - } else if (!checkSegStack && curChunk != NULL) { - /* - * Code executed on the closing of a segment. - */ - SymbolPtr chunk = curChunk; - - Notify(NOTIFY_ERROR, curFile->name, -1, - "Chunk %i missing ENDC", curChunk->name); - *okPtr = 0; - curChunk = NULL; - LMem_EndChunk(chunk); - ParseLocalizationCheck(); - /* - * Signal potential recursion. - */ - return(1); - } else if (inStruct != NULL) { - if (inStruct->type == SYM_STRUCT) { - Notify(NOTIFY_ERROR, curFile->name, -1, - "Structure definition for %i missing ENDS", inStruct->name); - } else { - Notify(NOTIFY_ERROR, curFile->name, -1, - "Union definition for %i missing END", inStruct->name); - } - *okPtr = 0; - } else if (usesMask) { - Notify(NOTIFY_ERROR, curFile->name, -1, - "USES given without procedure"); - *okPtr = 0; - } - - /* - * Code executed on the closing of a file. - */ - if (checkSegStack) { - /* - * Chunk needn't be closed as long as it's the one that - * was open when the file was entered. - */ - if (curChunk != curFile->chunk && curChunk != NULL) { - SymbolPtr chunk = curChunk; - - Notify(NOTIFY_ERROR, curFile->name, -1, - "Chunk %i missing ENDC", curChunk->name); - curChunk = NULL; - LMem_EndChunk(chunk); - ParseLocalizationCheck(); - retval = 1; - *okPtr = 0; - } - - /* - * Now any chunk is closed, make sure all segments are closed. - */ - if (segStack != curFile->segstack) { - SegStack *seg; - - Notify(NOTIFY_ERROR, curFile->name, -1, - "Open segments:\n\t%i", curSeg->name); - for (seg = segStack; seg != curFile->segstack; seg = seg->next) { - fprintf(stderr, "\t%i\n", seg->seg->name); - } - retval = 1; - *okPtr = 0; - } - } - - return(retval); -} - -/*********************************************************************** - * Parse_Complete - *********************************************************************** - * SYNOPSIS: Parsing is complete -- make sure no important things - * are left open. - * CALLED BY: main - * RETURN: 0 on error - * SIDE EFFECTS: None. - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 8/15/89 Initial Revision - * - ***********************************************************************/ -int -Parse_Complete(void) -{ - int retval; - - Parse_CheckClosure(&retval, TRUE); - return(retval); -} - -/*********************************************************************** - * Parse_FileChange - *********************************************************************** - * SYNOPSIS: Note another change in files. - * CALLED BY: ScanInclude - * RETURN: Nothing - * SIDE EFFECTS: The value for the @File equate is changed. - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 10/27/89 Initial Revision - * - ***********************************************************************/ -void -Parse_FileChange(int entry) -{ - char *file = ST_Lock(output, curFile->name); - int vlen = strlen(file); - MBlk *mp, *mpNext; - - for (mp = predefs[PD_FILE].value->next; - mp != NULL; - mp = mpNext) - { - mpNext = mp->next; - free((char *)mp); - } - for (mp = predefs[PD_FILE].value; - vlen > 0; - mp = mp->next) - { - int n = vlen; - - if (n > PD_VAL_LEN) { - n = PD_VAL_LEN; - } - bcopy(file, mp->text, n); - mp->dynamic = TRUE; - mp->length = n; - vlen -= n; - file += n; - - if (vlen > 0) { - mp->next = (MBlk *)malloc(sizeof(MArg)+PD_VAL_LEN); - } else { - break; - } - } - mp->next = NULL; - - ST_Unlock(output, curFile->name); - - /* - * Record segment stack level on entry to the file. - */ - if (entry) { - curFile->segstack = segStack; - } -} - - -/*********************************************************************** - * PushSegment - *********************************************************************** - * SYNOPSIS: Save the current state and switch to a new segment - * with the default state set up. - * CALLED BY: Lots o' things - * RETURN: Nothing - * SIDE EFFECTS: segStack is altered. - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 8/28/89 Initial Revision - * - ***********************************************************************/ -void -PushSegment(SymbolPtr sym) -{ - SegStack *seg; - char *name; - int i; - SymbolPtr newCS; - - seg = (SegStack *)malloc(sizeof(SegStack)); - seg->next = segStack; - seg->seg = curSeg; - seg->inStruct = inStruct; - seg->curProc = curProc; - seg->localSize = localSize; - seg->frameSize = frameSize; - seg->usesMask = usesMask; - seg->enterNeeded = enterNeeded; - seg->enterSeen = enterSeen; - seg->leaveSeen = leaveSeen; - seg->frameNeeded = frameNeeded; - seg->frameSetup = frameSetup; - seg->fall_thru = fall_thru; - seg->curChunk = curChunk; - seg->curClass = curClass; - seg->defClass = defClass; - seg->isPublic = isPublic; - seg->classProc = classProc; - - segStack = seg; - curSeg->u.segment.data->lastdot = dot; - - curSeg = sym; - dot = sym->u.segment.data->lastdot; - inStruct = (SymbolPtr)NULL; - curProc = (SymbolPtr)NULL; - localSize = 0; - frameSize = 0; - usesMask = 0; - enterNeeded = FALSE; - enterSeen = FALSE; - leaveSeen = FALSE; - frameNeeded = FALSE; - frameSetup = FALSE; - curChunk = (SymbolPtr)NULL; - defClass = FALSE; - isPublic = FALSE; - - EndClass(); - - /* - * Shut off class tokens if they were on before. - */ - if (classProc != -1) { - Scan_DontUseOpProc(classProc); - } - classProc = -1; - - if (sym->name != NullID) { - name = ST_Lock(output, sym->name); - } else { - name = "(null)"; - } - - predefs[PD_CURSEG].value->length = strlen(name); - bcopy(name, - predefs[PD_CURSEG].value->text, - predefs[PD_CURSEG].value->length); - ST_Unlock(output, sym->name); - - /* - * Bind CS to the new segment or its group, if it's in one. This - * makes sure that if someone uses a cs: override for something - * not in the current segment, s/he will get an error message from - * glue. If the current segment contains only data, the user shouldn't - * be using a cs: override. If it contains code, cs: has to be pointing - * to the segment or the group (this is the way we do things here). - */ - newCS = curSeg; - if (newCS->segment && newCS->segment->type == SYM_GROUP) { - newCS = newCS->segment; - } - for (i = NumElts(exprs)-1; i >= 0; i--) { - exprs[i]->segments[REG_CS] = newCS; - } -} - -/*********************************************************************** - * PopSegment - *********************************************************************** - * SYNOPSIS: Go back to the previously-saved segment - * CALLED BY: External - * RETURN: Nothing - * SIDE EFFECTS: All the parser state variables are changed - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 8/28/89 Initial Revision - * - ***********************************************************************/ -void -PopSegment(void) -{ - SegStack *seg; - char *name; - int junk; - int i; - SymbolPtr newCS; - - - /* - * Record final location counter for later entry - */ - curSeg->u.segment.data->lastdot = dot; - - if (Parse_CheckClosure(&junk, FALSE)) { - /* - * Recursed -- get ooout - */ - return; - } - - seg = segStack; - - curSeg = seg->seg; - inStruct = seg->inStruct; - curProc = seg->curProc; - localSize = seg->localSize; - frameSize = seg->frameSize; - usesMask = seg->usesMask; - enterNeeded = seg->enterNeeded; - enterSeen = seg->enterSeen; - leaveSeen = seg->leaveSeen; - frameNeeded = seg->frameNeeded; - frameSetup = seg->frameSetup; - fall_thru = seg->fall_thru; - curChunk = seg->curChunk; - defClass = seg->defClass; - isPublic = seg->isPublic; - - if (seg->curClass) { - EnterClass(seg->curClass); - } else { - EndClass(); - } - - /* - * Turn the class tokens back on if they were on in the segment - */ - classProc = seg->classProc; - if (classProc != -1) { - classProc = Scan_UseOpProc(findClassToken); - } - - /* - * Set the location counter back to wherever it was when last we left - * this segment -- this makes the object method table creation a bit - * easier, since it can just push to the class's segment, insert stuff, - * then adjust dot if it's in the way and we will take care of things as - * necessary. - */ - dot = curSeg->u.segment.data->lastdot; - - /* - * Pop and free the record. - */ - segStack = seg->next; - free((char *)seg); - - /* - * Fix up the @CurSeg equate. - */ - if (curSeg->name != NullID) { - name = ST_Lock(output, curSeg->name); - - predefs[PD_CURSEG].value->length = strlen(name); - bcopy(name, - predefs[PD_CURSEG].value->text, - predefs[PD_CURSEG].value->length); - ST_Unlock(output, curSeg->name); - } else { - /* - * Data can't be entered into the global segment, so no need to worry - * about leaving the previous one as the current resource for - * localization info - */ - predefs[PD_CURSEG].value->length = 0; - } - /* - * Bind CS to the new segment or its group, if it's in one. This - * makes sure that if someone uses a cs: override for something - * not in the current segment, s/he will get an error message from - * glue. If the current segment contains only data, the user shouldn't - * be using a cs: override. If it contains code, cs: has to be pointing - * to the segment or the group (this is the way we do things here). - */ - newCS = curSeg; - if (newCS->segment && newCS->segment->type == SYM_GROUP) { - newCS = newCS->segment; - } - for (i = NumElts(exprs)-1; i >= 0; i--) { - exprs[i]->segments[REG_CS] = newCS; - } -} - - -/*********************************************************************** - * HandleIF - *********************************************************************** - * SYNOPSIS: Deal with the start of a conditional. curExpr contains - * an expression to be evaluated if necessary to - * decide if the conditional code is to be assembled. - * If the result is a non-zero constant, the conditional - * is taken. - * CALLED BY: parser for all IF and ELSEIF tokens - * RETURN: Nothing - * SIDE EFFECTS: iflevel is altered. Scan_ToEndif may be called. - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 8/28/89 Initial Revision - * - ***********************************************************************/ -static void -HandleIF(int isElse) /* Non-zero if token was ELSEIF */ -{ - ExprResult result; - - if (isElse) { - /* - * ELSEIF: if no nested ifs, bitch. Else, if last - * if was TRUE, switch to FALSE and skip to the endif. - */ - if (iflevel == -1) { - yyerror("IF-less ELSEIF"); - } else if (ifStack[iflevel].value) { - /* - * Prev was TRUE -- skip to end of conditional without evaluating - * expression (this is important) - */ - ifStack[iflevel].value = 0; - Scan_ToEndif(FALSE); - } else { - int cond; - - if (!Expr_Eval(curExpr, &result, EXPR_NOUNDEF|EXPR_FINALIZE, NULL)) - { - yyerror((char *)result.type); - cond = 0; /* Don't take the conditional */ - } else if (result.type == EXPR_TYPE_CONST) { - cond = result.data.number; - } else { - yyerror("condition must be a numeric constant"); - cond = 0; - } - if (cond) { - /* - * Prev was FALSE, this is TRUE -- continue parsing - */ - ifStack[iflevel].value = 1; - } else { - /* - * Prev was FALSE, this is FALSE -- skip to - * ENDIF, ELSE or another ELSEIF. - */ - Scan_ToEndif(TRUE); - } - } - } else if (iflevel == MAX_IF_LEVEL) { - yyerror("Too many nested IF's (%d max)", MAX_IF_LEVEL); - } else { - int cond; - - if (!Expr_Eval(curExpr, &result, EXPR_NOUNDEF|EXPR_FINALIZE, NULL)) { - yyerror((char *)result.type); - cond = 0; /* Don't take the conditional */ - } else if (result.type == EXPR_TYPE_CONST) { - cond = result.data.number; - } else { - yyerror("condition must be a numeric constant"); - cond = 0; - } - if (cond) { - ifStack[++iflevel].value = 1; - ifStack[iflevel].file = curFile->name; - ifStack[iflevel].line = yylineno; - } else { - /* - * Record a false IF and go to an ELSE or ENDIF - */ - ifStack[++iflevel].value = 0; - ifStack[iflevel].file = curFile->name; - ifStack[iflevel].line = yylineno; - Scan_ToEndif(TRUE); - } - } -} - -/*********************************************************************** - * RedefineString - *********************************************************************** - * SYNOPSIS: Redefine a string equate, giving an error if - * the symbol in question isn't a string equate. - * CALLED BY: yyparse string rules - * RETURN: Nothing - * SIDE EFFECTS: The previous value is freed. - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 10/12/89 Initial Revision - * - ***********************************************************************/ -static void -RedefineString(SymbolPtr sym, /* Symbol to redefine */ - MBlk *val) /* New value chain */ -{ - /* - * Redefinition of text macro. Free old value and - * store new. - */ - if (sym->type != SYM_STRING) { - yyerror("%i is not a string constant", sym->name); - } else { - MBlk *mp, *mpNext; - - for(mp = sym->u.string.value; mp != (MBlk *)NULL; mp = mpNext) { - mpNext = mp->next; - if (mp->dynamic) { - free((char *)mp); - } - } - sym->u.string.value = val; - } -} - -/*********************************************************************** - * FindSubstring - *********************************************************************** - * SYNOPSIS: Locate a string inside another string. - * CALLED BY: yyparse for INSTR directive - * RETURN: the offset of the start of the string in the other - * string, zero-origin. -1 if substring not found. - * SIDE EFFECTS: None - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 10/12/89 Initial Revision - * - ***********************************************************************/ -static long -FindSubstring(char *string, /* String to search. */ - char *substring) /* Substring to try to find in string. */ -{ - register char *a, *b; - char *strstart = string; - - /* - * First scan quickly through the two strings looking for a - * single-character match. When it's found, then compare the - * rest of the substring. - */ - - b = substring; - for ( ; *string != 0; string += 1) { - if (*string != *b) { - continue; - } - a = string; - while (TRUE) { - if (*b == 0) { - return string-strstart; - } - if (*a++ != *b++) { - break; - } - } - b = substring; - } - return -1; -} - - -/*********************************************************************** - * CheckRelated - *********************************************************************** - * SYNOPSIS: Make sure a symbol is related to a class. - * CALLED BY: parser for methods, method handlers and instance variables - * RETURN: 0 if the class of the symbol and the current class - * are unrelated. - * SIDE EFFECTS: None - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 11/30/89 Initial Revision - * - ***********************************************************************/ -static int -CheckRelated(Symbol *curClass, /* Currently-active class */ - Symbol *otherClass) /* Class of symbol being - * referenced */ -{ - int retval; - - if (curClass == NULL) { - return(FALSE); - } - - curClass->u.class.data->flags |= SYM_CLASS_CHECKING; - - retval = (curClass == otherClass); - if (!retval) { - Symbol *class; - int i; - - for (i = 0; i < curClass->u.class.data->numUsed; i++) { - class = curClass->u.class.data->used[i]; - - if (!(class->u.class.data->flags & SYM_CLASS_CHECKING) && - CheckRelated(class, otherClass)) - { - retval = TRUE; - break; - } - } - } - - if (!retval) { - retval = CheckRelated(curClass->u.class.super, otherClass); - } - - curClass->u.class.data->flags &= ~SYM_CLASS_CHECKING; - - return(retval); -} - - -/*********************************************************************** - * ParseCountLocals - *********************************************************************** - * SYNOPSIS: Callback function to count the local variables already - * defined for the current procedure. - * CALLED BY: handler for push-initialized local variable setup - * via Sym_ForEachLocal - * RETURN: 0 (continue scan) - * SIDE EFFECTS: ... - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 7/ 3/91 Initial Revision - * - ***********************************************************************/ -static int -ParseCountLocals(SymbolPtr sym, - Opaque data) -{ - if (sym->u.localVar.offset <= 0) { - *(int *)data += 1; - } - return(0); -} - - -/*********************************************************************** - * ParseAdjustLocals - *********************************************************************** - * SYNOPSIS: Callback function to adjust all local variable offsets - * for a procedure by a set amount. This does not adjust - * the offsets for arguments, just locals. - * CALLED BY: handler for "push bp"-initialized local variables - * via Sym_ForEachLocal - * RETURN: 0 (continue scan) - * SIDE EFFECTS: ... - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 7/ 3/91 Initial Revision - * - ***********************************************************************/ -static int -ParseAdjustLocals(SymbolPtr sym, - Opaque data) -{ - if (sym->u.localVar.offset < 0) { - /* - * Offset < 0 => it's local, so adjust it. - */ - sym->u.localVar.offset += (int)data; - } - return(0); -} - - -/*********************************************************************** - * ParseFallThruCheck - *********************************************************************** - * SYNOPSIS: Make sure the operand given to a .fall_thru is - * in fact the thing that follows the .fall_thru. - * CALLED BY: Fixup module during pass 2 - * RETURN: FR_ERROR or FR_DONE - * SIDE EFFECTS: operand of .fall_thru is marked referenced - * - * STRATEGY: - * Evaluate the operand (which marks it referenced) and - * make sure the offset in the result (plus the symbol's - * own offset) matches the offset of the .fall_thru, as - * encoded in the fixup's own address. - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 4/26/94 Initial Revision - * - ***********************************************************************/ -static FixResult -ParseFallThruCheck(int *dotPtr, /* location of .fall_thru. */ - int prevSize, /* Size of data-to-fixup during - * previous pass (0) */ - int pass, /* Current pass */ - Expr *expr1, /* Operand of .fall_thru */ - Expr *expr2, /* NULL */ - Opaque data) /* Ignored */ -{ - ExprResult result; - byte status; - int targ; - - /* - * Evaluate the operand to something useful. - */ - if (!Expr_Eval(expr1, &result, EXPR_FINALIZE|EXPR_NOT_OPERAND, &status)) { - Notify(NOTIFY_ERROR, expr1->file, expr1->line, - "%s", (char *)result.type); - return(FR_ERROR); - } - - /* - * The result must be a direct code-related value (i.e. the expression - * must have been a procedure, method, or label). - */ - if ((status & (EXPR_STAT_DIRECT|EXPR_STAT_CODE)) != - (EXPR_STAT_DIRECT|EXPR_STAT_CODE)) - { - Notify(NOTIFY_ERROR, expr1->file, expr1->line, - "invalid operand for .fall_thru: must be procedure or label"); - return(FR_ERROR); - } - /* - * Compute the actual offset, including any symbol offset, of the operand - * so we can compare it to the .fall_thru's own. - */ - targ = result.data.ea.disp; - if (result.rel.sym != NULL) { - targ += result.rel.sym->u.addrsym.offset; - } - - if (*dotPtr != targ) { - if (result.rel.sym != NULL) { - Notify(NOTIFY_ERROR, expr1->file, expr1->line, - "%i does not immediately follow .fall_thru, off by %d bytes", - result.rel.sym->name, (targ - *dotPtr)); - } else { - Notify(NOTIFY_ERROR, expr1->file, expr1->line, - ".fall_thru not immediately followed by what you said followed it"); - } - return(FR_ERROR); - } - /* - * Happiness. Fixup module will free the expression, etc. - */ - return (FR_DONE); -} - -/*********************************************************************** - * ParseIsLibName - *********************************************************************** - * SYNOPSIS: See if the passed ID is one of those specified with - * the -n flag as being a library name for this here - * geode. - * CALLED BY: (INTERNAL) - * RETURN: TRUE if it is - * SIDE EFFECTS: none - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 3/17/95 Initial Revision - * - ***********************************************************************/ -static int -ParseIsLibName(ID id) -{ - int i; - - for (i = 0; i < numLibNames; i++) { - if (libNames[i] == id) { - return (TRUE); - } - } - return(FALSE); -} - - -/*********************************************************************** - * Parse_LastChunkWarning - *********************************************************************** - * SYNOPSIS: Display the warning related to the lastChunk. - * CALLED BY: EXTERN - * RETURN: nothing - * SIDE EFFECTS: nothing - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * clee 2/ 4/97 Initial Revision - * - ***********************************************************************/ -void -Parse_LastChunkWarning (char *fmt, ...) -{ - va_list args; - - /* - * We only give warnings to the .asm files. The localization warnings - * in .rdef have been handled by UIC. - */ - if ( strstr(lastChunkFile, ".rdef") == NULL ){ /* not .rdef file */ - va_start(args,fmt); - -#if defined(unix) || defined(_WIN32) - fprintf(stderr, "file %s, line %d: Warning: ", - lastChunkFile, lastChunkLine); -#else - fprintf(stderr, "Warning %s %d: ", - lastChunkFile, lastChunkLine); -#endif - vfprintf(stderr, fmt, args); - - va_end(args); - - putc('\n', stderr); - } - -} /* End of Parse_LastChunkWarning. */ - - -/*********************************************************************** - * ParseSetLastChunkWarningInfo - *********************************************************************** - * SYNOPSIS: Set the file name and line number for the lastChunk. - * CALLED BY: parser - * RETURN: nothing - * SIDE EFFECTS: - * lastChunkLine and lastChunkFile are set. - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * clee 2/ 4/97 Initial Revision - * - ***********************************************************************/ -static void -ParseSetLastChunkWarningInfo (void) -{ - if ( warn_localize ){ - /* Set the line number */ - lastChunkLine = yylineno; - - /* Set the file name */ - sprintf(lastChunkFile, "%i", curFile->name); - } -} /* End of ParseSetLastChunkWarningInfo. */ - - -/*********************************************************************** - * ParseLocalizationCheck - *********************************************************************** - * SYNOPSIS: Check the lastChunk to see if it is localizable. - * CALLED BY: parser - * RETURN: nothing - * SIDE EFFECTS: - * localizationRequired may change. - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * clee 2/ 5/97 Initial Revision - * - ***********************************************************************/ -static void -ParseLocalizationCheck (void) -{ - if (warn_localize && - lastChunk != NULL && - lastChunk->u.chunk.loc != NULL && - lastChunk->u.chunk.loc->dataTypeHint == CDT_text ){ - localizationRequired = 1; - } -} /* End of ParseLocalizationCheck. */ diff --git a/Tools/esp/parse.h b/Tools/esp/parse.h deleted file mode 100644 index 13cbf394b..000000000 --- a/Tools/esp/parse.h +++ /dev/null @@ -1,240 +0,0 @@ -#define MEMMODEL 257 -#define LANGUAGE 258 -#define EQU 259 -#define MACRO 260 -#define ALIGNMENT 261 -#define BREAK 262 -#define BYTEREG 263 -#define CAST 264 -#define COMBINE 265 -#define CONSTANT 266 -#define COPROCESSOR 267 -#define DEBUG 268 -#define DEF 269 -#define DWORDREG 270 -#define MASM 271 -#define PNTR 272 -#define PROCESSOR 273 -#define SEGREG 274 -#define SHOWM 275 -#define STATE 276 -#define WORDREG 277 -#define ST 278 -#define IFNDEF 279 -#define IFDEF 280 -#define IFDIF 281 -#define IFE 282 -#define IFIDN 283 -#define IFNB 284 -#define IFB 285 -#define IF 286 -#define IF1 287 -#define IF2 288 -#define FIRSTOP 289 -#define AND 290 -#define ARITH2 291 -#define ARPL 292 -#define BITNF 293 -#define BOUND 294 -#define CALL 295 -#define CMPS 296 -#define ENTER 297 -#define GROUP1 298 -#define IMUL 299 -#define IO 300 -#define INS 301 -#define INT 302 -#define JMP 303 -#define JUMP 304 -#define LDPTR 305 -#define LEA 306 -#define LEAVE 307 -#define LOCK 308 -#define LODS 309 -#define LOOP 310 -#define LSDT 311 -#define LSINFO 312 -#define MOV 313 -#define MOVS 314 -#define NAIO 315 -#define NAPRIV 316 -#define NASTRG 317 -#define NASTRGD 318 -#define NASTRGW 319 -#define NOARG 320 -#define NOARGD 321 -#define NOARGW 322 -#define NOT 323 -#define OR 324 -#define OPCODE 325 -#define OUTS 326 -#define POP 327 -#define PWORD 328 -#define PUSH 329 -#define REP 330 -#define RET 331 -#define RETF 332 -#define RETN 333 -#define SCAS 334 -#define SHIFT 335 -#define SHL 336 -#define SHLD 337 -#define SHR 338 -#define SHRD 339 -#define STOS 340 -#define TEST 341 -#define WREG1 342 -#define XCHG 343 -#define XLAT 344 -#define XLATB 345 -#define XOR 346 -#define FGROUP0 347 -#define FGROUP1 348 -#define FBIOP 349 -#define FCOM 350 -#define FUOP 351 -#define FZOP 352 -#define FFREE 353 -#define FINT 354 -#define FLDST 355 -#define FXCH 356 -#define LASTOP 357 -#define IDENT 358 -#define STRING 359 -#define PCTOUT 360 -#define MACARG 361 -#define STRUCT_INIT 362 -#define MACEXEC 363 -#define FIRSTSYM 364 -#define SYM 365 -#define STRUCT_SYM 366 -#define CLASS_SYM 367 -#define METHOD_SYM 368 -#define MODULE_SYM 369 -#define INSTVAR_SYM 370 -#define TYPE_SYM 371 -#define ETYPE_SYM 372 -#define RECORD_SYM 373 -#define EXPR_SYM 374 -#define LASTSYM 375 -#define PROTOMINOR_SYM 376 -#define EXPR 377 -#define PTYPE 378 -#define ABS 379 -#define ALIGN 380 -#define ASSERT 381 -#define ASSUME 382 -#define AT 383 -#define CATSTR 384 -#define CHUNK 385 -#define CLASS 386 -#define COMMENT 387 -#define CPUBLIC 388 -#define DEFAULT 389 -#define DEFETYPE 390 -#define DOT 391 -#define DOTENTER 392 -#define DOTLEAVE 393 -#define DOTTYPE 394 -#define DUP 395 -#define DYNAMIC 396 -#define ELSE 397 -#define END 398 -#define ENDC 399 -#define ENDIF 400 -#define ENDM 401 -#define ENDP 402 -#define ENDS 403 -#define ENUM 404 -#define EQ 405 -#define ERR 406 -#define ERRB 407 -#define ERRDEF 408 -#define ERRDIF 409 -#define ERRE 410 -#define ERRIDN 411 -#define ERRNB 412 -#define ERRNDEF 413 -#define ERRNZ 414 -#define EVEN 415 -#define EXITF 416 -#define EXITM 417 -#define EXPORT 418 -#define FALLTHRU 419 -#define FAR 420 -#define FIRST 421 -#define FLDMASK 422 -#define GE 423 -#define GLOBAL 424 -#define GROUP 425 -#define GT 426 -#define HANDLE 427 -#define HIGH 428 -#define HIGHPART 429 -#define INCLUDE 430 -#define INHERIT 431 -#define INST 432 -#define INSTR 433 -#define IOENABLE 434 -#define IRP 435 -#define IRPC 436 -#define LABEL 437 -#define LE 438 -#define LENGTH 439 -#define LMEM 440 -#define LOCAL 441 -#define LOCALIZE 442 -#define LOW 443 -#define LOWPART 444 -#define LT 445 -#define MASK 446 -#define MASTER 447 -#define METHOD 448 -#define MOD 449 -#define MODEL 450 -#define NE 451 -#define NEAR 452 -#define NORELOC 453 -#define NOTHING 454 -#define OFFPART 455 -#define OFFSET 456 -#define ON_STACK 457 -#define ORG 458 -#define PRIVATE 459 -#define PROC 460 -#define PROTOMINOR 461 -#define PROTORESET 462 -#define PTR 463 -#define PUBLIC 464 -#define RECORD 465 -#define RELOC 466 -#define REPT 467 -#define RESID 468 -#define SEG 469 -#define SEGMENT 470 -#define SEGREGOF 471 -#define SEGPART 472 -#define SIZE 473 -#define SIZESTR 474 -#define STATIC 475 -#define STRUC 476 -#define SUBSTR 477 -#define SUPER 478 -#define THIS 479 -#define TYPE 480 -#define UNDEF 481 -#define UNION 482 -#define UNREACHED 483 -#define USES 484 -#define VARDATA 485 -#define VARIANT 486 -#define VSEG 487 -#define WARN 488 -#define WIDTH 489 -#define WRITECHECK 490 -#define NOWRITECHECK 491 -#define READCHECK 492 -#define NOREADCHECK 493 -#define SHORT 494 -#define UNARY 495 - diff --git a/Tools/esp/parse.tab.h b/Tools/esp/parse.tab.h deleted file mode 100644 index 13cbf394b..000000000 --- a/Tools/esp/parse.tab.h +++ /dev/null @@ -1,240 +0,0 @@ -#define MEMMODEL 257 -#define LANGUAGE 258 -#define EQU 259 -#define MACRO 260 -#define ALIGNMENT 261 -#define BREAK 262 -#define BYTEREG 263 -#define CAST 264 -#define COMBINE 265 -#define CONSTANT 266 -#define COPROCESSOR 267 -#define DEBUG 268 -#define DEF 269 -#define DWORDREG 270 -#define MASM 271 -#define PNTR 272 -#define PROCESSOR 273 -#define SEGREG 274 -#define SHOWM 275 -#define STATE 276 -#define WORDREG 277 -#define ST 278 -#define IFNDEF 279 -#define IFDEF 280 -#define IFDIF 281 -#define IFE 282 -#define IFIDN 283 -#define IFNB 284 -#define IFB 285 -#define IF 286 -#define IF1 287 -#define IF2 288 -#define FIRSTOP 289 -#define AND 290 -#define ARITH2 291 -#define ARPL 292 -#define BITNF 293 -#define BOUND 294 -#define CALL 295 -#define CMPS 296 -#define ENTER 297 -#define GROUP1 298 -#define IMUL 299 -#define IO 300 -#define INS 301 -#define INT 302 -#define JMP 303 -#define JUMP 304 -#define LDPTR 305 -#define LEA 306 -#define LEAVE 307 -#define LOCK 308 -#define LODS 309 -#define LOOP 310 -#define LSDT 311 -#define LSINFO 312 -#define MOV 313 -#define MOVS 314 -#define NAIO 315 -#define NAPRIV 316 -#define NASTRG 317 -#define NASTRGD 318 -#define NASTRGW 319 -#define NOARG 320 -#define NOARGD 321 -#define NOARGW 322 -#define NOT 323 -#define OR 324 -#define OPCODE 325 -#define OUTS 326 -#define POP 327 -#define PWORD 328 -#define PUSH 329 -#define REP 330 -#define RET 331 -#define RETF 332 -#define RETN 333 -#define SCAS 334 -#define SHIFT 335 -#define SHL 336 -#define SHLD 337 -#define SHR 338 -#define SHRD 339 -#define STOS 340 -#define TEST 341 -#define WREG1 342 -#define XCHG 343 -#define XLAT 344 -#define XLATB 345 -#define XOR 346 -#define FGROUP0 347 -#define FGROUP1 348 -#define FBIOP 349 -#define FCOM 350 -#define FUOP 351 -#define FZOP 352 -#define FFREE 353 -#define FINT 354 -#define FLDST 355 -#define FXCH 356 -#define LASTOP 357 -#define IDENT 358 -#define STRING 359 -#define PCTOUT 360 -#define MACARG 361 -#define STRUCT_INIT 362 -#define MACEXEC 363 -#define FIRSTSYM 364 -#define SYM 365 -#define STRUCT_SYM 366 -#define CLASS_SYM 367 -#define METHOD_SYM 368 -#define MODULE_SYM 369 -#define INSTVAR_SYM 370 -#define TYPE_SYM 371 -#define ETYPE_SYM 372 -#define RECORD_SYM 373 -#define EXPR_SYM 374 -#define LASTSYM 375 -#define PROTOMINOR_SYM 376 -#define EXPR 377 -#define PTYPE 378 -#define ABS 379 -#define ALIGN 380 -#define ASSERT 381 -#define ASSUME 382 -#define AT 383 -#define CATSTR 384 -#define CHUNK 385 -#define CLASS 386 -#define COMMENT 387 -#define CPUBLIC 388 -#define DEFAULT 389 -#define DEFETYPE 390 -#define DOT 391 -#define DOTENTER 392 -#define DOTLEAVE 393 -#define DOTTYPE 394 -#define DUP 395 -#define DYNAMIC 396 -#define ELSE 397 -#define END 398 -#define ENDC 399 -#define ENDIF 400 -#define ENDM 401 -#define ENDP 402 -#define ENDS 403 -#define ENUM 404 -#define EQ 405 -#define ERR 406 -#define ERRB 407 -#define ERRDEF 408 -#define ERRDIF 409 -#define ERRE 410 -#define ERRIDN 411 -#define ERRNB 412 -#define ERRNDEF 413 -#define ERRNZ 414 -#define EVEN 415 -#define EXITF 416 -#define EXITM 417 -#define EXPORT 418 -#define FALLTHRU 419 -#define FAR 420 -#define FIRST 421 -#define FLDMASK 422 -#define GE 423 -#define GLOBAL 424 -#define GROUP 425 -#define GT 426 -#define HANDLE 427 -#define HIGH 428 -#define HIGHPART 429 -#define INCLUDE 430 -#define INHERIT 431 -#define INST 432 -#define INSTR 433 -#define IOENABLE 434 -#define IRP 435 -#define IRPC 436 -#define LABEL 437 -#define LE 438 -#define LENGTH 439 -#define LMEM 440 -#define LOCAL 441 -#define LOCALIZE 442 -#define LOW 443 -#define LOWPART 444 -#define LT 445 -#define MASK 446 -#define MASTER 447 -#define METHOD 448 -#define MOD 449 -#define MODEL 450 -#define NE 451 -#define NEAR 452 -#define NORELOC 453 -#define NOTHING 454 -#define OFFPART 455 -#define OFFSET 456 -#define ON_STACK 457 -#define ORG 458 -#define PRIVATE 459 -#define PROC 460 -#define PROTOMINOR 461 -#define PROTORESET 462 -#define PTR 463 -#define PUBLIC 464 -#define RECORD 465 -#define RELOC 466 -#define REPT 467 -#define RESID 468 -#define SEG 469 -#define SEGMENT 470 -#define SEGREGOF 471 -#define SEGPART 472 -#define SIZE 473 -#define SIZESTR 474 -#define STATIC 475 -#define STRUC 476 -#define SUBSTR 477 -#define SUPER 478 -#define THIS 479 -#define TYPE 480 -#define UNDEF 481 -#define UNION 482 -#define UNREACHED 483 -#define USES 484 -#define VARDATA 485 -#define VARIANT 486 -#define VSEG 487 -#define WARN 488 -#define WIDTH 489 -#define WRITECHECK 490 -#define NOWRITECHECK 491 -#define READCHECK 492 -#define NOREADCHECK 493 -#define SHORT 494 -#define UNARY 495 - diff --git a/Tools/esp/parse.y b/Tools/esp/parse.y index 9fa5d8084..7d8d00791 100644 --- a/Tools/esp/parse.y +++ b/Tools/esp/parse.y @@ -33,9 +33,6 @@ * A grammar to parse code for the assembler. * ***********************************************************************/ -#ifndef lint -static char *rcsid = "$Id: parse.y,v 3.73 95/09/20 14:46:15 weber Exp $"; -#endif lint #include @@ -305,19 +302,19 @@ static struct { * for @CurSeg), we just copy the new value into the * block and alter the length */ } predefs[] = { - "@CurSeg", NULL, + { "@CurSeg", NULL, }, #define PD_CURSEG 0 - "@Cpu", NULL, + { "@Cpu", NULL, }, #define PD_CPU 1 - "@CurProc", NULL, + { "@CurProc", NULL, }, #define PD_CURPROC 2 - "@FileName", NULL, + { "@FileName", NULL, }, #define PD_FILENAME 3 - "@CurClass", NULL, + { "@CurClass", NULL, }, #define PD_CURCLASS 4 - "@File", NULL, + { "@File", NULL, }, #define PD_FILE 5 - "@ArgSize", NULL, + { "@ArgSize", NULL, }, #define PD_ARGSIZE 6 }; @@ -350,8 +347,6 @@ static void DupExpr(int num, int start); static void StoreSubExpr(Expr *); static void FilterGenerated(SymbolPtr sym); -void yyerror(char *fmt, ...); -void yywarning(char *fmt, ...); static int ParseAdjustLocals(SymbolPtr, Opaque); static int ParseCountLocals(SymbolPtr, Opaque); @@ -966,7 +961,8 @@ StoreSubExpr(Expr *expr) * This is now defined as union SemVal in scan.h, to avoid problems with * High C. *****************************************************************************/ -%pure_parser +%pure-parser +%debug %token MEMMODEL %token LANGUAGE @@ -1008,7 +1004,7 @@ StoreSubExpr(Expr *expr) MASK MASTER METHOD MOD MODEL NE NEAR NORELOC NOTHING OFFPART OFFSET ON_STACK ORG - PRIVATE PROCESSOR PROC PROTOMINOR PROTORESET PTR PUBLIC + PRIVATE PROC PROTOMINOR PROTORESET PTR PUBLIC RECORD RELOC REPT RESID SEG SEGMENT SEGREGOF SEGPART SIZE SIZESTR STATIC STRUC SUBSTR SUPER @@ -1078,8 +1074,9 @@ StoreSubExpr(Expr *expr) * interpretation by shifting, which is what we want. * 2 other s/r conflicts come from the def/defList definition. It does the * right thing, and I've not the time to do it right. + * 3...5 I have no idea about. */ -%expect 3 +%expect 5 %% /* @@ -1550,7 +1547,7 @@ localID : IDENT yywarning("definition of %i as local variable shadows global symbol", $1->name); } - $$ = $1->name + $$ = $1->name; } | /* empty */ { $$ = NullID; } | sym @@ -5636,7 +5633,7 @@ op : SHLD operand1 flexiComma operand2 flexiComma CLorCexpr op : DEBUG { lexdebug = yydebug = $1; } | SHOWM { showmacro = $1; } | MASM { masmCompatible = $1; } - | BREAK { _asm int 3; } + | BREAK { /* _asm int 3; --- not portable */ } | FALLTHRU { fall_thru = 1; } | FALLTHRU operand1 { @@ -6292,13 +6289,13 @@ ParseStackOverflow(char *msg, /* Message if we decide not to */ ***********************************************************************/ /*VARARGS1*/ void -yyerror(char *fmt, ...) +yyerror(const char *fmt, ...) { va_list args; va_start(args, fmt); - NotifyInt(NOTIFY_ERROR, curFile->name, yylineno, fmt, args); + NotifyInt(NOTIFY_ERROR, curFile->name, yylineno, (char*)fmt, args); va_end(args); } @@ -6355,13 +6352,13 @@ FilterGenerated(SymbolPtr sym) ***********************************************************************/ /*VARARGS1*/ void -yywarning(char *fmt, ...) +yywarning(const char *fmt, ...) { va_list args; va_start(args, fmt); - NotifyInt(NOTIFY_WARNING, curFile->name, yylineno, fmt, args); + NotifyInt(NOTIFY_WARNING, curFile->name, yylineno, (char*)fmt, args); va_end(args); } diff --git a/Tools/esp/printobj.c b/Tools/esp/printobj.c index a637530db..e8175a09d 100644 --- a/Tools/esp/printobj.c +++ b/Tools/esp/printobj.c @@ -21,10 +21,6 @@ * Program to print out the contents of an object file. * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: printobj.c,v 3.25 95/02/17 16:27:30 adam Exp $"; -#endif lint #include diff --git a/Tools/esp/printsls.c b/Tools/esp/printsls.c index 95fd00b7a..0a1491f65 100644 --- a/Tools/esp/printsls.c +++ b/Tools/esp/printsls.c @@ -21,12 +21,8 @@ * Program to print out the contents of an object file. * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: printobj.c,v 3.25 95/02/17 16:27:30 adam Exp $"; -#endif lint -#include +#include "config.h" #include #include diff --git a/Tools/esp/scan.c b/Tools/esp/scan.c index 2376c369d..06a4a2d8d 100644 --- a/Tools/esp/scan.c +++ b/Tools/esp/scan.c @@ -28,10 +28,6 @@ * Lexical analyzer for Esp. Taken mostly from the scanner for Asap. * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: scan.c,v 1.51 94/03/31 13:20:54 jimmy Exp $"; -#endif lint #include "esp.h" #include "scan.h" @@ -79,7 +75,7 @@ int lexdebug=0; #define DBG(args) #endif -FILE *yyin = stdin; +FILE *yyin; int yylineno=1; LexProc *yylex; @@ -240,7 +236,7 @@ static MacState *freeState = (MacState *)NULL; * ardeb 8/29/89 Initial Revision * ***********************************************************************/ -inline void +static inline void yynewline(void) { yylineno++; @@ -776,7 +772,7 @@ NextID(char **pbPtr) /* Place to store original pushback pointer * if the next token is indeed an identifier */ { char *cp; - char c; + int c; int pushspace = 0; /* Non-zero if should push back * a single space when done. */ int retval = TRUE; @@ -831,6 +827,10 @@ NextID(char **pbPtr) /* Place to store original pushback pointer /* * Include the keyword table definitions. */ +#define inline static +#define __inline /* nothing */ +#undef __GNUC__ + #include "opcodes.h" #undef MIN_WORD_LENGTH #undef MAX_WORD_LENGTH @@ -880,6 +880,8 @@ NextID(char **pbPtr) /* Place to store original pushback pointer #undef MAX_HASH_VALUE #undef TOTAL_KEYWORDS +#undef inline +#undef __inline /* * Stack of opcode-search functions to try. Certain contexts require special @@ -908,7 +910,7 @@ static int opfTop = -1; * ardeb 8/18/89 Initial Revision * ***********************************************************************/ -inline int +int Scan_UseOpProc(OpProc *proc) { assert(opfTop != MAX_OP_FUNCS); @@ -932,7 +934,7 @@ Scan_UseOpProc(OpProc *proc) * ardeb 8/18/89 Initial Revision * ***********************************************************************/ -inline void +void Scan_DontUseOpProc(int idx) { if (idx != opfTop) { @@ -1389,7 +1391,7 @@ ScanEquate(YYSTYPE *yylval) MBlk *head; MBlk *tail; char *cp; - char c; + int c; /* * Skip leading white-space @@ -1564,7 +1566,7 @@ ScanComment(void) * on that line and go back and fetch another token. */ char delim; - char c; + int c; DBPRINTF((stderr,"Skipping comment block\n")); while((c = input()) == ' ' || c == '\t') { @@ -3359,7 +3361,7 @@ yyreadmacrobody(char ***paramsPtr,/* Array of words to be mapped when macro **mpp, /* Place to store address of next block */ *head; /* Head of the chain of text */ char *cp; /* Current place in mp->text */ - char c; /* Character read */ + int c; /* Character read */ int i; /* Argument number */ int nesting=0; /* Macro nesting level to determine when an * "endm" is actually for this macro */ @@ -3434,7 +3436,7 @@ yyreadmacrobody(char ***paramsPtr,/* Array of words to be mapped when macro * via doubling), nor does it deal with nested <> strings */ instring = 0; - } else if (c == '"' || c == '\'' && !instring) { + } else if ((c == '"' || c == '\'') && !instring) { /* * Found start of string -- avoid recognizing and skipping * comments inside it. diff --git a/Tools/esp/symbol.c b/Tools/esp/symbol.c index 869816e95..683a666f7 100644 --- a/Tools/esp/symbol.c +++ b/Tools/esp/symbol.c @@ -68,10 +68,6 @@ * are placed in the "groups" array. * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: symbol.c,v 3.32 94/03/30 17:57:18 jimmy Exp $"; -#endif lint #include "esp.h" #include diff --git a/Tools/esp/table.c b/Tools/esp/table.c index 4f32c0653..dcdf3e540 100644 --- a/Tools/esp/table.c +++ b/Tools/esp/table.c @@ -34,10 +34,6 @@ * XXX: Optimize for byte-sized elements? * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: table.c,v 1.12 92/06/30 12:47:49 jimmy Exp $"; -#endif lint #include "esp.h" #include "table.h" diff --git a/Tools/esp/type.c b/Tools/esp/type.c index 530551f4a..3e685ac22 100644 --- a/Tools/esp/type.c +++ b/Tools/esp/type.c @@ -34,10 +34,6 @@ * Functions to deal with type descriptions. * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: type.c,v 1.13 94/05/15 15:09:07 adam Exp $"; -#endif lint #include "esp.h" @@ -58,29 +54,29 @@ static struct { TypePtr ptrto; int size; } typeInts[] = { - TYPE_INT, 0, 0, 0, 0, - TYPE_INT, 0, 0, 0, 1, - TYPE_INT, 0, 0, 0, 2, - TYPE_INT, 0, 0, 0, 3, /* BOGUS */ - TYPE_INT, 0, 0, 0, 4, - TYPE_INT, 0, 0, 0, 5, /* BOGUS */ - TYPE_INT, 0, 0, 0, 6, /* BOGUS */ - TYPE_INT, 0, 0, 0, 7, /* BOGUS */ - TYPE_INT, 0, 0, 0, 8, - TYPE_INT, 0, 0, 0, 9, /* BOGUS */ - TYPE_INT, 0, 0, 0, 10, + { TYPE_INT, 0, 0, 0, 0, }, + { TYPE_INT, 0, 0, 0, 1, }, + { TYPE_INT, 0, 0, 0, 2, }, + { TYPE_INT, 0, 0, 0, 3, /* BOGUS */ }, + { TYPE_INT, 0, 0, 0, 4, }, + { TYPE_INT, 0, 0, 0, 5, /* BOGUS */ }, + { TYPE_INT, 0, 0, 0, 6, /* BOGUS */ }, + { TYPE_INT, 0, 0, 0, 7, /* BOGUS */ }, + { TYPE_INT, 0, 0, 0, 8, }, + { TYPE_INT, 0, 0, 0, 9, /* BOGUS */ }, + { TYPE_INT, 0, 0, 0, 10, }, }, typeSInts[] = { - TYPE_SIGNED, 0, 0, 0, 0, - TYPE_SIGNED, 0, 0, 0, 1, - TYPE_SIGNED, 0, 0, 0, 2, - TYPE_SIGNED, 0, 0, 0, 3, /* BOGUS */ - TYPE_SIGNED, 0, 0, 0, 4, - TYPE_SIGNED, 0, 0, 0, 5, /* BOGUS */ - TYPE_SIGNED, 0, 0, 0, 6, /* BOGUS */ - TYPE_SIGNED, 0, 0, 0, 7, /* BOGUS */ - TYPE_SIGNED, 0, 0, 0, 8, - TYPE_SIGNED, 0, 0, 0, 9, /* BOGUS */ - TYPE_SIGNED, 0, 0, 0, 10, + { TYPE_SIGNED, 0, 0, 0, 0, }, + { TYPE_SIGNED, 0, 0, 0, 1, }, + { TYPE_SIGNED, 0, 0, 0, 2, }, + { TYPE_SIGNED, 0, 0, 0, 3, /* BOGUS */ }, + { TYPE_SIGNED, 0, 0, 0, 4, }, + { TYPE_SIGNED, 0, 0, 0, 5, /* BOGUS */ }, + { TYPE_SIGNED, 0, 0, 0, 6, /* BOGUS */ }, + { TYPE_SIGNED, 0, 0, 0, 7, /* BOGUS */ }, + { TYPE_SIGNED, 0, 0, 0, 8, }, + { TYPE_SIGNED, 0, 0, 0, 9, /* BOGUS */ }, + { TYPE_SIGNED, 0, 0, 0, 10, }, }; #define NUM_INTS (sizeof(typeInts)/sizeof(typeInts[0])) #define NUM_SINTS (sizeof(typeSInts)/sizeof(typeSInts[0])) diff --git a/Tools/goc/BUILD b/Tools/goc/BUILD new file mode 100644 index 000000000..cfd5c562e --- /dev/null +++ b/Tools/goc/BUILD @@ -0,0 +1,48 @@ +load("//Tools/build:build.bzl", "bison") + +cc_binary( + name = "goc", + srcs = [ + "buf.c", + "buf.h", + "cond.c", + "cond.h", + "depends.c", + "depends.h", + "goc.c", + "goc.h", + "japan.h", + "map.c", + "map.h", + "output.c", + "scan.c", + "scan.h", + "semantic.c", + "sprite.h", + "stringt.c", + "stringt.h", + "strwid.c", + "strwid.h", + "symbol.c", + "symbol.h", + ":parse.c", + ], + deps = [ + "//Tools/include", + "//Tools/include/compat", + "//Tools/utils", + ":bisonlib", + ], +) + +cc_library( + name = "bisonlib", + srcs = [":parse.h"], + includes = [""] +) + +bison( + name = "parse", + src = "parse.y" +) + diff --git a/Tools/goc/parse.c b/Tools/goc/parse.c deleted file mode 100644 index 03ce94e14..000000000 --- a/Tools/goc/parse.c +++ /dev/null @@ -1,8841 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.0.4. */ - -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015 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. - - 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 . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - 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. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "3.0.4" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - - - - -/* Copy the first part of user declarations. */ - - -/*********************************************************************** - * PROJECT: PCGEOS - * MODULE: goc -- parser - * FILE: parse.y - * - * AUTHOR: Tony Requist - * - * DESCRIPTION: - * A grammar to parse a goc file - * - ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: parse.y,v 1.122 96/07/09 12:46:37 adam Exp $"; - -#endif /*lint*/ - -#include - -#define YYERROR_VERBOSE /* Give the follow set in parse error messages */ - -#include - -#include "goc.h" -#include "map.h" -#include "scan.h" -#include "stringt.h" -#include "assert.h" -#include "symbol.h" -#include - -// Required for void type def -#undef __WATCOMC__ -#include -#define __WATCOMC__ - -#include - -#include - -#define bison_malloc(x) (void*)malloc((size_t)x) -#define YYMALLOC bison_malloc - -#define bison_free(x) (void)free(x) -#define YYFREE bison_free - -/* Initial size of gstring buffer. If this changes, change */ -/* GET_NEW_GS_BUF_SIZE() */ -#define GS_BUF 256 -dynamic_buffer gstringBuf; - -/* - * We only have one ObjMessage, because we only parse one at a time. - * the objMessage rule's semantic value is always the address of this - * struct. - */ -SentMessage objMessage; - - -/* - * A variable to tell the scanner that we're scanning a chunk's - * definition and that the identifier should have an '@' before it. - */ - -Boolean parse_ScanningAChunk = FALSE; - - -/* - * Again only one of these, because we only parse one at a time. - */ - -ObjDest objDest; /* the destination of the current object being parsed */ - -/* for parsing VisMonikers */ -Boolean haveVMStyle = FALSE; - - -Symbol *chunkToLocalize; /* last chunk declared */ - -Symbol *classBeingParsed = NullSymbol; - -Symbol *curProtoMinor = NullSymbol; - -Symbol *classDeclList = NullSymbol; - -int currentMPD, numRegs, stackParams, forceRegs, forceNoRegs, multipleReturn; - -MethodModels defaultModel = MM_FAR; - -int specificUI = 0; /* Allow specific UI shortcuts */ - - -Method *curMethod = NullMethod; /* needed so method's code can call super*/ - -Symbol *curMessage = NullSymbol; - -char *currentMessageReturnType; - -Symbol *curResource = NullSymbol; - -Symbol *undefinedList = NullSymbol; - -Symbol *resourceList = NullSymbol; - -Symbol *curObject = NullSymbol; - -Symbol *curVisMoniker = NullSymbol; - -Symbol *curVisMonField = NullSymbol; - -Symbol *curFirstChild; -InstanceValue *curLastChild; -Symbol *curLastChildObj; -Symbol *curLinkPart; - -char *curStringType; - -Symbol *methClass; -int methModel; -char *methName; -Symbol *methFirst; - -char *relocString; -Symbol *relocSym; -char *relocStruct; - -char *caHeaderType; -char *caHeaderData; - -int realSymbolLineNumber; - -Boolean localizationRequired = FALSE; -/***/ - -void OutputInstanceData(Symbol *class); - -Symbol *MakeInstanceVar(int type, char *name, char *ctype); - -InstanceValue *MakeInstanceValue(Symbol *object); - -void AddRegDefinition(MessagePassRegs reg); - -void GenerateMethodDef(Method *meth); - -void GenerateCurRootDefine(Method *meth); - -void GenerateReturnType(MsgInvocType mit, Symbol *msgSym, Boolean children); - -void GeneratePrototype(MsgInvocType mit, Symbol *Msg, ObjDest *od); - -void GenerateComplexPrototype(MsgInvocType mit, Symbol *passMsg, - Symbol *retMsg, ObjDest *od); - -char * GenerateComplexMPDString(Symbol *passMsg,Symbol *retMsg, - MsgParamPassEnum paramSpec); - - - -char *String_EnterZT(char *s); - -void AddChunkToCurResourceAndOutputExtern(Symbol *sym); - -void AddChunkToUndefinedList(Symbol *sym); - -Symbol *EnterSymbolInGlobal(char *name, int type, int flags); - -void AddReloc(Symbol *tag, int type, char *text, int count, char *structName); -void NoReloc(Symbol *instance); - -void AddVarData(Symbol *vdSym, char *value,char *arraySize); - -static void LocalizationCheck(void); - -static int CheckRelated(Symbol *curClass, - Symbol *otherClass, - Symbol *bottomClass); - -static void AddStringToCurrentGstringBuffer(char *ptr); -static void AddStringCharsToCurrentGstringBuffer(char *ptr); -static void ErrCheck (void); - -/* - * Flags to ObjMessage - */ - -#define MF_CALL 0x8000 -#define MF_FORCE_QUEUE 0x4000 -#define MF_STACK 0x2000 -#define MF_RETURN_ERROR 0x1000 -#define MF_CHECK_DUPLICATE 0x0800 -#define MF_CHECK_LAST_ONLY 0x0400 -#define MF_REPLACE 0x0200 -#define MF_CUSTOM 0x0100 -#define MF_FIXUP_DS 0x0080 -#define MF_FIXUP_ES 0x0040 -#define MF_DISCARD_IF_NO_MATCH 0x0020 -#define MF_MATCH_ALL 0x0010 -#define MF_INSERT_AT_FRONT 0x0008 -#define MF_CAN_DISCARD_IF_DESPERATE 0x0004 -#define MF_RECORD 0x0002 - - -/* - * These macros are used on the structs used to hold type-declaration-like - * quantities. They are used for methods, messages, vardata, chunks, etc. - * - * The scanner used to have modes that would return the different pieces - * of a type-decl as a bunch of tokens, but now it returns a string and - * the parser has to break the string up into three strings. see - * the rule below for TypeDeclString - */ -#define AllocTypeDeclString() \ - ((TypeDeclString *) zmalloc(sizeof(TypeDeclString))) -#define TDS_CTYPE(foo) ((foo)->ct) -#define TDS_IDENT(foo) ((foo)->id) -#define TDS_TYPESUF(foo) ((foo)->ts) - -#define TDS_TYPESUF_IS_NOT_NULL(x) ( '\0' != *(TDS_TYPESUF(x))) - - - -#define FreeTypeDeclStringAndContents(foo) (free(TDS_CTYPE(foo)), \ - free(TDS_IDENT(foo)),free(TDS_TYPESUF(foo)),free(foo)) - - -#define REMOVE_LOCALIZATION_DATA(c) do{ \ - if(CHUNK_LOC(c)){ \ - free(CHUNK_LOC(c)); \ - CHUNK_LOC(c) = NULL; \ - } \ -}while(0) - - -/* - * Classes need to have a linked-list of their message symbols, so that - * they can output an enum upon seeing the @endc. - * - * These two macros are for initializing the class's message list, and - * adding an element to the list. - */ - -#define INIT_CLASS_MESSAGE_LIST(class) do{ \ - (class)->data.symClass.nextMessageElementPtr = \ - &((class)->data.symClass.firstMessagePtr); \ - (class)->data.symClass.firstMessagePtr = (Symbol *)NULL; }while (0) - - - -#define ADD_MESSAGE_LIST_ELEMENT(class,symbolPtr) do{ \ - *class->data.symClass.nextMessageElementPtr = symbolPtr; \ - class->data.symClass.nextMessageElementPtr = \ - &(symbolPtr->data.symMessage.nextMessage); \ - symbolPtr->data.symMessage.nextMessage = (Symbol *)NULL; } while(0) - -static int oldContext; - -#define SWITCH_CONTEXT(x) do{oldContext=lexContext;lexContext=(x);}while(0) - - -/*********************************************************************** - * Parse_SetReturnAndPassMessage - *********************************************************************** - * SYNOPSIS: set contents of returnForThisMsg & contents of passForThisMsg - * to the Symbol *'s of the message for passing and returning. - * - * This is used to resolve the kinds of casts that a message - * construct should have, given that there are optional - * casts and messages. - * - * If the message invocation type always has the same - * returnvalues, this will set the contents of - * returnForThisMsg to NULL. - * - * PASS: - * type of msg invocation - * return-cast - * pass-cast - * msg sent - * pointer to return-type symbol - * pointer to pass-type symbol - * - * RETURN: void - * - * ERROR: If there is an error, *passForThisMsg will == NullSymbol. - * - * CALLED BY: sendOrCallOrRecord - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * josh 9/21/92 Initial Revision - * - ***********************************************************************/ -#define RETURN_WITH_ERROR() \ - do { \ - *passForThisMsg = NullSymbol; \ - return; \ - } while(0) - -inline void -Parse_SetReturnAndPassMessage(MsgInvocType mit, - Symbol *castRet, - Symbol *castPass, - Symbol *objmsg, - Symbol **returnForThisMsg, - Symbol **passForThisMsg) -{ - /* first determine how to pass args */ - - *passForThisMsg = - (castPass != NullSymbol ? castPass: /* first is castPass */ - (objmsg != NullSymbol? objmsg : /* second is msg */ - (castRet != NullSymbol ? castRet : /* third is castRet*/ - NullSymbol))); - - if (*passForThisMsg == NullSymbol) { - - yyerror("can't determine how to pass parameters"); - RETURN_WITH_ERROR(); - } - - if (!IS_CALL_TYPE(mit)) { - *returnForThisMsg = NullSymbol; - /* - * if the cast doesn't get used for passing (and it exists), - * they probably don't intend for it to be here. - */ - if (castRet != NullSymbol && castRet != *passForThisMsg) { - yywarning("return value cast ignored. perhaps you want @call?"); - } - } else { - /* set the return value, and check to see if it is bad */ - *returnForThisMsg = - (castRet != NullSymbol ? castRet : /* first is castRet */ - (objmsg != NullSymbol ? objmsg : /* second is msg */ - (castPass != NullSymbol ? castPass : /* third is castPass*/ - NullSymbol))); - if (*returnForThisMsg == NullSymbol) { - yyerror("can't determine how to cast return values"); - RETURN_WITH_ERROR(); - } - - /* - * Try to be helpful and catch a nasty runtime error now. - * - * If the return cast and the msg are different, and either of - * them returns multiple values, the cast will never work, - * because there is no way to figure out what registers to put - * the return values in. - * - * We don't check against castPass because we only use it for - * passing if there is no other cast/msg specified, and there - * won't be a conflict with itself. - */ - - if (*returnForThisMsg != objmsg && - objmsg != NullSymbol && - (((objmsg->data.symMessage.mpd & MPD_RETURN_TYPE) == - (MRT_MULTIPLE << MPD_RETURN_TYPE_OFFSET)) || - (((*returnForThisMsg)->data.symMessage.mpd & MPD_RETURN_TYPE) == - (MRT_MULTIPLE << MPD_RETURN_TYPE_OFFSET)))) - { - yyerror("cannot cast between messages with multiple " - "return values"); - RETURN_WITH_ERROR(); - } - } - if ((castRet != NullSymbol && castRet == objmsg) || - (castPass != NullSymbol && castPass == objmsg)) - { - yywarning("cast and message sym are identical. Cast has no effect"); - } -} - - - -# ifndef YY_NULLPTR -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULLPTR nullptr -# else -# define YY_NULLPTR 0 -# endif -# endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* In a future release of Bison, this section will be replaced - by #include "parse.h". */ -#ifndef YY_YY_PARSE_H_INCLUDED -# define YY_YY_PARSE_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int yydebug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - CLASS = 258, - META = 259, - MASTER = 260, - VARIANT = 261, - ENDC = 262, - CLASSDECL = 263, - NEVER_SAVED = 264, - MESSAGE = 265, - STACK = 266, - CARRY = 267, - AX = 268, - CX = 269, - DX = 270, - BP = 271, - AL = 272, - AH = 273, - CL = 274, - CH = 275, - DL = 276, - DH = 277, - BPL = 278, - BPH = 279, - SS = 280, - AXBPCXDX = 281, - AXCXDXBP = 282, - CXDXBPAX = 283, - DXCX = 284, - BPAXDXCX = 285, - MULTIPLEAX = 286, - ALIAS = 287, - PROTOTYPE = 288, - RESERVE_MESSAGES = 289, - EXPORT_MESSAGES = 290, - IMPORT_MESSAGE = 291, - SET_MESSAGE_NUM = 292, - INSTANCE = 293, - COMPOSITE = 294, - LINK = 295, - VIS_MONIKER = 296, - KBD_ACCELERATOR = 297, - DEFAULT = 298, - RELOC = 299, - FPTR = 300, - HPTR = 301, - OPTR = 302, - DEFAULT_MODEL = 303, - METHOD = 304, - FAR = 305, - NEAR = 306, - BASED = 307, - CALL = 308, - CALL_SUPER = 309, - SEND = 310, - RECORD = 311, - DISPATCH = 312, - DISPATCHCALL = 313, - FORCE_QUEUE = 314, - RETURN_ERROR = 315, - CHECK_DUPLICATE = 316, - NO_FREE = 317, - CHECK_LAST_ONLY = 318, - REPLACE = 319, - INSERT_AT_FRONT = 320, - CAN_DISCARD_IF_DESPARATE = 321, - NULL_TOKEN = 322, - PARENT = 323, - CHILDREN = 324, - LOCALIZE = 325, - COMPILER = 326, - HIGHC = 327, - MSC = 328, - START = 329, - DATA = 330, - NOT_LMEM = 331, - NOT_DETACHABLE = 332, - END = 333, - HEADER = 334, - CHUNK = 335, - CHUNK_ARRAY = 336, - ELEMENT_ARRAY = 337, - OBJECT = 338, - SPECIFIC_UI = 339, - KBD_PATH = 340, - RESOURCE_OUTPUT = 341, - VARDATA = 342, - VARDATA_ALIAS = 343, - IGNORE_DIRTY = 344, - DEFLIB = 345, - ENDLIB = 346, - EXTERN = 347, - GCN_LIST = 348, - PROTOMINOR = 349, - PROTORESET = 350, - OPTIMIZE = 351, - NORELOC = 352, - USES = 353, - NOT = 354, - FIRSTSYM = 355, - CLASS_SYM = 356, - OBJECT_SYM = 357, - MSG_SYM = 358, - EXPORT_SYM = 359, - RESOURCE_SYM = 360, - CHUNK_SYM = 361, - VIS_MONIKER_CHUNK_SYM = 362, - VARDATA_SYM = 363, - PROTOMINOR_SYM = 364, - REG_INSTANCE_SYM = 365, - COMPOSITE_SYM = 366, - LINK_SYM = 367, - VIS_MONIKER_SYM = 368, - VARIANT_PTR_SYM = 369, - KBD_ACCELERATOR_SYM = 370, - OPTR_SYM = 371, - CHUNK_INST_SYM = 372, - LIST_SYM = 373, - GSTRING_SYM = 374, - ATTRIBUTES_SYM = 375, - COLOR_SYM = 376, - SIZE_SYM = 377, - ASPECT_RATIO_SYM = 378, - CACHED_SIZE_SYM = 379, - SIZE_COMP_SYM = 380, - COLOR_COMP_SYM = 381, - ASPECT_RATIO_COMP_SYM = 382, - STYLE_SYM = 383, - STYLE_COMP_SYM = 384, - KBD_SYM = 385, - KBD_MODIFIER_SYM = 386, - GCN_LIST_SYM = 387, - GCN_LIST_OF_LISTS_SYM = 388, - LASTSYM = 389, - SPECIAL_DEBUG_TOKEN = 390, - SPECIAL_UNDEBUG_TOKEN = 391, - IDENT = 392, - STRING = 393, - FAKESTRING = 394, - ASCIISTRING = 395, - LSTRING = 396, - SJISSTRING = 397, - TSTRING = 398, - CHAR = 399, - CONST = 400 - }; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED - -union YYSTYPE -{ - - - char *string; - char ch; - int num; - Symbol *sym; - Method *meth; - MessageParam *param; - SymbolListEntry *sle; - TypeDeclString *tdecl; - ObjDest *od; - SentMessage *sm; - MsgInvocType mit; - - -}; - -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - -extern YYSTYPE yylval; - -int yyparse (void); - -#endif /* !YY_YY_PARSE_H_INCLUDED */ - -/* Copy the second part of user declarations. */ - - - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#else -typedef signed char yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(Msgid) dgettext ("bison-runtime", Msgid) -# endif -# endif -# ifndef YY_ -# define YY_(Msgid) Msgid -# endif -#endif - -#ifndef YY_ATTRIBUTE -# if (defined __GNUC__ \ - && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ - || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C -# define YY_ATTRIBUTE(Spec) __attribute__(Spec) -# else -# define YY_ATTRIBUTE(Spec) /* empty */ -# endif -#endif - -#ifndef YY_ATTRIBUTE_PURE -# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) -#endif - -#ifndef YY_ATTRIBUTE_UNUSED -# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) -#endif - -#if !defined _Noreturn \ - && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) -# if defined _MSC_VER && 1200 <= _MSC_VER -# define _Noreturn __declspec (noreturn) -# else -# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) -#else -# define YYUSE(E) /* empty */ -#endif - -#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else -# define YY_INITIAL_VALUE(Value) Value -#endif -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS -# include /* INFRINGES ON USER NAME SPACE */ - /* Use EXIT_SUCCESS as a witness for stdlib.h. */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's 'empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((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 (0) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from SRC to DST. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) -# else -# define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } \ - while (0) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 3 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 673 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 159 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 232 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 472 -/* YYNSTATES -- Number of states. */ -#define YYNSTATES 779 - -/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned - by yylex, with out-of-bounds checking. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 400 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, without out-of-bounds checking. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 150, 151, 2, 153, 147, 154, 152, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 149, 146, - 2, 148, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 157, 2, 158, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 155, 2, 156, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145 -}; - -#if YYDEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 540, 540, 540, 575, 576, 585, 586, 587, 588, - 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, - 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 630, - 641, 650, 654, 669, 677, 692, 710, 726, 726, 734, - 734, 738, 737, 988, 989, 990, 997, 1001, 1005, 1009, - 1019, 1205, 1204, 1228, 1227, 1237, 1236, 1245, 1244, 1252, - 1251, 1259, 1258, 1283, 1284, 1289, 1288, 1295, 1305, 1309, - 1304, 1339, 1340, 1345, 1351, 1356, 1360, 1359, 1369, 1373, - 1368, 1408, 1420, 1438, 1442, 1437, 1508, 1509, 1510, 1511, - 1525, 1529, 1524, 1539, 1545, 1544, 1557, 1561, 1556, 1570, - 1577, 1578, 1579, 1589, 1588, 1659, 1668, 1672, 1682, 1681, - 1692, 1703, 1691, 1735, 1734, 1776, 1786, 1797, 1796, 1824, - 1833, 1838, 1843, 1842, 1856, 1879, 1892, 1893, 1894, 1895, - 1896, 1897, 1898, 1899, 1904, 1909, 1919, 1925, 1929, 1930, - 1931, 1935, 1936, 1937, 1938, 1939, 1940, 1944, 1952, 1971, - 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, - 1982, 1983, 1989, 1995, 1999, 2003, 2004, 2005, 2006, 2015, - 2014, 2027, 2038, 2039, 2048, 2047, 2060, 2071, 2072, 2076, - 2077, 2078, 2081, 2082, 2083, 2084, 2093, 2092, 2122, 2123, - 2132, 2133, 2140, 2152, 2157, 2151, 2197, 2196, 2244, 2245, - 2253, 2259, 2264, 2252, 2316, 2322, 2327, 2315, 2354, 2359, - 2366, 2367, 2371, 2372, 2385, 2386, 2403, 2400, 2453, 2454, - 2458, 2561, 2569, 2570, 2571, 2572, 2580, 2581, 2582, 2590, - 2601, 2607, 2618, 2624, 2635, 2650, 2655, 2660, 2677, 2678, - 2679, 2684, 2706, 2710, 2714, 2683, 2748, 2749, 2753, 2754, - 2764, 2765, 2778, 2777, 2789, 2791, 2795, 2849, 2857, 2861, - 2848, 2883, 2926, 2940, 2941, 2940, 2955, 2957, 2955, 2976, - 2984, 2988, 2983, 2998, 3019, 3020, 3025, 3026, 3027, 3028, - 3029, 3030, 3031, 3032, 3040, 3044, 3052, 3051, 3081, 3086, - 3095, 3093, 3126, 3127, 3136, 3135, 3169, 3168, 3190, 3194, - 3198, 3202, 3210, 3228, 3246, 3250, 3245, 3270, 3275, 3281, - 3269, 3317, 3321, 3325, 3329, 3332, 3316, 3356, 3358, 3365, - 3372, 3355, 3396, 3397, 3402, 3406, 3410, 3401, 3419, 3430, - 3429, 3483, 3484, 3488, 3489, 3490, 3494, 3501, 3512, 3513, - 3512, 3515, 3520, 3524, 3519, 3535, 3539, 3534, 3565, 3574, - 3584, 3588, 3583, 3597, 3605, 3629, 3637, 3646, 3645, 3652, - 3661, 3669, 3660, 3676, 3736, 3735, 3755, 3768, 3779, 3785, - 3786, 3787, 3788, 3789, 3793, 3809, 3830, 3845, 3863, 3864, - 3869, 3870, 3880, 3879, 3900, 3901, 3905, 3918, 3922, 3937, - 3943, 3961, 3967, 3968, 3971, 3975, 3983, 3984, 3987, 3988, - 3992, 4014, 4022, 4021, 4033, 4034, 4042, 4042, 4067, 4074, - 4081, 4087, 4088, 4089, 4096, 4106, 4113, 4120, 4127, 4137, - 4138, 4150, 4150, 4166, 4179, 4165, 4194, 4195, 4199, 4200, - 4201, 4210, 4215, 4221, 4226, 4231, 4236, 4240, 4248, 4261, - 4265, 4271, 4276, 4283, 4294, 4295, 4303, 4307, 4319, 4320, - 4328, 4329, 4338 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || 0 -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "CLASS", "META", "MASTER", "VARIANT", - "ENDC", "CLASSDECL", "NEVER_SAVED", "MESSAGE", "STACK", "CARRY", "AX", - "CX", "DX", "BP", "AL", "AH", "CL", "CH", "DL", "DH", "BPL", "BPH", "SS", - "AXBPCXDX", "AXCXDXBP", "CXDXBPAX", "DXCX", "BPAXDXCX", "MULTIPLEAX", - "ALIAS", "PROTOTYPE", "RESERVE_MESSAGES", "EXPORT_MESSAGES", - "IMPORT_MESSAGE", "SET_MESSAGE_NUM", "INSTANCE", "COMPOSITE", "LINK", - "VIS_MONIKER", "KBD_ACCELERATOR", "DEFAULT", "RELOC", "FPTR", "HPTR", - "OPTR", "DEFAULT_MODEL", "METHOD", "FAR", "NEAR", "BASED", "CALL", - "CALL_SUPER", "SEND", "RECORD", "DISPATCH", "DISPATCHCALL", - "FORCE_QUEUE", "RETURN_ERROR", "CHECK_DUPLICATE", "NO_FREE", - "CHECK_LAST_ONLY", "REPLACE", "INSERT_AT_FRONT", - "CAN_DISCARD_IF_DESPARATE", "NULL_TOKEN", "PARENT", "CHILDREN", - "LOCALIZE", "COMPILER", "HIGHC", "MSC", "START", "DATA", "NOT_LMEM", - "NOT_DETACHABLE", "END", "HEADER", "CHUNK", "CHUNK_ARRAY", - "ELEMENT_ARRAY", "OBJECT", "SPECIFIC_UI", "KBD_PATH", "RESOURCE_OUTPUT", - "VARDATA", "VARDATA_ALIAS", "IGNORE_DIRTY", "DEFLIB", "ENDLIB", "EXTERN", - "GCN_LIST", "PROTOMINOR", "PROTORESET", "OPTIMIZE", "NORELOC", "USES", - "NOT", "FIRSTSYM", "CLASS_SYM", "OBJECT_SYM", "MSG_SYM", "EXPORT_SYM", - "RESOURCE_SYM", "CHUNK_SYM", "VIS_MONIKER_CHUNK_SYM", "VARDATA_SYM", - "PROTOMINOR_SYM", "REG_INSTANCE_SYM", "COMPOSITE_SYM", "LINK_SYM", - "VIS_MONIKER_SYM", "VARIANT_PTR_SYM", "KBD_ACCELERATOR_SYM", "OPTR_SYM", - "CHUNK_INST_SYM", "LIST_SYM", "GSTRING_SYM", "ATTRIBUTES_SYM", - "COLOR_SYM", "SIZE_SYM", "ASPECT_RATIO_SYM", "CACHED_SIZE_SYM", - "SIZE_COMP_SYM", "COLOR_COMP_SYM", "ASPECT_RATIO_COMP_SYM", "STYLE_SYM", - "STYLE_COMP_SYM", "KBD_SYM", "KBD_MODIFIER_SYM", "GCN_LIST_SYM", - "GCN_LIST_OF_LISTS_SYM", "LASTSYM", "SPECIAL_DEBUG_TOKEN", - "SPECIAL_UNDEBUG_TOKEN", "IDENT", "STRING", "FAKESTRING", "ASCIISTRING", - "LSTRING", "SJISSTRING", "TSTRING", "CHAR", "CONST", "';'", "','", "'='", - "':'", "'('", "')'", "'.'", "'+'", "'-'", "'{'", "'}'", "'['", "']'", - "$accept", "file", "$@1", "lines", "line", "optimizeline", "norelocLine", - "usesLine", "usesClassList", "deflibLine", "endlibLine", - "semiColonOrError", "commaOrNothing", "classLine", "$@2", "superClass", - "classFlags", "endcLine", "instanceLine", "$@3", "instanceLineType", - "$@4", "$@5", "$@6", "$@7", "$@8", "kbdPathOrNull", "instanceDefault", - "$@9", "vardataLine", "$@10", "$@11", "vardataSymOrError", - "vardataClass", "$@12", "vardataAliasLine", "$@13", "$@14", - "protoMinorLine", "protoResetLine", "defaultLine", "$@15", "$@16", - "defaultableSym", "relocLine", "$@17", "$@18", "relocTail", "$@19", - "relocCount", "$@20", "$@21", "relocType", "classdeclLine", "$@22", - "classDeclFlags", "messageLine", "$@23", "messageFinish", "$@24", "$@25", - "$@26", "messageParamListOrNull", "messageParamList", "@27", "stackFlag", - "messageParam", "$@28", "eqParamRegs", "paramRegs", "wordParamReg", - "multipleParamReg", "messageReturn", "returnReg", "wordReturnReg", - "reserveMessagesLine", "$@29", "reserveNum", "setMessageLine", "$@30", - "setMessageNum", "numExpr", "primary", "exportMessagesLine", "$@31", - "exportNum", "exportSymOrError", "importMessagePrefix", - "importMessageLine", "$@32", "$@33", "$@34", "messageSymOrIdentErr", - "aliasLine", "$@35", "$@36", "$@37", "prototypeLine", "$@38", "$@39", - "$@40", "externMethodOrMethod", "identCommaOrNothing", - "openCurlyOrSemiColon", "classOrError", "methodLine", "$@41", - "methodMessageList", "methodMessage", "methodModel", "defaultModelLine", - "externLine", "objectDerefLine", "sendOrCallOrRecord", - "sendOrCallOrRecordLine", "$@42", "$@43", "$@44", "$@45", - "FakeStringOrNothing", "optCastMessage", "optCastWithNoBraces", - "callsuperLine", "$@46", "semiOrParens", "callsuperStuff", "$@47", - "$@48", "$@49", "objDest", "$@50", "$@51", "$@52", "$@53", "objMessage", - "$@54", "$@55", "ObjFlagListOrNull", "objFlag", "dispatchOrDispatchCall", - "dispatchOrDispatchCallLine", "$@56", "newDispatchOrDispatchCall", - "newDispatchOrDispatchCallLine", "$@57", "compilerLine", "startLine", - "$@58", "$@59", "startFlags", "resourceOutputLine", "endLine", - "headerLine", "$@60", "$@61", "chunkLine", "$@62", "$@63", "$@64", - "$@65", "$@66", "$@67", "$@68", "$@69", "$@70", "@71", "@72", "$@73", - "cArrayType", "caHeader", "$@74", "$@75", "$@76", "objectLine", "$@77", - "ignoreDirtyFlag", "objectFieldList", "fieldError", "optionalArraySize", - "$@78", "$@79", "objectField", "$@80", "$@81", "$@82", "$@83", "$@84", - "$@85", "$@86", "$@87", "$@88", "$@89", "someString", "LocalizationLine", - "simpleLocalization", "visMonikerFieldFinish", "$@90", "aleArrayN", - "aleArray", "aleArrayElement", "kbdAcceleratorStart", "kbdAccelChar", - "specificUIOrNothing", "kbdAccelModList", "childList", "childListNN", - "childNN", "visMonikerLine", "$@91", "optSemiColon", "visMonikerDef", - "$@92", "vmMiddle", "vmMiddleNonList", "vmNavChar", "vmList", - "vmGStrings", "@93", "GStrings", "$@94", "$@95", - "gstringBodyElementList", "gstringBodyElement", "vmElement", "vmArray", - "vmArrayElement", "vmArrayError", "objectOrIdent", "protoMinorSym", - "visMonikerOrIdent", "identOrConst", "typeDeclString", YY_NULLPTR -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, - 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, - 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, - 395, 396, 397, 398, 399, 400, 59, 44, 61, 58, - 40, 41, 46, 43, 45, 123, 125, 91, 93 -}; -# endif - -#define YYPACT_NINF -521 - -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-521))) - -#define YYTABLE_NINF -445 - -#define yytable_value_is_error(Yytable_value) \ - 0 - - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -static const yytype_int16 yypact[] = -{ - -521, 49, -521, -521, 198, -521, -47, -521, -56, -521, - -38, -521, -73, -1, -73, -73, -521, -2, 66, -521, - 193, -521, -521, -521, -521, -521, 15, 57, -78, 36, - -34, 46, 72, -521, -521, -521, 27, -521, 80, -521, - 99, 146, -521, 9, -61, -521, -521, 171, 33, -521, - -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, - -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, - -521, -521, -521, -521, -521, 87, -521, -521, -521, 299, - -521, -521, -521, -521, -521, -521, -521, -521, -521, 152, - -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, - -521, -521, 156, -521, 159, 88, -65, 178, -521, -521, - 190, 211, -521, 221, -66, 226, 1, -521, -521, 192, - -521, -521, -521, -521, 235, 158, -521, -521, -521, -39, - -521, -77, 238, 239, 248, -521, -521, -521, -521, -521, - 240, 178, -521, -521, -41, -41, 178, -42, -521, 31, - -521, -20, -40, -521, -521, -521, 241, 243, -521, 164, - 253, -521, -521, 242, -521, -521, -521, 254, -521, 256, - -521, 257, -521, 42, 159, 386, 14, -521, -521, 246, - -521, -521, 247, 249, -521, 14, 190, 250, -521, -521, - -521, -66, -66, 14, 202, -521, -66, -521, -521, -521, - -521, 255, -521, -521, -521, -521, -521, -521, -84, -521, - 251, -521, -521, -521, 252, 297, -521, -521, 40, 258, - 258, -521, 259, -521, -521, 260, -521, -521, -521, -521, - -521, 261, 21, 14, 14, 14, 14, 14, 14, -521, - -521, -521, 303, -521, -65, -521, 262, 27, 266, -521, - 263, -521, -521, -521, -521, -521, 14, -521, -521, -521, - -521, 307, -521, -521, -521, -521, 14, 268, 14, 113, - -521, -521, -66, -66, 14, 269, 326, 278, 279, -521, - 270, 12, 280, 273, 282, 283, 284, -521, -521, 275, - -521, 274, 119, 271, 277, 14, 14, 287, -521, 338, - 285, 286, -521, -521, -521, -521, -521, -521, -521, -521, - -521, -521, -521, 281, 288, 417, -521, -521, -521, -521, - -521, -521, -521, -521, -521, -521, -521, -45, -521, -521, - 290, 289, -521, 291, 417, 178, 417, -521, -521, -521, - -521, -521, -521, -521, 295, -521, 296, -521, -521, -521, - -521, -521, -521, 219, -521, 90, 294, 298, 300, 27, - -521, 292, 301, -521, -521, -521, -521, -521, -521, -521, - 305, -521, 302, -521, 304, 309, -521, 311, -521, 178, - 308, -521, -521, 313, 181, 14, 314, 178, 306, 178, - 322, -521, 315, 310, -521, 312, -521, -521, -521, -521, - 316, 317, -521, -521, -521, -521, 321, 323, -521, 325, - -521, 320, -521, 319, -521, 324, 276, -521, 328, -521, - -521, -521, -521, 327, 329, 330, 331, -521, -521, -35, - 334, 339, -521, 333, 337, -521, 340, 336, -521, 341, - -521, -521, 26, -521, 327, 201, 201, 201, 50, -521, - -521, 342, 343, -521, -521, -521, -521, 346, 344, 345, - 347, -521, 349, -521, 351, -521, -521, -521, -521, -521, - 318, -521, -521, 115, -521, 348, 350, 353, 432, 447, - -521, -521, 417, -521, -521, -43, -521, 103, -521, -521, - -521, -521, -521, -521, -19, -521, 354, 357, 358, 359, - 360, 352, -521, 361, -521, 355, -521, -65, -521, -521, - 8, -521, -521, 363, 362, 178, 293, -521, -521, -35, - -521, -521, 365, -67, -521, -521, -521, -521, 362, 178, - 362, 26, -521, -521, -521, -521, -521, 364, 335, 371, - 370, 368, 383, 366, 320, 375, -521, 376, 369, -521, - 373, 43, 377, 378, 379, -521, 380, -521, 381, 382, - -521, 102, -521, -521, 10, -521, 199, 372, -521, 75, - 108, 122, -521, -521, -521, -521, 384, -521, -521, -521, - -521, -521, -521, -521, -521, 149, -521, -521, 385, -521, - -521, -521, 374, 392, 393, 388, 387, 389, -521, -521, - 390, 391, 394, 395, 397, -521, -521, -521, 396, -521, - 65, -521, -521, 398, -521, -521, -41, 399, -521, 400, - -70, 4, -521, -521, -521, -521, -521, 401, -521, -521, - 403, 404, 405, 406, -521, -521, -521, -521, -521, -521, - -521, -521, -521, -521, 150, -521, 444, 356, 356, -521, - 414, -521, -521, -521, -521, -521, -521, -521, -521, -521, - 409, -521, 407, -521, 416, -521, -521, 412, 421, -521, - 422, 24, 410, 437, 418, 415, 433, 419, 420, -521, - 423, 424, 425, 426, -521, 332, 332, -521, -521, -521, - -521, -521, -521, -521, 416, 411, 427, 362, 428, -521, - -521, -521, 65, -521, 429, -521, -521, 430, 431, -521, - -521, -521, -521, 12, -521, -521, -521, -521, -521, -521, - -521, 436, -521, -521, -521, -521, -521, -521, -521, -521, - -521, -521, 434, -521, 435, -521, 438, -521, 439, 440, - 441, -521, 442, -521, 38, -521, 443, 53, -521, -521, - 445, -521, -521, -521, 446, -521, 449, -521, -521, -521, - -521, -521, -521, 451, 450, -521, -55, -521, -521, 452, - -521, -521, 229, -521, -521, -521, -521, -41, -521 -}; - - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ -static const yytype_uint16 yydefact[] = -{ - 2, 0, 5, 1, 0, 44, 0, 70, 0, 128, - 0, 224, 189, 0, 0, 194, 71, 0, 0, 110, - 0, 228, 259, 272, 258, 260, 304, 0, 0, 0, - 0, 0, 0, 327, 342, 343, 0, 43, 0, 88, - 0, 0, 56, 0, 0, 102, 49, 0, 0, 255, - 256, 257, 337, 45, 46, 4, 47, 9, 48, 40, - 41, 6, 7, 8, 36, 37, 38, 39, 10, 11, - 12, 13, 16, 19, 17, 0, 18, 14, 15, 245, - 20, 21, 23, 22, 261, 24, 25, 306, 26, 0, - 27, 28, 29, 42, 30, 31, 32, 331, 33, 35, - 397, 34, 60, 123, 127, 0, 0, 0, 210, 211, - 193, 0, 206, 0, 198, 0, 0, 468, 469, 0, - 106, 108, 107, 109, 0, 0, 246, 247, 248, 0, - 308, 0, 0, 0, 0, 312, 313, 316, 314, 323, - 0, 0, 235, 234, 0, 0, 0, 0, 55, 0, - 229, 0, 0, 466, 467, 101, 0, 0, 53, 0, - 0, 472, 216, 0, 242, 243, 244, 231, 295, 0, - 310, 0, 59, 0, 127, 0, 0, 133, 129, 0, - 218, 219, 0, 0, 192, 0, 193, 209, 212, 205, - 204, 0, 0, 0, 197, 201, 198, 73, 75, 77, - 79, 0, 81, 422, 103, 111, 283, 286, 0, 274, - 0, 276, 273, 277, 0, 0, 396, 399, 0, 321, - 321, 324, 0, 464, 465, 0, 322, 89, 96, 91, - 95, 0, 0, 0, 0, 0, 0, 0, 0, 50, - 52, 51, 0, 338, 0, 213, 0, 0, 271, 307, - 0, 332, 64, 63, 65, 61, 0, 126, 58, 57, - 125, 0, 130, 220, 225, 190, 0, 0, 0, 0, - 203, 195, 0, 0, 0, 0, 84, 0, 0, 72, - 87, 0, 0, 0, 0, 0, 0, 281, 275, 0, - 305, 0, 0, 0, 0, 0, 0, 0, 328, 352, - 0, 0, 98, 94, 92, 93, 254, 253, 252, 251, - 250, 249, 54, 0, 0, 141, 230, 236, 296, 297, - 298, 303, 299, 300, 301, 302, 270, 0, 294, 311, - 348, 69, 124, 0, 141, 0, 141, 191, 208, 207, - 202, 199, 200, 196, 0, 83, 0, 78, 80, 85, - 82, 428, 423, 0, 104, 119, 0, 0, 0, 0, - 309, 0, 0, 398, 319, 320, 318, 317, 315, 325, - 0, 351, 0, 90, 0, 0, 339, 0, 140, 136, - 0, 262, 344, 0, 0, 0, 0, 136, 0, 136, - 0, 76, 0, 0, 441, 389, 390, 392, 393, 391, - 0, 0, 440, 438, 427, 430, 0, 0, 114, 0, - 112, 0, 284, 0, 282, 0, 0, 394, 0, 329, - 349, 97, 99, 0, 0, 0, 135, 139, 142, 0, - 0, 0, 333, 68, 0, 62, 0, 0, 221, 0, - 74, 86, 0, 433, 0, 0, 0, 0, 0, 431, - 105, 0, 0, 120, 121, 122, 113, 0, 0, 0, - 0, 326, 0, 354, 0, 443, 340, 217, 214, 137, - 145, 240, 241, 0, 239, 269, 0, 0, 0, 0, - 134, 131, 141, 226, 463, 0, 459, 0, 460, 442, - 389, 437, 435, 436, 0, 441, 0, 0, 0, 0, - 0, 0, 439, 119, 116, 0, 287, 0, 395, 330, - 0, 100, 447, 0, 168, 0, 0, 143, 233, 0, - 232, 237, 271, 0, 345, 334, 66, 67, 168, 136, - 168, 0, 429, 461, 462, 456, 457, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 285, 0, 0, 357, - 0, 361, 0, 0, 0, 377, 0, 409, 0, 0, - 350, 0, 353, 388, 0, 341, 0, 0, 138, 150, - 151, 152, 146, 147, 148, 149, 0, 161, 162, 163, - 164, 165, 166, 157, 144, 0, 156, 238, 0, 289, - 293, 290, 0, 0, 0, 0, 0, 0, 458, 434, - 0, 0, 0, 0, 0, 432, 115, 117, 0, 278, - 0, 379, 358, 0, 362, 384, 0, 400, 365, 0, - 0, 0, 355, 356, 450, 449, 448, 0, 446, 183, - 185, 186, 187, 188, 173, 174, 175, 176, 177, 178, - 179, 180, 184, 167, 0, 215, 0, 0, 0, 268, - 0, 263, 346, 335, 132, 222, 227, 453, 454, 451, - 0, 452, 0, 288, 267, 470, 471, 0, 0, 380, - 0, 0, 0, 402, 425, 0, 413, 0, 0, 370, - 0, 0, 0, 0, 445, 0, 0, 155, 158, 159, - 160, 153, 154, 291, 267, 0, 0, 168, 0, 118, - 266, 279, 0, 359, 0, 363, 421, 0, 416, 419, - 420, 387, 401, 0, 424, 378, 366, 412, 415, 369, - 368, 0, 376, 375, 373, 374, 185, 186, 187, 188, - 181, 182, 0, 264, 0, 336, 0, 455, 0, 0, - 0, 381, 0, 385, 0, 403, 0, 0, 371, 292, - 0, 347, 223, 280, 0, 360, 0, 364, 418, 367, - 411, 414, 410, 0, 0, 265, 0, 382, 386, 0, - 405, 383, 0, 407, 408, 372, 404, 0, 406 -}; - - /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = -{ - -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, - -521, -181, -521, -521, -521, -521, -521, -521, -521, -521, - -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, - -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, - -521, -521, -521, -521, -521, -521, -521, -521, -521, -32, - -521, -521, -82, -521, -521, 408, -521, -521, -521, -521, - -521, -521, -370, -521, -521, -320, -36, -521, -521, -521, - -270, -521, -520, -521, -306, -521, -521, 448, -521, -521, - 413, 402, -174, -521, -521, -521, 367, -521, -521, -521, - -521, -521, -242, -521, -521, -521, -521, -521, -521, -521, - -521, -521, -521, -521, -227, -521, -521, -521, 2, -521, - -521, -521, -521, -521, -521, -521, -521, -521, -521, -217, - -521, -23, -521, -521, -521, -521, -521, -521, -521, 212, - -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, - -521, -521, -521, -521, -521, -521, -521, -521, -521, 453, - -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, - -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, - -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, - -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, - -521, -521, -440, 67, -521, -521, -521, -521, -521, -214, - -521, -521, -521, -521, -521, -521, -177, -521, -521, -521, - -134, -521, -521, -521, 132, -521, 86, -521, 139, -521, - -521, -521, -521, -521, -521, 56, -521, -144, -521, 575, - -102, -72 -}; - - /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 1, 2, 4, 55, 56, 57, 58, 159, 59, - 60, 260, 173, 61, 331, 255, 385, 62, 63, 116, - 201, 275, 276, 277, 278, 280, 346, 350, 392, 64, - 146, 300, 231, 232, 301, 65, 375, 464, 66, 67, - 68, 282, 407, 124, 69, 125, 283, 410, 451, 411, - 545, 662, 456, 70, 174, 176, 71, 105, 178, 334, - 528, 261, 425, 426, 515, 379, 427, 470, 517, 584, - 585, 586, 567, 643, 644, 72, 110, 185, 73, 114, - 193, 194, 195, 74, 187, 268, 111, 75, 76, 315, - 514, 244, 182, 77, 335, 482, 697, 78, 107, 336, - 530, 79, 247, 521, 144, 80, 380, 473, 474, 167, - 81, 82, 83, 84, 85, 168, 430, 694, 750, 701, - 523, 327, 86, 129, 211, 212, 289, 664, 738, 213, - 284, 457, 285, 547, 592, 650, 732, 248, 328, 87, - 88, 169, 89, 90, 250, 91, 92, 220, 219, 295, - 93, 94, 95, 297, 418, 96, 141, 370, 462, 171, - 330, 477, 594, 696, 160, 313, 423, 513, 97, 383, - 431, 593, 695, 98, 463, 372, 510, 561, 613, 668, - 740, 562, 670, 742, 675, 746, 721, 764, 617, 704, - 756, 671, 403, 99, 100, 674, 713, 771, 772, 773, - 619, 763, 718, 747, 707, 708, 709, 101, 281, 715, - 352, 353, 404, 405, 406, 448, 443, 444, 466, 512, - 627, 564, 628, 502, 485, 486, 487, 710, 155, 488, - 667, 428 -}; - - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ -static const yytype_int16 yytable[] = -{ - 225, 226, 314, 163, 265, 491, 492, 493, 595, 549, - 597, 624, 271, 351, 387, 258, 389, 437, 270, 439, - 317, 132, 303, 206, 207, 706, 214, 484, 142, 206, - 207, 108, 677, 179, 157, 183, 589, 189, 180, 706, - 197, 198, 199, 200, 202, 103, 252, 223, 153, 3, - 149, 494, 306, 307, 308, 309, 310, 311, 150, 228, - 133, 223, 237, 286, 109, 287, 229, 678, 471, 222, - 590, 137, 181, 215, 227, 332, 154, 134, 28, 190, - 679, 104, 224, 591, 191, 337, 235, 339, 192, 151, - 102, 770, 152, 343, 208, 230, 224, 238, 341, 342, - 208, 550, 472, 138, 531, 117, 680, 209, 135, 136, - 681, 210, 106, 532, 367, 368, 551, 236, 552, 553, - 554, 555, 556, 557, 558, 559, 223, 535, 143, 304, - -426, -426, 415, 117, 158, 118, 112, 536, 233, 161, - 223, 682, 490, 253, 396, 397, 398, 399, 625, 626, - -426, 139, -426, -426, -426, -426, -426, -426, 305, 596, - 259, 224, 529, 118, 560, 130, -444, -426, 234, 495, - -417, 496, 497, 498, 499, 224, 120, 736, 500, 254, - 121, 683, 122, 760, 761, 292, 433, 434, 395, 611, - 396, 397, 398, 399, 400, 401, 293, 762, -3, 5, - 612, 6, 665, 123, 435, 7, 8, 131, 9, 140, - 666, 629, 630, 631, 632, 633, 634, 635, 636, 637, - 638, 639, 640, 641, -158, 161, 161, -158, 145, 408, - 10, 11, 12, 13, 14, 15, 16, 162, 177, 17, - 409, 18, 19, 126, 127, 128, 20, 21, 622, 147, - 533, 22, 23, 24, 25, 26, 27, -159, 623, 534, - -159, 518, 519, 388, 340, 548, 272, 273, 28, 29, - 520, -160, 30, 361, -160, 362, 31, 32, 33, 34, - 35, 36, 37, 148, 38, 39, 40, 156, 41, 42, - 43, 170, 44, 45, 46, 47, 48, 205, 647, 685, - 49, 648, 686, 172, 50, 51, 175, 569, 570, 571, - 241, 242, 572, 573, 574, 575, 161, 52, 576, 577, - 578, 579, 580, 581, 582, 318, 319, 320, 321, 322, - 323, 324, 325, 53, 54, 184, 642, 393, 394, 490, - 203, 396, 397, 398, 399, 726, 727, 728, 729, 164, - 165, 166, 364, 365, 366, 272, 273, 395, 186, 396, - 397, 398, 399, 400, 401, 453, 454, 455, 188, 326, - 688, 689, 690, 196, 402, 776, 777, 691, 692, 730, - 731, 113, 115, 204, 216, 217, 218, 239, 221, 240, - 243, 246, 245, 249, 251, 257, 262, 267, 263, 264, - 291, 279, 288, 290, 312, 294, 344, 298, 299, 316, - 333, 345, 302, 338, 329, 347, 348, 363, 349, 354, - 355, 356, 357, 358, 359, 360, 369, 371, 378, 376, - 583, 373, 460, 391, 440, 374, 384, 416, 526, 377, - 382, 412, 386, 390, 419, 413, 422, 417, 424, 414, - 432, 436, 527, 421, 441, 429, 438, 420, 458, 445, - 687, 600, 606, 446, 447, 442, 516, 449, 326, 450, - 452, 544, 672, 459, 461, 467, 476, 733, 469, 568, - 478, 468, 465, 475, 479, 505, 480, 481, 511, 503, - 504, 506, 483, 508, 507, 509, 601, 602, 543, 588, - 524, 525, 538, 522, 546, 539, 540, 541, 542, 565, - 566, 409, 604, 603, 607, 608, 716, 717, 645, 609, - 599, 587, 605, 610, 651, 614, 615, 616, 618, 620, - 621, 652, 653, 646, 654, 656, 657, 658, 655, 381, - 659, 649, 660, 661, 712, 663, 669, 673, 676, -169, - -170, -171, -172, 693, 698, 700, 711, 684, 699, 702, - 703, 705, 734, 778, 714, 719, 720, 758, 741, 722, - 723, 724, 725, 735, 737, 748, 743, 563, 744, 745, - 501, 537, 256, 489, 752, 749, 751, 598, 757, 759, - 753, 754, 119, 269, 766, 767, 765, 768, 775, 755, - 739, 769, 0, 0, 0, 0, 0, 0, 0, 274, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 774, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 774, 266, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 296 -}; - -static const yytype_int16 yycheck[] = -{ - 144, 145, 244, 75, 185, 445, 446, 447, 528, 1, - 530, 1, 193, 1, 334, 1, 336, 387, 192, 389, - 247, 99, 1, 68, 69, 1, 103, 1, 1, 68, - 69, 104, 102, 105, 1, 107, 103, 103, 103, 1, - 39, 40, 41, 42, 116, 101, 4, 102, 109, 0, - 41, 1, 233, 234, 235, 236, 237, 238, 49, 101, - 138, 102, 102, 147, 137, 149, 108, 137, 103, 141, - 137, 105, 137, 150, 146, 256, 137, 155, 70, 145, - 150, 137, 137, 150, 150, 266, 106, 268, 154, 80, - 137, 146, 83, 274, 139, 137, 137, 137, 272, 273, - 139, 93, 137, 137, 147, 107, 102, 146, 72, 73, - 106, 150, 150, 156, 295, 296, 108, 137, 110, 111, - 112, 113, 114, 115, 116, 117, 102, 146, 101, 108, - 118, 119, 359, 107, 101, 137, 137, 156, 107, 138, - 102, 137, 138, 101, 140, 141, 142, 143, 138, 139, - 138, 105, 140, 141, 142, 143, 144, 145, 137, 529, - 146, 137, 482, 137, 156, 150, 156, 155, 137, 119, - 146, 121, 122, 123, 124, 137, 110, 697, 128, 137, - 114, 621, 116, 130, 131, 145, 5, 6, 138, 146, - 140, 141, 142, 143, 144, 145, 156, 144, 0, 1, - 157, 3, 137, 137, 385, 7, 8, 150, 10, 137, - 145, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 149, 138, 138, 152, 148, 139, - 32, 33, 34, 35, 36, 37, 38, 150, 150, 41, - 150, 43, 44, 50, 51, 52, 48, 49, 146, 150, - 147, 53, 54, 55, 56, 57, 58, 149, 156, 156, - 152, 146, 147, 335, 151, 507, 153, 154, 70, 71, - 155, 149, 74, 154, 152, 156, 78, 79, 80, 81, - 82, 83, 84, 137, 86, 87, 88, 116, 90, 91, - 92, 139, 94, 95, 96, 97, 98, 139, 149, 149, - 102, 152, 152, 147, 106, 107, 147, 14, 15, 16, - 146, 147, 19, 20, 21, 22, 138, 119, 25, 26, - 27, 28, 29, 30, 31, 59, 60, 61, 62, 63, - 64, 65, 66, 135, 136, 145, 137, 118, 119, 138, - 148, 140, 141, 142, 143, 13, 14, 15, 16, 50, - 51, 52, 75, 76, 77, 153, 154, 138, 147, 140, - 141, 142, 143, 144, 145, 45, 46, 47, 147, 103, - 14, 15, 16, 147, 155, 146, 147, 647, 648, 685, - 686, 14, 15, 148, 146, 146, 138, 146, 148, 146, - 137, 137, 150, 137, 137, 9, 150, 147, 151, 150, - 103, 146, 151, 151, 101, 147, 137, 148, 148, 147, - 103, 85, 151, 145, 151, 137, 137, 146, 148, 139, - 147, 139, 139, 139, 149, 151, 139, 89, 11, 148, - 137, 146, 156, 137, 112, 149, 147, 145, 6, 151, - 150, 147, 151, 148, 139, 147, 137, 146, 137, 149, - 137, 137, 5, 149, 139, 147, 150, 155, 139, 147, - 16, 126, 544, 147, 147, 155, 148, 146, 103, 146, - 145, 503, 616, 149, 146, 146, 137, 694, 147, 515, - 147, 151, 155, 149, 147, 139, 146, 151, 137, 147, - 147, 147, 151, 146, 149, 146, 125, 127, 146, 522, - 150, 148, 148, 155, 149, 148, 148, 148, 148, 146, - 148, 150, 129, 145, 139, 139, 101, 84, 146, 150, - 156, 519, 156, 150, 150, 148, 148, 148, 148, 148, - 148, 139, 139, 149, 146, 146, 146, 146, 151, 327, - 146, 156, 147, 146, 107, 149, 148, 148, 148, 146, - 146, 146, 146, 139, 145, 139, 146, 156, 151, 147, - 139, 139, 151, 777, 146, 146, 146, 744, 139, 146, - 146, 146, 146, 146, 146, 139, 146, 510, 147, 713, - 448, 495, 174, 444, 146, 151, 151, 531, 146, 146, - 151, 151, 17, 191, 148, 146, 151, 146, 146, 158, - 702, 151, -1, -1, -1, -1, -1, -1, -1, 196, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 766, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 777, 186, -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, 220 -}; - - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint16 yystos[] = -{ - 0, 160, 161, 0, 162, 1, 3, 7, 8, 10, - 32, 33, 34, 35, 36, 37, 38, 41, 43, 44, - 48, 49, 53, 54, 55, 56, 57, 58, 70, 71, - 74, 78, 79, 80, 81, 82, 83, 84, 86, 87, - 88, 90, 91, 92, 94, 95, 96, 97, 98, 102, - 106, 107, 119, 135, 136, 163, 164, 165, 166, 168, - 169, 172, 176, 177, 188, 194, 197, 198, 199, 203, - 212, 215, 234, 237, 242, 246, 247, 252, 256, 260, - 264, 269, 270, 271, 272, 273, 281, 298, 299, 301, - 302, 304, 305, 309, 310, 311, 314, 327, 332, 352, - 353, 366, 137, 101, 137, 216, 150, 257, 104, 137, - 235, 245, 137, 245, 238, 245, 178, 107, 137, 388, - 110, 114, 116, 137, 202, 204, 50, 51, 52, 282, - 150, 150, 99, 138, 155, 72, 73, 105, 137, 105, - 137, 315, 1, 101, 263, 148, 189, 150, 137, 41, - 49, 80, 83, 109, 137, 387, 116, 1, 101, 167, - 323, 138, 150, 390, 50, 51, 52, 268, 274, 300, - 139, 318, 147, 171, 213, 147, 214, 150, 217, 390, - 103, 137, 251, 390, 145, 236, 147, 243, 147, 103, - 145, 150, 154, 239, 240, 241, 147, 39, 40, 41, - 42, 179, 390, 148, 148, 139, 68, 69, 139, 146, - 150, 283, 284, 288, 103, 150, 146, 146, 138, 307, - 306, 148, 390, 102, 137, 386, 386, 390, 101, 108, - 137, 191, 192, 107, 137, 106, 137, 102, 137, 146, - 146, 146, 147, 137, 250, 150, 137, 261, 296, 137, - 303, 137, 4, 101, 137, 174, 214, 9, 1, 146, - 170, 220, 150, 151, 150, 170, 236, 147, 244, 240, - 241, 170, 153, 154, 239, 180, 181, 182, 183, 146, - 184, 367, 200, 205, 289, 291, 147, 149, 151, 285, - 151, 103, 145, 156, 147, 308, 308, 312, 148, 148, - 190, 193, 151, 1, 108, 137, 170, 170, 170, 170, - 170, 170, 101, 324, 251, 248, 147, 263, 59, 60, - 61, 62, 63, 64, 65, 66, 103, 280, 297, 151, - 319, 173, 170, 103, 218, 253, 258, 170, 145, 170, - 151, 241, 241, 170, 137, 85, 185, 137, 137, 148, - 186, 1, 369, 370, 139, 147, 139, 139, 139, 149, - 151, 154, 156, 146, 75, 76, 77, 170, 170, 139, - 316, 89, 334, 146, 149, 195, 148, 151, 11, 224, - 265, 288, 150, 328, 147, 175, 151, 224, 390, 224, - 148, 137, 187, 118, 119, 138, 140, 141, 142, 143, - 144, 145, 155, 351, 371, 372, 373, 201, 139, 150, - 206, 208, 147, 147, 149, 263, 145, 146, 313, 139, - 155, 149, 137, 325, 137, 221, 222, 225, 390, 147, - 275, 329, 137, 5, 6, 170, 137, 221, 150, 221, - 112, 139, 155, 375, 376, 147, 147, 147, 374, 146, - 146, 207, 145, 45, 46, 47, 211, 290, 139, 149, - 156, 146, 317, 333, 196, 155, 377, 146, 151, 147, - 226, 103, 137, 266, 267, 149, 137, 320, 147, 147, - 146, 151, 254, 151, 1, 383, 384, 385, 388, 377, - 138, 351, 351, 351, 1, 119, 121, 122, 123, 124, - 128, 373, 382, 147, 147, 139, 147, 149, 146, 146, - 335, 137, 378, 326, 249, 223, 148, 227, 146, 147, - 155, 262, 155, 279, 150, 148, 6, 5, 219, 224, - 259, 147, 156, 147, 156, 146, 156, 375, 148, 148, - 148, 148, 148, 146, 208, 209, 149, 292, 251, 1, - 93, 108, 110, 111, 112, 113, 114, 115, 116, 117, - 156, 336, 340, 352, 380, 146, 148, 231, 225, 14, - 15, 16, 19, 20, 21, 22, 25, 26, 27, 28, - 29, 30, 31, 137, 228, 229, 230, 267, 280, 103, - 137, 150, 293, 330, 321, 231, 221, 231, 384, 156, - 126, 125, 127, 145, 129, 156, 211, 139, 139, 150, - 150, 146, 157, 337, 148, 148, 148, 347, 148, 359, - 148, 148, 146, 156, 1, 138, 139, 379, 381, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 137, 232, 233, 146, 149, 149, 152, 156, - 294, 150, 139, 139, 146, 151, 146, 146, 146, 146, - 147, 146, 210, 149, 286, 137, 145, 389, 338, 148, - 341, 350, 386, 148, 354, 343, 148, 102, 137, 150, - 102, 106, 137, 351, 156, 149, 152, 16, 14, 15, - 16, 229, 229, 139, 276, 331, 322, 255, 145, 151, - 139, 278, 147, 139, 348, 139, 1, 363, 364, 365, - 386, 146, 107, 355, 146, 368, 101, 84, 361, 146, - 146, 345, 146, 146, 146, 146, 13, 14, 15, 16, - 233, 233, 295, 278, 151, 146, 231, 146, 287, 389, - 339, 139, 342, 146, 147, 369, 344, 362, 139, 151, - 277, 151, 146, 151, 151, 158, 349, 146, 365, 146, - 130, 131, 144, 360, 346, 151, 148, 146, 146, 151, - 146, 356, 357, 358, 386, 146, 146, 147, 358 -}; - - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint16 yyr1[] = -{ - 0, 159, 161, 160, 162, 162, 163, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 164, - 165, 166, 166, 167, 167, 168, 169, 170, 170, 171, - 171, 173, 172, 174, 174, 174, 175, 175, 175, 175, - 176, 178, 177, 180, 179, 181, 179, 182, 179, 183, - 179, 184, 179, 185, 185, 187, 186, 186, 189, 190, - 188, 191, 191, 191, 191, 191, 193, 192, 195, 196, - 194, 197, 198, 200, 201, 199, 202, 202, 202, 202, - 204, 205, 203, 206, 207, 206, 209, 210, 208, 208, - 211, 211, 211, 213, 212, 212, 214, 214, 216, 215, - 218, 219, 217, 220, 217, 221, 221, 223, 222, 222, - 224, 224, 226, 225, 227, 227, 228, 228, 228, 228, - 228, 228, 228, 228, 228, 228, 228, 228, 229, 229, - 229, 230, 230, 230, 230, 230, 230, 231, 231, 232, - 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, - 232, 232, 232, 232, 232, 233, 233, 233, 233, 235, - 234, 234, 236, 236, 238, 237, 237, 239, 239, 240, - 240, 240, 241, 241, 241, 241, 243, 242, 244, 244, - 245, 245, 246, 248, 249, 247, 250, 247, 251, 251, - 253, 254, 255, 252, 257, 258, 259, 256, 260, 260, - 261, 261, 262, 262, 263, 263, 265, 264, 266, 266, - 267, 267, 268, 268, 268, 268, 269, 269, 269, 270, - 270, 270, 270, 270, 270, 271, 271, 271, 272, 272, - 272, 274, 275, 276, 277, 273, 278, 278, 279, 279, - 280, 280, 282, 281, 283, 283, 284, 285, 286, 287, - 284, 288, 288, 289, 290, 288, 291, 292, 288, 293, - 294, 295, 293, 293, 296, 296, 297, 297, 297, 297, - 297, 297, 297, 297, 298, 298, 300, 299, 301, 301, - 303, 302, 304, 304, 306, 305, 307, 305, 308, 308, - 308, 308, 309, 310, 312, 313, 311, 315, 316, 317, - 314, 318, 319, 320, 321, 322, 314, 323, 324, 325, - 326, 314, 327, 327, 329, 330, 331, 328, 328, 333, - 332, 334, 334, 335, 335, 335, 335, 336, 338, 339, - 337, 337, 341, 342, 340, 343, 344, 340, 340, 340, - 345, 346, 340, 340, 340, 340, 340, 347, 340, 340, - 348, 349, 340, 340, 350, 340, 340, 340, 340, 351, - 351, 351, 351, 351, 352, 352, 352, 352, 353, 353, - 354, 354, 355, 354, 356, 356, 357, 357, 358, 359, - 360, 360, 361, 361, 362, 362, 363, 363, 364, 364, - 365, 365, 367, 366, 368, 368, 370, 369, 369, 371, - 371, 372, 372, 372, 372, 373, 373, 373, 373, 374, - 374, 376, 375, 378, 379, 377, 380, 380, 381, 381, - 381, 382, 382, 382, 382, 382, 382, 382, 383, 383, - 384, 384, 384, 385, 386, 386, 387, 387, 388, 388, - 389, 389, 390 -}; - - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 0, 2, 2, 0, 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, - 3, 3, 3, 1, 3, 2, 1, 1, 1, 1, - 0, 0, 7, 1, 1, 1, 4, 4, 2, 0, - 1, 0, 4, 0, 5, 0, 4, 0, 3, 0, - 3, 0, 3, 1, 0, 0, 3, 0, 0, 0, - 5, 1, 2, 2, 2, 1, 0, 4, 0, 0, - 8, 2, 1, 0, 0, 7, 1, 1, 1, 1, - 0, 0, 6, 2, 0, 5, 0, 0, 7, 0, - 1, 1, 1, 0, 5, 4, 2, 0, 0, 3, - 0, 0, 9, 0, 6, 1, 0, 0, 4, 1, - 1, 0, 0, 3, 2, 0, 1, 1, 1, 1, - 1, 1, 1, 3, 3, 3, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 3, 3, 1, 1, 1, 1, 1, 1, 0, - 4, 5, 1, 0, 0, 4, 5, 1, 0, 3, - 3, 1, 3, 2, 1, 1, 0, 5, 2, 0, - 1, 1, 3, 0, 0, 10, 0, 7, 1, 1, - 0, 0, 0, 14, 0, 0, 0, 11, 1, 2, - 2, 0, 1, 1, 1, 1, 0, 8, 3, 1, - 1, 1, 1, 1, 1, 0, 2, 2, 2, 4, - 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, - 1, 0, 0, 0, 0, 14, 1, 0, 3, 0, - 1, 0, 0, 3, 1, 2, 1, 0, 0, 0, - 12, 2, 4, 0, 0, 7, 0, 0, 9, 1, - 0, 0, 5, 1, 2, 0, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 4, 0, 3, 2, 5, - 0, 4, 2, 2, 0, 5, 0, 5, 2, 2, - 2, 0, 3, 2, 0, 0, 7, 0, 0, 0, - 8, 0, 0, 0, 0, 0, 12, 0, 0, 0, - 0, 9, 1, 1, 0, 0, 0, 9, 0, 0, - 9, 1, 0, 2, 0, 3, 3, 1, 0, 0, - 5, 0, 0, 0, 6, 0, 0, 6, 4, 4, - 0, 0, 8, 4, 4, 4, 4, 0, 4, 2, - 0, 0, 7, 8, 0, 5, 7, 4, 1, 1, - 1, 1, 1, 1, 6, 8, 3, 1, 5, 3, - 0, 2, 0, 3, 2, 1, 3, 1, 1, 0, - 1, 1, 1, 0, 2, 0, 1, 0, 3, 1, - 1, 1, 0, 5, 1, 0, 0, 2, 1, 4, - 1, 2, 5, 2, 5, 3, 3, 3, 1, 2, - 0, 0, 2, 0, 0, 5, 2, 0, 1, 1, - 1, 4, 4, 4, 4, 6, 2, 2, 3, 1, - 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1 -}; - - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) - -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - - - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif - - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - - -/*----------------------------------------. -| Print this symbol's value on YYOUTPUT. | -`----------------------------------------*/ - -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -{ - FILE *yyo = yyoutput; - YYUSE (yyo); - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - YYUSE (yytype); -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -{ - YYFPRINTF (yyoutput, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); - - yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -static void -yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) -{ - unsigned long int yylno = yyrline[yyrule]; - int yynrhs = yyr2[yyrule]; - int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, - yystos[yyssp[yyi + 1 - yynrhs]], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyssp, yyvsp, Rule); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -yystrlen (const char *yystr) -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -yystpcpy (char *yydest, const char *yysrc) -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# 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) -{ - YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* 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: - - 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]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } - } - } - - 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_ - } - - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - 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; - } - - /* 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; -} -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -{ - YYUSE (yyvaluep); - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); - YY_IGNORE_MAYBE_UNINITIALIZED_END -} - - - - -/* The lookahead symbol. */ -int yychar; - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; -/* Number of syntax errors so far. */ -int yynerrs; - - -/*----------. -| yyparse. | -`----------*/ - -int -yyparse (void) -{ - 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 through 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 yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - 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 - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = yylex (); - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - '$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: - - { - /* - * Output a couple of macros that we need (compiler dependent) - */ - switch (compiler) { - case COM_HIGHC: - /* - * Instruct Glue of true file name - */ - Output("pragma Comment(\"@%s\");\n", inFile); - break; - case COM_BORL: case COM_MSC: case COM_WATCOM: - break; - } - /* output our first line directive */ - OutputLineNumber(yylineno,curFile->name); - } - - break; - - case 3: - - { - /* - * Do a few clean up checks. We don't want to leave something - * open... - */ - if (classBeingParsed != NullSymbol) { - yyerror("End of file in class declaration (class %s)", - classBeingParsed->name); - } - if (curResource != NullSymbol) { - yyerror("End of file in resource declaration (resource %s)", - curResource->name); - } - } - - break; - - case 6: - - {} - - break; - - case 7: - - {} - - break; - - case 8: - - {} - - break; - - case 9: - - {} - - break; - - case 10: - - {} - - break; - - case 11: - - {} - - break; - - case 12: - - {} - - break; - - case 13: - - {} - - break; - - case 14: - - {} - - break; - - case 15: - - {} - - break; - - case 16: - - {} - - break; - - case 17: - - {} - - break; - - case 18: - - {} - - break; - - case 19: - - {} - - break; - - case 20: - - {} - - break; - - case 21: - - {} - - break; - - case 22: - - {} - - break; - - case 23: - - {} - - break; - - case 24: - - {} - - break; - - case 25: - - {} - - break; - - case 26: - - {} - - break; - - case 27: - - {} - - break; - - case 28: - - {} - - break; - - case 29: - - {} - - break; - - case 30: - - {} - - break; - - case 31: - - {} - - break; - - case 32: - - {} - - break; - - case 33: - - {} - - break; - - case 34: - - {} - - break; - - case 35: - - {} - - break; - - case 36: - - {} - - break; - - case 37: - - {} - - break; - - case 38: - - {} - - break; - - case 39: - - {} - - break; - - case 40: - - {} - - break; - - case 41: - - {} - - break; - - case 42: - - {} - - break; - - case 43: - - { specificUI = TRUE; } - - break; - - case 44: - - { ErrCheck(); SWITCH_CONTEXT(LC_NONE); } - - break; - - case 45: - - { SWITCH_CONTEXT( LC_NONE); } - - break; - - case 46: - - { SWITCH_CONTEXT( LC_NONE); } - - break; - - case 47: - - {SWITCH_CONTEXT( LC_NONE); } - - break; - - case 49: - - { - if(whichToken == FIRST_OF_FILE){ - Scan_StartOptimize(); - }else{ - yyerror("@optimize must appear at the very start of a file."); - } -} - - break; - - case 50: - - { - NoReloc((yyvsp[-1].sym)); - } - - break; - - case 51: - - { - SWITCH_CONTEXT(LC_NONE); - } - - break; - - case 52: - - { - if (yychar == IDENT) { - yyerror("%s is not a defined class.", (yyvsp[-2].string)); - } else if (yychar > FIRSTSYM && yychar < LASTSYM) { - if (yychar != CLASS_SYM) { - yyerror("%s is not a defined class.", (yyvsp[-2].sym)->name); - } - } - Scan_Unput(';'); - yyerrok; - yyclearin; - } - - break; - - case 53: - - { - if (classBeingParsed != NullSymbol) { - Symbol_ClassUses(classBeingParsed, (yyvsp[0].sym)); - } else { - yyerror("@uses is valid only inside a class definition."); - } - } - - break; - - case 54: - - { - if (classBeingParsed != NullSymbol) { - Symbol_ClassUses(classBeingParsed, (yyvsp[0].sym)); - } - /* error case handled by above rule upon receiving first class */ - } - - break; - - case 55: - - { - DeflibNode *node; - - node = (DeflibNode *) malloc(sizeof(DeflibNode)); - node->next = deflibPtr; - node->name = (char *) malloc(strlen((yyvsp[0].string)) + 1); - strcpy(node->name, (yyvsp[0].string)); - deflibPtr = node; - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 56: - - { - DeflibNode *node; - - if (deflibPtr == NullDeflibNode) { - yyerror("mismatched @deflib and @endlib"); - } else { - node = deflibPtr; - deflibPtr = node->next; - free(node->name); - free(node); - } - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 58: - - {yyerror("missing semicolon");} - - break; - - case 61: - - { - /* - * If a class is already being declared, give an error - */ - if (classBeingParsed != NullSymbol) { - yyerror("class %s declared before class %s closed", - (yyvsp[-2].string), classBeingParsed->name); - } - /* - * Enter the identifier as a class and create a local symbol - * table for it - */ - classBeingParsed = Symbol_Enter((yyvsp[-2].string), CLASS_SYM, SYM_DEFINED); - - /* - * Reset the protoMinor stuff - * - */ - - curProtoMinor = NullSymbol; - - } - - break; - - case 62: - - { - char iname[100]; - char *cp; - Symbol *class, *super, *bottomClass; - - /* - * prepare to insert the messages into the class's list. - */ - - INIT_CLASS_MESSAGE_LIST(classBeingParsed); - - classBeingParsed->data.symClass.superclass = (yyvsp[-3].sym); - classBeingParsed->flags |= (yyvsp[-1].num); - classBeingParsed->data.symClass.classSeg = curResource; - - /* - * Generate the root name of the class - */ - strcpy(iname, (yyvsp[-5].string)); - for (cp = iname; *cp != '\0'; cp++) ; - if (!strcmp(cp-5, "Class")) { - *(cp-5) = '\0'; - } - classBeingParsed->data.symClass.root = String_EnterZT(iname); - /* - * Set the master level correctly (depends on whether this is - * a master class). Set the first message for the class based - * on the first message for the superclass - */ - if ((yyvsp[-3].sym) == NullSymbol) { - classBeingParsed->data.symClass.localSymbols = - Symbol_NewScope(currentScope, FALSE); - classBeingParsed->data.symClass.firstMessage = 0; - classBeingParsed->data.symClass.masterLevel = 0; - } else { - if ((yyvsp[-1].num) & SYM_CLASS_VARIANT) { - classBeingParsed->data.symClass.localSymbols = - Symbol_NewScope(currentScope, FALSE); - } else { - classBeingParsed->data.symClass.localSymbols = - Symbol_NewScope((yyvsp[-3].sym)->data.symClass.localSymbols, FALSE); - } - /* - * Check for this class being ProcessClass or a subclass - * thereof. This affects the method definitions - */ - if (!strcmp((yyvsp[-5].string), "ProcessClass") || - ((yyvsp[-3].sym)->flags & SYM_PROCESS_CLASS)) { - classBeingParsed->flags |= SYM_PROCESS_CLASS; - } - classBeingParsed->data.symClass.masterLevel = - (yyvsp[-3].sym)->data.symClass.masterLevel; - /* - * Output base structure for this class - */ - if ((classBeingParsed->data.symClass.superclass != NullSymbol) - && !(classBeingParsed->flags & SYM_PROCESS_CLASS)) - { - if ((yyvsp[-1].num) & SYM_CLASS_MASTER) { - Output("typedef struct {%sBase %s_metaBase; word %s_offset; } %sBase;", - classBeingParsed->data.symClass.superclass-> - data.symClass.root, - classBeingParsed->data.symClass.root, - classBeingParsed->data.symClass.root, - classBeingParsed->data.symClass.root); - -#if 0 - /* This was moved to happen where the @classdecl occurs - * so there's only one of these variables in - * existence for each class */ - if (compiler == COM_BORL) { - /* put out a bogus segment with a variable - * of ClassBase so glue will get type info - * so pobj on objects whose classes are - * sub classes of Master Classes defined in GOC - * will work - */ - if (!((deflibPtr != NullDeflibNode) && - strcmp(libraryName, deflibPtr->name))) - { - char foo[205]; - - /* - * We have to use CompilerStartSegment here, - * 'cause using -zE directly will screw us - * up later. - */ - sprintf(foo, "%sBase", classBeingParsed->data.symClass.root); - CompilerStartSegment("_BOGUS_", foo); - Output("\n#pragma option -zFCODE\n%sBase _far %sBaseBogusVariable[1]={0};\n#pragma option -zF*", - classBeingParsed->data.symClass.root, - classBeingParsed->data.symClass.root); - CompilerEndSegment("_BOGUS_", foo); - } - } -#endif - } else { - /* - * 7/23/92: We used to put this out as a typedef - * of the current class's Base structure to be the - * super class's Base structure. Unfortunately, - * HighC on the Sparc names the only real Base - * structure that exists for the master level - * after the final typedef so generated. This - * causes us to think there's a type-mismatch between - * files, when, for example, there's a subclass of - * VisClass used in one file but not in another - * (Gen_metaBase becomes of type GrObjBodyBase, - * for example, instead of VisBase). To get around - * this brain damage, we use a #define instead. - * -- ardeb - */ - - /* - * If the class is GenApplicationClass output - * the typedef as it doesn't seem to cause problems - * and it does fix a major headache. - */ - char *className; - - className = classBeingParsed->data.symClass.root; - if ((hackFlags & HF_APP_BASE) && - (!strcmp(className, "GenApplication") || - strstr(className, "App"))) - { - Output("typedef %sBase %sBase;", - classBeingParsed->data.symClass.superclass-> - data.symClass.root, - classBeingParsed->data.symClass.root - ); - } - else - { - Output("#define %sBase %sBase", - classBeingParsed->data.symClass.root, - classBeingParsed->data.symClass.superclass-> - data.symClass.root); - } - } - } - /* - * Figure first message for the class. - */ - if ((yyvsp[-1].num) & SYM_CLASS_MASTER) { - classBeingParsed->data.symClass.masterLevel += 1; - classBeingParsed->data.symClass.firstMessage = - FIRST_MASTER_MESSAGE + - (classBeingParsed->data.symClass.masterLevel-1) - *DEFAULT_MASTER_MESSAGES; - } else { - /* - * If our superclass is MetaClass then force our first - * message to be 8192 - */ - if (classBeingParsed->data.symClass.superclass-> - data.symClass.superclass == NullSymbol) { - classBeingParsed->data.symClass.firstMessage = 8192; - } else { - /* - * If our superclass is the first class in a master - * level then give it 2048 - */ - if (((yyvsp[-3].sym)->data.symClass.firstMessage & (8192-1)) || - ((yyvsp[-3].sym)->data.symClass.firstMessage == 8192)) { - classBeingParsed->data.symClass.firstMessage = - (yyvsp[-3].sym)->data.symClass.firstMessage - +DEFAULT_CLASS_MESSAGES; - } else { - classBeingParsed->data.symClass.firstMessage = - (yyvsp[-3].sym)->data.symClass.firstMessage - +2048; - } - } - } - } - Output("\n#define _FIRST_%s %d", classBeingParsed->name, - classBeingParsed->data.symClass.firstMessage); - OutputLineNumber(yylineno,curFile->name); - Symbol_PushScope(classBeingParsed->data.symClass.localSymbols); - - classBeingParsed->data.symClass.nextMessage = - classBeingParsed->data.symClass.firstMessage; - classBeingParsed->data.symClass.nextTag = - classBeingParsed->data.symClass.firstMessage; - - if (classBeingParsed->flags & SYM_CLASS_VARIANT) { - char name[100]; - Symbol *inst; - /* - * For a variant class put in the superclass pointer - */ - sprintf(name, "%s", classBeingParsed->data.symClass.root); - inst = MakeInstanceVar(VARIANT_PTR_SYM, - String_EnterZT(name), "MetaBase"); - classBeingParsed->data.symClass.instanceData = inst; - } - - /* - * Deal with default building of things, going all the way up - * the class tree.. - */ - for (class = bottomClass = classBeingParsed; - class != NullSymbol; - class = super) - { - super = class->data.symClass.superclass; - if (class->flags & SYM_CLASS_VARIANT) { - /* - * If we have hit a variant class then we need to try to - * find the variant class for it - */ - if (LocateSuperForVariant(bottomClass, NullSymbol, &super)){ - /* - * Push default superclass's locals too - */ - Symbol_PushScope(super->data.symClass.localSymbols); - bottomClass = super; - } else { - break; - } - } - } - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 64: - - { (yyval.sym) = NullSymbol; } - - break; - - case 65: - - { - yyerror("unidentified class symbol '%s'. Substituting with 'meta'",(yyvsp[0].string)); - (yyval.sym) = NullSymbol; - } - - break; - - case 66: - - { - (yyval.num) = SYM_CLASS_MASTER | SYM_CLASS_VARIANT; - } - - break; - - case 67: - - { - (yyval.num) = SYM_CLASS_MASTER | SYM_CLASS_VARIANT; - } - - break; - - case 68: - - { - (yyval.num) = SYM_CLASS_MASTER; - } - - break; - - case 69: - - { (yyval.num) = 0; } - - break; - - case 70: - - { - if (classBeingParsed == NullSymbol) { - yyerror("@endc outside class declaration"); - } else { - /* - * Output an extern for the class structure. - * If we are in a library that we are not defining then - * declare the class to be 'far'. - */ - if ((deflibPtr != NullDeflibNode) && strcmp(libraryName, deflibPtr->name)) { - - Output("extern ClassStruct %s %s; ", - compilerFarKeyword, classBeingParsed->name); - - /* - * NOTE: for the data to be laid out correctly by HighC, these - * four extern declarations must exist and be in the order - * in which the components of the class record are placed in - * memory, as HighC seems to mark the location where data - * should go based on where it saw the extern, effectively - * remembering the current offset in the segment and stuffing - * the data in there when the variable is encountered. - * -- ardeb 3/11/92 - */ - if (compiler == COM_HIGHC) { - Output("extern Message _Messages_%s[]; ", classBeingParsed->name); - Output("extern MessageMethod *_Methods_%s[]; ", - classBeingParsed->name); - Output("extern CMethodDef _htypes_%s[];", - classBeingParsed->name); - Output("extern MessageMethod *_Reloc_%s;", - classBeingParsed->name); - } - } else { - - char farString[] = " _far"; - - /* - * High C will place the following externs into whichever - * segment is active when it encounters the following externs, - * even if the actual declarations are specified as being - * in a different segment, so curResource gets this class, - * regardless of which segment is active during the @classdecl. - * There's code in the @classdecl handler that'll error if - * curResource here is null and curResource during the - * @classdecl is some segment if we're targeting the High C - * compiler. We also prepend an "_CLASSSEG_" to the name - * of the segment, since High C will issue a GRPDEF to - * subsume whatever segment we begin here, and glue needs to - * recognize that we don't want that to happen.None of this - * should be a problem under Borland C, since it seems to - * favor the active segment at the time the thing is actually - * declared. - jon 19 oct 94 - */ - - if (compiler == COM_BORL) { - -#if 1 - /* - * I changed this back to not emit the far unless the - * class is known to be in a different segment, as without - * this, an @callsuper in a multi-launchable geode yields - * death when the class segment remains the resource ID, - * not the segment of dgroup. -- ardeb 7/9/96 - */ - if (curResource != NullSymbol) { - CompilerStartSegment("", curResource->name); - Output("extern ClassStruct far %s[]; ", classBeingParsed->name); - } else if (classSegName) { - CompilerStartSegment("", classSegName); - Output("extern ClassStruct far %s[]; ", classBeingParsed->name); - } else { - Output("extern ClassStruct %s[]; ", classBeingParsed->name); - } -#else - /* - * I've changed this line to *always* emit the far - * keyword so that HP can use the non '-C' method - * of declaring classes in segments other than dgroup. - * I thought that this caused a problem somewhere else, - * but eballot sez he tried it out on a bunch of sample - * apps, and it seems to work. - jon 29 feb 96 - */ - Output("extern ClassStruct far %s[]; ", classBeingParsed->name); -#endif - } else { - if (curResource != NullSymbol) { - CompilerStartSegment("_CLASSSEG_", curResource->name); - } else if (classSegName) { - CompilerStartSegment("_CLASSSEG_", classSegName); - } else { - *farString = '\0'; - } - - Output("extern%s ClassStruct %s; ", - farString, classBeingParsed->name); - - /* NOTE: for the data to be laid out correctly by HighC, these - * four extern declarations must exist and be in the order - * in which the components of the class record are placed in - * memory, as HighC seems to mark the location where data - * should go based on where it saw the extern, effectively - * remembering the current offset in the segment and stuffing - * the data in there when the variable is encountered. - * -- ardeb 3/11/92 - */ - - Output("extern%s Message _Messages_%s[]; ", - farString, classBeingParsed->name); - Output("extern%s MessageMethod *_Methods_%s[]; ", - farString, classBeingParsed->name); - Output("extern%s CMethodDef _htypes_%s[];", - farString, classBeingParsed->name); - Output("extern%s MessageMethod *_Reloc_%s;", - farString, classBeingParsed->name); - - /* - * End the segment we began - */ - if (curResource != NullSymbol) { - CompilerEndSegment("_CLASSSEG_", curResource->name); - } else if (classSegName) { - CompilerEndSegment("_CLASSSEG_", classSegName); - } - } - } - - if (classBeingParsed->flags & SYM_PROCESS_CLASS) { - processClass = classBeingParsed; - } else { - /* - * Output the instance data structure that we've stored - * the pieces of - */ - Output("\ntypedef struct _%sInstance {\n", - classBeingParsed->data.symClass.root); - OutputInstanceData(classBeingParsed); - Output("} %sInstance; ", - classBeingParsed->data.symClass.root); - /* - * Need to put out a line number directive because - * the instance stuff might have changed it, and - * there might be stuff on the line after the @endc. - */ - OutputLineNumber(yylineno,curFile->name); - } - /* output an extern for the classes messages, if any */ - if(classBeingParsed->data.symClass.firstMessagePtr != NULL){ - int enumValue = 0; - Symbol *mptr; - Output("typedef enum{"); - for(mptr = classBeingParsed->data.symClass.firstMessagePtr; - mptr != (Symbol *)NULL; - mptr = mptr->data.symMessage.nextMessage){ - if(enumValue == mptr->data.symMessage.messageNumber){ - Output("%s,",mptr->name); - }else{ - Output("%s=%d,",mptr->name, - /* cast it so it makes them negative if they */ - /* are over 32768 */ - (long)(short) - mptr->data.symMessage.messageNumber); - enumValue = mptr->data.symMessage.messageNumber; - } - enumValue++; - } - Output("}%sMessages;", - classBeingParsed->data.symClass.root); - } - - Symbol_PopScopeTo(classBeingParsed->data.symClass.localSymbols); - } - classBeingParsed = NullSymbol; - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 71: - - { - SWITCH_CONTEXT( LC_TYPE_STRING_MATCH_PARENS); - } - - break; - - case 72: - - { - Symbol **iptr; - /* - * Add instance variable to class's instance variables - */ - if (classBeingParsed == NullSymbol) { - yyerror("@instance outside class declaration"); - } else { - for (iptr = &(classBeingParsed->data.symClass.instanceData); - *iptr != NullSymbol; - iptr = &((*iptr)->data.symRegInstance.next)) ; - *iptr = (yyvsp[-1].sym); - } - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 73: - - { SWITCH_CONTEXT( LC_PARSE); } - - break; - - case 74: - - { - (yyval.sym) = MakeInstanceVar(COMPOSITE_SYM, (yyvsp[-2].string), - String_EnterZT("CompPart")); - (yyval.sym)->data.symComposite.linkPart = (yyvsp[0].sym); - AddReloc(NullSymbol, RT_OPTR, (yyvsp[-2].string), 1, String_EnterZT("")); - } - - break; - - case 75: - - { SWITCH_CONTEXT( LC_PARSE); } - - break; - - case 76: - - { - (yyval.sym) = MakeInstanceVar(LINK_SYM, (yyvsp[0].string), String_EnterZT("LinkPart")); - (yyval.sym)->flags |= (yyvsp[-1].num); - AddReloc(NullSymbol, RT_OPTR, (yyvsp[0].string), 1, String_EnterZT("")); - } - - break; - - case 77: - - { SWITCH_CONTEXT( LC_PARSE); } - - break; - - case 78: - - { - (yyval.sym) = MakeInstanceVar(VIS_MONIKER_SYM, (yyvsp[0].string), - String_EnterZT("ChunkHandle")); - } - - break; - - case 79: - - { SWITCH_CONTEXT( LC_PARSE); } - - break; - - case 80: - - { - (yyval.sym) = MakeInstanceVar(KBD_ACCELERATOR_SYM, (yyvsp[0].string), - String_EnterZT("word")); - } - - break; - - case 81: - - { SWITCH_CONTEXT( LC_PARSE); } - - break; - - case 82: - - { - if (!strcmp(TDS_CTYPE((yyvsp[-2].tdecl)), "optr")) { - (yyval.sym) = MakeInstanceVar(OPTR_SYM, TDS_IDENT((yyvsp[-2].tdecl)), - String_EnterZT("optr")); - (yyval.sym)->data.symRegInstance.defaultValue = (yyvsp[0].string); - AddReloc(NullSymbol, RT_OPTR, TDS_IDENT((yyvsp[-2].tdecl)), - 1, String_EnterZT("")); - } else if (!strcmp(TDS_CTYPE((yyvsp[-2].tdecl)), "ChunkHandle")) { - (yyval.sym) = MakeInstanceVar(CHUNK_INST_SYM, TDS_IDENT((yyvsp[-2].tdecl)), - String_EnterZT("ChunkHandle")); - (yyval.sym)->data.symRegInstance.defaultValue = (yyvsp[0].string); - } else { - (yyval.sym) = MakeInstanceVar(REG_INSTANCE_SYM, TDS_IDENT((yyvsp[-2].tdecl)), - TDS_CTYPE((yyvsp[-2].tdecl))); - (yyval.sym)->data.symRegInstance.typeSuffix = TDS_TYPESUF((yyvsp[-2].tdecl)); - (yyval.sym)->data.symRegInstance.defaultValue = (yyvsp[0].string); - } - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 83: - - { (yyval.num) = SYM_IS_KBD_PATH; } - - break; - - case 84: - - { (yyval.num) = 0; } - - break; - - case 85: - - { - SWITCH_CONTEXT( LC_STRING_SEMI_COLON); - } - - break; - - case 86: - - { - (yyval.string) = (yyvsp[0].string); - } - - break; - - case 87: - - { (yyval.string) = NULL; } - - break; - - case 88: - - { - SWITCH_CONTEXT( LC_TYPE_STRING_MATCH_PARENS); - } - - break; - - case 89: - - { - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 90: - - { - Symbol *sym; - - if (classBeingParsed == NullSymbol) { - yyerror("@vardata cannot be outside class declaration"); - } else { - - sym = Symbol_Enter(TDS_IDENT((yyvsp[-2].tdecl)), VARDATA_SYM, SYM_DEFINED); - sym->data.symVardata.ctype = TDS_CTYPE((yyvsp[-2].tdecl)); - sym->data.symVardata.typeSuffix = TDS_TYPESUF((yyvsp[-2].tdecl)); - - sym->data.symVardata.class = classBeingParsed; - sym->data.symVardata.protoMinor = curProtoMinor; - sym->data.symVardata.tag = - classBeingParsed->data.symClass.nextTag; - classBeingParsed->data.symClass.nextTag += 4; - Output("#define %s %d\n", sym->name, sym->data.symVardata.tag); - } - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 91: - - {(yyval.sym) = (yyvsp[0].sym);} - - break; - - case 92: - - { - (yyval.sym) = (yyvsp[0].sym); - Symbol_PopScope(); - } - - break; - - case 93: - - { - yyerror("'%s' is not a vardata symbol",(yyvsp[0].string)); - Symbol_PopScope(); - (yyval.sym) = NullSymbol; - } - - break; - - case 94: - - { - Symbol_PopScope(); - (yyval.sym) = NullSymbol; - } - - break; - - case 95: - - { yyerror("'%s' is not a vardata symbol",(yyvsp[0].string)); (yyval.sym) = NullSymbol;} - - break; - - case 96: - - { - Symbol_PushScope((yyvsp[0].sym)->data.symClass.localSymbols); - } - - break; - - case 98: - - { - SWITCH_CONTEXT( LC_PARSE_NO_LOOKUP); - } - - break; - - case 99: - - { - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 100: - - { - Symbol *sym; - - if((yyvsp[-5].sym) != NullSymbol){ - - /* - * Make sure we're in the scope of the class of whose vardata - * this thing will become a member. - */ - Symbol_PushScope((yyvsp[-5].sym)->data.symVardata.class->data.symClass.localSymbols); - sym = Symbol_Enter((yyvsp[0].string), VARDATA_SYM, SYM_DEFINED); - sym->data.symVardata.ctype = (yyvsp[-2].string); - sym->data.symVardata.class = (yyvsp[-5].sym)->data.symVardata.class; - sym->data.symVardata.tag = (yyvsp[-5].sym)->data.symVardata.tag; - sym->data.symVardata.typeSuffix = - (yyvsp[-5].sym)->data.symVardata.typeSuffix; - Output("#define %s %d", sym->name, sym->data.symVardata.tag); - - Symbol_PopScope(); - - SWITCH_CONTEXT( LC_NONE); - } - } - - break; - - case 101: - - { - if (classBeingParsed == NullSymbol) { - yyerror("@protominor cannot be outside class declaration"); - } else { - curProtoMinor = (yyvsp[0].sym); - } - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 102: - - { - if (classBeingParsed == NullSymbol) { - yyerror("@protoreset cannot be outside class declaration"); - } else { - curProtoMinor = NullSymbol; - } - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 103: - - { - SWITCH_CONTEXT( LC_STRING_SEMI_COLON); - } - - break; - - case 104: - - { - if((yyvsp[-3].sym) != NullSymbol){ - InstanceValue *inst; - char buf[1000]; - /* - * Replace any occurrance of @default with - * the old default value - */ - if (defaultdebug) { - fprintf(stderr, "*** Defaulting %s of class %s...", - (yyvsp[-3].sym)->name, classBeingParsed->name); - } - inst = FindDefault(classBeingParsed, (yyvsp[-3].sym)->name); - if (inst != NullInstanceValue) { - if (defaultdebug) { - fprintf(stderr, "found %s -> ", inst->value); - } - CopySubst(buf, (yyvsp[0].string), "@default", inst->value); - } else { - if (defaultdebug) { - fprintf(stderr, "using default %s ->", - (yyvsp[-3].sym)->data.symRegInstance.defaultValue); - } - if ((yyvsp[-3].sym)->data.symRegInstance.defaultValue != NULL) { - CopySubst(buf, (yyvsp[0].string), "@default", - (yyvsp[-3].sym)->data.symRegInstance.defaultValue); - } else { - CopySubst(buf, (yyvsp[0].string), "@default", "0"); - } - } - if (defaultdebug) { - fprintf(stderr, "%s\n", buf); - } - if ((yyvsp[-3].sym)->type == VARIANT_PTR_SYM) { - Symbol *oldScope, *tempClass; - - tempClass = Symbol_Find((yyvsp[0].string), TRUE); - if (tempClass == NullSymbol) { - yyerror("superclass for variant (%s) not defined", (yyvsp[0].string)); - } else if (LocateSuperForVariant(classBeingParsed, NullSymbol, - &oldScope)) { - /* - * Replace the old scope - */ - Symbol_ReplaceScope(oldScope->data.symClass.localSymbols, - tempClass->data.symClass.localSymbols); - } else { - Symbol_PushScope(tempClass->data.symClass.localSymbols); - } - } - - inst = (InstanceValue *) zmalloc(sizeof(InstanceValue)); - inst->next = classBeingParsed->data.symClass.defaultList; - classBeingParsed->data.symClass.defaultList = inst; - inst->name = (yyvsp[-3].sym)->name; - inst->value = String_EnterZT(buf); - SWITCH_CONTEXT( LC_PARSE); - } - } - - break; - - case 105: - - { - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 109: - - { - yyerror("'%s' not an instance variable, can't set its default", - (yyvsp[0].string)); - (yyval.sym) = NullSymbol; - } - - break; - - case 110: - - { - SWITCH_CONTEXT( LC_STRING_COMMA); - } - - break; - - case 111: - - { - relocSym = Symbol_Find((yyvsp[0].string), TRUE); - if ((relocSym == NullSymbol) || (relocSym->type != VARDATA_SYM)) { - SWITCH_CONTEXT( LC_PARSE); - relocString = (yyvsp[0].string); - } - } - - break; - - case 113: - - { - AddReloc(NullSymbol, (yyvsp[0].num), relocString, (yyvsp[-1].num), relocStruct); - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 114: - - { - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 115: - - { - AddReloc(relocSym, (yyvsp[0].num), (yyvsp[-4].string), (yyvsp[-1].num), relocStruct); - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 116: - - { - SWITCH_CONTEXT( LC_STRING_RIGHT_PAREN); - } - - break; - - case 117: - - { - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 118: - - { - (yyval.num) = (yyvsp[-5].num); - relocStruct = String_EnterZT((yyvsp[-2].string)); - } - - break; - - case 119: - - { - (yyval.num) = 1; - relocStruct = String_EnterZT(""); - } - - break; - - case 120: - - { (yyval.num) = RT_FPTR; } - - break; - - case 121: - - { (yyval.num) = RT_HPTR; } - - break; - - case 122: - - { (yyval.num) = RT_OPTR; } - - break; - - case 123: - - { - } - - break; - - case 124: - - { - Symbol **sym; - - if (classBeingParsed != NullSymbol) { - yyerror("@classdecl for %s must be outside class declaration", - (yyvsp[-3].sym)->name); - } - - /* - * Check whether the class has already been declared, since - * this would cause an endless loop in DoFinalOutput if left - * unchecked. - */ - if ((yyvsp[-3].sym)->flags & SYM_CLASS_DECLARED) { - yyerror("Duplicate @classdecl for %s", (yyvsp[-3].sym)->name); - } else { - for (sym = &classDeclList; *sym != NullSymbol; - sym= &((*sym)->data.symClass.nextDeclaredClass)); - *sym = (yyvsp[-3].sym); - (yyvsp[-3].sym)->flags |= (yyvsp[-1].num) | SYM_CLASS_DECLARED; - - if (curResource != NullSymbol) { - if ((yyvsp[-3].sym)->data.symClass.classSeg != NullSymbol) { - if ((yyvsp[-3].sym)->data.symClass.classSeg != curResource) { - yyerror("%s is already in segment %s, so it can't be redeclared in %s", (yyvsp[-3].sym)->name, (yyvsp[-3].sym)->data.symClass.classSeg->name, curResource->name); - } - } else if (compiler == COM_HIGHC) { - yyerror("%s must be the current segment around the @class/@endc for %s, otherwise High C will put %s into dgroup, which is probably not what you were expecting.", curResource->name, (yyvsp[-3].sym)->name, (yyvsp[-3].sym)->name); - } else { - (yyvsp[-3].sym)->data.symClass.classSeg = curResource; - } - } - } - SWITCH_CONTEXT( LC_NONE); - - curProtoMinor = NullSymbol; - - /* put out a bogus segment with a variable of ClassBase so - * glue will get type info so pobj on objects whose classes are - * sub classes of Master Classes defined in GOC will work - * First: check to make sure the class has a master level - * NOTE: only implemented for BORLAND compiler now - */ - if ((yyvsp[-3].sym)->data.symClass.masterLevel != 0) - { - if (compiler == COM_BORL) - { - char *cp, foo[205]; -#define STRLEN_CLASS 5 - cp = (yyvsp[-3].sym)->name + strlen((yyvsp[-3].sym)->name) - STRLEN_CLASS; - *cp = '\0'; - - /* - * We have to use CompilerStartSegment here, 'cause - * using -zE directly will screw us up later. - */ - sprintf(foo, "%sBase", (yyvsp[-3].sym)->name); - CompilerStartSegment("_BOGUS_", foo); - Output("\n#pragma option -zFCODE\n%sBase _far %sBaseBogusVariable[1]={0};\n#pragma option -zF*", (yyvsp[-3].sym)->name, (yyvsp[-3].sym)->name); - CompilerEndSegment("_BOGUS_", foo); - - *cp = 'C'; - OutputLineNumber(yylineno,curFile->name); - } - } - } - - break; - - case 125: - - { - yyerror("Can't declare class for '%s', not defined.",(yyvsp[-2].string)); - - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 126: - - { - (yyval.num) = SYM_NEVER_SAVED; - } - - break; - - case 127: - - { (yyval.num) = 0; } - - break; - - case 128: - - { - SWITCH_CONTEXT( LC_TYPE_STRING_NO_MATCH_PARENS); - currentMPD = numRegs = 0; - stackParams = forceRegs = forceNoRegs = multipleReturn = FALSE; - } - - break; - - case 130: - - { - /* - * Enter the identifier as a message and initialize it. We must - * enter it in the global scope so that it is accessable anywhere. - */ - curMessage = EnterSymbolInGlobal(TDS_IDENT((yyvsp[-1].tdecl)), - MSG_SYM, SYM_DEFINED); - SWITCH_CONTEXT( LC_TYPE_STRING_MATCH_PARENS); - currentMessageReturnType = TDS_CTYPE((yyvsp[-1].tdecl)); - } - - break; - - case 131: - - { - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 132: - - { - if (classBeingParsed == NullSymbol) { - yyerror("@message cannot be outside class declaration"); - } else { - if (TDS_TYPESUF_IS_NOT_NULL((yyvsp[-8].tdecl))) { - yyerror("messages cannot return arrays (use *)"); - } - curMessage->data.symMessage.class = classBeingParsed; - curMessage->data.symMessage.protoMinor = curProtoMinor; - curMessage->data.symMessage.messageNumber = - classBeingParsed->data.symClass.nextMessage++; - curMessage->data.symMessage.firstParam = (yyvsp[-4].param); - curMessage->data.symMessage.returnType = TDS_CTYPE((yyvsp[-8].tdecl)); - curMessage->data.symMessage.mpd = currentMPD; - /* - * Output("#define %s %d", TDS_IDENT($1), - * curMessage->data.symMessage.messageNumber); - */ - ADD_MESSAGE_LIST_ELEMENT(classBeingParsed,curMessage); - if (mpddebug) { - Output("\n#define %s_MPD %s", curMessage->name, - GenerateMPDString(curMessage, - MPD_PASS_AND_RETURN)); - } - } - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 133: - - { - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 134: - - { - /* - * Enter the identifier as a message and initialize it. We must - * enter it in the global scope so that it is accessable anywhere. - */ - curMessage = EnterSymbolInGlobal((yyvsp[-1].string), MSG_SYM, SYM_DEFINED); - - if (classBeingParsed == NullSymbol) { - yyerror("@message cannot be outside class declaration"); - - } else { - curMessage->data.symMessage.class = classBeingParsed; - curMessage->data.symMessage.messageNumber = - classBeingParsed->data.symClass.nextMessage++; - curMessage->data.symMessage.firstParam = - (yyvsp[-3].sym)->data.symMessage.firstParam; - curMessage->data.symMessage.returnType = - (yyvsp[-3].sym)->data.symMessage.returnType; - curMessage->data.symMessage.mpd = - (yyvsp[-3].sym)->data.symMessage.mpd; - /* - * Output("#define %s %d", $5, - * curMessage->data.symMessage.messageNumber); - */ - ADD_MESSAGE_LIST_ELEMENT(classBeingParsed,curMessage); - - if (mpddebug) { - Output("\n#define %s_MPD %s", curMessage->name, - GenerateMPDString(curMessage, - MPD_PASS_AND_RETURN)); - } - } - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 135: - - { - /* - * If no parameters are given then set to register params - */ - if ( !stackParams && ((currentMPD & MPD_PASS) == 0)) { - currentMPD |= MPD_REGISTER_PARAMS; - } - } - - break; - - case 136: - - { - /* - * No parameters given -> set to register params - */ - (yyval.param) = NullParam; - currentMPD |= MPD_REGISTER_PARAMS; - } - - break; - - case 137: - - { - SWITCH_CONTEXT( LC_TYPE_STRING_MATCH_PARENS); - (yyval.num) = multipleReturn; - } - - break; - - case 138: - - { - MessageParam **pp; - - /* - * Make sure the value of the global multipleReturn variable hasn't - * changed because of this parameter, as any multiple-return - * parameter must be the first one passed (that's where the - * kernel puts the thing). - */ - if ((yyvsp[-1].num) != multipleReturn) { - yyerror("multiple-return parameter must be first parameter for message"); - } - - if ((yyvsp[-3].param) != NullParam) { - for (pp = &((yyvsp[-3].param)->next); *pp != NullParam; pp = &((*pp)->next)); - *pp = (yyvsp[0].param); - (yyval.param) = (yyvsp[-3].param); - } else { - (yyval.param) = (yyvsp[0].param); - } - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 139: - - { SWITCH_CONTEXT( LC_PARSE); (yyval.param) = (yyvsp[0].param); } - - break; - - case 140: - - { - forceNoRegs = TRUE; - stackParams = TRUE; - } - - break; - - case 142: - - { - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 143: - - { - (yyval.param) = (MessageParam *) zmalloc(sizeof(MessageParam)); - (yyval.param)->name = TDS_IDENT((yyvsp[-2].tdecl)); - (yyval.param)->ctype = TDS_CTYPE((yyvsp[-2].tdecl)); - (yyval.param)->typeSuffix = TDS_TYPESUF((yyvsp[-2].tdecl)); - } - - break; - - case 144: - - { - if (forceNoRegs) { - if (numRegs != 0) { - if (currentMPD & MPD_C_PARAMS) { - yyerror("cannot specify registers with @stack"); - } else { - yyerror("must specify registers for all params " - "or none"); - } - } - } else { - /* - * If we parsed a real register (somsging other tmeth - * multiple return values) then force all other parameters - * to have registers - */ - if (numRegs != 0) { - forceRegs = TRUE; - } - } - } - - break; - - case 145: - - { - if (forceRegs) { - yyerror("must specify registers for all params or none"); - } else { - forceNoRegs = TRUE; - if (!stackParams) { - currentMPD |= MPD_C_PARAMS; - } - } - } - - break; - - case 146: - - { AddRegDefinition(MPR_CL); } - - break; - - case 147: - - { AddRegDefinition(MPR_CH); } - - break; - - case 148: - - { AddRegDefinition(MPR_DL); } - - break; - - case 149: - - { AddRegDefinition(MPR_DH); } - - break; - - case 150: - - { AddRegDefinition(MPR_CX); } - - break; - - case 151: - - { AddRegDefinition(MPR_DX); } - - break; - - case 152: - - { AddRegDefinition(MPR_BP); } - - break; - - case 153: - - { - AddRegDefinition((yyvsp[-2].num)); - AddRegDefinition((yyvsp[0].num)); - } - - break; - - case 154: - - { - AddRegDefinition((yyvsp[-2].num)); - AddRegDefinition((yyvsp[0].num)); - } - - break; - - case 155: - - { - if (numRegs != 0) { - yyerror("ss:bp cannot be used with any other register"); - } else if (currentMPD & MPD_STRUCT_AT_SS_BP) { - yyerror("only one ss:bp allowed"); - } else { - currentMPD |= MPD_STRUCT_AT_SS_BP; - } - } - - break; - - case 156: - - { - multipleReturn = TRUE; - currentMPD |= (MRT_MULTIPLE << MPD_RETURN_TYPE_OFFSET) | - ((yyvsp[0].num) << MPD_RET_MULT_OFFSET); - } - - break; - - case 157: - - {yyerror("unrecognized register syntax '%s'",(yyvsp[0].string));} - - break; - - case 158: - - { (yyval.num) = MPR_CX; } - - break; - - case 159: - - { (yyval.num) = MPR_DX; } - - break; - - case 160: - - { (yyval.num) = MPR_BP; } - - break; - - case 161: - - { (yyval.num) = MRMT_AXBPCXDX; } - - break; - - case 162: - - { (yyval.num) = MRMT_AXCXDXBP; } - - break; - - case 163: - - { (yyval.num) = MRMT_CXDXBPAX; } - - break; - - case 164: - - { (yyval.num) = MRMT_DXCX; } - - break; - - case 165: - - { (yyval.num) = MRMT_BPAXDXCX; } - - break; - - case 166: - - { (yyval.num) = MRMT_MULTIPLEAX; } - - break; - - case 167: - - { - if (multipleReturn && - ((currentMPD >> MPD_RETURN_TYPE_OFFSET) != MRT_MULTIPLE)) { - yyerror("cannot have a return type in addition to multiple"); - } - } - - break; - - case 168: - - { - /* - * If no registers given for return type and not multiple - * return then set return type to dword dxax *unless* the return - * type is "void" - */ - if (!multipleReturn) { - if (!strcmp(currentMessageReturnType, "void")) { - currentMPD |= (MRT_VOID << MPD_RETURN_TYPE_OFFSET); - } else { - currentMPD |= (MRT_DWORD << MPD_RETURN_TYPE_OFFSET) | - (MRDWR_DX << MPD_RET_DWORD_HIGH_OFFSET) | - (MRDWR_AX << MPD_RET_DWORD_LOW_OFFSET); - } - } - } - - break; - - case 169: - - { currentMPD |= RetTypeBWReg(MRBWT_AX); } - - break; - - case 170: - - { currentMPD |= RetTypeBWReg(MRBWT_CX); } - - break; - - case 171: - - { currentMPD |= RetTypeBWReg(MRBWT_DX); } - - break; - - case 172: - - { currentMPD |= RetTypeBWReg(MRBWT_BP); } - - break; - - case 173: - - { currentMPD |= RetTypeBWReg(MRBWT_AL); } - - break; - - case 174: - - { currentMPD |= RetTypeBWReg(MRBWT_AH); } - - break; - - case 175: - - { currentMPD |= RetTypeBWReg(MRBWT_CL); } - - break; - - case 176: - - { currentMPD |= RetTypeBWReg(MRBWT_CH); } - - break; - - case 177: - - { currentMPD |= RetTypeBWReg(MRBWT_DL); } - - break; - - case 178: - - { currentMPD |= RetTypeBWReg(MRBWT_DH); } - - break; - - case 179: - - { currentMPD |= RetTypeBWReg(MRBWT_BPL); } - - break; - - case 180: - - { currentMPD |= RetTypeBWReg(MRBWT_BPH); } - - break; - - case 181: - - { - currentMPD |= (MRT_DWORD << MPD_RETURN_TYPE_OFFSET) | - ((yyvsp[-2].num) << MPD_RET_DWORD_HIGH_OFFSET) | - ((yyvsp[0].num) << MPD_RET_DWORD_LOW_OFFSET); - } - - break; - - case 182: - - { - currentMPD |= (MRT_DWORD << MPD_RETURN_TYPE_OFFSET) | - ((yyvsp[-2].num) << MPD_RET_DWORD_HIGH_OFFSET) | - ((yyvsp[0].num) << MPD_RET_DWORD_LOW_OFFSET); - } - - break; - - case 183: - - { - currentMPD |= (MRT_VOID << MPD_RETURN_TYPE_OFFSET); - } - - break; - - case 184: - - {yyerror("unrecognized return register '%s'",(yyvsp[0].string));} - - break; - - case 185: - - { (yyval.num) = MRDWR_AX; } - - break; - - case 186: - - { (yyval.num) = MRDWR_CX; } - - break; - - case 187: - - { (yyval.num) = MRDWR_DX; } - - break; - - case 188: - - { (yyval.num) = MRDWR_BP; } - - break; - - case 189: - - { - - } - - break; - - case 190: - - { - if (classBeingParsed == NullSymbol) { - yyerror("@reserveMessages outside class declaration"); - } else { - classBeingParsed->data.symClass.nextMessage += (yyvsp[-1].num); - } - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 191: - - { - if((yyvsp[-3].sym)){ - (yyvsp[-3].sym)->data.symExport.nextMessage += (yyvsp[-1].num); - SWITCH_CONTEXT( LC_NONE); - } - } - - break; - - case 193: - - { yywarning("reserving one message.");(yyval.num) = 1; } - - break; - - case 194: - - { - - } - - break; - - case 195: - - { - if (classBeingParsed == NullSymbol) { - yyerror("@setMessageNum outside class declaration"); - } else { - classBeingParsed->data.symClass.nextMessage = (yyvsp[-1].num); - } - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 196: - - { - if((yyvsp[-3].sym)){ - (yyvsp[-3].sym)->data.symExport.nextMessage = (yyvsp[-1].num); - SWITCH_CONTEXT( LC_NONE); - } - } - - break; - - case 197: - - { (yyval.num) = (yyvsp[0].num); } - - break; - - case 198: - - { yywarning("reserving one message."); (yyval.num) = 1; } - - break; - - case 199: - - { (yyval.num) = (yyvsp[-2].num) + (yyvsp[0].num); } - - break; - - case 200: - - { (yyval.num) = (yyvsp[-2].num) - (yyvsp[0].num); } - - break; - - case 201: - - { (yyval.num) = (yyvsp[0].num); } - - break; - - case 202: - - { (yyval.num) = (yyvsp[-1].num); } - - break; - - case 203: - - { (yyval.num) = -(yyvsp[0].num); } - - break; - - case 204: - - { (yyval.num) = (yyvsp[0].num); } - - break; - - case 205: - - { (yyval.num) = (yyvsp[0].sym)->data.symMessage.messageNumber; } - - break; - - case 206: - - { - - } - - break; - - case 207: - - { - Symbol *sym; - - if (classBeingParsed == NullSymbol) { - yyerror("@exportMessages outside class declaration"); - } else { - /* - * We want to enter the exported message symbol in the global - * scope (so that it can be accessed outside the class), not - * within the scope of the class (which is the current scope). - * We do this by pushing the global scope temporarily. - */ - sym = EnterSymbolInGlobal((yyvsp[-3].string), EXPORT_SYM, SYM_DEFINED); - sym->data.symExport.class = classBeingParsed; - sym->data.symExport.firstMessage = - sym->data.symExport.nextMessage = - classBeingParsed->data.symClass.nextMessage; - classBeingParsed->data.symClass.nextMessage += (yyvsp[-1].num); - } - - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 208: - - { (yyval.num) = (yyvsp[0].num); } - - break; - - case 209: - - { - yywarning("using default number of exported messages."); - (yyval.num) = DEFAULT_EXPORTED_MESSAGES; - } - - break; - - case 211: - - { - (yyval.sym) = NullSymbol; - yyerror("'%s' is not an exported message range",(yyvsp[0].string)); - } - - break; - - case 212: - - { - SWITCH_CONTEXT( LC_TYPE_STRING_NO_MATCH_PARENS); - currentMPD = numRegs = 0; - stackParams = forceRegs = forceNoRegs = multipleReturn = FALSE; - - (yyval.sym) = (yyvsp[-1].sym); - } - - break; - - case 213: - - { - SWITCH_CONTEXT( LC_TYPE_STRING_MATCH_PARENS); - currentMessageReturnType = TDS_CTYPE((yyvsp[-1].tdecl)); - } - - break; - - case 214: - - { - /* - * Enter the identifier as a message and initialize it - */ - curMessage = EnterSymbolInGlobal(TDS_IDENT((yyvsp[-5].tdecl)), MSG_SYM, SYM_DEFINED); - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 215: - - { - if (TDS_TYPESUF_IS_NOT_NULL((yyvsp[-8].tdecl))) { - yyerror("messages cannot return arrays (use *)"); - } - if((yyvsp[-9].sym) != NullSymbol){ - curMessage->flags |= SYM_IMPORTED; - curMessage->data.symMessage.class = (yyvsp[-9].sym)->data.symExport.class; - curMessage->data.symMessage.messageNumber = - (yyvsp[-9].sym)->data.symExport.nextMessage++; - curMessage->data.symMessage.firstParam = (yyvsp[-4].param); - curMessage->data.symMessage.returnType = TDS_CTYPE((yyvsp[-8].tdecl)); - curMessage->data.symMessage.mpd = currentMPD; - /* - * there is not current class, so we don't add the message - * to a list so we can put out the imported messages in an - * enumeration. Nor can we output a define name1 name2 as - * for @alias, because name2 don't exist, because exported - * messages don't get names. - */ - Output("#define %s %d", TDS_IDENT((yyvsp[-8].tdecl)), - curMessage->data.symMessage.messageNumber); - - if (mpddebug) { - Output("\n#define %s_MPD %s", curMessage->name, - GenerateMPDString(curMessage, - MPD_PASS_AND_RETURN)); - } - } - - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 216: - - { - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 217: - - { - if((yyvsp[-3].sym) && (yyvsp[-6].sym)){ /* check the prefix and message */ - - /* - * Enter the identifier as a message and initialize it. - * We must enter it in the global scope so that it - * is accessable anywhere. - */ - curMessage = EnterSymbolInGlobal((yyvsp[-1].string), MSG_SYM, - SYM_DEFINED|SYM_IMPORTED); - - curMessage->data.symMessage.class = (yyvsp[-6].sym)->data.symExport.class; - curMessage->data.symMessage.messageNumber = - (yyvsp[-6].sym)->data.symExport.nextMessage++; - curMessage->data.symMessage.firstParam = - (yyvsp[-3].sym)->data.symMessage.firstParam; - curMessage->data.symMessage.returnType = - (yyvsp[-3].sym)->data.symMessage.returnType; - curMessage->data.symMessage.mpd = (yyvsp[-3].sym)->data.symMessage.mpd; - /* can't do this for reasons discussed above. */ - /* ADD_MESSAGE_LIST_ELEMENT(classBeingParsed,curMessage); */ - - Output("#define %s %d", (yyvsp[-1].string), - curMessage->data.symMessage.messageNumber); - - - - if (mpddebug) { - Output("\n#define %s_MPD %s", curMessage->name, - GenerateMPDString(curMessage, - MPD_PASS_AND_RETURN)); - } - } - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 219: - - { - (yyval.sym) = NullSymbol; yyerror("'%s' is not a message symbol.",(yyvsp[0].string)); - } - - break; - - case 220: - - { - SWITCH_CONTEXT( LC_TYPE_STRING_NO_MATCH_PARENS); - currentMPD = numRegs = 0; - stackParams = forceRegs = forceNoRegs = multipleReturn = FALSE; - } - - break; - - case 221: - - { - SWITCH_CONTEXT( LC_TYPE_STRING_MATCH_PARENS); - currentMessageReturnType = TDS_CTYPE((yyvsp[-1].tdecl)); - } - - break; - - case 222: - - { - /* - * Enter the identifier as a message and initialize it - */ - curMessage = EnterSymbolInGlobal(TDS_IDENT((yyvsp[-5].tdecl)), MSG_SYM, SYM_DEFINED); - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 223: - - { - if (TDS_TYPESUF_IS_NOT_NULL((yyvsp[-8].tdecl))) { - yyerror("messages cannot return arrays (use *)"); - } - if((yyvsp[-11].sym) != NullSymbol){ - if (((yyvsp[-11].sym)->data.symMessage.class != NullSymbol) && - ((yyvsp[-11].sym)->data.symMessage.class != classBeingParsed) && - !((yyvsp[-11].sym)->flags & SYM_IMPORTED)) - { - yywarning("%s is not a message for the class being defined now", - (yyvsp[-11].sym)->name); - } - curMessage->data.symMessage.class = (yyvsp[-11].sym)->data.symMessage.class; - curMessage->data.symMessage.messageNumber = - (yyvsp[-11].sym)->data.symMessage.messageNumber; - curMessage->data.symMessage.firstParam = (yyvsp[-4].param); - curMessage->data.symMessage.returnType = TDS_CTYPE((yyvsp[-8].tdecl)); - curMessage->data.symMessage.mpd = currentMPD; - /* - * We can't output this in an enum, because there is no class, - * as this is just an alias. Luckily though, we know the name - * of the message, and it will be in an enumerated type, so we - * define it be the name of the enumeration. - */ - Output("#define %s %s", TDS_IDENT((yyvsp[-8].tdecl)), (yyvsp[-11].sym)->name); - - if (mpddebug) { - Output("\n#define %s_MPD %s", curMessage->name, - GenerateMPDString(curMessage, MPD_PASS_AND_RETURN)); - } - - } - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 224: - - { - SWITCH_CONTEXT( LC_TYPE_STRING_NO_MATCH_PARENS); - currentMPD = numRegs = 0; - stackParams = forceRegs = forceNoRegs = multipleReturn = FALSE; - } - - break; - - case 225: - - { - SWITCH_CONTEXT( LC_TYPE_STRING_MATCH_PARENS); - currentMessageReturnType = TDS_CTYPE((yyvsp[-1].tdecl)); - } - - break; - - case 226: - - { - /* - * Enter the identifier as a message and initialize it - */ - curMessage = EnterSymbolInGlobal(TDS_IDENT((yyvsp[-5].tdecl)), MSG_SYM, SYM_DEFINED); - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 227: - - { - if (TDS_TYPESUF_IS_NOT_NULL((yyvsp[-8].tdecl))) { - yyerror("messages cannot return arrays (use *)"); - } - curMessage->data.symMessage.class = NullSymbol; - curMessage->data.symMessage.firstParam = (yyvsp[-4].param); - curMessage->data.symMessage.returnType = TDS_CTYPE((yyvsp[-8].tdecl)); - curMessage->data.symMessage.mpd = currentMPD; - if (mpddebug) { - Output("\n#define %s_MPD %s", curMessage->name, - GenerateMPDString(curMessage, MPD_PASS_AND_RETURN)); - } - - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 228: - - { - (yyval.num) = FALSE; - } - - break; - - case 229: - - { - (yyval.num) = TRUE; - } - - break; - - case 230: - - {(yyval.string) = (yyvsp[-1].string);} - - break; - - case 231: - - {(yyval.string) = NULL;} - - break; - - case 232: - - {(yyval.ch) = '{'; } - - break; - - case 233: - - {(yyval.ch) = ';'; } - - break; - - case 235: - - { - (yyval.sym) = NullSymbol; - if (yychar == IDENT) { - yyerror("expecting a class, not the identifier '%s'", - yylval.string); - } else if(yychar > FIRSTSYM && yychar < LASTSYM) { - yyerror("expecting a class, not the symbol '%s'", - yylval.sym->name); - } - } - - break; - - case 236: - - { - if((yyvsp[0].sym)){ - methClass = (yyvsp[0].sym); - Symbol_PushScope((yyvsp[0].sym)->data.symClass.localSymbols); - } - methModel = (yyvsp[-2].num); - methName = (yyvsp[-1].string); - methFirst = NullSymbol; - SWITCH_CONTEXT( LC_PARSE); - - - } - - break; - - case 237: - - { - if((yyvsp[-4].sym) && (yyvsp[-1].meth)){ - GenerateCurRootDefine((yyvsp[-1].meth)); - GenerateMethodDef((yyvsp[-1].meth)); - Output("%c", (yyvsp[0].ch)); /* output the ';' or '{' */ - - if((yyvsp[-7].num) == FALSE || (yyvsp[0].ch) == '{') { /* @method || @extern method{ */ - void OutputMethodAntiWarningCode(Method *meth); - - if((yyvsp[0].ch) == '{'){ - OutputMethodAntiWarningCode((yyvsp[-1].meth)); - }else{ - /* this really isn't bad. we put out the decl, */ - /* but the important thing is that we allow */ - /* people to assign their own method handler */ - /* its even good that we put out the decl, */ - /* because this allows type checking later. */ - - /* yyerror("expect method body, not just a ';'"); */ - } - /* if is @method .... and class not declared... */ - - if((yyvsp[-7].num) == FALSE && !((yyvsp[-4].sym)->flags & SYM_CLASS_DECLARED)){ - yyerror("you attempted to define method '%s' for the undeclared " - "class '%s'",(yyvsp[-1].meth)->name,(yyvsp[-4].sym)->name); - } - } - - curMethod = (yyvsp[-1].meth); - Symbol_PopScope(); - SWITCH_CONTEXT( LC_NONE); - } - } - - break; - - case 240: - - { - Method *meth; - char name[200]; - char *cp; - - if (methClass == NullSymbol){ - (yyval.meth) = NULL; - goto skip_the_methodMessageProduction; - } else if (((yyvsp[0].sym)->data.symMessage.class == NullSymbol) && - ((yyvsp[0].sym)->data.symMessage.messageNumber != 0)) - { - yyerror("%s is a prototype, not a real message", - (yyvsp[0].sym)->name); - (yyval.meth) = NULL; - goto skip_the_methodMessageProduction; - } else if ((yyvsp[0].sym)->data.symMessage.class != NullSymbol) { - if (!CheckRelated(methClass, (yyvsp[0].sym)->data.symMessage.class, - methClass)) - { - yyerror("%s is not a message defined by %s or its ancestors", - (yyvsp[0].sym)->name, methClass->name); - (yyval.meth) = NULL; - goto skip_the_methodMessageProduction; - } - } - - - - /* - * If no method name given then create one - */ - if (methName == NULL) { - strcpy(name, methClass->name); - for (cp = name; *cp != '\0'; cp++) ; - if (!strcmp(cp-5, "Class")) { - cp -= 5; - } - if (!strncmp((yyvsp[0].sym)->name, "MSG_", 4)) { - strcpy(cp, ((yyvsp[0].sym)->name)+4); - } else { - strcpy(cp, (yyvsp[0].sym)->name); - } - methName = String_EnterZT(name); - } - /* - * Allocate a structure for the method and link it into the - * class's linked list of methods - */ - meth = (Method *) zmalloc(sizeof(Method)); - meth->next = methClass->data.symClass.firstMethod; - methClass->data.symClass.firstMethod = meth; - meth->model = methModel; - meth->message = (yyvsp[0].sym); - meth->class = methClass; - - meth->name = methName; - if ((yyvsp[0].sym)->data.symMessage.class == NullSymbol) { - /* - * Relocation message. - */ - if (methClass->flags & SYM_CLASS_HAS_RELOC) { - yyerror("%s already has a relocation method", - methClass->name); - } - if (methClass->flags & SYM_PROCESS_CLASS) { - yyerror("process classes cannot have relocation methods"); - } - meth->htd = MTD_RELOC | (MM_FAR << MTD_MODEL_OFFSET); - methClass->flags |= SYM_CLASS_HAS_RELOC; - } else { - /* - * Set the correct master message bit - */ - meth->class->data.symClass.masterMessages |= - 1 << (meth->message->data.symMessage.messageNumber >> 13); - meth->htd = (meth->model << MTD_MODEL_OFFSET); - if (meth->class->flags & SYM_PROCESS_CLASS) { - meth->htd |= MTD_PROCESS_CLASS; - } - /* - * Mark another method for the class - */ - methClass->data.symClass.methodCount++; - } - - /* - * If this is not the first message given for this handler - * then make sure that it is compatible with the first message - */ - if (methFirst != NullSymbol) { - if ((yyvsp[0].sym)->data.symMessage.mpd != methFirst->data.symMessage.mpd) { - yyerror("method cannot handle incompatible messages"); - } - } else { - methFirst = (yyvsp[0].sym); - } - (yyval.meth) = meth; - skip_the_methodMessageProduction: - // Null semicolom required for watcom - ; - - } - - break; - - case 241: - - { - (yyval.meth) = NULL; - yyerror("'%s' is not a message symbol.",(yyvsp[0].string)); - } - - break; - - case 242: - - { (yyval.num) = MM_FAR; } - - break; - - case 243: - - { (yyval.num) = MM_NEAR; } - - break; - - case 244: - - { (yyval.num) = MM_BASED; } - - break; - - case 245: - - { (yyval.num) = defaultModel; } - - break; - - case 246: - - { defaultModel = MM_FAR; SWITCH_CONTEXT( LC_NONE); } - - break; - - case 247: - - { defaultModel = MM_NEAR; SWITCH_CONTEXT( LC_NONE); } - - break; - - case 248: - - { defaultModel = MM_BASED; SWITCH_CONTEXT( LC_NONE); } - - break; - - case 249: - - { - Output("extern %s %s %s%s;", - compilerOffsetTypeName, - compilerFarKeyword, - (yyvsp[-1].string), - _ar); - (void) EnterSymbolInGlobal((yyvsp[-1].string), OBJECT_SYM, - SYM_DEFINED | SYM_EXTERN); - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 250: - - { - yyerror("%s: cannot make extern, already defined in line %d of '%s'\n", - (yyvsp[-1].sym)->name, (yyvsp[-1].sym)->lineNumber, (yyvsp[-1].sym)->realFileName); - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 251: - - { - Output("extern %s %s %s%s;", - compilerOffsetTypeName, - compilerFarKeyword, - (yyvsp[-1].string), - _ar); - (void) EnterSymbolInGlobal((yyvsp[-1].string), CHUNK_SYM, - SYM_DEFINED | SYM_EXTERN); - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 252: - - { - yyerror("%s: cannot make extern, already defined in line %d of '%s'\n", - (yyvsp[-1].sym)->name, (yyvsp[-1].sym)->lineNumber, (yyvsp[-1].sym)->realFileName); - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 253: - - { - Output("extern %s %s %s%s;", - compilerOffsetTypeName, - compilerFarKeyword, - (yyvsp[-1].string), - _ar); - (void) EnterSymbolInGlobal((yyvsp[-1].string), VIS_MONIKER_CHUNK_SYM, - SYM_DEFINED | SYM_EXTERN); - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 254: - - { - yyerror("%s: cannot make extern, already defined in line %d of '%s'\n", - (yyvsp[-1].sym)->name, (yyvsp[-1].sym)->lineNumber, (yyvsp[-1].sym)->realFileName); - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 255: - - { - Output(" (optr)&%s", (yyvsp[0].sym)->name); - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 256: - - { - Output(" (optr)&%s", (yyvsp[0].sym)->name); - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 257: - - { - Output(" (optr)&%s", (yyvsp[0].sym)->name); - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 258: - - {(yyval.mit) = MIT_SEND;} - - break; - - case 259: - - {(yyval.mit) = MIT_CALL;} - - break; - - case 260: - - {(yyval.mit) = MIT_RECORD;} - - break; - - case 261: - - { - /*XXX very nasty SWITCH_CONTEXT(XX) */ - - SWITCH_CONTEXT( LC_PARSE_OBJ_FLAGS_AND_CAST); - - /* - * This tells the scanner that we'll output the string - * on it's line in the output file, so it doesn't have to - * output newlines if the string spans multiple lines. - * If it did, we'd put in extra newlines, and would ruin - * the linenumber info. - */ - - scannerShouldRealignOutputAndInputAfterLC_STRING = 0; - } - - break; - - case 262: - - { - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 263: - - { - SWITCH_CONTEXT( LC_STRING_RIGHT_PAREN); - } - - break; - - case 264: - - { - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 265: - - { - Symbol *passMsg, *retMsg; - Parse_SetReturnAndPassMessage((yyvsp[-13].mit),(yyvsp[-10].sym), (yyvsp[-6].sym), MSG((yyvsp[-5].sm)),&retMsg,&passMsg); - - if(passMsg != NullSymbol){ /* if no parse error, continue */ - - if (HAS_CHILDREN((yyvsp[-9].od))){ - Output("CObjSendToChildren(oself, "); - } - GenerateComplexPrototype((yyvsp[-13].mit),passMsg,retMsg,(yyvsp[-9].od)); - - Output("CObjMessage)("); - OutputSubst((yyvsp[-2].string), "@", "(optr)&"); - Output("%s 0x%x, %s, (Message) %s, %s)", - (strlen((yyvsp[-2].string))!=0) ? ", " : "", - ((yyvsp[-11].num) | RECORD_FLAG((yyvsp[-13].mit),(yyvsp[-9].od)) | CALL_FLAG((yyvsp[-13].mit))), /* flags */ - DEST((yyvsp[-9].od)), /* dest */ - MSG_OUT((yyvsp[-5].sm)), /* message */ - GenerateComplexMPDString(passMsg,retMsg, /* mpd */ - COMPLEX_PARAM_ENUM((yyvsp[-13].mit),(yyvsp[-9].od)))); - - if (HAS_CHILDREN((yyvsp[-9].od))){ - Output(", %s)", OBJ_CHILDREN((yyvsp[-9].od))); - } - } - SWITCH_CONTEXT( LC_NONE); - scannerShouldRealignOutputAndInputAfterLC_STRING = 1; - } - - break; - - case 266: - - {(yyval.string) = (yyvsp[0].string);} - - break; - - case 267: - - {(yyval.string) = String_EnterZT("");} - - break; - - case 268: - - {(yyval.sym) = (yyvsp[-1].sym);} - - break; - - case 269: - - {(yyval.sym) = NullSymbol;} - - break; - - case 271: - - { (yyval.sym) = NullSymbol; } - - break; - - case 272: - - { - SWITCH_CONTEXT( LC_PARSE_CALLSUPER_OBJ_DEST); - scannerShouldRealignOutputAndInputAfterLC_STRING = 0; - } - - break; - - case 273: - - { - scannerShouldRealignOutputAndInputAfterLC_STRING = 1; - } - - break; - - case 274: - - {(yyval.num) = 1;} - - break; - - case 275: - - {(yyval.num) = 0;} - - break; - - case 276: - - { - MessageParam *pp; - - if((yyvsp[0].num)){ - yywarning("Old syntax. Please use @callsuper()."); - } - - /* - * If we're using Borland's compiler, temporarily disable the - * "Suspected Pointer Conversion" warning here, 'cause it's - * pissing us off. - */ - - if (compiler == COM_BORL) { - Output("\n#pragma warn -sus\n"); - OutputLineNumber(yylineno,curFile->name); - } - - if (curMethod == NullMethod) { - yyerror("no current method"); - } else if (curMethod->htd & MTD_RELOC) { - /* - * This is a relocation method, so we need to call something - * different. - */ - Output("ObjRelocOrUnRelocSuper(oself,&%s,frame)%s", - curMethod->class->name, - (yyvsp[0].num) ? ";" : ""); /*XXX should go away */ - } else { - /* must set up an objDest before calling GeneratePrototype */ - SET_OBJ_DEST(&objDest,"",PROTO_ONE_PARAM,""); - GeneratePrototype(MIT_CALLSUPER, curMethod->message, &objDest); - - Output("CObjCallSuper)("); - for (pp = curMethod->message->data.symMessage.firstParam; - pp != NullParam; pp = pp->next) { - Output("%s, ", pp->name); - } - Output("&%s, oself", curMethod->class->name); - Output(", message, %s)%s", - GenerateMPDString(curMethod->message, - PARAM_ENUM(MIT_CALLSUPER)), - (yyvsp[0].num)?";":""); /* XXX should go away */ - } - - if (compiler == COM_BORL) { - Output("\n#pragma warn .sus\n"); - OutputLineNumber(yylineno,curFile->name); - } - - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 277: - - { - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 278: - - { - SWITCH_CONTEXT( LC_STRING_RIGHT_PAREN); - } - - break; - - case 279: - - { - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 280: - - { - if((yyvsp[-8].sym) && (yyvsp[-5].sym)){ - GeneratePrototype(MIT_CALLSUPER,(yyvsp[-5].sym), (yyvsp[-11].od)); - Output("CObjCallSuper)("); - OutputSubst((yyvsp[-2].string), "@", "(optr)&"); - - Output("%s &%s, %s, (Message) %d, %s)", - (strlen((yyvsp[-2].string))!=0) ? ", " : "", /* separator */ - (yyvsp[-8].sym)->name, /* class */ - DEST((yyvsp[-11].od)), /* dest */ - (yyvsp[-5].sym)->data.symMessage.messageNumber, /* message */ - GenerateMPDString((yyvsp[-5].sym), PARAM_ENUM(MIT_CALLSUPER))); - } - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 281: - - { - (yyval.od) = &objDest; - - if (!strcmp((yyvsp[-1].string), "process")) { - - SET_OBJ_DEST((yyval.od), - "GeodeGetProcessHandle(), 0", - PROTO_TWO_PARAMS,""); - - } else if (!strcmp((yyvsp[-1].string), "self")) { - - SET_OBJ_DEST((yyval.od), "oself",PROTO_ONE_PARAM,""); - - } else if (!strcmp((yyvsp[-1].string), "application")) { - - SET_OBJ_DEST((yyval.od), - "GeodeGetAppObject(0)", - PROTO_ONE_PARAM, - ""); - - } else if (!strcmp((yyvsp[-1].string), "null")) { - - SET_OBJ_DEST((yyval.od), "(optr)0",PROTO_ONE_PARAM,""); - - } else { - Symbol *sym; - /* - * If there is just one parameter and if that parameter is - * an object then we stick a "(optr) &" in front of it. - */ - sym = Symbol_Find((yyvsp[-1].string), TRUE); - if ((sym != NullSymbol) && ((sym->type == OBJECT_SYM) || - (sym->type == CLASS_SYM))) { - sprintf(DEST((yyval.od)), "(optr) &%s", (yyvsp[-1].string)); - } else { - CopySubst(DEST((yyval.od)), (yyvsp[-1].string), "@", "(optr)&"); - } - DEST_TYPE((yyval.od)) = PROTO_ONE_PARAM; - *OBJ_CHILDREN((yyval.od)) ='\0'; - } - - } - - break; - - case 282: - - { - char buf1[1000]; - char buf2[1000]; - - (yyval.od) = &objDest; - - CopySubst(buf1, (yyvsp[-3].string), "@", "(optr)&"); - CopySubst(buf2, (yyvsp[-1].string), "@", "(optr)&"); - - sprintf(DEST((yyval.od)), "%s, %s", buf1, buf2); - DEST_TYPE((yyval.od)) = PROTO_TWO_PARAMS; - *OBJ_CHILDREN((yyval.od)) ='\0'; - } - - break; - - case 283: - - { SWITCH_CONTEXT( LC_STRING_COMMA); } - - break; - - case 284: - - { SWITCH_CONTEXT( LC_STRING_COLON); } - - break; - - case 285: - - { - (yyval.od) = &objDest; - - sprintf(DEST((yyval.od)), - "ObjLinkFindParent(oself, %s, %s)", (yyvsp[-4].string), (yyvsp[-1].string)); - - DEST_TYPE((yyval.od)) = PROTO_ONE_PARAM; - *OBJ_CHILDREN((yyval.od)) ='\0'; - - SWITCH_CONTEXT(LC_PARSE); - - } - - break; - - case 286: - - { SWITCH_CONTEXT( LC_STRING_COMMA); } - - break; - - case 287: - - {SWITCH_CONTEXT( LC_STRING_COLON);} - - break; - - case 288: - - { - (yyval.od) = &objDest; - - sprintf(DEST((yyval.od)), "(optr)0"); - sprintf(OBJ_CHILDREN((yyval.od)), "%s, %s, %s", - (yyvsp[-6].string), (yyvsp[-4].string), (yyvsp[-1].string)); - DEST_TYPE((yyval.od)) = PROTO_ONE_PARAM; - - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 289: - - { - (yyval.sm) = &objMessage; - - MSG((yyval.sm)) = (yyvsp[0].sym); - sprintf(MSG_OUT((yyval.sm)), "%d", (yyvsp[0].sym)->data.symMessage.messageNumber); - } - - break; - - case 290: - - { - SWITCH_CONTEXT( LC_STRING_RIGHT_PAREN); - } - - break; - - case 291: - - { - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 292: - - { - (yyval.sm) = &objMessage; - - MSG((yyval.sm)) = NullSymbol; - strcpy(MSG_OUT((yyval.sm)), (yyvsp[-2].string)); - } - - break; - - case 293: - - { - char *cp; - for(cp = (yyvsp[0].string); *cp; cp++){ - if(islower(*cp)) - break; - } - /* a little hueristic: if the thing is all upper and an ident */ - /* it is probably not kosher */ - if(!*cp){ - yywarning("Perhaps you misspelled your message name %s " - "(or maybe it is a C variable of type Message)", - (yyvsp[0].string)); - } - (yyval.sm) = &objMessage; - MSG((yyval.sm)) = NullSymbol; - strcpy(MSG_OUT((yyval.sm)),(yyvsp[0].string)); - } - - break; - - case 294: - - { (yyval.num) = (yyvsp[-1].num) | (yyvsp[0].num); } - - break; - - case 295: - - { (yyval.num) = 0; } - - break; - - case 296: - - {(yyval.num) = MF_FORCE_QUEUE; } - - break; - - case 297: - - {(yyval.num) = MF_RETURN_ERROR; } - - break; - - case 298: - - {(yyval.num) = MF_CHECK_DUPLICATE; } - - break; - - case 299: - - {(yyval.num) = MF_CHECK_LAST_ONLY; } - - break; - - case 300: - - {(yyval.num) = MF_REPLACE; } - - break; - - case 301: - - {(yyval.num) = MF_INSERT_AT_FRONT; } - - break; - - case 302: - - {(yyval.num) = MF_CAN_DISCARD_IF_DESPERATE; } - - break; - - case 303: - - {(yyval.num) = MF_RECORD; } - - break; - - case 304: - - { - (yyval.sym) = (Symbol *)NULL; - } - - break; - - case 305: - - { - (yyval.sym) = (yyvsp[-1].sym); - } - - break; - - case 306: - - { - SWITCH_CONTEXT( LC_PARSE_NO_LOOKUP); - } - - break; - - case 307: - - { - MsgInvocType mit; - - if ((yyvsp[-2].sym)!= NullSymbol){ /* is this a dispatch call? */ - mit = MIT_DISPATCHCALL; - - if (((yyvsp[-2].sym)->data.symMessage.mpd & MPD_RETURN_TYPE) - == (MRT_MULTIPLE << MPD_RETURN_TYPE_OFFSET)) { - yyerror("cannot cast to message %s, it has multiple" - " return values",(yyvsp[-2].sym)->name); - } - }else{ - mit = MIT_DISPATCH; - } - Output("("); - GenerateReturnType(mit, (yyvsp[-2].sym), FALSE); - Output(")CMessageDispatch(%s, 0x%x, %s)", - (yyvsp[0].string), /* Message handle */ - (yyvsp[-2].sym)?MF_CALL:0, /* flags */ - GenerateMPDString(NullSymbol,PARAM_ENUM(mit))); /* mpd */ - - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 308: - - { - SWITCH_CONTEXT( LC_STRING_RIGHT_PAREN); - (yyval.sym) = NullSymbol; - } - - break; - - case 309: - - { (yyval.sym) = (yyvsp[-1].sym); - SWITCH_CONTEXT( LC_STRING_RIGHT_PAREN); - } - - break; - - case 310: - - {SWITCH_CONTEXT( LC_STRING_RIGHT_PAREN);} - - break; - - case 311: - - { - MsgInvocType mit; - - if ((yyvsp[-3].sym)!= NullSymbol){ /* is this a dispatch call? */ - mit = MIT_DISPATCHCALL; - - if (((yyvsp[-3].sym)->data.symMessage.mpd & MPD_RETURN_TYPE) - == (MRT_MULTIPLE << MPD_RETURN_TYPE_OFFSET)) { - yyerror("cannot cast to message %s, it has multiple" - " return values",(yyvsp[-3].sym)->name); - } - }else{ - mit = MIT_DISPATCH; - } - Output("("); - GenerateReturnType(mit, (yyvsp[-3].sym), FALSE); - Output(")CMessageDispatch(%s, 0x%x, %s)", - (yyvsp[-2].string), /* Message handle */ - (yyvsp[-3].sym)?MF_CALL:0, /* flags */ - GenerateMPDString(NullSymbol,PARAM_ENUM(mit))); /* mpd */ - - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 312: - - { compiler = COM_HIGHC; SWITCH_CONTEXT( LC_NONE); } - - break; - - case 313: - - { compiler = COM_MSC; SWITCH_CONTEXT( LC_NONE); } - - break; - - case 314: - - { - /* - * If we're in the middle of defining a resource, bitch - */ - if (curResource != NullSymbol) { - yyerror("resource %s declared within resource %s", - (yyvsp[0].string), curResource->name); - } - /* - * Enter the identifier as a resource - */ - curResource = Symbol_Enter((yyvsp[0].string), RESOURCE_SYM, SYM_DEFINED); - } - - break; - - case 315: - - { - curResource->flags |= (yyvsp[-1].num); - curResource->data.symResource.nextResource = resourceList; - resourceList = curResource; - - if (curResource->flags & SYM_OBJECT_BLOCK) { - CompilerStartSegment("__HANDLES_", curResource->name); - if(compiler == COM_WATCOM) { - Output("extern %s " - "__based(__segname(\"__HANDLES_%s\")) _%s_Flags%s;", - compilerOffsetTypeName, - curResource->name, - curResource->name, - _ar); - } - else { - Output("extern %s %s _%s_Flags%s;", - compilerOffsetTypeName, - compilerFarKeyword, - curResource->name, - _ar); - } - CompilerEndSegment("__HANDLES_", curResource->name); - } - - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 316: - - { - /* - * If we're in the middle of defining a resource, bitch - */ - if (curResource != NullSymbol) { - yyerror("resource %s declared within resource %s", - (yyvsp[0].sym), curResource->name); - } - curResource = (yyvsp[0].sym); - - } - - break; - - case 317: - - { - if((curResource->flags &(SYM_NOT_DETACHABLE|SYM_OBJECT_BLOCK) )!= (yyvsp[-1].num)){ - yyerror("resource %s declared with different flags\n",curResource->name); - } - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 318: - - { - (yyval.num) = SYM_NOT_DETACHABLE | SYM_OBJECT_BLOCK; - } - - break; - - case 319: - - { - (yyval.num) = 0; - } - - break; - - case 320: - - { - (yyval.num) = SYM_RESOURCE_NOT_LMEM; - } - - break; - - case 321: - - { (yyval.num) = SYM_OBJECT_BLOCK; } - - break; - - case 322: - - { - Scan_WarnForForwardChunk((yyvsp[0].sym)->name); - - if (curResource == NullSymbol) { - yyerror("@resourceOutput must appear within @start, @end"); - } else { - curResource->data.symResource.resourceOutput = (yyvsp[0].sym); - } - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 323: - - { - if (curResource != (yyvsp[0].sym)) { - yyerror("mismatched @start (%s) and @end (%s)", - curResource?curResource->name:"none", (yyvsp[0].sym)->name); - } - - curResource = NullSymbol; - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 324: - - { - SWITCH_CONTEXT( LC_STRING_SEMI_COLON); - } - - break; - - case 325: - - { - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 326: - - { - if (curResource == NullSymbol) { - yyerror("@header outside of resource definition"); - } else { - curResource->data.symResource.header_ctype = (yyvsp[-5].string); - curResource->data.symResource.header_initializer = (yyvsp[-2].string); - } - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 327: - - { - SWITCH_CONTEXT( LC_TYPE_STRING_MATCH_PARENS); - parse_ScanningAChunk = TRUE; - } - - break; - - case 328: - - { - parse_ScanningAChunk = FALSE; - realSymbolLineNumber = yylineno; - SWITCH_CONTEXT( LC_STRING_SEMI_COLON); - } - - break; - - case 329: - - { - Symbol *chunk; - - if (curResource == NullSymbol) { - yyerror("chunk %s outside of any resource", TDS_IDENT((yyvsp[-3].tdecl))); - } else { - chunk = Symbol_EnterWithLineNumber(TDS_IDENT((yyvsp[-3].tdecl)), - CHUNK_SYM, - SYM_DEFINED, - realSymbolLineNumber); -/*XXX check here if(! chunk & SYM_MULTIPLY_DEFINED){ */ - AddChunkToCurResourceAndOutputExtern(chunk); - chunk->data.symChunk.data = (yyvsp[0].string); - chunk->data.symChunk.ctype = TDS_CTYPE((yyvsp[-3].tdecl)); - chunk->data.symChunk.typeSuffix = TDS_TYPESUF((yyvsp[-3].tdecl)); - - if (strcmp(chunk->data.symChunk.typeSuffix, "[]") == 0 && - ((strcmp(chunk->data.symChunk.ctype, "char") == 0) || - (strcmp(chunk->data.symChunk.ctype, "wchar_t") == 0) || - (strcmp(chunk->data.symChunk.ctype, "TCHAR") == 0))) - { - LOC_HINT(CHUNK_LOC(chunk)) = CDT_text; - } else { - LOC_HINT(CHUNK_LOC(chunk)) = CDT_unknown; - } - -/* } */ - } - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 330: - - { - SWITCH_CONTEXT( LC_NONE); - LocalizationCheck(); - } - - break; - - case 331: - - { - SWITCH_CONTEXT( LC_PARSE_NO_LOOKUP); - } - - break; - - case 332: - - { - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 333: - - { - realSymbolLineNumber = yylineno; - } - - break; - - case 334: - - { - SWITCH_CONTEXT( LC_STRING_SEMI_COLON); - } - - break; - - case 335: - - { /* 10 */ - Symbol *chunk; - - if (curResource == NullSymbol) { - yyerror("chunk %s outside of any resource", (yyvsp[-4].string)); - } else { - chunk = Symbol_EnterWithLineNumber((yyvsp[-4].string), CHUNK_SYM, - SYM_DEFINED,realSymbolLineNumber); - AddChunkToCurResourceAndOutputExtern(chunk); - chunk->data.symChunk.data = (yyvsp[0].string); - chunk->data.symChunk.ctype = (yyvsp[-7].string); - chunk->data.symChunk.headerType = caHeaderType; - chunk->data.symChunk.headerData = caHeaderData; - chunk->flags |= (yyvsp[-9].num) | SYM_IS_CHUNK_ARRAY; - LOC_HINT(CHUNK_LOC(chunk)) = CDT_unknown; - } - - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 336: - - { - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 337: - - { SWITCH_CONTEXT( LC_PARSE_NO_LOOKUP); } - - break; - - case 338: - - { - /* - * Record line number of identifier for later entering - */ - (yyval.num) = yylineno; /* $4 */ - } - - break; - - case 339: - - { - /* - * Ask GStrings rule to include open/close curly in the string. - */ - (yyval.num) = TRUE; - } - - break; - - case 340: - - { - Symbol *chunk; - - if (curResource == NullSymbol) { - yyerror("chunk %s outside of any resource", (yyvsp[-4].string)); - } else { - chunk = Symbol_EnterWithLineNumber((yyvsp[-4].string), CHUNK_SYM, SYM_DEFINED, - (yyvsp[-3].num)); - AddChunkToCurResourceAndOutputExtern(chunk); - chunk->data.symChunk.data = (yyvsp[0].string); - chunk->data.symChunk.ctype = "byte"; - chunk->data.symChunk.typeSuffix = "[]"; - LOC_HINT(CHUNK_LOC(chunk)) = CDT_GString; - } - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 341: - - { - SWITCH_CONTEXT( LC_NONE); - LocalizationCheck(); - } - - break; - - case 342: - - { (yyval.num) = 0; } - - break; - - case 343: - - { (yyval.num) = SYM_IS_ELEMENT_ARRAY; } - - break; - - case 344: - - { - SWITCH_CONTEXT( LC_PARSE_NO_LOOKUP); - } - - break; - - case 345: - - { - SWITCH_CONTEXT( LC_STRING_RIGHT_PAREN); - } - - break; - - case 346: - - { - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 347: - - { - caHeaderType = (yyvsp[-6].string); - caHeaderData = (yyvsp[-3].string); - } - - break; - - case 348: - - { - caHeaderType = caHeaderData = String_EnterZT(""); - } - - break; - - case 349: - - { - Symbol *class, *super, *bottomClass; - - (void) EnterSymbolInGlobal((yyvsp[-3].sym)->name, OBJECT_SYM, SYM_DEFINED); - (yyvsp[-3].sym)->flags |= SYM_IS_OBJECT | (yyvsp[-1].num); - curObject = (yyvsp[-3].sym); - (yyvsp[-3].sym)->data.symObject.class = (yyvsp[-4].sym); - if ((yyvsp[-4].sym)){ - Symbol_PushScope((yyvsp[-4].sym)->data.symClass.localSymbols); - } - /* - * Deal with default building of things, going all the way up - * the class tree.. XXX: doesn't handle overriding default super - * more than one level up. - */ - for (class = bottomClass = (yyvsp[-4].sym); class != NullSymbol; class = super) { - super = class->data.symClass.superclass; - if (class->flags & SYM_CLASS_VARIANT) { - /* - * If we have hit a variant class then we need to try to - * find the variant class for it - */ - if (LocateSuperForVariant(bottomClass, curObject, &super)) { - /* - * Push default superclass's locals too - */ - Symbol_PushScope(super->data.symClass.localSymbols); - bottomClass = super; - } else { - break; - } - } - } - } - - break; - - case 350: - - { - if (curResource == NullSymbol) { - yyerror("object %s outside of any resource", (yyvsp[-6].sym)); - } else if (!(curObject->flags & SYM_MULTIPLY_DEFINED)) { - /*Symbol *iptr;*/ - - AddChunkToCurResourceAndOutputExtern((yyvsp[-6].sym)); - - } - curObject = NullSymbol; - SWITCH_CONTEXT( LC_NONE); - if((yyvsp[-7].sym)){ - Symbol_PopScopeTo((yyvsp[-7].sym)->data.symClass.localSymbols); - } - } - - break; - - case 351: - - { (yyval.num) = SYM_IGNORE_DIRTY; } - - break; - - case 352: - - { (yyval.num) = 0; } - - break; - - case 355: - - { - yyerrok; - } - - break; - - case 356: - - { - Scan_Unput('}'); - yyerrok; - } - - break; - - case 357: - - { - if ((yychar == IDENT) || - (yychar > FIRSTSYM && yychar < LASTSYM)) - { - yyerror("%s is not a valid instance variable or vardata element for this object", - (yychar == IDENT) ? (yyvsp[0].string) : (yyvsp[0].sym)->name); - } - } - - break; - - case 358: - - {SWITCH_CONTEXT( LC_STRING_CLOSE_BRACE);} - - break; - - case 359: - - {SWITCH_CONTEXT( LC_PARSE); } - - break; - - case 360: - - {(yyval.string) = (yyvsp[-2].string);} - - break; - - case 361: - - {(yyval.string) = NULL;} - - break; - - case 362: - - { - SWITCH_CONTEXT( LC_STRING_SEMI_COLON); - } - - break; - - case 363: - - { - InstanceValue *inst; - - inst = MakeInstanceValue(curObject); - inst->name = (yyvsp[-3].sym)->name; - inst->value = (yyvsp[0].string); - - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 365: - - { - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 366: - - { - InstanceValue *inst; - Symbol *oldScope; - - SWITCH_CONTEXT( LC_PARSE); - - /* - * XXX: doesn't handle changing variant more than one level up - */ - if (LocateSuperForVariant(curObject->data.symObject.class, - curObject, &oldScope)) { - /* - * Replace the old scope - */ - Symbol_ReplaceScope(oldScope->data.symClass.localSymbols, - (yyvsp[0].sym)->data.symClass.localSymbols); - } else { - Symbol_PushScope((yyvsp[0].sym)->data.symClass.localSymbols); - } - - inst = MakeInstanceValue(curObject); - inst->name = (yyvsp[-3].sym)->name; - inst->value = (yyvsp[0].sym)->name; - - } - - break; - - case 368: - - { - InstanceValue *inst; - - inst = MakeInstanceValue(curObject); - inst->name = (yyvsp[-3].sym)->name; - inst->value = (yyvsp[-1].string); - inst->data.instReg.flags |= INST_ADD_OPTR; - } - - break; - - case 369: - - { - InstanceValue *inst; - - inst = MakeInstanceValue(curObject); - inst->name = (yyvsp[-3].sym)->name; - inst->value = (yyvsp[-1].sym)->name; - inst->data.instReg.flags |= INST_ADD_OPTR; - } - - break; - - case 370: - - { - SWITCH_CONTEXT( LC_STRING_RIGHT_PAREN); - } - - break; - - case 371: - - { - InstanceValue *inst; - - inst = MakeInstanceValue(curObject); - inst->name = (yyvsp[-4].sym)->name; - inst->value = String_EnterZT((yyvsp[0].string)); - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 373: - - { - InstanceValue *inst; - - inst = MakeInstanceValue(curObject); - inst->name = (yyvsp[-3].sym)->name; - inst->value = (yyvsp[-1].string); - } - - break; - - case 374: - - { - InstanceValue *inst; - char buf[200]; - Symbol *chunk; - - if (curResource == NullSymbol) { - yyerror("object %s outside of any resource", curObject); - } else { - sprintf(buf, "_%s_%s", (yyvsp[-3].sym)->name, curObject->name); - chunk = Symbol_Enter(String_EnterZT(buf), - CHUNK_SYM, SYM_DEFINED); - chunk->flags |= SYM_CHUNK_NEEDS_QUOTES; - AddChunkToCurResourceAndOutputExtern(chunk); - chunk->data.symChunk.data = (yyvsp[-1].string); - chunk->data.symChunk.ctype = curStringType; - chunk->data.symChunk.typeSuffix = String_EnterZT("[]"); - LOC_HINT(CHUNK_LOC(chunk)) = CDT_text; - inst = MakeInstanceValue(curObject); - inst->name = (yyvsp[-3].sym)->name; - inst->value = chunk->name; - } - LocalizationCheck(); - } - - break; - - case 375: - - { - InstanceValue *inst; - - inst = MakeInstanceValue(curObject); - inst->name = (yyvsp[-3].sym)->name; - inst->value = (yyvsp[-1].sym)->name; - } - - break; - - case 376: - - { - InstanceValue *inst; - - inst = MakeInstanceValue(curObject); - inst->name = (yyvsp[-3].sym)->name; - inst->value = (yyvsp[-1].sym)->name; - } - - break; - - case 377: - - { - Symbol_PushScope(visMonikerScope); - curVisMonField = (yyvsp[0].sym); - } - - break; - - case 379: - - { - if ((yyvsp[-1].sym)->data.symVardata.ctype != String_EnterZT("void")) { - yyerror("Initializer cannot be given for void vardata %s", - (yyvsp[-1].sym)->name); - } - AddVarData((yyvsp[-1].sym), String_EnterZT(""),NULL); - } - - break; - - case 380: - - { - if ((yyvsp[-2].sym)->data.symVardata.ctype == String_EnterZT("void")) { - yyerror("No initializer given for vardata %s (type %s)", - (yyvsp[-2].sym)->name, (yyvsp[-2].sym)->data.symVardata.ctype); - } - SWITCH_CONTEXT( LC_STRING_SEMI_COLON); - } - - break; - - case 381: - - { - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 382: - - { - AddVarData((yyvsp[-6].sym), (yyvsp[-2].string),(yyvsp[-5].string)); - } - - break; - - case 383: - - { - Symbol *gcnList; - char buf[1000]; - - /* define symbol for this particular gcn list */ - sprintf(buf, "_%s_gcnL_%s_%s", curObject->name, (yyvsp[-5].string), (yyvsp[-3].string)); - gcnList = Symbol_Enter(String_EnterZT(buf), - GCN_LIST_SYM, SYM_DEFINED); - gcnList->flags |= SYM_DEFINED; - gcnList->data.symGCNList.firstItem = (yyvsp[0].sle); - AddChunkToCurResourceAndOutputExtern(gcnList); - - /* create gcn list of lists, if necessary, else, just hook new - gcn list onto end of list of lists */ - if (curObject->data.symObject.gcnListOfLists == NullSymbol) { - Symbol *listOfLists; - Symbol *tempMetaGCNSym; - Symbol *metaClass; - char buf[300]; - - sprintf(buf, "_%s_gcnLOL", curObject->name); - listOfLists = Symbol_Enter(String_EnterZT(buf), - GCN_LIST_OF_LISTS_SYM, SYM_DEFINED); - listOfLists->flags |= SYM_DEFINED; - AddChunkToCurResourceAndOutputExtern(listOfLists); - curObject->data.symObject.gcnListOfLists = listOfLists; - curObject->data.symObject.gcnListOfLists->data.symGCNListOfLists.firstList = gcnList; - - /* new list of lists created, add a piece of var data to point - to the list of lists */ - metaClass = Symbol_Find(String_EnterZT("MetaClass"), - ALL_SCOPES); - if ((metaClass != NullSymbol) && (metaClass->type == CLASS_SYM)) - { - Symbol_PushScope(metaClass->data.symClass.localSymbols); - tempMetaGCNSym = Symbol_Find(String_EnterZT("TEMP_META_GCN"), - LOCAL_SCOPE); - Symbol_PopScope(); - if (tempMetaGCNSym != NullSymbol) { - sprintf(buf, "{{((ChunkHandle)(optr)&_%s_gcnLOL)}, 0}", - curObject->name); - AddVarData(tempMetaGCNSym, String_EnterZT(buf),NULL); - } else { - yyerror("TEMP_META_GCN symbol not found"); - } - } else { - yyerror("MetaClass not defined"); - } - } else { - Symbol **field; - for (field = &(curObject->data.symObject.gcnListOfLists->data.symGCNListOfLists.firstList); - *field != NullSymbol; - field = &((*field)->data.symGCNList.nextList)); - *field = gcnList; - } - gcnList->data.symGCNList.manufID = (yyvsp[-5].string); - gcnList->data.symGCNList.type = (yyvsp[-3].string); - } - - break; - - case 384: - - { - curLastChild = NullInstanceValue; - curLinkPart = (yyvsp[-1].sym)->data.symComposite.linkPart; - } - - break; - - case 385: - - { - if (curLastChild != NullInstanceValue) { - InstanceValue *inst; - - inst = MakeInstanceValue(curObject); - inst->name = (yyvsp[-4].sym)->name; - inst->data.instLink.link = curFirstChild; - curLastChild->data.instLink.isParentLink = TRUE; - curLastChild->data.instLink.link = curObject; - if (curLinkPart->flags & SYM_IS_KBD_PATH) { - curLastChildObj->data.symObject.kbdPathParent = curObject; - } - } - } - - break; - - case 386: - - { - InstanceValue *inst; - - inst = MakeInstanceValue(curObject); - inst->name = (yyvsp[-6].sym)->name; - inst->data.instKbdAccelerator.specificUI = (yyvsp[-3].num); - inst->data.instKbdAccelerator.flags = (yyvsp[-2].num); - inst->data.instKbdAccelerator.key = (yyvsp[-1].num); - curObject->flags |= SYM_HAS_KBD_ACCEL; - (void) Symbol_PopScope(); - } - - break; - - case 387: - - { - InstanceValue *inst; - - inst = MakeInstanceValue(curObject); - inst->name = (yyvsp[-3].sym)->name; - inst->value = (yyvsp[-1].sym)->name; - inst->data.instLink.link = (yyvsp[-1].sym); - inst->data.instLink.isParentLink = TRUE; - } - - break; - - case 389: - - {(yyval.string) = (yyvsp[0].string); curStringType = defStringType;} - - break; - - case 390: - - {(yyval.string) = (yyvsp[0].string); curStringType = asciiStringType;} - - break; - - case 391: - - {(yyval.string) = (yyvsp[0].string); curStringType = defStringType;} - - break; - - case 392: - - {(yyval.string) = (yyvsp[0].string); curStringType = lStringType;} - - break; - - case 393: - - {(yyval.string) = (yyvsp[0].string); curStringType = sjisStringType;} - - break; - - case 394: - - { - localizationRequired = FALSE; - if (chunkToLocalize == NULL) { - yyerror("You have entered no chunk that could need localizing\n"); - } else if(!CHUNK_LOC(chunkToLocalize)){ - yyerror("This chunk (%s) is not localizable\n", - chunkToLocalize->name); - }else{ - LOC_NAME(CHUNK_LOC(chunkToLocalize)) = chunkToLocalize->name; - LOC_INST(CHUNK_LOC(chunkToLocalize)) = (yyvsp[-3].string); - LOC_MIN(CHUNK_LOC(chunkToLocalize))= - LOC_MAX(CHUNK_LOC(chunkToLocalize))= (yyvsp[-2].num); - } - - } - - break; - - case 395: - - { - localizationRequired = FALSE; - if (chunkToLocalize == NULL) { - yyerror("You have entered no chunk that could need localizing\n"); - } else if(!CHUNK_LOC(chunkToLocalize)){ - yyerror("This chunk (%s) is not localizable\n", - chunkToLocalize->name); - }else{ - LOC_NAME(CHUNK_LOC(chunkToLocalize)) = chunkToLocalize->name; - LOC_INST(CHUNK_LOC(chunkToLocalize)) = (yyvsp[-5].string); - LOC_MIN(CHUNK_LOC(chunkToLocalize)) = (yyvsp[-4].num); - LOC_MAX(CHUNK_LOC(chunkToLocalize)) = (yyvsp[-2].num); - if((yyvsp[-4].num) > (yyvsp[-2].num)){ - yyerror("Min size is greater than Max size\n"); - }else if ((yyvsp[-4].num) == (yyvsp[-2].num)){ - yywarning("Min size is equal to Max size."); - yywarning("Perhaps you want a different syntax"); - } - } - } - - break; - - case 396: - - { - localizationRequired = FALSE; - if (chunkToLocalize == NULL) { - yyerror("You have entered no chunk that could need localizing\n"); - } else if(!CHUNK_LOC(chunkToLocalize)){ - yyerror("This chunk (%s) is not localizable\n", - chunkToLocalize->name); - }else{ - LOC_NAME(CHUNK_LOC(chunkToLocalize)) = chunkToLocalize->name; - LOC_INST(CHUNK_LOC(chunkToLocalize)) = ""; - LOC_MIN(CHUNK_LOC(chunkToLocalize)) = -1; - LOC_MAX(CHUNK_LOC(chunkToLocalize)) = -1; - } - } - - break; - - case 397: - - { - localizationRequired = FALSE; - if (chunkToLocalize == NULL) { - yyerror("You have entered no chunk that could need localizing\n"); - } else if(!CHUNK_LOC(chunkToLocalize)){ - yyerror("This chunk (%s) is not localizable\n", - chunkToLocalize->name); - }else{ - LOC_NAME(CHUNK_LOC(chunkToLocalize)) = chunkToLocalize->name; - LOC_INST(CHUNK_LOC(chunkToLocalize)) = (yyvsp[0].string); - LOC_MIN(CHUNK_LOC(chunkToLocalize)) = 0; - LOC_MAX(CHUNK_LOC(chunkToLocalize)) = 0; - } - } - - break; - - case 398: - - {(yyval.string) = (yyvsp[-2].string);} - - break; - - case 399: - - {(yyval.string) = (yyvsp[-1].string);} - - break; - - case 401: - - { - InstanceValue *inst; - - inst = MakeInstanceValue(curObject); - inst->name = curVisMonField->name; - inst->value = (yyvsp[0].sym)->name; - Symbol_PopScope(); - } - - break; - - case 402: - - { - char buf[200]; - - sprintf(buf, "_%s_%s", curVisMonField->name, curObject->name); - curVisMoniker = Symbol_Enter(String_EnterZT(buf), - VIS_MONIKER_CHUNK_SYM, SYM_DEFINED); - - } - - break; - - case 403: - - { - InstanceValue *inst; - - inst = MakeInstanceValue(curObject); - inst->name = curVisMonField->name; - inst->value = curVisMoniker->name; - - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 404: - - { (yyval.sle) = (yyvsp[-1].sle); } - - break; - - case 405: - - { (yyval.sle) = NullSymbolListEntry; } - - break; - - case 406: - - { - SymbolListEntry **sle; - - (yyval.sle) = (yyvsp[-2].sle); - if ((yyval.sle) == NullSymbolListEntry) { - (yyval.sle) = (yyvsp[0].sle); - } else { - for (sle = &((yyval.sle)->next); *sle != NullSymbolListEntry; - sle = &((*sle)->next)); - *sle = (yyvsp[0].sle); - } - } - - break; - - case 408: - - { - Scan_WarnForForwardChunk((yyvsp[0].sym)->name); - (yyval.sle) = (SymbolListEntry *) zmalloc(sizeof(SymbolListEntry)); - (yyval.sle)->entry = (yyvsp[0].sym); - } - - break; - - case 409: - - { - Symbol_PushScope(kbdAcceleratorScope); - } - - break; - - case 410: - - { - (yyval.num) = (yyvsp[0].ch); - if (isupper((yyval.num))) { - (yyval.num) = tolower((yyval.num)); - } - if (isalpha((yyval.num))) { - (yyval.num) = (KEY_ALPHA << 16) | (yyval.num); - } else if (isdigit((yyval.num))) { - (yyval.num) = (KEY_DIGIT << 16) | (yyval.num); - } else if (!(yyval.num)) { - yyerror("keyboard accelerator must be alpha-numeric"); - (yyval.num) = (KEY_ALPHA << 16) | 'a'; - } else { - (yyval.num) = (KEY_PUNCT << 16) | (yyval.num); - } - } - - break; - - case 411: - - { - (yyval.num) = (yyvsp[0].sym)->data.symSpecial.value; - } - - break; - - case 412: - - { (yyval.num) = 1; } - - break; - - case 413: - - { (yyval.num) = specificUI; } - - break; - - case 414: - - { - (yyval.num) = (yyvsp[-1].num) | (yyvsp[0].sym)->data.symSpecial.value; - } - - break; - - case 415: - - { (yyval.num) = 0; } - - break; - - case 420: - - { - InstanceValue *inst; - - Scan_WarnForForwardChunk((yyvsp[0].sym)->name); - - if((yyvsp[0].sym) == curObject){ - yyerror("The parent %s is its own child. This will " - "fail at runtime.",(yyvsp[0].sym)->name); - } - - (yyvsp[0].sym)->flags |= SYM_CANNOT_BE_EXTERN; - if (curLastChild != NullInstanceValue) { - curLastChild->data.instLink.link = (yyvsp[0].sym); - } else { - curFirstChild = (yyvsp[0].sym); - } - inst = MakeInstanceValue((yyvsp[0].sym)); - inst->name = curLinkPart->name; - curLastChild = inst; - curLastChildObj = (yyvsp[0].sym); - } - - break; - - case 422: - - { - Symbol_Enter((yyvsp[-1].sym)->name, VIS_MONIKER_CHUNK_SYM, SYM_DEFINED); - Symbol_PushScope(visMonikerScope); - curVisMoniker = (yyvsp[-1].sym); - } - - break; - - case 423: - - { - SWITCH_CONTEXT( LC_NONE); - } - - break; - - case 426: - - { - curVisMoniker->data.symVisMoniker.vmXSize=0; - curVisMoniker->data.symVisMoniker.vmYSize=0; - curVisMoniker->data.symVisMoniker.vmType.gsSize = DS_STANDARD; - curVisMoniker->data.symVisMoniker.vmType.monikerList = 0; - curVisMoniker->data.symVisMoniker.vmType.gstring = 0; - curVisMoniker->data.symVisMoniker.vmType.aspectRatio = DAR_NORMAL; - curVisMoniker->data.symVisMoniker.vmType.gsColor = DC_GRAY_1; - curVisMoniker->data.symVisMoniker.vmType.style = VMS_TEXT; - haveVMStyle = FALSE; - } - - break; - - case 427: - - { - /* - * Output the moniker - */ - if (curResource == NullSymbol) { - yyerror("vis moniker %s outside of any resource", - curVisMoniker->name); - } else { - AddChunkToCurResourceAndOutputExtern(curVisMoniker); - LocalizationCheck(); - } - Symbol_PopScope(); - } - - break; - - case 428: - - { - Symbol_PopScope(); - } - - break; - - case 429: - - { - /* not localizable, so remove the data */ - REMOVE_LOCALIZATION_DATA(curVisMoniker); - curVisMoniker->flags |= SYM_LIST_MONIKER; - curVisMoniker->data.symVisMoniker.list = (yyvsp[-1].sle); - } - - break; - - case 430: - - { - LOC_HINT(CHUNK_LOC(curVisMoniker)) = CDT_visMoniker; - } - - break; - - case 433: - - { - curVisMoniker->flags |= SYM_GSTRING_MONIKER; - if (!haveVMStyle) { - curVisMoniker->data.symVisMoniker.vmType.style = VMS_ICON; - } - } - - break; - - case 434: - - { - curVisMoniker->flags |= SYM_GSTRING_MONIKER; - if (!haveVMStyle) { - curVisMoniker->data.symVisMoniker.vmType.style = VMS_ICON; - } - } - - break; - - case 435: - - { - curVisMoniker->data.symVisMoniker.navChar = (yyvsp[-2].ch); - curVisMoniker->data.symVisMoniker.navType = NT_CHAR; - curVisMoniker->data.symVisMoniker.vmText = (yyvsp[0].string); - curVisMoniker->data.symVisMoniker.ctype = curStringType; - } - - break; - - case 436: - - { - curVisMoniker->data.symVisMoniker.navConst = (yyvsp[-2].num); - curVisMoniker->data.symVisMoniker.navType = NT_CONST; - curVisMoniker->data.symVisMoniker.vmText = (yyvsp[0].string); - curVisMoniker->data.symVisMoniker.ctype = curStringType; - } - - break; - - case 437: - - { - curVisMoniker->data.symVisMoniker.navString = (yyvsp[-2].string); - curVisMoniker->data.symVisMoniker.navType = NT_STRING; - curVisMoniker->data.symVisMoniker.vmText = (yyvsp[0].string); - curVisMoniker->data.symVisMoniker.ctype = curStringType; - } - - break; - - case 438: - - { - curVisMoniker->data.symVisMoniker.navConst = 0xff; - curVisMoniker->data.symVisMoniker.navType = NT_CONST; - curVisMoniker->data.symVisMoniker.vmText = (yyvsp[0].string); - curVisMoniker->data.symVisMoniker.ctype = curStringType; - } - - break; - - case 441: - - { - /* setup up vis moniker in preparation, in case of error */ - curVisMoniker->data.symVisMoniker.startLine = yylineno; - curVisMoniker->data.symVisMoniker.vmText = ""; - /* - * Don't include open/close curly in the string. - */ - (yyval.num) = FALSE; - } - - break; - - case 442: - - { - curVisMoniker->data.symVisMoniker.vmText = (yyvsp[0].string); - } - - break; - - case 443: - - { - INIT_DYNAMIC_BUFFER(gstringBuf,GS_BUF); - /* - * Add open-curly if calling rule requested it - */ - if ((yyvsp[-1].num)) { - ADD_CHAR_TO_DYNAMIC_BUFFER('{',gstringBuf); - } - SWITCH_CONTEXT( LC_CLOSE_CURLY_OR_STRING); - - } - - break; - - case 444: - - { - SWITCH_CONTEXT( LC_PARSE); - } - - break; - - case 445: - - { - /* - * Add close-curly if calling rule requested it. - */ - if ((yyvsp[-5].num)) { - ADD_CHAR_TO_DYNAMIC_BUFFER('}',gstringBuf); - } - ADD_CHAR_TO_DYNAMIC_BUFFER('\0',gstringBuf); - (yyval.string) = DB_STR(gstringBuf); - } - - break; - - case 448: - - {AddStringToCurrentGstringBuffer((yyvsp[0].string)); } - - break; - - case 449: - - {AddStringCharsToCurrentGstringBuffer((yyvsp[0].string)); } - - break; - - case 450: - - { - yyerror("invalid graphics-string element"); - yyerrok; - } - - break; - - case 451: - - { - curVisMoniker->data.symVisMoniker.vmType.aspectRatio = - (yyvsp[-1].sym)->data.symSpecial.value; - } - - break; - - case 452: - - { - curVisMoniker->data.symVisMoniker.vmType.style = - (yyvsp[-1].sym)->data.symSpecial.value; - haveVMStyle = TRUE; - } - - break; - - case 453: - - { - curVisMoniker->data.symVisMoniker.vmType.gsColor = - (yyvsp[-1].sym)->data.symSpecial.value; - } - - break; - - case 454: - - { - curVisMoniker->data.symVisMoniker.vmType.gsSize = - (yyvsp[-1].sym)->data.symSpecial.value; - } - - break; - - case 455: - - { - curVisMoniker->data.symVisMoniker.vmXSize = (yyvsp[-3].num); - curVisMoniker->data.symVisMoniker.vmYSize = (yyvsp[-1].num); - } - - break; - - case 456: - - { - yyerrok; - } - - break; - - case 457: - - { - Scan_Unput('}'); - yyerrok; - } - - break; - - case 458: - - { - SymbolListEntry **sle; - - (yyval.sle) = (yyvsp[-2].sle); - if ((yyval.sle) == NullSymbolListEntry) { - (yyval.sle) = (yyvsp[0].sle); - } else { - for (sle = &((yyval.sle)->next); *sle != NullSymbolListEntry; - sle = &((*sle)->next)); - *sle = (yyvsp[0].sle); - } - } - - break; - - case 460: - - { - Scan_WarnForForwardChunk((yyvsp[0].sym)->name); - (yyval.sle) = (SymbolListEntry *) zmalloc(sizeof(SymbolListEntry)); - (yyval.sle)->entry = (yyvsp[0].sym); - } - - break; - - case 461: - - { - Scan_Unput(','); - yyerrok; - } - - break; - - case 462: - - { - Scan_Unput('}'); - yyerrok; - } - - break; - - case 463: - - { - yyerror("elements of a visMoniker list must be visMoniker chunk names"); - } - - break; - - case 465: - - { - (yyval.sym) = EnterSymbolInGlobal((yyvsp[0].string), OBJECT_SYM, 0); - AddChunkToUndefinedList((yyval.sym)); - } - - break; - - case 466: - - { - (yyval.sym) = (yyvsp[0].sym); - } - - break; - - case 467: - - { - Symbol *sym; - - sym = EnterSymbolInGlobal((yyvsp[0].string), PROTOMINOR_SYM, 0); - sym->data.symProtoMinor.msgOrVardataSym = NullSymbol; - sym->data.symProtoMinor.references = 0; - (yyval.sym) = sym; - } - - break; - - case 469: - - { - (yyval.sym) = EnterSymbolInGlobal((yyvsp[0].string), VIS_MONIKER_CHUNK_SYM, 0); - AddChunkToUndefinedList((yyval.sym)); - } - - break; - - case 471: - - { - char buf[100]; - sprintf(buf, "%d",(yyvsp[0].num)); - (yyval.string) = String_EnterZT(buf); - } - - break; - - case 472: - - { - char *ctype; - char *id; - char *typesuffix; - - - (yyval.tdecl) = AllocTypeDeclString(); - SplitTypeString((yyvsp[0].string),&ctype,&id,&typesuffix); - - /* make sure the strings are hashed */ - TDS_CTYPE((yyval.tdecl)) = String_EnterZT(ctype); - TDS_IDENT((yyval.tdecl)) = String_EnterZT(id); - TDS_TYPESUF((yyval.tdecl)) = String_EnterZT(typesuffix); - - } - - break; - - - - 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); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++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. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*--------------------------------------. -| 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) - { - ++yynerrs; -#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; - } -# undef YYSYNTAX_ERROR -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#if !defined yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#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); - } - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - return yyresult; -} - - - - -/*********************************************************************** - * CheckRelated - *********************************************************************** - * SYNOPSIS: Make sure a symbol is related to a class. - * CALLED BY: parser for methods, method handlers and instance variables - * RETURN: 0 if the class of the symbol and the current class - * are unrelated. - * SIDE EFFECTS: None - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 11/30/89 Initial Revision - * - ***********************************************************************/ -static int -CheckRelated(Symbol *curClass, /* Currently-active class */ - Symbol *otherClass, /* Class of symbol being - * referenced */ - Symbol *bottomClass) /* Bottom-most class in current - * master level */ -{ - int retval; - - if (curClass == NULL) { - return(FALSE); - } -#define SYM_CLASS_CHECKING SYM_IS_CHUNK_ARRAY /* overload a bit that - * can't possibly be set for - * this symbol */ - - curClass->flags |= SYM_CLASS_CHECKING; - - retval = (curClass == otherClass); - if (!retval) { - Symbol *class; - int i; - - for (i = 0; i < curClass->data.symClass.numUsed; i++) { - class = curClass->data.symClass.used[i]; - - /* - * Check friendly class, assuming it's the bottom-most class in - * its master level, so far as we're concerned. - */ - if (!(class->flags & SYM_CLASS_CHECKING) && - CheckRelated(class, otherClass, class)) - { - retval = TRUE; - break; - } - } - } - - if (!retval) { - Symbol *super; - if (!(curClass->flags & SYM_CLASS_VARIANT) || - !LocateSuperForVariant(bottomClass, NullSymbol, &super)) - { - retval = CheckRelated(curClass->data.symClass.superclass, - otherClass, - (curClass->flags & SYM_CLASS_MASTER ? - curClass->data.symClass.superclass : - bottomClass)); - } else { - retval = CheckRelated(super, otherClass, super); - } - } - - curClass->flags &= ~SYM_CLASS_CHECKING; - - return(retval); -} - -/*********************************************************************** - * - * FUNCTION: AddChunkToCurResourceAndOutputExtern - * - * DESCRIPTION: Add a chunk to the current resource - * - * CALLED BY: yyparse - * - * RETURN: chunk added, line number and file name set - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * tony 3/91 Initial Revision - * - ***********************************************************************/ -void -AddChunkToCurResourceAndOutputExtern(Symbol *chunk) -{ - Symbol **cptr; - - /* - * Remove chunk from undefined list if needed - */ - for (cptr = &undefinedList; *cptr != NullSymbol; - cptr = &((*cptr)->data.symChunk.nextChunk)) { - if (*cptr == chunk) { - *cptr = chunk->data.symChunk.nextChunk; - chunk->data.symChunk.nextChunk = NullSymbol; - break; - } - } - - chunk->data.symChunk.resource = curResource; - curResource->data.symResource.numberOfChunks++; - if(CHUNK_LOC(chunk)){ - LOC_NAME(CHUNK_LOC(chunk))= chunk->name; - } - for (cptr = &(curResource->data.symResource.firstChunk); - *cptr != NullSymbol; - cptr = &((*cptr)->data.symChunk.nextChunk)) ; - *cptr = chunk; - /* - * Output an extern definition for the chunk so that it can - * be referenced - */ - if (curResource != NULL) { - CompilerStartSegment("__HANDLES_", curResource->name); - if(compiler == COM_WATCOM) { - Output("extern %s " - "__based(__segname(\"__HANDLES_%s\")) %s%s;", - compilerOffsetTypeName, - curResource->name, - chunk->name, - _ar); - } - else { - Output("extern %s %s %s%s;", - compilerOffsetTypeName, - compilerFarKeyword, - chunk->name, - _ar); - } - CompilerEndSegment("__HANDLES_", curResource->name); - } - - /* Make sure the previous localizable chunk has the localization - instruction. */ - if ( localizationRequired ){ - Parse_LocalizationWarning("Missing @localize statement"); - localizationRequired = FALSE; /* reset the flag */ - } - chunkToLocalize = chunk; -} - -/*********************************************************************** - * - * FUNCTION: AddChunkToUndefinedList - * - * DESCRIPTION: Add a chunk to the undefined list - * - * CALLED BY: yyparse - * - * RETURN: chunk added - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * tony 3/91 Initial Revision - * - ***********************************************************************/ -void -AddChunkToUndefinedList(Symbol *chunk) -{ - chunk->data.symChunk.nextChunk = undefinedList; - undefinedList = chunk; -} - -/*********************************************************************** - * - * FUNCTION: EnterSymbolInGlobal - * - * DESCRIPTION: Enter a symbol in the global scope - * - * CALLED BY: yyparse - * - * RETURN: symbol entered - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * tony 3/91 Initial Revision - * - ***********************************************************************/ -Symbol * -EnterSymbolInGlobal(char *name, int type, int flags) -{ - Symbol *sym; - - /* - * We always want to enter symbols in the global scope - */ - Symbol_PushScope(globalScope); - sym = Symbol_Enter(name, type, flags); - Symbol_PopScope(); - return(sym); -} - -/*********************************************************************** - * - * FUNCTION: AddRegDefinition - * - * DESCRIPTION: Add a register to a MPD - * - * CALLED BY: yyparse - * - * RETURN: none - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * tony 3/91 Initial Revision - * - ***********************************************************************/ -void -AddRegDefinition(MessagePassRegs reg) -{ - if (numRegs == 3) { - yyerror("only three registers can be used"); - } else if (currentMPD & MPD_STRUCT_AT_SS_BP) { - yyerror("ss:bp cannot be used with any other register"); - } else { - currentMPD |= MPD_REGISTER_PARAMS | (reg << (numRegs*3)); - numRegs++; - } -} - -char * -String_EnterZT(char *s) -{ - return (String_Enter(s, strlen(s))); -} - -/*********************************************************************** - * yyerror - *********************************************************************** - * SYNOPSIS: Print an error message with the current line # - * CALLED BY: yyparse() and others - * RETURN: Nothing - * SIDE EFFECTS: A message be printed - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 8/31/88 Initial Revision - * - ***********************************************************************/ -void -yyerror(const char *fmt, ...) -{ - va_list args; - - va_start(args, fmt); - -#if defined(unix) - fprintf(stderr, "file %s, line %d: ", curFile->name, yylineno); -#else - fprintf(stderr, "Error %s %d: ", curFile->name, yylineno); -#endif - vfprintf(stderr,fmt,args); - putc('\n', stderr); - - yyerrors++; - va_end(args); -} - -/*********************************************************************** - * yywarning - *********************************************************************** - * SYNOPSIS: Print a warning message with the current line # - * CALLED BY: yyparse() and others - * RETURN: Nothing - * SIDE EFFECTS: A message be printed - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 8/31/88 Initial Revision - * - ***********************************************************************/ -void -yywarning(char *fmt, ...) -{ - va_list args; - - va_start(args, fmt); - -#if defined(unix) - fprintf(stderr, "file %s, line %d Warning: ", curFile->name, yylineno); -#else - fprintf(stderr, "Warning %s %d: ", curFile->name, yylineno); -#endif - vfprintf(stderr,fmt,args); - putc('\n', stderr); - va_end(args); -} - - -/*********************************************************************** - * - * FUNCTION: GenerateReturnType - * - * DESCRIPTION: Output a return type for a message invocation - * - * PASS: - * - * msgInvocType: send/record/call/dispatch enum - * message symbol: tells the message-return-type - * Boolean children: tells if is sending to children - * - * CALLED BY: yyparse rules - * - * SYNOPSIS: This puts out a return value for the message invocation. - * - * There are three types of values: - * EventHandle, void, and a message specific value. - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * josh 9/92 Initial Revision - * - ***********************************************************************/ -void -GenerateReturnType(MsgInvocType mit, Symbol *msgSym, Boolean children) -{ - /* - * If its dest is the children, we can't receive return values, - */ - if(HAS_RECORD_FLAG(mit,children)){ - Output("EventHandle"); - if(IS_CALL_TYPE(mit)){ - yyerror("cannot do @call to children (can't get return values)"); - } - if((mit == MIT_RECORD) && children){ - yyerror("can't record message sent to children"); - } - }else if(IS_CALL_TYPE(mit)){ - assert(msgSym); - Output("%s _pascal ", msgSym->data.symMessage.returnType); - }else{ - Output("void"); - } -} - -/*********************************************************************** - * - * FUNCTION: GeneratePrototype - * - * DESCRIPTION: Generate a prototype for a message call - * - * PASS: MsgInvocType -- type of invocation: either send,record, - * call or callsuper. - * Symbol *msg -- message symbol telling how to pass/return params - * (overridden for @children, @record) - * ObjDest *od -- objDest value parsed for this invocation. - * - * CALLED BY: yyparse - * - * RETURN: void - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * josh 9/92 revamp for sdk release - * tony 3/91 Initial Revision - * - ***********************************************************************/ -void -GeneratePrototype(MsgInvocType mit, Symbol *msg, ObjDest *od) -{ - GenerateComplexPrototype(mit,msg,msg,od); -} - - - - -/*********************************************************************** - * - * FUNCTION: GenerateComplexPrototype - * - * DESCRIPTION: Generate a prototype for a message call - * this is used for @send/@call/@record/@callsuper - * - * PASS: MsgInvocType -- type of invocation: either send,record, - * call or callsuper. - * Symbol *passMsg -- message symbol telling how to pass params - * (overridden for @children, @record) - * Symbol *retMsg -- message symbol telling how to return params - * - * ObjDest *od -- objDest value parsed for this invocation. - * - * CALLED BY: yyparse - * - * SYNOPSIS: output in order: - * return type, - * params, - * flags (or "ClassStruct *" for callsuper), - * dest, - * Message, - * mpd - * - * WARNING: Don't call this for @dispatch[call]; they have fixed - * parameter lists. - * - * - * RETURN: none - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * josh 9/92 revamp for sdk release - * tony 3/91 Initial Revision - * - ***********************************************************************/ -void -GenerateComplexPrototype(MsgInvocType mit,/* record/call/send/callsuper */ - Symbol *passMsg, /* msg symbol being sent. */ - Symbol *retMsg, /* msg symbol being sent. */ - ObjDest *od) /* objDest for this invocation */ - -{ - MessageParam *pp; - - Output("(("); - GenerateReturnType(mit,retMsg,HAS_CHILDREN(od)); - Output(" _pascal (*)("); - /* pump out the params for the msg */ - - assert(passMsg != NullSymbol); - for (pp = passMsg->data.symMessage.firstParam; - pp != NullParam; pp = pp->next) { - Output("%s%s,", pp->ctype,pp->typeSuffix); - } - - if (mit != MIT_CALLSUPER){ - Output("word,"); /* XXX */ - } else { - Output("ClassStruct *,"); /* XXX */ - } - - if (DEST_TYPE(od) == PROTO_ONE_PARAM) { - Output("optr,"); /* XXX */ - } else { - assert(DEST_TYPE(od) == PROTO_TWO_PARAMS); - Output("MemHandle, ChunkHandle,"); - } - - Output("Message,word))"); -} - -/*********************************************************************** - * - * FUNCTION: GenerateMethodDef - * - * DESCRIPTION: Generate a method definition - * - * CALLED BY: yyparse - * - * PASS: meth: method do dump out, - * - * RETURN: none - * - * note: this thing will output something like: - * char * fooBAR(fooInstance *pself, optr oself, Message message, int a) - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * tony 3/91 Initial Revision - * - ***********************************************************************/ -void -GenerateMethodDef(Method *meth) -{ - MessageParam *pp; - - /* - * We want to prevent any "oself unused in function" (sic) warnings, - * and we can't do it in Borlnd any later than this, due to oddities - * unique to that compiler. - */ - if (issueArgsUsedPragma && (compiler == COM_BORL)) { - Output("#pragma argsused\n"); - OutputLineNumber(yylineno,curFile->name); - } - - /* - * Output start of definition (stuff before parameters) and generate - * the name of the instance structure (if any) - */ - Output("%s _pascal %s(", meth->message->data.symMessage.returnType, - meth->name); - if (!(meth->class->flags & SYM_PROCESS_CLASS)) { - /* - * Output parameters based on memory model - */ - switch (meth->model) { - case MM_FAR: - Output("%sInstance *pself, ", - meth->class->data.symClass.root); - break; - case MM_NEAR: - Output("%sInstance _near *pself, ", - meth->class->data.symClass.root); - break; - case MM_BASED: - Output("_segment sself, %sInstance _based(sself) *pself, ", - meth->class->data.symClass.root); - break; - } - } - if (meth->message->data.symMessage.class) { - Output("optr oself, %sMessages message", - meth->message->data.symMessage.class->data.symClass.root); - } else { - /* relocation method, so message enum unknown */ - Output("optr oself, word message"); - } - - for (pp = meth->message->data.symMessage.firstParam; pp != NullParam; - pp = pp->next) { - Output(", %s %s%s", pp->ctype, pp->name,pp->typeSuffix); - } - Output(")"); -} - -/*********************************************************************** - * - * FUNCTION: GenerateCurRootDefine - * - * DESCRIPTION: Generate a #define for the current class of the method. - * - * CALLED BY: yyparse - * - * PASS: meth: method do dump out, - * - * RETURN: none - * - * note: this thing will output something like: - * #ifdef __CURROOT - * #undef __CURROOT - * #define __CURROOT foo (for fooClass) - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ron 10/95 Initial Revision - * - ***********************************************************************/ -void -GenerateCurRootDefine(Method *meth) -{ - /* - * Undefine the symbol to get rid of warnings. - * This probably should be moved to the end of the output for this - * method. - */ - Output("#ifdef __CURROOT\n#undef __CURROOT\n#endif\n"); - - if (!(meth->class->flags & SYM_PROCESS_CLASS)) { - /* - * Output parameters based on memory model - */ - Output("#define __CURROOT %s\n", - meth->class->data.symClass.root); - } - OutputLineNumber(yylineno, curFile->name); -} - - -/*********************************************************************** - * - * FUNCTION: GenerateMPDString - * - * DESCRIPTION: Generate the string for an MPD value - * - * PASS: Symbol *message, - * MsgParamPassEnum, telling whether is dispatch/record/default - * - * CALLED BY: msg rules - * - * RETURN: void - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * josh 9/92 revamp for SDK release - * tony 3/91 Initial Revision - * - ***********************************************************************/ -char * -GenerateMPDString(Symbol *msg, MsgParamPassEnum paramSpec) -{ - return GenerateComplexMPDString(msg,msg,paramSpec); -} - - -/*********************************************************************** - * - * FUNCTION: GenerateComplexMPDString - * - * DESCRIPTION: Generate the string for an MPD value - * - * PASS: Symbol *passMsg, (how to pass values ) - * Symbol *retMsg, (how to return values) - * MsgParamPassEnum, telling whether is dispatch/record/default - * - * CALLED BY: msg rules - * - * RETURN: void - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * josh 9/92 revamp for SDK release - * tony 3/91 Initial Revision - * - ***********************************************************************/ - -char * GenerateComplexMPDString(Symbol *passMsg,Symbol *retMsg, - MsgParamPassEnum paramSpec) -{ - char buf[400]; /* XXX this is just a band-aid and needs to be dynamic */ - char *cp; - int mpd; - - if(paramSpec != MPD_RETURN_ONLY && /* only if not a dispatch */ - paramSpec != MPD_PASS_VOID_RETURN_VOID){ - mpd = passMsg->data.symMessage.mpd & MPD_PASS; - }else { - mpd = 0; /* the mpd is in the EventHandle */ - } - - switch(paramSpec) { - /* XXX */ - /* dx:ax is the fastest case, so we make these two return this way */ - /* returning void takes longer than returning dx:ax, so this is */ - /* the way to do it. */ - - case MPD_PASS_ONLY_RETURN_EVENT_HANDLE: /* @record */ - case MPD_PASS_ONLY_RETURN_VOID: -#if defined OLD_STYLE_DEFAULT_RETURN_TYPE - mpd |= (MRT_BYTE_OR_WORD<data.symMessage.mpd & MPD_RETURN; - break; - - default: - assert(0); - } - - sprintf(buf, "0x%x", mpd); - for (cp = buf; *cp != '\0'; cp++); - if ((passMsg == NullSymbol) || (mpd & MPD_REGISTER_PARAMS)) { - /* - * If register params (or we don't know the msg, @dispatch perhaps?) - * then the number is all of it. - */ - } else { - MessageParam *mp; - /* - * Skip the first parameter if MRT_MULTIPLE - */ - mp = passMsg->data.symMessage.firstParam; - if ((mp != NullParam) && (mpd & MPD_RETURN_TYPE) == - (MRT_MULTIPLE << MPD_RETURN_TYPE_OFFSET)) { - mp = mp->next; - } - if (mpd & MPD_STRUCT_AT_SS_BP) { - char *sp, *xp; - char structName[1000]; - - /* - * Get the structure name into a local - */ - for (xp = structName, sp = mp->ctype; - ((*sp != ' ') && (*sp != '\0')); - sp++) { - *xp++ = *sp; - } - *xp = '\0'; - /* - * structure at ss:bp -> the parameter is something like: - * FooStruct *foo - * We need to get: - * "+ (sizeof(FooStruct) < 126 ? sizeof(FooStruct) : 126)" - */ - for (; *cp != '\0'; cp++); /* Go to the end */ -#if 1 - sprintf(cp, "+(sizeof(%s)<126?sizeof(%s):126)", - structName, structName); -#else - sprintf(cp, "+(sizeof(%s)&127)", structName); -#endif - } else { - /* - * C params -- we must add the size of the parameters to the MPD - * definition, and we must round the size of each parameter up - * to a word - */ - sprintf(cp, "+((0"); - for (; *cp != '\0'; cp++); - while (mp != NullParam) { - /* if the param is an array, add in the size of a ptr */ - /* else, the size of the parameter */ - if(strchr(mp->typeSuffix,'[')){ - strcpy(cp, "+sizeof(void *)/2"); - }else{ - sprintf(cp, "+(sizeof(%s%s)+1)/2", mp->ctype, - mp->typeSuffix); - } - for (; *cp != '\0'; cp++); - mp = mp->next; - } - sprintf(cp, ")*2)"); - for (; *cp != '\0'; cp++); - } - } - return (String_EnterZT(buf)); -} - - -Symbol * -MakeInstanceVar(int type, char *name, char *ctype) -{ - Symbol *inst; - - inst = Symbol_Enter(name, type, SYM_DEFINED); - inst->data.symRegInstance.ctype = ctype; - inst->data.symRegInstance.typeSuffix = String_EnterZT(""); - return(inst); -} - -InstanceValue * -MakeInstanceValue(Symbol *object) -{ - InstanceValue *inst; - - inst = (InstanceValue *) zmalloc(sizeof(InstanceValue)); - inst->next = object->data.symObject.firstInstance; - object->data.symObject.firstInstance = inst; - return(inst); -} - -void -AddReloc(Symbol *tag, /* Vardata containing the relocatable data */ - int type, /* Type of data (RT_?PTR) */ - char *text, /* Name of instance variable/field within vardata - * extra data holding relocatable data */ - int count, /* Number of elements that make up the data */ - char *structName) /* Field within instance/vardata holding the - * relocatable data */ -{ - Reloc *rel; - - if (classBeingParsed == NullSymbol) { - yyerror("@reloc outside class declaration"); - } else { - for (rel = classBeingParsed->data.symClass.relocList; - rel != NULL; - rel = rel->next) - { - if ((rel->tag == tag) && !strcmp(rel->text, text)) { - yyerror("relocation for %s already entered", text); - return; - } - } - rel = (Reloc *) zmalloc(sizeof(Reloc)); - rel->text = text; - rel->type = type; - rel->tag = tag; - rel->count = count; - rel->structName = structName; - rel->next = classBeingParsed->data.symClass.relocList; - classBeingParsed->data.symClass.relocList = rel; - if (tag != NullSymbol) { - classBeingParsed->flags |= SYM_CLASS_HAS_VD_RELOC; - tag->flags |= SYM_VARDATA_HAS_RELOC; - } else { - classBeingParsed->flags |= SYM_CLASS_HAS_INST_RELOC; - } - } -} - -void -NoReloc(Symbol *instance) /* Name of instance variable/field within vardata - * extra data holding relocatable data */ -{ - Reloc *rel; - Reloc *prev; - - if (classBeingParsed == NullSymbol) { - yyerror("@noreloc outside class declaration"); - } else { - for (prev = NULL, rel = classBeingParsed->data.symClass.relocList; - rel != NULL; - rel = rel->next) - { - if (!strcmp(rel->text, instance->name)) { - /* - * We've found the relocation... nuke it. - */ - if (prev == NULL) { - classBeingParsed->data.symClass.relocList = rel->next; - } else { - prev->next = rel->next; - } - - /* - * Free the relocation - */ - free(rel); - } - } - } -} - -/*********************************************************************** - * AddVarData - *********************************************************************** - * SYNOPSIS: Add a vardata element to this object. - * Add the element at the END of the list, so that - * the if/else/endif hints can be used. - * CALLED BY: - * RETURN: - * SIDE EFFECTS: - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * CB 4/22/93 added header - * - ***********************************************************************/ -void -AddVarData(Symbol *vdSym, char *value,char *arraySize) -{ - VardataValue *vd, *lastPtr; - - vd = (VardataValue *) zmalloc(sizeof(VardataValue)); - - lastPtr = curObject->data.symObject.vardata; - if (lastPtr == NULL) { - curObject->data.symObject.vardata = vd; - } else { - while ( lastPtr->next != NULL ) { - lastPtr = lastPtr->next; - } - lastPtr->next = vd; - } - - vd->type = vdSym; - vd->value = value; - vd->arraySize = arraySize; /* hack for hints that take arrays */ - if (vdSym->flags & SYM_VARDATA_HAS_RELOC) { - curObject->flags |= SYM_OBJECT_HAS_VD_RELOC; - } -} - -/*********************************************************************** - * - * FUNCTION: OutputInstanceData - * - * DESCRIPTION: Output the instance data for a class - * - * CALLED BY: endcLine - * - * RETURN: none - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * tony 3/91 Initial Revision - * - ***********************************************************************/ -void -OutputInstanceData(Symbol *class) -{ - Symbol *iptr; - - char *previousSymbolFileName = NULL; /* set to illegal */ - int previousSymLineNumber = 0; - - - if (!(class->flags & SYM_CLASS_MASTER) && - (class->data.symClass.superclass != NullSymbol)) { - OutputInstanceData(class->data.symClass.superclass); - } - for (iptr = class->data.symClass.instanceData; - iptr != NullSymbol; - iptr = iptr->data.symRegInstance.next) { - - if(previousSymbolFileName == iptr->fileName){ - OutputLineDirectiveOrNewlinesForFile(iptr->lineNumber - - previousSymLineNumber, - iptr->fileName, - iptr->lineNumber); - } else { - OutputLineNumberForSym(iptr); - } - Output(" %s %s%s;", iptr->data.symRegInstance.ctype, - iptr->name,iptr->data.symRegInstance.typeSuffix); - - previousSymLineNumber = iptr->lineNumber; - previousSymbolFileName = iptr->fileName; - } -} - - - - - -/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - AddStringCharsToCurrentGstringBuffer -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -SYNOPSIS: format a string's contents as chars into the current gstring buffer - prefacing it with its length. - e.g. "\\\"foo" --> '\', '"', 'f', 'o', 'o' - -CALLED BY: rule for parsing gstring body - -PASS: (char *) to formate into buffer - -RETURN: void - -DESTROYED: the buffer might get realloced. - -KNOWN BUGS/SIDE EFFECTS/IDEAS: - uses global vars to keep track of the size of the buffer. - -REVISION HISTORY: - Name Date Description - ---- ---- ----------- - JP 5/29/92 Initial version. - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -static void -AddStringCharsToCurrentGstringBuffer(char *st) -{ - char translationShort[] = ",'X'"; /* short substitution */ - char translationLong[] = ",'\\X'"; /* make enough space for biggest xlat */ - char *translation; - char lengthBuf[10]; - int length; - - /* put out the length first. no trailing comma required as the - * translation strings (above) lead off with one */ - - length = strlen(st); - sprintf(lengthBuf,"%d,%d",length&0xff, (length&0xff00)>>8); - AddStringToCurrentGstringBuffer(lengthBuf); - - - /* - * all escaped chars go out directly. - * XXX: DOESN'T DEAL WITH \206 - */ - - for(;*st;st++){ - int tlen; - - switch(*st){ - case '\0': - return; - case '\\': /* note: this handles "\'" properly */ - st++; - /*FALLTHRU*/ - case '\'': /* if "'", need to make it '\'' */ - translation = translationLong; - tlen = sizeof(translationLong); - break; - - default: - translation = translationShort; - tlen = sizeof(translationShort); - break; - } - /* tlen-1 gets to the null byte, -2 skips over the ending single- - * quote and points to the X in the translation strings. */ - - translation[tlen-1-2] = *st; - AddStringToCurrentGstringBuffer(translation); - } -} - - - -/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - AddStringToCurrentGstringBuffer -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -SYNOPSIS: add a string the the current resource's gstring buffer. - -CALLED BY: rule for parsing gstrings - -PASS: (char *) to copy to buffer - -RETURN: void - -DESTROYED: the buffer might get realloced. - -REVISION HISTORY: - Name Date Description - ---- ---- ----------- - JP 5/29/92 Initial version. - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ - - -static void AddStringToCurrentGstringBuffer(char *ptr) -{ - ADD_STRING_TO_DYNAMIC_BUFFER(ptr,gstringBuf); -} - - - - -/*********************************************************************** - * ParseStackOverflow - *********************************************************************** - * SYNOPSIS: Enlarge the parser's internal stacks. - * CALLED BY: yyparse() - * RETURN: Nothing. *maxDepth left unaltered if we don't want to - * allow the increase. yyerror is called with msg if so. - * SIDE EFFECTS: - * - * STRATEGY: This implementation relies on the "errcheck" rule - * freeing stacks up, if necessary. Sadly, there's no - * opportunity to do this, so it be a core leak... - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * ardeb 8/31/88 Initial Revision - * - ***********************************************************************/ -#if 0 -static void -ParseStackOverflow(char *msg, /* Message if we decide not to */ - short **state, /* Current state stack */ - size_t stateSize, /* Current state stack size */ - void **vals, /* Current value stack */ - size_t valsSize, /* Current value stack size */ - int *maxDepth) /* Current maximum stack depth of - * all stacks */ -{ - *maxDepth *= 2; - - if (malloc_size(*state) != NULL) { - /* - * we've been called before. Just use realloc() - */ - *state = (short *)realloc_tagged((char *)*state, stateSize * 2); - *vals = (YYSTYPE *)realloc_tagged((char *)*vals, valsSize * 2); - } else { - short *newstate; - YYSTYPE *newvals; - - newstate = (short *)malloc_tagged(stateSize * 2, - TAG_PARSER_STACK); - newvals = (YYSTYPE *)malloc_tagged(valsSize * 2, - TAG_PARSER_STACK); - - bcopy(*state, newstate, stateSize); - bcopy(*vals, newvals, valsSize); - - *state = newstate; - *vals = newvals; - } -} - -#endif - -/*********************************************************************** - * ErrCheck - *********************************************************************** - * SYNOPSIS: Simple routine to help a programmer who forgets a - * semi-colon or close-brace out by detecting if the input - * for something whose structure is unknown to GOC, but - * which is ended by one of the above, extends over an - * unusually large number of lines. - * CALLED BY: - * RETURN: - * SIDE EFFECTS: - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * JP 10/26/92 Initial Revision - * - ***********************************************************************/ -int parse_TokenStart; /* the scanner kindly remembers where its */ -int parse_TokenEnd; /* LC_STRING_XXX token starts/ends */ -static void -ErrCheck (void) -{ - switch(oldContext){ - case LC_STRING_SEMI_COLON: - case LC_STRING_COMMA: - case LC_STRING_RIGHT_PAREN: - case LC_STRING_COLON: - case LC_STRING_CLOSE_BRACE: - yywarning(": did you really mean to end the expression beginning " - "on line %d on line %d?\n", - parse_TokenStart, - parse_TokenEnd); - default: - break; - } -} - - -/*********************************************************************** - * LocalizationCheck - *********************************************************************** - * SYNOPSIS: Determine if current chunk needs localization instruction. - * CALLED BY: - * RETURN: nothing - * SIDE EFFECTS: - * localizationRequired may be changed. - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * clee 1/29/97 Initial Revision - * - ***********************************************************************/ -static void -LocalizationCheck (void) -{ - /* Set the flag if this is a localizable chunk. */ - if (localizationWarning && - (chunkToLocalize != NULL) && - (CHUNK_LOC(chunkToLocalize) != NULL) && - (LOC_HINT(CHUNK_LOC(chunkToLocalize)) != CDT_unknown)){ - localizationRequired = TRUE; - } -} /* End of LocalizationCheck. */ - - -/*********************************************************************** - * Parse_LocalizationWarning - *********************************************************************** - * SYNOPSIS: Issue the localization warning. - * CALLED BY: - * RETURN: nothing - * SIDE EFFECTS: nothing - * - * STRATEGY: - * - * REVISION HISTORY: - * Name Date Description - * ---- ---- ----------- - * clee 1/30/97 Initial Revision - * - ***********************************************************************/ -void -Parse_LocalizationWarning (char *fmt, ...) -{ - va_list args; - - va_start(args, fmt); - -#if defined(unix) - fprintf(stderr, "file %s, line %d: Warning: ", - chunkToLocalize->fileName, chunkToLocalize->lineNumber); -#else - fprintf(stderr, "Warning %s %d: ", - chunkToLocalize->fileName, chunkToLocalize->lineNumber); -#endif - vfprintf(stderr,fmt,args); - putc('\n', stderr); - va_end(args); -} /* End of LocalizationWarning. */ - -/* - * Local Variables: - * yacc-action-column: 8 - * yacc-rule-column: 8 - * end: - */ diff --git a/Tools/goc/parse.h b/Tools/goc/parse.h deleted file mode 100644 index 67ea77324..000000000 --- a/Tools/goc/parse.h +++ /dev/null @@ -1,226 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.0.4. */ - -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015 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. - - 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 . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - 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. */ - -#ifndef YY_YY_PARSE_H_INCLUDED -# define YY_YY_PARSE_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int yydebug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - CLASS = 258, - META = 259, - MASTER = 260, - VARIANT = 261, - ENDC = 262, - CLASSDECL = 263, - NEVER_SAVED = 264, - MESSAGE = 265, - STACK = 266, - CARRY = 267, - AX = 268, - CX = 269, - DX = 270, - BP = 271, - AL = 272, - AH = 273, - CL = 274, - CH = 275, - DL = 276, - DH = 277, - BPL = 278, - BPH = 279, - SS = 280, - AXBPCXDX = 281, - AXCXDXBP = 282, - CXDXBPAX = 283, - DXCX = 284, - BPAXDXCX = 285, - MULTIPLEAX = 286, - ALIAS = 287, - PROTOTYPE = 288, - RESERVE_MESSAGES = 289, - EXPORT_MESSAGES = 290, - IMPORT_MESSAGE = 291, - SET_MESSAGE_NUM = 292, - INSTANCE = 293, - COMPOSITE = 294, - LINK = 295, - VIS_MONIKER = 296, - KBD_ACCELERATOR = 297, - DEFAULT = 298, - RELOC = 299, - FPTR = 300, - HPTR = 301, - OPTR = 302, - DEFAULT_MODEL = 303, - METHOD = 304, - FAR = 305, - NEAR = 306, - BASED = 307, - CALL = 308, - CALL_SUPER = 309, - SEND = 310, - RECORD = 311, - DISPATCH = 312, - DISPATCHCALL = 313, - FORCE_QUEUE = 314, - RETURN_ERROR = 315, - CHECK_DUPLICATE = 316, - NO_FREE = 317, - CHECK_LAST_ONLY = 318, - REPLACE = 319, - INSERT_AT_FRONT = 320, - CAN_DISCARD_IF_DESPARATE = 321, - NULL_TOKEN = 322, - PARENT = 323, - CHILDREN = 324, - LOCALIZE = 325, - COMPILER = 326, - HIGHC = 327, - MSC = 328, - START = 329, - DATA = 330, - NOT_LMEM = 331, - NOT_DETACHABLE = 332, - END = 333, - HEADER = 334, - CHUNK = 335, - CHUNK_ARRAY = 336, - ELEMENT_ARRAY = 337, - OBJECT = 338, - SPECIFIC_UI = 339, - KBD_PATH = 340, - RESOURCE_OUTPUT = 341, - VARDATA = 342, - VARDATA_ALIAS = 343, - IGNORE_DIRTY = 344, - DEFLIB = 345, - ENDLIB = 346, - EXTERN = 347, - GCN_LIST = 348, - PROTOMINOR = 349, - PROTORESET = 350, - OPTIMIZE = 351, - NORELOC = 352, - USES = 353, - NOT = 354, - FIRSTSYM = 355, - CLASS_SYM = 356, - OBJECT_SYM = 357, - MSG_SYM = 358, - EXPORT_SYM = 359, - RESOURCE_SYM = 360, - CHUNK_SYM = 361, - VIS_MONIKER_CHUNK_SYM = 362, - VARDATA_SYM = 363, - PROTOMINOR_SYM = 364, - REG_INSTANCE_SYM = 365, - COMPOSITE_SYM = 366, - LINK_SYM = 367, - VIS_MONIKER_SYM = 368, - VARIANT_PTR_SYM = 369, - KBD_ACCELERATOR_SYM = 370, - OPTR_SYM = 371, - CHUNK_INST_SYM = 372, - LIST_SYM = 373, - GSTRING_SYM = 374, - ATTRIBUTES_SYM = 375, - COLOR_SYM = 376, - SIZE_SYM = 377, - ASPECT_RATIO_SYM = 378, - CACHED_SIZE_SYM = 379, - SIZE_COMP_SYM = 380, - COLOR_COMP_SYM = 381, - ASPECT_RATIO_COMP_SYM = 382, - STYLE_SYM = 383, - STYLE_COMP_SYM = 384, - KBD_SYM = 385, - KBD_MODIFIER_SYM = 386, - GCN_LIST_SYM = 387, - GCN_LIST_OF_LISTS_SYM = 388, - LASTSYM = 389, - SPECIAL_DEBUG_TOKEN = 390, - SPECIAL_UNDEBUG_TOKEN = 391, - IDENT = 392, - STRING = 393, - FAKESTRING = 394, - ASCIISTRING = 395, - LSTRING = 396, - SJISSTRING = 397, - TSTRING = 398, - CHAR = 399, - CONST = 400 - }; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED - -union YYSTYPE -{ - - - char *string; - char ch; - int num; - Symbol *sym; - Method *meth; - MessageParam *param; - SymbolListEntry *sle; - TypeDeclString *tdecl; - ObjDest *od; - SentMessage *sm; - MsgInvocType mit; - - -}; - -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - -extern YYSTYPE yylval; - -int yyparse (void); - -#endif /* !YY_YY_PARSE_H_INCLUDED */ diff --git a/Tools/goc/parse.output b/Tools/goc/parse.output deleted file mode 100644 index 7b9fa4b92..000000000 --- a/Tools/goc/parse.output +++ /dev/null @@ -1,7885 +0,0 @@ -Terminals unused in grammar - - NULL_TOKEN - FIRSTSYM - ATTRIBUTES_SYM - GCN_LIST_SYM - GCN_LIST_OF_LISTS_SYM - LASTSYM - - -Grammar - - 0 $accept: file $end - - 1 $@1: %empty - - 2 file: $@1 lines - - 3 lines: lines line - 4 | %empty - - 5 line: classLine - 6 | endcLine - 7 | instanceLine - 8 | norelocLine - 9 | defaultLine - 10 | relocLine - 11 | classdeclLine - 12 | messageLine - 13 | aliasLine - 14 | prototypeLine - 15 | reserveMessagesLine - 16 | exportMessagesLine - 17 | importMessageLine - 18 | setMessageLine - 19 | methodLine - 20 | defaultModelLine - 21 | objectDerefLine - 22 | externLine - 23 | sendOrCallOrRecordLine - 24 | callsuperLine - 25 | dispatchOrDispatchCallLine - 26 | newDispatchOrDispatchCallLine - 27 | compilerLine - 28 | startLine - 29 | endLine - 30 | headerLine - 31 | chunkLine - 32 | objectLine - 33 | visMonikerLine - 34 | LocalizationLine - 35 | vardataLine - 36 | vardataAliasLine - 37 | protoMinorLine - 38 | protoResetLine - 39 | deflibLine - 40 | endlibLine - 41 | resourceOutputLine - 42 | SPECIFIC_UI - 43 | error - 44 | SPECIAL_DEBUG_TOKEN - 45 | SPECIAL_UNDEBUG_TOKEN - 46 | optimizeline - 47 | usesLine - - 48 optimizeline: OPTIMIZE - - 49 norelocLine: NORELOC OPTR_SYM ';' - - 50 usesLine: USES usesClassList ';' - 51 | USES error ';' - - 52 usesClassList: CLASS_SYM - 53 | usesClassList ',' CLASS_SYM - - 54 deflibLine: DEFLIB IDENT - - 55 endlibLine: ENDLIB - - 56 semiColonOrError: ';' - 57 | error - - 58 commaOrNothing: ',' - 59 | %empty - - 60 $@2: %empty - - 61 classLine: CLASS IDENT commaOrNothing superClass $@2 classFlags semiColonOrError - - 62 superClass: CLASS_SYM - 63 | META - 64 | IDENT - - 65 classFlags: ',' MASTER ',' VARIANT - 66 | ',' VARIANT ',' MASTER - 67 | ',' MASTER - 68 | %empty - - 69 endcLine: ENDC - - 70 $@3: %empty - - 71 instanceLine: INSTANCE $@3 instanceLineType ';' - - 72 $@4: %empty - - 73 instanceLineType: COMPOSITE $@4 IDENT '=' LINK_SYM - - 74 $@5: %empty - - 75 instanceLineType: LINK $@5 kbdPathOrNull IDENT - - 76 $@6: %empty - - 77 instanceLineType: VIS_MONIKER $@6 IDENT - - 78 $@7: %empty - - 79 instanceLineType: KBD_ACCELERATOR $@7 IDENT - - 80 $@8: %empty - - 81 instanceLineType: typeDeclString $@8 instanceDefault - - 82 kbdPathOrNull: KBD_PATH - 83 | %empty - - 84 $@9: %empty - - 85 instanceDefault: '=' $@9 FAKESTRING - 86 | %empty - - 87 $@10: %empty - - 88 $@11: %empty - - 89 vardataLine: VARDATA $@10 typeDeclString $@11 ';' - - 90 vardataSymOrError: VARDATA_SYM - 91 | vardataClass VARDATA_SYM - 92 | vardataClass IDENT - 93 | vardataClass error - 94 | IDENT - - 95 $@12: %empty - - 96 vardataClass: CLASS_SYM $@12 ':' ':' - - 97 $@13: %empty - - 98 $@14: %empty - - 99 vardataAliasLine: VARDATA_ALIAS '(' vardataSymOrError ')' $@13 IDENT $@14 IDENT - - 100 protoMinorLine: PROTOMINOR protoMinorSym - - 101 protoResetLine: PROTORESET - - 102 $@15: %empty - - 103 $@16: %empty - - 104 defaultLine: DEFAULT defaultableSym '=' $@15 FAKESTRING $@16 ';' - - 105 defaultableSym: REG_INSTANCE_SYM - 106 | OPTR_SYM - 107 | VARIANT_PTR_SYM - 108 | IDENT - - 109 $@17: %empty - - 110 $@18: %empty - - 111 relocLine: RELOC $@17 FAKESTRING $@18 ',' relocTail - - 112 relocTail: relocCount relocType - - 113 $@19: %empty - - 114 relocTail: FAKESTRING $@19 ',' relocCount relocType - - 115 $@20: %empty - - 116 $@21: %empty - - 117 relocCount: '(' CONST ',' $@20 FAKESTRING $@21 ')' - 118 | %empty - - 119 relocType: FPTR - 120 | HPTR - 121 | OPTR - - 122 $@22: %empty - - 123 classdeclLine: CLASSDECL CLASS_SYM $@22 classDeclFlags semiColonOrError - 124 | CLASSDECL IDENT classDeclFlags semiColonOrError - - 125 classDeclFlags: ',' NEVER_SAVED - 126 | %empty - - 127 $@23: %empty - - 128 messageLine: MESSAGE $@23 messageFinish - - 129 $@24: %empty - - 130 $@25: %empty - - 131 messageFinish: typeDeclString '(' $@24 stackFlag messageParamListOrNull ')' $@25 messageReturn ';' - - 132 $@26: %empty - - 133 messageFinish: '(' $@26 MSG_SYM ')' IDENT ';' - - 134 messageParamListOrNull: messageParamList - 135 | %empty - - 136 @27: %empty - - 137 messageParamList: messageParamList ',' @27 messageParam - 138 | messageParam - - 139 stackFlag: STACK - 140 | %empty - - 141 $@28: %empty - - 142 messageParam: typeDeclString $@28 eqParamRegs - - 143 eqParamRegs: '=' paramRegs - 144 | %empty - - 145 paramRegs: CL - 146 | CH - 147 | DL - 148 | DH - 149 | CX - 150 | DX - 151 | BP - 152 | wordParamReg ':' wordParamReg - 153 | wordParamReg '.' wordParamReg - 154 | SS ':' BP - 155 | multipleParamReg - 156 | IDENT - - 157 wordParamReg: CX - 158 | DX - 159 | BP - - 160 multipleParamReg: AXBPCXDX - 161 | AXCXDXBP - 162 | CXDXBPAX - 163 | DXCX - 164 | BPAXDXCX - 165 | MULTIPLEAX - - 166 messageReturn: '=' returnReg - 167 | %empty - - 168 returnReg: AX - 169 | CX - 170 | DX - 171 | BP - 172 | AL - 173 | AH - 174 | CL - 175 | CH - 176 | DL - 177 | DH - 178 | BPL - 179 | BPH - 180 | wordReturnReg ':' wordReturnReg - 181 | wordReturnReg '.' wordReturnReg - 182 | CARRY - 183 | IDENT - - 184 wordReturnReg: AX - 185 | CX - 186 | DX - 187 | BP - - 188 $@29: %empty - - 189 reserveMessagesLine: RESERVE_MESSAGES $@29 reserveNum semiColonOrError - 190 | RESERVE_MESSAGES exportSymOrError ',' reserveNum semiColonOrError - - 191 reserveNum: CONST - 192 | %empty - - 193 $@30: %empty - - 194 setMessageLine: SET_MESSAGE_NUM $@30 setMessageNum semiColonOrError - 195 | SET_MESSAGE_NUM exportSymOrError ',' setMessageNum semiColonOrError - - 196 setMessageNum: numExpr - 197 | %empty - - 198 numExpr: numExpr '+' primary - 199 | numExpr '-' primary - 200 | primary - - 201 primary: '(' numExpr ')' - 202 | '-' primary - 203 | CONST - 204 | MSG_SYM - - 205 $@31: %empty - - 206 exportMessagesLine: EXPORT_MESSAGES IDENT $@31 exportNum semiColonOrError - - 207 exportNum: ',' CONST - 208 | %empty - - 209 exportSymOrError: EXPORT_SYM - 210 | IDENT - - 211 importMessagePrefix: IMPORT_MESSAGE exportSymOrError ',' - - 212 $@32: %empty - - 213 $@33: %empty - - 214 importMessageLine: importMessagePrefix typeDeclString '(' $@32 stackFlag messageParamListOrNull ')' $@33 messageReturn ';' - - 215 $@34: %empty - - 216 importMessageLine: importMessagePrefix '(' $@34 messageSymOrIdentErr ')' IDENT ';' - - 217 messageSymOrIdentErr: MSG_SYM - 218 | IDENT - - 219 $@35: %empty - - 220 $@36: %empty - - 221 $@37: %empty - - 222 aliasLine: ALIAS '(' messageSymOrIdentErr ')' $@35 typeDeclString '(' $@36 stackFlag messageParamListOrNull ')' $@37 messageReturn ';' - - 223 $@38: %empty - - 224 $@39: %empty - - 225 $@40: %empty - - 226 prototypeLine: PROTOTYPE $@38 typeDeclString '(' $@39 stackFlag messageParamListOrNull ')' $@40 messageReturn ';' - - 227 externMethodOrMethod: METHOD - 228 | EXTERN METHOD - - 229 identCommaOrNothing: IDENT ',' - 230 | %empty - - 231 openCurlyOrSemiColon: '{' - 232 | ';' - - 233 classOrError: CLASS_SYM - 234 | error - - 235 $@41: %empty - - 236 methodLine: externMethodOrMethod methodModel identCommaOrNothing classOrError $@41 ',' methodMessageList openCurlyOrSemiColon - - 237 methodMessageList: methodMessageList ',' methodMessage - 238 | methodMessage - - 239 methodMessage: MSG_SYM - 240 | IDENT - - 241 methodModel: FAR - 242 | NEAR - 243 | BASED - 244 | %empty - - 245 defaultModelLine: DEFAULT_MODEL FAR - 246 | DEFAULT_MODEL NEAR - 247 | DEFAULT_MODEL BASED - - 248 externLine: EXTERN OBJECT IDENT semiColonOrError - 249 | EXTERN OBJECT OBJECT_SYM semiColonOrError - 250 | EXTERN CHUNK IDENT semiColonOrError - 251 | EXTERN CHUNK CHUNK_SYM semiColonOrError - 252 | EXTERN VIS_MONIKER IDENT semiColonOrError - 253 | EXTERN VIS_MONIKER VIS_MONIKER_CHUNK_SYM semiColonOrError - - 254 objectDerefLine: OBJECT_SYM - 255 | CHUNK_SYM - 256 | VIS_MONIKER_CHUNK_SYM - - 257 sendOrCallOrRecord: SEND - 258 | CALL - 259 | RECORD - - 260 $@42: %empty - - 261 $@43: %empty - - 262 $@44: %empty - - 263 $@45: %empty - - 264 sendOrCallOrRecordLine: sendOrCallOrRecord $@42 ObjFlagListOrNull optCastWithNoBraces objDest $@43 ':' optCastMessage objMessage '(' $@44 FakeStringOrNothing $@45 ')' - - 265 FakeStringOrNothing: FAKESTRING - 266 | %empty - - 267 optCastMessage: '{' optCastWithNoBraces '}' - 268 | %empty - - 269 optCastWithNoBraces: MSG_SYM - 270 | %empty - - 271 $@46: %empty - - 272 callsuperLine: CALL_SUPER $@46 callsuperStuff - - 273 semiOrParens: ';' - 274 | '(' ')' - - 275 callsuperStuff: semiOrParens - - 276 $@47: %empty - - 277 $@48: %empty - - 278 $@49: %empty - - 279 callsuperStuff: objDest $@47 ':' classOrError ':' ':' messageSymOrIdentErr '(' $@48 FakeStringOrNothing $@49 ')' - - 280 objDest: FAKESTRING ':' - 281 | FAKESTRING ',' FAKESTRING ':' - - 282 $@50: %empty - - 283 $@51: %empty - - 284 objDest: PARENT $@50 FAKESTRING ',' $@51 FAKESTRING ':' - - 285 $@52: %empty - - 286 $@53: %empty - - 287 objDest: CHILDREN $@52 FAKESTRING ',' FAKESTRING ',' $@53 FAKESTRING ':' - - 288 objMessage: MSG_SYM - - 289 $@54: %empty - - 290 $@55: %empty - - 291 objMessage: '(' $@54 FAKESTRING $@55 ')' - 292 | IDENT - - 293 ObjFlagListOrNull: ObjFlagListOrNull objFlag - 294 | %empty - - 295 objFlag: FORCE_QUEUE - 296 | RETURN_ERROR - 297 | CHECK_DUPLICATE - 298 | CHECK_LAST_ONLY - 299 | REPLACE - 300 | INSERT_AT_FRONT - 301 | CAN_DISCARD_IF_DESPARATE - 302 | NO_FREE - - 303 dispatchOrDispatchCall: DISPATCH - 304 | DISPATCHCALL '(' MSG_SYM ')' - - 305 $@56: %empty - - 306 dispatchOrDispatchCallLine: dispatchOrDispatchCall $@56 IDENT - - 307 newDispatchOrDispatchCall: DISPATCH '(' - 308 | DISPATCHCALL '(' '(' MSG_SYM ')' - - 309 $@57: %empty - - 310 newDispatchOrDispatchCallLine: newDispatchOrDispatchCall FAKESTRING $@57 ')' - - 311 compilerLine: COMPILER HIGHC - 312 | COMPILER MSC - - 313 $@58: %empty - - 314 startLine: START IDENT $@58 startFlags semiColonOrError - - 315 $@59: %empty - - 316 startLine: START RESOURCE_SYM $@59 startFlags semiColonOrError - - 317 startFlags: ',' NOT_DETACHABLE - 318 | ',' DATA - 319 | ',' NOT_LMEM - 320 | %empty - - 321 resourceOutputLine: RESOURCE_OUTPUT '=' objectOrIdent - - 322 endLine: END RESOURCE_SYM - - 323 $@60: %empty - - 324 $@61: %empty - - 325 headerLine: HEADER IDENT '=' $@60 FAKESTRING $@61 ';' - - 326 $@62: %empty - - 327 $@63: %empty - - 328 $@64: %empty - - 329 chunkLine: CHUNK $@62 typeDeclString '=' $@63 FAKESTRING $@64 ';' - - 330 $@65: %empty - - 331 $@66: %empty - - 332 $@67: %empty - - 333 $@68: %empty - - 334 $@69: %empty - - 335 chunkLine: cArrayType $@65 IDENT $@66 caHeader IDENT $@67 '=' $@68 FAKESTRING $@69 ';' - - 336 $@70: %empty - - 337 @71: %empty - - 338 @72: %empty - - 339 $@73: %empty - - 340 chunkLine: GSTRING_SYM $@70 IDENT @71 '=' @72 GStrings $@73 ';' - - 341 cArrayType: CHUNK_ARRAY - 342 | ELEMENT_ARRAY - - 343 $@74: %empty - - 344 $@75: %empty - - 345 $@76: %empty - - 346 caHeader: '(' $@74 IDENT '(' $@75 FAKESTRING $@76 ')' ')' - 347 | %empty - - 348 $@77: %empty - - 349 objectLine: OBJECT classOrError objectOrIdent '=' ignoreDirtyFlag '{' $@77 objectFieldList '}' - - 350 ignoreDirtyFlag: IGNORE_DIRTY - 351 | %empty - - 352 objectFieldList: objectFieldList objectField - 353 | %empty - 354 | objectFieldList fieldError ';' - 355 | objectFieldList fieldError '}' - - 356 fieldError: error - - 357 $@78: %empty - - 358 $@79: %empty - - 359 optionalArraySize: '[' $@78 FAKESTRING $@79 ']' - 360 | %empty - - 361 $@80: %empty - - 362 $@81: %empty - - 363 objectField: REG_INSTANCE_SYM '=' $@80 FAKESTRING $@81 ';' - - 364 $@82: %empty - - 365 $@83: %empty - - 366 objectField: VARIANT_PTR_SYM '=' $@82 CLASS_SYM $@83 ';' - 367 | OPTR_SYM '=' IDENT ';' - 368 | OPTR_SYM '=' OBJECT_SYM ';' - - 369 $@84: %empty - - 370 $@85: %empty - - 371 objectField: OPTR_SYM '=' '(' $@84 FAKESTRING $@85 ')' ';' - 372 | CHUNK_INST_SYM '=' IDENT ';' - 373 | CHUNK_INST_SYM '=' someString ';' - 374 | CHUNK_INST_SYM '=' CHUNK_SYM ';' - 375 | CHUNK_INST_SYM '=' OBJECT_SYM ';' - - 376 $@86: %empty - - 377 objectField: VIS_MONIKER_SYM $@86 visMonikerFieldFinish optSemiColon - 378 | VARDATA_SYM ';' - - 379 $@87: %empty - - 380 $@88: %empty - - 381 objectField: VARDATA_SYM optionalArraySize '=' $@87 FAKESTRING $@88 ';' - 382 | GCN_LIST '(' identOrConst ',' identOrConst ')' '=' aleArrayN - - 383 $@89: %empty - - 384 objectField: COMPOSITE_SYM '=' $@89 childList ';' - 385 | KBD_ACCELERATOR_SYM kbdAcceleratorStart '=' specificUIOrNothing kbdAccelModList kbdAccelChar ';' - 386 | LINK_SYM '=' objectOrIdent ';' - 387 | LocalizationLine - - 388 someString: STRING - 389 | ASCIISTRING - 390 | TSTRING - 391 | LSTRING - 392 | SJISSTRING - - 393 LocalizationLine: LOCALIZE '{' STRING CONST '}' ';' - 394 | LOCALIZE '{' STRING CONST '-' CONST '}' ';' - 395 | LOCALIZE NOT ';' - 396 | simpleLocalization - - 397 simpleLocalization: LOCALIZE '{' STRING '}' ';' - 398 | LOCALIZE STRING ';' - - 399 visMonikerFieldFinish: %empty - 400 | '=' VIS_MONIKER_CHUNK_SYM - - 401 $@90: %empty - - 402 visMonikerFieldFinish: '=' $@90 visMonikerDef - - 403 aleArrayN: aleArray ';' - 404 | ';' - - 405 aleArray: aleArray ',' aleArrayElement - 406 | aleArrayElement - - 407 aleArrayElement: objectOrIdent - - 408 kbdAcceleratorStart: %empty - - 409 kbdAccelChar: CHAR - 410 | KBD_SYM - - 411 specificUIOrNothing: SPECIFIC_UI - 412 | %empty - - 413 kbdAccelModList: kbdAccelModList KBD_MODIFIER_SYM - 414 | %empty - - 415 childList: childListNN - 416 | %empty - - 417 childListNN: childListNN ',' childNN - 418 | childNN - - 419 childNN: objectOrIdent - 420 | error - - 421 $@91: %empty - - 422 visMonikerLine: VIS_MONIKER visMonikerOrIdent '=' $@91 visMonikerDef - - 423 optSemiColon: ';' - 424 | %empty - - 425 $@92: %empty - - 426 visMonikerDef: $@92 vmMiddle - 427 | error - - 428 vmMiddle: LIST_SYM '{' vmArray '}' - 429 | vmMiddleNonList - - 430 vmMiddleNonList: vmNavChar ';' - 431 | '{' vmList vmNavChar ';' '}' - 432 | GSTRING_SYM vmGStrings - 433 | '{' vmList GSTRING_SYM vmGStrings '}' - - 434 vmNavChar: CHAR ',' someString - 435 | CONST ',' someString - 436 | STRING ',' someString - 437 | someString - - 438 vmList: vmList vmElement - 439 | %empty - - 440 @93: %empty - - 441 vmGStrings: @93 GStrings - - 442 $@94: %empty - - 443 $@95: %empty - - 444 GStrings: '{' $@94 gstringBodyElementList $@95 '}' - - 445 gstringBodyElementList: gstringBodyElementList gstringBodyElement - 446 | %empty - - 447 gstringBodyElement: FAKESTRING - 448 | STRING - 449 | error - - 450 vmElement: ASPECT_RATIO_SYM '=' ASPECT_RATIO_COMP_SYM ';' - 451 | STYLE_SYM '=' STYLE_COMP_SYM ';' - 452 | COLOR_SYM '=' COLOR_COMP_SYM ';' - 453 | SIZE_SYM '=' SIZE_COMP_SYM ';' - 454 | CACHED_SIZE_SYM '=' CONST ',' CONST ';' - 455 | error ';' - 456 | error '}' - - 457 vmArray: vmArray ',' vmArrayElement - 458 | vmArrayElement - - 459 vmArrayElement: visMonikerOrIdent - 460 | vmArrayError ',' - 461 | vmArrayError '}' - - 462 vmArrayError: error - - 463 objectOrIdent: OBJECT_SYM - 464 | IDENT - - 465 protoMinorSym: PROTOMINOR_SYM - 466 | IDENT - - 467 visMonikerOrIdent: VIS_MONIKER_CHUNK_SYM - 468 | IDENT - - 469 identOrConst: IDENT - 470 | CONST - - 471 typeDeclString: STRING - - -Terminals, with rules where they appear - -$end (0) 0 -'(' (40) 99 117 131 133 201 214 216 222 226 264 274 279 291 304 307 - 308 346 371 382 -')' (41) 99 117 131 133 201 214 216 222 226 264 274 279 291 304 308 - 310 346 371 382 -'+' (43) 198 -',' (44) 53 58 65 66 67 111 114 117 125 137 190 195 207 211 229 236 - 237 281 284 287 317 318 319 382 405 417 434 435 436 454 457 460 -'-' (45) 199 202 394 -'.' (46) 153 181 -':' (58) 96 152 154 180 264 279 280 281 284 287 -';' (59) 49 50 51 56 71 89 104 131 133 214 216 222 226 232 273 325 - 329 335 340 354 363 366 367 368 371 372 373 374 375 378 381 384 - 385 386 393 394 395 397 398 403 404 423 430 431 450 451 452 453 - 454 455 -'=' (61) 73 85 104 143 166 321 325 329 335 340 349 363 366 367 368 - 371 372 373 374 375 381 382 384 385 386 400 402 422 450 451 452 - 453 454 -'[' (91) 359 -']' (93) 359 -'{' (123) 231 267 349 393 394 397 428 431 433 444 -'}' (125) 267 349 355 393 394 397 428 431 433 444 456 461 -error (256) 43 51 57 93 234 356 420 427 449 455 456 462 -CLASS (258) 61 -META (259) 63 -MASTER (260) 65 66 67 -VARIANT (261) 65 66 -ENDC (262) 69 -CLASSDECL (263) 123 124 -NEVER_SAVED (264) 125 -MESSAGE (265) 128 -STACK (266) 139 -CARRY (267) 182 -AX (268) 168 184 -CX (269) 149 157 169 185 -DX (270) 150 158 170 186 -BP (271) 151 154 159 171 187 -AL (272) 172 -AH (273) 173 -CL (274) 145 174 -CH (275) 146 175 -DL (276) 147 176 -DH (277) 148 177 -BPL (278) 178 -BPH (279) 179 -SS (280) 154 -AXBPCXDX (281) 160 -AXCXDXBP (282) 161 -CXDXBPAX (283) 162 -DXCX (284) 163 -BPAXDXCX (285) 164 -MULTIPLEAX (286) 165 -ALIAS (287) 222 -PROTOTYPE (288) 226 -RESERVE_MESSAGES (289) 189 190 -EXPORT_MESSAGES (290) 206 -IMPORT_MESSAGE (291) 211 -SET_MESSAGE_NUM (292) 194 195 -INSTANCE (293) 71 -COMPOSITE (294) 73 -LINK (295) 75 -VIS_MONIKER (296) 77 252 253 422 -KBD_ACCELERATOR (297) 79 -DEFAULT (298) 104 -RELOC (299) 111 -FPTR (300) 119 -HPTR (301) 120 -OPTR (302) 121 -DEFAULT_MODEL (303) 245 246 247 -METHOD (304) 227 228 -FAR (305) 241 245 -NEAR (306) 242 246 -BASED (307) 243 247 -CALL (308) 258 -CALL_SUPER (309) 272 -SEND (310) 257 -RECORD (311) 259 -DISPATCH (312) 303 307 -DISPATCHCALL (313) 304 308 -FORCE_QUEUE (314) 295 -RETURN_ERROR (315) 296 -CHECK_DUPLICATE (316) 297 -NO_FREE (317) 302 -CHECK_LAST_ONLY (318) 298 -REPLACE (319) 299 -INSERT_AT_FRONT (320) 300 -CAN_DISCARD_IF_DESPARATE (321) 301 -NULL_TOKEN (322) -PARENT (323) 284 -CHILDREN (324) 287 -LOCALIZE (325) 393 394 395 397 398 -COMPILER (326) 311 312 -HIGHC (327) 311 -MSC (328) 312 -START (329) 314 316 -DATA (330) 318 -NOT_LMEM (331) 319 -NOT_DETACHABLE (332) 317 -END (333) 322 -HEADER (334) 325 -CHUNK (335) 250 251 329 -CHUNK_ARRAY (336) 341 -ELEMENT_ARRAY (337) 342 -OBJECT (338) 248 249 349 -SPECIFIC_UI (339) 42 411 -KBD_PATH (340) 82 -RESOURCE_OUTPUT (341) 321 -VARDATA (342) 89 -VARDATA_ALIAS (343) 99 -IGNORE_DIRTY (344) 350 -DEFLIB (345) 54 -ENDLIB (346) 55 -EXTERN (347) 228 248 249 250 251 252 253 -GCN_LIST (348) 382 -PROTOMINOR (349) 100 -PROTORESET (350) 101 -OPTIMIZE (351) 48 -NORELOC (352) 49 -USES (353) 50 51 -NOT (354) 395 -FIRSTSYM (355) -CLASS_SYM (356) 52 53 62 96 123 233 366 -OBJECT_SYM (357) 249 254 368 375 463 -MSG_SYM (358) 133 204 217 239 269 288 304 308 -EXPORT_SYM (359) 209 -RESOURCE_SYM (360) 316 322 -CHUNK_SYM (361) 251 255 374 -VIS_MONIKER_CHUNK_SYM (362) 253 256 400 467 -VARDATA_SYM (363) 90 91 378 381 -PROTOMINOR_SYM (364) 465 -REG_INSTANCE_SYM (365) 105 363 -COMPOSITE_SYM (366) 384 -LINK_SYM (367) 73 386 -VIS_MONIKER_SYM (368) 377 -VARIANT_PTR_SYM (369) 107 366 -KBD_ACCELERATOR_SYM (370) 385 -OPTR_SYM (371) 49 106 367 368 371 -CHUNK_INST_SYM (372) 372 373 374 375 -LIST_SYM (373) 428 -GSTRING_SYM (374) 340 432 433 -ATTRIBUTES_SYM (375) -COLOR_SYM (376) 452 -SIZE_SYM (377) 453 -ASPECT_RATIO_SYM (378) 450 -CACHED_SIZE_SYM (379) 454 -SIZE_COMP_SYM (380) 453 -COLOR_COMP_SYM (381) 452 -ASPECT_RATIO_COMP_SYM (382) 450 -STYLE_SYM (383) 451 -STYLE_COMP_SYM (384) 451 -KBD_SYM (385) 410 -KBD_MODIFIER_SYM (386) 413 -GCN_LIST_SYM (387) -GCN_LIST_OF_LISTS_SYM (388) -LASTSYM (389) -SPECIAL_DEBUG_TOKEN (390) 44 -SPECIAL_UNDEBUG_TOKEN (391) 45 -IDENT (392) 54 61 64 73 75 77 79 92 94 99 108 124 133 156 183 206 210 - 216 218 229 240 248 250 252 292 306 314 325 335 340 346 367 372 - 464 466 468 469 -STRING (393) 388 393 394 397 398 436 448 471 -FAKESTRING (394) 85 104 111 114 117 265 280 281 284 287 291 310 325 - 329 335 346 359 363 371 381 447 -ASCIISTRING (395) 389 -LSTRING (396) 391 -SJISSTRING (397) 392 -TSTRING (398) 390 -CHAR (399) 409 434 -CONST (400) 117 191 203 207 393 394 435 454 470 - - -Nonterminals, with rules where they appear - -$accept (159) - on left: 0 -file (160) - on left: 2, on right: 0 -$@1 (161) - on left: 1, on right: 2 -lines (162) - on left: 3 4, on right: 2 3 -line (163) - on left: 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 - 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 - 46 47, on right: 3 -optimizeline (164) - on left: 48, on right: 46 -norelocLine (165) - on left: 49, on right: 8 -usesLine (166) - on left: 50 51, on right: 47 -usesClassList (167) - on left: 52 53, on right: 50 53 -deflibLine (168) - on left: 54, on right: 39 -endlibLine (169) - on left: 55, on right: 40 -semiColonOrError (170) - on left: 56 57, on right: 61 123 124 189 190 194 195 206 248 249 - 250 251 252 253 314 316 -commaOrNothing (171) - on left: 58 59, on right: 61 -classLine (172) - on left: 61, on right: 5 -$@2 (173) - on left: 60, on right: 61 -superClass (174) - on left: 62 63 64, on right: 61 -classFlags (175) - on left: 65 66 67 68, on right: 61 -endcLine (176) - on left: 69, on right: 6 -instanceLine (177) - on left: 71, on right: 7 -$@3 (178) - on left: 70, on right: 71 -instanceLineType (179) - on left: 73 75 77 79 81, on right: 71 -$@4 (180) - on left: 72, on right: 73 -$@5 (181) - on left: 74, on right: 75 -$@6 (182) - on left: 76, on right: 77 -$@7 (183) - on left: 78, on right: 79 -$@8 (184) - on left: 80, on right: 81 -kbdPathOrNull (185) - on left: 82 83, on right: 75 -instanceDefault (186) - on left: 85 86, on right: 81 -$@9 (187) - on left: 84, on right: 85 -vardataLine (188) - on left: 89, on right: 35 -$@10 (189) - on left: 87, on right: 89 -$@11 (190) - on left: 88, on right: 89 -vardataSymOrError (191) - on left: 90 91 92 93 94, on right: 99 -vardataClass (192) - on left: 96, on right: 91 92 93 -$@12 (193) - on left: 95, on right: 96 -vardataAliasLine (194) - on left: 99, on right: 36 -$@13 (195) - on left: 97, on right: 99 -$@14 (196) - on left: 98, on right: 99 -protoMinorLine (197) - on left: 100, on right: 37 -protoResetLine (198) - on left: 101, on right: 38 -defaultLine (199) - on left: 104, on right: 9 -$@15 (200) - on left: 102, on right: 104 -$@16 (201) - on left: 103, on right: 104 -defaultableSym (202) - on left: 105 106 107 108, on right: 104 -relocLine (203) - on left: 111, on right: 10 -$@17 (204) - on left: 109, on right: 111 -$@18 (205) - on left: 110, on right: 111 -relocTail (206) - on left: 112 114, on right: 111 -$@19 (207) - on left: 113, on right: 114 -relocCount (208) - on left: 117 118, on right: 112 114 -$@20 (209) - on left: 115, on right: 117 -$@21 (210) - on left: 116, on right: 117 -relocType (211) - on left: 119 120 121, on right: 112 114 -classdeclLine (212) - on left: 123 124, on right: 11 -$@22 (213) - on left: 122, on right: 123 -classDeclFlags (214) - on left: 125 126, on right: 123 124 -messageLine (215) - on left: 128, on right: 12 -$@23 (216) - on left: 127, on right: 128 -messageFinish (217) - on left: 131 133, on right: 128 -$@24 (218) - on left: 129, on right: 131 -$@25 (219) - on left: 130, on right: 131 -$@26 (220) - on left: 132, on right: 133 -messageParamListOrNull (221) - on left: 134 135, on right: 131 214 222 226 -messageParamList (222) - on left: 137 138, on right: 134 137 -@27 (223) - on left: 136, on right: 137 -stackFlag (224) - on left: 139 140, on right: 131 214 222 226 -messageParam (225) - on left: 142, on right: 137 138 -$@28 (226) - on left: 141, on right: 142 -eqParamRegs (227) - on left: 143 144, on right: 142 -paramRegs (228) - on left: 145 146 147 148 149 150 151 152 153 154 155 156, on right: - 143 -wordParamReg (229) - on left: 157 158 159, on right: 152 153 -multipleParamReg (230) - on left: 160 161 162 163 164 165, on right: 155 -messageReturn (231) - on left: 166 167, on right: 131 214 222 226 -returnReg (232) - on left: 168 169 170 171 172 173 174 175 176 177 178 179 180 181 - 182 183, on right: 166 -wordReturnReg (233) - on left: 184 185 186 187, on right: 180 181 -reserveMessagesLine (234) - on left: 189 190, on right: 15 -$@29 (235) - on left: 188, on right: 189 -reserveNum (236) - on left: 191 192, on right: 189 190 -setMessageLine (237) - on left: 194 195, on right: 18 -$@30 (238) - on left: 193, on right: 194 -setMessageNum (239) - on left: 196 197, on right: 194 195 -numExpr (240) - on left: 198 199 200, on right: 196 198 199 201 -primary (241) - on left: 201 202 203 204, on right: 198 199 200 202 -exportMessagesLine (242) - on left: 206, on right: 16 -$@31 (243) - on left: 205, on right: 206 -exportNum (244) - on left: 207 208, on right: 206 -exportSymOrError (245) - on left: 209 210, on right: 190 195 211 -importMessagePrefix (246) - on left: 211, on right: 214 216 -importMessageLine (247) - on left: 214 216, on right: 17 -$@32 (248) - on left: 212, on right: 214 -$@33 (249) - on left: 213, on right: 214 -$@34 (250) - on left: 215, on right: 216 -messageSymOrIdentErr (251) - on left: 217 218, on right: 216 222 279 -aliasLine (252) - on left: 222, on right: 13 -$@35 (253) - on left: 219, on right: 222 -$@36 (254) - on left: 220, on right: 222 -$@37 (255) - on left: 221, on right: 222 -prototypeLine (256) - on left: 226, on right: 14 -$@38 (257) - on left: 223, on right: 226 -$@39 (258) - on left: 224, on right: 226 -$@40 (259) - on left: 225, on right: 226 -externMethodOrMethod (260) - on left: 227 228, on right: 236 -identCommaOrNothing (261) - on left: 229 230, on right: 236 -openCurlyOrSemiColon (262) - on left: 231 232, on right: 236 -classOrError (263) - on left: 233 234, on right: 236 279 349 -methodLine (264) - on left: 236, on right: 19 -$@41 (265) - on left: 235, on right: 236 -methodMessageList (266) - on left: 237 238, on right: 236 237 -methodMessage (267) - on left: 239 240, on right: 237 238 -methodModel (268) - on left: 241 242 243 244, on right: 236 -defaultModelLine (269) - on left: 245 246 247, on right: 20 -externLine (270) - on left: 248 249 250 251 252 253, on right: 22 -objectDerefLine (271) - on left: 254 255 256, on right: 21 -sendOrCallOrRecord (272) - on left: 257 258 259, on right: 264 -sendOrCallOrRecordLine (273) - on left: 264, on right: 23 -$@42 (274) - on left: 260, on right: 264 -$@43 (275) - on left: 261, on right: 264 -$@44 (276) - on left: 262, on right: 264 -$@45 (277) - on left: 263, on right: 264 -FakeStringOrNothing (278) - on left: 265 266, on right: 264 279 -optCastMessage (279) - on left: 267 268, on right: 264 -optCastWithNoBraces (280) - on left: 269 270, on right: 264 267 -callsuperLine (281) - on left: 272, on right: 24 -$@46 (282) - on left: 271, on right: 272 -semiOrParens (283) - on left: 273 274, on right: 275 -callsuperStuff (284) - on left: 275 279, on right: 272 -$@47 (285) - on left: 276, on right: 279 -$@48 (286) - on left: 277, on right: 279 -$@49 (287) - on left: 278, on right: 279 -objDest (288) - on left: 280 281 284 287, on right: 264 279 -$@50 (289) - on left: 282, on right: 284 -$@51 (290) - on left: 283, on right: 284 -$@52 (291) - on left: 285, on right: 287 -$@53 (292) - on left: 286, on right: 287 -objMessage (293) - on left: 288 291 292, on right: 264 -$@54 (294) - on left: 289, on right: 291 -$@55 (295) - on left: 290, on right: 291 -ObjFlagListOrNull (296) - on left: 293 294, on right: 264 293 -objFlag (297) - on left: 295 296 297 298 299 300 301 302, on right: 293 -dispatchOrDispatchCall (298) - on left: 303 304, on right: 306 -dispatchOrDispatchCallLine (299) - on left: 306, on right: 25 -$@56 (300) - on left: 305, on right: 306 -newDispatchOrDispatchCall (301) - on left: 307 308, on right: 310 -newDispatchOrDispatchCallLine (302) - on left: 310, on right: 26 -$@57 (303) - on left: 309, on right: 310 -compilerLine (304) - on left: 311 312, on right: 27 -startLine (305) - on left: 314 316, on right: 28 -$@58 (306) - on left: 313, on right: 314 -$@59 (307) - on left: 315, on right: 316 -startFlags (308) - on left: 317 318 319 320, on right: 314 316 -resourceOutputLine (309) - on left: 321, on right: 41 -endLine (310) - on left: 322, on right: 29 -headerLine (311) - on left: 325, on right: 30 -$@60 (312) - on left: 323, on right: 325 -$@61 (313) - on left: 324, on right: 325 -chunkLine (314) - on left: 329 335 340, on right: 31 -$@62 (315) - on left: 326, on right: 329 -$@63 (316) - on left: 327, on right: 329 -$@64 (317) - on left: 328, on right: 329 -$@65 (318) - on left: 330, on right: 335 -$@66 (319) - on left: 331, on right: 335 -$@67 (320) - on left: 332, on right: 335 -$@68 (321) - on left: 333, on right: 335 -$@69 (322) - on left: 334, on right: 335 -$@70 (323) - on left: 336, on right: 340 -@71 (324) - on left: 337, on right: 340 -@72 (325) - on left: 338, on right: 340 -$@73 (326) - on left: 339, on right: 340 -cArrayType (327) - on left: 341 342, on right: 335 -caHeader (328) - on left: 346 347, on right: 335 -$@74 (329) - on left: 343, on right: 346 -$@75 (330) - on left: 344, on right: 346 -$@76 (331) - on left: 345, on right: 346 -objectLine (332) - on left: 349, on right: 32 -$@77 (333) - on left: 348, on right: 349 -ignoreDirtyFlag (334) - on left: 350 351, on right: 349 -objectFieldList (335) - on left: 352 353 354 355, on right: 349 352 354 355 -fieldError (336) - on left: 356, on right: 354 355 -optionalArraySize (337) - on left: 359 360, on right: 381 -$@78 (338) - on left: 357, on right: 359 -$@79 (339) - on left: 358, on right: 359 -objectField (340) - on left: 363 366 367 368 371 372 373 374 375 377 378 381 382 384 - 385 386 387, on right: 352 -$@80 (341) - on left: 361, on right: 363 -$@81 (342) - on left: 362, on right: 363 -$@82 (343) - on left: 364, on right: 366 -$@83 (344) - on left: 365, on right: 366 -$@84 (345) - on left: 369, on right: 371 -$@85 (346) - on left: 370, on right: 371 -$@86 (347) - on left: 376, on right: 377 -$@87 (348) - on left: 379, on right: 381 -$@88 (349) - on left: 380, on right: 381 -$@89 (350) - on left: 383, on right: 384 -someString (351) - on left: 388 389 390 391 392, on right: 373 434 435 436 437 -LocalizationLine (352) - on left: 393 394 395 396, on right: 34 387 -simpleLocalization (353) - on left: 397 398, on right: 396 -visMonikerFieldFinish (354) - on left: 399 400 402, on right: 377 -$@90 (355) - on left: 401, on right: 402 -aleArrayN (356) - on left: 403 404, on right: 382 -aleArray (357) - on left: 405 406, on right: 403 405 -aleArrayElement (358) - on left: 407, on right: 405 406 -kbdAcceleratorStart (359) - on left: 408, on right: 385 -kbdAccelChar (360) - on left: 409 410, on right: 385 -specificUIOrNothing (361) - on left: 411 412, on right: 385 -kbdAccelModList (362) - on left: 413 414, on right: 385 413 -childList (363) - on left: 415 416, on right: 384 -childListNN (364) - on left: 417 418, on right: 415 417 -childNN (365) - on left: 419 420, on right: 417 418 -visMonikerLine (366) - on left: 422, on right: 33 -$@91 (367) - on left: 421, on right: 422 -optSemiColon (368) - on left: 423 424, on right: 377 -visMonikerDef (369) - on left: 426 427, on right: 402 422 -$@92 (370) - on left: 425, on right: 426 -vmMiddle (371) - on left: 428 429, on right: 426 -vmMiddleNonList (372) - on left: 430 431 432 433, on right: 429 -vmNavChar (373) - on left: 434 435 436 437, on right: 430 431 -vmList (374) - on left: 438 439, on right: 431 433 438 -vmGStrings (375) - on left: 441, on right: 432 433 -@93 (376) - on left: 440, on right: 441 -GStrings (377) - on left: 444, on right: 340 441 -$@94 (378) - on left: 442, on right: 444 -$@95 (379) - on left: 443, on right: 444 -gstringBodyElementList (380) - on left: 445 446, on right: 444 445 -gstringBodyElement (381) - on left: 447 448 449, on right: 445 -vmElement (382) - on left: 450 451 452 453 454 455 456, on right: 438 -vmArray (383) - on left: 457 458, on right: 428 457 -vmArrayElement (384) - on left: 459 460 461, on right: 457 458 -vmArrayError (385) - on left: 462, on right: 460 461 -objectOrIdent (386) - on left: 463 464, on right: 321 349 386 407 419 -protoMinorSym (387) - on left: 465 466, on right: 100 -visMonikerOrIdent (388) - on left: 467 468, on right: 422 459 -identOrConst (389) - on left: 469 470, on right: 382 -typeDeclString (390) - on left: 471, on right: 81 89 131 142 214 222 226 329 - - -State 0 - - 0 $accept: . file $end - - $default reduce using rule 1 ($@1) - - file go to state 1 - $@1 go to state 2 - - -State 1 - - 0 $accept: file . $end - - $end shift, and go to state 3 - - -State 2 - - 2 file: $@1 . lines - - $default reduce using rule 4 (lines) - - lines go to state 4 - - -State 3 - - 0 $accept: file $end . - - $default accept - - -State 4 - - 2 file: $@1 lines . - 3 lines: lines . line - - error shift, and go to state 5 - CLASS shift, and go to state 6 - ENDC shift, and go to state 7 - CLASSDECL shift, and go to state 8 - MESSAGE shift, and go to state 9 - ALIAS shift, and go to state 10 - PROTOTYPE shift, and go to state 11 - RESERVE_MESSAGES shift, and go to state 12 - EXPORT_MESSAGES shift, and go to state 13 - IMPORT_MESSAGE shift, and go to state 14 - SET_MESSAGE_NUM shift, and go to state 15 - INSTANCE shift, and go to state 16 - VIS_MONIKER shift, and go to state 17 - DEFAULT shift, and go to state 18 - RELOC shift, and go to state 19 - DEFAULT_MODEL shift, and go to state 20 - METHOD shift, and go to state 21 - CALL shift, and go to state 22 - CALL_SUPER shift, and go to state 23 - SEND shift, and go to state 24 - RECORD shift, and go to state 25 - DISPATCH shift, and go to state 26 - DISPATCHCALL shift, and go to state 27 - LOCALIZE shift, and go to state 28 - COMPILER shift, and go to state 29 - START shift, and go to state 30 - END shift, and go to state 31 - HEADER shift, and go to state 32 - CHUNK shift, and go to state 33 - CHUNK_ARRAY shift, and go to state 34 - ELEMENT_ARRAY shift, and go to state 35 - OBJECT shift, and go to state 36 - SPECIFIC_UI shift, and go to state 37 - RESOURCE_OUTPUT shift, and go to state 38 - VARDATA shift, and go to state 39 - VARDATA_ALIAS shift, and go to state 40 - DEFLIB shift, and go to state 41 - ENDLIB shift, and go to state 42 - EXTERN shift, and go to state 43 - PROTOMINOR shift, and go to state 44 - PROTORESET shift, and go to state 45 - OPTIMIZE shift, and go to state 46 - NORELOC shift, and go to state 47 - USES shift, and go to state 48 - OBJECT_SYM shift, and go to state 49 - CHUNK_SYM shift, and go to state 50 - VIS_MONIKER_CHUNK_SYM shift, and go to state 51 - GSTRING_SYM shift, and go to state 52 - SPECIAL_DEBUG_TOKEN shift, and go to state 53 - SPECIAL_UNDEBUG_TOKEN shift, and go to state 54 - - $end reduce using rule 2 (file) - - line go to state 55 - optimizeline go to state 56 - norelocLine go to state 57 - usesLine go to state 58 - deflibLine go to state 59 - endlibLine go to state 60 - classLine go to state 61 - endcLine go to state 62 - instanceLine go to state 63 - vardataLine go to state 64 - vardataAliasLine go to state 65 - protoMinorLine go to state 66 - protoResetLine go to state 67 - defaultLine go to state 68 - relocLine go to state 69 - classdeclLine go to state 70 - messageLine go to state 71 - reserveMessagesLine go to state 72 - setMessageLine go to state 73 - exportMessagesLine go to state 74 - importMessagePrefix go to state 75 - importMessageLine go to state 76 - aliasLine go to state 77 - prototypeLine go to state 78 - externMethodOrMethod go to state 79 - methodLine go to state 80 - defaultModelLine go to state 81 - externLine go to state 82 - objectDerefLine go to state 83 - sendOrCallOrRecord go to state 84 - sendOrCallOrRecordLine go to state 85 - callsuperLine go to state 86 - dispatchOrDispatchCall go to state 87 - dispatchOrDispatchCallLine go to state 88 - newDispatchOrDispatchCall go to state 89 - newDispatchOrDispatchCallLine go to state 90 - compilerLine go to state 91 - startLine go to state 92 - resourceOutputLine go to state 93 - endLine go to state 94 - headerLine go to state 95 - chunkLine go to state 96 - cArrayType go to state 97 - objectLine go to state 98 - LocalizationLine go to state 99 - simpleLocalization go to state 100 - visMonikerLine go to state 101 - - -State 5 - - 43 line: error . - - $default reduce using rule 43 (line) - - -State 6 - - 61 classLine: CLASS . IDENT commaOrNothing superClass $@2 classFlags semiColonOrError - - IDENT shift, and go to state 102 - - -State 7 - - 69 endcLine: ENDC . - - $default reduce using rule 69 (endcLine) - - -State 8 - - 123 classdeclLine: CLASSDECL . CLASS_SYM $@22 classDeclFlags semiColonOrError - 124 | CLASSDECL . IDENT classDeclFlags semiColonOrError - - CLASS_SYM shift, and go to state 103 - IDENT shift, and go to state 104 - - -State 9 - - 128 messageLine: MESSAGE . $@23 messageFinish - - $default reduce using rule 127 ($@23) - - $@23 go to state 105 - - -State 10 - - 222 aliasLine: ALIAS . '(' messageSymOrIdentErr ')' $@35 typeDeclString '(' $@36 stackFlag messageParamListOrNull ')' $@37 messageReturn ';' - - '(' shift, and go to state 106 - - -State 11 - - 226 prototypeLine: PROTOTYPE . $@38 typeDeclString '(' $@39 stackFlag messageParamListOrNull ')' $@40 messageReturn ';' - - $default reduce using rule 223 ($@38) - - $@38 go to state 107 - - -State 12 - - 189 reserveMessagesLine: RESERVE_MESSAGES . $@29 reserveNum semiColonOrError - 190 | RESERVE_MESSAGES . exportSymOrError ',' reserveNum semiColonOrError - - EXPORT_SYM shift, and go to state 108 - IDENT shift, and go to state 109 - - $default reduce using rule 188 ($@29) - - $@29 go to state 110 - exportSymOrError go to state 111 - - -State 13 - - 206 exportMessagesLine: EXPORT_MESSAGES . IDENT $@31 exportNum semiColonOrError - - IDENT shift, and go to state 112 - - -State 14 - - 211 importMessagePrefix: IMPORT_MESSAGE . exportSymOrError ',' - - EXPORT_SYM shift, and go to state 108 - IDENT shift, and go to state 109 - - exportSymOrError go to state 113 - - -State 15 - - 194 setMessageLine: SET_MESSAGE_NUM . $@30 setMessageNum semiColonOrError - 195 | SET_MESSAGE_NUM . exportSymOrError ',' setMessageNum semiColonOrError - - EXPORT_SYM shift, and go to state 108 - IDENT shift, and go to state 109 - - $default reduce using rule 193 ($@30) - - $@30 go to state 114 - exportSymOrError go to state 115 - - -State 16 - - 71 instanceLine: INSTANCE . $@3 instanceLineType ';' - - $default reduce using rule 70 ($@3) - - $@3 go to state 116 - - -State 17 - - 422 visMonikerLine: VIS_MONIKER . visMonikerOrIdent '=' $@91 visMonikerDef - - VIS_MONIKER_CHUNK_SYM shift, and go to state 117 - IDENT shift, and go to state 118 - - visMonikerOrIdent go to state 119 - - -State 18 - - 104 defaultLine: DEFAULT . defaultableSym '=' $@15 FAKESTRING $@16 ';' - - REG_INSTANCE_SYM shift, and go to state 120 - VARIANT_PTR_SYM shift, and go to state 121 - OPTR_SYM shift, and go to state 122 - IDENT shift, and go to state 123 - - defaultableSym go to state 124 - - -State 19 - - 111 relocLine: RELOC . $@17 FAKESTRING $@18 ',' relocTail - - $default reduce using rule 109 ($@17) - - $@17 go to state 125 - - -State 20 - - 245 defaultModelLine: DEFAULT_MODEL . FAR - 246 | DEFAULT_MODEL . NEAR - 247 | DEFAULT_MODEL . BASED - - FAR shift, and go to state 126 - NEAR shift, and go to state 127 - BASED shift, and go to state 128 - - -State 21 - - 227 externMethodOrMethod: METHOD . - - $default reduce using rule 227 (externMethodOrMethod) - - -State 22 - - 258 sendOrCallOrRecord: CALL . - - $default reduce using rule 258 (sendOrCallOrRecord) - - -State 23 - - 272 callsuperLine: CALL_SUPER . $@46 callsuperStuff - - $default reduce using rule 271 ($@46) - - $@46 go to state 129 - - -State 24 - - 257 sendOrCallOrRecord: SEND . - - $default reduce using rule 257 (sendOrCallOrRecord) - - -State 25 - - 259 sendOrCallOrRecord: RECORD . - - $default reduce using rule 259 (sendOrCallOrRecord) - - -State 26 - - 303 dispatchOrDispatchCall: DISPATCH . - 307 newDispatchOrDispatchCall: DISPATCH . '(' - - '(' shift, and go to state 130 - - $default reduce using rule 303 (dispatchOrDispatchCall) - - -State 27 - - 304 dispatchOrDispatchCall: DISPATCHCALL . '(' MSG_SYM ')' - 308 newDispatchOrDispatchCall: DISPATCHCALL . '(' '(' MSG_SYM ')' - - '(' shift, and go to state 131 - - -State 28 - - 393 LocalizationLine: LOCALIZE . '{' STRING CONST '}' ';' - 394 | LOCALIZE . '{' STRING CONST '-' CONST '}' ';' - 395 | LOCALIZE . NOT ';' - 397 simpleLocalization: LOCALIZE . '{' STRING '}' ';' - 398 | LOCALIZE . STRING ';' - - NOT shift, and go to state 132 - STRING shift, and go to state 133 - '{' shift, and go to state 134 - - -State 29 - - 311 compilerLine: COMPILER . HIGHC - 312 | COMPILER . MSC - - HIGHC shift, and go to state 135 - MSC shift, and go to state 136 - - -State 30 - - 314 startLine: START . IDENT $@58 startFlags semiColonOrError - 316 | START . RESOURCE_SYM $@59 startFlags semiColonOrError - - RESOURCE_SYM shift, and go to state 137 - IDENT shift, and go to state 138 - - -State 31 - - 322 endLine: END . RESOURCE_SYM - - RESOURCE_SYM shift, and go to state 139 - - -State 32 - - 325 headerLine: HEADER . IDENT '=' $@60 FAKESTRING $@61 ';' - - IDENT shift, and go to state 140 - - -State 33 - - 329 chunkLine: CHUNK . $@62 typeDeclString '=' $@63 FAKESTRING $@64 ';' - - $default reduce using rule 326 ($@62) - - $@62 go to state 141 - - -State 34 - - 341 cArrayType: CHUNK_ARRAY . - - $default reduce using rule 341 (cArrayType) - - -State 35 - - 342 cArrayType: ELEMENT_ARRAY . - - $default reduce using rule 342 (cArrayType) - - -State 36 - - 349 objectLine: OBJECT . classOrError objectOrIdent '=' ignoreDirtyFlag '{' $@77 objectFieldList '}' - - error shift, and go to state 142 - CLASS_SYM shift, and go to state 143 - - classOrError go to state 144 - - -State 37 - - 42 line: SPECIFIC_UI . - - $default reduce using rule 42 (line) - - -State 38 - - 321 resourceOutputLine: RESOURCE_OUTPUT . '=' objectOrIdent - - '=' shift, and go to state 145 - - -State 39 - - 89 vardataLine: VARDATA . $@10 typeDeclString $@11 ';' - - $default reduce using rule 87 ($@10) - - $@10 go to state 146 - - -State 40 - - 99 vardataAliasLine: VARDATA_ALIAS . '(' vardataSymOrError ')' $@13 IDENT $@14 IDENT - - '(' shift, and go to state 147 - - -State 41 - - 54 deflibLine: DEFLIB . IDENT - - IDENT shift, and go to state 148 - - -State 42 - - 55 endlibLine: ENDLIB . - - $default reduce using rule 55 (endlibLine) - - -State 43 - - 228 externMethodOrMethod: EXTERN . METHOD - 248 externLine: EXTERN . OBJECT IDENT semiColonOrError - 249 | EXTERN . OBJECT OBJECT_SYM semiColonOrError - 250 | EXTERN . CHUNK IDENT semiColonOrError - 251 | EXTERN . CHUNK CHUNK_SYM semiColonOrError - 252 | EXTERN . VIS_MONIKER IDENT semiColonOrError - 253 | EXTERN . VIS_MONIKER VIS_MONIKER_CHUNK_SYM semiColonOrError - - VIS_MONIKER shift, and go to state 149 - METHOD shift, and go to state 150 - CHUNK shift, and go to state 151 - OBJECT shift, and go to state 152 - - -State 44 - - 100 protoMinorLine: PROTOMINOR . protoMinorSym - - PROTOMINOR_SYM shift, and go to state 153 - IDENT shift, and go to state 154 - - protoMinorSym go to state 155 - - -State 45 - - 101 protoResetLine: PROTORESET . - - $default reduce using rule 101 (protoResetLine) - - -State 46 - - 48 optimizeline: OPTIMIZE . - - $default reduce using rule 48 (optimizeline) - - -State 47 - - 49 norelocLine: NORELOC . OPTR_SYM ';' - - OPTR_SYM shift, and go to state 156 - - -State 48 - - 50 usesLine: USES . usesClassList ';' - 51 | USES . error ';' - - error shift, and go to state 157 - CLASS_SYM shift, and go to state 158 - - usesClassList go to state 159 - - -State 49 - - 254 objectDerefLine: OBJECT_SYM . - - $default reduce using rule 254 (objectDerefLine) - - -State 50 - - 255 objectDerefLine: CHUNK_SYM . - - $default reduce using rule 255 (objectDerefLine) - - -State 51 - - 256 objectDerefLine: VIS_MONIKER_CHUNK_SYM . - - $default reduce using rule 256 (objectDerefLine) - - -State 52 - - 340 chunkLine: GSTRING_SYM . $@70 IDENT @71 '=' @72 GStrings $@73 ';' - - $default reduce using rule 336 ($@70) - - $@70 go to state 160 - - -State 53 - - 44 line: SPECIAL_DEBUG_TOKEN . - - $default reduce using rule 44 (line) - - -State 54 - - 45 line: SPECIAL_UNDEBUG_TOKEN . - - $default reduce using rule 45 (line) - - -State 55 - - 3 lines: lines line . - - $default reduce using rule 3 (lines) - - -State 56 - - 46 line: optimizeline . - - $default reduce using rule 46 (line) - - -State 57 - - 8 line: norelocLine . - - $default reduce using rule 8 (line) - - -State 58 - - 47 line: usesLine . - - $default reduce using rule 47 (line) - - -State 59 - - 39 line: deflibLine . - - $default reduce using rule 39 (line) - - -State 60 - - 40 line: endlibLine . - - $default reduce using rule 40 (line) - - -State 61 - - 5 line: classLine . - - $default reduce using rule 5 (line) - - -State 62 - - 6 line: endcLine . - - $default reduce using rule 6 (line) - - -State 63 - - 7 line: instanceLine . - - $default reduce using rule 7 (line) - - -State 64 - - 35 line: vardataLine . - - $default reduce using rule 35 (line) - - -State 65 - - 36 line: vardataAliasLine . - - $default reduce using rule 36 (line) - - -State 66 - - 37 line: protoMinorLine . - - $default reduce using rule 37 (line) - - -State 67 - - 38 line: protoResetLine . - - $default reduce using rule 38 (line) - - -State 68 - - 9 line: defaultLine . - - $default reduce using rule 9 (line) - - -State 69 - - 10 line: relocLine . - - $default reduce using rule 10 (line) - - -State 70 - - 11 line: classdeclLine . - - $default reduce using rule 11 (line) - - -State 71 - - 12 line: messageLine . - - $default reduce using rule 12 (line) - - -State 72 - - 15 line: reserveMessagesLine . - - $default reduce using rule 15 (line) - - -State 73 - - 18 line: setMessageLine . - - $default reduce using rule 18 (line) - - -State 74 - - 16 line: exportMessagesLine . - - $default reduce using rule 16 (line) - - -State 75 - - 214 importMessageLine: importMessagePrefix . typeDeclString '(' $@32 stackFlag messageParamListOrNull ')' $@33 messageReturn ';' - 216 | importMessagePrefix . '(' $@34 messageSymOrIdentErr ')' IDENT ';' - - STRING shift, and go to state 161 - '(' shift, and go to state 162 - - typeDeclString go to state 163 - - -State 76 - - 17 line: importMessageLine . - - $default reduce using rule 17 (line) - - -State 77 - - 13 line: aliasLine . - - $default reduce using rule 13 (line) - - -State 78 - - 14 line: prototypeLine . - - $default reduce using rule 14 (line) - - -State 79 - - 236 methodLine: externMethodOrMethod . methodModel identCommaOrNothing classOrError $@41 ',' methodMessageList openCurlyOrSemiColon - - FAR shift, and go to state 164 - NEAR shift, and go to state 165 - BASED shift, and go to state 166 - - $default reduce using rule 244 (methodModel) - - methodModel go to state 167 - - -State 80 - - 19 line: methodLine . - - $default reduce using rule 19 (line) - - -State 81 - - 20 line: defaultModelLine . - - $default reduce using rule 20 (line) - - -State 82 - - 22 line: externLine . - - $default reduce using rule 22 (line) - - -State 83 - - 21 line: objectDerefLine . - - $default reduce using rule 21 (line) - - -State 84 - - 264 sendOrCallOrRecordLine: sendOrCallOrRecord . $@42 ObjFlagListOrNull optCastWithNoBraces objDest $@43 ':' optCastMessage objMessage '(' $@44 FakeStringOrNothing $@45 ')' - - $default reduce using rule 260 ($@42) - - $@42 go to state 168 - - -State 85 - - 23 line: sendOrCallOrRecordLine . - - $default reduce using rule 23 (line) - - -State 86 - - 24 line: callsuperLine . - - $default reduce using rule 24 (line) - - -State 87 - - 306 dispatchOrDispatchCallLine: dispatchOrDispatchCall . $@56 IDENT - - $default reduce using rule 305 ($@56) - - $@56 go to state 169 - - -State 88 - - 25 line: dispatchOrDispatchCallLine . - - $default reduce using rule 25 (line) - - -State 89 - - 310 newDispatchOrDispatchCallLine: newDispatchOrDispatchCall . FAKESTRING $@57 ')' - - FAKESTRING shift, and go to state 170 - - -State 90 - - 26 line: newDispatchOrDispatchCallLine . - - $default reduce using rule 26 (line) - - -State 91 - - 27 line: compilerLine . - - $default reduce using rule 27 (line) - - -State 92 - - 28 line: startLine . - - $default reduce using rule 28 (line) - - -State 93 - - 41 line: resourceOutputLine . - - $default reduce using rule 41 (line) - - -State 94 - - 29 line: endLine . - - $default reduce using rule 29 (line) - - -State 95 - - 30 line: headerLine . - - $default reduce using rule 30 (line) - - -State 96 - - 31 line: chunkLine . - - $default reduce using rule 31 (line) - - -State 97 - - 335 chunkLine: cArrayType . $@65 IDENT $@66 caHeader IDENT $@67 '=' $@68 FAKESTRING $@69 ';' - - $default reduce using rule 330 ($@65) - - $@65 go to state 171 - - -State 98 - - 32 line: objectLine . - - $default reduce using rule 32 (line) - - -State 99 - - 34 line: LocalizationLine . - - $default reduce using rule 34 (line) - - -State 100 - - 396 LocalizationLine: simpleLocalization . - - $default reduce using rule 396 (LocalizationLine) - - -State 101 - - 33 line: visMonikerLine . - - $default reduce using rule 33 (line) - - -State 102 - - 61 classLine: CLASS IDENT . commaOrNothing superClass $@2 classFlags semiColonOrError - - ',' shift, and go to state 172 - - $default reduce using rule 59 (commaOrNothing) - - commaOrNothing go to state 173 - - -State 103 - - 123 classdeclLine: CLASSDECL CLASS_SYM . $@22 classDeclFlags semiColonOrError - - $default reduce using rule 122 ($@22) - - $@22 go to state 174 - - -State 104 - - 124 classdeclLine: CLASSDECL IDENT . classDeclFlags semiColonOrError - - ',' shift, and go to state 175 - - $default reduce using rule 126 (classDeclFlags) - - classDeclFlags go to state 176 - - -State 105 - - 128 messageLine: MESSAGE $@23 . messageFinish - - STRING shift, and go to state 161 - '(' shift, and go to state 177 - - messageFinish go to state 178 - typeDeclString go to state 179 - - -State 106 - - 222 aliasLine: ALIAS '(' . messageSymOrIdentErr ')' $@35 typeDeclString '(' $@36 stackFlag messageParamListOrNull ')' $@37 messageReturn ';' - - MSG_SYM shift, and go to state 180 - IDENT shift, and go to state 181 - - messageSymOrIdentErr go to state 182 - - -State 107 - - 226 prototypeLine: PROTOTYPE $@38 . typeDeclString '(' $@39 stackFlag messageParamListOrNull ')' $@40 messageReturn ';' - - STRING shift, and go to state 161 - - typeDeclString go to state 183 - - -State 108 - - 209 exportSymOrError: EXPORT_SYM . - - $default reduce using rule 209 (exportSymOrError) - - -State 109 - - 210 exportSymOrError: IDENT . - - $default reduce using rule 210 (exportSymOrError) - - -State 110 - - 189 reserveMessagesLine: RESERVE_MESSAGES $@29 . reserveNum semiColonOrError - - CONST shift, and go to state 184 - - $default reduce using rule 192 (reserveNum) - - reserveNum go to state 185 - - -State 111 - - 190 reserveMessagesLine: RESERVE_MESSAGES exportSymOrError . ',' reserveNum semiColonOrError - - ',' shift, and go to state 186 - - -State 112 - - 206 exportMessagesLine: EXPORT_MESSAGES IDENT . $@31 exportNum semiColonOrError - - $default reduce using rule 205 ($@31) - - $@31 go to state 187 - - -State 113 - - 211 importMessagePrefix: IMPORT_MESSAGE exportSymOrError . ',' - - ',' shift, and go to state 188 - - -State 114 - - 194 setMessageLine: SET_MESSAGE_NUM $@30 . setMessageNum semiColonOrError - - MSG_SYM shift, and go to state 189 - CONST shift, and go to state 190 - '(' shift, and go to state 191 - '-' shift, and go to state 192 - - $default reduce using rule 197 (setMessageNum) - - setMessageNum go to state 193 - numExpr go to state 194 - primary go to state 195 - - -State 115 - - 195 setMessageLine: SET_MESSAGE_NUM exportSymOrError . ',' setMessageNum semiColonOrError - - ',' shift, and go to state 196 - - -State 116 - - 71 instanceLine: INSTANCE $@3 . instanceLineType ';' - - COMPOSITE shift, and go to state 197 - LINK shift, and go to state 198 - VIS_MONIKER shift, and go to state 199 - KBD_ACCELERATOR shift, and go to state 200 - STRING shift, and go to state 161 - - instanceLineType go to state 201 - typeDeclString go to state 202 - - -State 117 - - 467 visMonikerOrIdent: VIS_MONIKER_CHUNK_SYM . - - $default reduce using rule 467 (visMonikerOrIdent) - - -State 118 - - 468 visMonikerOrIdent: IDENT . - - $default reduce using rule 468 (visMonikerOrIdent) - - -State 119 - - 422 visMonikerLine: VIS_MONIKER visMonikerOrIdent . '=' $@91 visMonikerDef - - '=' shift, and go to state 203 - - -State 120 - - 105 defaultableSym: REG_INSTANCE_SYM . - - $default reduce using rule 105 (defaultableSym) - - -State 121 - - 107 defaultableSym: VARIANT_PTR_SYM . - - $default reduce using rule 107 (defaultableSym) - - -State 122 - - 106 defaultableSym: OPTR_SYM . - - $default reduce using rule 106 (defaultableSym) - - -State 123 - - 108 defaultableSym: IDENT . - - $default reduce using rule 108 (defaultableSym) - - -State 124 - - 104 defaultLine: DEFAULT defaultableSym . '=' $@15 FAKESTRING $@16 ';' - - '=' shift, and go to state 204 - - -State 125 - - 111 relocLine: RELOC $@17 . FAKESTRING $@18 ',' relocTail - - FAKESTRING shift, and go to state 205 - - -State 126 - - 245 defaultModelLine: DEFAULT_MODEL FAR . - - $default reduce using rule 245 (defaultModelLine) - - -State 127 - - 246 defaultModelLine: DEFAULT_MODEL NEAR . - - $default reduce using rule 246 (defaultModelLine) - - -State 128 - - 247 defaultModelLine: DEFAULT_MODEL BASED . - - $default reduce using rule 247 (defaultModelLine) - - -State 129 - - 272 callsuperLine: CALL_SUPER $@46 . callsuperStuff - - PARENT shift, and go to state 206 - CHILDREN shift, and go to state 207 - FAKESTRING shift, and go to state 208 - ';' shift, and go to state 209 - '(' shift, and go to state 210 - - semiOrParens go to state 211 - callsuperStuff go to state 212 - objDest go to state 213 - - -State 130 - - 307 newDispatchOrDispatchCall: DISPATCH '(' . - - $default reduce using rule 307 (newDispatchOrDispatchCall) - - -State 131 - - 304 dispatchOrDispatchCall: DISPATCHCALL '(' . MSG_SYM ')' - 308 newDispatchOrDispatchCall: DISPATCHCALL '(' . '(' MSG_SYM ')' - - MSG_SYM shift, and go to state 214 - '(' shift, and go to state 215 - - -State 132 - - 395 LocalizationLine: LOCALIZE NOT . ';' - - ';' shift, and go to state 216 - - -State 133 - - 398 simpleLocalization: LOCALIZE STRING . ';' - - ';' shift, and go to state 217 - - -State 134 - - 393 LocalizationLine: LOCALIZE '{' . STRING CONST '}' ';' - 394 | LOCALIZE '{' . STRING CONST '-' CONST '}' ';' - 397 simpleLocalization: LOCALIZE '{' . STRING '}' ';' - - STRING shift, and go to state 218 - - -State 135 - - 311 compilerLine: COMPILER HIGHC . - - $default reduce using rule 311 (compilerLine) - - -State 136 - - 312 compilerLine: COMPILER MSC . - - $default reduce using rule 312 (compilerLine) - - -State 137 - - 316 startLine: START RESOURCE_SYM . $@59 startFlags semiColonOrError - - $default reduce using rule 315 ($@59) - - $@59 go to state 219 - - -State 138 - - 314 startLine: START IDENT . $@58 startFlags semiColonOrError - - $default reduce using rule 313 ($@58) - - $@58 go to state 220 - - -State 139 - - 322 endLine: END RESOURCE_SYM . - - $default reduce using rule 322 (endLine) - - -State 140 - - 325 headerLine: HEADER IDENT . '=' $@60 FAKESTRING $@61 ';' - - '=' shift, and go to state 221 - - -State 141 - - 329 chunkLine: CHUNK $@62 . typeDeclString '=' $@63 FAKESTRING $@64 ';' - - STRING shift, and go to state 161 - - typeDeclString go to state 222 - - -State 142 - - 234 classOrError: error . - - $default reduce using rule 234 (classOrError) - - -State 143 - - 233 classOrError: CLASS_SYM . - - $default reduce using rule 233 (classOrError) - - -State 144 - - 349 objectLine: OBJECT classOrError . objectOrIdent '=' ignoreDirtyFlag '{' $@77 objectFieldList '}' - - OBJECT_SYM shift, and go to state 223 - IDENT shift, and go to state 224 - - objectOrIdent go to state 225 - - -State 145 - - 321 resourceOutputLine: RESOURCE_OUTPUT '=' . objectOrIdent - - OBJECT_SYM shift, and go to state 223 - IDENT shift, and go to state 224 - - objectOrIdent go to state 226 - - -State 146 - - 89 vardataLine: VARDATA $@10 . typeDeclString $@11 ';' - - STRING shift, and go to state 161 - - typeDeclString go to state 227 - - -State 147 - - 99 vardataAliasLine: VARDATA_ALIAS '(' . vardataSymOrError ')' $@13 IDENT $@14 IDENT - - CLASS_SYM shift, and go to state 228 - VARDATA_SYM shift, and go to state 229 - IDENT shift, and go to state 230 - - vardataSymOrError go to state 231 - vardataClass go to state 232 - - -State 148 - - 54 deflibLine: DEFLIB IDENT . - - $default reduce using rule 54 (deflibLine) - - -State 149 - - 252 externLine: EXTERN VIS_MONIKER . IDENT semiColonOrError - 253 | EXTERN VIS_MONIKER . VIS_MONIKER_CHUNK_SYM semiColonOrError - - VIS_MONIKER_CHUNK_SYM shift, and go to state 233 - IDENT shift, and go to state 234 - - -State 150 - - 228 externMethodOrMethod: EXTERN METHOD . - - $default reduce using rule 228 (externMethodOrMethod) - - -State 151 - - 250 externLine: EXTERN CHUNK . IDENT semiColonOrError - 251 | EXTERN CHUNK . CHUNK_SYM semiColonOrError - - CHUNK_SYM shift, and go to state 235 - IDENT shift, and go to state 236 - - -State 152 - - 248 externLine: EXTERN OBJECT . IDENT semiColonOrError - 249 | EXTERN OBJECT . OBJECT_SYM semiColonOrError - - OBJECT_SYM shift, and go to state 237 - IDENT shift, and go to state 238 - - -State 153 - - 465 protoMinorSym: PROTOMINOR_SYM . - - $default reduce using rule 465 (protoMinorSym) - - -State 154 - - 466 protoMinorSym: IDENT . - - $default reduce using rule 466 (protoMinorSym) - - -State 155 - - 100 protoMinorLine: PROTOMINOR protoMinorSym . - - $default reduce using rule 100 (protoMinorLine) - - -State 156 - - 49 norelocLine: NORELOC OPTR_SYM . ';' - - ';' shift, and go to state 239 - - -State 157 - - 51 usesLine: USES error . ';' - - ';' shift, and go to state 240 - - -State 158 - - 52 usesClassList: CLASS_SYM . - - $default reduce using rule 52 (usesClassList) - - -State 159 - - 50 usesLine: USES usesClassList . ';' - 53 usesClassList: usesClassList . ',' CLASS_SYM - - ';' shift, and go to state 241 - ',' shift, and go to state 242 - - -State 160 - - 340 chunkLine: GSTRING_SYM $@70 . IDENT @71 '=' @72 GStrings $@73 ';' - - IDENT shift, and go to state 243 - - -State 161 - - 471 typeDeclString: STRING . - - $default reduce using rule 471 (typeDeclString) - - -State 162 - - 216 importMessageLine: importMessagePrefix '(' . $@34 messageSymOrIdentErr ')' IDENT ';' - - $default reduce using rule 215 ($@34) - - $@34 go to state 244 - - -State 163 - - 214 importMessageLine: importMessagePrefix typeDeclString . '(' $@32 stackFlag messageParamListOrNull ')' $@33 messageReturn ';' - - '(' shift, and go to state 245 - - -State 164 - - 241 methodModel: FAR . - - $default reduce using rule 241 (methodModel) - - -State 165 - - 242 methodModel: NEAR . - - $default reduce using rule 242 (methodModel) - - -State 166 - - 243 methodModel: BASED . - - $default reduce using rule 243 (methodModel) - - -State 167 - - 236 methodLine: externMethodOrMethod methodModel . identCommaOrNothing classOrError $@41 ',' methodMessageList openCurlyOrSemiColon - - IDENT shift, and go to state 246 - - $default reduce using rule 230 (identCommaOrNothing) - - identCommaOrNothing go to state 247 - - -State 168 - - 264 sendOrCallOrRecordLine: sendOrCallOrRecord $@42 . ObjFlagListOrNull optCastWithNoBraces objDest $@43 ':' optCastMessage objMessage '(' $@44 FakeStringOrNothing $@45 ')' - - $default reduce using rule 294 (ObjFlagListOrNull) - - ObjFlagListOrNull go to state 248 - - -State 169 - - 306 dispatchOrDispatchCallLine: dispatchOrDispatchCall $@56 . IDENT - - IDENT shift, and go to state 249 - - -State 170 - - 310 newDispatchOrDispatchCallLine: newDispatchOrDispatchCall FAKESTRING . $@57 ')' - - $default reduce using rule 309 ($@57) - - $@57 go to state 250 - - -State 171 - - 335 chunkLine: cArrayType $@65 . IDENT $@66 caHeader IDENT $@67 '=' $@68 FAKESTRING $@69 ';' - - IDENT shift, and go to state 251 - - -State 172 - - 58 commaOrNothing: ',' . - - $default reduce using rule 58 (commaOrNothing) - - -State 173 - - 61 classLine: CLASS IDENT commaOrNothing . superClass $@2 classFlags semiColonOrError - - META shift, and go to state 252 - CLASS_SYM shift, and go to state 253 - IDENT shift, and go to state 254 - - superClass go to state 255 - - -State 174 - - 123 classdeclLine: CLASSDECL CLASS_SYM $@22 . classDeclFlags semiColonOrError - - ',' shift, and go to state 175 - - $default reduce using rule 126 (classDeclFlags) - - classDeclFlags go to state 256 - - -State 175 - - 125 classDeclFlags: ',' . NEVER_SAVED - - NEVER_SAVED shift, and go to state 257 - - -State 176 - - 124 classdeclLine: CLASSDECL IDENT classDeclFlags . semiColonOrError - - error shift, and go to state 258 - ';' shift, and go to state 259 - - semiColonOrError go to state 260 - - -State 177 - - 133 messageFinish: '(' . $@26 MSG_SYM ')' IDENT ';' - - $default reduce using rule 132 ($@26) - - $@26 go to state 261 - - -State 178 - - 128 messageLine: MESSAGE $@23 messageFinish . - - $default reduce using rule 128 (messageLine) - - -State 179 - - 131 messageFinish: typeDeclString . '(' $@24 stackFlag messageParamListOrNull ')' $@25 messageReturn ';' - - '(' shift, and go to state 262 - - -State 180 - - 217 messageSymOrIdentErr: MSG_SYM . - - $default reduce using rule 217 (messageSymOrIdentErr) - - -State 181 - - 218 messageSymOrIdentErr: IDENT . - - $default reduce using rule 218 (messageSymOrIdentErr) - - -State 182 - - 222 aliasLine: ALIAS '(' messageSymOrIdentErr . ')' $@35 typeDeclString '(' $@36 stackFlag messageParamListOrNull ')' $@37 messageReturn ';' - - ')' shift, and go to state 263 - - -State 183 - - 226 prototypeLine: PROTOTYPE $@38 typeDeclString . '(' $@39 stackFlag messageParamListOrNull ')' $@40 messageReturn ';' - - '(' shift, and go to state 264 - - -State 184 - - 191 reserveNum: CONST . - - $default reduce using rule 191 (reserveNum) - - -State 185 - - 189 reserveMessagesLine: RESERVE_MESSAGES $@29 reserveNum . semiColonOrError - - error shift, and go to state 258 - ';' shift, and go to state 259 - - semiColonOrError go to state 265 - - -State 186 - - 190 reserveMessagesLine: RESERVE_MESSAGES exportSymOrError ',' . reserveNum semiColonOrError - - CONST shift, and go to state 184 - - $default reduce using rule 192 (reserveNum) - - reserveNum go to state 266 - - -State 187 - - 206 exportMessagesLine: EXPORT_MESSAGES IDENT $@31 . exportNum semiColonOrError - - ',' shift, and go to state 267 - - $default reduce using rule 208 (exportNum) - - exportNum go to state 268 - - -State 188 - - 211 importMessagePrefix: IMPORT_MESSAGE exportSymOrError ',' . - - $default reduce using rule 211 (importMessagePrefix) - - -State 189 - - 204 primary: MSG_SYM . - - $default reduce using rule 204 (primary) - - -State 190 - - 203 primary: CONST . - - $default reduce using rule 203 (primary) - - -State 191 - - 201 primary: '(' . numExpr ')' - - MSG_SYM shift, and go to state 189 - CONST shift, and go to state 190 - '(' shift, and go to state 191 - '-' shift, and go to state 192 - - numExpr go to state 269 - primary go to state 195 - - -State 192 - - 202 primary: '-' . primary - - MSG_SYM shift, and go to state 189 - CONST shift, and go to state 190 - '(' shift, and go to state 191 - '-' shift, and go to state 192 - - primary go to state 270 - - -State 193 - - 194 setMessageLine: SET_MESSAGE_NUM $@30 setMessageNum . semiColonOrError - - error shift, and go to state 258 - ';' shift, and go to state 259 - - semiColonOrError go to state 271 - - -State 194 - - 196 setMessageNum: numExpr . - 198 numExpr: numExpr . '+' primary - 199 | numExpr . '-' primary - - '+' shift, and go to state 272 - '-' shift, and go to state 273 - - $default reduce using rule 196 (setMessageNum) - - -State 195 - - 200 numExpr: primary . - - $default reduce using rule 200 (numExpr) - - -State 196 - - 195 setMessageLine: SET_MESSAGE_NUM exportSymOrError ',' . setMessageNum semiColonOrError - - MSG_SYM shift, and go to state 189 - CONST shift, and go to state 190 - '(' shift, and go to state 191 - '-' shift, and go to state 192 - - $default reduce using rule 197 (setMessageNum) - - setMessageNum go to state 274 - numExpr go to state 194 - primary go to state 195 - - -State 197 - - 73 instanceLineType: COMPOSITE . $@4 IDENT '=' LINK_SYM - - $default reduce using rule 72 ($@4) - - $@4 go to state 275 - - -State 198 - - 75 instanceLineType: LINK . $@5 kbdPathOrNull IDENT - - $default reduce using rule 74 ($@5) - - $@5 go to state 276 - - -State 199 - - 77 instanceLineType: VIS_MONIKER . $@6 IDENT - - $default reduce using rule 76 ($@6) - - $@6 go to state 277 - - -State 200 - - 79 instanceLineType: KBD_ACCELERATOR . $@7 IDENT - - $default reduce using rule 78 ($@7) - - $@7 go to state 278 - - -State 201 - - 71 instanceLine: INSTANCE $@3 instanceLineType . ';' - - ';' shift, and go to state 279 - - -State 202 - - 81 instanceLineType: typeDeclString . $@8 instanceDefault - - $default reduce using rule 80 ($@8) - - $@8 go to state 280 - - -State 203 - - 422 visMonikerLine: VIS_MONIKER visMonikerOrIdent '=' . $@91 visMonikerDef - - $default reduce using rule 421 ($@91) - - $@91 go to state 281 - - -State 204 - - 104 defaultLine: DEFAULT defaultableSym '=' . $@15 FAKESTRING $@16 ';' - - $default reduce using rule 102 ($@15) - - $@15 go to state 282 - - -State 205 - - 111 relocLine: RELOC $@17 FAKESTRING . $@18 ',' relocTail - - $default reduce using rule 110 ($@18) - - $@18 go to state 283 - - -State 206 - - 284 objDest: PARENT . $@50 FAKESTRING ',' $@51 FAKESTRING ':' - - $default reduce using rule 282 ($@50) - - $@50 go to state 284 - - -State 207 - - 287 objDest: CHILDREN . $@52 FAKESTRING ',' FAKESTRING ',' $@53 FAKESTRING ':' - - $default reduce using rule 285 ($@52) - - $@52 go to state 285 - - -State 208 - - 280 objDest: FAKESTRING . ':' - 281 | FAKESTRING . ',' FAKESTRING ':' - - ',' shift, and go to state 286 - ':' shift, and go to state 287 - - -State 209 - - 273 semiOrParens: ';' . - - $default reduce using rule 273 (semiOrParens) - - -State 210 - - 274 semiOrParens: '(' . ')' - - ')' shift, and go to state 288 - - -State 211 - - 275 callsuperStuff: semiOrParens . - - $default reduce using rule 275 (callsuperStuff) - - -State 212 - - 272 callsuperLine: CALL_SUPER $@46 callsuperStuff . - - $default reduce using rule 272 (callsuperLine) - - -State 213 - - 279 callsuperStuff: objDest . $@47 ':' classOrError ':' ':' messageSymOrIdentErr '(' $@48 FakeStringOrNothing $@49 ')' - - $default reduce using rule 276 ($@47) - - $@47 go to state 289 - - -State 214 - - 304 dispatchOrDispatchCall: DISPATCHCALL '(' MSG_SYM . ')' - - ')' shift, and go to state 290 - - -State 215 - - 308 newDispatchOrDispatchCall: DISPATCHCALL '(' '(' . MSG_SYM ')' - - MSG_SYM shift, and go to state 291 - - -State 216 - - 395 LocalizationLine: LOCALIZE NOT ';' . - - $default reduce using rule 395 (LocalizationLine) - - -State 217 - - 398 simpleLocalization: LOCALIZE STRING ';' . - - $default reduce using rule 398 (simpleLocalization) - - -State 218 - - 393 LocalizationLine: LOCALIZE '{' STRING . CONST '}' ';' - 394 | LOCALIZE '{' STRING . CONST '-' CONST '}' ';' - 397 simpleLocalization: LOCALIZE '{' STRING . '}' ';' - - CONST shift, and go to state 292 - '}' shift, and go to state 293 - - -State 219 - - 316 startLine: START RESOURCE_SYM $@59 . startFlags semiColonOrError - - ',' shift, and go to state 294 - - $default reduce using rule 320 (startFlags) - - startFlags go to state 295 - - -State 220 - - 314 startLine: START IDENT $@58 . startFlags semiColonOrError - - ',' shift, and go to state 294 - - $default reduce using rule 320 (startFlags) - - startFlags go to state 296 - - -State 221 - - 325 headerLine: HEADER IDENT '=' . $@60 FAKESTRING $@61 ';' - - $default reduce using rule 323 ($@60) - - $@60 go to state 297 - - -State 222 - - 329 chunkLine: CHUNK $@62 typeDeclString . '=' $@63 FAKESTRING $@64 ';' - - '=' shift, and go to state 298 - - -State 223 - - 463 objectOrIdent: OBJECT_SYM . - - $default reduce using rule 463 (objectOrIdent) - - -State 224 - - 464 objectOrIdent: IDENT . - - $default reduce using rule 464 (objectOrIdent) - - -State 225 - - 349 objectLine: OBJECT classOrError objectOrIdent . '=' ignoreDirtyFlag '{' $@77 objectFieldList '}' - - '=' shift, and go to state 299 - - -State 226 - - 321 resourceOutputLine: RESOURCE_OUTPUT '=' objectOrIdent . - - $default reduce using rule 321 (resourceOutputLine) - - -State 227 - - 89 vardataLine: VARDATA $@10 typeDeclString . $@11 ';' - - $default reduce using rule 88 ($@11) - - $@11 go to state 300 - - -State 228 - - 96 vardataClass: CLASS_SYM . $@12 ':' ':' - - $default reduce using rule 95 ($@12) - - $@12 go to state 301 - - -State 229 - - 90 vardataSymOrError: VARDATA_SYM . - - $default reduce using rule 90 (vardataSymOrError) - - -State 230 - - 94 vardataSymOrError: IDENT . - - $default reduce using rule 94 (vardataSymOrError) - - -State 231 - - 99 vardataAliasLine: VARDATA_ALIAS '(' vardataSymOrError . ')' $@13 IDENT $@14 IDENT - - ')' shift, and go to state 302 - - -State 232 - - 91 vardataSymOrError: vardataClass . VARDATA_SYM - 92 | vardataClass . IDENT - 93 | vardataClass . error - - error shift, and go to state 303 - VARDATA_SYM shift, and go to state 304 - IDENT shift, and go to state 305 - - -State 233 - - 253 externLine: EXTERN VIS_MONIKER VIS_MONIKER_CHUNK_SYM . semiColonOrError - - error shift, and go to state 258 - ';' shift, and go to state 259 - - semiColonOrError go to state 306 - - -State 234 - - 252 externLine: EXTERN VIS_MONIKER IDENT . semiColonOrError - - error shift, and go to state 258 - ';' shift, and go to state 259 - - semiColonOrError go to state 307 - - -State 235 - - 251 externLine: EXTERN CHUNK CHUNK_SYM . semiColonOrError - - error shift, and go to state 258 - ';' shift, and go to state 259 - - semiColonOrError go to state 308 - - -State 236 - - 250 externLine: EXTERN CHUNK IDENT . semiColonOrError - - error shift, and go to state 258 - ';' shift, and go to state 259 - - semiColonOrError go to state 309 - - -State 237 - - 249 externLine: EXTERN OBJECT OBJECT_SYM . semiColonOrError - - error shift, and go to state 258 - ';' shift, and go to state 259 - - semiColonOrError go to state 310 - - -State 238 - - 248 externLine: EXTERN OBJECT IDENT . semiColonOrError - - error shift, and go to state 258 - ';' shift, and go to state 259 - - semiColonOrError go to state 311 - - -State 239 - - 49 norelocLine: NORELOC OPTR_SYM ';' . - - $default reduce using rule 49 (norelocLine) - - -State 240 - - 51 usesLine: USES error ';' . - - $default reduce using rule 51 (usesLine) - - -State 241 - - 50 usesLine: USES usesClassList ';' . - - $default reduce using rule 50 (usesLine) - - -State 242 - - 53 usesClassList: usesClassList ',' . CLASS_SYM - - CLASS_SYM shift, and go to state 312 - - -State 243 - - 340 chunkLine: GSTRING_SYM $@70 IDENT . @71 '=' @72 GStrings $@73 ';' - - $default reduce using rule 337 (@71) - - @71 go to state 313 - - -State 244 - - 216 importMessageLine: importMessagePrefix '(' $@34 . messageSymOrIdentErr ')' IDENT ';' - - MSG_SYM shift, and go to state 180 - IDENT shift, and go to state 181 - - messageSymOrIdentErr go to state 314 - - -State 245 - - 214 importMessageLine: importMessagePrefix typeDeclString '(' . $@32 stackFlag messageParamListOrNull ')' $@33 messageReturn ';' - - $default reduce using rule 212 ($@32) - - $@32 go to state 315 - - -State 246 - - 229 identCommaOrNothing: IDENT . ',' - - ',' shift, and go to state 316 - - -State 247 - - 236 methodLine: externMethodOrMethod methodModel identCommaOrNothing . classOrError $@41 ',' methodMessageList openCurlyOrSemiColon - - error shift, and go to state 142 - CLASS_SYM shift, and go to state 143 - - classOrError go to state 317 - - -State 248 - - 264 sendOrCallOrRecordLine: sendOrCallOrRecord $@42 ObjFlagListOrNull . optCastWithNoBraces objDest $@43 ':' optCastMessage objMessage '(' $@44 FakeStringOrNothing $@45 ')' - 293 ObjFlagListOrNull: ObjFlagListOrNull . objFlag - - FORCE_QUEUE shift, and go to state 318 - RETURN_ERROR shift, and go to state 319 - CHECK_DUPLICATE shift, and go to state 320 - NO_FREE shift, and go to state 321 - CHECK_LAST_ONLY shift, and go to state 322 - REPLACE shift, and go to state 323 - INSERT_AT_FRONT shift, and go to state 324 - CAN_DISCARD_IF_DESPARATE shift, and go to state 325 - MSG_SYM shift, and go to state 326 - - $default reduce using rule 270 (optCastWithNoBraces) - - optCastWithNoBraces go to state 327 - objFlag go to state 328 - - -State 249 - - 306 dispatchOrDispatchCallLine: dispatchOrDispatchCall $@56 IDENT . - - $default reduce using rule 306 (dispatchOrDispatchCallLine) - - -State 250 - - 310 newDispatchOrDispatchCallLine: newDispatchOrDispatchCall FAKESTRING $@57 . ')' - - ')' shift, and go to state 329 - - -State 251 - - 335 chunkLine: cArrayType $@65 IDENT . $@66 caHeader IDENT $@67 '=' $@68 FAKESTRING $@69 ';' - - $default reduce using rule 331 ($@66) - - $@66 go to state 330 - - -State 252 - - 63 superClass: META . - - $default reduce using rule 63 (superClass) - - -State 253 - - 62 superClass: CLASS_SYM . - - $default reduce using rule 62 (superClass) - - -State 254 - - 64 superClass: IDENT . - - $default reduce using rule 64 (superClass) - - -State 255 - - 61 classLine: CLASS IDENT commaOrNothing superClass . $@2 classFlags semiColonOrError - - $default reduce using rule 60 ($@2) - - $@2 go to state 331 - - -State 256 - - 123 classdeclLine: CLASSDECL CLASS_SYM $@22 classDeclFlags . semiColonOrError - - error shift, and go to state 258 - ';' shift, and go to state 259 - - semiColonOrError go to state 332 - - -State 257 - - 125 classDeclFlags: ',' NEVER_SAVED . - - $default reduce using rule 125 (classDeclFlags) - - -State 258 - - 57 semiColonOrError: error . - - $default reduce using rule 57 (semiColonOrError) - - -State 259 - - 56 semiColonOrError: ';' . - - $default reduce using rule 56 (semiColonOrError) - - -State 260 - - 124 classdeclLine: CLASSDECL IDENT classDeclFlags semiColonOrError . - - $default reduce using rule 124 (classdeclLine) - - -State 261 - - 133 messageFinish: '(' $@26 . MSG_SYM ')' IDENT ';' - - MSG_SYM shift, and go to state 333 - - -State 262 - - 131 messageFinish: typeDeclString '(' . $@24 stackFlag messageParamListOrNull ')' $@25 messageReturn ';' - - $default reduce using rule 129 ($@24) - - $@24 go to state 334 - - -State 263 - - 222 aliasLine: ALIAS '(' messageSymOrIdentErr ')' . $@35 typeDeclString '(' $@36 stackFlag messageParamListOrNull ')' $@37 messageReturn ';' - - $default reduce using rule 219 ($@35) - - $@35 go to state 335 - - -State 264 - - 226 prototypeLine: PROTOTYPE $@38 typeDeclString '(' . $@39 stackFlag messageParamListOrNull ')' $@40 messageReturn ';' - - $default reduce using rule 224 ($@39) - - $@39 go to state 336 - - -State 265 - - 189 reserveMessagesLine: RESERVE_MESSAGES $@29 reserveNum semiColonOrError . - - $default reduce using rule 189 (reserveMessagesLine) - - -State 266 - - 190 reserveMessagesLine: RESERVE_MESSAGES exportSymOrError ',' reserveNum . semiColonOrError - - error shift, and go to state 258 - ';' shift, and go to state 259 - - semiColonOrError go to state 337 - - -State 267 - - 207 exportNum: ',' . CONST - - CONST shift, and go to state 338 - - -State 268 - - 206 exportMessagesLine: EXPORT_MESSAGES IDENT $@31 exportNum . semiColonOrError - - error shift, and go to state 258 - ';' shift, and go to state 259 - - semiColonOrError go to state 339 - - -State 269 - - 198 numExpr: numExpr . '+' primary - 199 | numExpr . '-' primary - 201 primary: '(' numExpr . ')' - - ')' shift, and go to state 340 - '+' shift, and go to state 272 - '-' shift, and go to state 273 - - -State 270 - - 202 primary: '-' primary . - - $default reduce using rule 202 (primary) - - -State 271 - - 194 setMessageLine: SET_MESSAGE_NUM $@30 setMessageNum semiColonOrError . - - $default reduce using rule 194 (setMessageLine) - - -State 272 - - 198 numExpr: numExpr '+' . primary - - MSG_SYM shift, and go to state 189 - CONST shift, and go to state 190 - '(' shift, and go to state 191 - '-' shift, and go to state 192 - - primary go to state 341 - - -State 273 - - 199 numExpr: numExpr '-' . primary - - MSG_SYM shift, and go to state 189 - CONST shift, and go to state 190 - '(' shift, and go to state 191 - '-' shift, and go to state 192 - - primary go to state 342 - - -State 274 - - 195 setMessageLine: SET_MESSAGE_NUM exportSymOrError ',' setMessageNum . semiColonOrError - - error shift, and go to state 258 - ';' shift, and go to state 259 - - semiColonOrError go to state 343 - - -State 275 - - 73 instanceLineType: COMPOSITE $@4 . IDENT '=' LINK_SYM - - IDENT shift, and go to state 344 - - -State 276 - - 75 instanceLineType: LINK $@5 . kbdPathOrNull IDENT - - KBD_PATH shift, and go to state 345 - - $default reduce using rule 83 (kbdPathOrNull) - - kbdPathOrNull go to state 346 - - -State 277 - - 77 instanceLineType: VIS_MONIKER $@6 . IDENT - - IDENT shift, and go to state 347 - - -State 278 - - 79 instanceLineType: KBD_ACCELERATOR $@7 . IDENT - - IDENT shift, and go to state 348 - - -State 279 - - 71 instanceLine: INSTANCE $@3 instanceLineType ';' . - - $default reduce using rule 71 (instanceLine) - - -State 280 - - 81 instanceLineType: typeDeclString $@8 . instanceDefault - - '=' shift, and go to state 349 - - $default reduce using rule 86 (instanceDefault) - - instanceDefault go to state 350 - - -State 281 - - 422 visMonikerLine: VIS_MONIKER visMonikerOrIdent '=' $@91 . visMonikerDef - - error shift, and go to state 351 - - LIST_SYM reduce using rule 425 ($@92) - GSTRING_SYM reduce using rule 425 ($@92) - STRING reduce using rule 425 ($@92) - ASCIISTRING reduce using rule 425 ($@92) - LSTRING reduce using rule 425 ($@92) - SJISSTRING reduce using rule 425 ($@92) - TSTRING reduce using rule 425 ($@92) - CHAR reduce using rule 425 ($@92) - CONST reduce using rule 425 ($@92) - '{' reduce using rule 425 ($@92) - - visMonikerDef go to state 352 - $@92 go to state 353 - - -State 282 - - 104 defaultLine: DEFAULT defaultableSym '=' $@15 . FAKESTRING $@16 ';' - - FAKESTRING shift, and go to state 354 - - -State 283 - - 111 relocLine: RELOC $@17 FAKESTRING $@18 . ',' relocTail - - ',' shift, and go to state 355 - - -State 284 - - 284 objDest: PARENT $@50 . FAKESTRING ',' $@51 FAKESTRING ':' - - FAKESTRING shift, and go to state 356 - - -State 285 - - 287 objDest: CHILDREN $@52 . FAKESTRING ',' FAKESTRING ',' $@53 FAKESTRING ':' - - FAKESTRING shift, and go to state 357 - - -State 286 - - 281 objDest: FAKESTRING ',' . FAKESTRING ':' - - FAKESTRING shift, and go to state 358 - - -State 287 - - 280 objDest: FAKESTRING ':' . - - $default reduce using rule 280 (objDest) - - -State 288 - - 274 semiOrParens: '(' ')' . - - $default reduce using rule 274 (semiOrParens) - - -State 289 - - 279 callsuperStuff: objDest $@47 . ':' classOrError ':' ':' messageSymOrIdentErr '(' $@48 FakeStringOrNothing $@49 ')' - - ':' shift, and go to state 359 - - -State 290 - - 304 dispatchOrDispatchCall: DISPATCHCALL '(' MSG_SYM ')' . - - $default reduce using rule 304 (dispatchOrDispatchCall) - - -State 291 - - 308 newDispatchOrDispatchCall: DISPATCHCALL '(' '(' MSG_SYM . ')' - - ')' shift, and go to state 360 - - -State 292 - - 393 LocalizationLine: LOCALIZE '{' STRING CONST . '}' ';' - 394 | LOCALIZE '{' STRING CONST . '-' CONST '}' ';' - - '-' shift, and go to state 361 - '}' shift, and go to state 362 - - -State 293 - - 397 simpleLocalization: LOCALIZE '{' STRING '}' . ';' - - ';' shift, and go to state 363 - - -State 294 - - 317 startFlags: ',' . NOT_DETACHABLE - 318 | ',' . DATA - 319 | ',' . NOT_LMEM - - DATA shift, and go to state 364 - NOT_LMEM shift, and go to state 365 - NOT_DETACHABLE shift, and go to state 366 - - -State 295 - - 316 startLine: START RESOURCE_SYM $@59 startFlags . semiColonOrError - - error shift, and go to state 258 - ';' shift, and go to state 259 - - semiColonOrError go to state 367 - - -State 296 - - 314 startLine: START IDENT $@58 startFlags . semiColonOrError - - error shift, and go to state 258 - ';' shift, and go to state 259 - - semiColonOrError go to state 368 - - -State 297 - - 325 headerLine: HEADER IDENT '=' $@60 . FAKESTRING $@61 ';' - - FAKESTRING shift, and go to state 369 - - -State 298 - - 329 chunkLine: CHUNK $@62 typeDeclString '=' . $@63 FAKESTRING $@64 ';' - - $default reduce using rule 327 ($@63) - - $@63 go to state 370 - - -State 299 - - 349 objectLine: OBJECT classOrError objectOrIdent '=' . ignoreDirtyFlag '{' $@77 objectFieldList '}' - - IGNORE_DIRTY shift, and go to state 371 - - $default reduce using rule 351 (ignoreDirtyFlag) - - ignoreDirtyFlag go to state 372 - - -State 300 - - 89 vardataLine: VARDATA $@10 typeDeclString $@11 . ';' - - ';' shift, and go to state 373 - - -State 301 - - 96 vardataClass: CLASS_SYM $@12 . ':' ':' - - ':' shift, and go to state 374 - - -State 302 - - 99 vardataAliasLine: VARDATA_ALIAS '(' vardataSymOrError ')' . $@13 IDENT $@14 IDENT - - $default reduce using rule 97 ($@13) - - $@13 go to state 375 - - -State 303 - - 93 vardataSymOrError: vardataClass error . - - $default reduce using rule 93 (vardataSymOrError) - - -State 304 - - 91 vardataSymOrError: vardataClass VARDATA_SYM . - - $default reduce using rule 91 (vardataSymOrError) - - -State 305 - - 92 vardataSymOrError: vardataClass IDENT . - - $default reduce using rule 92 (vardataSymOrError) - - -State 306 - - 253 externLine: EXTERN VIS_MONIKER VIS_MONIKER_CHUNK_SYM semiColonOrError . - - $default reduce using rule 253 (externLine) - - -State 307 - - 252 externLine: EXTERN VIS_MONIKER IDENT semiColonOrError . - - $default reduce using rule 252 (externLine) - - -State 308 - - 251 externLine: EXTERN CHUNK CHUNK_SYM semiColonOrError . - - $default reduce using rule 251 (externLine) - - -State 309 - - 250 externLine: EXTERN CHUNK IDENT semiColonOrError . - - $default reduce using rule 250 (externLine) - - -State 310 - - 249 externLine: EXTERN OBJECT OBJECT_SYM semiColonOrError . - - $default reduce using rule 249 (externLine) - - -State 311 - - 248 externLine: EXTERN OBJECT IDENT semiColonOrError . - - $default reduce using rule 248 (externLine) - - -State 312 - - 53 usesClassList: usesClassList ',' CLASS_SYM . - - $default reduce using rule 53 (usesClassList) - - -State 313 - - 340 chunkLine: GSTRING_SYM $@70 IDENT @71 . '=' @72 GStrings $@73 ';' - - '=' shift, and go to state 376 - - -State 314 - - 216 importMessageLine: importMessagePrefix '(' $@34 messageSymOrIdentErr . ')' IDENT ';' - - ')' shift, and go to state 377 - - -State 315 - - 214 importMessageLine: importMessagePrefix typeDeclString '(' $@32 . stackFlag messageParamListOrNull ')' $@33 messageReturn ';' - - STACK shift, and go to state 378 - - $default reduce using rule 140 (stackFlag) - - stackFlag go to state 379 - - -State 316 - - 229 identCommaOrNothing: IDENT ',' . - - $default reduce using rule 229 (identCommaOrNothing) - - -State 317 - - 236 methodLine: externMethodOrMethod methodModel identCommaOrNothing classOrError . $@41 ',' methodMessageList openCurlyOrSemiColon - - $default reduce using rule 235 ($@41) - - $@41 go to state 380 - - -State 318 - - 295 objFlag: FORCE_QUEUE . - - $default reduce using rule 295 (objFlag) - - -State 319 - - 296 objFlag: RETURN_ERROR . - - $default reduce using rule 296 (objFlag) - - -State 320 - - 297 objFlag: CHECK_DUPLICATE . - - $default reduce using rule 297 (objFlag) - - -State 321 - - 302 objFlag: NO_FREE . - - $default reduce using rule 302 (objFlag) - - -State 322 - - 298 objFlag: CHECK_LAST_ONLY . - - $default reduce using rule 298 (objFlag) - - -State 323 - - 299 objFlag: REPLACE . - - $default reduce using rule 299 (objFlag) - - -State 324 - - 300 objFlag: INSERT_AT_FRONT . - - $default reduce using rule 300 (objFlag) - - -State 325 - - 301 objFlag: CAN_DISCARD_IF_DESPARATE . - - $default reduce using rule 301 (objFlag) - - -State 326 - - 269 optCastWithNoBraces: MSG_SYM . - - $default reduce using rule 269 (optCastWithNoBraces) - - -State 327 - - 264 sendOrCallOrRecordLine: sendOrCallOrRecord $@42 ObjFlagListOrNull optCastWithNoBraces . objDest $@43 ':' optCastMessage objMessage '(' $@44 FakeStringOrNothing $@45 ')' - - PARENT shift, and go to state 206 - CHILDREN shift, and go to state 207 - FAKESTRING shift, and go to state 208 - - objDest go to state 381 - - -State 328 - - 293 ObjFlagListOrNull: ObjFlagListOrNull objFlag . - - $default reduce using rule 293 (ObjFlagListOrNull) - - -State 329 - - 310 newDispatchOrDispatchCallLine: newDispatchOrDispatchCall FAKESTRING $@57 ')' . - - $default reduce using rule 310 (newDispatchOrDispatchCallLine) - - -State 330 - - 335 chunkLine: cArrayType $@65 IDENT $@66 . caHeader IDENT $@67 '=' $@68 FAKESTRING $@69 ';' - - '(' shift, and go to state 382 - - $default reduce using rule 347 (caHeader) - - caHeader go to state 383 - - -State 331 - - 61 classLine: CLASS IDENT commaOrNothing superClass $@2 . classFlags semiColonOrError - - ',' shift, and go to state 384 - - $default reduce using rule 68 (classFlags) - - classFlags go to state 385 - - -State 332 - - 123 classdeclLine: CLASSDECL CLASS_SYM $@22 classDeclFlags semiColonOrError . - - $default reduce using rule 123 (classdeclLine) - - -State 333 - - 133 messageFinish: '(' $@26 MSG_SYM . ')' IDENT ';' - - ')' shift, and go to state 386 - - -State 334 - - 131 messageFinish: typeDeclString '(' $@24 . stackFlag messageParamListOrNull ')' $@25 messageReturn ';' - - STACK shift, and go to state 378 - - $default reduce using rule 140 (stackFlag) - - stackFlag go to state 387 - - -State 335 - - 222 aliasLine: ALIAS '(' messageSymOrIdentErr ')' $@35 . typeDeclString '(' $@36 stackFlag messageParamListOrNull ')' $@37 messageReturn ';' - - STRING shift, and go to state 161 - - typeDeclString go to state 388 - - -State 336 - - 226 prototypeLine: PROTOTYPE $@38 typeDeclString '(' $@39 . stackFlag messageParamListOrNull ')' $@40 messageReturn ';' - - STACK shift, and go to state 378 - - $default reduce using rule 140 (stackFlag) - - stackFlag go to state 389 - - -State 337 - - 190 reserveMessagesLine: RESERVE_MESSAGES exportSymOrError ',' reserveNum semiColonOrError . - - $default reduce using rule 190 (reserveMessagesLine) - - -State 338 - - 207 exportNum: ',' CONST . - - $default reduce using rule 207 (exportNum) - - -State 339 - - 206 exportMessagesLine: EXPORT_MESSAGES IDENT $@31 exportNum semiColonOrError . - - $default reduce using rule 206 (exportMessagesLine) - - -State 340 - - 201 primary: '(' numExpr ')' . - - $default reduce using rule 201 (primary) - - -State 341 - - 198 numExpr: numExpr '+' primary . - - $default reduce using rule 198 (numExpr) - - -State 342 - - 199 numExpr: numExpr '-' primary . - - $default reduce using rule 199 (numExpr) - - -State 343 - - 195 setMessageLine: SET_MESSAGE_NUM exportSymOrError ',' setMessageNum semiColonOrError . - - $default reduce using rule 195 (setMessageLine) - - -State 344 - - 73 instanceLineType: COMPOSITE $@4 IDENT . '=' LINK_SYM - - '=' shift, and go to state 390 - - -State 345 - - 82 kbdPathOrNull: KBD_PATH . - - $default reduce using rule 82 (kbdPathOrNull) - - -State 346 - - 75 instanceLineType: LINK $@5 kbdPathOrNull . IDENT - - IDENT shift, and go to state 391 - - -State 347 - - 77 instanceLineType: VIS_MONIKER $@6 IDENT . - - $default reduce using rule 77 (instanceLineType) - - -State 348 - - 79 instanceLineType: KBD_ACCELERATOR $@7 IDENT . - - $default reduce using rule 79 (instanceLineType) - - -State 349 - - 85 instanceDefault: '=' . $@9 FAKESTRING - - $default reduce using rule 84 ($@9) - - $@9 go to state 392 - - -State 350 - - 81 instanceLineType: typeDeclString $@8 instanceDefault . - - $default reduce using rule 81 (instanceLineType) - - -State 351 - - 427 visMonikerDef: error . - - $default reduce using rule 427 (visMonikerDef) - - -State 352 - - 422 visMonikerLine: VIS_MONIKER visMonikerOrIdent '=' $@91 visMonikerDef . - - $default reduce using rule 422 (visMonikerLine) - - -State 353 - - 426 visMonikerDef: $@92 . vmMiddle - - LIST_SYM shift, and go to state 393 - GSTRING_SYM shift, and go to state 394 - STRING shift, and go to state 395 - ASCIISTRING shift, and go to state 396 - LSTRING shift, and go to state 397 - SJISSTRING shift, and go to state 398 - TSTRING shift, and go to state 399 - CHAR shift, and go to state 400 - CONST shift, and go to state 401 - '{' shift, and go to state 402 - - someString go to state 403 - vmMiddle go to state 404 - vmMiddleNonList go to state 405 - vmNavChar go to state 406 - - -State 354 - - 104 defaultLine: DEFAULT defaultableSym '=' $@15 FAKESTRING . $@16 ';' - - $default reduce using rule 103 ($@16) - - $@16 go to state 407 - - -State 355 - - 111 relocLine: RELOC $@17 FAKESTRING $@18 ',' . relocTail - - FAKESTRING shift, and go to state 408 - '(' shift, and go to state 409 - - $default reduce using rule 118 (relocCount) - - relocTail go to state 410 - relocCount go to state 411 - - -State 356 - - 284 objDest: PARENT $@50 FAKESTRING . ',' $@51 FAKESTRING ':' - - ',' shift, and go to state 412 - - -State 357 - - 287 objDest: CHILDREN $@52 FAKESTRING . ',' FAKESTRING ',' $@53 FAKESTRING ':' - - ',' shift, and go to state 413 - - -State 358 - - 281 objDest: FAKESTRING ',' FAKESTRING . ':' - - ':' shift, and go to state 414 - - -State 359 - - 279 callsuperStuff: objDest $@47 ':' . classOrError ':' ':' messageSymOrIdentErr '(' $@48 FakeStringOrNothing $@49 ')' - - error shift, and go to state 142 - CLASS_SYM shift, and go to state 143 - - classOrError go to state 415 - - -State 360 - - 308 newDispatchOrDispatchCall: DISPATCHCALL '(' '(' MSG_SYM ')' . - - $default reduce using rule 308 (newDispatchOrDispatchCall) - - -State 361 - - 394 LocalizationLine: LOCALIZE '{' STRING CONST '-' . CONST '}' ';' - - CONST shift, and go to state 416 - - -State 362 - - 393 LocalizationLine: LOCALIZE '{' STRING CONST '}' . ';' - - ';' shift, and go to state 417 - - -State 363 - - 397 simpleLocalization: LOCALIZE '{' STRING '}' ';' . - - $default reduce using rule 397 (simpleLocalization) - - -State 364 - - 318 startFlags: ',' DATA . - - $default reduce using rule 318 (startFlags) - - -State 365 - - 319 startFlags: ',' NOT_LMEM . - - $default reduce using rule 319 (startFlags) - - -State 366 - - 317 startFlags: ',' NOT_DETACHABLE . - - $default reduce using rule 317 (startFlags) - - -State 367 - - 316 startLine: START RESOURCE_SYM $@59 startFlags semiColonOrError . - - $default reduce using rule 316 (startLine) - - -State 368 - - 314 startLine: START IDENT $@58 startFlags semiColonOrError . - - $default reduce using rule 314 (startLine) - - -State 369 - - 325 headerLine: HEADER IDENT '=' $@60 FAKESTRING . $@61 ';' - - $default reduce using rule 324 ($@61) - - $@61 go to state 418 - - -State 370 - - 329 chunkLine: CHUNK $@62 typeDeclString '=' $@63 . FAKESTRING $@64 ';' - - FAKESTRING shift, and go to state 419 - - -State 371 - - 350 ignoreDirtyFlag: IGNORE_DIRTY . - - $default reduce using rule 350 (ignoreDirtyFlag) - - -State 372 - - 349 objectLine: OBJECT classOrError objectOrIdent '=' ignoreDirtyFlag . '{' $@77 objectFieldList '}' - - '{' shift, and go to state 420 - - -State 373 - - 89 vardataLine: VARDATA $@10 typeDeclString $@11 ';' . - - $default reduce using rule 89 (vardataLine) - - -State 374 - - 96 vardataClass: CLASS_SYM $@12 ':' . ':' - - ':' shift, and go to state 421 - - -State 375 - - 99 vardataAliasLine: VARDATA_ALIAS '(' vardataSymOrError ')' $@13 . IDENT $@14 IDENT - - IDENT shift, and go to state 422 - - -State 376 - - 340 chunkLine: GSTRING_SYM $@70 IDENT @71 '=' . @72 GStrings $@73 ';' - - $default reduce using rule 338 (@72) - - @72 go to state 423 - - -State 377 - - 216 importMessageLine: importMessagePrefix '(' $@34 messageSymOrIdentErr ')' . IDENT ';' - - IDENT shift, and go to state 424 - - -State 378 - - 139 stackFlag: STACK . - - $default reduce using rule 139 (stackFlag) - - -State 379 - - 214 importMessageLine: importMessagePrefix typeDeclString '(' $@32 stackFlag . messageParamListOrNull ')' $@33 messageReturn ';' - - STRING shift, and go to state 161 - - $default reduce using rule 135 (messageParamListOrNull) - - messageParamListOrNull go to state 425 - messageParamList go to state 426 - messageParam go to state 427 - typeDeclString go to state 428 - - -State 380 - - 236 methodLine: externMethodOrMethod methodModel identCommaOrNothing classOrError $@41 . ',' methodMessageList openCurlyOrSemiColon - - ',' shift, and go to state 429 - - -State 381 - - 264 sendOrCallOrRecordLine: sendOrCallOrRecord $@42 ObjFlagListOrNull optCastWithNoBraces objDest . $@43 ':' optCastMessage objMessage '(' $@44 FakeStringOrNothing $@45 ')' - - $default reduce using rule 261 ($@43) - - $@43 go to state 430 - - -State 382 - - 346 caHeader: '(' . $@74 IDENT '(' $@75 FAKESTRING $@76 ')' ')' - - $default reduce using rule 343 ($@74) - - $@74 go to state 431 - - -State 383 - - 335 chunkLine: cArrayType $@65 IDENT $@66 caHeader . IDENT $@67 '=' $@68 FAKESTRING $@69 ';' - - IDENT shift, and go to state 432 - - -State 384 - - 65 classFlags: ',' . MASTER ',' VARIANT - 66 | ',' . VARIANT ',' MASTER - 67 | ',' . MASTER - - MASTER shift, and go to state 433 - VARIANT shift, and go to state 434 - - -State 385 - - 61 classLine: CLASS IDENT commaOrNothing superClass $@2 classFlags . semiColonOrError - - error shift, and go to state 258 - ';' shift, and go to state 259 - - semiColonOrError go to state 435 - - -State 386 - - 133 messageFinish: '(' $@26 MSG_SYM ')' . IDENT ';' - - IDENT shift, and go to state 436 - - -State 387 - - 131 messageFinish: typeDeclString '(' $@24 stackFlag . messageParamListOrNull ')' $@25 messageReturn ';' - - STRING shift, and go to state 161 - - $default reduce using rule 135 (messageParamListOrNull) - - messageParamListOrNull go to state 437 - messageParamList go to state 426 - messageParam go to state 427 - typeDeclString go to state 428 - - -State 388 - - 222 aliasLine: ALIAS '(' messageSymOrIdentErr ')' $@35 typeDeclString . '(' $@36 stackFlag messageParamListOrNull ')' $@37 messageReturn ';' - - '(' shift, and go to state 438 - - -State 389 - - 226 prototypeLine: PROTOTYPE $@38 typeDeclString '(' $@39 stackFlag . messageParamListOrNull ')' $@40 messageReturn ';' - - STRING shift, and go to state 161 - - $default reduce using rule 135 (messageParamListOrNull) - - messageParamListOrNull go to state 439 - messageParamList go to state 426 - messageParam go to state 427 - typeDeclString go to state 428 - - -State 390 - - 73 instanceLineType: COMPOSITE $@4 IDENT '=' . LINK_SYM - - LINK_SYM shift, and go to state 440 - - -State 391 - - 75 instanceLineType: LINK $@5 kbdPathOrNull IDENT . - - $default reduce using rule 75 (instanceLineType) - - -State 392 - - 85 instanceDefault: '=' $@9 . FAKESTRING - - FAKESTRING shift, and go to state 441 - - -State 393 - - 428 vmMiddle: LIST_SYM . '{' vmArray '}' - - '{' shift, and go to state 442 - - -State 394 - - 432 vmMiddleNonList: GSTRING_SYM . vmGStrings - - $default reduce using rule 440 (@93) - - vmGStrings go to state 443 - @93 go to state 444 - - -State 395 - - 388 someString: STRING . - 436 vmNavChar: STRING . ',' someString - - ',' shift, and go to state 445 - - $default reduce using rule 388 (someString) - - -State 396 - - 389 someString: ASCIISTRING . - - $default reduce using rule 389 (someString) - - -State 397 - - 391 someString: LSTRING . - - $default reduce using rule 391 (someString) - - -State 398 - - 392 someString: SJISSTRING . - - $default reduce using rule 392 (someString) - - -State 399 - - 390 someString: TSTRING . - - $default reduce using rule 390 (someString) - - -State 400 - - 434 vmNavChar: CHAR . ',' someString - - ',' shift, and go to state 446 - - -State 401 - - 435 vmNavChar: CONST . ',' someString - - ',' shift, and go to state 447 - - -State 402 - - 431 vmMiddleNonList: '{' . vmList vmNavChar ';' '}' - 433 | '{' . vmList GSTRING_SYM vmGStrings '}' - - $default reduce using rule 439 (vmList) - - vmList go to state 448 - - -State 403 - - 437 vmNavChar: someString . - - $default reduce using rule 437 (vmNavChar) - - -State 404 - - 426 visMonikerDef: $@92 vmMiddle . - - $default reduce using rule 426 (visMonikerDef) - - -State 405 - - 429 vmMiddle: vmMiddleNonList . - - $default reduce using rule 429 (vmMiddle) - - -State 406 - - 430 vmMiddleNonList: vmNavChar . ';' - - ';' shift, and go to state 449 - - -State 407 - - 104 defaultLine: DEFAULT defaultableSym '=' $@15 FAKESTRING $@16 . ';' - - ';' shift, and go to state 450 - - -State 408 - - 114 relocTail: FAKESTRING . $@19 ',' relocCount relocType - - $default reduce using rule 113 ($@19) - - $@19 go to state 451 - - -State 409 - - 117 relocCount: '(' . CONST ',' $@20 FAKESTRING $@21 ')' - - CONST shift, and go to state 452 - - -State 410 - - 111 relocLine: RELOC $@17 FAKESTRING $@18 ',' relocTail . - - $default reduce using rule 111 (relocLine) - - -State 411 - - 112 relocTail: relocCount . relocType - - FPTR shift, and go to state 453 - HPTR shift, and go to state 454 - OPTR shift, and go to state 455 - - relocType go to state 456 - - -State 412 - - 284 objDest: PARENT $@50 FAKESTRING ',' . $@51 FAKESTRING ':' - - $default reduce using rule 283 ($@51) - - $@51 go to state 457 - - -State 413 - - 287 objDest: CHILDREN $@52 FAKESTRING ',' . FAKESTRING ',' $@53 FAKESTRING ':' - - FAKESTRING shift, and go to state 458 - - -State 414 - - 281 objDest: FAKESTRING ',' FAKESTRING ':' . - - $default reduce using rule 281 (objDest) - - -State 415 - - 279 callsuperStuff: objDest $@47 ':' classOrError . ':' ':' messageSymOrIdentErr '(' $@48 FakeStringOrNothing $@49 ')' - - ':' shift, and go to state 459 - - -State 416 - - 394 LocalizationLine: LOCALIZE '{' STRING CONST '-' CONST . '}' ';' - - '}' shift, and go to state 460 - - -State 417 - - 393 LocalizationLine: LOCALIZE '{' STRING CONST '}' ';' . - - $default reduce using rule 393 (LocalizationLine) - - -State 418 - - 325 headerLine: HEADER IDENT '=' $@60 FAKESTRING $@61 . ';' - - ';' shift, and go to state 461 - - -State 419 - - 329 chunkLine: CHUNK $@62 typeDeclString '=' $@63 FAKESTRING . $@64 ';' - - $default reduce using rule 328 ($@64) - - $@64 go to state 462 - - -State 420 - - 349 objectLine: OBJECT classOrError objectOrIdent '=' ignoreDirtyFlag '{' . $@77 objectFieldList '}' - - $default reduce using rule 348 ($@77) - - $@77 go to state 463 - - -State 421 - - 96 vardataClass: CLASS_SYM $@12 ':' ':' . - - $default reduce using rule 96 (vardataClass) - - -State 422 - - 99 vardataAliasLine: VARDATA_ALIAS '(' vardataSymOrError ')' $@13 IDENT . $@14 IDENT - - $default reduce using rule 98 ($@14) - - $@14 go to state 464 - - -State 423 - - 340 chunkLine: GSTRING_SYM $@70 IDENT @71 '=' @72 . GStrings $@73 ';' - - '{' shift, and go to state 465 - - GStrings go to state 466 - - -State 424 - - 216 importMessageLine: importMessagePrefix '(' $@34 messageSymOrIdentErr ')' IDENT . ';' - - ';' shift, and go to state 467 - - -State 425 - - 214 importMessageLine: importMessagePrefix typeDeclString '(' $@32 stackFlag messageParamListOrNull . ')' $@33 messageReturn ';' - - ')' shift, and go to state 468 - - -State 426 - - 134 messageParamListOrNull: messageParamList . - 137 messageParamList: messageParamList . ',' @27 messageParam - - ',' shift, and go to state 469 - - $default reduce using rule 134 (messageParamListOrNull) - - -State 427 - - 138 messageParamList: messageParam . - - $default reduce using rule 138 (messageParamList) - - -State 428 - - 142 messageParam: typeDeclString . $@28 eqParamRegs - - $default reduce using rule 141 ($@28) - - $@28 go to state 470 - - -State 429 - - 236 methodLine: externMethodOrMethod methodModel identCommaOrNothing classOrError $@41 ',' . methodMessageList openCurlyOrSemiColon - - MSG_SYM shift, and go to state 471 - IDENT shift, and go to state 472 - - methodMessageList go to state 473 - methodMessage go to state 474 - - -State 430 - - 264 sendOrCallOrRecordLine: sendOrCallOrRecord $@42 ObjFlagListOrNull optCastWithNoBraces objDest $@43 . ':' optCastMessage objMessage '(' $@44 FakeStringOrNothing $@45 ')' - - ':' shift, and go to state 475 - - -State 431 - - 346 caHeader: '(' $@74 . IDENT '(' $@75 FAKESTRING $@76 ')' ')' - - IDENT shift, and go to state 476 - - -State 432 - - 335 chunkLine: cArrayType $@65 IDENT $@66 caHeader IDENT . $@67 '=' $@68 FAKESTRING $@69 ';' - - $default reduce using rule 332 ($@67) - - $@67 go to state 477 - - -State 433 - - 65 classFlags: ',' MASTER . ',' VARIANT - 67 | ',' MASTER . - - ',' shift, and go to state 478 - - $default reduce using rule 67 (classFlags) - - -State 434 - - 66 classFlags: ',' VARIANT . ',' MASTER - - ',' shift, and go to state 479 - - -State 435 - - 61 classLine: CLASS IDENT commaOrNothing superClass $@2 classFlags semiColonOrError . - - $default reduce using rule 61 (classLine) - - -State 436 - - 133 messageFinish: '(' $@26 MSG_SYM ')' IDENT . ';' - - ';' shift, and go to state 480 - - -State 437 - - 131 messageFinish: typeDeclString '(' $@24 stackFlag messageParamListOrNull . ')' $@25 messageReturn ';' - - ')' shift, and go to state 481 - - -State 438 - - 222 aliasLine: ALIAS '(' messageSymOrIdentErr ')' $@35 typeDeclString '(' . $@36 stackFlag messageParamListOrNull ')' $@37 messageReturn ';' - - $default reduce using rule 220 ($@36) - - $@36 go to state 482 - - -State 439 - - 226 prototypeLine: PROTOTYPE $@38 typeDeclString '(' $@39 stackFlag messageParamListOrNull . ')' $@40 messageReturn ';' - - ')' shift, and go to state 483 - - -State 440 - - 73 instanceLineType: COMPOSITE $@4 IDENT '=' LINK_SYM . - - $default reduce using rule 73 (instanceLineType) - - -State 441 - - 85 instanceDefault: '=' $@9 FAKESTRING . - - $default reduce using rule 85 (instanceDefault) - - -State 442 - - 428 vmMiddle: LIST_SYM '{' . vmArray '}' - - error shift, and go to state 484 - VIS_MONIKER_CHUNK_SYM shift, and go to state 117 - IDENT shift, and go to state 118 - - vmArray go to state 485 - vmArrayElement go to state 486 - vmArrayError go to state 487 - visMonikerOrIdent go to state 488 - - -State 443 - - 432 vmMiddleNonList: GSTRING_SYM vmGStrings . - - $default reduce using rule 432 (vmMiddleNonList) - - -State 444 - - 441 vmGStrings: @93 . GStrings - - '{' shift, and go to state 465 - - GStrings go to state 489 - - -State 445 - - 436 vmNavChar: STRING ',' . someString - - STRING shift, and go to state 490 - ASCIISTRING shift, and go to state 396 - LSTRING shift, and go to state 397 - SJISSTRING shift, and go to state 398 - TSTRING shift, and go to state 399 - - someString go to state 491 - - -State 446 - - 434 vmNavChar: CHAR ',' . someString - - STRING shift, and go to state 490 - ASCIISTRING shift, and go to state 396 - LSTRING shift, and go to state 397 - SJISSTRING shift, and go to state 398 - TSTRING shift, and go to state 399 - - someString go to state 492 - - -State 447 - - 435 vmNavChar: CONST ',' . someString - - STRING shift, and go to state 490 - ASCIISTRING shift, and go to state 396 - LSTRING shift, and go to state 397 - SJISSTRING shift, and go to state 398 - TSTRING shift, and go to state 399 - - someString go to state 493 - - -State 448 - - 431 vmMiddleNonList: '{' vmList . vmNavChar ';' '}' - 433 | '{' vmList . GSTRING_SYM vmGStrings '}' - 438 vmList: vmList . vmElement - - error shift, and go to state 494 - GSTRING_SYM shift, and go to state 495 - COLOR_SYM shift, and go to state 496 - SIZE_SYM shift, and go to state 497 - ASPECT_RATIO_SYM shift, and go to state 498 - CACHED_SIZE_SYM shift, and go to state 499 - STYLE_SYM shift, and go to state 500 - STRING shift, and go to state 395 - ASCIISTRING shift, and go to state 396 - LSTRING shift, and go to state 397 - SJISSTRING shift, and go to state 398 - TSTRING shift, and go to state 399 - CHAR shift, and go to state 400 - CONST shift, and go to state 401 - - someString go to state 403 - vmNavChar go to state 501 - vmElement go to state 502 - - -State 449 - - 430 vmMiddleNonList: vmNavChar ';' . - - $default reduce using rule 430 (vmMiddleNonList) - - -State 450 - - 104 defaultLine: DEFAULT defaultableSym '=' $@15 FAKESTRING $@16 ';' . - - $default reduce using rule 104 (defaultLine) - - -State 451 - - 114 relocTail: FAKESTRING $@19 . ',' relocCount relocType - - ',' shift, and go to state 503 - - -State 452 - - 117 relocCount: '(' CONST . ',' $@20 FAKESTRING $@21 ')' - - ',' shift, and go to state 504 - - -State 453 - - 119 relocType: FPTR . - - $default reduce using rule 119 (relocType) - - -State 454 - - 120 relocType: HPTR . - - $default reduce using rule 120 (relocType) - - -State 455 - - 121 relocType: OPTR . - - $default reduce using rule 121 (relocType) - - -State 456 - - 112 relocTail: relocCount relocType . - - $default reduce using rule 112 (relocTail) - - -State 457 - - 284 objDest: PARENT $@50 FAKESTRING ',' $@51 . FAKESTRING ':' - - FAKESTRING shift, and go to state 505 - - -State 458 - - 287 objDest: CHILDREN $@52 FAKESTRING ',' FAKESTRING . ',' $@53 FAKESTRING ':' - - ',' shift, and go to state 506 - - -State 459 - - 279 callsuperStuff: objDest $@47 ':' classOrError ':' . ':' messageSymOrIdentErr '(' $@48 FakeStringOrNothing $@49 ')' - - ':' shift, and go to state 507 - - -State 460 - - 394 LocalizationLine: LOCALIZE '{' STRING CONST '-' CONST '}' . ';' - - ';' shift, and go to state 508 - - -State 461 - - 325 headerLine: HEADER IDENT '=' $@60 FAKESTRING $@61 ';' . - - $default reduce using rule 325 (headerLine) - - -State 462 - - 329 chunkLine: CHUNK $@62 typeDeclString '=' $@63 FAKESTRING $@64 . ';' - - ';' shift, and go to state 509 - - -State 463 - - 349 objectLine: OBJECT classOrError objectOrIdent '=' ignoreDirtyFlag '{' $@77 . objectFieldList '}' - - $default reduce using rule 353 (objectFieldList) - - objectFieldList go to state 510 - - -State 464 - - 99 vardataAliasLine: VARDATA_ALIAS '(' vardataSymOrError ')' $@13 IDENT $@14 . IDENT - - IDENT shift, and go to state 511 - - -State 465 - - 444 GStrings: '{' . $@94 gstringBodyElementList $@95 '}' - - $default reduce using rule 442 ($@94) - - $@94 go to state 512 - - -State 466 - - 340 chunkLine: GSTRING_SYM $@70 IDENT @71 '=' @72 GStrings . $@73 ';' - - $default reduce using rule 339 ($@73) - - $@73 go to state 513 - - -State 467 - - 216 importMessageLine: importMessagePrefix '(' $@34 messageSymOrIdentErr ')' IDENT ';' . - - $default reduce using rule 216 (importMessageLine) - - -State 468 - - 214 importMessageLine: importMessagePrefix typeDeclString '(' $@32 stackFlag messageParamListOrNull ')' . $@33 messageReturn ';' - - $default reduce using rule 213 ($@33) - - $@33 go to state 514 - - -State 469 - - 137 messageParamList: messageParamList ',' . @27 messageParam - - $default reduce using rule 136 (@27) - - @27 go to state 515 - - -State 470 - - 142 messageParam: typeDeclString $@28 . eqParamRegs - - '=' shift, and go to state 516 - - $default reduce using rule 144 (eqParamRegs) - - eqParamRegs go to state 517 - - -State 471 - - 239 methodMessage: MSG_SYM . - - $default reduce using rule 239 (methodMessage) - - -State 472 - - 240 methodMessage: IDENT . - - $default reduce using rule 240 (methodMessage) - - -State 473 - - 236 methodLine: externMethodOrMethod methodModel identCommaOrNothing classOrError $@41 ',' methodMessageList . openCurlyOrSemiColon - 237 methodMessageList: methodMessageList . ',' methodMessage - - ';' shift, and go to state 518 - ',' shift, and go to state 519 - '{' shift, and go to state 520 - - openCurlyOrSemiColon go to state 521 - - -State 474 - - 238 methodMessageList: methodMessage . - - $default reduce using rule 238 (methodMessageList) - - -State 475 - - 264 sendOrCallOrRecordLine: sendOrCallOrRecord $@42 ObjFlagListOrNull optCastWithNoBraces objDest $@43 ':' . optCastMessage objMessage '(' $@44 FakeStringOrNothing $@45 ')' - - '{' shift, and go to state 522 - - $default reduce using rule 268 (optCastMessage) - - optCastMessage go to state 523 - - -State 476 - - 346 caHeader: '(' $@74 IDENT . '(' $@75 FAKESTRING $@76 ')' ')' - - '(' shift, and go to state 524 - - -State 477 - - 335 chunkLine: cArrayType $@65 IDENT $@66 caHeader IDENT $@67 . '=' $@68 FAKESTRING $@69 ';' - - '=' shift, and go to state 525 - - -State 478 - - 65 classFlags: ',' MASTER ',' . VARIANT - - VARIANT shift, and go to state 526 - - -State 479 - - 66 classFlags: ',' VARIANT ',' . MASTER - - MASTER shift, and go to state 527 - - -State 480 - - 133 messageFinish: '(' $@26 MSG_SYM ')' IDENT ';' . - - $default reduce using rule 133 (messageFinish) - - -State 481 - - 131 messageFinish: typeDeclString '(' $@24 stackFlag messageParamListOrNull ')' . $@25 messageReturn ';' - - $default reduce using rule 130 ($@25) - - $@25 go to state 528 - - -State 482 - - 222 aliasLine: ALIAS '(' messageSymOrIdentErr ')' $@35 typeDeclString '(' $@36 . stackFlag messageParamListOrNull ')' $@37 messageReturn ';' - - STACK shift, and go to state 378 - - $default reduce using rule 140 (stackFlag) - - stackFlag go to state 529 - - -State 483 - - 226 prototypeLine: PROTOTYPE $@38 typeDeclString '(' $@39 stackFlag messageParamListOrNull ')' . $@40 messageReturn ';' - - $default reduce using rule 225 ($@40) - - $@40 go to state 530 - - -State 484 - - 462 vmArrayError: error . - - $default reduce using rule 462 (vmArrayError) - - -State 485 - - 428 vmMiddle: LIST_SYM '{' vmArray . '}' - 457 vmArray: vmArray . ',' vmArrayElement - - ',' shift, and go to state 531 - '}' shift, and go to state 532 - - -State 486 - - 458 vmArray: vmArrayElement . - - $default reduce using rule 458 (vmArray) - - -State 487 - - 460 vmArrayElement: vmArrayError . ',' - 461 | vmArrayError . '}' - - ',' shift, and go to state 533 - '}' shift, and go to state 534 - - -State 488 - - 459 vmArrayElement: visMonikerOrIdent . - - $default reduce using rule 459 (vmArrayElement) - - -State 489 - - 441 vmGStrings: @93 GStrings . - - $default reduce using rule 441 (vmGStrings) - - -State 490 - - 388 someString: STRING . - - $default reduce using rule 388 (someString) - - -State 491 - - 436 vmNavChar: STRING ',' someString . - - $default reduce using rule 436 (vmNavChar) - - -State 492 - - 434 vmNavChar: CHAR ',' someString . - - $default reduce using rule 434 (vmNavChar) - - -State 493 - - 435 vmNavChar: CONST ',' someString . - - $default reduce using rule 435 (vmNavChar) - - -State 494 - - 455 vmElement: error . ';' - 456 | error . '}' - - ';' shift, and go to state 535 - '}' shift, and go to state 536 - - -State 495 - - 433 vmMiddleNonList: '{' vmList GSTRING_SYM . vmGStrings '}' - - $default reduce using rule 440 (@93) - - vmGStrings go to state 537 - @93 go to state 444 - - -State 496 - - 452 vmElement: COLOR_SYM . '=' COLOR_COMP_SYM ';' - - '=' shift, and go to state 538 - - -State 497 - - 453 vmElement: SIZE_SYM . '=' SIZE_COMP_SYM ';' - - '=' shift, and go to state 539 - - -State 498 - - 450 vmElement: ASPECT_RATIO_SYM . '=' ASPECT_RATIO_COMP_SYM ';' - - '=' shift, and go to state 540 - - -State 499 - - 454 vmElement: CACHED_SIZE_SYM . '=' CONST ',' CONST ';' - - '=' shift, and go to state 541 - - -State 500 - - 451 vmElement: STYLE_SYM . '=' STYLE_COMP_SYM ';' - - '=' shift, and go to state 542 - - -State 501 - - 431 vmMiddleNonList: '{' vmList vmNavChar . ';' '}' - - ';' shift, and go to state 543 - - -State 502 - - 438 vmList: vmList vmElement . - - $default reduce using rule 438 (vmList) - - -State 503 - - 114 relocTail: FAKESTRING $@19 ',' . relocCount relocType - - '(' shift, and go to state 409 - - $default reduce using rule 118 (relocCount) - - relocCount go to state 544 - - -State 504 - - 117 relocCount: '(' CONST ',' . $@20 FAKESTRING $@21 ')' - - $default reduce using rule 115 ($@20) - - $@20 go to state 545 - - -State 505 - - 284 objDest: PARENT $@50 FAKESTRING ',' $@51 FAKESTRING . ':' - - ':' shift, and go to state 546 - - -State 506 - - 287 objDest: CHILDREN $@52 FAKESTRING ',' FAKESTRING ',' . $@53 FAKESTRING ':' - - $default reduce using rule 286 ($@53) - - $@53 go to state 547 - - -State 507 - - 279 callsuperStuff: objDest $@47 ':' classOrError ':' ':' . messageSymOrIdentErr '(' $@48 FakeStringOrNothing $@49 ')' - - MSG_SYM shift, and go to state 180 - IDENT shift, and go to state 181 - - messageSymOrIdentErr go to state 548 - - -State 508 - - 394 LocalizationLine: LOCALIZE '{' STRING CONST '-' CONST '}' ';' . - - $default reduce using rule 394 (LocalizationLine) - - -State 509 - - 329 chunkLine: CHUNK $@62 typeDeclString '=' $@63 FAKESTRING $@64 ';' . - - $default reduce using rule 329 (chunkLine) - - -State 510 - - 349 objectLine: OBJECT classOrError objectOrIdent '=' ignoreDirtyFlag '{' $@77 objectFieldList . '}' - 352 objectFieldList: objectFieldList . objectField - 354 | objectFieldList . fieldError ';' - 355 | objectFieldList . fieldError '}' - - error shift, and go to state 549 - LOCALIZE shift, and go to state 28 - GCN_LIST shift, and go to state 550 - VARDATA_SYM shift, and go to state 551 - REG_INSTANCE_SYM shift, and go to state 552 - COMPOSITE_SYM shift, and go to state 553 - LINK_SYM shift, and go to state 554 - VIS_MONIKER_SYM shift, and go to state 555 - VARIANT_PTR_SYM shift, and go to state 556 - KBD_ACCELERATOR_SYM shift, and go to state 557 - OPTR_SYM shift, and go to state 558 - CHUNK_INST_SYM shift, and go to state 559 - '}' shift, and go to state 560 - - fieldError go to state 561 - objectField go to state 562 - LocalizationLine go to state 563 - simpleLocalization go to state 100 - - -State 511 - - 99 vardataAliasLine: VARDATA_ALIAS '(' vardataSymOrError ')' $@13 IDENT $@14 IDENT . - - $default reduce using rule 99 (vardataAliasLine) - - -State 512 - - 444 GStrings: '{' $@94 . gstringBodyElementList $@95 '}' - - $default reduce using rule 446 (gstringBodyElementList) - - gstringBodyElementList go to state 564 - - -State 513 - - 340 chunkLine: GSTRING_SYM $@70 IDENT @71 '=' @72 GStrings $@73 . ';' - - ';' shift, and go to state 565 - - -State 514 - - 214 importMessageLine: importMessagePrefix typeDeclString '(' $@32 stackFlag messageParamListOrNull ')' $@33 . messageReturn ';' - - '=' shift, and go to state 566 - - $default reduce using rule 167 (messageReturn) - - messageReturn go to state 567 - - -State 515 - - 137 messageParamList: messageParamList ',' @27 . messageParam - - STRING shift, and go to state 161 - - messageParam go to state 568 - typeDeclString go to state 428 - - -State 516 - - 143 eqParamRegs: '=' . paramRegs - - CX shift, and go to state 569 - DX shift, and go to state 570 - BP shift, and go to state 571 - CL shift, and go to state 572 - CH shift, and go to state 573 - DL shift, and go to state 574 - DH shift, and go to state 575 - SS shift, and go to state 576 - AXBPCXDX shift, and go to state 577 - AXCXDXBP shift, and go to state 578 - CXDXBPAX shift, and go to state 579 - DXCX shift, and go to state 580 - BPAXDXCX shift, and go to state 581 - MULTIPLEAX shift, and go to state 582 - IDENT shift, and go to state 583 - - paramRegs go to state 584 - wordParamReg go to state 585 - multipleParamReg go to state 586 - - -State 517 - - 142 messageParam: typeDeclString $@28 eqParamRegs . - - $default reduce using rule 142 (messageParam) - - -State 518 - - 232 openCurlyOrSemiColon: ';' . - - $default reduce using rule 232 (openCurlyOrSemiColon) - - -State 519 - - 237 methodMessageList: methodMessageList ',' . methodMessage - - MSG_SYM shift, and go to state 471 - IDENT shift, and go to state 472 - - methodMessage go to state 587 - - -State 520 - - 231 openCurlyOrSemiColon: '{' . - - $default reduce using rule 231 (openCurlyOrSemiColon) - - -State 521 - - 236 methodLine: externMethodOrMethod methodModel identCommaOrNothing classOrError $@41 ',' methodMessageList openCurlyOrSemiColon . - - $default reduce using rule 236 (methodLine) - - -State 522 - - 267 optCastMessage: '{' . optCastWithNoBraces '}' - - MSG_SYM shift, and go to state 326 - - $default reduce using rule 270 (optCastWithNoBraces) - - optCastWithNoBraces go to state 588 - - -State 523 - - 264 sendOrCallOrRecordLine: sendOrCallOrRecord $@42 ObjFlagListOrNull optCastWithNoBraces objDest $@43 ':' optCastMessage . objMessage '(' $@44 FakeStringOrNothing $@45 ')' - - MSG_SYM shift, and go to state 589 - IDENT shift, and go to state 590 - '(' shift, and go to state 591 - - objMessage go to state 592 - - -State 524 - - 346 caHeader: '(' $@74 IDENT '(' . $@75 FAKESTRING $@76 ')' ')' - - $default reduce using rule 344 ($@75) - - $@75 go to state 593 - - -State 525 - - 335 chunkLine: cArrayType $@65 IDENT $@66 caHeader IDENT $@67 '=' . $@68 FAKESTRING $@69 ';' - - $default reduce using rule 333 ($@68) - - $@68 go to state 594 - - -State 526 - - 65 classFlags: ',' MASTER ',' VARIANT . - - $default reduce using rule 65 (classFlags) - - -State 527 - - 66 classFlags: ',' VARIANT ',' MASTER . - - $default reduce using rule 66 (classFlags) - - -State 528 - - 131 messageFinish: typeDeclString '(' $@24 stackFlag messageParamListOrNull ')' $@25 . messageReturn ';' - - '=' shift, and go to state 566 - - $default reduce using rule 167 (messageReturn) - - messageReturn go to state 595 - - -State 529 - - 222 aliasLine: ALIAS '(' messageSymOrIdentErr ')' $@35 typeDeclString '(' $@36 stackFlag . messageParamListOrNull ')' $@37 messageReturn ';' - - STRING shift, and go to state 161 - - $default reduce using rule 135 (messageParamListOrNull) - - messageParamListOrNull go to state 596 - messageParamList go to state 426 - messageParam go to state 427 - typeDeclString go to state 428 - - -State 530 - - 226 prototypeLine: PROTOTYPE $@38 typeDeclString '(' $@39 stackFlag messageParamListOrNull ')' $@40 . messageReturn ';' - - '=' shift, and go to state 566 - - $default reduce using rule 167 (messageReturn) - - messageReturn go to state 597 - - -State 531 - - 457 vmArray: vmArray ',' . vmArrayElement - - error shift, and go to state 484 - VIS_MONIKER_CHUNK_SYM shift, and go to state 117 - IDENT shift, and go to state 118 - - vmArrayElement go to state 598 - vmArrayError go to state 487 - visMonikerOrIdent go to state 488 - - -State 532 - - 428 vmMiddle: LIST_SYM '{' vmArray '}' . - - $default reduce using rule 428 (vmMiddle) - - -State 533 - - 460 vmArrayElement: vmArrayError ',' . - - $default reduce using rule 460 (vmArrayElement) - - -State 534 - - 461 vmArrayElement: vmArrayError '}' . - - $default reduce using rule 461 (vmArrayElement) - - -State 535 - - 455 vmElement: error ';' . - - $default reduce using rule 455 (vmElement) - - -State 536 - - 456 vmElement: error '}' . - - $default reduce using rule 456 (vmElement) - - -State 537 - - 433 vmMiddleNonList: '{' vmList GSTRING_SYM vmGStrings . '}' - - '}' shift, and go to state 599 - - -State 538 - - 452 vmElement: COLOR_SYM '=' . COLOR_COMP_SYM ';' - - COLOR_COMP_SYM shift, and go to state 600 - - -State 539 - - 453 vmElement: SIZE_SYM '=' . SIZE_COMP_SYM ';' - - SIZE_COMP_SYM shift, and go to state 601 - - -State 540 - - 450 vmElement: ASPECT_RATIO_SYM '=' . ASPECT_RATIO_COMP_SYM ';' - - ASPECT_RATIO_COMP_SYM shift, and go to state 602 - - -State 541 - - 454 vmElement: CACHED_SIZE_SYM '=' . CONST ',' CONST ';' - - CONST shift, and go to state 603 - - -State 542 - - 451 vmElement: STYLE_SYM '=' . STYLE_COMP_SYM ';' - - STYLE_COMP_SYM shift, and go to state 604 - - -State 543 - - 431 vmMiddleNonList: '{' vmList vmNavChar ';' . '}' - - '}' shift, and go to state 605 - - -State 544 - - 114 relocTail: FAKESTRING $@19 ',' relocCount . relocType - - FPTR shift, and go to state 453 - HPTR shift, and go to state 454 - OPTR shift, and go to state 455 - - relocType go to state 606 - - -State 545 - - 117 relocCount: '(' CONST ',' $@20 . FAKESTRING $@21 ')' - - FAKESTRING shift, and go to state 607 - - -State 546 - - 284 objDest: PARENT $@50 FAKESTRING ',' $@51 FAKESTRING ':' . - - $default reduce using rule 284 (objDest) - - -State 547 - - 287 objDest: CHILDREN $@52 FAKESTRING ',' FAKESTRING ',' $@53 . FAKESTRING ':' - - FAKESTRING shift, and go to state 608 - - -State 548 - - 279 callsuperStuff: objDest $@47 ':' classOrError ':' ':' messageSymOrIdentErr . '(' $@48 FakeStringOrNothing $@49 ')' - - '(' shift, and go to state 609 - - -State 549 - - 356 fieldError: error . - - $default reduce using rule 356 (fieldError) - - -State 550 - - 382 objectField: GCN_LIST . '(' identOrConst ',' identOrConst ')' '=' aleArrayN - - '(' shift, and go to state 610 - - -State 551 - - 378 objectField: VARDATA_SYM . ';' - 381 | VARDATA_SYM . optionalArraySize '=' $@87 FAKESTRING $@88 ';' - - ';' shift, and go to state 611 - '[' shift, and go to state 612 - - $default reduce using rule 360 (optionalArraySize) - - optionalArraySize go to state 613 - - -State 552 - - 363 objectField: REG_INSTANCE_SYM . '=' $@80 FAKESTRING $@81 ';' - - '=' shift, and go to state 614 - - -State 553 - - 384 objectField: COMPOSITE_SYM . '=' $@89 childList ';' - - '=' shift, and go to state 615 - - -State 554 - - 386 objectField: LINK_SYM . '=' objectOrIdent ';' - - '=' shift, and go to state 616 - - -State 555 - - 377 objectField: VIS_MONIKER_SYM . $@86 visMonikerFieldFinish optSemiColon - - $default reduce using rule 376 ($@86) - - $@86 go to state 617 - - -State 556 - - 366 objectField: VARIANT_PTR_SYM . '=' $@82 CLASS_SYM $@83 ';' - - '=' shift, and go to state 618 - - -State 557 - - 385 objectField: KBD_ACCELERATOR_SYM . kbdAcceleratorStart '=' specificUIOrNothing kbdAccelModList kbdAccelChar ';' - - $default reduce using rule 408 (kbdAcceleratorStart) - - kbdAcceleratorStart go to state 619 - - -State 558 - - 367 objectField: OPTR_SYM . '=' IDENT ';' - 368 | OPTR_SYM . '=' OBJECT_SYM ';' - 371 | OPTR_SYM . '=' '(' $@84 FAKESTRING $@85 ')' ';' - - '=' shift, and go to state 620 - - -State 559 - - 372 objectField: CHUNK_INST_SYM . '=' IDENT ';' - 373 | CHUNK_INST_SYM . '=' someString ';' - 374 | CHUNK_INST_SYM . '=' CHUNK_SYM ';' - 375 | CHUNK_INST_SYM . '=' OBJECT_SYM ';' - - '=' shift, and go to state 621 - - -State 560 - - 349 objectLine: OBJECT classOrError objectOrIdent '=' ignoreDirtyFlag '{' $@77 objectFieldList '}' . - - $default reduce using rule 349 (objectLine) - - -State 561 - - 354 objectFieldList: objectFieldList fieldError . ';' - 355 | objectFieldList fieldError . '}' - - ';' shift, and go to state 622 - '}' shift, and go to state 623 - - -State 562 - - 352 objectFieldList: objectFieldList objectField . - - $default reduce using rule 352 (objectFieldList) - - -State 563 - - 387 objectField: LocalizationLine . - - $default reduce using rule 387 (objectField) - - -State 564 - - 444 GStrings: '{' $@94 gstringBodyElementList . $@95 '}' - 445 gstringBodyElementList: gstringBodyElementList . gstringBodyElement - - error shift, and go to state 624 - STRING shift, and go to state 625 - FAKESTRING shift, and go to state 626 - - '}' reduce using rule 443 ($@95) - - $@95 go to state 627 - gstringBodyElement go to state 628 - - -State 565 - - 340 chunkLine: GSTRING_SYM $@70 IDENT @71 '=' @72 GStrings $@73 ';' . - - $default reduce using rule 340 (chunkLine) - - -State 566 - - 166 messageReturn: '=' . returnReg - - CARRY shift, and go to state 629 - AX shift, and go to state 630 - CX shift, and go to state 631 - DX shift, and go to state 632 - BP shift, and go to state 633 - AL shift, and go to state 634 - AH shift, and go to state 635 - CL shift, and go to state 636 - CH shift, and go to state 637 - DL shift, and go to state 638 - DH shift, and go to state 639 - BPL shift, and go to state 640 - BPH shift, and go to state 641 - IDENT shift, and go to state 642 - - returnReg go to state 643 - wordReturnReg go to state 644 - - -State 567 - - 214 importMessageLine: importMessagePrefix typeDeclString '(' $@32 stackFlag messageParamListOrNull ')' $@33 messageReturn . ';' - - ';' shift, and go to state 645 - - -State 568 - - 137 messageParamList: messageParamList ',' @27 messageParam . - - $default reduce using rule 137 (messageParamList) - - -State 569 - - 149 paramRegs: CX . - 157 wordParamReg: CX . - - ':' reduce using rule 157 (wordParamReg) - '.' reduce using rule 157 (wordParamReg) - $default reduce using rule 149 (paramRegs) - - -State 570 - - 150 paramRegs: DX . - 158 wordParamReg: DX . - - ':' reduce using rule 158 (wordParamReg) - '.' reduce using rule 158 (wordParamReg) - $default reduce using rule 150 (paramRegs) - - -State 571 - - 151 paramRegs: BP . - 159 wordParamReg: BP . - - ':' reduce using rule 159 (wordParamReg) - '.' reduce using rule 159 (wordParamReg) - $default reduce using rule 151 (paramRegs) - - -State 572 - - 145 paramRegs: CL . - - $default reduce using rule 145 (paramRegs) - - -State 573 - - 146 paramRegs: CH . - - $default reduce using rule 146 (paramRegs) - - -State 574 - - 147 paramRegs: DL . - - $default reduce using rule 147 (paramRegs) - - -State 575 - - 148 paramRegs: DH . - - $default reduce using rule 148 (paramRegs) - - -State 576 - - 154 paramRegs: SS . ':' BP - - ':' shift, and go to state 646 - - -State 577 - - 160 multipleParamReg: AXBPCXDX . - - $default reduce using rule 160 (multipleParamReg) - - -State 578 - - 161 multipleParamReg: AXCXDXBP . - - $default reduce using rule 161 (multipleParamReg) - - -State 579 - - 162 multipleParamReg: CXDXBPAX . - - $default reduce using rule 162 (multipleParamReg) - - -State 580 - - 163 multipleParamReg: DXCX . - - $default reduce using rule 163 (multipleParamReg) - - -State 581 - - 164 multipleParamReg: BPAXDXCX . - - $default reduce using rule 164 (multipleParamReg) - - -State 582 - - 165 multipleParamReg: MULTIPLEAX . - - $default reduce using rule 165 (multipleParamReg) - - -State 583 - - 156 paramRegs: IDENT . - - $default reduce using rule 156 (paramRegs) - - -State 584 - - 143 eqParamRegs: '=' paramRegs . - - $default reduce using rule 143 (eqParamRegs) - - -State 585 - - 152 paramRegs: wordParamReg . ':' wordParamReg - 153 | wordParamReg . '.' wordParamReg - - ':' shift, and go to state 647 - '.' shift, and go to state 648 - - -State 586 - - 155 paramRegs: multipleParamReg . - - $default reduce using rule 155 (paramRegs) - - -State 587 - - 237 methodMessageList: methodMessageList ',' methodMessage . - - $default reduce using rule 237 (methodMessageList) - - -State 588 - - 267 optCastMessage: '{' optCastWithNoBraces . '}' - - '}' shift, and go to state 649 - - -State 589 - - 288 objMessage: MSG_SYM . - - $default reduce using rule 288 (objMessage) - - -State 590 - - 292 objMessage: IDENT . - - $default reduce using rule 292 (objMessage) - - -State 591 - - 291 objMessage: '(' . $@54 FAKESTRING $@55 ')' - - $default reduce using rule 289 ($@54) - - $@54 go to state 650 - - -State 592 - - 264 sendOrCallOrRecordLine: sendOrCallOrRecord $@42 ObjFlagListOrNull optCastWithNoBraces objDest $@43 ':' optCastMessage objMessage . '(' $@44 FakeStringOrNothing $@45 ')' - - '(' shift, and go to state 651 - - -State 593 - - 346 caHeader: '(' $@74 IDENT '(' $@75 . FAKESTRING $@76 ')' ')' - - FAKESTRING shift, and go to state 652 - - -State 594 - - 335 chunkLine: cArrayType $@65 IDENT $@66 caHeader IDENT $@67 '=' $@68 . FAKESTRING $@69 ';' - - FAKESTRING shift, and go to state 653 - - -State 595 - - 131 messageFinish: typeDeclString '(' $@24 stackFlag messageParamListOrNull ')' $@25 messageReturn . ';' - - ';' shift, and go to state 654 - - -State 596 - - 222 aliasLine: ALIAS '(' messageSymOrIdentErr ')' $@35 typeDeclString '(' $@36 stackFlag messageParamListOrNull . ')' $@37 messageReturn ';' - - ')' shift, and go to state 655 - - -State 597 - - 226 prototypeLine: PROTOTYPE $@38 typeDeclString '(' $@39 stackFlag messageParamListOrNull ')' $@40 messageReturn . ';' - - ';' shift, and go to state 656 - - -State 598 - - 457 vmArray: vmArray ',' vmArrayElement . - - $default reduce using rule 457 (vmArray) - - -State 599 - - 433 vmMiddleNonList: '{' vmList GSTRING_SYM vmGStrings '}' . - - $default reduce using rule 433 (vmMiddleNonList) - - -State 600 - - 452 vmElement: COLOR_SYM '=' COLOR_COMP_SYM . ';' - - ';' shift, and go to state 657 - - -State 601 - - 453 vmElement: SIZE_SYM '=' SIZE_COMP_SYM . ';' - - ';' shift, and go to state 658 - - -State 602 - - 450 vmElement: ASPECT_RATIO_SYM '=' ASPECT_RATIO_COMP_SYM . ';' - - ';' shift, and go to state 659 - - -State 603 - - 454 vmElement: CACHED_SIZE_SYM '=' CONST . ',' CONST ';' - - ',' shift, and go to state 660 - - -State 604 - - 451 vmElement: STYLE_SYM '=' STYLE_COMP_SYM . ';' - - ';' shift, and go to state 661 - - -State 605 - - 431 vmMiddleNonList: '{' vmList vmNavChar ';' '}' . - - $default reduce using rule 431 (vmMiddleNonList) - - -State 606 - - 114 relocTail: FAKESTRING $@19 ',' relocCount relocType . - - $default reduce using rule 114 (relocTail) - - -State 607 - - 117 relocCount: '(' CONST ',' $@20 FAKESTRING . $@21 ')' - - $default reduce using rule 116 ($@21) - - $@21 go to state 662 - - -State 608 - - 287 objDest: CHILDREN $@52 FAKESTRING ',' FAKESTRING ',' $@53 FAKESTRING . ':' - - ':' shift, and go to state 663 - - -State 609 - - 279 callsuperStuff: objDest $@47 ':' classOrError ':' ':' messageSymOrIdentErr '(' . $@48 FakeStringOrNothing $@49 ')' - - $default reduce using rule 277 ($@48) - - $@48 go to state 664 - - -State 610 - - 382 objectField: GCN_LIST '(' . identOrConst ',' identOrConst ')' '=' aleArrayN - - IDENT shift, and go to state 665 - CONST shift, and go to state 666 - - identOrConst go to state 667 - - -State 611 - - 378 objectField: VARDATA_SYM ';' . - - $default reduce using rule 378 (objectField) - - -State 612 - - 359 optionalArraySize: '[' . $@78 FAKESTRING $@79 ']' - - $default reduce using rule 357 ($@78) - - $@78 go to state 668 - - -State 613 - - 381 objectField: VARDATA_SYM optionalArraySize . '=' $@87 FAKESTRING $@88 ';' - - '=' shift, and go to state 669 - - -State 614 - - 363 objectField: REG_INSTANCE_SYM '=' . $@80 FAKESTRING $@81 ';' - - $default reduce using rule 361 ($@80) - - $@80 go to state 670 - - -State 615 - - 384 objectField: COMPOSITE_SYM '=' . $@89 childList ';' - - $default reduce using rule 383 ($@89) - - $@89 go to state 671 - - -State 616 - - 386 objectField: LINK_SYM '=' . objectOrIdent ';' - - OBJECT_SYM shift, and go to state 223 - IDENT shift, and go to state 224 - - objectOrIdent go to state 672 - - -State 617 - - 377 objectField: VIS_MONIKER_SYM $@86 . visMonikerFieldFinish optSemiColon - - '=' shift, and go to state 673 - - $default reduce using rule 399 (visMonikerFieldFinish) - - visMonikerFieldFinish go to state 674 - - -State 618 - - 366 objectField: VARIANT_PTR_SYM '=' . $@82 CLASS_SYM $@83 ';' - - $default reduce using rule 364 ($@82) - - $@82 go to state 675 - - -State 619 - - 385 objectField: KBD_ACCELERATOR_SYM kbdAcceleratorStart . '=' specificUIOrNothing kbdAccelModList kbdAccelChar ';' - - '=' shift, and go to state 676 - - -State 620 - - 367 objectField: OPTR_SYM '=' . IDENT ';' - 368 | OPTR_SYM '=' . OBJECT_SYM ';' - 371 | OPTR_SYM '=' . '(' $@84 FAKESTRING $@85 ')' ';' - - OBJECT_SYM shift, and go to state 677 - IDENT shift, and go to state 678 - '(' shift, and go to state 679 - - -State 621 - - 372 objectField: CHUNK_INST_SYM '=' . IDENT ';' - 373 | CHUNK_INST_SYM '=' . someString ';' - 374 | CHUNK_INST_SYM '=' . CHUNK_SYM ';' - 375 | CHUNK_INST_SYM '=' . OBJECT_SYM ';' - - OBJECT_SYM shift, and go to state 680 - CHUNK_SYM shift, and go to state 681 - IDENT shift, and go to state 682 - STRING shift, and go to state 490 - ASCIISTRING shift, and go to state 396 - LSTRING shift, and go to state 397 - SJISSTRING shift, and go to state 398 - TSTRING shift, and go to state 399 - - someString go to state 683 - - -State 622 - - 354 objectFieldList: objectFieldList fieldError ';' . - - $default reduce using rule 354 (objectFieldList) - - -State 623 - - 355 objectFieldList: objectFieldList fieldError '}' . - - $default reduce using rule 355 (objectFieldList) - - -State 624 - - 449 gstringBodyElement: error . - - $default reduce using rule 449 (gstringBodyElement) - - -State 625 - - 448 gstringBodyElement: STRING . - - $default reduce using rule 448 (gstringBodyElement) - - -State 626 - - 447 gstringBodyElement: FAKESTRING . - - $default reduce using rule 447 (gstringBodyElement) - - -State 627 - - 444 GStrings: '{' $@94 gstringBodyElementList $@95 . '}' - - '}' shift, and go to state 684 - - -State 628 - - 445 gstringBodyElementList: gstringBodyElementList gstringBodyElement . - - $default reduce using rule 445 (gstringBodyElementList) - - -State 629 - - 182 returnReg: CARRY . - - $default reduce using rule 182 (returnReg) - - -State 630 - - 168 returnReg: AX . - 184 wordReturnReg: AX . - - ';' reduce using rule 168 (returnReg) - $default reduce using rule 184 (wordReturnReg) - - -State 631 - - 169 returnReg: CX . - 185 wordReturnReg: CX . - - ';' reduce using rule 169 (returnReg) - $default reduce using rule 185 (wordReturnReg) - - -State 632 - - 170 returnReg: DX . - 186 wordReturnReg: DX . - - ';' reduce using rule 170 (returnReg) - $default reduce using rule 186 (wordReturnReg) - - -State 633 - - 171 returnReg: BP . - 187 wordReturnReg: BP . - - ';' reduce using rule 171 (returnReg) - $default reduce using rule 187 (wordReturnReg) - - -State 634 - - 172 returnReg: AL . - - $default reduce using rule 172 (returnReg) - - -State 635 - - 173 returnReg: AH . - - $default reduce using rule 173 (returnReg) - - -State 636 - - 174 returnReg: CL . - - $default reduce using rule 174 (returnReg) - - -State 637 - - 175 returnReg: CH . - - $default reduce using rule 175 (returnReg) - - -State 638 - - 176 returnReg: DL . - - $default reduce using rule 176 (returnReg) - - -State 639 - - 177 returnReg: DH . - - $default reduce using rule 177 (returnReg) - - -State 640 - - 178 returnReg: BPL . - - $default reduce using rule 178 (returnReg) - - -State 641 - - 179 returnReg: BPH . - - $default reduce using rule 179 (returnReg) - - -State 642 - - 183 returnReg: IDENT . - - $default reduce using rule 183 (returnReg) - - -State 643 - - 166 messageReturn: '=' returnReg . - - $default reduce using rule 166 (messageReturn) - - -State 644 - - 180 returnReg: wordReturnReg . ':' wordReturnReg - 181 | wordReturnReg . '.' wordReturnReg - - ':' shift, and go to state 685 - '.' shift, and go to state 686 - - -State 645 - - 214 importMessageLine: importMessagePrefix typeDeclString '(' $@32 stackFlag messageParamListOrNull ')' $@33 messageReturn ';' . - - $default reduce using rule 214 (importMessageLine) - - -State 646 - - 154 paramRegs: SS ':' . BP - - BP shift, and go to state 687 - - -State 647 - - 152 paramRegs: wordParamReg ':' . wordParamReg - - CX shift, and go to state 688 - DX shift, and go to state 689 - BP shift, and go to state 690 - - wordParamReg go to state 691 - - -State 648 - - 153 paramRegs: wordParamReg '.' . wordParamReg - - CX shift, and go to state 688 - DX shift, and go to state 689 - BP shift, and go to state 690 - - wordParamReg go to state 692 - - -State 649 - - 267 optCastMessage: '{' optCastWithNoBraces '}' . - - $default reduce using rule 267 (optCastMessage) - - -State 650 - - 291 objMessage: '(' $@54 . FAKESTRING $@55 ')' - - FAKESTRING shift, and go to state 693 - - -State 651 - - 264 sendOrCallOrRecordLine: sendOrCallOrRecord $@42 ObjFlagListOrNull optCastWithNoBraces objDest $@43 ':' optCastMessage objMessage '(' . $@44 FakeStringOrNothing $@45 ')' - - $default reduce using rule 262 ($@44) - - $@44 go to state 694 - - -State 652 - - 346 caHeader: '(' $@74 IDENT '(' $@75 FAKESTRING . $@76 ')' ')' - - $default reduce using rule 345 ($@76) - - $@76 go to state 695 - - -State 653 - - 335 chunkLine: cArrayType $@65 IDENT $@66 caHeader IDENT $@67 '=' $@68 FAKESTRING . $@69 ';' - - $default reduce using rule 334 ($@69) - - $@69 go to state 696 - - -State 654 - - 131 messageFinish: typeDeclString '(' $@24 stackFlag messageParamListOrNull ')' $@25 messageReturn ';' . - - $default reduce using rule 131 (messageFinish) - - -State 655 - - 222 aliasLine: ALIAS '(' messageSymOrIdentErr ')' $@35 typeDeclString '(' $@36 stackFlag messageParamListOrNull ')' . $@37 messageReturn ';' - - $default reduce using rule 221 ($@37) - - $@37 go to state 697 - - -State 656 - - 226 prototypeLine: PROTOTYPE $@38 typeDeclString '(' $@39 stackFlag messageParamListOrNull ')' $@40 messageReturn ';' . - - $default reduce using rule 226 (prototypeLine) - - -State 657 - - 452 vmElement: COLOR_SYM '=' COLOR_COMP_SYM ';' . - - $default reduce using rule 452 (vmElement) - - -State 658 - - 453 vmElement: SIZE_SYM '=' SIZE_COMP_SYM ';' . - - $default reduce using rule 453 (vmElement) - - -State 659 - - 450 vmElement: ASPECT_RATIO_SYM '=' ASPECT_RATIO_COMP_SYM ';' . - - $default reduce using rule 450 (vmElement) - - -State 660 - - 454 vmElement: CACHED_SIZE_SYM '=' CONST ',' . CONST ';' - - CONST shift, and go to state 698 - - -State 661 - - 451 vmElement: STYLE_SYM '=' STYLE_COMP_SYM ';' . - - $default reduce using rule 451 (vmElement) - - -State 662 - - 117 relocCount: '(' CONST ',' $@20 FAKESTRING $@21 . ')' - - ')' shift, and go to state 699 - - -State 663 - - 287 objDest: CHILDREN $@52 FAKESTRING ',' FAKESTRING ',' $@53 FAKESTRING ':' . - - $default reduce using rule 287 (objDest) - - -State 664 - - 279 callsuperStuff: objDest $@47 ':' classOrError ':' ':' messageSymOrIdentErr '(' $@48 . FakeStringOrNothing $@49 ')' - - FAKESTRING shift, and go to state 700 - - $default reduce using rule 266 (FakeStringOrNothing) - - FakeStringOrNothing go to state 701 - - -State 665 - - 469 identOrConst: IDENT . - - $default reduce using rule 469 (identOrConst) - - -State 666 - - 470 identOrConst: CONST . - - $default reduce using rule 470 (identOrConst) - - -State 667 - - 382 objectField: GCN_LIST '(' identOrConst . ',' identOrConst ')' '=' aleArrayN - - ',' shift, and go to state 702 - - -State 668 - - 359 optionalArraySize: '[' $@78 . FAKESTRING $@79 ']' - - FAKESTRING shift, and go to state 703 - - -State 669 - - 381 objectField: VARDATA_SYM optionalArraySize '=' . $@87 FAKESTRING $@88 ';' - - $default reduce using rule 379 ($@87) - - $@87 go to state 704 - - -State 670 - - 363 objectField: REG_INSTANCE_SYM '=' $@80 . FAKESTRING $@81 ';' - - FAKESTRING shift, and go to state 705 - - -State 671 - - 384 objectField: COMPOSITE_SYM '=' $@89 . childList ';' - - error shift, and go to state 706 - OBJECT_SYM shift, and go to state 223 - IDENT shift, and go to state 224 - - ';' reduce using rule 416 (childList) - - childList go to state 707 - childListNN go to state 708 - childNN go to state 709 - objectOrIdent go to state 710 - - -State 672 - - 386 objectField: LINK_SYM '=' objectOrIdent . ';' - - ';' shift, and go to state 711 - - -State 673 - - 400 visMonikerFieldFinish: '=' . VIS_MONIKER_CHUNK_SYM - 402 | '=' . $@90 visMonikerDef - - VIS_MONIKER_CHUNK_SYM shift, and go to state 712 - - $default reduce using rule 401 ($@90) - - $@90 go to state 713 - - -State 674 - - 377 objectField: VIS_MONIKER_SYM $@86 visMonikerFieldFinish . optSemiColon - - ';' shift, and go to state 714 - - $default reduce using rule 424 (optSemiColon) - - optSemiColon go to state 715 - - -State 675 - - 366 objectField: VARIANT_PTR_SYM '=' $@82 . CLASS_SYM $@83 ';' - - CLASS_SYM shift, and go to state 716 - - -State 676 - - 385 objectField: KBD_ACCELERATOR_SYM kbdAcceleratorStart '=' . specificUIOrNothing kbdAccelModList kbdAccelChar ';' - - SPECIFIC_UI shift, and go to state 717 - - $default reduce using rule 412 (specificUIOrNothing) - - specificUIOrNothing go to state 718 - - -State 677 - - 368 objectField: OPTR_SYM '=' OBJECT_SYM . ';' - - ';' shift, and go to state 719 - - -State 678 - - 367 objectField: OPTR_SYM '=' IDENT . ';' - - ';' shift, and go to state 720 - - -State 679 - - 371 objectField: OPTR_SYM '=' '(' . $@84 FAKESTRING $@85 ')' ';' - - $default reduce using rule 369 ($@84) - - $@84 go to state 721 - - -State 680 - - 375 objectField: CHUNK_INST_SYM '=' OBJECT_SYM . ';' - - ';' shift, and go to state 722 - - -State 681 - - 374 objectField: CHUNK_INST_SYM '=' CHUNK_SYM . ';' - - ';' shift, and go to state 723 - - -State 682 - - 372 objectField: CHUNK_INST_SYM '=' IDENT . ';' - - ';' shift, and go to state 724 - - -State 683 - - 373 objectField: CHUNK_INST_SYM '=' someString . ';' - - ';' shift, and go to state 725 - - -State 684 - - 444 GStrings: '{' $@94 gstringBodyElementList $@95 '}' . - - $default reduce using rule 444 (GStrings) - - -State 685 - - 180 returnReg: wordReturnReg ':' . wordReturnReg - - AX shift, and go to state 726 - CX shift, and go to state 727 - DX shift, and go to state 728 - BP shift, and go to state 729 - - wordReturnReg go to state 730 - - -State 686 - - 181 returnReg: wordReturnReg '.' . wordReturnReg - - AX shift, and go to state 726 - CX shift, and go to state 727 - DX shift, and go to state 728 - BP shift, and go to state 729 - - wordReturnReg go to state 731 - - -State 687 - - 154 paramRegs: SS ':' BP . - - $default reduce using rule 154 (paramRegs) - - -State 688 - - 157 wordParamReg: CX . - - $default reduce using rule 157 (wordParamReg) - - -State 689 - - 158 wordParamReg: DX . - - $default reduce using rule 158 (wordParamReg) - - -State 690 - - 159 wordParamReg: BP . - - $default reduce using rule 159 (wordParamReg) - - -State 691 - - 152 paramRegs: wordParamReg ':' wordParamReg . - - $default reduce using rule 152 (paramRegs) - - -State 692 - - 153 paramRegs: wordParamReg '.' wordParamReg . - - $default reduce using rule 153 (paramRegs) - - -State 693 - - 291 objMessage: '(' $@54 FAKESTRING . $@55 ')' - - $default reduce using rule 290 ($@55) - - $@55 go to state 732 - - -State 694 - - 264 sendOrCallOrRecordLine: sendOrCallOrRecord $@42 ObjFlagListOrNull optCastWithNoBraces objDest $@43 ':' optCastMessage objMessage '(' $@44 . FakeStringOrNothing $@45 ')' - - FAKESTRING shift, and go to state 700 - - $default reduce using rule 266 (FakeStringOrNothing) - - FakeStringOrNothing go to state 733 - - -State 695 - - 346 caHeader: '(' $@74 IDENT '(' $@75 FAKESTRING $@76 . ')' ')' - - ')' shift, and go to state 734 - - -State 696 - - 335 chunkLine: cArrayType $@65 IDENT $@66 caHeader IDENT $@67 '=' $@68 FAKESTRING $@69 . ';' - - ';' shift, and go to state 735 - - -State 697 - - 222 aliasLine: ALIAS '(' messageSymOrIdentErr ')' $@35 typeDeclString '(' $@36 stackFlag messageParamListOrNull ')' $@37 . messageReturn ';' - - '=' shift, and go to state 566 - - $default reduce using rule 167 (messageReturn) - - messageReturn go to state 736 - - -State 698 - - 454 vmElement: CACHED_SIZE_SYM '=' CONST ',' CONST . ';' - - ';' shift, and go to state 737 - - -State 699 - - 117 relocCount: '(' CONST ',' $@20 FAKESTRING $@21 ')' . - - $default reduce using rule 117 (relocCount) - - -State 700 - - 265 FakeStringOrNothing: FAKESTRING . - - $default reduce using rule 265 (FakeStringOrNothing) - - -State 701 - - 279 callsuperStuff: objDest $@47 ':' classOrError ':' ':' messageSymOrIdentErr '(' $@48 FakeStringOrNothing . $@49 ')' - - $default reduce using rule 278 ($@49) - - $@49 go to state 738 - - -State 702 - - 382 objectField: GCN_LIST '(' identOrConst ',' . identOrConst ')' '=' aleArrayN - - IDENT shift, and go to state 665 - CONST shift, and go to state 666 - - identOrConst go to state 739 - - -State 703 - - 359 optionalArraySize: '[' $@78 FAKESTRING . $@79 ']' - - $default reduce using rule 358 ($@79) - - $@79 go to state 740 - - -State 704 - - 381 objectField: VARDATA_SYM optionalArraySize '=' $@87 . FAKESTRING $@88 ';' - - FAKESTRING shift, and go to state 741 - - -State 705 - - 363 objectField: REG_INSTANCE_SYM '=' $@80 FAKESTRING . $@81 ';' - - $default reduce using rule 362 ($@81) - - $@81 go to state 742 - - -State 706 - - 420 childNN: error . - - $default reduce using rule 420 (childNN) - - -State 707 - - 384 objectField: COMPOSITE_SYM '=' $@89 childList . ';' - - ';' shift, and go to state 743 - - -State 708 - - 415 childList: childListNN . - 417 childListNN: childListNN . ',' childNN - - ',' shift, and go to state 744 - - $default reduce using rule 415 (childList) - - -State 709 - - 418 childListNN: childNN . - - $default reduce using rule 418 (childListNN) - - -State 710 - - 419 childNN: objectOrIdent . - - $default reduce using rule 419 (childNN) - - -State 711 - - 386 objectField: LINK_SYM '=' objectOrIdent ';' . - - $default reduce using rule 386 (objectField) - - -State 712 - - 400 visMonikerFieldFinish: '=' VIS_MONIKER_CHUNK_SYM . - - $default reduce using rule 400 (visMonikerFieldFinish) - - -State 713 - - 402 visMonikerFieldFinish: '=' $@90 . visMonikerDef - - error shift, and go to state 351 - - LIST_SYM reduce using rule 425 ($@92) - GSTRING_SYM reduce using rule 425 ($@92) - STRING reduce using rule 425 ($@92) - ASCIISTRING reduce using rule 425 ($@92) - LSTRING reduce using rule 425 ($@92) - SJISSTRING reduce using rule 425 ($@92) - TSTRING reduce using rule 425 ($@92) - CHAR reduce using rule 425 ($@92) - CONST reduce using rule 425 ($@92) - '{' reduce using rule 425 ($@92) - - visMonikerDef go to state 745 - $@92 go to state 353 - - -State 714 - - 423 optSemiColon: ';' . - - $default reduce using rule 423 (optSemiColon) - - -State 715 - - 377 objectField: VIS_MONIKER_SYM $@86 visMonikerFieldFinish optSemiColon . - - $default reduce using rule 377 (objectField) - - -State 716 - - 366 objectField: VARIANT_PTR_SYM '=' $@82 CLASS_SYM . $@83 ';' - - $default reduce using rule 365 ($@83) - - $@83 go to state 746 - - -State 717 - - 411 specificUIOrNothing: SPECIFIC_UI . - - $default reduce using rule 411 (specificUIOrNothing) - - -State 718 - - 385 objectField: KBD_ACCELERATOR_SYM kbdAcceleratorStart '=' specificUIOrNothing . kbdAccelModList kbdAccelChar ';' - - $default reduce using rule 414 (kbdAccelModList) - - kbdAccelModList go to state 747 - - -State 719 - - 368 objectField: OPTR_SYM '=' OBJECT_SYM ';' . - - $default reduce using rule 368 (objectField) - - -State 720 - - 367 objectField: OPTR_SYM '=' IDENT ';' . - - $default reduce using rule 367 (objectField) - - -State 721 - - 371 objectField: OPTR_SYM '=' '(' $@84 . FAKESTRING $@85 ')' ';' - - FAKESTRING shift, and go to state 748 - - -State 722 - - 375 objectField: CHUNK_INST_SYM '=' OBJECT_SYM ';' . - - $default reduce using rule 375 (objectField) - - -State 723 - - 374 objectField: CHUNK_INST_SYM '=' CHUNK_SYM ';' . - - $default reduce using rule 374 (objectField) - - -State 724 - - 372 objectField: CHUNK_INST_SYM '=' IDENT ';' . - - $default reduce using rule 372 (objectField) - - -State 725 - - 373 objectField: CHUNK_INST_SYM '=' someString ';' . - - $default reduce using rule 373 (objectField) - - -State 726 - - 184 wordReturnReg: AX . - - $default reduce using rule 184 (wordReturnReg) - - -State 727 - - 185 wordReturnReg: CX . - - $default reduce using rule 185 (wordReturnReg) - - -State 728 - - 186 wordReturnReg: DX . - - $default reduce using rule 186 (wordReturnReg) - - -State 729 - - 187 wordReturnReg: BP . - - $default reduce using rule 187 (wordReturnReg) - - -State 730 - - 180 returnReg: wordReturnReg ':' wordReturnReg . - - $default reduce using rule 180 (returnReg) - - -State 731 - - 181 returnReg: wordReturnReg '.' wordReturnReg . - - $default reduce using rule 181 (returnReg) - - -State 732 - - 291 objMessage: '(' $@54 FAKESTRING $@55 . ')' - - ')' shift, and go to state 749 - - -State 733 - - 264 sendOrCallOrRecordLine: sendOrCallOrRecord $@42 ObjFlagListOrNull optCastWithNoBraces objDest $@43 ':' optCastMessage objMessage '(' $@44 FakeStringOrNothing . $@45 ')' - - $default reduce using rule 263 ($@45) - - $@45 go to state 750 - - -State 734 - - 346 caHeader: '(' $@74 IDENT '(' $@75 FAKESTRING $@76 ')' . ')' - - ')' shift, and go to state 751 - - -State 735 - - 335 chunkLine: cArrayType $@65 IDENT $@66 caHeader IDENT $@67 '=' $@68 FAKESTRING $@69 ';' . - - $default reduce using rule 335 (chunkLine) - - -State 736 - - 222 aliasLine: ALIAS '(' messageSymOrIdentErr ')' $@35 typeDeclString '(' $@36 stackFlag messageParamListOrNull ')' $@37 messageReturn . ';' - - ';' shift, and go to state 752 - - -State 737 - - 454 vmElement: CACHED_SIZE_SYM '=' CONST ',' CONST ';' . - - $default reduce using rule 454 (vmElement) - - -State 738 - - 279 callsuperStuff: objDest $@47 ':' classOrError ':' ':' messageSymOrIdentErr '(' $@48 FakeStringOrNothing $@49 . ')' - - ')' shift, and go to state 753 - - -State 739 - - 382 objectField: GCN_LIST '(' identOrConst ',' identOrConst . ')' '=' aleArrayN - - ')' shift, and go to state 754 - - -State 740 - - 359 optionalArraySize: '[' $@78 FAKESTRING $@79 . ']' - - ']' shift, and go to state 755 - - -State 741 - - 381 objectField: VARDATA_SYM optionalArraySize '=' $@87 FAKESTRING . $@88 ';' - - $default reduce using rule 380 ($@88) - - $@88 go to state 756 - - -State 742 - - 363 objectField: REG_INSTANCE_SYM '=' $@80 FAKESTRING $@81 . ';' - - ';' shift, and go to state 757 - - -State 743 - - 384 objectField: COMPOSITE_SYM '=' $@89 childList ';' . - - $default reduce using rule 384 (objectField) - - -State 744 - - 417 childListNN: childListNN ',' . childNN - - error shift, and go to state 706 - OBJECT_SYM shift, and go to state 223 - IDENT shift, and go to state 224 - - childNN go to state 758 - objectOrIdent go to state 710 - - -State 745 - - 402 visMonikerFieldFinish: '=' $@90 visMonikerDef . - - $default reduce using rule 402 (visMonikerFieldFinish) - - -State 746 - - 366 objectField: VARIANT_PTR_SYM '=' $@82 CLASS_SYM $@83 . ';' - - ';' shift, and go to state 759 - - -State 747 - - 385 objectField: KBD_ACCELERATOR_SYM kbdAcceleratorStart '=' specificUIOrNothing kbdAccelModList . kbdAccelChar ';' - 413 kbdAccelModList: kbdAccelModList . KBD_MODIFIER_SYM - - KBD_SYM shift, and go to state 760 - KBD_MODIFIER_SYM shift, and go to state 761 - CHAR shift, and go to state 762 - - kbdAccelChar go to state 763 - - -State 748 - - 371 objectField: OPTR_SYM '=' '(' $@84 FAKESTRING . $@85 ')' ';' - - $default reduce using rule 370 ($@85) - - $@85 go to state 764 - - -State 749 - - 291 objMessage: '(' $@54 FAKESTRING $@55 ')' . - - $default reduce using rule 291 (objMessage) - - -State 750 - - 264 sendOrCallOrRecordLine: sendOrCallOrRecord $@42 ObjFlagListOrNull optCastWithNoBraces objDest $@43 ':' optCastMessage objMessage '(' $@44 FakeStringOrNothing $@45 . ')' - - ')' shift, and go to state 765 - - -State 751 - - 346 caHeader: '(' $@74 IDENT '(' $@75 FAKESTRING $@76 ')' ')' . - - $default reduce using rule 346 (caHeader) - - -State 752 - - 222 aliasLine: ALIAS '(' messageSymOrIdentErr ')' $@35 typeDeclString '(' $@36 stackFlag messageParamListOrNull ')' $@37 messageReturn ';' . - - $default reduce using rule 222 (aliasLine) - - -State 753 - - 279 callsuperStuff: objDest $@47 ':' classOrError ':' ':' messageSymOrIdentErr '(' $@48 FakeStringOrNothing $@49 ')' . - - $default reduce using rule 279 (callsuperStuff) - - -State 754 - - 382 objectField: GCN_LIST '(' identOrConst ',' identOrConst ')' . '=' aleArrayN - - '=' shift, and go to state 766 - - -State 755 - - 359 optionalArraySize: '[' $@78 FAKESTRING $@79 ']' . - - $default reduce using rule 359 (optionalArraySize) - - -State 756 - - 381 objectField: VARDATA_SYM optionalArraySize '=' $@87 FAKESTRING $@88 . ';' - - ';' shift, and go to state 767 - - -State 757 - - 363 objectField: REG_INSTANCE_SYM '=' $@80 FAKESTRING $@81 ';' . - - $default reduce using rule 363 (objectField) - - -State 758 - - 417 childListNN: childListNN ',' childNN . - - $default reduce using rule 417 (childListNN) - - -State 759 - - 366 objectField: VARIANT_PTR_SYM '=' $@82 CLASS_SYM $@83 ';' . - - $default reduce using rule 366 (objectField) - - -State 760 - - 410 kbdAccelChar: KBD_SYM . - - $default reduce using rule 410 (kbdAccelChar) - - -State 761 - - 413 kbdAccelModList: kbdAccelModList KBD_MODIFIER_SYM . - - $default reduce using rule 413 (kbdAccelModList) - - -State 762 - - 409 kbdAccelChar: CHAR . - - $default reduce using rule 409 (kbdAccelChar) - - -State 763 - - 385 objectField: KBD_ACCELERATOR_SYM kbdAcceleratorStart '=' specificUIOrNothing kbdAccelModList kbdAccelChar . ';' - - ';' shift, and go to state 768 - - -State 764 - - 371 objectField: OPTR_SYM '=' '(' $@84 FAKESTRING $@85 . ')' ';' - - ')' shift, and go to state 769 - - -State 765 - - 264 sendOrCallOrRecordLine: sendOrCallOrRecord $@42 ObjFlagListOrNull optCastWithNoBraces objDest $@43 ':' optCastMessage objMessage '(' $@44 FakeStringOrNothing $@45 ')' . - - $default reduce using rule 264 (sendOrCallOrRecordLine) - - -State 766 - - 382 objectField: GCN_LIST '(' identOrConst ',' identOrConst ')' '=' . aleArrayN - - OBJECT_SYM shift, and go to state 223 - IDENT shift, and go to state 224 - ';' shift, and go to state 770 - - aleArrayN go to state 771 - aleArray go to state 772 - aleArrayElement go to state 773 - objectOrIdent go to state 774 - - -State 767 - - 381 objectField: VARDATA_SYM optionalArraySize '=' $@87 FAKESTRING $@88 ';' . - - $default reduce using rule 381 (objectField) - - -State 768 - - 385 objectField: KBD_ACCELERATOR_SYM kbdAcceleratorStart '=' specificUIOrNothing kbdAccelModList kbdAccelChar ';' . - - $default reduce using rule 385 (objectField) - - -State 769 - - 371 objectField: OPTR_SYM '=' '(' $@84 FAKESTRING $@85 ')' . ';' - - ';' shift, and go to state 775 - - -State 770 - - 404 aleArrayN: ';' . - - $default reduce using rule 404 (aleArrayN) - - -State 771 - - 382 objectField: GCN_LIST '(' identOrConst ',' identOrConst ')' '=' aleArrayN . - - $default reduce using rule 382 (objectField) - - -State 772 - - 403 aleArrayN: aleArray . ';' - 405 aleArray: aleArray . ',' aleArrayElement - - ';' shift, and go to state 776 - ',' shift, and go to state 777 - - -State 773 - - 406 aleArray: aleArrayElement . - - $default reduce using rule 406 (aleArray) - - -State 774 - - 407 aleArrayElement: objectOrIdent . - - $default reduce using rule 407 (aleArrayElement) - - -State 775 - - 371 objectField: OPTR_SYM '=' '(' $@84 FAKESTRING $@85 ')' ';' . - - $default reduce using rule 371 (objectField) - - -State 776 - - 403 aleArrayN: aleArray ';' . - - $default reduce using rule 403 (aleArrayN) - - -State 777 - - 405 aleArray: aleArray ',' . aleArrayElement - - OBJECT_SYM shift, and go to state 223 - IDENT shift, and go to state 224 - - aleArrayElement go to state 778 - objectOrIdent go to state 774 - - -State 778 - - 405 aleArray: aleArray ',' aleArrayElement . - - $default reduce using rule 405 (aleArray) diff --git a/Tools/goc/parse.y b/Tools/goc/parse.y index 4ece36636..94507e391 100644 --- a/Tools/goc/parse.y +++ b/Tools/goc/parse.y @@ -297,7 +297,7 @@ static int oldContext; return; \ } while(0) -inline void +static void Parse_SetReturnAndPassMessage(MsgInvocType mit, Symbol *castRet, Symbol *castPass, @@ -373,6 +373,8 @@ Parse_SetReturnAndPassMessage(MsgInvocType mit, } %} +%debug + /* * Type returned by yylex() */ @@ -419,7 +421,7 @@ Parse_SetReturnAndPassMessage(MsgInvocType mit, %token FORCE_QUEUE RETURN_ERROR CHECK_DUPLICATE NO_FREE %token CHECK_LAST_ONLY REPLACE INSERT_AT_FRONT CAN_DISCARD_IF_DESPARATE %token NULL_TOKEN PARENT CHILDREN LOCALIZE -%token COMPILER HIGHC MSC START DATA NOT_LMEM NOT_DETACHABLE END +%token COMPILER HIGHC MSC WATCOM START DATA NOT_LMEM NOT_DETACHABLE END %token HEADER CHUNK CHUNK_ARRAY ELEMENT_ARRAY OBJECT SPECIFIC_UI %token KBD_PATH RESOURCE_OUTPUT %token VARDATA VARDATA_ALIAS IGNORE_DIRTY DEFLIB ENDLIB EXTERN diff --git a/Tools/goc/symbol.c b/Tools/goc/symbol.c index 287175e1e..581134009 100644 --- a/Tools/goc/symbol.c +++ b/Tools/goc/symbol.c @@ -13,10 +13,6 @@ * Symbol module for uic * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: symbol.c,v 1.19 96/07/09 17:09:50 jimmy Exp $"; -#endif lint #include #include "goc.h" @@ -284,7 +280,7 @@ Symbol_Find(char *name, int allScopes) { Scope *sptr, **sptrptr; Hash_Entry *entry; - int restrict = FALSE; + int restricted = FALSE; if (symdebug) { fprintf(stderr, "Looking for symbol <%s> in ",name); @@ -308,9 +304,9 @@ Symbol_Find(char *name, int allScopes) } return (NullSymbol); } - restrict = restrict || sptr->restrict; + restricted = restricted || sptr->restricted; } - if (restrict) { + if (restricted) { if (symdebug) { fprintf(stderr, "restricted => not found\n"); } @@ -535,13 +531,13 @@ Symbol_ClassUses(Symbol *class, ***********************************************************************/ Scope * Symbol_NewScope(Scope *parent, - int restrict) + int restricted) { Scope *scope; scope = (Scope *) malloc(sizeof(Scope)); scope->parent = parent; - scope->restrict = restrict; + scope->restricted = restricted; scope->symbols = (Hash_Table *) malloc(sizeof(Hash_Table)); Hash_InitTable(scope->symbols, 0, HASH_ONE_WORD_KEYS, 3); diff --git a/Tools/goc/symbol.h b/Tools/goc/symbol.h index e5c5b23a9..99386dfdb 100644 --- a/Tools/goc/symbol.h +++ b/Tools/goc/symbol.h @@ -129,7 +129,7 @@ typedef enum { typedef struct _Scope { struct _Scope *parent; /* Higher scope */ - int restrict; /* Non-zero if this scope is + int restricted; /* Non-zero if this scope is * restrictive => lookups shouldn't * proceed down the scope stack * if not found in this one */ diff --git a/Tools/include/BUILD b/Tools/include/BUILD new file mode 100644 index 000000000..3e468f478 --- /dev/null +++ b/Tools/include/BUILD @@ -0,0 +1,8 @@ +package(default_visibility = ["//visibility:public"]) + +cc_library( + name = "include", + srcs = glob(["*.h"]), + includes = [""] +) + diff --git a/Tools/include/compat/BUILD b/Tools/include/compat/BUILD new file mode 100644 index 000000000..c112c7efa --- /dev/null +++ b/Tools/include/compat/BUILD @@ -0,0 +1,7 @@ +package(default_visibility = ["//visibility:public"]) + +cc_library( + name = "compat", + srcs = glob(["*.h"]) +) + diff --git a/Tools/include/compat/file.h b/Tools/include/compat/file.h index 5fc3abed2..444eca492 100644 --- a/Tools/include/compat/file.h +++ b/Tools/include/compat/file.h @@ -26,10 +26,13 @@ #if defined(unix) # include +# include +# include # include #elif defined(_LINUX) /*# include */ # include +# include # include # include #elif defined(_MSDOS) || defined(_WIN32) diff --git a/Tools/include/compat/string.h b/Tools/include/compat/string.h index d1fd8930e..dfdace9c6 100644 --- a/Tools/include/compat/string.h +++ b/Tools/include/compat/string.h @@ -24,17 +24,6 @@ #ifndef _STRING_H_ #define _STRING_H_ -/* - * For now, I'm assuming that these are going to vary by OS rather - * than compiler. If that ever stops working, feel free to change - * this appropriately. - */ -#if defined(unix) -#include -#elif defined(_MSDOS) || defined(_WIN32) || defined(_LINUX) #include -#else -#error Your compiler/OS is not yet supported -#endif #endif /* _STRING_H_ */ diff --git a/Tools/include/config.h b/Tools/include/config.h index 79a19f75b..2df0a2ee1 100644 --- a/Tools/include/config.h +++ b/Tools/include/config.h @@ -151,12 +151,7 @@ #define HAVE_STRCASECMP -/* - * Argh, SunOS doesn't have strerror(), so we can't define - * HAVE_STRERROR here. - */ -/* #define HAVE_STRERROR */ - +#define HAVE_STRERROR #define HAVE_STRNCASECMP diff --git a/Tools/include/hash.h b/Tools/include/hash.h index 71215a85a..acf6e757c 100644 --- a/Tools/include/hash.h +++ b/Tools/include/hash.h @@ -40,7 +40,8 @@ #if defined(__HIGHC__) typedef unsigned long Opaque; #else -typedef void *Opaque; +#include +typedef intptr_t Opaque; #endif typedef char *Address; typedef int Boolean; diff --git a/Tools/utils/BUILD b/Tools/utils/BUILD new file mode 100644 index 000000000..2df463c6b --- /dev/null +++ b/Tools/utils/BUILD @@ -0,0 +1,12 @@ +package(default_visibility = ["//visibility:public"]) + +cc_library( + name = "utils", + srcs = glob(["*.c", "*.h"]), + includes = [""], + deps = [ + "//Tools/include", + "//Tools/include/compat", + ] +) + diff --git a/Tools/utils/fileUtil.c b/Tools/utils/fileUtil.c index cf71e6f1b..8fe0f8afe 100644 --- a/Tools/utils/fileUtil.c +++ b/Tools/utils/fileUtil.c @@ -27,15 +27,12 @@ * Thus, the WIN32 file functions are used here. * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: fileUtil.c,v 1.4 97/05/27 16:40:45 dbaumann Exp $"; -#endif lint #include #include #include #include +#include #include #include #ifdef _LINUX @@ -443,11 +440,7 @@ FileUtil_GetTime(FileType file) #endif #if defined(unix) || defined(_LINUX) -#if defined(_LINUX) - i = fstat(file->_handle, &stb); -#else - i = fstat(file->_file, &stb); -#endif + i = fstat(fileno(file), &stb); if (i < 0) { return i; } @@ -510,9 +503,7 @@ FileUtil_SprintError(char *result, char *fmt, ...) va_end(argList); } #if defined(unix) || defined(_MSDOS) || defined(_LINUX) - if (errno < sys_nerr) { - sprintf(result, ": %s: error #%d\n", sys_errlist[errno], errno); - } + sprintf(result, ": %s: error #%d\n", strerror(errno), errno); #elif defined(_WIN32) /* * This turns GetLastError() into a human-readable string. diff --git a/Tools/utils/hash.c b/Tools/utils/hash.c index 7104e9952..dd194ddcd 100644 --- a/Tools/utils/hash.c +++ b/Tools/utils/hash.c @@ -38,12 +38,9 @@ * * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: hash.c,v 1.4 96/05/20 18:55:46 dbaumann Exp $"; -#endif lint #include +#include #include #include @@ -579,7 +576,7 @@ Hash(register Hash_Table *tablePtr, } break; case HASH_ONE_WORD_KEYS: - i = (int) key; + i = (int)(intptr_t) key; break; case 2: i = ((int *) key)[0] + ((int *) key)[1]; diff --git a/Tools/utils/localize.c b/Tools/utils/localize.c index 6b0421f33..2ed92cab7 100644 --- a/Tools/utils/localize.c +++ b/Tools/utils/localize.c @@ -48,7 +48,7 @@ REVISION HISTORY: static FILE *locOut; /* output file */ static Hash_Table locHash; /* all resources */ static ResourceSym *currentResource = NULL;/* currnet resource */ -static upcaseLinkerResourceNames; /* true iff using MetaWare */ +static int upcaseLinkerResourceNames; /* true iff using MetaWare */ static char *locName = NULL; diff --git a/Tools/utils/malErr.c b/Tools/utils/malErr.c index 21d8a3805..fb154c81a 100644 --- a/Tools/utils/malErr.c +++ b/Tools/utils/malErr.c @@ -25,13 +25,10 @@ * to stderr. * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: malErr.c,v 1.1 91/04/26 11:47:05 adam Exp $"; -#endif lint #include #include +#include #ifdef _WIN32 #include #include diff --git a/Tools/utils/mallint.h b/Tools/utils/mallint.h index 126b7f93a..f84a1eba6 100644 --- a/Tools/utils/mallint.h +++ b/Tools/utils/mallint.h @@ -92,7 +92,7 @@ struct dblk { * can be introduced by errant programs. */ -#define blkhdr(p) (Dblk)((p)==0?(malloc_t)0:(((malloc_t)p)-(int)&((Dblk)0)->data)) +#define blkhdr(p) (Dblk)((p)==0?(malloc_t)0:(((malloc_t)p)-(intptr_t)&((Dblk)0)->data)) #define weight(x) ((x) == NIL? 0: (x->size)) #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) #define nextblk(p, size) ((Dblk) ((malloc_t) (p) + (size))) @@ -105,9 +105,9 @@ struct dblk { #define heapsize() (_ubound - _lbound) #if defined(sparc) -#define misaligned(p) ((unsigned)(p)&7) +#define misaligned(p) ((intptr_t)(p)&7) #else -#define misaligned(p) ((unsigned)(p)&3) +#define misaligned(p) ((intptr_t)(p)&3) #endif extern Freehdr _root; diff --git a/Tools/utils/malloc.c b/Tools/utils/malloc.c index 5293f4caf..d0c651db4 100644 --- a/Tools/utils/malloc.c +++ b/Tools/utils/malloc.c @@ -1,7 +1,3 @@ -#if !defined(lint) -static char *sccsid = "@(#)malloc.c 1.1 86/09/24 SMI"; -#endif - /* * Copyright (c) 1986 by Sun Microsystems, Inc. * @@ -34,6 +30,8 @@ static char *sccsid = "@(#)malloc.c 1.1 86/09/24 SMI"; #include #include #include +#include +#include #if defined(_MSDOS) && defined(__HIGHC__) #include @@ -178,8 +176,8 @@ static int debug_level = 1; #else /*!DEBUG =================================================*/ -#define malloc_debug(level) 0 -#define malloc_verify() 1 +#define malloc_debug(level) do {} while(0) +#define malloc_verify() do {} while(0) #define debug_level 0 #define badblksize(p,size) 0 @@ -493,7 +491,7 @@ delete(register Freehdr *p) if (left_weight == 0) { /* zero-length block */ error("blocksize=0 at %#x\n", - (int)left_branch->block->data); + (intptr_t)left_branch->block->data); break; } *p = left_branch; @@ -508,8 +506,8 @@ delete(register Freehdr *p) if (right_branch != NIL) { if (right_weight == 0) { /* zero-length block */ - error("blocksize=0 at %#x\n", - (int)right_branch->block->data); + error("blocksize=0 at %p\n", + right_branch->block->data); break; } *p = right_branch; @@ -837,8 +835,7 @@ free(malloc_t ptr) LOG(("f %d %#x\n", nbytes, oldblk)); if (badblksize(oldblk,nbytes)) { - error("free: bad block size (%d) at %#x\n", - (int)nbytes, (int)oldblk ); + error("free: bad block size (%d) at %p\n", nbytes, oldblk); return; } @@ -872,8 +869,8 @@ free(malloc_t ptr) * is bad news. Return to avoid * further fouling up the the tree. */ - error("free: blocks %#x, %#x overlap\n", - (int)oldblk, (int)neighbor_blk); + error("free: blocks %p, %p overlap\n", + oldblk, neighbor_blk); return; } else { /* @@ -907,8 +904,7 @@ free(malloc_t ptr) /* * This block has already been freed */ - error("free: block %#x was already free\n", - (int)ptr); + error("free: block %p was already free\n", ptr); return; } else { /* @@ -921,7 +917,7 @@ free(malloc_t ptr) * This block has already been freed * as "oldblk == neighbor_blk" */ - error("free: block %#x was already free\n", (int)ptr); + error("free: block %p was already free\n", ptr); return; } /*else*/ @@ -1531,7 +1527,7 @@ getfreehdr(int allowgc) if (nfreehdrs <= 0) { size = NFREE_HDRS*sizeof(struct freehdr) + sizeof(struct dblk); blk = (Dblk) sbrk(size); - if ((int)blk == -1) { + if ((intptr_t)blk == -1) { if (noerr) { malloc_err(1, oom, strlen(oom)); if (allowgc) { @@ -2179,7 +2175,7 @@ malloc_printstats(malloc_printstats_callback *printFunc, void *data) while (p < (Dblk) _ubound) { size = p->size; #if !defined(DEBUG) - fp = (Freehdr)(p->tag == 0xff); + fp = (Freehdr)(intptr_t)(p->tag == 0xff); #else fp = malloc_findhdr(p); #endif @@ -2262,7 +2258,7 @@ shrinkheap(void) * Final block is at the end of memory. Good. See if we can reduce * it a page or more... */ - malloc_t p = (malloc_t)roundup((int)hp->block,nbpg); + malloc_t p = (malloc_t)roundup((intptr_t)hp->block,nbpg); Dblk b; int size; diff --git a/Tools/utils/memAl.c b/Tools/utils/memAl.c index 31e9d6f92..ba337b1d4 100644 --- a/Tools/utils/memAl.c +++ b/Tools/utils/memAl.c @@ -22,11 +22,6 @@ * Allocate a block. * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: memAl.c,v 1.1 91/04/26 11:47:36 adam Exp $"; -#endif lint - #include #include diff --git a/Tools/utils/memAlLkd.c b/Tools/utils/memAlLkd.c index d436d8bfd..348939bce 100644 --- a/Tools/utils/memAlLkd.c +++ b/Tools/utils/memAlLkd.c @@ -22,11 +22,6 @@ * Allocate a block and lock it immediately. * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: memAlLkd.c,v 1.1 91/04/26 11:47:46 adam Exp $"; -#endif lint - #include #include "memInt.h" diff --git a/Tools/utils/memFree.c b/Tools/utils/memFree.c index 78ff70d3e..88a3076df 100644 --- a/Tools/utils/memFree.c +++ b/Tools/utils/memFree.c @@ -22,11 +22,6 @@ * Free a block and handle * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: memFree.c,v 1.4 91/04/26 11:47:54 adam Exp $"; -#endif lint - #include #include "malloc.h" #include "memInt.h" diff --git a/Tools/utils/memInfo.c b/Tools/utils/memInfo.c index 7bd1cc1a9..ab5be9ec7 100644 --- a/Tools/utils/memInfo.c +++ b/Tools/utils/memInfo.c @@ -22,11 +22,6 @@ * Retrieve information about a handle * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: memInfo.c,v 1.6 92/06/17 17:42:48 jimmy Exp $"; -#endif lint - #include #include "memInt.h" diff --git a/Tools/utils/memLock.c b/Tools/utils/memLock.c index 55dfe3e2b..ec874b77d 100644 --- a/Tools/utils/memLock.c +++ b/Tools/utils/memLock.c @@ -22,11 +22,6 @@ * Lock a block and return its address. * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: memLock.c,v 1.5 91/04/26 11:48:18 adam Exp $"; -#endif lint - #include #include "memInt.h" diff --git a/Tools/utils/memRAl.c b/Tools/utils/memRAl.c index e2654abc5..8b63fed29 100644 --- a/Tools/utils/memRAl.c +++ b/Tools/utils/memRAl.c @@ -22,11 +22,6 @@ * Change the size of an existing block. * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: memRAl.c,v 1.2 92/06/02 21:17:54 adam Exp $"; -#endif lint - #include #include #include "malloc.h" diff --git a/Tools/utils/memRAlLk.c b/Tools/utils/memRAlLk.c index 9cf374178..24d35f612 100644 --- a/Tools/utils/memRAlLk.c +++ b/Tools/utils/memRAlLk.c @@ -22,11 +22,6 @@ * Change the size of a block and lock it down. * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: memRAlLk.c,v 1.1 91/04/26 11:48:27 adam Exp $"; -#endif lint - #include #include "memInt.h" diff --git a/Tools/utils/memUtils.c b/Tools/utils/memUtils.c index bd2cd2add..7c9658b06 100644 --- a/Tools/utils/memUtils.c +++ b/Tools/utils/memUtils.c @@ -24,14 +24,10 @@ * Functions to deal with the handle table * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: memUtils.c,v 1.7 96/05/20 18:57:08 dbaumann Exp $"; -#endif lint - #include #include #include +#include #ifdef _WIN32 #include diff --git a/Tools/utils/objSwap.c b/Tools/utils/objSwap.c index 10910c047..63e5c90bf 100644 --- a/Tools/utils/objSwap.c +++ b/Tools/utils/objSwap.c @@ -22,11 +22,6 @@ * PC/GEOS object file. * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: objSwap.c,v 1.10 96/05/20 18:57:19 dbaumann Exp $"; -#endif lint - #include #include #include "objSwap.h" @@ -730,7 +725,7 @@ ObjSwap_Reloc(VMHandle vmHandle, /* File from whence it comes */ MemHandle handle, /* Its memory handle */ genptr block) /* The base of the locked block */ { - static const VMRelocRoutine *relocRoutines[] = { + static VMRelocRoutine *relocRoutines[] = { ST_Reloc, /* OID_STRING_HEAD */ ST_Reloc, /* OID_STRING_CHAIN */ ObjSwapRelBlock, /* OID_REL_BLOCK */ @@ -780,7 +775,7 @@ ObjSwap_Reloc_NewFormat( MemHandle handle, /* Its memory handle */ genptr block) /* The base of the locked block */ { - static const VMRelocRoutine *relocRoutines_NewFormat[] = { + static VMRelocRoutine *relocRoutines_NewFormat[] = { ST_Reloc, /* OID_STRING_HEAD */ ST_Reloc, /* OID_STRING_CHAIN */ ObjSwapRelBlock, /* OID_REL_BLOCK */ diff --git a/Tools/utils/printf.c b/Tools/utils/printf.c index 16b132ef6..683e1f446 100644 --- a/Tools/utils/printf.c +++ b/Tools/utils/printf.c @@ -41,13 +41,9 @@ * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: printf.c,v 1.10 93/01/13 22:38:58 josh Exp $"; -#endif lint - #include #include +#include #if defined(is68k) || defined(sparc) #define sprintf sprintf_is_declared_wrong diff --git a/Tools/utils/stClose.c b/Tools/utils/stClose.c index 5510239c7..1ca1207e2 100644 --- a/Tools/utils/stClose.c +++ b/Tools/utils/stClose.c @@ -17,11 +17,6 @@ * Release extra working space allocated for the table * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: stClose.c,v 1.8 92/06/22 15:07:58 josh Exp $"; -#endif lint - #include #include "stInt.h" diff --git a/Tools/utils/stCreate.c b/Tools/utils/stCreate.c index 296fc5052..74ab8753e 100644 --- a/Tools/utils/stCreate.c +++ b/Tools/utils/stCreate.c @@ -17,11 +17,6 @@ * Create a string table in a VM file * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: stCreate.c,v 1.6 91/04/26 11:49:32 adam Exp $"; -#endif lint - #include #include "stInt.h" diff --git a/Tools/utils/stDest.c b/Tools/utils/stDest.c index 976d3e133..fb8845e4a 100644 --- a/Tools/utils/stDest.c +++ b/Tools/utils/stDest.c @@ -17,11 +17,6 @@ * Free all space occupied by a string table. * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: stDest.c,v 1.1 91/04/26 11:49:37 adam Exp $"; -#endif lint - #include #include "stInt.h" diff --git a/Tools/utils/stDup.c b/Tools/utils/stDup.c index e4a4be858..e7343b67f 100644 --- a/Tools/utils/stDup.c +++ b/Tools/utils/stDup.c @@ -17,11 +17,6 @@ * Duplicate a string-table entry from one table to another * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: stDup.c,v 1.5 91/04/26 11:49:45 adam Exp $"; -#endif lint - #include #include "stInt.h" diff --git a/Tools/utils/stEnt.c b/Tools/utils/stEnt.c index 961bbec7c..d37855407 100644 --- a/Tools/utils/stEnt.c +++ b/Tools/utils/stEnt.c @@ -17,12 +17,8 @@ * Look for and enter, if not found, a string in a string table * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: stEnt.c,v 1.3 92/06/22 15:15:20 jimmy Exp $"; -#endif lint - #include +#include #include "stInt.h" @@ -131,7 +127,7 @@ STAlloc(VMHandle vmHandle, /* Handle of file containing table */ * * Copy the string in and null-terminate it. */ - bcopy(name, stcp->string, len); + memcpy(stcp->string, name, len); stcp->string[len] = '\0'; /* diff --git a/Tools/utils/stEntNL.c b/Tools/utils/stEntNL.c index e8f797402..c40e4b623 100644 --- a/Tools/utils/stEntNL.c +++ b/Tools/utils/stEntNL.c @@ -17,10 +17,6 @@ * Enter a null-terminated string into the table * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: stEntNL.c,v 1.1 91/04/26 11:49:52 adam Exp $"; -#endif lint #include #include diff --git a/Tools/utils/stHash.c b/Tools/utils/stHash.c index 49855a70e..8a292efb5 100644 --- a/Tools/utils/stHash.c +++ b/Tools/utils/stHash.c @@ -17,11 +17,6 @@ * Hash function for string table. * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: stHash.c,v 1.7 92/06/03 16:34:57 adam Exp $"; -#endif lint - #include #include "stInt.h" diff --git a/Tools/utils/stIndex.c b/Tools/utils/stIndex.c index c32219b85..f6989175e 100644 --- a/Tools/utils/stIndex.c +++ b/Tools/utils/stIndex.c @@ -17,11 +17,6 @@ * Return the hash value for an identifier * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: stIndex.c,v 1.4 91/04/26 11:50:08 adam Exp $"; -#endif lint - #include #include "stInt.h" #include diff --git a/Tools/utils/stLook.c b/Tools/utils/stLook.c index 05d2f5262..d1fa53b66 100644 --- a/Tools/utils/stLook.c +++ b/Tools/utils/stLook.c @@ -17,11 +17,6 @@ * Look up a string in a string table. * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: stLook.c,v 1.2 92/04/02 22:20:18 adam Exp $"; -#endif lint - #include #include "stInt.h" diff --git a/Tools/utils/stLookNL.c b/Tools/utils/stLookNL.c index ba19466a3..0486f2b6e 100644 --- a/Tools/utils/stLookNL.c +++ b/Tools/utils/stLookNL.c @@ -17,10 +17,6 @@ * Lookup a null-terminated string into the table * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: stLookNL.c,v 1.3 96/05/20 18:57:31 dbaumann Exp $"; -#endif lint #include #include "stInt.h" diff --git a/Tools/utils/stReloc.c b/Tools/utils/stReloc.c index 86af930fa..0b6df5e10 100644 --- a/Tools/utils/stReloc.c +++ b/Tools/utils/stReloc.c @@ -17,10 +17,6 @@ * Byte-swapping for string-table blocks. * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: stReloc.c,v 1.7 92/06/22 15:19:10 jimmy Exp $"; -#endif lint #include #include "stInt.h" diff --git a/Tools/utils/stSearch.c b/Tools/utils/stSearch.c index 5e2fef8fb..b4b2cca42 100644 --- a/Tools/utils/stSearch.c +++ b/Tools/utils/stSearch.c @@ -17,12 +17,9 @@ * Utility used to search a hash chain for a string. * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: stSearch.c,v 1.8 92/06/03 16:35:24 adam Exp $"; -#endif lint #include +#include #include "stInt.h" @@ -74,7 +71,7 @@ STSearch(VMHandle vmHandle, /* Handle of VM file */ stcp = ST_NEXT_CP(stcp,stcp->length)) { if ((stcp->hashval == hashval) && (stcp->length == len) && - bcmp(stcp->string, name, len) == 0) + memcmp(stcp->string, name, len) == 0) { result = (ID)((hdr->chains[bucket] << 16) | (stcp->string - (char *)chdr)); diff --git a/Tools/utils/sttab.c b/Tools/utils/sttab.c index 73107e59d..09d4cd907 100644 --- a/Tools/utils/sttab.c +++ b/Tools/utils/sttab.c @@ -31,10 +31,6 @@ * string. The strings are never freed. * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: sttab.c,v 1.3 92/06/03 16:35:39 adam Exp $"; -#endif lint #include #include diff --git a/Tools/utils/vmAl.c b/Tools/utils/vmAl.c index ea53cc7a4..776d2f052 100644 --- a/Tools/utils/vmAl.c +++ b/Tools/utils/vmAl.c @@ -17,10 +17,6 @@ * Allocate a new VM block * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: vmAl.c,v 1.2 96/05/20 18:58:01 dbaumann Exp $"; -#endif lint #include #include "vmInt.h" diff --git a/Tools/utils/vmAlRd.c b/Tools/utils/vmAlRd.c index b7b1509a3..b0201bca6 100644 --- a/Tools/utils/vmAlRd.c +++ b/Tools/utils/vmAlRd.c @@ -17,15 +17,12 @@ * Read a block into new memory from the file * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: vmAlRd.c,v 1.4 92/07/17 19:35:10 adam Exp $"; -#endif lint #include #include "vmInt.h" #include +#include #include #include diff --git a/Tools/utils/vmAlUnas.c b/Tools/utils/vmAlUnas.c index 6f68f21f4..fd01b1a86 100644 --- a/Tools/utils/vmAlUnas.c +++ b/Tools/utils/vmAlUnas.c @@ -17,10 +17,6 @@ * Allocate an unassigned handle to someone * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: vmAlUnas.c,v 1.5 96/05/20 18:58:12 dbaumann Exp $"; -#endif lint #include #include diff --git a/Tools/utils/vmAttach.c b/Tools/utils/vmAttach.c index f0fe26404..00d00b206 100644 --- a/Tools/utils/vmAttach.c +++ b/Tools/utils/vmAttach.c @@ -17,10 +17,6 @@ * Attach a memory block to a vm block * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: vmAttach.c,v 1.5 91/04/26 11:51:25 adam Exp $"; -#endif lint #include #include "vmInt.h" diff --git a/Tools/utils/vmAttr.c b/Tools/utils/vmAttr.c index b2df0769d..d3c2cf074 100644 --- a/Tools/utils/vmAttr.c +++ b/Tools/utils/vmAttr.c @@ -21,10 +21,6 @@ * Functions to set/get the VM file's attribute bits. * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: vmAttr.c,v 1.3 92/12/10 22:08:46 adam Exp $"; -#endif lint #include #include "vmInt.h" diff --git a/Tools/utils/vmClose.c b/Tools/utils/vmClose.c index 184e6c9f2..18da6e36f 100644 --- a/Tools/utils/vmClose.c +++ b/Tools/utils/vmClose.c @@ -17,12 +17,9 @@ * Close down a VM file * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: vmClose.c,v 1.7 92/09/02 19:33:53 adam Exp $"; -#endif lint #include +#include #include "vmInt.h" #include "malloc.h" diff --git a/Tools/utils/vmDetach.c b/Tools/utils/vmDetach.c index 90128d9c4..6f1f2a5a8 100644 --- a/Tools/utils/vmDetach.c +++ b/Tools/utils/vmDetach.c @@ -17,10 +17,6 @@ * Detach a memory handle from a VM block handle * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: vmDetach.c,v 1.5 91/04/26 11:51:50 adam Exp $"; -#endif lint #include #include "vmInt.h" @@ -86,7 +82,7 @@ VMDetach(VMHandle vmHandle, /* * No copy of the block in the file -- choke now. */ - return((MemHandle)NULL); + return 0; } } diff --git a/Tools/utils/vmDirty.c b/Tools/utils/vmDirty.c index 44b392c03..7ebce98c3 100644 --- a/Tools/utils/vmDirty.c +++ b/Tools/utils/vmDirty.c @@ -17,10 +17,6 @@ * Mark a block as dirty * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: vmDirty.c,v 1.7 91/04/26 11:51:58 adam Exp $"; -#endif lint #include #include "vmInt.h" diff --git a/Tools/utils/vmEmpty.c b/Tools/utils/vmEmpty.c index 6b7419f15..47c238ade 100644 --- a/Tools/utils/vmEmpty.c +++ b/Tools/utils/vmEmpty.c @@ -17,10 +17,6 @@ * Nuke any memory associated witha block * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: vmEmpty.c,v 3.1 91/04/26 11:52:08 adam Exp $"; -#endif lint #include #include "vmInt.h" diff --git a/Tools/utils/vmFAl.c b/Tools/utils/vmFAl.c index 7b93a8f82..4d3761994 100644 --- a/Tools/utils/vmFAl.c +++ b/Tools/utils/vmFAl.c @@ -17,10 +17,6 @@ * Allocation of space in a VM file * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: vmFAl.c,v 1.2 92/06/02 21:18:20 adam Exp $"; -#endif lint #include #include "vmInt.h" diff --git a/Tools/utils/vmFFree.c b/Tools/utils/vmFFree.c index 234c499e9..edb9234ad 100644 --- a/Tools/utils/vmFFree.c +++ b/Tools/utils/vmFFree.c @@ -17,10 +17,6 @@ * Release a region of a VM file * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: vmFFree.c,v 1.1 91/04/26 11:52:24 adam Exp $"; -#endif lint #include #include "vmInt.h" diff --git a/Tools/utils/vmFind.c b/Tools/utils/vmFind.c index 0fb61ff92..d6944cfd1 100644 --- a/Tools/utils/vmFind.c +++ b/Tools/utils/vmFind.c @@ -17,10 +17,6 @@ * Locate a VM block by user-assigned ID * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: vmFind.c,v 1.5 91/04/26 11:52:30 adam Exp $"; -#endif lint #include #include "vmInt.h" diff --git a/Tools/utils/vmFree.c b/Tools/utils/vmFree.c index 3b9e27f7f..170bdf0ca 100644 --- a/Tools/utils/vmFree.c +++ b/Tools/utils/vmFree.c @@ -17,10 +17,6 @@ * Free a VM block * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: vmFree.c,v 1.6 91/04/26 11:52:39 adam Exp $"; -#endif lint #include #include "vmInt.h" diff --git a/Tools/utils/vmGVers.c b/Tools/utils/vmGVers.c index ebb92dc0e..25844f02f 100644 --- a/Tools/utils/vmGVers.c +++ b/Tools/utils/vmGVers.c @@ -22,10 +22,6 @@ * DESCRIPTION: * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: vmGVers.c,v 1.1 92/06/02 21:18:25 adam Exp $"; -#endif lint #include #include "vmInt.h" diff --git a/Tools/utils/vmHeader.c b/Tools/utils/vmHeader.c index 28d890b13..e26ee272f 100644 --- a/Tools/utils/vmHeader.c +++ b/Tools/utils/vmHeader.c @@ -25,16 +25,13 @@ * BYTE-ORDER. THE CALLER MUST BE AWARE OF THIS. * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: vmHeader.c,v 1.4 92/07/17 19:35:24 adam Exp $"; -#endif lint #include #include #include "vmInt.h" #include +#include #if defined(__HIGHC__) || defined(_WIN32) || defined(__WATCOMC__) # include #endif @@ -64,9 +61,9 @@ VMGetHeader(VMHandle vmHandle, VMFilePtr file = (VMFilePtr)vmHandle; if (file->flags & VM_2_0) { - bcopy(&file->fileHdr.v2.VMFH_gfh, gfhPtr, sizeof(GeosFileHeader2)); + memcpy(gfhPtr, &file->fileHdr.v2.VMFH_gfh, sizeof(GeosFileHeader2)); } else { - bcopy(&file->fileHdr.v1.VMFH_gfh, gfhPtr, sizeof(GeosFileHeader)); + memcpy(gfhPtr, &file->fileHdr.v1.VMFH_gfh, sizeof(GeosFileHeader)); } } @@ -95,15 +92,14 @@ VMSetHeader(VMHandle vmHandle, { VMFilePtr file = (VMFilePtr)vmHandle; long bytesWritten = 0; - int seekPos = 0; FileUtil_Seek(file->fd, 0L, SEEK_SET); if (file->flags & VM_2_0) { - bcopy(gfhPtr, &file->fileHdr.v2.VMFH_gfh, sizeof(GeosFileHeader2)); + memcpy(&file->fileHdr.v2.VMFH_gfh, gfhPtr, sizeof(GeosFileHeader2)); FileUtil_Write(file->fd, (unsigned const char *)&file->fileHdr.v2.VMFH_gfh, sizeof(GeosFileHeader2), &bytesWritten); } else { - bcopy(gfhPtr, &file->fileHdr.v1.VMFH_gfh, sizeof(GeosFileHeader)); + memcpy(&file->fileHdr.v1.VMFH_gfh, gfhPtr, sizeof(GeosFileHeader)); FileUtil_Write(file->fd, (unsigned const char *)&file->fileHdr.v1.VMFH_gfh, sizeof(GeosFileHeader), &bytesWritten); } diff --git a/Tools/utils/vmInfo.c b/Tools/utils/vmInfo.c index f3d18cc33..11fc9416a 100644 --- a/Tools/utils/vmInfo.c +++ b/Tools/utils/vmInfo.c @@ -17,10 +17,6 @@ * Return info about a VM block * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: vmInfo.c,v 3.2 92/06/22 15:32:11 jimmy Exp $"; -#endif lint #include #include "vmInt.h" diff --git a/Tools/utils/vmLock.c b/Tools/utils/vmLock.c index 3d1ef12f4..74831461d 100644 --- a/Tools/utils/vmLock.c +++ b/Tools/utils/vmLock.c @@ -17,10 +17,6 @@ * Lock a VM block, returning its handle and address * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: vmLock.c,v 1.6 92/06/17 17:41:27 jimmy Exp $"; -#endif lint #include #include "vmInt.h" diff --git a/Tools/utils/vmMapBlk.c b/Tools/utils/vmMapBlk.c index a2bb38c30..2adf99205 100644 --- a/Tools/utils/vmMapBlk.c +++ b/Tools/utils/vmMapBlk.c @@ -23,10 +23,6 @@ * Functions for playing with the map block * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: vmMapBlk.c,v 1.6 92/06/02 21:19:08 adam Exp $"; -#endif lint #include #include "vmInt.h" diff --git a/Tools/utils/vmModUID.c b/Tools/utils/vmModUID.c index 18f84d6c3..ef50ecc39 100644 --- a/Tools/utils/vmModUID.c +++ b/Tools/utils/vmModUID.c @@ -17,10 +17,6 @@ * Change the user-assigned ID number for a VM block * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: vmModUID.c,v 1.5 91/04/26 11:53:29 adam Exp $"; -#endif lint #include #include "vmInt.h" diff --git a/Tools/utils/vmOpen.c b/Tools/utils/vmOpen.c index cf75d087c..e6920b266 100644 --- a/Tools/utils/vmOpen.c +++ b/Tools/utils/vmOpen.c @@ -21,15 +21,12 @@ * Open a VM file * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: vmOpen.c,v 1.32 96/05/20 18:58:32 dbaumann Exp $"; -#endif lint #include #include "vmInt.h" #include +#include #include #include #include @@ -72,7 +69,7 @@ VMInitFile(VMFilePtr file) VMHeader *hdr; /* Allocated header to be filled-in */ VMBlock *block; /* General block pointer */ MemHandle hdrHandle; /* Memory handle of header block */ - char *cp, *cp2; + char *cp; int returnCode; long bytesWritten = 0; @@ -101,8 +98,10 @@ VMInitFile(VMFilePtr file) */ cp = rindex(file->name, '/'); #if defined(_WIN32) || defined(_MSDOS) - cp2 = rindex(file->name, '\\'); - cp = (cp2 > cp) ? cp2 : cp; + { + int cp2 = rindex(file->name, '\\'); + cp = (cp2 > cp) ? cp2 : cp; + } #endif if (cp == NULL) { cp = file->name; @@ -288,7 +287,6 @@ VMOpen(short flags, /* Flags for open */ /* * Find a unique name using the template created above */ -#if defined(_LINUX) { int fp = mkstemp(file->name); if(fp == -1) { @@ -302,15 +300,6 @@ VMOpen(short flags, /* Flags for open */ file->fd = fdopen(fp, "w+"); } } -#else - if (mktemp(file->name) != NULL) { - returnCode = FileUtil_Open(&(file->fd), file->name, - oflags, sflags, 0666); - if (returnCode == TRUE) { - break; - } - } -#endif break; } case VMO_CREATE_TRUNCATE: @@ -393,7 +382,7 @@ VMOpen(short flags, /* Flags for open */ FileUtil_Seek(file->fd, 0L, SEEK_SET); errno = 0; /* In case file smaller than file header */ - FileUtil_Read(file->fd, (char *)&file->fileHdr, HEADER_SIZE, &bytesRead); + FileUtil_Read(file->fd, (void *)&file->fileHdr, HEADER_SIZE, &bytesRead); switch (bytesRead) { case 0: /* diff --git a/Tools/utils/vmSetRel.c b/Tools/utils/vmSetRel.c index 5407dd30c..cd5a4dfd7 100644 --- a/Tools/utils/vmSetRel.c +++ b/Tools/utils/vmSetRel.c @@ -17,10 +17,6 @@ * Change the relocation routine for a VM File * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: vmSetRel.c,v 1.1 91/04/26 11:53:44 adam Exp $"; -#endif lint #include #include "vmInt.h" diff --git a/Tools/utils/vmUpdate.c b/Tools/utils/vmUpdate.c index bcc34a9fb..84821ab46 100644 --- a/Tools/utils/vmUpdate.c +++ b/Tools/utils/vmUpdate.c @@ -23,16 +23,14 @@ * Synchronize a VM file with its in-core image * ***********************************************************************/ -#ifndef lint -static char *rcsid = -"$Id: vmUpdate.c,v 1.14 96/05/01 20:07:54 adam Exp $"; -#endif lint #include #include +#include +#include +#include #include "vmInt.h" #include "malloc.h" -#include #if !defined(_WIN32) # define size_t other_size_t @@ -129,13 +127,13 @@ VMFlushWrites(VMFilePtr file) { genptr buf; int inbuf; - struct stat stb; + /* struct stat stb; */ VMQueue *q, *nq; int offset; int blksize = 2048; /* assume 2048, unless we can * find out more in a particular * OS */ - int fstatResult; + /* int fstatResult; */ long bytesWritten = 0; #if 0 @@ -188,7 +186,7 @@ VMFlushWrites(VMFilePtr file) * offset accordingly. */ if (inbuf + q->size < blksize) { - bcopy(q->block, buf+inbuf, q->size); + memcpy(buf+inbuf, q->block, q->size); inbuf += q->size; offset += q->size; q->size = 0; @@ -201,7 +199,7 @@ VMFlushWrites(VMFilePtr file) */ int n = blksize - inbuf; - bcopy(q->block, buf+inbuf, n); + memcpy(buf+inbuf, q->block, n); q->size -= n; q->block += n; offset += n; @@ -361,7 +359,6 @@ VMWriteBlock(VMFilePtr file, /* File to which block belongs */ VMBlockHandle blockH; int doSwap=0; - int bytesWritten = 0; hdr = file->blkHdr; @@ -523,20 +520,23 @@ VMWriteBlock(VMFilePtr file, /* File to which block belongs */ /* * Write the data out. */ - FileUtil_Write(file->fd, addr, size, &bytesWritten); - if (bytesWritten < size) { - /* - * No room on device? Mark the block as still dirty and return 0 - * to signal error. - * - * XXX: Release file space? - */ - /* - * Swap header back, if necessary. - */ - VMSwapHeader(file->blkHdr, size); - block->VMB_sig = VM_DIRTY_BLK_SIG; - return 0; + { + int bytesWritten = 0; + FileUtil_Write(file->fd, addr, size, &bytesWritten); + if (bytesWritten < size) { + /* + * No room on device? Mark the block as still dirty and return 0 + * to signal error. + * + * XXX: Release file space? + */ + /* + * Swap header back, if necessary. + */ + VMSwapHeader(file->blkHdr, size); + block->VMB_sig = VM_DIRTY_BLK_SIG; + return 0; + } } /* @@ -737,7 +737,7 @@ VMUpdate(VMHandle vmHandle) file->fileHdr.v2.VMFH_headerSize = swapword(block->VMB_size); file->fileHdr.v2.VMFH_signature = swapword(VMFH_SIG); FileUtil_Write(file->fd, - (char *)&file->fileHdr.v2, + (const void *)&file->fileHdr.v2, sizeof(file->fileHdr.v2), &bytesWritten); if (bytesWritten != sizeof(file->fileHdr.v2)) @@ -749,7 +749,7 @@ VMUpdate(VMHandle vmHandle) file->fileHdr.v1.VMFH_headerSize = swapword(block->VMB_size); file->fileHdr.v1.VMFH_signature = swapword(VMFH_SIG); FileUtil_Write(file->fd, - (char *)&file->fileHdr.v1, + (const void *)&file->fileHdr.v1, sizeof(file->fileHdr.v1), &bytesWritten); if (bytesWritten != sizeof(file->fileHdr.v1)) diff --git a/WORKSPACE b/WORKSPACE new file mode 100644 index 000000000..e69de29bb