1 /* A Bison parser, made by GNU Bison 3.0.4. */
2
3 /* Bison implementation for Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
6
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20 /* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
29
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
32
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
35
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
42
43 /* Identify Bison output. */
44 #define YYBISON 1
45
46 /* Bison version. */
47 #define YYBISON_VERSION "3.0.4"
48
49 /* Skeleton name. */
50 #define YYSKELETON_NAME "yacc.c"
51
52 /* Pure parsers. */
53 #define YYPURE 0
54
55 /* Push parsers. */
56 #define YYPUSH 0
57
58 /* Pull parsers. */
59 #define YYPULL 1
60
61
62
63
64 /* Copy the first part of user declarations. */
65 #line 1 "asm/as1600_real.y" /* yacc.c:339 */
66
67 /* Clang doesn't like the unreachable code in Bison's generated output. */
68 #ifdef __clang__
69 #pragma clang diagnostic ignored "-Wunreachable-code"
70 #endif
71
72 #if 0
73 # define YYDEBUG 1
74 # define YYERROR_VERBOSE 1
75 # define YYTOKEN_TABLE 1
76 int yydebug = 1;
77 #endif
78
79 /* NOTICE: This code is based on the Public Domain AS2650.Y that comes
80 * with the Frankenstein Assembler, by Mark Zenier. The changes
81 * that I, Joseph Zbiciak, have made are being placed under GPL.
82 * See GPL notice immediately below.
83 */
84
85 /* ======================================================================== */
86 /* This program is free software; you can redistribute it and/or modify */
87 /* it under the terms of the GNU General Public License as published by */
88 /* the Free Software Foundation; either version 2 of the License, or */
89 /* (at your option) any later version. */
90 /* */
91 /* This program is distributed in the hope that it will be useful, */
92 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
93 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */
94 /* General Public License for more details. */
95 /* */
96 /* You should have received a copy of the GNU General Public License along */
97 /* with this program; if not, write to the Free Software Foundation, Inc., */
98 /* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
99 /* ======================================================================== */
100 /* Copyright (c) 1998-1999, Joseph Zbiciak */
101 /* ======================================================================== */
102
103
104 /*
105 HEADER: ;
106 TITLE: Frankenstein Cross Assemblers;
107 VERSION: 2.0;
108 DESCRIPTION: " Reconfigurable Cross-assembler producing Intel (TM)
109 Hex format object records. ";
110 KEYWORDS: cross-assemblers, 1600, 1805, 2650, 6301, 6502, 6805, 6809,
111 6811, tms7000, 8048, 8051, 8096, z8, z80;
112 SYSTEM: UNIX, MS-Dos ;
113 FILENAME: as1600.y;
114 WARNINGS: "This software is in the public domain.
115 Any prior copyright claims are relinquished.
116
117 This software is distributed with no warranty whatever.
118 The author takes no responsibility for the consequences
119 of its use.
120
121 Yacc (or Bison) required to compile." ;
122 SEE-ALSO: as1600.ps, frasmain.c;
123 AUTHORS: Mark Zenier; Joe Zbiciak
124 COMPILERS: GCC
125 */
126
127 /* 1600 instruction generation file, GI standard syntax */
128 /* September 25, 1999 */
129
130 /*
131 description frame work parser description for framework cross assemblers
132 history February 2, 1988
133 September 11, 1990 - merge table definition
134 September 12, 1990 - short file names
135 September 14, 1990 - short variable names
136 September 17, 1990 - use yylex as external
137 */
138
139 /* ======================================================================== *\
140
141 The CP-1610 supports the following basic opcode formats:
142
143 --------------------------------------- ------- --------------------------
144 Format Words Description
145 --------------------------------------- ------- --------------------------
146 0000 000 0oo 1 Implied 1-op insns
147 0000 000 100 bbppppppii pppppppppp 3 Jump insns
148 0000 000 1oo 1 Implied 1-op insns
149 0000 ooo ddd 1 1-op insns, comb src/dst
150 0000 110 0dd 1 GSWD
151 0000 110 1om 1 NOP(2), SIN(2)
152 0001 ooo mrr 1 Rotate/Shift insns
153 0ooo sss ddd 1 2-op arith, reg->reg
154 1000 zxc ccc pppppppppp 2 Branch insns
155 1ooo 000 ddd pppppppppp 2 2-op arith, direct, reg
156 1ooo mmm ddd 1* 2-op arith, ind., reg
157 1ooo 111 ddd iiiiiiiiii 2* 2-op arith, immed., reg
158 --------------------------------------- ------- --------------------------
159
160
161 -----
162 Key
163 -----
164
165 oo -- Opcode field (dependent on format)
166 sss -- Source register, R0 ... R7 (binary encoding)
167 ddd -- Destination register, R0 ... R7 (binary encoding)
168 0dd -- Destination register, R0 ... R3
169 cccc -- Condition codes (branches)
170 x -- External branch condition (0 == internal, 1 == examine BEXT)
171 z -- Branch displacement direction (1 == negative)
172 m -- Shift amount (0 == shift by 1, 1 == shift by 2)
173 bb -- Branch return register
174 ii -- Branch interrupt flag mode
175
176 --------------------------------
177 Branch Condition Codes (cccc)
178 --------------------------------
179 n == 0 n == 1
180 n000 -- Always Never
181 n001 -- Carry set/Greater than Carry clear/Less than or equal
182 n010 -- Overflow set Overflow clear
183 n011 -- Positive Negative
184 n100 -- Equal Not equal
185 n101 -- Less than Greater than or equal
186 n110 -- Less than or equal Greater than
187 n111 -- Unequal sign and carry Equal sign and carry
188
189
190 -------------------------------
191 Branch Return Registers (bb)
192 -------------------------------
193
194 00 -- R4
195 01 -- R5
196 10 -- R6
197 11 -- none (do not save return address)
198
199 -------------------------------
200 Branch Interrupt Modes (ii)
201 -------------------------------
202
203 00 -- Do not change interrupt enable state
204 01 -- Enable interrupts
205 10 -- Disable interrupts
206 11 -- Undefined/Reserved ?
207
208 ------------
209 SDBD notes
210 ------------
211
212 -- SDBD is supported on "immediate" and "indirect" modes only.
213
214 -- An SDBD prefix on an immediate instruction sets the immediate constant
215 to be 16 bits, stored in two adjacent 8-bit words. The ordering is
216 little-endian.
217
218 -- An SDBD prefix on an indirect instruction causes memory to be
219 accessed twice, bringing in (or out) two 8-bit words, again in
220 little-endian order. If a non-incrementing data counter is used,
221 both accesses are to the same address. Otherwise, the counter
222 is post-incremented with each access. Indirect through R6
223 (stack addressing) is not allowed, although I suspect it works
224 as expected (performing two accesses through R6).
225
226 ------------------------
227 General encoding notes
228 ------------------------
229
230 -- "Immediate" mode is encoded the same as "Indirect" mode, except that
231 R7 is given as the indirect register. I'm guessing R7 is implemented
232 the same as R4 and R5, especially since MVOI does what you'd
233 expect -- it (attempts to) write over its immediate operand!!!
234
235 -- The PC value (in R7) used for arithmetic always points to the first
236 byte after the instruction for purposes of arithmetic. This is
237 consistent with the observation that immediate mode is really
238 indirect mode in disguise, with the instruction being only one word
239 long initially.
240
241 -- Several instructions are just special cases of other instructions,
242 and therefore do not need special decoder treatment:
243
244 -- TSTR Rx --> MOVR Rx, Rx
245 -- JR Rx --> MOVR Rx, R7
246 -- CLRR Rx --> XORR Rx, Rx
247 -- B --> Branch with condition code 0000 ("Always")
248 -- NOPP --> Branch with condition code 1000 ("Never")
249 -- PSHR Rx --> MVO@ Rx, R6
250 -- PULR Rx --> MVI@ R6, Rx
251
252 -- "Direct" mode is encoded the same as "Indirect" mode, except 000
253 (which corresponds to R0) is encoded in the indirect register field.
254 This is why R0 cannot be used as a data counter, and why it has no
255 "special use."
256
257 -- Relative branches encode their sign bit in the opcode word, rather
258 than relying on a sign-extended relative offset in their second word.
259 This allows +/- 10-bit range in a 10-bit wide memory, or +/-
260 16-bit range in a 16-bit memory. To avoid redundant encoding, the
261 offset is calculated slightly differently for negative vs. positive
262 offset:
263
264 -- Negative: address_of_branch + 1 - offset
265 -- Positive: address_of_branch + 2 + offset
266
267 I'm guessing it is implemented about like so in hardware:
268
269 -- offset == pc + (offset ^ (sign ? -1 : 0))
270
271 ---------------
272 Opcode Spaces
273 ---------------
274
275 I've divided the CP-1610 opcode map into 12 different opcode
276 spaces. (I really should merge the two separate Implied 1-op
277 spaces into one space. Oh well...) In the descriptions below,
278 "n/i" means "not interruptible". Defined flags: Sign, Zero, Carry,
279 Overflow, Interrupt-enable, Double-byte-data. Interrupt-enable and
280 Double-byte-data are not user visible.
281
282 -- Implied 1-op instructions, part A: 0000 000 0oo
283 Each has a single, implied operand, if any.
284
285 opcode mnemonic n/i SZCOID description
286 -- 00 HLT Halts the CPU (until next interrupt?)
287 -- 01 SDBD * 1 Set Double Byte Data
288 -- 10 EIS * 1 Enable Interrupt System
289 -- 11 DIS * 1 Disable Interrupt System
290
291 -- Implied 1-op instructions, part B: 0000 000 1oo
292 Each has a single, implied operand, if any.
293
294 opcode mnemonic n/i SZCOID description
295 -- 00 n/a Aliases the "Jump" opcode space
296 -- 01 TCI * Terminate Current Interrupt.
297 -- 10 CLRC * Clear carry flag
298 -- 11 SETC * Set carry flag
299
300 -- Jump Instructions: 0000 000 100 bbppppppii pppppppppp
301 Unconditional jumps with optional return-address save and
302 interrupt enable/disable.
303
304 bb ii mnemonic n/i SZCOID description
305 -- 11 00 J Jump.
306 -- xx 00 JSR Jump. Save return address in R4..R6
307 -- 11 01 JE 1 Jump and enable ints.
308 -- xx 01 JSRE 1 Jump and enable ints. Save ret addr.
309 -- 11 10 JD 0 Jump and disable ints
310 -- xx 10 JSRD 0 Jump and disable ints. Save ret addr.
311 -- xx 11 n/a Invalid opcode.
312
313 -- Register 1-op instructions 0000 ooo rrr
314 Each has one register operand, encoded as 000 through 111.
315
316 opcode mnemonic n/i SZCOID description
317 -- 000 n/a Aliases "Implied", "Jump" opcode space
318 -- 001 INCR XX INCrement register
319 -- 010 DECR XX DECrement register
320 -- 011 COMR XX COMplement register (1s complement)
321 -- 100 NEGR XXXX NEGate register (2s complement)
322 -- 101 ADCR XXXX ADd Carry to Register
323 -- 110 n/a Aliases "GSWD", "NOP/SIN" opcode space
324 -- 111 RSWD XXXX Restore Status Word from Register
325
326
327 -- Get Status WorD 0000 110 0rr
328 This was given its own opcode space due to limited encoding on its
329 destination register and complication with the NOP/SIN encodings.
330
331 -- NOP/SIN 0000 110 1om
332 I don't know what the "m" bit is for. I don't know what to do with SIN.
333
334 opcode mnemonic n/i SZCOID description
335 -- 0 NOP No operation
336 -- 1 SIN Software Interrupt (pulse PCIT pin) ?
337
338 -- Shift/Rotate 1-op instructions 0001 ooo mrr
339 These can operate only on R0...R3. The "m" bit specifies whether the
340 operation is performed once or twice. The overflow bit is used for
341 catching the second bit on the rotates/shifts that use the carry.
342
343 opcode mnemonic n/i SZCOID description
344 -- 000 SWAP * XX Swaps bytes in word once or twice.
345 -- 001 SLL * XX Shift Logical Left
346 -- 010 RLC * XXX2 Rotate Left through Carry/overflow
347 -- 011 SLLC * XXX2 Shift Logical Left thru Carry/overflow
348 -- 100 SLR * XX Shift Logical Right
349 -- 101 SAR * XX Shift Arithmetic Right
350 -- 110 RRC * XXX2 Rotate Left through Carry/overflow
351 -- 111 SARC * XXX2 Shift Arithmetic Right thru Carry/over
352
353 -- Register/Register 2-op instructions 0ooo sss ddd
354 Register to register arithmetic. Second operand acts as src2 and dest.
355
356 opcode mnemonic n/i SZCOID description
357 -- 00x n/a Aliases other opcode spaces
358 -- 010 MOVR XX Move register to register
359 -- 011 ADDR XXXX Add src1 to src2->dst
360 -- 100 SUBR XXXX Sub src1 from src2->dst
361 -- 101 CMPR XXXX Sub src1 from src2, don't store
362 -- 110 ANDR XX AND src1 with src2->dst
363 -- 111 XORR XX XOR src1 with src2->dst
364
365 -- Conditional Branch instructions 1000 zxn ccc pppppppppppppppp
366 The "z" bit specifies the direction for the offset. The "x" bit
367 specifies using an external branch condition instead of using flag
368 bits. Conditional brances are interruptible. The "n" bit specifies
369 branching on the opposite condition from 'ccc'.
370
371 cond n=0 Condition n=1 Condition
372 -- n000 B always NOPP never
373 -- n001 BC C = 1 BNC C = 0
374 -- n010 BOV O = 1 BNOV O = 0
375 -- n011 BPL S = 0 BMI S = 1
376 -- n100 BZE/BEQ Z = 1 BNZE/BNEQ Z = 0
377 -- n101 BLT/BNGE S^O = 1 BGE/BNLT S^O = 0
378 -- n110 BLE/BNGT Z|(S^O) = 1 BGT/BNLE Z|(S^O) = 0
379 -- n111 BUSC S^C = 1 BESC S^C = 0
380
381 -- Direct/Register 2-op instructions 1ooo 000 rrr pppppppppppppppp
382 Direct memory to register arithmetic. MVO uses direct address as
383 a destination, all other operations use it as a source, with
384 the register as the destination.
385
386 opcode mnemonic n/i SZCOID description
387 -- 000 n/a Aliases conditional branch opcodes
388 -- 001 MVO * Move register to direct address
389 -- 010 MVI Move direct address to register
390 -- 011 ADD XXXX Add src1 to src2->dst
391 -- 100 SUB XXXX Sub src1 from src2->dst
392 -- 101 CMP XXXX Sub src1 from src2, don't store
393 -- 110 AND XX AND src1 with src2->dst
394 -- 111 XOR XX XOR src1 with src2->dst
395
396
397 -- Indirect/Register 2-op instructions 1ooo sss ddd
398 A source of "000" is actually a Direct/Register opcode.
399 A source of "111" is actually a Immediate/Register opcode.
400 R4, R5 increment after each access. If the D bit is set, two
401 accesses are made through the indirect register, updating the
402 address if R4 or R5. R6 increments after writes, decrements
403 before reads.
404
405 opcode mnemonic n/i SZCOID description
406 -- 000 n/a Aliases conditional branch opcodes
407 -- 001 MVO@ * Move register to indirect address
408 -- 010 MVI@ Move indirect address to register
409 -- 011 ADD@ XXXX Add src1 to src2->dst
410 -- 100 SUB@ XXXX Sub src1 from src2->dst
411 -- 101 CMP@ XXXX Sub src1 from src2, don't store
412 -- 110 AND@ XX AND src1 with src2->dst
413 -- 111 XOR@ XX XOR src1 with src2->dst
414
415 -- Immediate/Register 2-op instructions 1ooo 111 ddd pppp
416 If DBD is set, the immediate value spans two adjacent bytes, little
417 endian order. Otherwise the immediate value spans one word. This
418 instruction really looks like indirect through R7, and I suspect
419 that's how the silicon implements it.
420
421 opcode mnemonic n/i SZCOID description
422 -- 000 n/a Aliases conditional branch opcodes
423 -- 001 MVOI * Move register to immediate field!
424 -- 010 MVII Move immediate field to register
425 -- 011 ADDI XXXX Add src1 to src2->dst
426 -- 100 SUBI XXXX Sub src1 from src2->dst
427 -- 101 CMPI XXXX Sub src1 from src2, don't store
428 -- 110 ANDI XX AND src1 with src2->dst
429 -- 111 XORI XX XOR src1 with src2->dst
430
431 \* ======================================================================== */
432
433 #include <stdio.h>
434 #include <string.h>
435 #include "config.h"
436 #include "as1600_types.h"
437 #include "intermed.h"
438 #include "lzoe/lzoe.h"
439 #include "file/file.h"
440 #include "asm/frasmdat.h"
441 #include "asm/fragcon.h"
442 #include "asm/intvec.h"
443 #include "asm/protos.h"
444 #include "asm/as1600.tab.h"
445 #include "asm/memo_string.h"
446
447 #define yylex lexintercept
448
449 #define JSR_RG 0x0001
450 #define SHF_RG 0x0002
451 #define IND_RG 0x0004
452 #define SDBD 0x0008
453
454 #define ST_REGREG 0x0001
455 #define ST_REGEXP 0x0002
456 #define ST_EXPREG 0x0004
457 #define ST_REGCEX 0x0008
458 #define ST_CEXREG 0x0010
459 #define ST_REG 0x0020
460 #define ST_EXP 0x0040
461 #define ST_IMP 0x0080
462 #define ST_EXPEXP 0x0100
463
464 /* ======================================================================== */
465 /* R0 .. R7 can be used as general-purpose registers. */
466 /* R0 .. R3 can be used for shifts and GSWD. */
467 /* R1 .. R6 can be used for indirect addressing. */
468 /* R4 .. R6 can be used for JSR. */
469 /* ======================================================================== */
470 static int reg_type[8] =
471 {
472 SHF_RG,
473 SHF_RG | IND_RG,
474 SHF_RG | IND_RG,
475 SHF_RG | IND_RG,
476 JSR_RG | IND_RG,
477 JSR_RG | IND_RG,
478 JSR_RG | IND_RG,
479 0
480 };
481
482 /* ======================================================================== */
483 /* BDEF outputs a number as a ROMW width word directly. Allowed width is */
484 /* determined by argument #2 to the expression. */
485 /* WDEF outputs a 16-bit word as a Double Byte Data. */
486 /* ======================================================================== */
487 static char genbdef[] = "[1=].[2#]I$[1=]x";
488 static char genwdef[] = "[1=].10I$[1=].FF&x[1=].8}.FF&x";
489
490 /*static char gensdbd[] = "0001x";*/
491
492 char ignosyn[] = "[Xinvalid syntax for instruction";
493 char ignosel[] = "[Xinvalid operands";
494
495 /* ======================================================================== */
496 /* Truth table: */
497 /* */
498 /* ifskip rptskip expmac | Expand macros Parse line */
499 /* FALSE FALSE any | TRUE TRUE */
500 /* TRUE any FALSE | FALSE FALSE */
501 /* TRUE any TRUE | TRUE FALSE */
502 /* any TRUE FALSE | FALSE FALSE */
503 /* any TRUE TRUE | TRUE FALSE */
504 /* */
505 /* Only IF/ENDI modify expmac. RPT 0 does not modify expmac, and the */
506 /* default state of expmac is TRUE. Therefore, by default, macros will */
507 /* get expanded in RPT 0 / ENDR blocks. If you need RPT 0 to terminate */
508 /* macro recursion, include an IF / ENDI around it. Sorry. */
509 /* ======================================================================== */
510 int fraifskip = FALSE, frarptskip = FALSE, fraexpmac = TRUE;
511
512 int labelloc;
513 static int satsub;
514 int ifstkpt = 0;
515 int frarptact = 0, frarptcnt = -1;
516 int struct_locctr = -1;
517
518 #define MAX_PROC_STK (64)
519
520 static char *proc_stk[MAX_PROC_STK];
521 static int proc_stk_depth = 0;
522
523 extern char *proc;
524 extern int proc_len;
525 static const char *currmode = "";
526
527
528 static int sdbd = 0, is_sdbd = 0;
529 static int romw = 16;
530 static unsigned romm = 0xFFFF;
531 static int first = 1;
532
533 static int fwd_sdbd = 0;
534
535 struct symel * endsymbol = SYMNULL;
536
537
538 #define SDBD_CHK \
539 if (sdbd) { sdbd = 0; frawarn("SDBD not allowed with this instruction."); }
540
do_set_equ_(int isequ,int flags,struct symel * sym,int value,const char * equerr)541 LOCAL void do_set_equ_(int isequ, int flags,
542 struct symel *sym, int value,
543 const char *equerr)
544 {
545 if (sym->seg == SSG_UNDEF
546 || (sym->seg == SSG_SET && isequ == FALSE))
547 {
548 sym->seg = isequ ? SSG_EQU : SSG_SET;
549 sym->value = value;
550 sym->flags |= flags;
551 emit_set_equ(value);
552 } else
553 {
554 fraerror(equerr);
555 }
556 }
557
do_set_equ_list(int isslice,int isequ,int flags,struct symel * const RESTRICT sym,const intvec_t * const RESTRICT exprs,int firstidx,int lastidx,const char * const RESTRICT ncerr,const char * const RESTRICT equerr)558 LOCAL void do_set_equ_list(int isslice,
559 int isequ,
560 int flags,
561 struct symel *const RESTRICT sym,
562 const intvec_t *const RESTRICT exprs,
563 int firstidx,
564 int lastidx,
565 const char *const RESTRICT ncerr,
566 const char *const RESTRICT equerr)
567 {
568 static long *exprvals = NULL;
569 static int exprvals_size = 0;
570 struct symel *newsym;
571 int i, idx, stp;
572
573 if (exprvals_size < exprs->len)
574 {
575 exprvals = REALLOC(exprvals, long, exprs->alloc);
576 exprvals_size = exprs->alloc;
577 }
578
579 for (i = 0; i < exprs->len; i++)
580 {
581 pevalexpr(0, exprs->data[i]);
582
583 exprvals[i] = evalr[0].value;
584
585 if (evalr[0].seg != SSG_ABS)
586 fraerror(ncerr);
587 }
588
589 if (exprs->len == 1 && !isslice)
590 {
591 do_set_equ_(isequ, flags, sym, exprvals[0], equerr);
592 }
593 else if (abs(lastidx - firstidx) + 1 != exprs->len)
594 {
595 fraerror("Array slice length doesn't match expression list length");
596 }
597 else if (sym->seg == SSG_UNDEF || sym->seg == SSG_SET)
598 {
599 if (sym->value < firstidx)
600 sym->value = firstidx;
601
602 if (sym->value < lastidx)
603 sym->value = lastidx;
604
605 stp = firstidx > lastidx ? -1 : 1;
606 sym->seg = SSG_SET;
607 sym->flags |= SFLAG_QUIET;
608
609 for (i = 0, idx = firstidx; i < exprs->len; i++, idx += stp)
610 {
611 newsym = symbentryidx(sym->symstr, LABEL, 1, idx);
612 newsym->flags |= SFLAG_QUIET | SFLAG_ARRAY;
613
614 do_set_equ_(isequ, flags, newsym, exprvals[i], equerr);
615 }
616 } else
617 {
618 fraerror("Cannot convert symbol to array");
619 }
620 }
621
622 typedef enum { USRERR, USRWARN, USRSTAT, USRCMT } usrmsg;
623
usr_message(usrmsg type,const char * msg)624 LOCAL void usr_message(usrmsg type, const char *msg)
625 {
626 char *copy = strdup((msg && *msg) ? msg : " "), *s, *ss;
627
628 /* force all characters to be printing characters */
629 for (s = copy; *s; s++)
630 if (!(isprint(*s) || isspace(*s)))
631 *s = '?';
632
633 /* Print all the lines of the message, breaking at newlines */
634 for (s = copy; s && *s; s = ss)
635 {
636 ss = strpbrk(s, "\n\r");
637
638 if (ss)
639 *ss++ = 0;
640
641 switch (type)
642 {
643 case USRERR: fraerror(s); break;
644 case USRWARN: frawarn (s); break;
645 case USRSTAT: puts(s); FALLTHROUGH_INTENDED;
646 case USRCMT: emit_comment(1, "%s", s); break;
647 default: fraerror("internal error in usr_message");
648 }
649 }
650
651 free(copy);
652 }
653
chardef(char * sourcestr,const intvec_t * const RESTRICT defs)654 LOCAL void chardef(char *sourcestr,
655 const intvec_t *const RESTRICT defs)
656 {
657 int findrv, numret, *charaddr;
658 char *before;
659
660 if(chtnpoint != (int *)NULL)
661 {
662 for(satsub = 0; satsub < defs->len; satsub++)
663 {
664 before = sourcestr;
665
666 pevalexpr(0, defs->data[satsub]);
667 findrv = chtcfind(chtnpoint, &sourcestr, &charaddr, &numret);
668
669 if(findrv == CF_END)
670 {
671 fraerror("more expressions than characters");
672 break;
673 }
674
675 if(evalr[0].seg == SSG_ABS)
676 {
677 switch(findrv)
678 {
679 case CF_UNDEF:
680 {
681 if(evalr[0].value < 0 || evalr[0].value > 255)
682 frawarn("character translation value truncated");
683
684 *charaddr = evalr[0].value & 0xff;
685 emit_set_equ(evalr[0].value);
686 }
687 break;
688
689 case CF_INVALID:
690 case CF_NUMBER:
691 fracherror("invalid character to define",
692 before, sourcestr);
693 break;
694
695 case CF_CHAR:
696 fracherror("character already defined",
697 before, sourcestr);
698 break;
699 }
700 }
701 else
702 fraerror("noncomputable expression");
703 }
704
705 if( *sourcestr != '\0')
706 fraerror("more characters than expressions");
707 }
708 else
709 fraerror("no CHARSET statement active");
710 }
711
chkover(int value,int bias)712 LOCAL int chkover(int value, int bias)
713 {
714 if (value > 0xFFFF + bias || value < 0)
715 fraerror("Address overflow");
716
717 return value;
718 }
719
720 #define MAXTEMPSTR (65536)
721 static char tempstr[MAXTEMPSTR];
722 static int tempstrlen = 0;
723
724
725
726 #line 727 "asm/as1600.tab.c" /* yacc.c:339 */
727
728 # ifndef YY_NULLPTR
729 # if defined __cplusplus && 201103L <= __cplusplus
730 # define YY_NULLPTR nullptr
731 # else
732 # define YY_NULLPTR 0
733 # endif
734 # endif
735
736 /* Enabling verbose error messages. */
737 #ifdef YYERROR_VERBOSE
738 # undef YYERROR_VERBOSE
739 # define YYERROR_VERBOSE 1
740 #else
741 # define YYERROR_VERBOSE 0
742 #endif
743
744 /* In a future release of Bison, this section will be replaced
745 by #include "as1600.tab.h". */
746 #ifndef YY_YY_ASM_AS1600_TAB_H_INCLUDED
747 # define YY_YY_ASM_AS1600_TAB_H_INCLUDED
748 /* Debug traces. */
749 #ifndef YYDEBUG
750 # define YYDEBUG 0
751 #endif
752 #if YYDEBUG
753 extern int yydebug;
754 #endif
755
756 /* Token type. */
757 #ifndef YYTOKENTYPE
758 # define YYTOKENTYPE
759 enum yytokentype
760 {
761 CP1600_REG = 258,
762 KOC_BDEF = 259,
763 KOC_ELSE = 260,
764 KOC_END = 261,
765 KOC_ENDI = 262,
766 KOC_EQU = 263,
767 KOC_IF = 264,
768 KOC_INCLUDE = 265,
769 KOC_ORG = 266,
770 KOC_RESM = 267,
771 KOC_SDEF = 268,
772 KOC_SET = 269,
773 KOC_WDEF = 270,
774 KOC_CHSET = 271,
775 KOC_CHDEF = 272,
776 KOC_CHUSE = 273,
777 KOC_opcode = 274,
778 KOC_opcode_i = 275,
779 KOC_relbr = 276,
780 KOC_relbr_x = 277,
781 KOC_SDBD = 278,
782 KOC_ROMW = 279,
783 KOC_PROC = 280,
784 KOC_ENDP = 281,
785 KOC_STRUCT = 282,
786 KOC_ENDS = 283,
787 KOC_MEMATTR = 284,
788 KOC_DDEF = 285,
789 KOC_RPT = 286,
790 KOC_ENDR = 287,
791 KOC_USRERR = 288,
792 KOC_LIST = 289,
793 KOC_QEQU = 290,
794 KOC_QSET = 291,
795 KOC_MACERR = 292,
796 KOC_BRKIF = 293,
797 KOC_CMSG = 294,
798 KOC_SMSG = 295,
799 KOC_WMSG = 296,
800 KOC_CFGVAR = 297,
801 KOC_SRCFILE = 298,
802 KOC_LISTCOL = 299,
803 KOC_ERR_IF_OVERWRITTEN = 300,
804 KOC_FORCE_OVERWRITE = 301,
805 CONSTANT = 302,
806 EOL = 303,
807 KEOP_AND = 304,
808 KEOP_DEFINED = 305,
809 KEOP_EQ = 306,
810 KEOP_GE = 307,
811 KEOP_GT = 308,
812 KEOP_HIGH = 309,
813 KEOP_LE = 310,
814 KEOP_LOW = 311,
815 KEOP_LT = 312,
816 KEOP_MOD = 313,
817 KEOP_MUN = 314,
818 KEOP_NE = 315,
819 KEOP_NOT = 316,
820 KEOP_OR = 317,
821 KEOP_SHL = 318,
822 KEOP_SHR = 319,
823 KEOP_SHRU = 320,
824 KEOP_ROTL = 321,
825 KEOP_ROTR = 322,
826 KEOP_XOR = 323,
827 KEOP_locctr = 324,
828 KEOP_TODAY_STR = 325,
829 KEOP_TODAY_VAL = 326,
830 KEOP_STRLEN = 327,
831 KEOP_ASC = 328,
832 KEOP_CLASSIFY = 329,
833 LABEL = 330,
834 STRING = 331,
835 QCHAR = 332,
836 SYMBOL = 333,
837 FEATURE = 334,
838 KEOP_EXPMAC = 335,
839 KTK_invalid = 336,
840 EXPRLIST = 337
841 };
842 #endif
843
844 /* Value type. */
845 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
846
847 union YYSTYPE
848 {
849 #line 661 "asm/as1600_real.y" /* yacc.c:355 */
850
851 int intv;
852 int longv;
853 char *strng;
854 struct symel *symb;
855 struct slidx slidx;
856 intvec_t *intvec;
857
858 #line 859 "asm/as1600.tab.c" /* yacc.c:355 */
859 };
860
861 typedef union YYSTYPE YYSTYPE;
862 # define YYSTYPE_IS_TRIVIAL 1
863 # define YYSTYPE_IS_DECLARED 1
864 #endif
865
866
867 extern YYSTYPE yylval;
868
869 int yyparse (void);
870
871 #endif /* !YY_YY_ASM_AS1600_TAB_H_INCLUDED */
872
873 /* Copy the second part of user declarations. */
874
875 #line 876 "asm/as1600.tab.c" /* yacc.c:358 */
876
877 #ifdef short
878 # undef short
879 #endif
880
881 #ifdef YYTYPE_UINT8
882 typedef YYTYPE_UINT8 yytype_uint8;
883 #else
884 typedef unsigned char yytype_uint8;
885 #endif
886
887 #ifdef YYTYPE_INT8
888 typedef YYTYPE_INT8 yytype_int8;
889 #else
890 typedef signed char yytype_int8;
891 #endif
892
893 #ifdef YYTYPE_UINT16
894 typedef YYTYPE_UINT16 yytype_uint16;
895 #else
896 typedef unsigned short int yytype_uint16;
897 #endif
898
899 #ifdef YYTYPE_INT16
900 typedef YYTYPE_INT16 yytype_int16;
901 #else
902 typedef short int yytype_int16;
903 #endif
904
905 #ifndef YYSIZE_T
906 # ifdef __SIZE_TYPE__
907 # define YYSIZE_T __SIZE_TYPE__
908 # elif defined size_t
909 # define YYSIZE_T size_t
910 # elif ! defined YYSIZE_T
911 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
912 # define YYSIZE_T size_t
913 # else
914 # define YYSIZE_T unsigned int
915 # endif
916 #endif
917
918 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
919
920 #ifndef YY_
921 # if defined YYENABLE_NLS && YYENABLE_NLS
922 # if ENABLE_NLS
923 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
924 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
925 # endif
926 # endif
927 # ifndef YY_
928 # define YY_(Msgid) Msgid
929 # endif
930 #endif
931
932 #ifndef YY_ATTRIBUTE
933 # if (defined __GNUC__ \
934 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
935 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
936 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
937 # else
938 # define YY_ATTRIBUTE(Spec) /* empty */
939 # endif
940 #endif
941
942 #ifndef YY_ATTRIBUTE_PURE
943 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
944 #endif
945
946 #ifndef YY_ATTRIBUTE_UNUSED
947 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
948 #endif
949
950 #if !defined _Noreturn \
951 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
952 # if defined _MSC_VER && 1200 <= _MSC_VER
953 # define _Noreturn __declspec (noreturn)
954 # else
955 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
956 # endif
957 #endif
958
959 /* Suppress unused-variable warnings by "using" E. */
960 #if ! defined lint || defined __GNUC__
961 # define YYUSE(E) ((void) (E))
962 #else
963 # define YYUSE(E) /* empty */
964 #endif
965
966 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
967 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
968 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
969 _Pragma ("GCC diagnostic push") \
970 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
971 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
972 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
973 _Pragma ("GCC diagnostic pop")
974 #else
975 # define YY_INITIAL_VALUE(Value) Value
976 #endif
977 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
978 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
979 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
980 #endif
981 #ifndef YY_INITIAL_VALUE
982 # define YY_INITIAL_VALUE(Value) /* Nothing. */
983 #endif
984
985
986 #if ! defined yyoverflow || YYERROR_VERBOSE
987
988 /* The parser invokes alloca or malloc; define the necessary symbols. */
989
990 # ifdef YYSTACK_USE_ALLOCA
991 # if YYSTACK_USE_ALLOCA
992 # ifdef __GNUC__
993 # define YYSTACK_ALLOC __builtin_alloca
994 # elif defined __BUILTIN_VA_ARG_INCR
995 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
996 # elif defined _AIX
997 # define YYSTACK_ALLOC __alloca
998 # elif defined _MSC_VER
999 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
1000 # define alloca _alloca
1001 # else
1002 # define YYSTACK_ALLOC alloca
1003 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
1004 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1005 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
1006 # ifndef EXIT_SUCCESS
1007 # define EXIT_SUCCESS 0
1008 # endif
1009 # endif
1010 # endif
1011 # endif
1012 # endif
1013
1014 # ifdef YYSTACK_ALLOC
1015 /* Pacify GCC's 'empty if-body' warning. */
1016 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
1017 # ifndef YYSTACK_ALLOC_MAXIMUM
1018 /* The OS might guarantee only one guard page at the bottom of the stack,
1019 and a page size can be as small as 4096 bytes. So we cannot safely
1020 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
1021 to allow for a few compiler-allocated temporary stack slots. */
1022 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
1023 # endif
1024 # else
1025 # define YYSTACK_ALLOC YYMALLOC
1026 # define YYSTACK_FREE YYFREE
1027 # ifndef YYSTACK_ALLOC_MAXIMUM
1028 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
1029 # endif
1030 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
1031 && ! ((defined YYMALLOC || defined malloc) \
1032 && (defined YYFREE || defined free)))
1033 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1034 # ifndef EXIT_SUCCESS
1035 # define EXIT_SUCCESS 0
1036 # endif
1037 # endif
1038 # ifndef YYMALLOC
1039 # define YYMALLOC malloc
1040 # if ! defined malloc && ! defined EXIT_SUCCESS
1041 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1042 # endif
1043 # endif
1044 # ifndef YYFREE
1045 # define YYFREE free
1046 # if ! defined free && ! defined EXIT_SUCCESS
1047 void free (void *); /* INFRINGES ON USER NAME SPACE */
1048 # endif
1049 # endif
1050 # endif
1051 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
1052
1053
1054 #if (! defined yyoverflow \
1055 && (! defined __cplusplus \
1056 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
1057
1058 /* A type that is properly aligned for any stack member. */
1059 union yyalloc
1060 {
1061 yytype_int16 yyss_alloc;
1062 YYSTYPE yyvs_alloc;
1063 };
1064
1065 /* The size of the maximum gap between one aligned stack and the next. */
1066 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1067
1068 /* The size of an array large to enough to hold all stacks, each with
1069 N elements. */
1070 # define YYSTACK_BYTES(N) \
1071 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
1072 + YYSTACK_GAP_MAXIMUM)
1073
1074 # define YYCOPY_NEEDED 1
1075
1076 /* Relocate STACK from its old location to the new one. The
1077 local variables YYSIZE and YYSTACKSIZE give the old and new number of
1078 elements in the stack, and YYPTR gives the new location of the
1079 stack. Advance YYPTR to a properly aligned location for the next
1080 stack. */
1081 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
1082 do \
1083 { \
1084 YYSIZE_T yynewbytes; \
1085 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
1086 Stack = &yyptr->Stack_alloc; \
1087 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
1088 yyptr += yynewbytes / sizeof (*yyptr); \
1089 } \
1090 while (0)
1091
1092 #endif
1093
1094 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
1095 /* Copy COUNT objects from SRC to DST. The source and destination do
1096 not overlap. */
1097 # ifndef YYCOPY
1098 # if defined __GNUC__ && 1 < __GNUC__
1099 # define YYCOPY(Dst, Src, Count) \
1100 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
1101 # else
1102 # define YYCOPY(Dst, Src, Count) \
1103 do \
1104 { \
1105 YYSIZE_T yyi; \
1106 for (yyi = 0; yyi < (Count); yyi++) \
1107 (Dst)[yyi] = (Src)[yyi]; \
1108 } \
1109 while (0)
1110 # endif
1111 # endif
1112 #endif /* !YYCOPY_NEEDED */
1113
1114 /* YYFINAL -- State number of the termination state. */
1115 #define YYFINAL 108
1116 /* YYLAST -- Last index in YYTABLE. */
1117 #define YYLAST 2206
1118
1119 /* YYNTOKENS -- Number of terminals. */
1120 #define YYNTOKENS 96
1121 /* YYNNTS -- Number of nonterminals. */
1122 #define YYNNTS 17
1123 /* YYNRULES -- Number of rules. */
1124 #define YYNRULES 176
1125 /* YYNSTATES -- Number of states. */
1126 #define YYNSTATES 353
1127
1128 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
1129 by yylex, with out-of-bounds checking. */
1130 #define YYUNDEFTOK 2
1131 #define YYMAXUTOK 337
1132
1133 #define YYTRANSLATE(YYX) \
1134 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1135
1136 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
1137 as returned by yylex, without out-of-bounds checking. */
1138 static const yytype_uint8 yytranslate[] =
1139 {
1140 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1141 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1142 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1143 2, 2, 2, 2, 2, 92, 91, 93, 2, 2,
1144 90, 87, 85, 83, 88, 84, 2, 86, 2, 2,
1145 2, 2, 2, 2, 2, 2, 2, 2, 89, 2,
1146 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1147 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1148 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1149 2, 94, 2, 95, 2, 2, 2, 2, 2, 2,
1150 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1151 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1152 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1153 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1154 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1155 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1156 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1157 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1158 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1159 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1160 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1161 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1162 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1163 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1164 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1165 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1166 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1167 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1168 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1169 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1170 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1171 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1172 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
1173 75, 76, 77, 78, 79, 80, 81, 82
1174 };
1175
1176 #if YYDEBUG
1177 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
1178 static const yytype_uint16 yyrline[] =
1179 {
1180 0, 776, 776, 777, 780, 785, 786, 794, 799, 803,
1181 807, 811, 815, 819, 823, 866, 873, 881, 889, 897,
1182 905, 913, 921, 929, 948, 959, 974, 986, 1006, 1040,
1183 1063, 1081, 1101, 1125, 1142, 1167, 1185, 1213, 1232, 1257,
1184 1274, 1299, 1316, 1335, 1341, 1354, 1374, 1410, 1421, 1432,
1185 1448, 1453, 1478, 1483, 1489, 1501, 1504, 1505, 1508, 1529,
1186 1540, 1553, 1567, 1580, 1592, 1610, 1611, 1614, 1615, 1618,
1187 1623, 1636, 1642, 1656, 1661, 1667, 1673, 1674, 1707, 1730,
1188 1757, 1788, 1803, 1837, 1858, 1885, 1902, 1927, 1964, 1979,
1189 1996, 2022, 2034, 2048, 2064, 2080, 2096, 2132, 2145, 2159,
1190 2173, 2177, 2181, 2185, 2189, 2193, 2197, 2201, 2205, 2209,
1191 2213, 2217, 2221, 2225, 2230, 2236, 2240, 2244, 2248, 2252,
1192 2256, 2260, 2264, 2268, 2272, 2276, 2280, 2284, 2288, 2292,
1193 2296, 2302, 2306, 2310, 2315, 2319, 2324, 2328, 2332, 2346,
1194 2350, 2375, 2391, 2392, 2414, 2415, 2435, 2436, 2457, 2485,
1195 2525, 2530, 2538, 2553, 2557, 2564, 2565, 2566, 2567, 2568,
1196 2569, 2570, 2571, 2572, 2573, 2574, 2575, 2576, 2577, 2578,
1197 2579, 2580, 2581, 2582, 2583, 2584, 2585
1198 };
1199 #endif
1200
1201 #if YYDEBUG || YYERROR_VERBOSE || 0
1202 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1203 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1204 static const char *const yytname[] =
1205 {
1206 "$end", "error", "$undefined", "CP1600_REG", "KOC_BDEF", "KOC_ELSE",
1207 "KOC_END", "KOC_ENDI", "KOC_EQU", "KOC_IF", "KOC_INCLUDE", "KOC_ORG",
1208 "KOC_RESM", "KOC_SDEF", "KOC_SET", "KOC_WDEF", "KOC_CHSET", "KOC_CHDEF",
1209 "KOC_CHUSE", "KOC_opcode", "KOC_opcode_i", "KOC_relbr", "KOC_relbr_x",
1210 "KOC_SDBD", "KOC_ROMW", "KOC_PROC", "KOC_ENDP", "KOC_STRUCT", "KOC_ENDS",
1211 "KOC_MEMATTR", "KOC_DDEF", "KOC_RPT", "KOC_ENDR", "KOC_USRERR",
1212 "KOC_LIST", "KOC_QEQU", "KOC_QSET", "KOC_MACERR", "KOC_BRKIF",
1213 "KOC_CMSG", "KOC_SMSG", "KOC_WMSG", "KOC_CFGVAR", "KOC_SRCFILE",
1214 "KOC_LISTCOL", "KOC_ERR_IF_OVERWRITTEN", "KOC_FORCE_OVERWRITE",
1215 "CONSTANT", "EOL", "KEOP_AND", "KEOP_DEFINED", "KEOP_EQ", "KEOP_GE",
1216 "KEOP_GT", "KEOP_HIGH", "KEOP_LE", "KEOP_LOW", "KEOP_LT", "KEOP_MOD",
1217 "KEOP_MUN", "KEOP_NE", "KEOP_NOT", "KEOP_OR", "KEOP_SHL", "KEOP_SHR",
1218 "KEOP_SHRU", "KEOP_ROTL", "KEOP_ROTR", "KEOP_XOR", "KEOP_locctr",
1219 "KEOP_TODAY_STR", "KEOP_TODAY_VAL", "KEOP_STRLEN", "KEOP_ASC",
1220 "KEOP_CLASSIFY", "LABEL", "STRING", "QCHAR", "SYMBOL", "FEATURE",
1221 "KEOP_EXPMAC", "KTK_invalid", "EXPRLIST", "'+'", "'-'", "'*'", "'/'",
1222 "')'", "','", "':'", "'('", "'$'", "'#'", "'%'", "'['", "']'", "$accept",
1223 "file", "allline", "line", "maybe_expmac", "labeledline", "genline",
1224 "labelcolon", "labelslicecolon", "exprlist", "string", "expr", "label",
1225 "symbol", "symslice", "labelslice", "keyword", YY_NULLPTR
1226 };
1227 #endif
1228
1229 # ifdef YYPRINT
1230 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
1231 (internal) symbol number NUM (which must be that of a token). */
1232 static const yytype_uint16 yytoknum[] =
1233 {
1234 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1235 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1236 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1237 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1238 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1239 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1240 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1241 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1242 335, 336, 337, 43, 45, 42, 47, 41, 44, 58,
1243 40, 36, 35, 37, 91, 93
1244 };
1245 # endif
1246
1247 #define YYPACT_NINF -88
1248
1249 #define yypact_value_is_default(Yystate) \
1250 (!!((Yystate) == (-88)))
1251
1252 #define YYTABLE_NINF -1
1253
1254 #define yytable_value_is_error(Yytable_value) \
1255 (!!((Yytable_value) == (-1)))
1256
1257 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1258 STATE-NUM. */
1259 static const yytype_int16 yypact[] =
1260 {
1261 507, -44, 1042, -88, -88, -88, -67, -57, 1156, 1156,
1262 1042, 1042, -53, 1156, 23, 19, 1156, 1156, -88, 1156,
1263 -88, -88, 1156, 1042, 1156, -88, -16, -25, -88, 1156,
1264 -16, -16, -16, -16, -16, 1156, 1156, 1156, -88, -88,
1265 459, -88, 7, -88, -88, 550, 4, -87, -74, -88,
1266 -88, -43, 1156, 1156, 1156, -23, -21, -19, -14, -12,
1267 -88, -88, -88, -88, 1156, 1156, 1042, 26, -5, -88,
1268 2010, -31, -20, -88, 1156, -88, 1042, -88, 1199, -9,
1269 2010, -5, -5, 1, 26, 15, 2010, 16, 1156, 1281,
1270 20, 2010, 1319, 1357, 1395, -5, 2010, -88, -88, 2010,
1271 -88, -88, -88, 14, 22, 1433, 2010, 2010, -88, -88,
1272 -88, -88, 1042, 1156, 1042, -88, -88, 1156, 35, 1042,
1273 1042, -88, 34, -52, 1042, 1042, 1042, 1042, -88, 1156,
1274 -88, 1156, -88, -9, 2010, 2010, 2084, -16, -16, -29,
1275 -27, 371, -88, -88, -6, 1737, 1042, 32, 36, 37,
1276 1080, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156,
1277 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156, 1156,
1278 1156, 1156, 2010, 0, 1156, 1156, 1156, 1042, 1042, 299,
1279 1471, 109, 121, 1156, 1156, 1156, 1118, 1156, 1156, -5,
1280 1240, -5, 2010, -88, -5, -5, 1156, -5, -5, -5,
1281 -5, 538, 579, 38, 43, 44, 45, 46, 47, 49,
1282 -88, -43, -88, -88, -88, 1156, -88, 1156, -88, -88,
1283 -88, -88, 1156, -88, -88, -88, -88, -88, -88, -19,
1284 -14, -12, 50, -88, 51, 1776, -84, 52, 70, -88,
1285 11, 1156, 1156, 1156, -88, 2010, -20, 2084, 2120, 2120,
1286 2120, 2120, 2120, -88, 2120, 2048, -88, -88, -88, -88,
1287 -88, 2048, -33, -33, -88, -88, 620, 661, 71, 1509,
1288 1547, 743, -5, -5, -88, 1156, 2010, 137, -88, -88,
1289 2010, 2010, 1585, -88, 2010, 2010, 1623, 1156, 1156, 782,
1290 1156, -88, 1156, -88, -88, -88, -88, -88, 1156, 1156,
1291 -88, -88, -88, -88, -88, -88, 1156, -88, 1815, 1854,
1292 1893, 1156, -88, 1156, -88, 1156, 94, 96, 2010, -88,
1293 97, 1156, 1661, 1699, 821, 860, 1932, 1971, 702, -88,
1294 -88, -88, 899, 938, 977, -88, -88, -88, 2010, 98,
1295 105, -88, -88, -88, -88, 1156, -88, -88, -88, -88,
1296 -88, 1016, -88
1297 };
1298
1299 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
1300 Performed when YYTABLE does not specify something else to do. Zero
1301 means the default is an error. */
1302 static const yytype_uint8 yydefact[] =
1303 {
1304 0, 0, 0, 30, 13, 31, 57, 0, 0, 0,
1305 0, 0, 0, 50, 91, 0, 0, 0, 88, 0,
1306 83, 85, 0, 0, 0, 24, 0, 0, 12, 0,
1307 0, 0, 0, 0, 0, 0, 0, 0, 5, 144,
1308 0, 3, 0, 55, 59, 54, 0, 65, 67, 6,
1309 129, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1310 76, 130, 146, 127, 0, 0, 0, 128, 60, 72,
1311 71, 125, 75, 56, 29, 14, 0, 128, 33, 125,
1312 64, 62, 63, 0, 0, 0, 51, 97, 0, 92,
1313 0, 89, 0, 86, 0, 61, 23, 8, 26, 25,
1314 11, 10, 9, 0, 0, 0, 47, 48, 1, 2,
1315 4, 7, 0, 0, 0, 49, 82, 0, 0, 0,
1316 0, 58, 0, 65, 0, 0, 0, 0, 66, 0,
1317 68, 0, 126, 124, 103, 104, 102, 0, 0, 0,
1318 0, 0, 100, 101, 0, 71, 0, 0, 0, 0,
1319 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1320 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1321 0, 0, 28, 0, 0, 0, 0, 0, 0, 0,
1322 0, 0, 0, 0, 0, 0, 0, 0, 0, 15,
1323 32, 17, 84, 27, 16, 18, 0, 19, 21, 20,
1324 22, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1325 155, 156, 157, 158, 159, 160, 161, 162, 163, 164,
1326 165, 166, 167, 168, 169, 170, 171, 172, 173, 174,
1327 175, 176, 127, 131, 0, 0, 125, 0, 0, 142,
1328 0, 0, 0, 0, 70, 69, 74, 121, 120, 116,
1329 115, 118, 117, 109, 119, 122, 110, 111, 112, 113,
1330 114, 123, 107, 108, 105, 106, 0, 0, 0, 35,
1331 39, 0, 53, 52, 98, 0, 93, 0, 95, 99,
1332 90, 87, 0, 43, 44, 45, 0, 0, 0, 0,
1333 0, 145, 0, 153, 81, 73, 139, 138, 0, 0,
1334 132, 133, 135, 137, 136, 134, 0, 77, 0, 0,
1335 0, 0, 147, 0, 150, 0, 0, 0, 94, 96,
1336 0, 0, 34, 38, 0, 0, 0, 0, 0, 79,
1337 78, 80, 0, 0, 0, 37, 41, 42, 46, 0,
1338 0, 152, 154, 141, 140, 0, 143, 148, 151, 36,
1339 40, 0, 149
1340 };
1341
1342 /* YYPGOTO[NTERM-NUM]. */
1343 static const yytype_int16 yypgoto[] =
1344 {
1345 -88, -88, 142, -88, -88, -88, 138, 140, -88, 238,
1346 60, -8, 141, 118, 39, -88, -88
1347 };
1348
1349 /* YYDEFGOTO[NTERM-NUM]. */
1350 static const yytype_int16 yydefgoto[] =
1351 {
1352 -1, 40, 41, 42, 74, 43, 44, 45, 46, 68,
1353 69, 70, 47, 79, 72, 48, 237
1354 };
1355
1356 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
1357 positive, shift that token. If negative, reduce the rule whose
1358 number is the opposite. If YYTABLE_NINF, syntax error. */
1359 static const yytype_int16 yytable[] =
1360 {
1361 78, 80, 128, 304, 49, 86, 89, 129, 91, 92,
1362 176, 93, 124, 73, 94, 130, 96, 55, 125, 75,
1363 131, 99, 90, 60, 83, 157, 87, 105, 106, 107,
1364 160, 161, 162, 163, 164, 62, 132, 128, 84, 126,
1365 127, 55, 196, 55, 134, 135, 136, 60, 205, 60,
1366 207, 98, 168, 169, 55, 110, 142, 143, 145, 116,
1367 60, 117, 84, 170, 84, 186, 172, 137, 145, 138,
1368 50, 139, 85, 51, 171, 84, 140, 52, 141, 53,
1369 180, 238, 150, 150, 54, 176, 97, 268, 150, 177,
1370 100, 101, 102, 103, 104, 57, 58, 59, 307, 150,
1371 61, 62, 63, 178, 179, 190, 64, 65, 182, 192,
1372 187, 193, 278, 76, 77, 88, 146, 147, 148, 149,
1373 71, 201, 241, 202, 279, 294, 242, 243, 71, 71,
1374 295, 296, 297, 235, 298, 299, 300, 301, 302, 305,
1375 319, 71, 245, 247, 248, 249, 250, 251, 252, 253,
1376 254, 255, 256, 257, 258, 259, 260, 261, 262, 263,
1377 264, 265, 266, 267, 306, 315, 269, 270, 271, 133,
1378 335, 276, 336, 337, 349, 280, 281, 282, 284, 285,
1379 286, 350, 109, 121, 71, 122, 123, 0, 289, 246,
1380 0, 0, 0, 0, 71, 0, 0, 203, 204, 206,
1381 208, 234, 0, 0, 0, 0, 0, 134, 0, 135,
1382 244, 0, 0, 0, 136, 0, 0, 0, 0, 0,
1383 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1384 71, 0, 71, 308, 309, 310, 0, 71, 71, 0,
1385 0, 0, 71, 71, 71, 71, 283, 0, 81, 82,
1386 0, 0, 0, 0, 0, 0, 0, 0, 0, 236,
1387 0, 95, 0, 0, 71, 0, 0, 318, 71, 0,
1388 0, 0, 0, 0, 0, 0, 0, 0, 0, 322,
1389 323, 0, 324, 0, 325, 0, 0, 0, 0, 0,
1390 326, 327, 0, 0, 0, 71, 71, 0, 328, 0,
1391 0, 0, 274, 332, 144, 333, 0, 334, 0, 0,
1392 0, 0, 0, 338, 173, 0, 0, 0, 0, 0,
1393 0, 0, 0, 0, 0, 0, 0, 0, 0, 133,
1394 0, 0, 0, 0, 0, 0, 0, 351, 0, 0,
1395 0, 0, 0, 0, 0, 0, 50, 0, 0, 51,
1396 189, 0, 191, 52, 0, 53, 0, 194, 195, 0,
1397 54, 0, 197, 198, 199, 200, 0, 0, 0, 0,
1398 0, 57, 58, 59, 209, 0, 61, 62, 63, 0,
1399 0, 0, 64, 65, 240, 0, 0, 0, 0, 76,
1400 77, 275, 0, 0, 0, 0, 0, 0, 0, 0,
1401 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1402 0, 0, 0, 0, 0, 272, 273, 0, 50, 0,
1403 210, 211, 212, 213, 214, 215, 216, 217, 218, 219,
1404 220, 221, 222, 223, 224, 225, 226, 0, 0, 227,
1405 228, 55, 0, 229, 230, 231, 0, 60, 61, 62,
1406 232, 0, 0, 0, 64, 65, 0, 0, 233, 108,
1407 1, 76, 67, 2, 3, 4, 5, 0, 6, 7,
1408 8, 9, 10, 0, 11, 0, 12, 13, 14, 15,
1409 16, 17, 18, 19, 0, 20, 0, 21, 22, 23,
1410 24, 25, 26, 27, 0, 0, 28, 29, 30, 31,
1411 32, 33, 34, 35, 36, 37, 0, 38, 1, 0,
1412 0, 2, 3, 4, 5, 0, 6, 7, 8, 9,
1413 10, 0, 11, 0, 12, 13, 14, 15, 16, 17,
1414 18, 19, 0, 20, 39, 21, 22, 23, 24, 25,
1415 26, 27, 0, 0, 28, 29, 30, 31, 32, 33,
1416 34, 35, 36, 37, 2, 38, 111, 0, 112, 0,
1417 0, 113, 9, 10, 114, 11, 115, 0, 0, 14,
1418 15, 16, 17, 18, 19, 116, 20, 117, 21, 0,
1419 23, 0, 39, 0, 118, 119, 120, 151, 0, 152,
1420 153, 154, 0, 155, 0, 156, 157, 0, 158, 0,
1421 159, 160, 161, 162, 163, 164, 165, 0, 0, 0,
1422 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1423 0, 166, 167, 168, 169, 39, 290, 0, 151, 0,
1424 152, 153, 154, 291, 155, 0, 156, 157, 0, 158,
1425 0, 159, 160, 161, 162, 163, 164, 165, 0, 0,
1426 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1427 0, 0, 166, 167, 168, 169, 0, 292, 0, 151,
1428 0, 152, 153, 154, 293, 155, 0, 156, 157, 0,
1429 158, 0, 159, 160, 161, 162, 163, 164, 165, 0,
1430 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1431 0, 0, 0, 166, 167, 168, 169, 0, 311, 0,
1432 151, 0, 152, 153, 154, 312, 155, 0, 156, 157,
1433 0, 158, 0, 159, 160, 161, 162, 163, 164, 165,
1434 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1435 0, 0, 0, 0, 166, 167, 168, 169, 0, 313,
1436 0, 151, 0, 152, 153, 154, 314, 155, 0, 156,
1437 157, 0, 158, 0, 159, 160, 161, 162, 163, 164,
1438 165, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1439 0, 0, 0, 0, 0, 166, 167, 168, 169, 0,
1440 345, 0, 151, 0, 152, 153, 154, 346, 155, 0,
1441 156, 157, 0, 158, 0, 159, 160, 161, 162, 163,
1442 164, 165, 0, 0, 0, 0, 0, 0, 0, 0,
1443 0, 0, 0, 0, 0, 0, 166, 167, 168, 169,
1444 0, 151, 0, 152, 153, 154, 0, 155, 312, 156,
1445 157, 0, 158, 0, 159, 160, 161, 162, 163, 164,
1446 165, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1447 0, 0, 0, 0, 0, 166, 167, 168, 169, 0,
1448 151, 0, 152, 153, 154, 0, 155, 291, 156, 157,
1449 0, 158, 0, 159, 160, 161, 162, 163, 164, 165,
1450 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1451 0, 0, 0, 0, 166, 167, 168, 169, 0, 151,
1452 0, 152, 153, 154, 0, 155, 341, 156, 157, 0,
1453 158, 0, 159, 160, 161, 162, 163, 164, 165, 0,
1454 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1455 0, 0, 0, 166, 167, 168, 169, 0, 151, 0,
1456 152, 153, 154, 0, 155, 342, 156, 157, 0, 158,
1457 0, 159, 160, 161, 162, 163, 164, 165, 0, 0,
1458 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1459 0, 0, 166, 167, 168, 169, 0, 151, 0, 152,
1460 153, 154, 0, 155, 347, 156, 157, 0, 158, 0,
1461 159, 160, 161, 162, 163, 164, 165, 0, 0, 0,
1462 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1463 0, 166, 167, 168, 169, 0, 151, 0, 152, 153,
1464 154, 0, 155, 348, 156, 157, 0, 158, 0, 159,
1465 160, 161, 162, 163, 164, 165, 0, 0, 0, 0,
1466 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1467 166, 167, 168, 169, 0, 151, 0, 152, 153, 154,
1468 0, 155, 346, 156, 157, 0, 158, 0, 159, 160,
1469 161, 162, 163, 164, 165, 0, 0, 0, 0, 50,
1470 0, 0, 51, 0, 0, 0, 52, 0, 53, 166,
1471 167, 168, 169, 54, 0, 0, 0, 0, 0, 0,
1472 0, 352, 55, 56, 57, 58, 59, 0, 60, 61,
1473 62, 63, 0, 0, 0, 64, 65, 50, 0, 0,
1474 51, 0, 66, 67, 52, 0, 53, 0, 0, 0,
1475 0, 54, 0, 0, 0, 0, 0, 0, 0, 0,
1476 55, 0, 57, 58, 59, 0, 60, 61, 62, 63,
1477 0, 0, 0, 64, 65, 50, 0, 0, 51, 0,
1478 66, 67, 52, 0, 53, 0, 0, 0, 0, 54,
1479 0, 0, 0, 0, 0, 0, 0, 0, 55, 0,
1480 57, 58, 59, 0, 60, 61, 62, 63, 0, 0,
1481 0, 64, 65, 50, 0, 0, 51, 0, 76, 67,
1482 52, 0, 53, 0, 0, 0, 0, 54, 0, 0,
1483 0, 0, 0, 0, 0, 0, 0, 0, 57, 58,
1484 59, 0, 0, 61, 62, 63, 0, 0, 0, 64,
1485 65, 0, 0, 0, 0, 0, 76, 77, 151, 0,
1486 152, 153, 154, 0, 155, 0, 156, 157, 0, 158,
1487 0, 159, 160, 161, 162, 163, 164, 165, 0, 0,
1488 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1489 0, 0, 166, 167, 168, 169, 0, 174, 175, 151,
1490 0, 152, 153, 154, 0, 155, 0, 156, 157, 0,
1491 158, 0, 159, 160, 161, 162, 163, 164, 165, 0,
1492 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1493 0, 0, 0, 166, 167, 168, 169, 0, 287, 288,
1494 151, 0, 152, 153, 154, 0, 155, 0, 156, 157,
1495 0, 158, 0, 159, 160, 161, 162, 163, 164, 165,
1496 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1497 0, 0, 0, 0, 166, 167, 168, 169, 151, 181,
1498 152, 153, 154, 0, 155, 0, 156, 157, 0, 158,
1499 0, 159, 160, 161, 162, 163, 164, 165, 0, 0,
1500 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1501 0, 0, 166, 167, 168, 169, 151, 183, 152, 153,
1502 154, 0, 155, 0, 156, 157, 0, 158, 0, 159,
1503 160, 161, 162, 163, 164, 165, 0, 0, 0, 0,
1504 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1505 166, 167, 168, 169, 151, 184, 152, 153, 154, 0,
1506 155, 0, 156, 157, 0, 158, 0, 159, 160, 161,
1507 162, 163, 164, 165, 0, 0, 0, 0, 0, 0,
1508 0, 0, 0, 0, 0, 0, 0, 0, 166, 167,
1509 168, 169, 151, 185, 152, 153, 154, 0, 155, 0,
1510 156, 157, 0, 158, 0, 159, 160, 161, 162, 163,
1511 164, 165, 0, 0, 0, 0, 0, 0, 0, 0,
1512 0, 0, 0, 0, 0, 0, 166, 167, 168, 169,
1513 151, 188, 152, 153, 154, 0, 155, 0, 156, 157,
1514 0, 158, 0, 159, 160, 161, 162, 163, 164, 165,
1515 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1516 0, 0, 0, 0, 166, 167, 168, 169, 151, 277,
1517 152, 153, 154, 0, 155, 0, 156, 157, 0, 158,
1518 0, 159, 160, 161, 162, 163, 164, 165, 0, 0,
1519 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1520 0, 0, 166, 167, 168, 169, 151, 316, 152, 153,
1521 154, 0, 155, 0, 156, 157, 0, 158, 0, 159,
1522 160, 161, 162, 163, 164, 165, 0, 0, 0, 0,
1523 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1524 166, 167, 168, 169, 151, 317, 152, 153, 154, 0,
1525 155, 0, 156, 157, 0, 158, 0, 159, 160, 161,
1526 162, 163, 164, 165, 0, 0, 0, 0, 0, 0,
1527 0, 0, 0, 0, 0, 0, 0, 0, 166, 167,
1528 168, 169, 151, 320, 152, 153, 154, 0, 155, 0,
1529 156, 157, 0, 158, 0, 159, 160, 161, 162, 163,
1530 164, 165, 0, 0, 0, 0, 0, 0, 0, 0,
1531 0, 0, 0, 0, 0, 0, 166, 167, 168, 169,
1532 151, 321, 152, 153, 154, 0, 155, 0, 156, 157,
1533 0, 158, 0, 159, 160, 161, 162, 163, 164, 165,
1534 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1535 0, 0, 0, 0, 166, 167, 168, 169, 151, 339,
1536 152, 153, 154, 0, 155, 0, 156, 157, 0, 158,
1537 0, 159, 160, 161, 162, 163, 164, 165, 0, 0,
1538 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1539 0, 0, 166, 167, 168, 169, 151, 340, 152, 153,
1540 154, 0, 155, 0, 156, 157, 0, 158, 0, 159,
1541 160, 161, 162, 163, 164, 165, 0, 0, 0, 0,
1542 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1543 166, 167, 168, 169, 239, 151, 0, 152, 153, 154,
1544 0, 155, 0, 156, 157, 0, 158, 0, 159, 160,
1545 161, 162, 163, 164, 165, 0, 0, 0, 0, 0,
1546 0, 0, 0, 0, 0, 0, 0, 0, 0, 166,
1547 167, 168, 169, 303, 151, 0, 152, 153, 154, 0,
1548 155, 0, 156, 157, 0, 158, 0, 159, 160, 161,
1549 162, 163, 164, 165, 0, 0, 0, 0, 0, 0,
1550 0, 0, 0, 0, 0, 0, 0, 0, 166, 167,
1551 168, 169, 329, 151, 0, 152, 153, 154, 0, 155,
1552 0, 156, 157, 0, 158, 0, 159, 160, 161, 162,
1553 163, 164, 165, 0, 0, 0, 0, 0, 0, 0,
1554 0, 0, 0, 0, 0, 0, 0, 166, 167, 168,
1555 169, 330, 151, 0, 152, 153, 154, 0, 155, 0,
1556 156, 157, 0, 158, 0, 159, 160, 161, 162, 163,
1557 164, 165, 0, 0, 0, 0, 0, 0, 0, 0,
1558 0, 0, 0, 0, 0, 0, 166, 167, 168, 169,
1559 331, 151, 0, 152, 153, 154, 0, 155, 0, 156,
1560 157, 0, 158, 0, 159, 160, 161, 162, 163, 164,
1561 165, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1562 0, 0, 0, 0, 0, 166, 167, 168, 169, 343,
1563 151, 0, 152, 153, 154, 0, 155, 0, 156, 157,
1564 0, 158, 0, 159, 160, 161, 162, 163, 164, 165,
1565 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1566 0, 0, 0, 0, 166, 167, 168, 169, 344, 151,
1567 0, 152, 153, 154, 0, 155, 0, 156, 157, 0,
1568 158, 0, 159, 160, 161, 162, 163, 164, 165, 0,
1569 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1570 0, 0, 0, 166, 167, 168, 169, 151, 0, 152,
1571 153, 154, 0, 155, 0, 156, 157, 0, 158, 0,
1572 0, 160, 161, 162, 163, 164, 0, 0, 0, 0,
1573 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1574 0, 166, 167, 168, 169, 152, 153, 154, 0, 155,
1575 0, 156, 157, 0, 158, 0, 0, 160, 161, 162,
1576 163, 164, 0, 0, 0, 0, 0, 0, 0, 0,
1577 0, 0, 0, 0, 0, 0, 0, 166, 167, 168,
1578 169, -1, -1, -1, 0, -1, 0, -1, 157, 0,
1579 -1, 0, 0, 160, 161, 162, 163, 164, 0, 0,
1580 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1581 0, 0, 0, 166, 167, 168, 169
1582 };
1583
1584 static const yytype_int16 yycheck[] =
1585 {
1586 8, 9, 89, 87, 48, 13, 14, 94, 16, 17,
1587 94, 19, 8, 80, 22, 89, 24, 70, 14, 76,
1588 94, 29, 3, 76, 77, 58, 3, 35, 36, 37,
1589 63, 64, 65, 66, 67, 78, 79, 89, 91, 35,
1590 36, 70, 94, 70, 52, 53, 54, 76, 77, 76,
1591 77, 76, 85, 86, 70, 48, 64, 65, 66, 25,
1592 76, 27, 91, 94, 91, 51, 74, 90, 76, 90,
1593 47, 90, 12, 50, 94, 91, 90, 54, 90, 56,
1594 88, 87, 88, 88, 61, 94, 26, 87, 88, 88,
1595 30, 31, 32, 33, 34, 72, 73, 74, 87, 88,
1596 77, 78, 79, 88, 88, 113, 83, 84, 88, 117,
1597 88, 76, 3, 90, 91, 92, 90, 91, 92, 93,
1598 2, 129, 90, 131, 3, 87, 90, 90, 10, 11,
1599 87, 87, 87, 141, 88, 88, 87, 87, 87, 87,
1600 3, 23, 150, 151, 152, 153, 154, 155, 156, 157,
1601 158, 159, 160, 161, 162, 163, 164, 165, 166, 167,
1602 168, 169, 170, 171, 94, 94, 174, 175, 176, 51,
1603 76, 179, 76, 76, 76, 183, 184, 185, 186, 187,
1604 188, 76, 40, 45, 66, 45, 45, -1, 196, 150,
1605 -1, -1, -1, -1, 76, -1, -1, 137, 138, 139,
1606 140, 141, -1, -1, -1, -1, -1, 215, -1, 217,
1607 150, -1, -1, -1, 222, -1, -1, -1, -1, -1,
1608 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1609 112, -1, 114, 241, 242, 243, -1, 119, 120, -1,
1610 -1, -1, 124, 125, 126, 127, 186, -1, 10, 11,
1611 -1, -1, -1, -1, -1, -1, -1, -1, -1, 141,
1612 -1, 23, -1, -1, 146, -1, -1, 275, 150, -1,
1613 -1, -1, -1, -1, -1, -1, -1, -1, -1, 287,
1614 288, -1, 290, -1, 292, -1, -1, -1, -1, -1,
1615 298, 299, -1, -1, -1, 177, 178, -1, 306, -1,
1616 -1, -1, 3, 311, 66, 313, -1, 315, -1, -1,
1617 -1, -1, -1, 321, 76, -1, -1, -1, -1, -1,
1618 -1, -1, -1, -1, -1, -1, -1, -1, -1, 211,
1619 -1, -1, -1, -1, -1, -1, -1, 345, -1, -1,
1620 -1, -1, -1, -1, -1, -1, 47, -1, -1, 50,
1621 112, -1, 114, 54, -1, 56, -1, 119, 120, -1,
1622 61, -1, 124, 125, 126, 127, -1, -1, -1, -1,
1623 -1, 72, 73, 74, 3, -1, 77, 78, 79, -1,
1624 -1, -1, 83, 84, 146, -1, -1, -1, -1, 90,
1625 91, 92, -1, -1, -1, -1, -1, -1, -1, -1,
1626 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1627 -1, -1, -1, -1, -1, 177, 178, -1, 47, -1,
1628 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
1629 59, 60, 61, 62, 63, 64, 65, -1, -1, 68,
1630 69, 70, -1, 72, 73, 74, -1, 76, 77, 78,
1631 79, -1, -1, -1, 83, 84, -1, -1, 87, 0,
1632 1, 90, 91, 4, 5, 6, 7, -1, 9, 10,
1633 11, 12, 13, -1, 15, -1, 17, 18, 19, 20,
1634 21, 22, 23, 24, -1, 26, -1, 28, 29, 30,
1635 31, 32, 33, 34, -1, -1, 37, 38, 39, 40,
1636 41, 42, 43, 44, 45, 46, -1, 48, 1, -1,
1637 -1, 4, 5, 6, 7, -1, 9, 10, 11, 12,
1638 13, -1, 15, -1, 17, 18, 19, 20, 21, 22,
1639 23, 24, -1, 26, 75, 28, 29, 30, 31, 32,
1640 33, 34, -1, -1, 37, 38, 39, 40, 41, 42,
1641 43, 44, 45, 46, 4, 48, 6, -1, 8, -1,
1642 -1, 11, 12, 13, 14, 15, 16, -1, -1, 19,
1643 20, 21, 22, 23, 24, 25, 26, 27, 28, -1,
1644 30, -1, 75, -1, 34, 35, 36, 49, -1, 51,
1645 52, 53, -1, 55, -1, 57, 58, -1, 60, -1,
1646 62, 63, 64, 65, 66, 67, 68, -1, -1, -1,
1647 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1648 -1, 83, 84, 85, 86, 75, 88, -1, 49, -1,
1649 51, 52, 53, 95, 55, -1, 57, 58, -1, 60,
1650 -1, 62, 63, 64, 65, 66, 67, 68, -1, -1,
1651 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1652 -1, -1, 83, 84, 85, 86, -1, 88, -1, 49,
1653 -1, 51, 52, 53, 95, 55, -1, 57, 58, -1,
1654 60, -1, 62, 63, 64, 65, 66, 67, 68, -1,
1655 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1656 -1, -1, -1, 83, 84, 85, 86, -1, 88, -1,
1657 49, -1, 51, 52, 53, 95, 55, -1, 57, 58,
1658 -1, 60, -1, 62, 63, 64, 65, 66, 67, 68,
1659 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1660 -1, -1, -1, -1, 83, 84, 85, 86, -1, 88,
1661 -1, 49, -1, 51, 52, 53, 95, 55, -1, 57,
1662 58, -1, 60, -1, 62, 63, 64, 65, 66, 67,
1663 68, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1664 -1, -1, -1, -1, -1, 83, 84, 85, 86, -1,
1665 88, -1, 49, -1, 51, 52, 53, 95, 55, -1,
1666 57, 58, -1, 60, -1, 62, 63, 64, 65, 66,
1667 67, 68, -1, -1, -1, -1, -1, -1, -1, -1,
1668 -1, -1, -1, -1, -1, -1, 83, 84, 85, 86,
1669 -1, 49, -1, 51, 52, 53, -1, 55, 95, 57,
1670 58, -1, 60, -1, 62, 63, 64, 65, 66, 67,
1671 68, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1672 -1, -1, -1, -1, -1, 83, 84, 85, 86, -1,
1673 49, -1, 51, 52, 53, -1, 55, 95, 57, 58,
1674 -1, 60, -1, 62, 63, 64, 65, 66, 67, 68,
1675 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1676 -1, -1, -1, -1, 83, 84, 85, 86, -1, 49,
1677 -1, 51, 52, 53, -1, 55, 95, 57, 58, -1,
1678 60, -1, 62, 63, 64, 65, 66, 67, 68, -1,
1679 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1680 -1, -1, -1, 83, 84, 85, 86, -1, 49, -1,
1681 51, 52, 53, -1, 55, 95, 57, 58, -1, 60,
1682 -1, 62, 63, 64, 65, 66, 67, 68, -1, -1,
1683 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1684 -1, -1, 83, 84, 85, 86, -1, 49, -1, 51,
1685 52, 53, -1, 55, 95, 57, 58, -1, 60, -1,
1686 62, 63, 64, 65, 66, 67, 68, -1, -1, -1,
1687 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1688 -1, 83, 84, 85, 86, -1, 49, -1, 51, 52,
1689 53, -1, 55, 95, 57, 58, -1, 60, -1, 62,
1690 63, 64, 65, 66, 67, 68, -1, -1, -1, -1,
1691 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1692 83, 84, 85, 86, -1, 49, -1, 51, 52, 53,
1693 -1, 55, 95, 57, 58, -1, 60, -1, 62, 63,
1694 64, 65, 66, 67, 68, -1, -1, -1, -1, 47,
1695 -1, -1, 50, -1, -1, -1, 54, -1, 56, 83,
1696 84, 85, 86, 61, -1, -1, -1, -1, -1, -1,
1697 -1, 95, 70, 71, 72, 73, 74, -1, 76, 77,
1698 78, 79, -1, -1, -1, 83, 84, 47, -1, -1,
1699 50, -1, 90, 91, 54, -1, 56, -1, -1, -1,
1700 -1, 61, -1, -1, -1, -1, -1, -1, -1, -1,
1701 70, -1, 72, 73, 74, -1, 76, 77, 78, 79,
1702 -1, -1, -1, 83, 84, 47, -1, -1, 50, -1,
1703 90, 91, 54, -1, 56, -1, -1, -1, -1, 61,
1704 -1, -1, -1, -1, -1, -1, -1, -1, 70, -1,
1705 72, 73, 74, -1, 76, 77, 78, 79, -1, -1,
1706 -1, 83, 84, 47, -1, -1, 50, -1, 90, 91,
1707 54, -1, 56, -1, -1, -1, -1, 61, -1, -1,
1708 -1, -1, -1, -1, -1, -1, -1, -1, 72, 73,
1709 74, -1, -1, 77, 78, 79, -1, -1, -1, 83,
1710 84, -1, -1, -1, -1, -1, 90, 91, 49, -1,
1711 51, 52, 53, -1, 55, -1, 57, 58, -1, 60,
1712 -1, 62, 63, 64, 65, 66, 67, 68, -1, -1,
1713 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1714 -1, -1, 83, 84, 85, 86, -1, 88, 89, 49,
1715 -1, 51, 52, 53, -1, 55, -1, 57, 58, -1,
1716 60, -1, 62, 63, 64, 65, 66, 67, 68, -1,
1717 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1718 -1, -1, -1, 83, 84, 85, 86, -1, 88, 89,
1719 49, -1, 51, 52, 53, -1, 55, -1, 57, 58,
1720 -1, 60, -1, 62, 63, 64, 65, 66, 67, 68,
1721 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1722 -1, -1, -1, -1, 83, 84, 85, 86, 49, 88,
1723 51, 52, 53, -1, 55, -1, 57, 58, -1, 60,
1724 -1, 62, 63, 64, 65, 66, 67, 68, -1, -1,
1725 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1726 -1, -1, 83, 84, 85, 86, 49, 88, 51, 52,
1727 53, -1, 55, -1, 57, 58, -1, 60, -1, 62,
1728 63, 64, 65, 66, 67, 68, -1, -1, -1, -1,
1729 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1730 83, 84, 85, 86, 49, 88, 51, 52, 53, -1,
1731 55, -1, 57, 58, -1, 60, -1, 62, 63, 64,
1732 65, 66, 67, 68, -1, -1, -1, -1, -1, -1,
1733 -1, -1, -1, -1, -1, -1, -1, -1, 83, 84,
1734 85, 86, 49, 88, 51, 52, 53, -1, 55, -1,
1735 57, 58, -1, 60, -1, 62, 63, 64, 65, 66,
1736 67, 68, -1, -1, -1, -1, -1, -1, -1, -1,
1737 -1, -1, -1, -1, -1, -1, 83, 84, 85, 86,
1738 49, 88, 51, 52, 53, -1, 55, -1, 57, 58,
1739 -1, 60, -1, 62, 63, 64, 65, 66, 67, 68,
1740 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1741 -1, -1, -1, -1, 83, 84, 85, 86, 49, 88,
1742 51, 52, 53, -1, 55, -1, 57, 58, -1, 60,
1743 -1, 62, 63, 64, 65, 66, 67, 68, -1, -1,
1744 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1745 -1, -1, 83, 84, 85, 86, 49, 88, 51, 52,
1746 53, -1, 55, -1, 57, 58, -1, 60, -1, 62,
1747 63, 64, 65, 66, 67, 68, -1, -1, -1, -1,
1748 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1749 83, 84, 85, 86, 49, 88, 51, 52, 53, -1,
1750 55, -1, 57, 58, -1, 60, -1, 62, 63, 64,
1751 65, 66, 67, 68, -1, -1, -1, -1, -1, -1,
1752 -1, -1, -1, -1, -1, -1, -1, -1, 83, 84,
1753 85, 86, 49, 88, 51, 52, 53, -1, 55, -1,
1754 57, 58, -1, 60, -1, 62, 63, 64, 65, 66,
1755 67, 68, -1, -1, -1, -1, -1, -1, -1, -1,
1756 -1, -1, -1, -1, -1, -1, 83, 84, 85, 86,
1757 49, 88, 51, 52, 53, -1, 55, -1, 57, 58,
1758 -1, 60, -1, 62, 63, 64, 65, 66, 67, 68,
1759 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1760 -1, -1, -1, -1, 83, 84, 85, 86, 49, 88,
1761 51, 52, 53, -1, 55, -1, 57, 58, -1, 60,
1762 -1, 62, 63, 64, 65, 66, 67, 68, -1, -1,
1763 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1764 -1, -1, 83, 84, 85, 86, 49, 88, 51, 52,
1765 53, -1, 55, -1, 57, 58, -1, 60, -1, 62,
1766 63, 64, 65, 66, 67, 68, -1, -1, -1, -1,
1767 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1768 83, 84, 85, 86, 87, 49, -1, 51, 52, 53,
1769 -1, 55, -1, 57, 58, -1, 60, -1, 62, 63,
1770 64, 65, 66, 67, 68, -1, -1, -1, -1, -1,
1771 -1, -1, -1, -1, -1, -1, -1, -1, -1, 83,
1772 84, 85, 86, 87, 49, -1, 51, 52, 53, -1,
1773 55, -1, 57, 58, -1, 60, -1, 62, 63, 64,
1774 65, 66, 67, 68, -1, -1, -1, -1, -1, -1,
1775 -1, -1, -1, -1, -1, -1, -1, -1, 83, 84,
1776 85, 86, 87, 49, -1, 51, 52, 53, -1, 55,
1777 -1, 57, 58, -1, 60, -1, 62, 63, 64, 65,
1778 66, 67, 68, -1, -1, -1, -1, -1, -1, -1,
1779 -1, -1, -1, -1, -1, -1, -1, 83, 84, 85,
1780 86, 87, 49, -1, 51, 52, 53, -1, 55, -1,
1781 57, 58, -1, 60, -1, 62, 63, 64, 65, 66,
1782 67, 68, -1, -1, -1, -1, -1, -1, -1, -1,
1783 -1, -1, -1, -1, -1, -1, 83, 84, 85, 86,
1784 87, 49, -1, 51, 52, 53, -1, 55, -1, 57,
1785 58, -1, 60, -1, 62, 63, 64, 65, 66, 67,
1786 68, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1787 -1, -1, -1, -1, -1, 83, 84, 85, 86, 87,
1788 49, -1, 51, 52, 53, -1, 55, -1, 57, 58,
1789 -1, 60, -1, 62, 63, 64, 65, 66, 67, 68,
1790 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1791 -1, -1, -1, -1, 83, 84, 85, 86, 87, 49,
1792 -1, 51, 52, 53, -1, 55, -1, 57, 58, -1,
1793 60, -1, 62, 63, 64, 65, 66, 67, 68, -1,
1794 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1795 -1, -1, -1, 83, 84, 85, 86, 49, -1, 51,
1796 52, 53, -1, 55, -1, 57, 58, -1, 60, -1,
1797 -1, 63, 64, 65, 66, 67, -1, -1, -1, -1,
1798 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1799 -1, 83, 84, 85, 86, 51, 52, 53, -1, 55,
1800 -1, 57, 58, -1, 60, -1, -1, 63, 64, 65,
1801 66, 67, -1, -1, -1, -1, -1, -1, -1, -1,
1802 -1, -1, -1, -1, -1, -1, -1, 83, 84, 85,
1803 86, 51, 52, 53, -1, 55, -1, 57, 58, -1,
1804 60, -1, -1, 63, 64, 65, 66, 67, -1, -1,
1805 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1806 -1, -1, -1, 83, 84, 85, 86
1807 };
1808
1809 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1810 symbol of state STATE-NUM. */
1811 static const yytype_uint8 yystos[] =
1812 {
1813 0, 1, 4, 5, 6, 7, 9, 10, 11, 12,
1814 13, 15, 17, 18, 19, 20, 21, 22, 23, 24,
1815 26, 28, 29, 30, 31, 32, 33, 34, 37, 38,
1816 39, 40, 41, 42, 43, 44, 45, 46, 48, 75,
1817 97, 98, 99, 101, 102, 103, 104, 108, 111, 48,
1818 47, 50, 54, 56, 61, 70, 71, 72, 73, 74,
1819 76, 77, 78, 79, 83, 84, 90, 91, 105, 106,
1820 107, 109, 110, 80, 100, 76, 90, 91, 107, 109,
1821 107, 105, 105, 77, 91, 106, 107, 3, 92, 107,
1822 3, 107, 107, 107, 107, 105, 107, 106, 76, 107,
1823 106, 106, 106, 106, 106, 107, 107, 107, 0, 98,
1824 48, 6, 8, 11, 14, 16, 25, 27, 34, 35,
1825 36, 102, 103, 108, 8, 14, 35, 36, 89, 94,
1826 89, 94, 79, 109, 107, 107, 107, 90, 90, 90,
1827 90, 90, 107, 107, 105, 107, 90, 91, 92, 93,
1828 88, 49, 51, 52, 53, 55, 57, 58, 60, 62,
1829 63, 64, 65, 66, 67, 68, 83, 84, 85, 86,
1830 94, 94, 107, 105, 88, 89, 94, 88, 88, 88,
1831 107, 88, 88, 88, 88, 88, 51, 88, 88, 105,
1832 107, 105, 107, 76, 105, 105, 94, 105, 105, 105,
1833 105, 107, 107, 106, 106, 77, 106, 77, 106, 3,
1834 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
1835 59, 60, 61, 62, 63, 64, 65, 68, 69, 72,
1836 73, 74, 79, 87, 106, 107, 109, 112, 87, 87,
1837 105, 90, 90, 90, 106, 107, 110, 107, 107, 107,
1838 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
1839 107, 107, 107, 107, 107, 107, 107, 107, 87, 107,
1840 107, 107, 105, 105, 3, 92, 107, 88, 3, 3,
1841 107, 107, 107, 106, 107, 107, 107, 88, 89, 107,
1842 88, 95, 88, 95, 87, 87, 87, 87, 88, 88,
1843 87, 87, 87, 87, 87, 87, 94, 87, 107, 107,
1844 107, 88, 95, 88, 95, 94, 88, 88, 107, 3,
1845 88, 88, 107, 107, 107, 107, 107, 107, 107, 87,
1846 87, 87, 107, 107, 107, 76, 76, 76, 107, 88,
1847 88, 95, 95, 87, 87, 88, 95, 95, 95, 76,
1848 76, 107, 95
1849 };
1850
1851 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1852 static const yytype_uint8 yyr1[] =
1853 {
1854 0, 96, 97, 97, 98, 98, 98, 99, 99, 99,
1855 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
1856 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
1857 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
1858 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
1859 99, 99, 99, 99, 99, 99, 100, 100, 101, 101,
1860 102, 102, 102, 102, 102, 103, 103, 104, 104, 105,
1861 105, 105, 105, 105, 105, 105, 106, 106, 106, 106,
1862 106, 106, 102, 102, 102, 102, 102, 102, 102, 102,
1863 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
1864 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
1865 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
1866 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
1867 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
1868 107, 107, 107, 107, 108, 108, 109, 109, 110, 110,
1869 110, 110, 111, 111, 111, 112, 112, 112, 112, 112,
1870 112, 112, 112, 112, 112, 112, 112, 112, 112, 112,
1871 112, 112, 112, 112, 112, 112, 112
1872 };
1873
1874 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
1875 static const yytype_uint8 yyr2[] =
1876 {
1877 0, 2, 2, 1, 2, 1, 2, 2, 2, 2,
1878 2, 2, 1, 1, 2, 3, 3, 3, 3, 3,
1879 3, 3, 3, 2, 1, 2, 2, 3, 3, 2,
1880 1, 1, 3, 2, 5, 4, 7, 6, 5, 4,
1881 7, 6, 6, 4, 4, 4, 6, 2, 2, 2,
1882 1, 2, 4, 4, 1, 1, 1, 0, 2, 1,
1883 2, 2, 2, 2, 2, 1, 2, 1, 2, 3,
1884 3, 1, 1, 4, 3, 1, 1, 4, 5, 5,
1885 5, 4, 2, 1, 3, 1, 2, 4, 1, 2,
1886 4, 1, 2, 4, 5, 4, 5, 2, 4, 4,
1887 2, 2, 2, 2, 2, 3, 3, 3, 3, 3,
1888 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
1889 3, 3, 3, 3, 2, 1, 2, 1, 1, 1,
1890 1, 3, 4, 4, 4, 4, 4, 4, 4, 4,
1891 6, 6, 3, 6, 1, 4, 1, 4, 6, 8,
1892 4, 6, 6, 4, 6, 1, 1, 1, 1, 1,
1893 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1894 1, 1, 1, 1, 1, 1, 1
1895 };
1896
1897
1898 #define yyerrok (yyerrstatus = 0)
1899 #define yyclearin (yychar = YYEMPTY)
1900 #define YYEMPTY (-2)
1901 #define YYEOF 0
1902
1903 #define YYACCEPT goto yyacceptlab
1904 #define YYABORT goto yyabortlab
1905 #define YYERROR goto yyerrorlab
1906
1907
1908 #define YYRECOVERING() (!!yyerrstatus)
1909
1910 #define YYBACKUP(Token, Value) \
1911 do \
1912 if (yychar == YYEMPTY) \
1913 { \
1914 yychar = (Token); \
1915 yylval = (Value); \
1916 YYPOPSTACK (yylen); \
1917 yystate = *yyssp; \
1918 goto yybackup; \
1919 } \
1920 else \
1921 { \
1922 yyerror (YY_("syntax error: cannot back up")); \
1923 YYERROR; \
1924 } \
1925 while (0)
1926
1927 /* Error token number */
1928 #define YYTERROR 1
1929 #define YYERRCODE 256
1930
1931
1932
1933 /* Enable debugging if requested. */
1934 #if YYDEBUG
1935
1936 # ifndef YYFPRINTF
1937 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1938 # define YYFPRINTF fprintf
1939 # endif
1940
1941 # define YYDPRINTF(Args) \
1942 do { \
1943 if (yydebug) \
1944 YYFPRINTF Args; \
1945 } while (0)
1946
1947 /* This macro is provided for backward compatibility. */
1948 #ifndef YY_LOCATION_PRINT
1949 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1950 #endif
1951
1952
1953 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1954 do { \
1955 if (yydebug) \
1956 { \
1957 YYFPRINTF (stderr, "%s ", Title); \
1958 yy_symbol_print (stderr, \
1959 Type, Value); \
1960 YYFPRINTF (stderr, "\n"); \
1961 } \
1962 } while (0)
1963
1964
1965 /*----------------------------------------.
1966 | Print this symbol's value on YYOUTPUT. |
1967 `----------------------------------------*/
1968
1969 static void
yy_symbol_value_print(FILE * yyoutput,int yytype,YYSTYPE const * const yyvaluep)1970 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1971 {
1972 FILE *yyo = yyoutput;
1973 YYUSE (yyo);
1974 if (!yyvaluep)
1975 return;
1976 # ifdef YYPRINT
1977 if (yytype < YYNTOKENS)
1978 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1979 # endif
1980 YYUSE (yytype);
1981 }
1982
1983
1984 /*--------------------------------.
1985 | Print this symbol on YYOUTPUT. |
1986 `--------------------------------*/
1987
1988 static void
yy_symbol_print(FILE * yyoutput,int yytype,YYSTYPE const * const yyvaluep)1989 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1990 {
1991 YYFPRINTF (yyoutput, "%s %s (",
1992 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
1993
1994 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1995 YYFPRINTF (yyoutput, ")");
1996 }
1997
1998 /*------------------------------------------------------------------.
1999 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
2000 | TOP (included). |
2001 `------------------------------------------------------------------*/
2002
2003 static void
yy_stack_print(yytype_int16 * yybottom,yytype_int16 * yytop)2004 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
2005 {
2006 YYFPRINTF (stderr, "Stack now");
2007 for (; yybottom <= yytop; yybottom++)
2008 {
2009 int yybot = *yybottom;
2010 YYFPRINTF (stderr, " %d", yybot);
2011 }
2012 YYFPRINTF (stderr, "\n");
2013 }
2014
2015 # define YY_STACK_PRINT(Bottom, Top) \
2016 do { \
2017 if (yydebug) \
2018 yy_stack_print ((Bottom), (Top)); \
2019 } while (0)
2020
2021
2022 /*------------------------------------------------.
2023 | Report that the YYRULE is going to be reduced. |
2024 `------------------------------------------------*/
2025
2026 static void
yy_reduce_print(yytype_int16 * yyssp,YYSTYPE * yyvsp,int yyrule)2027 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
2028 {
2029 unsigned long int yylno = yyrline[yyrule];
2030 int yynrhs = yyr2[yyrule];
2031 int yyi;
2032 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
2033 yyrule - 1, yylno);
2034 /* The symbols being reduced. */
2035 for (yyi = 0; yyi < yynrhs; yyi++)
2036 {
2037 YYFPRINTF (stderr, " $%d = ", yyi + 1);
2038 yy_symbol_print (stderr,
2039 yystos[yyssp[yyi + 1 - yynrhs]],
2040 &(yyvsp[(yyi + 1) - (yynrhs)])
2041 );
2042 YYFPRINTF (stderr, "\n");
2043 }
2044 }
2045
2046 # define YY_REDUCE_PRINT(Rule) \
2047 do { \
2048 if (yydebug) \
2049 yy_reduce_print (yyssp, yyvsp, Rule); \
2050 } while (0)
2051
2052 /* Nonzero means print parse trace. It is left uninitialized so that
2053 multiple parsers can coexist. */
2054 int yydebug;
2055 #else /* !YYDEBUG */
2056 # define YYDPRINTF(Args)
2057 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
2058 # define YY_STACK_PRINT(Bottom, Top)
2059 # define YY_REDUCE_PRINT(Rule)
2060 #endif /* !YYDEBUG */
2061
2062
2063 /* YYINITDEPTH -- initial size of the parser's stacks. */
2064 #ifndef YYINITDEPTH
2065 # define YYINITDEPTH 200
2066 #endif
2067
2068 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
2069 if the built-in stack extension method is used).
2070
2071 Do not make this value too large; the results are undefined if
2072 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
2073 evaluated with infinite-precision integer arithmetic. */
2074
2075 #ifndef YYMAXDEPTH
2076 # define YYMAXDEPTH 10000
2077 #endif
2078
2079
2080 #if YYERROR_VERBOSE
2081
2082 # ifndef yystrlen
2083 # if defined __GLIBC__ && defined _STRING_H
2084 # define yystrlen strlen
2085 # else
2086 /* Return the length of YYSTR. */
2087 static YYSIZE_T
yystrlen(const char * yystr)2088 yystrlen (const char *yystr)
2089 {
2090 YYSIZE_T yylen;
2091 for (yylen = 0; yystr[yylen]; yylen++)
2092 continue;
2093 return yylen;
2094 }
2095 # endif
2096 # endif
2097
2098 # ifndef yystpcpy
2099 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
2100 # define yystpcpy stpcpy
2101 # else
2102 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
2103 YYDEST. */
2104 static char *
yystpcpy(char * yydest,const char * yysrc)2105 yystpcpy (char *yydest, const char *yysrc)
2106 {
2107 char *yyd = yydest;
2108 const char *yys = yysrc;
2109
2110 while ((*yyd++ = *yys++) != '\0')
2111 continue;
2112
2113 return yyd - 1;
2114 }
2115 # endif
2116 # endif
2117
2118 # ifndef yytnamerr
2119 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
2120 quotes and backslashes, so that it's suitable for yyerror. The
2121 heuristic is that double-quoting is unnecessary unless the string
2122 contains an apostrophe, a comma, or backslash (other than
2123 backslash-backslash). YYSTR is taken from yytname. If YYRES is
2124 null, do not copy; instead, return the length of what the result
2125 would have been. */
2126 static YYSIZE_T
yytnamerr(char * yyres,const char * yystr)2127 yytnamerr (char *yyres, const char *yystr)
2128 {
2129 if (*yystr == '"')
2130 {
2131 YYSIZE_T yyn = 0;
2132 char const *yyp = yystr;
2133
2134 for (;;)
2135 switch (*++yyp)
2136 {
2137 case '\'':
2138 case ',':
2139 goto do_not_strip_quotes;
2140
2141 case '\\':
2142 if (*++yyp != '\\')
2143 goto do_not_strip_quotes;
2144 /* Fall through. */
2145 default:
2146 if (yyres)
2147 yyres[yyn] = *yyp;
2148 yyn++;
2149 break;
2150
2151 case '"':
2152 if (yyres)
2153 yyres[yyn] = '\0';
2154 return yyn;
2155 }
2156 do_not_strip_quotes: ;
2157 }
2158
2159 if (! yyres)
2160 return yystrlen (yystr);
2161
2162 return yystpcpy (yyres, yystr) - yyres;
2163 }
2164 # endif
2165
2166 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
2167 about the unexpected token YYTOKEN for the state stack whose top is
2168 YYSSP.
2169
2170 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
2171 not large enough to hold the message. In that case, also set
2172 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
2173 required number of bytes is too large to store. */
2174 static int
yysyntax_error(YYSIZE_T * yymsg_alloc,char ** yymsg,yytype_int16 * yyssp,int yytoken)2175 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
2176 yytype_int16 *yyssp, int yytoken)
2177 {
2178 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
2179 YYSIZE_T yysize = yysize0;
2180 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
2181 /* Internationalized format string. */
2182 const char *yyformat = YY_NULLPTR;
2183 /* Arguments of yyformat. */
2184 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
2185 /* Number of reported tokens (one for the "unexpected", one per
2186 "expected"). */
2187 int yycount = 0;
2188
2189 /* There are many possibilities here to consider:
2190 - If this state is a consistent state with a default action, then
2191 the only way this function was invoked is if the default action
2192 is an error action. In that case, don't check for expected
2193 tokens because there are none.
2194 - The only way there can be no lookahead present (in yychar) is if
2195 this state is a consistent state with a default action. Thus,
2196 detecting the absence of a lookahead is sufficient to determine
2197 that there is no unexpected or expected token to report. In that
2198 case, just report a simple "syntax error".
2199 - Don't assume there isn't a lookahead just because this state is a
2200 consistent state with a default action. There might have been a
2201 previous inconsistent state, consistent state with a non-default
2202 action, or user semantic action that manipulated yychar.
2203 - Of course, the expected token list depends on states to have
2204 correct lookahead information, and it depends on the parser not
2205 to perform extra reductions after fetching a lookahead from the
2206 scanner and before detecting a syntax error. Thus, state merging
2207 (from LALR or IELR) and default reductions corrupt the expected
2208 token list. However, the list is correct for canonical LR with
2209 one exception: it will still contain any token that will not be
2210 accepted due to an error action in a later state.
2211 */
2212 if (yytoken != YYEMPTY)
2213 {
2214 int yyn = yypact[*yyssp];
2215 yyarg[yycount++] = yytname[yytoken];
2216 if (!yypact_value_is_default (yyn))
2217 {
2218 /* Start YYX at -YYN if negative to avoid negative indexes in
2219 YYCHECK. In other words, skip the first -YYN actions for
2220 this state because they are default actions. */
2221 int yyxbegin = yyn < 0 ? -yyn : 0;
2222 /* Stay within bounds of both yycheck and yytname. */
2223 int yychecklim = YYLAST - yyn + 1;
2224 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
2225 int yyx;
2226
2227 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
2228 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
2229 && !yytable_value_is_error (yytable[yyx + yyn]))
2230 {
2231 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
2232 {
2233 yycount = 1;
2234 yysize = yysize0;
2235 break;
2236 }
2237 yyarg[yycount++] = yytname[yyx];
2238 {
2239 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
2240 if (! (yysize <= yysize1
2241 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
2242 return 2;
2243 yysize = yysize1;
2244 }
2245 }
2246 }
2247 }
2248
2249 switch (yycount)
2250 {
2251 # define YYCASE_(N, S) \
2252 case N: \
2253 yyformat = S; \
2254 break
2255 YYCASE_(0, YY_("syntax error"));
2256 YYCASE_(1, YY_("syntax error, unexpected %s"));
2257 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
2258 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
2259 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
2260 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
2261 # undef YYCASE_
2262 }
2263
2264 {
2265 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
2266 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
2267 return 2;
2268 yysize = yysize1;
2269 }
2270
2271 if (*yymsg_alloc < yysize)
2272 {
2273 *yymsg_alloc = 2 * yysize;
2274 if (! (yysize <= *yymsg_alloc
2275 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
2276 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
2277 return 1;
2278 }
2279
2280 /* Avoid sprintf, as that infringes on the user's name space.
2281 Don't have undefined behavior even if the translation
2282 produced a string with the wrong number of "%s"s. */
2283 {
2284 char *yyp = *yymsg;
2285 int yyi = 0;
2286 while ((*yyp = *yyformat) != '\0')
2287 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
2288 {
2289 yyp += yytnamerr (yyp, yyarg[yyi++]);
2290 yyformat += 2;
2291 }
2292 else
2293 {
2294 yyp++;
2295 yyformat++;
2296 }
2297 }
2298 return 0;
2299 }
2300 #endif /* YYERROR_VERBOSE */
2301
2302 /*-----------------------------------------------.
2303 | Release the memory associated to this symbol. |
2304 `-----------------------------------------------*/
2305
2306 static void
yydestruct(const char * yymsg,int yytype,YYSTYPE * yyvaluep)2307 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
2308 {
2309 YYUSE (yyvaluep);
2310 if (!yymsg)
2311 yymsg = "Deleting";
2312 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
2313
2314 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2315 YYUSE (yytype);
2316 YY_IGNORE_MAYBE_UNINITIALIZED_END
2317 }
2318
2319
2320
2321
2322 /* The lookahead symbol. */
2323 int yychar;
2324
2325 /* The semantic value of the lookahead symbol. */
2326 YYSTYPE yylval;
2327 /* Number of syntax errors so far. */
2328 int yynerrs;
2329
2330
2331 /*----------.
2332 | yyparse. |
2333 `----------*/
2334
2335 int
yyparse(void)2336 yyparse (void)
2337 {
2338 int yystate;
2339 /* Number of tokens to shift before error messages enabled. */
2340 int yyerrstatus;
2341
2342 /* The stacks and their tools:
2343 'yyss': related to states.
2344 'yyvs': related to semantic values.
2345
2346 Refer to the stacks through separate pointers, to allow yyoverflow
2347 to reallocate them elsewhere. */
2348
2349 /* The state stack. */
2350 yytype_int16 yyssa[YYINITDEPTH];
2351 yytype_int16 *yyss;
2352 yytype_int16 *yyssp;
2353
2354 /* The semantic value stack. */
2355 YYSTYPE yyvsa[YYINITDEPTH];
2356 YYSTYPE *yyvs;
2357 YYSTYPE *yyvsp;
2358
2359 YYSIZE_T yystacksize;
2360
2361 int yyn;
2362 int yyresult;
2363 /* Lookahead token as an internal (translated) token number. */
2364 int yytoken = 0;
2365 /* The variables used to return semantic value and location from the
2366 action routines. */
2367 YYSTYPE yyval;
2368
2369 #if YYERROR_VERBOSE
2370 /* Buffer for error messages, and its allocated size. */
2371 char yymsgbuf[128];
2372 char *yymsg = yymsgbuf;
2373 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
2374 #endif
2375
2376 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
2377
2378 /* The number of symbols on the RHS of the reduced rule.
2379 Keep to zero when no symbol should be popped. */
2380 int yylen = 0;
2381
2382 yyssp = yyss = yyssa;
2383 yyvsp = yyvs = yyvsa;
2384 yystacksize = YYINITDEPTH;
2385
2386 YYDPRINTF ((stderr, "Starting parse\n"));
2387
2388 yystate = 0;
2389 yyerrstatus = 0;
2390 yynerrs = 0;
2391 yychar = YYEMPTY; /* Cause a token to be read. */
2392 goto yysetstate;
2393
2394 /*------------------------------------------------------------.
2395 | yynewstate -- Push a new state, which is found in yystate. |
2396 `------------------------------------------------------------*/
2397 yynewstate:
2398 /* In all cases, when you get here, the value and location stacks
2399 have just been pushed. So pushing a state here evens the stacks. */
2400 yyssp++;
2401
2402 yysetstate:
2403 *yyssp = yystate;
2404
2405 if (yyss + yystacksize - 1 <= yyssp)
2406 {
2407 /* Get the current used size of the three stacks, in elements. */
2408 YYSIZE_T yysize = yyssp - yyss + 1;
2409
2410 #ifdef yyoverflow
2411 {
2412 /* Give user a chance to reallocate the stack. Use copies of
2413 these so that the &'s don't force the real ones into
2414 memory. */
2415 YYSTYPE *yyvs1 = yyvs;
2416 yytype_int16 *yyss1 = yyss;
2417
2418 /* Each stack pointer address is followed by the size of the
2419 data in use in that stack, in bytes. This used to be a
2420 conditional around just the two extra args, but that might
2421 be undefined if yyoverflow is a macro. */
2422 yyoverflow (YY_("memory exhausted"),
2423 &yyss1, yysize * sizeof (*yyssp),
2424 &yyvs1, yysize * sizeof (*yyvsp),
2425 &yystacksize);
2426
2427 yyss = yyss1;
2428 yyvs = yyvs1;
2429 }
2430 #else /* no yyoverflow */
2431 # ifndef YYSTACK_RELOCATE
2432 goto yyexhaustedlab;
2433 # else
2434 /* Extend the stack our own way. */
2435 if (YYMAXDEPTH <= yystacksize)
2436 goto yyexhaustedlab;
2437 yystacksize *= 2;
2438 if (YYMAXDEPTH < yystacksize)
2439 yystacksize = YYMAXDEPTH;
2440
2441 {
2442 yytype_int16 *yyss1 = yyss;
2443 union yyalloc *yyptr =
2444 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2445 if (! yyptr)
2446 goto yyexhaustedlab;
2447 YYSTACK_RELOCATE (yyss_alloc, yyss);
2448 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
2449 # undef YYSTACK_RELOCATE
2450 if (yyss1 != yyssa)
2451 YYSTACK_FREE (yyss1);
2452 }
2453 # endif
2454 #endif /* no yyoverflow */
2455
2456 yyssp = yyss + yysize - 1;
2457 yyvsp = yyvs + yysize - 1;
2458
2459 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2460 (unsigned long int) yystacksize));
2461
2462 if (yyss + yystacksize - 1 <= yyssp)
2463 YYABORT;
2464 }
2465
2466 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2467
2468 if (yystate == YYFINAL)
2469 YYACCEPT;
2470
2471 goto yybackup;
2472
2473 /*-----------.
2474 | yybackup. |
2475 `-----------*/
2476 yybackup:
2477
2478 /* Do appropriate processing given the current state. Read a
2479 lookahead token if we need one and don't already have one. */
2480
2481 /* First try to decide what to do without reference to lookahead token. */
2482 yyn = yypact[yystate];
2483 if (yypact_value_is_default (yyn))
2484 goto yydefault;
2485
2486 /* Not known => get a lookahead token if don't already have one. */
2487
2488 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2489 if (yychar == YYEMPTY)
2490 {
2491 YYDPRINTF ((stderr, "Reading a token: "));
2492 yychar = yylex ();
2493 }
2494
2495 if (yychar <= YYEOF)
2496 {
2497 yychar = yytoken = YYEOF;
2498 YYDPRINTF ((stderr, "Now at end of input.\n"));
2499 }
2500 else
2501 {
2502 yytoken = YYTRANSLATE (yychar);
2503 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2504 }
2505
2506 /* If the proper action on seeing token YYTOKEN is to reduce or to
2507 detect an error, take that action. */
2508 yyn += yytoken;
2509 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2510 goto yydefault;
2511 yyn = yytable[yyn];
2512 if (yyn <= 0)
2513 {
2514 if (yytable_value_is_error (yyn))
2515 goto yyerrlab;
2516 yyn = -yyn;
2517 goto yyreduce;
2518 }
2519
2520 /* Count tokens shifted since error; after three, turn off error
2521 status. */
2522 if (yyerrstatus)
2523 yyerrstatus--;
2524
2525 /* Shift the lookahead token. */
2526 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2527
2528 /* Discard the shifted token. */
2529 yychar = YYEMPTY;
2530
2531 yystate = yyn;
2532 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2533 *++yyvsp = yylval;
2534 YY_IGNORE_MAYBE_UNINITIALIZED_END
2535
2536 goto yynewstate;
2537
2538
2539 /*-----------------------------------------------------------.
2540 | yydefault -- do the default action for the current state. |
2541 `-----------------------------------------------------------*/
2542 yydefault:
2543 yyn = yydefact[yystate];
2544 if (yyn == 0)
2545 goto yyerrlab;
2546 goto yyreduce;
2547
2548
2549 /*-----------------------------.
2550 | yyreduce -- Do a reduction. |
2551 `-----------------------------*/
2552 yyreduce:
2553 /* yyn is the number of a rule to reduce with. */
2554 yylen = yyr2[yyn];
2555
2556 /* If YYLEN is nonzero, implement the default value of the action:
2557 '$$ = $1'.
2558
2559 Otherwise, the following line sets YYVAL to garbage.
2560 This behavior is undocumented and Bison
2561 users should not rely upon it. Assigning to YYVAL
2562 unconditionally makes the parser a bit smaller, and it avoids a
2563 GCC warning that YYVAL may be used uninitialized. */
2564 yyval = yyvsp[1-yylen];
2565
2566
2567 YY_REDUCE_PRINT (yyn);
2568 switch (yyn)
2569 {
2570 case 4:
2571 #line 781 "asm/as1600_real.y" /* yacc.c:1646 */
2572 {
2573 clrexpr();
2574 tempstrlen = 0;
2575 }
2576 #line 2577 "asm/as1600.tab.c" /* yacc.c:1646 */
2577 break;
2578
2579 case 6:
2580 #line 787 "asm/as1600_real.y" /* yacc.c:1646 */
2581 {
2582 clrexpr();
2583 tempstrlen = 0;
2584 yyerrok;
2585 }
2586 #line 2587 "asm/as1600.tab.c" /* yacc.c:1646 */
2587 break;
2588
2589 case 7:
2590 #line 795 "asm/as1600_real.y" /* yacc.c:1646 */
2591 {
2592 endsymbol = (yyvsp[-1].symb);
2593 nextreadact = Nra_end;
2594 }
2595 #line 2596 "asm/as1600.tab.c" /* yacc.c:1646 */
2596 break;
2597
2598 case 8:
2599 #line 800 "asm/as1600_real.y" /* yacc.c:1646 */
2600 {
2601 usr_message(USRERR, (yyvsp[0].strng));
2602 }
2603 #line 2604 "asm/as1600.tab.c" /* yacc.c:1646 */
2604 break;
2605
2606 case 9:
2607 #line 804 "asm/as1600_real.y" /* yacc.c:1646 */
2608 {
2609 usr_message(USRWARN, (yyvsp[0].strng));
2610 }
2611 #line 2612 "asm/as1600.tab.c" /* yacc.c:1646 */
2612 break;
2613
2614 case 10:
2615 #line 808 "asm/as1600_real.y" /* yacc.c:1646 */
2616 {
2617 usr_message(USRSTAT, (yyvsp[0].strng));
2618 }
2619 #line 2620 "asm/as1600.tab.c" /* yacc.c:1646 */
2620 break;
2621
2622 case 11:
2623 #line 812 "asm/as1600_real.y" /* yacc.c:1646 */
2624 {
2625 usr_message(USRCMT, (yyvsp[0].strng));
2626 }
2627 #line 2628 "asm/as1600.tab.c" /* yacc.c:1646 */
2628 break;
2629
2630 case 12:
2631 #line 816 "asm/as1600_real.y" /* yacc.c:1646 */
2632 {
2633 fraerror("Unexpected MACRO or ENDM directive");
2634 }
2635 #line 2636 "asm/as1600.tab.c" /* yacc.c:1646 */
2636 break;
2637
2638 case 13:
2639 #line 820 "asm/as1600_real.y" /* yacc.c:1646 */
2640 {
2641 nextreadact = Nra_end;
2642 }
2643 #line 2644 "asm/as1600.tab.c" /* yacc.c:1646 */
2644 break;
2645
2646 case 14:
2647 #line 824 "asm/as1600_real.y" /* yacc.c:1646 */
2648 {
2649 if(frarptact)
2650 {
2651 fraerror("INCLUDE not permitted inside REPEAT");
2652 } else if(nextfstk >= FILESTKDPTH)
2653 {
2654 fraerror("include file nesting limit exceeded");
2655 }
2656 else
2657 {
2658 infilestk[nextfstk].line = 0;
2659 infilestk[nextfstk].fnm = memoize_string((yyvsp[0].strng));
2660 if( (infilestk[nextfstk].fpt =
2661 path_fopen(as1600_search_path,(yyvsp[0].strng),"r")) ==(LZFILE*)NULL)
2662 {
2663 static char *incl_file = NULL;
2664 static int incl_file_size = 0;
2665 int incl_file_len = strlen((yyvsp[0].strng)) + 80;
2666 if (incl_file_size < incl_file_len)
2667 {
2668 incl_file_size = incl_file_len << 1;
2669 if (incl_file) free(incl_file);
2670 incl_file = (char *)malloc(incl_file_size);
2671 if (!incl_file)
2672 incl_file_size = 0;
2673 }
2674 if (incl_file_size == 0)
2675 fraerror("cannot open include file");
2676 else
2677 {
2678 sprintf(incl_file, "cannot open include file "
2679 "\"%s\"", (yyvsp[0].strng));
2680
2681 fraerror(incl_file);
2682 }
2683 }
2684 else
2685 {
2686 nextreadact = Nra_new;
2687 }
2688 }
2689 }
2690 #line 2691 "asm/as1600.tab.c" /* yacc.c:1646 */
2691 break;
2692
2693 case 15:
2694 #line 867 "asm/as1600_real.y" /* yacc.c:1646 */
2695 {
2696 do_set_equ_list(FALSE, TRUE, 0, (yyvsp[-2].symb), (yyvsp[0].intvec), 0, (yyvsp[0].intvec)->len - 1,
2697 "noncomputable expression for EQU",
2698 "cannot change symbol value with EQU");
2699 intvec_delete((yyvsp[0].intvec));
2700 }
2701 #line 2702 "asm/as1600.tab.c" /* yacc.c:1646 */
2702 break;
2703
2704 case 16:
2705 #line 874 "asm/as1600_real.y" /* yacc.c:1646 */
2706 {
2707 do_set_equ_list(FALSE, TRUE, SFLAG_QUIET, (yyvsp[-2].symb), (yyvsp[0].intvec), 0,
2708 (yyvsp[0].intvec)->len - 1,
2709 "noncomputable expression for QEQU",
2710 "cannot change symbol value with QEQU");
2711 intvec_delete((yyvsp[0].intvec));
2712 }
2713 #line 2714 "asm/as1600.tab.c" /* yacc.c:1646 */
2714 break;
2715
2716 case 17:
2717 #line 882 "asm/as1600_real.y" /* yacc.c:1646 */
2718 {
2719 do_set_equ_list(FALSE, FALSE, 0, (yyvsp[-2].symb), (yyvsp[0].intvec), 0,
2720 (yyvsp[0].intvec)->len - 1,
2721 "noncomputable expression for SET",
2722 "cannot change symbol value with SET");
2723 intvec_delete((yyvsp[0].intvec));
2724 }
2725 #line 2726 "asm/as1600.tab.c" /* yacc.c:1646 */
2726 break;
2727
2728 case 18:
2729 #line 890 "asm/as1600_real.y" /* yacc.c:1646 */
2730 {
2731 do_set_equ_list(FALSE, FALSE, SFLAG_QUIET, (yyvsp[-2].symb), (yyvsp[0].intvec), 0,
2732 (yyvsp[0].intvec)->len - 1,
2733 "noncomputable expression for QSET",
2734 "cannot change symbol value with QSET");
2735 intvec_delete((yyvsp[0].intvec));
2736 }
2737 #line 2738 "asm/as1600.tab.c" /* yacc.c:1646 */
2738 break;
2739
2740 case 19:
2741 #line 898 "asm/as1600_real.y" /* yacc.c:1646 */
2742 {
2743 do_set_equ_list(TRUE, TRUE, 0,
2744 (yyvsp[-2].slidx).sym, (yyvsp[0].intvec), (yyvsp[-2].slidx).first, (yyvsp[-2].slidx).last,
2745 "noncomputable expression for EQU",
2746 "cannot change symbol value with EQU");
2747 intvec_delete((yyvsp[0].intvec));
2748 }
2749 #line 2750 "asm/as1600.tab.c" /* yacc.c:1646 */
2750 break;
2751
2752 case 20:
2753 #line 906 "asm/as1600_real.y" /* yacc.c:1646 */
2754 {
2755 do_set_equ_list(TRUE, TRUE, SFLAG_QUIET,
2756 (yyvsp[-2].slidx).sym, (yyvsp[0].intvec), (yyvsp[-2].slidx).first, (yyvsp[-2].slidx).last,
2757 "noncomputable expression for QEQU",
2758 "cannot change symbol value with QEQU");
2759 intvec_delete((yyvsp[0].intvec));
2760 }
2761 #line 2762 "asm/as1600.tab.c" /* yacc.c:1646 */
2762 break;
2763
2764 case 21:
2765 #line 914 "asm/as1600_real.y" /* yacc.c:1646 */
2766 {
2767 do_set_equ_list(TRUE, FALSE, 0,
2768 (yyvsp[-2].slidx).sym, (yyvsp[0].intvec), (yyvsp[-2].slidx).first, (yyvsp[-2].slidx).last,
2769 "noncomputable expression for SET",
2770 "cannot change symbol value with SET");
2771 intvec_delete((yyvsp[0].intvec));
2772 }
2773 #line 2774 "asm/as1600.tab.c" /* yacc.c:1646 */
2774 break;
2775
2776 case 22:
2777 #line 922 "asm/as1600_real.y" /* yacc.c:1646 */
2778 {
2779 do_set_equ_list(TRUE, FALSE, SFLAG_QUIET,
2780 (yyvsp[-2].slidx).sym, (yyvsp[0].intvec), (yyvsp[-2].slidx).first, (yyvsp[-2].slidx).last,
2781 "noncomputable expression for QSET",
2782 "cannot change symbol value with QSET");
2783 intvec_delete((yyvsp[0].intvec));
2784 }
2785 #line 2786 "asm/as1600.tab.c" /* yacc.c:1646 */
2786 break;
2787
2788 case 23:
2789 #line 930 "asm/as1600_real.y" /* yacc.c:1646 */
2790 {
2791 pevalexpr(0, (yyvsp[0].intv));
2792 if (evalr[0].seg == SSG_ABS)
2793 {
2794 if (evalr[0].value < 0)
2795 {
2796 fraerror("REPEAT count must be >= 0");
2797 frarptpush(0); /* treat it as a 0 count. */
2798 } else
2799 {
2800 frarptpush(frarptskip ? 0 : evalr[0].value);
2801 }
2802 } else
2803 {
2804 fraerror("Computable expression required for REPEAT block");
2805 frarptpush(0); /* treat it as a 0 count. */
2806 }
2807 }
2808 #line 2809 "asm/as1600.tab.c" /* yacc.c:1646 */
2809 break;
2810
2811 case 24:
2812 #line 949 "asm/as1600_real.y" /* yacc.c:1646 */
2813 {
2814 if (frarptact == 0)
2815 {
2816 fraerror("ENDR without REPEAT");
2817 frarptreset(); /* make sure repeat stack is reset. */
2818 } else
2819 {
2820 frarptendr(); /* loop back to most recent REPEAT */
2821 }
2822 }
2823 #line 2824 "asm/as1600.tab.c" /* yacc.c:1646 */
2824 break;
2825
2826 case 25:
2827 #line 960 "asm/as1600_real.y" /* yacc.c:1646 */
2828 {
2829 if (frarptcnt < 0)
2830 fraerror("BRKIF without REPEAT");
2831
2832 pevalexpr(0, (yyvsp[0].intv));
2833 if (evalr[0].seg == SSG_ABS)
2834 {
2835 if (evalr[0].value != 0)
2836 frarptbreak(); /* skip rest of repeat block */
2837 } else
2838 {
2839 fraerror("Computable expression required for BRKIF");
2840 }
2841 }
2842 #line 2843 "asm/as1600.tab.c" /* yacc.c:1646 */
2843 break;
2844
2845 case 26:
2846 #line 975 "asm/as1600_real.y" /* yacc.c:1646 */
2847 {
2848 if (stricmp((yyvsp[0].strng), "ON" )==0) emit_listing_mode(LIST_ON);
2849 else if (stricmp((yyvsp[0].strng), "OFF" )==0) emit_listing_mode(LIST_OFF);
2850 else if (stricmp((yyvsp[0].strng), "CODE")==0) emit_listing_mode(LIST_CODE);
2851 else if (stricmp((yyvsp[0].strng), "PREV")==0) emit_listing_mode(LIST_PREV);
2852 else
2853 {
2854 fraerror("LISTING must be followed by \"ON\", \"OFF\" "
2855 "or \"CODE\"");
2856 }
2857 }
2858 #line 2859 "asm/as1600.tab.c" /* yacc.c:1646 */
2859 break;
2860
2861 case 27:
2862 #line 987 "asm/as1600_real.y" /* yacc.c:1646 */
2863 {
2864 if (stricmp((yyvsp[0].strng), "ON" )==0) emit_listing_mode(LIST_ON);
2865 else if (stricmp((yyvsp[0].strng), "OFF" )==0) emit_listing_mode(LIST_OFF);
2866 else if (stricmp((yyvsp[0].strng), "CODE")==0) emit_listing_mode(LIST_CODE);
2867 else if (stricmp((yyvsp[0].strng), "PREV")==0) emit_listing_mode(LIST_PREV);
2868 else
2869 {
2870 fraerror("LISTING must be followed by \"ON\", \"OFF\" "
2871 "or \"CODE\"");
2872 }
2873
2874 if((yyvsp[-2].symb)->seg == SSG_UNDEF)
2875 {
2876 (yyvsp[-2].symb)->seg = SSG_ABS;
2877 (yyvsp[-2].symb)->value = labelloc;
2878 }
2879 else
2880 fraerror( "multiple definition of label");
2881 }
2882 #line 2883 "asm/as1600.tab.c" /* yacc.c:1646 */
2883 break;
2884
2885 case 28:
2886 #line 1007 "asm/as1600_real.y" /* yacc.c:1646 */
2887 {
2888 if((++ifstkpt) < IFSTKDEPTH)
2889 {
2890 pevalexpr(0, (yyvsp[0].intv));
2891 if(evalr[0].seg == SSG_ABS)
2892 {
2893 if(evalr[0].value != 0)
2894 {
2895 elseifstk[ifstkpt] = If_Skip;
2896 endifstk[ifstkpt] = If_Active;
2897 }
2898 else
2899 {
2900 fraifskip = TRUE;
2901 elseifstk[ifstkpt] = If_Active;
2902 endifstk[ifstkpt] = If_Active;
2903 }
2904 }
2905 else
2906 {
2907 fraifskip = TRUE;
2908 elseifstk[ifstkpt] = If_Active;
2909 endifstk[ifstkpt] = If_Active;
2910 }
2911 expmacstk[ifstkpt] = fraexpmac;
2912 fraexpmac = (yyvsp[-1].intv);
2913 }
2914 else
2915 {
2916 fraerror("IF stack overflow");
2917 }
2918 }
2919 #line 2920 "asm/as1600.tab.c" /* yacc.c:1646 */
2920 break;
2921
2922 case 29:
2923 #line 1041 "asm/as1600_real.y" /* yacc.c:1646 */
2924 {
2925 if(fraifskip)
2926 {
2927 if((++ifstkpt) < IFSTKDEPTH)
2928 {
2929 elseifstk[ifstkpt] = If_Skip;
2930 endifstk[ifstkpt] = If_Skip;
2931 expmacstk[ifstkpt] = fraexpmac;
2932 fraexpmac = (yyvsp[0].intv);
2933 }
2934 else
2935 {
2936 fraerror("IF stack overflow");
2937 }
2938 }
2939 else
2940 {
2941 yyerror("syntax error");
2942 YYERROR;
2943 }
2944 }
2945 #line 2946 "asm/as1600.tab.c" /* yacc.c:1646 */
2946 break;
2947
2948 case 30:
2949 #line 1064 "asm/as1600_real.y" /* yacc.c:1646 */
2950 {
2951 switch(elseifstk[ifstkpt])
2952 {
2953 case If_Active:
2954 fraifskip = FALSE;
2955 break;
2956
2957 case If_Skip:
2958 fraifskip = TRUE;
2959 break;
2960
2961 case If_Err:
2962 fraerror("ELSE with no matching if");
2963 break;
2964 }
2965 }
2966 #line 2967 "asm/as1600.tab.c" /* yacc.c:1646 */
2967 break;
2968
2969 case 31:
2970 #line 1082 "asm/as1600_real.y" /* yacc.c:1646 */
2971 {
2972 fraexpmac = expmacstk[ifstkpt];
2973 switch(endifstk[ifstkpt])
2974 {
2975 case If_Active:
2976 fraifskip = FALSE;
2977 ifstkpt--;
2978 break;
2979
2980 case If_Skip:
2981 fraifskip = TRUE;
2982 ifstkpt--;
2983 break;
2984
2985 case If_Err:
2986 fraerror("ENDI with no matching if");
2987 break;
2988 }
2989 }
2990 #line 2991 "asm/as1600.tab.c" /* yacc.c:1646 */
2991 break;
2992
2993 case 32:
2994 #line 1102 "asm/as1600_real.y" /* yacc.c:1646 */
2995 {
2996 pevalexpr(0, (yyvsp[0].intv));
2997 if(evalr[0].seg == SSG_ABS)
2998 {
2999 locctr = 2 * chkover(labelloc = evalr[0].value, 0);
3000 currseg = 0;
3001 currpag = -1;
3002 currmode = memoize_string("+R");
3003 if((yyvsp[-2].symb)->seg == SSG_UNDEF)
3004 {
3005 (yyvsp[-2].symb)->seg = SSG_ABS;
3006 (yyvsp[-2].symb)->value = labelloc;
3007 }
3008 else
3009 fraerror( "multiple definition of label");
3010
3011 emit_set_equ(evalr[0].value);
3012 }
3013 else
3014 {
3015 fraerror( "noncomputable expression for ORG");
3016 }
3017 }
3018 #line 3019 "asm/as1600.tab.c" /* yacc.c:1646 */
3019 break;
3020
3021 case 33:
3022 #line 1126 "asm/as1600_real.y" /* yacc.c:1646 */
3023 {
3024 pevalexpr(0, (yyvsp[0].intv));
3025 if(evalr[0].seg == SSG_ABS)
3026 {
3027 locctr = 2 * chkover(labelloc = evalr[0].value, 0);
3028 currseg = 0;
3029 currpag = -1;
3030 currmode = memoize_string("+R");
3031 emit_set_equ(evalr[0].value);
3032 }
3033 else
3034 {
3035 fraerror(
3036 "noncomputable expression for ORG");
3037 }
3038 }
3039 #line 3040 "asm/as1600.tab.c" /* yacc.c:1646 */
3040 break;
3041
3042 case 34:
3043 #line 1143 "asm/as1600_real.y" /* yacc.c:1646 */
3044 {
3045 pevalexpr(0, (yyvsp[-2].intv));
3046 pevalexpr(1, (yyvsp[0].intv));
3047 if(evalr[0].seg == SSG_ABS && evalr[1].seg == SSG_ABS)
3048 {
3049 locctr = 2 * chkover(labelloc = evalr[0].value, 0);
3050 currseg = chkover(evalr[1].value, 0) - labelloc;
3051 currpag = -1;
3052 currmode = memoize_string(currseg ? "" : "+R");
3053 if((yyvsp[-4].symb)->seg == SSG_UNDEF)
3054 {
3055 (yyvsp[-4].symb)->seg = SSG_ABS;
3056 (yyvsp[-4].symb)->value = labelloc;
3057 }
3058 else
3059 fraerror( "multiple definition of label");
3060
3061 emit_set_equ(evalr[0].value);
3062 }
3063 else
3064 {
3065 fraerror( "noncomputable expression for ORG");
3066 }
3067 }
3068 #line 3069 "asm/as1600.tab.c" /* yacc.c:1646 */
3069 break;
3070
3071 case 35:
3072 #line 1168 "asm/as1600_real.y" /* yacc.c:1646 */
3073 {
3074 pevalexpr(0, (yyvsp[-2].intv));
3075 pevalexpr(1, (yyvsp[0].intv));
3076 if(evalr[0].seg == SSG_ABS && evalr[1].seg == SSG_ABS)
3077 {
3078 locctr = 2 * chkover(labelloc = evalr[0].value, 0);
3079 currseg = chkover(evalr[1].value, 0) - labelloc;
3080 currpag = -1;
3081 currmode = memoize_string(currseg ? "" : "+R");
3082 emit_set_equ(evalr[0].value);
3083 }
3084 else
3085 {
3086 fraerror(
3087 "noncomputable expression for ORG");
3088 }
3089 }
3090 #line 3091 "asm/as1600.tab.c" /* yacc.c:1646 */
3091 break;
3092
3093 case 36:
3094 #line 1186 "asm/as1600_real.y" /* yacc.c:1646 */
3095 {
3096 pevalexpr(0, (yyvsp[-4].intv));
3097 pevalexpr(1, (yyvsp[-2].intv));
3098 if(evalr[0].seg == SSG_ABS && evalr[1].seg == SSG_ABS)
3099 {
3100 char *s = (yyvsp[0].strng);
3101
3102 locctr = 2 * chkover(labelloc = evalr[0].value, 0);
3103 currseg = chkover(evalr[1].value, 0) - labelloc;
3104 currpag = -1;
3105 currmode = memoize_string(s);
3106
3107 if((yyvsp[-6].symb)->seg == SSG_UNDEF)
3108 {
3109 (yyvsp[-6].symb)->seg = SSG_ABS;
3110 (yyvsp[-6].symb)->value = labelloc;
3111 }
3112 else
3113 fraerror( "multiple definition of label");
3114
3115 emit_set_equ(evalr[0].value);
3116 }
3117 else
3118 {
3119 fraerror( "noncomputable expression for ORG");
3120 }
3121 }
3122 #line 3123 "asm/as1600.tab.c" /* yacc.c:1646 */
3123 break;
3124
3125 case 37:
3126 #line 1214 "asm/as1600_real.y" /* yacc.c:1646 */
3127 {
3128 pevalexpr(0, (yyvsp[-4].intv));
3129 pevalexpr(1, (yyvsp[-2].intv));
3130 if(evalr[0].seg == SSG_ABS && evalr[1].seg == SSG_ABS)
3131 {
3132 char *s = (yyvsp[0].strng);
3133
3134 locctr = 2 * chkover(labelloc = evalr[0].value, 0);
3135 currseg = chkover(evalr[1].value, 0) - labelloc;
3136 currpag = -1;
3137 currmode = memoize_string(s);
3138 emit_set_equ(evalr[0].value);
3139 }
3140 else
3141 {
3142 fraerror("noncomputable expression for ORG");
3143 }
3144 }
3145 #line 3146 "asm/as1600.tab.c" /* yacc.c:1646 */
3146 break;
3147
3148 case 38:
3149 #line 1233 "asm/as1600_real.y" /* yacc.c:1646 */
3150 {
3151 pevalexpr(0, (yyvsp[-2].intv));
3152 pevalexpr(1, (yyvsp[0].intv));
3153 if(evalr[0].seg == SSG_ABS && evalr[1].seg == SSG_ABS)
3154 {
3155 locctr = 2 * chkover(labelloc = evalr[0].value, 0);
3156 currseg = 0;
3157 currpag = evalr[1].value;
3158 currmode = memoize_string("=R");
3159 if((yyvsp[-4].symb)->seg == SSG_UNDEF)
3160 {
3161 (yyvsp[-4].symb)->seg = SSG_ABS;
3162 (yyvsp[-4].symb)->value = labelloc;
3163 }
3164 else
3165 fraerror( "multiple definition of label");
3166
3167 emit_set_equ(evalr[0].value);
3168 }
3169 else
3170 {
3171 fraerror( "noncomputable expression for ORG");
3172 }
3173 }
3174 #line 3175 "asm/as1600.tab.c" /* yacc.c:1646 */
3175 break;
3176
3177 case 39:
3178 #line 1258 "asm/as1600_real.y" /* yacc.c:1646 */
3179 {
3180 pevalexpr(0, (yyvsp[-2].intv));
3181 pevalexpr(1, (yyvsp[0].intv));
3182 if(evalr[0].seg == SSG_ABS && evalr[1].seg == SSG_ABS)
3183 {
3184 locctr = 2 * chkover(labelloc = evalr[0].value, 0);
3185 currseg = 0;
3186 currpag = evalr[1].value;
3187 currmode = memoize_string("=R");
3188 emit_set_equ(evalr[0].value);
3189 }
3190 else
3191 {
3192 fraerror("noncomputable expression for ORG");
3193 }
3194 }
3195 #line 3196 "asm/as1600.tab.c" /* yacc.c:1646 */
3196 break;
3197
3198 case 40:
3199 #line 1275 "asm/as1600_real.y" /* yacc.c:1646 */
3200 {
3201 pevalexpr(0, (yyvsp[-4].intv));
3202 pevalexpr(1, (yyvsp[-2].intv));
3203 if(evalr[0].seg == SSG_ABS && evalr[1].seg == SSG_ABS)
3204 {
3205 locctr = 2 * chkover(labelloc = evalr[0].value, 0);
3206 currseg = 0;
3207 currpag = evalr[1].value;
3208 currmode = memoize_string((yyvsp[0].strng));
3209 if((yyvsp[-6].symb)->seg == SSG_UNDEF)
3210 {
3211 (yyvsp[-6].symb)->seg = SSG_ABS;
3212 (yyvsp[-6].symb)->value = labelloc;
3213 }
3214 else
3215 fraerror( "multiple definition of label");
3216
3217 emit_set_equ(evalr[0].value);
3218 }
3219 else
3220 {
3221 fraerror( "noncomputable expression for ORG");
3222 }
3223 }
3224 #line 3225 "asm/as1600.tab.c" /* yacc.c:1646 */
3225 break;
3226
3227 case 41:
3228 #line 1300 "asm/as1600_real.y" /* yacc.c:1646 */
3229 {
3230 pevalexpr(0, (yyvsp[-4].intv));
3231 pevalexpr(1, (yyvsp[-2].intv));
3232 if(evalr[0].seg == SSG_ABS && evalr[1].seg == SSG_ABS)
3233 {
3234 locctr = 2 * chkover(labelloc = evalr[0].value, 0);
3235 currseg = 0;
3236 currpag = evalr[1].value;
3237 currmode = memoize_string((yyvsp[0].strng));
3238 emit_set_equ(evalr[0].value);
3239 }
3240 else
3241 {
3242 fraerror("noncomputable expression for ORG");
3243 }
3244 }
3245 #line 3246 "asm/as1600.tab.c" /* yacc.c:1646 */
3246 break;
3247
3248 case 42:
3249 #line 1317 "asm/as1600_real.y" /* yacc.c:1646 */
3250 {
3251 pevalexpr(0, (yyvsp[-4].intv));
3252 pevalexpr(1, (yyvsp[-2].intv));
3253 if(evalr[0].seg == SSG_ABS && evalr[1].seg == SSG_ABS)
3254 {
3255 const char *s = memoize_string((yyvsp[0].strng));
3256 chkover(evalr[0].value, 0);
3257 chkover(evalr[1].value, 0);
3258 emit_location(0, -1, labelloc, TYPE_HOLE, s);
3259 emit_mark_with_mode(evalr[0].value, evalr[1].value, s);
3260 emit_location(currseg, currpag, labelloc, TYPE_HOLE,
3261 currmode);
3262 }
3263 else
3264 {
3265 fraerror("noncomputable expression for MEMATTR");
3266 }
3267 }
3268 #line 3269 "asm/as1600.tab.c" /* yacc.c:1646 */
3269 break;
3270
3271 case 43:
3272 #line 1336 "asm/as1600_real.y" /* yacc.c:1646 */
3273 {
3274 const char *var = memoize_string((yyvsp[-2].strng));
3275 const char *value = memoize_string((yyvsp[0].strng));
3276 emit_cfgvar_str(var, value);
3277 }
3278 #line 3279 "asm/as1600.tab.c" /* yacc.c:1646 */
3279 break;
3280
3281 case 44:
3282 #line 1342 "asm/as1600_real.y" /* yacc.c:1646 */
3283 {
3284 pevalexpr(0, (yyvsp[0].intv));
3285 if(evalr[0].seg == SSG_ABS)
3286 {
3287 const char *var = memoize_string((yyvsp[-2].strng));
3288 emit_cfgvar_int(var, evalr[0].value);
3289 }
3290 else
3291 {
3292 fraerror("noncomputable expression for CFGVAR");
3293 }
3294 }
3295 #line 3296 "asm/as1600.tab.c" /* yacc.c:1646 */
3296 break;
3297
3298 case 45:
3299 #line 1355 "asm/as1600_real.y" /* yacc.c:1646 */
3300 {
3301 /* set the current source file override and line number */
3302 pevalexpr(0, (yyvsp[0].intv));
3303 if ( evalr[0].seg == SSG_ABS )
3304 {
3305 if ( strlen( (yyvsp[-2].strng) ) == 0 || evalr[0].value < 1 )
3306 {
3307 emit_srcfile_override( NULL, 0 );
3308 } else
3309 {
3310 emit_srcfile_override( memoize_string( (yyvsp[-2].strng) ),
3311 evalr[0].value );
3312 }
3313 }
3314 else
3315 {
3316 fraerror("noncomputable expression for SRCFILE");
3317 }
3318 }
3319 #line 3320 "asm/as1600.tab.c" /* yacc.c:1646 */
3320 break;
3321
3322 case 46:
3323 #line 1375 "asm/as1600_real.y" /* yacc.c:1646 */
3324 {
3325 pevalexpr(0, (yyvsp[-4].intv)); /* Hex per line w/ source */
3326 pevalexpr(1, (yyvsp[-2].intv)); /* Hex per line w/out source */
3327 pevalexpr(2, (yyvsp[0].intv)); /* Starting column of source */
3328 if ( evalr[0].seg != SSG_ABS || evalr[1].seg != SSG_ABS ||
3329 evalr[2].seg != SSG_ABS )
3330 {
3331 fraerror("noncomputable expression for LISTCOL");
3332 } else
3333 {
3334 const int new_hex_source = evalr[0].value;
3335 const int new_hex_no_src = evalr[1].value;
3336 const int new_source_ofs = evalr[2].value;
3337 const int new_source_ofs_min = 7 + 5*new_hex_source;
3338
3339 if (new_hex_source < 1 || new_hex_source > 256 ||
3340 new_hex_no_src < 1 || new_hex_no_src > 256 ||
3341 new_source_ofs < 1 || new_source_ofs > 2048)
3342 {
3343 fraerror("value out of range value for LISTCOL");
3344 } else
3345 {
3346 if (new_source_ofs < new_source_ofs_min)
3347 {
3348 fraerror("source column too small compared to "
3349 "hex-per-source-line for LISTCOL");
3350 } else
3351 {
3352 emit_listing_column(new_hex_source,
3353 new_hex_no_src,
3354 new_source_ofs);
3355 }
3356 }
3357 }
3358 }
3359 #line 3360 "asm/as1600.tab.c" /* yacc.c:1646 */
3360 break;
3361
3362 case 47:
3363 #line 1411 "asm/as1600_real.y" /* yacc.c:1646 */
3364 {
3365 pevalexpr(0, (yyvsp[0].intv));
3366 if ( evalr[0].seg != SSG_ABS )
3367 {
3368 fraerror("noncomputable expression for ERR_IF_OVERWITTEN");
3369 } else
3370 {
3371 emit_err_if_overwritten(evalr[0].value != 0);
3372 }
3373 }
3374 #line 3375 "asm/as1600.tab.c" /* yacc.c:1646 */
3375 break;
3376
3377 case 48:
3378 #line 1422 "asm/as1600_real.y" /* yacc.c:1646 */
3379 {
3380 pevalexpr(0, (yyvsp[0].intv));
3381 if ( evalr[0].seg != SSG_ABS )
3382 {
3383 fraerror("noncomputable expression for FORCE_OVERWRITE");
3384 } else
3385 {
3386 emit_force_overwrite(evalr[0].value != 0);
3387 }
3388 }
3389 #line 3390 "asm/as1600.tab.c" /* yacc.c:1646 */
3390 break;
3391
3392 case 49:
3393 #line 1433 "asm/as1600_real.y" /* yacc.c:1646 */
3394 {
3395 if((yyvsp[-1].symb)->seg == SSG_UNDEF)
3396 {
3397 (yyvsp[-1].symb)->seg = SSG_EQU;
3398 if( ((yyvsp[-1].symb)->value = chtcreate()) <= 0)
3399 {
3400 fraerror("cannot create character translation table");
3401 }
3402 emit_set_equ((yyvsp[-1].symb)->value);
3403 }
3404 else
3405 {
3406 fraerror("multiple definition of label");
3407 }
3408 }
3409 #line 3410 "asm/as1600.tab.c" /* yacc.c:1646 */
3410 break;
3411
3412 case 50:
3413 #line 1449 "asm/as1600_real.y" /* yacc.c:1646 */
3414 {
3415 chtcpoint = (int *) NULL;
3416 emit_set_equ(0L);
3417 }
3418 #line 3419 "asm/as1600.tab.c" /* yacc.c:1646 */
3419 break;
3420
3421 case 51:
3422 #line 1454 "asm/as1600_real.y" /* yacc.c:1646 */
3423 {
3424 pevalexpr(0, (yyvsp[0].intv));
3425 if( evalr[0].seg == SSG_ABS)
3426 {
3427 if( evalr[0].value == 0)
3428 {
3429 chtcpoint = (int *)NULL;
3430 emit_set_equ(0L);
3431 }
3432 else if(evalr[0].value < chtnxalph)
3433 {
3434 chtcpoint = chtatab[evalr[0].value];
3435 emit_set_equ(evalr[0].value);
3436 }
3437 else
3438 {
3439 fraerror("nonexistent character translation table");
3440 }
3441 }
3442 else
3443 {
3444 fraerror("noncomputable expression");
3445 }
3446 }
3447 #line 3448 "asm/as1600.tab.c" /* yacc.c:1646 */
3448 break;
3449
3450 case 52:
3451 #line 1479 "asm/as1600_real.y" /* yacc.c:1646 */
3452 {
3453 chardef((yyvsp[-2].strng), (yyvsp[0].intvec));
3454 intvec_delete((yyvsp[0].intvec));
3455 }
3456 #line 3457 "asm/as1600.tab.c" /* yacc.c:1646 */
3457 break;
3458
3459 case 53:
3460 #line 1484 "asm/as1600_real.y" /* yacc.c:1646 */
3461 {
3462 char st[2] = { (yyvsp[-2].longv), 0 };
3463 chardef(st, (yyvsp[0].intvec));
3464 intvec_delete((yyvsp[0].intvec));
3465 }
3466 #line 3467 "asm/as1600.tab.c" /* yacc.c:1646 */
3467 break;
3468
3469 case 54:
3470 #line 1490 "asm/as1600_real.y" /* yacc.c:1646 */
3471 {
3472 if((yyvsp[0].symb)->seg == SSG_UNDEF)
3473 {
3474 (yyvsp[0].symb)->seg = SSG_ABS;
3475 (yyvsp[0].symb)->value = chkover(labelloc, 0);
3476 emit_set_equ(labelloc);
3477
3478 }
3479 else
3480 fraerror("multiple definition of label");
3481 }
3482 #line 3483 "asm/as1600.tab.c" /* yacc.c:1646 */
3483 break;
3484
3485 case 56:
3486 #line 1504 "asm/as1600_real.y" /* yacc.c:1646 */
3487 { (yyval.intv) = 1; }
3488 #line 3489 "asm/as1600.tab.c" /* yacc.c:1646 */
3489 break;
3490
3491 case 57:
3492 #line 1505 "asm/as1600_real.y" /* yacc.c:1646 */
3493 { (yyval.intv) = 0; }
3494 #line 3495 "asm/as1600.tab.c" /* yacc.c:1646 */
3495 break;
3496
3497 case 58:
3498 #line 1509 "asm/as1600_real.y" /* yacc.c:1646 */
3499 {
3500 if (sdbd)
3501 frawarn("label between SDBD and instruction");
3502
3503 if((yyvsp[-1].symb)->seg == SSG_UNDEF)
3504 {
3505 (yyvsp[-1].symb)->seg = SSG_ABS;
3506 (yyvsp[-1].symb)->value = chkover(labelloc, 0);
3507 }
3508 else
3509 fraerror("multiple definition of label");
3510
3511 if (locctr & 1) fraerror("internal error: PC misaligned.");
3512
3513 labelloc = locctr >> 1;
3514
3515 sdbd = is_sdbd;
3516 is_sdbd = 0;
3517 first = 0;
3518 }
3519 #line 3520 "asm/as1600.tab.c" /* yacc.c:1646 */
3520 break;
3521
3522 case 59:
3523 #line 1530 "asm/as1600_real.y" /* yacc.c:1646 */
3524 {
3525 if (locctr & 1) fraerror("internal error: PC misaligned.");
3526 labelloc = locctr >> 1;
3527
3528 sdbd = is_sdbd;
3529 is_sdbd = 0;
3530 first = 0;
3531 }
3532 #line 3533 "asm/as1600.tab.c" /* yacc.c:1646 */
3533 break;
3534
3535 case 60:
3536 #line 1541 "asm/as1600_real.y" /* yacc.c:1646 */
3537 {
3538 emit_location(currseg, currpag, labelloc, TYPE_DATA, currmode);
3539 evalr[2].seg = SSG_ABS;
3540 evalr[2].value = 8;
3541 for( satsub = 0; satsub < (yyvsp[0].intvec)->len; satsub++)
3542 {
3543 pevalexpr(1, (yyvsp[0].intvec)->data[satsub]);
3544 locctr += geninstr(genbdef);
3545 }
3546 chkover( locctr >> 1 , 1);
3547 intvec_delete((yyvsp[0].intvec));
3548 }
3549 #line 3550 "asm/as1600.tab.c" /* yacc.c:1646 */
3550 break;
3551
3552 case 61:
3553 #line 1554 "asm/as1600_real.y" /* yacc.c:1646 */
3554 {
3555 emit_location(currseg, currpag, labelloc, TYPE_DATA, currmode);
3556 evalr[2].seg = SSG_ABS;
3557 evalr[2].value = romw;
3558 for( satsub = 0; satsub < (yyvsp[0].intvec)->len; satsub++)
3559 {
3560 pevalexpr(1, (yyvsp[0].intvec)->data[satsub]);
3561 locctr += geninstr(genbdef);
3562 }
3563 chkover( locctr >> 1 , 1);
3564 intvec_delete((yyvsp[0].intvec));
3565 }
3566 #line 3567 "asm/as1600.tab.c" /* yacc.c:1646 */
3567 break;
3568
3569 case 62:
3570 #line 1568 "asm/as1600_real.y" /* yacc.c:1646 */
3571 {
3572 emit_location(currseg, currpag, labelloc, TYPE_STRING, currmode);
3573 evalr[2].seg = SSG_ABS;
3574 evalr[2].value = romw;
3575 for( satsub = 0; satsub < (yyvsp[0].intvec)->len; satsub++)
3576 {
3577 pevalexpr(1, (yyvsp[0].intvec)->data[satsub]);
3578 locctr += geninstr(genbdef);
3579 }
3580 chkover( locctr >> 1 , 1);
3581 intvec_delete((yyvsp[0].intvec));
3582 }
3583 #line 3584 "asm/as1600.tab.c" /* yacc.c:1646 */
3584 break;
3585
3586 case 63:
3587 #line 1581 "asm/as1600_real.y" /* yacc.c:1646 */
3588 {
3589 emit_location(currseg, currpag, labelloc,
3590 TYPE_DBDATA|TYPE_DATA, currmode);
3591 for( satsub = 0; satsub < (yyvsp[0].intvec)->len; satsub++)
3592 {
3593 pevalexpr(1, (yyvsp[0].intvec)->data[satsub]);
3594 locctr += geninstr(genwdef);
3595 }
3596 chkover( locctr >> 1 , 1);
3597 intvec_delete((yyvsp[0].intvec));
3598 }
3599 #line 3600 "asm/as1600.tab.c" /* yacc.c:1646 */
3600 break;
3601
3602 case 64:
3603 #line 1593 "asm/as1600_real.y" /* yacc.c:1646 */
3604 {
3605 pevalexpr(0, (yyvsp[0].intv));
3606 if(evalr[0].seg == SSG_ABS)
3607 {
3608 locctr = 2 * chkover(labelloc + evalr[0].value, 1);
3609 emit_set_equ(labelloc);
3610 emit_location(currseg, currpag, labelloc, TYPE_HOLE,
3611 currmode);
3612 emit_reserve(labelloc + evalr[0].value - 1);
3613 }
3614 else
3615 {
3616 fraerror("noncomputable expression for RMB");
3617 }
3618 }
3619 #line 3620 "asm/as1600.tab.c" /* yacc.c:1646 */
3620 break;
3621
3622 case 69:
3623 #line 1619 "asm/as1600_real.y" /* yacc.c:1646 */
3624 {
3625 intvec_push((yyvsp[-2].intvec), (yyvsp[0].intv));
3626 (yyval.intvec) = (yyvsp[-2].intvec);
3627 }
3628 #line 3629 "asm/as1600.tab.c" /* yacc.c:1646 */
3629 break;
3630
3631 case 70:
3632 #line 1624 "asm/as1600_real.y" /* yacc.c:1646 */
3633 {
3634 char *s = (yyvsp[0].strng);
3635 int accval = 0;
3636
3637 while (*s)
3638 {
3639 accval = chtran(&s);
3640 intvec_push((yyvsp[-2].intvec),
3641 exprnode(PCCASE_CONS,0,IGP_CONSTANT,0,accval,SYMNULL));
3642 }
3643 (yyval.intvec) = (yyvsp[-2].intvec);
3644 }
3645 #line 3646 "asm/as1600.tab.c" /* yacc.c:1646 */
3646 break;
3647
3648 case 71:
3649 #line 1637 "asm/as1600_real.y" /* yacc.c:1646 */
3650 {
3651 intvec_t *const RESTRICT iv = intvec_new();
3652 intvec_push(iv, (yyvsp[0].intv));
3653 (yyval.intvec) = iv;
3654 }
3655 #line 3656 "asm/as1600.tab.c" /* yacc.c:1646 */
3656 break;
3657
3658 case 72:
3659 #line 1643 "asm/as1600_real.y" /* yacc.c:1646 */
3660 {
3661 intvec_t *const RESTRICT iv = intvec_new();
3662 char *s = (yyvsp[0].strng);
3663 int accval = 0;
3664
3665 while (*s)
3666 {
3667 accval = chtran(&s);
3668 intvec_push(iv,
3669 exprnode(PCCASE_CONS,0,IGP_CONSTANT,0,accval,SYMNULL));
3670 }
3671 (yyval.intvec) = iv;
3672 }
3673 #line 3674 "asm/as1600.tab.c" /* yacc.c:1646 */
3674 break;
3675
3676 case 73:
3677 #line 1657 "asm/as1600_real.y" /* yacc.c:1646 */
3678 {
3679 const struct tm *t = (yyvsp[-3].longv) ? &asm_time_gmt : &asm_time_local;
3680 (yyval.intvec) = unpack_time_exprs(t, &asm_time_gmt, (yyvsp[-1].strng));
3681 }
3682 #line 3683 "asm/as1600.tab.c" /* yacc.c:1646 */
3683 break;
3684
3685 case 74:
3686 #line 1662 "asm/as1600_real.y" /* yacc.c:1646 */
3687 {
3688 intvec_concat((yyvsp[-2].intvec), (yyvsp[0].intvec));
3689 intvec_delete((yyvsp[0].intvec));
3690 (yyval.intvec) = (yyvsp[-2].intvec);
3691 }
3692 #line 3693 "asm/as1600.tab.c" /* yacc.c:1646 */
3693 break;
3694
3695 case 75:
3696 #line 1668 "asm/as1600_real.y" /* yacc.c:1646 */
3697 {
3698 (yyval.intvec) = (yyvsp[0].intvec);
3699 }
3700 #line 3701 "asm/as1600.tab.c" /* yacc.c:1646 */
3701 break;
3702
3703 case 77:
3704 #line 1675 "asm/as1600_real.y" /* yacc.c:1646 */
3705 {
3706 char *s = &tempstr[tempstrlen];
3707
3708 if (chtcpoint != NULL)
3709 {
3710 frawarn("Stringifying expression list while character "
3711 "translation active");
3712 }
3713
3714 tempstrlen += (yyvsp[-1].intvec)->len + 1;
3715
3716 if (tempstrlen > MAXTEMPSTR)
3717 {
3718 fraerror("Temporary string buffer overflow");
3719 (yyval.strng) = "";
3720 } else
3721 {
3722 int i;
3723 (yyval.strng) = s;
3724 for (i = 0; i < (yyvsp[-1].intvec)->len; i++)
3725 {
3726 pevalexpr(0, (yyvsp[-1].intvec)->data[i]);
3727
3728 if (evalr[0].seg == SSG_ABS)
3729 *s++ = evalr[0].value;
3730 else
3731 *s++ = '?';
3732 }
3733 *s = 0;
3734 }
3735 intvec_delete((yyvsp[-1].intvec));
3736 }
3737 #line 3738 "asm/as1600.tab.c" /* yacc.c:1646 */
3738 break;
3739
3740 case 78:
3741 #line 1708 "asm/as1600_real.y" /* yacc.c:1646 */
3742 {
3743 char *s = &tempstr[tempstrlen];
3744
3745 if (tempstrlen + 32 > MAXTEMPSTR)
3746 {
3747 fraerror("Temporary string buffer overflow");
3748 (yyval.strng) = "";
3749 } else
3750 {
3751 (yyval.strng) = s;
3752 pevalexpr(0, (yyvsp[-1].intv));
3753
3754 if (evalr[0].seg == SSG_ABS)
3755 sprintf(s, "%d", (int)evalr[0].value);
3756 else
3757 {
3758 s[0] = '?';
3759 s[1] = 0;
3760 }
3761 tempstrlen += strlen(s) + 1;
3762 }
3763 }
3764 #line 3765 "asm/as1600.tab.c" /* yacc.c:1646 */
3765 break;
3766
3767 case 79:
3768 #line 1731 "asm/as1600_real.y" /* yacc.c:1646 */
3769 {
3770 char *s = &tempstr[tempstrlen];
3771
3772 if (tempstrlen + 5 > MAXTEMPSTR)
3773 {
3774 fraerror("Temporary string buffer overflow");
3775 (yyval.strng) = "";
3776 } else
3777 {
3778 (yyval.strng) = s;
3779 pevalexpr(0, (yyvsp[-1].intv));
3780
3781 if (evalr[0].seg == SSG_ABS)
3782 sprintf(s, "%4.4X",
3783 (unsigned int)(0xFFFF & evalr[0].value));
3784 else
3785 {
3786 s[0] = '?';
3787 s[1] = '?';
3788 s[2] = '?';
3789 s[3] = '?';
3790 s[4] = 0;
3791 }
3792 tempstrlen += 5;
3793 }
3794 }
3795 #line 3796 "asm/as1600.tab.c" /* yacc.c:1646 */
3796 break;
3797
3798 case 80:
3799 #line 1758 "asm/as1600_real.y" /* yacc.c:1646 */
3800 {
3801 char *s = &tempstr[tempstrlen];
3802
3803 if (tempstrlen + 5 > MAXTEMPSTR)
3804 {
3805 fraerror("Temporary string buffer overflow");
3806 (yyval.strng) = "";
3807 } else
3808 {
3809 (yyval.strng) = s;
3810 pevalexpr(0, (yyvsp[-1].intv));
3811
3812 if (evalr[0].seg == SSG_ABS)
3813 sprintf(s, "%8.8X",
3814 (unsigned int)(0xFFFFFFFF & evalr[0].value));
3815 else
3816 {
3817 s[0] = '?';
3818 s[1] = '?';
3819 s[2] = '?';
3820 s[3] = '?';
3821 s[4] = '?';
3822 s[5] = '?';
3823 s[6] = '?';
3824 s[7] = '?';
3825 s[8] = 0;
3826 }
3827 tempstrlen += 5;
3828 }
3829 }
3830 #line 3831 "asm/as1600.tab.c" /* yacc.c:1646 */
3831 break;
3832
3833 case 81:
3834 #line 1789 "asm/as1600_real.y" /* yacc.c:1646 */
3835 {
3836 const struct tm *t = (yyvsp[-3].longv) ? &asm_time_gmt : &asm_time_local;
3837 char *const bufbeg = &tempstr[tempstrlen];
3838 const int avail = MAXTEMPSTR - tempstrlen;
3839 const int len = format_time_string(t, &asm_time_gmt,
3840 (yyvsp[-1].strng), bufbeg, avail);
3841 tempstrlen += len;
3842 (yyval.strng) = bufbeg;
3843 }
3844 #line 3845 "asm/as1600.tab.c" /* yacc.c:1646 */
3845 break;
3846
3847 case 82:
3848 #line 1804 "asm/as1600_real.y" /* yacc.c:1646 */
3849 {
3850 if (proc && struct_locctr != -1)
3851 fraerror("PROC cannot nest inside STRUCT.");
3852 else if (proc && proc_stk_depth == MAX_PROC_STK)
3853 fraerror("PROC nesting limit reached.");
3854 else if (((yyvsp[-1].symb)->flags & SFLAG_ARRAY) != 0)
3855 fraerror("array element can not be defined by PROC");
3856 else if ((yyvsp[-1].symb)->seg != SSG_UNDEF)
3857 fraerror("multiple definition of label");
3858 else
3859 {
3860 if (proc)
3861 {
3862 char *old_proc = proc;
3863 int old_proc_len = proc_len;
3864 proc_stk[proc_stk_depth++] = proc;
3865 proc_len = strlen(proc) + strlen((yyvsp[-1].symb)->symstr) + 1;
3866 proc = (char *)malloc(proc_len + 1);
3867 strcpy(proc, old_proc);
3868 proc[old_proc_len] = '.';
3869 strcpy(proc + old_proc_len + 1, (yyvsp[-1].symb)->symstr);
3870 } else
3871 {
3872 proc = strdup((yyvsp[-1].symb)->symstr);
3873 proc_len = strlen(proc);
3874 }
3875
3876 (yyvsp[-1].symb)->seg = SSG_ABS;
3877 (yyvsp[-1].symb)->value = labelloc;
3878 emit_set_equ(labelloc);
3879 }
3880 }
3881 #line 3882 "asm/as1600.tab.c" /* yacc.c:1646 */
3882 break;
3883
3884 case 83:
3885 #line 1838 "asm/as1600_real.y" /* yacc.c:1646 */
3886 {
3887 if (!proc || struct_locctr != -1)
3888 fraerror("ENDP w/out PROC.");
3889
3890 free(proc);
3891
3892 if (proc_stk_depth > 0)
3893 {
3894 proc = proc_stk[--proc_stk_depth];
3895 proc_len = strlen(proc);
3896 } else
3897 {
3898 proc = NULL;
3899 proc_len = 0;
3900 }
3901 }
3902 #line 3903 "asm/as1600.tab.c" /* yacc.c:1646 */
3903 break;
3904
3905 case 84:
3906 #line 1859 "asm/as1600_real.y" /* yacc.c:1646 */
3907 {
3908 pevalexpr(0, (yyvsp[0].intv));
3909
3910 if (proc)
3911 fraerror("STRUCT can not nest inside other STRUCTs or PROCs.");
3912 else if (((yyvsp[-2].symb)->flags & SFLAG_ARRAY) != 0)
3913 fraerror("array element can not be defined by STRUCT");
3914 else if (evalr[0].seg != SSG_ABS)
3915 fraerror( "noncomputable expression for ORG");
3916 else if ((yyvsp[-2].symb)->seg != SSG_UNDEF)
3917 fraerror( "multiple definition of label");
3918 else
3919 {
3920 proc = strdup((yyvsp[-2].symb)->symstr);
3921 proc_len = strlen(proc);
3922 struct_locctr = locctr;
3923
3924 locctr = 2 * chkover(labelloc = evalr[0].value, 0);
3925
3926 (yyvsp[-2].symb)->seg = SSG_ABS;
3927 (yyvsp[-2].symb)->value = labelloc;
3928
3929 emit_set_equ(evalr[0].value);
3930 }
3931 }
3932 #line 3933 "asm/as1600.tab.c" /* yacc.c:1646 */
3933 break;
3934
3935 case 85:
3936 #line 1886 "asm/as1600_real.y" /* yacc.c:1646 */
3937 {
3938 if (!proc || struct_locctr == -1)
3939 fraerror("ENDS w/out STRUCT.");
3940 else
3941 {
3942 free(proc);
3943 proc = NULL;
3944 proc_len = 0;
3945 locctr = struct_locctr;
3946 struct_locctr = -1;
3947 }
3948 }
3949 #line 3950 "asm/as1600.tab.c" /* yacc.c:1646 */
3950 break;
3951
3952 case 86:
3953 #line 1903 "asm/as1600_real.y" /* yacc.c:1646 */
3954 {
3955 emit_location(currseg, currpag, labelloc, TYPE_HOLE, currmode);
3956 pevalexpr(0, (yyvsp[0].intv));
3957 if(evalr[0].seg == SSG_ABS)
3958 {
3959 romw = evalr[0].value;
3960
3961 if (romw < 8 || romw > 16)
3962 fraerror("ROMWIDTH out of range");
3963
3964 romm = 0xFFFFU >> (16 - romw);
3965 }
3966 else
3967 {
3968 fraerror("noncomputable expression for ROMWIDTH");
3969 }
3970
3971 if (!first)
3972 {
3973 frawarn("Code appears before ROMW directive.");
3974 }
3975
3976 fwd_sdbd = 0;
3977 }
3978 #line 3979 "asm/as1600.tab.c" /* yacc.c:1646 */
3979 break;
3980
3981 case 87:
3982 #line 1928 "asm/as1600_real.y" /* yacc.c:1646 */
3983 {
3984 emit_location(currseg, currpag, labelloc, TYPE_HOLE, currmode);
3985 pevalexpr(0, (yyvsp[-2].intv));
3986 pevalexpr(1, (yyvsp[0].intv));
3987 if(evalr[0].seg == SSG_ABS)
3988 {
3989 romw = evalr[0].value;
3990
3991 if (romw < 8 || romw > 16)
3992 fraerror("ROMWIDTH out of range");
3993
3994 romm = 0xFFFFU >> (16 - romw);
3995 }
3996 else
3997 fraerror("noncomputable expression for ROMWIDTH");
3998
3999 if (!first)
4000 {
4001 frawarn("Code appears before ROMW directive.");
4002 }
4003
4004 if (evalr[1].seg == SSG_ABS)
4005 {
4006 fwd_sdbd = evalr[1].value;
4007
4008 if (fwd_sdbd > 1 || fwd_sdbd < 0)
4009 fraerror("SDBD mode flag must be 0 or 1.");
4010 } else
4011 fraerror("noncomputable expression for ROMWIDTH");
4012
4013 }
4014 #line 4015 "asm/as1600.tab.c" /* yacc.c:1646 */
4015 break;
4016
4017 case 88:
4018 #line 1965 "asm/as1600_real.y" /* yacc.c:1646 */
4019 {
4020 if (sdbd)
4021 frawarn("Two SDBDs in a row.");
4022
4023 emit_location(currseg, currpag, labelloc, TYPE_CODE, currmode);
4024 locctr += geninstr(findgen((yyvsp[0].intv), ST_IMP, 0));
4025 chkover(locctr >> 1, 1);
4026 is_sdbd = SDBD;
4027 }
4028 #line 4029 "asm/as1600.tab.c" /* yacc.c:1646 */
4029 break;
4030
4031 case 89:
4032 #line 1980 "asm/as1600_real.y" /* yacc.c:1646 */
4033 {
4034 /*unsigned rel_addr = labelloc + 2;*/
4035 /*int dir;*/
4036
4037 SDBD_CHK
4038
4039 emit_location(currseg, currpag, labelloc, TYPE_CODE, currmode);
4040 pevalexpr(1, (yyvsp[0].intv));
4041
4042 evalr[3].seg = SSG_ABS;
4043 evalr[3].value = romw;
4044
4045 locctr += geninstr(findgen((yyvsp[-1].intv), ST_EXP, sdbd));
4046 chkover(locctr >> 1, 1);
4047 }
4048 #line 4049 "asm/as1600.tab.c" /* yacc.c:1646 */
4049 break;
4050
4051 case 90:
4052 #line 1997 "asm/as1600_real.y" /* yacc.c:1646 */
4053 {
4054 /*unsigned rel_addr = labelloc + 2;*/
4055 /*int dir;*/
4056
4057 SDBD_CHK
4058
4059 emit_location(currseg, currpag, labelloc, TYPE_CODE, currmode);
4060 pevalexpr(1, (yyvsp[-2].intv));
4061 pevalexpr(4, (yyvsp[0].intv));
4062
4063 if (evalr[4].seg != SSG_ABS)
4064 fraerror("Must have constant expr for BEXT condition");
4065
4066 evalr[3].seg = SSG_ABS;
4067 evalr[3].value = romw;
4068
4069 locctr += geninstr(findgen((yyvsp[-3].intv), ST_EXPEXP, sdbd));
4070 chkover(locctr >> 1, 1);
4071 }
4072 #line 4073 "asm/as1600.tab.c" /* yacc.c:1646 */
4073 break;
4074
4075 case 91:
4076 #line 2023 "asm/as1600_real.y" /* yacc.c:1646 */
4077 {
4078 SDBD_CHK
4079 emit_location(currseg, currpag, labelloc, TYPE_CODE, currmode);
4080 locctr += geninstr(findgen((yyvsp[0].intv), ST_IMP, sdbd));
4081 chkover(locctr >> 1, 1);
4082 }
4083 #line 4084 "asm/as1600.tab.c" /* yacc.c:1646 */
4084 break;
4085
4086 case 92:
4087 #line 2035 "asm/as1600_real.y" /* yacc.c:1646 */
4088 {
4089 SDBD_CHK
4090 emit_location(currseg, currpag, labelloc, TYPE_CODE, currmode);
4091 pevalexpr(1, (yyvsp[0].intv));
4092 locctr += geninstr(findgen((yyvsp[-1].intv), ST_EXP, sdbd));
4093 chkover(locctr >> 1, 1);
4094 }
4095 #line 4096 "asm/as1600.tab.c" /* yacc.c:1646 */
4096 break;
4097
4098 case 93:
4099 #line 2049 "asm/as1600_real.y" /* yacc.c:1646 */
4100 {
4101 SDBD_CHK
4102 emit_location(currseg, currpag, labelloc, TYPE_CODE, currmode);
4103 evalr[1].value = (yyvsp[-2].intv);
4104 pevalexpr(2, (yyvsp[0].intv));
4105 evalr[3].seg = SSG_ABS;
4106 evalr[3].value = romw;
4107 locctr += geninstr(findgen((yyvsp[-3].intv), ST_REGEXP, reg_type[(yyvsp[-2].intv)]|sdbd));
4108 chkover(locctr >> 1, 1);
4109 }
4110 #line 4111 "asm/as1600.tab.c" /* yacc.c:1646 */
4111 break;
4112
4113 case 94:
4114 #line 2065 "asm/as1600_real.y" /* yacc.c:1646 */
4115 {
4116 SDBD_CHK
4117 emit_location(currseg, currpag, labelloc, TYPE_CODE, currmode);
4118 evalr[1].value = (yyvsp[-3].intv);
4119 evalr[3].seg = SSG_ABS;
4120 evalr[3].value = romw;
4121 pevalexpr(2, (yyvsp[0].intv));
4122 locctr += geninstr(findgen((yyvsp[-4].intv), ST_REGCEX, reg_type[(yyvsp[-3].intv)]|sdbd));
4123 chkover(locctr >> 1, 1);
4124 }
4125 #line 4126 "asm/as1600.tab.c" /* yacc.c:1646 */
4126 break;
4127
4128 case 95:
4129 #line 2081 "asm/as1600_real.y" /* yacc.c:1646 */
4130 {
4131 SDBD_CHK
4132 emit_location(currseg, currpag, labelloc, TYPE_CODE, currmode);
4133 pevalexpr(1, (yyvsp[-2].intv));
4134 evalr[2].value = (yyvsp[0].intv);
4135 evalr[3].seg = SSG_ABS;
4136 evalr[3].value = romw;
4137 locctr += geninstr(findgen((yyvsp[-3].intv), ST_EXPREG, reg_type[(yyvsp[0].intv)]|sdbd));
4138 chkover(locctr >> 1, 1);
4139 }
4140 #line 4141 "asm/as1600.tab.c" /* yacc.c:1646 */
4141 break;
4142
4143 case 96:
4144 #line 2097 "asm/as1600_real.y" /* yacc.c:1646 */
4145 {
4146 emit_location(currseg, currpag, labelloc, TYPE_CODE, currmode);
4147 pevalexpr(1, (yyvsp[-2].intv));
4148 evalr[2].value = (yyvsp[0].intv);
4149
4150 evalr[3].seg = SSG_ABS;
4151 evalr[3].value = romw;
4152
4153 if (sdbd == 0 && romw != 16)
4154 {
4155 if (evalr[1].seg == SSG_ABS &&
4156 (0xFFFF & evalr[1].value & ~romm) != 0)
4157 {
4158 /*frawarn("Constant is wider than ROM width. "
4159 "Inserting SDBD.");*/
4160 locctr += geninstr("0001x");
4161 sdbd = SDBD;
4162 }
4163
4164 if (evalr[1].seg != SSG_ABS && fwd_sdbd)
4165 {
4166 frawarn("Inserting SDBD due to forward reference.");
4167 locctr += geninstr("0001x");
4168 sdbd = SDBD;
4169 }
4170 }
4171
4172 locctr += geninstr(findgen((yyvsp[-4].intv), ST_CEXREG, reg_type[(yyvsp[0].intv)]|sdbd));
4173 chkover(locctr >> 1, 1);
4174 }
4175 #line 4176 "asm/as1600.tab.c" /* yacc.c:1646 */
4176 break;
4177
4178 case 97:
4179 #line 2133 "asm/as1600_real.y" /* yacc.c:1646 */
4180 {
4181 SDBD_CHK
4182 emit_location(currseg, currpag, labelloc, TYPE_CODE, currmode);
4183 evalr[1].value = (yyvsp[0].intv);
4184 locctr += geninstr(findgen((yyvsp[-1].intv), ST_REG, reg_type[(yyvsp[0].intv)]|sdbd));
4185 chkover(locctr >> 1, 1);
4186 }
4187 #line 4188 "asm/as1600.tab.c" /* yacc.c:1646 */
4188 break;
4189
4190 case 98:
4191 #line 2146 "asm/as1600_real.y" /* yacc.c:1646 */
4192 {
4193 SDBD_CHK
4194 emit_location(currseg, currpag, labelloc, TYPE_CODE, currmode);
4195 evalr[1].value = (yyvsp[-2].intv);
4196 evalr[2].value = (yyvsp[0].intv);
4197 locctr += geninstr(findgen((yyvsp[-3].intv), ST_REGREG, reg_type[(yyvsp[-2].intv)]|sdbd));
4198 chkover(locctr >> 1, 1);
4199 }
4200 #line 4201 "asm/as1600.tab.c" /* yacc.c:1646 */
4201 break;
4202
4203 case 99:
4204 #line 2160 "asm/as1600_real.y" /* yacc.c:1646 */
4205 {
4206 emit_location(currseg, currpag, labelloc, TYPE_CODE, currmode);
4207 evalr[1].value = (yyvsp[-2].intv);
4208 evalr[2].value = (yyvsp[0].intv);
4209 locctr += geninstr(findgen((yyvsp[-3].intv), ST_REGREG, reg_type[(yyvsp[-2].intv)]|sdbd));
4210 chkover(locctr >> 1, 1);
4211 }
4212 #line 4213 "asm/as1600.tab.c" /* yacc.c:1646 */
4213 break;
4214
4215 case 100:
4216 #line 2174 "asm/as1600_real.y" /* yacc.c:1646 */
4217 {
4218 (yyval.intv) = (yyvsp[0].intv);
4219 }
4220 #line 4221 "asm/as1600.tab.c" /* yacc.c:1646 */
4221 break;
4222
4223 case 101:
4224 #line 2178 "asm/as1600_real.y" /* yacc.c:1646 */
4225 {
4226 (yyval.intv) = exprnode(PCCASE_UN,(yyvsp[0].intv),IFC_NEG,0,0L, SYMNULL);
4227 }
4228 #line 4229 "asm/as1600.tab.c" /* yacc.c:1646 */
4229 break;
4230
4231 case 102:
4232 #line 2182 "asm/as1600_real.y" /* yacc.c:1646 */
4233 {
4234 (yyval.intv) = exprnode(PCCASE_UN,(yyvsp[0].intv),IFC_NOT,0,0L, SYMNULL);
4235 }
4236 #line 4237 "asm/as1600.tab.c" /* yacc.c:1646 */
4237 break;
4238
4239 case 103:
4240 #line 2186 "asm/as1600_real.y" /* yacc.c:1646 */
4241 {
4242 (yyval.intv) = exprnode(PCCASE_UN,(yyvsp[0].intv),IFC_HIGH,0,0L, SYMNULL);
4243 }
4244 #line 4245 "asm/as1600.tab.c" /* yacc.c:1646 */
4245 break;
4246
4247 case 104:
4248 #line 2190 "asm/as1600_real.y" /* yacc.c:1646 */
4249 {
4250 (yyval.intv) = exprnode(PCCASE_UN,(yyvsp[0].intv),IFC_LOW,0,0L, SYMNULL);
4251 }
4252 #line 4253 "asm/as1600.tab.c" /* yacc.c:1646 */
4253 break;
4254
4255 case 105:
4256 #line 2194 "asm/as1600_real.y" /* yacc.c:1646 */
4257 {
4258 (yyval.intv) = exprnode(PCCASE_BIN,(yyvsp[-2].intv),IFC_MUL,(yyvsp[0].intv),0L, SYMNULL);
4259 }
4260 #line 4261 "asm/as1600.tab.c" /* yacc.c:1646 */
4261 break;
4262
4263 case 106:
4264 #line 2198 "asm/as1600_real.y" /* yacc.c:1646 */
4265 {
4266 (yyval.intv) = exprnode(PCCASE_BIN,(yyvsp[-2].intv),IFC_DIV,(yyvsp[0].intv),0L, SYMNULL);
4267 }
4268 #line 4269 "asm/as1600.tab.c" /* yacc.c:1646 */
4269 break;
4270
4271 case 107:
4272 #line 2202 "asm/as1600_real.y" /* yacc.c:1646 */
4273 {
4274 (yyval.intv) = exprnode(PCCASE_BIN,(yyvsp[-2].intv),IFC_ADD,(yyvsp[0].intv),0L, SYMNULL);
4275 }
4276 #line 4277 "asm/as1600.tab.c" /* yacc.c:1646 */
4277 break;
4278
4279 case 108:
4280 #line 2206 "asm/as1600_real.y" /* yacc.c:1646 */
4281 {
4282 (yyval.intv) = exprnode(PCCASE_BIN,(yyvsp[-2].intv),IFC_SUB,(yyvsp[0].intv),0L, SYMNULL);
4283 }
4284 #line 4285 "asm/as1600.tab.c" /* yacc.c:1646 */
4285 break;
4286
4287 case 109:
4288 #line 2210 "asm/as1600_real.y" /* yacc.c:1646 */
4289 {
4290 (yyval.intv) = exprnode(PCCASE_BIN,(yyvsp[-2].intv),IFC_MOD,(yyvsp[0].intv),0L, SYMNULL);
4291 }
4292 #line 4293 "asm/as1600.tab.c" /* yacc.c:1646 */
4293 break;
4294
4295 case 110:
4296 #line 2214 "asm/as1600_real.y" /* yacc.c:1646 */
4297 {
4298 (yyval.intv) = exprnode(PCCASE_BIN,(yyvsp[-2].intv),IFC_SHL,(yyvsp[0].intv),0L, SYMNULL);
4299 }
4300 #line 4301 "asm/as1600.tab.c" /* yacc.c:1646 */
4301 break;
4302
4303 case 111:
4304 #line 2218 "asm/as1600_real.y" /* yacc.c:1646 */
4305 {
4306 (yyval.intv) = exprnode(PCCASE_BIN,(yyvsp[-2].intv),IFC_SHR,(yyvsp[0].intv),0L, SYMNULL);
4307 }
4308 #line 4309 "asm/as1600.tab.c" /* yacc.c:1646 */
4309 break;
4310
4311 case 112:
4312 #line 2222 "asm/as1600_real.y" /* yacc.c:1646 */
4313 {
4314 (yyval.intv) = exprnode(PCCASE_BIN,(yyvsp[-2].intv),IFC_SHRU,(yyvsp[0].intv),0L, SYMNULL);
4315 }
4316 #line 4317 "asm/as1600.tab.c" /* yacc.c:1646 */
4317 break;
4318
4319 case 113:
4320 #line 2226 "asm/as1600_real.y" /* yacc.c:1646 */
4321 {
4322 const int ifc = (yyvsp[-1].intv) == 16 ? IFC_ROTL16 : IFC_ROTL32;
4323 (yyval.intv) = exprnode(PCCASE_BIN,(yyvsp[-2].intv),ifc,(yyvsp[0].intv),0L, SYMNULL);
4324 }
4325 #line 4326 "asm/as1600.tab.c" /* yacc.c:1646 */
4326 break;
4327
4328 case 114:
4329 #line 2231 "asm/as1600_real.y" /* yacc.c:1646 */
4330 {
4331 const int ifc = (yyvsp[-1].intv) == 16 ? IFC_ROTL16 : IFC_ROTL32;
4332 const int neg = exprnode(PCCASE_UN,(yyvsp[0].intv),IFC_NEG,0,0L, SYMNULL);
4333 (yyval.intv) = exprnode(PCCASE_BIN,(yyvsp[-2].intv),ifc,neg,0L, SYMNULL);
4334 }
4335 #line 4336 "asm/as1600.tab.c" /* yacc.c:1646 */
4336 break;
4337
4338 case 115:
4339 #line 2237 "asm/as1600_real.y" /* yacc.c:1646 */
4340 {
4341 (yyval.intv) = exprnode(PCCASE_BIN,(yyvsp[-2].intv),IFC_GT,(yyvsp[0].intv),0L, SYMNULL);
4342 }
4343 #line 4344 "asm/as1600.tab.c" /* yacc.c:1646 */
4344 break;
4345
4346 case 116:
4347 #line 2241 "asm/as1600_real.y" /* yacc.c:1646 */
4348 {
4349 (yyval.intv) = exprnode(PCCASE_BIN,(yyvsp[-2].intv),IFC_GE,(yyvsp[0].intv),0L, SYMNULL);
4350 }
4351 #line 4352 "asm/as1600.tab.c" /* yacc.c:1646 */
4352 break;
4353
4354 case 117:
4355 #line 2245 "asm/as1600_real.y" /* yacc.c:1646 */
4356 {
4357 (yyval.intv) = exprnode(PCCASE_BIN,(yyvsp[-2].intv),IFC_LT,(yyvsp[0].intv),0L, SYMNULL);
4358 }
4359 #line 4360 "asm/as1600.tab.c" /* yacc.c:1646 */
4360 break;
4361
4362 case 118:
4363 #line 2249 "asm/as1600_real.y" /* yacc.c:1646 */
4364 {
4365 (yyval.intv) = exprnode(PCCASE_BIN,(yyvsp[-2].intv),IFC_LE,(yyvsp[0].intv),0L, SYMNULL);
4366 }
4367 #line 4368 "asm/as1600.tab.c" /* yacc.c:1646 */
4368 break;
4369
4370 case 119:
4371 #line 2253 "asm/as1600_real.y" /* yacc.c:1646 */
4372 {
4373 (yyval.intv) = exprnode(PCCASE_BIN,(yyvsp[-2].intv),IFC_NE,(yyvsp[0].intv),0L, SYMNULL);
4374 }
4375 #line 4376 "asm/as1600.tab.c" /* yacc.c:1646 */
4376 break;
4377
4378 case 120:
4379 #line 2257 "asm/as1600_real.y" /* yacc.c:1646 */
4380 {
4381 (yyval.intv) = exprnode(PCCASE_BIN,(yyvsp[-2].intv),IFC_EQ,(yyvsp[0].intv),0L, SYMNULL);
4382 }
4383 #line 4384 "asm/as1600.tab.c" /* yacc.c:1646 */
4384 break;
4385
4386 case 121:
4387 #line 2261 "asm/as1600_real.y" /* yacc.c:1646 */
4388 {
4389 (yyval.intv) = exprnode(PCCASE_BIN,(yyvsp[-2].intv),IFC_AND,(yyvsp[0].intv),0L, SYMNULL);
4390 }
4391 #line 4392 "asm/as1600.tab.c" /* yacc.c:1646 */
4392 break;
4393
4394 case 122:
4395 #line 2265 "asm/as1600_real.y" /* yacc.c:1646 */
4396 {
4397 (yyval.intv) = exprnode(PCCASE_BIN,(yyvsp[-2].intv),IFC_OR,(yyvsp[0].intv),0L, SYMNULL);
4398 }
4399 #line 4400 "asm/as1600.tab.c" /* yacc.c:1646 */
4400 break;
4401
4402 case 123:
4403 #line 2269 "asm/as1600_real.y" /* yacc.c:1646 */
4404 {
4405 (yyval.intv) = exprnode(PCCASE_BIN,(yyvsp[-2].intv),IFC_XOR,(yyvsp[0].intv),0L, SYMNULL);
4406 }
4407 #line 4408 "asm/as1600.tab.c" /* yacc.c:1646 */
4408 break;
4409
4410 case 124:
4411 #line 2273 "asm/as1600_real.y" /* yacc.c:1646 */
4412 {
4413 (yyval.intv) = exprnode(PCCASE_DEF,0,IGP_DEFINED,0,0L,(yyvsp[0].symb));
4414 }
4415 #line 4416 "asm/as1600.tab.c" /* yacc.c:1646 */
4416 break;
4417
4418 case 125:
4419 #line 2277 "asm/as1600_real.y" /* yacc.c:1646 */
4420 {
4421 (yyval.intv) = exprnode(PCCASE_SYMB,0,IFC_SYMB,0,0L,(yyvsp[0].symb));
4422 }
4423 #line 4424 "asm/as1600.tab.c" /* yacc.c:1646 */
4424 break;
4425
4426 case 126:
4427 #line 2281 "asm/as1600_real.y" /* yacc.c:1646 */
4428 {
4429 (yyval.intv) = exprnode(PCCASE_CONS,0,IGP_CONSTANT,0,(yyvsp[0].longv), SYMNULL);
4430 }
4431 #line 4432 "asm/as1600.tab.c" /* yacc.c:1646 */
4432 break;
4433
4434 case 127:
4435 #line 2285 "asm/as1600_real.y" /* yacc.c:1646 */
4436 {
4437 (yyval.intv) = exprnode(PCCASE_CONS,0,IGP_CONSTANT,0,(yyvsp[0].longv), SYMNULL);
4438 }
4439 #line 4440 "asm/as1600.tab.c" /* yacc.c:1646 */
4440 break;
4441
4442 case 128:
4443 #line 2289 "asm/as1600_real.y" /* yacc.c:1646 */
4444 {
4445 (yyval.intv) = exprnode(PCCASE_PROGC,0,IFC_PROGCTR,0,labelloc,SYMNULL);
4446 }
4447 #line 4448 "asm/as1600.tab.c" /* yacc.c:1646 */
4448 break;
4449
4450 case 129:
4451 #line 2293 "asm/as1600_real.y" /* yacc.c:1646 */
4452 {
4453 (yyval.intv) = exprnode(PCCASE_CONS,0,IGP_CONSTANT,0,(yyvsp[0].longv), SYMNULL);
4454 }
4455 #line 4456 "asm/as1600.tab.c" /* yacc.c:1646 */
4456 break;
4457
4458 case 130:
4459 #line 2297 "asm/as1600_real.y" /* yacc.c:1646 */
4460 {
4461 char st[2] = { (yyvsp[0].longv), 0 }, *s = st;
4462 int accval = chtran(&s);
4463 (yyval.intv) = exprnode(PCCASE_CONS,0,IGP_CONSTANT,0,accval,SYMNULL);
4464 }
4465 #line 4466 "asm/as1600.tab.c" /* yacc.c:1646 */
4466 break;
4467
4468 case 131:
4469 #line 2303 "asm/as1600_real.y" /* yacc.c:1646 */
4470 {
4471 (yyval.intv) = exprnode(PCCASE_CONS,0,IGP_CONSTANT,0,CLASS_EMPTY,SYMNULL);
4472 }
4473 #line 4474 "asm/as1600.tab.c" /* yacc.c:1646 */
4474 break;
4475
4476 case 132:
4477 #line 2307 "asm/as1600_real.y" /* yacc.c:1646 */
4478 {
4479 (yyval.intv) = exprnode(PCCASE_CONS,0,IGP_CONSTANT,0, (yyvsp[-1].intv), SYMNULL);
4480 }
4481 #line 4482 "asm/as1600.tab.c" /* yacc.c:1646 */
4482 break;
4483
4484 case 133:
4485 #line 2311 "asm/as1600_real.y" /* yacc.c:1646 */
4486 {
4487 (yyval.intv) = exprnode(PCCASE_CONS,0,IGP_CONSTANT,0,CLASS_FEATURE,
4488 SYMNULL);
4489 }
4490 #line 4491 "asm/as1600.tab.c" /* yacc.c:1646 */
4491 break;
4492
4493 case 134:
4494 #line 2316 "asm/as1600_real.y" /* yacc.c:1646 */
4495 {
4496 (yyval.intv) = exprnode(PCCASE_CONS,0,IGP_CONSTANT,0,CLASS_RESV,SYMNULL);
4497 }
4498 #line 4499 "asm/as1600.tab.c" /* yacc.c:1646 */
4499 break;
4500
4501 case 135:
4502 #line 2320 "asm/as1600_real.y" /* yacc.c:1646 */
4503 {
4504 (yyval.intv) = exprnode(PCCASE_CONS,0,IGP_CONSTANT,0,CLASS_STRING,
4505 SYMNULL);
4506 }
4507 #line 4508 "asm/as1600.tab.c" /* yacc.c:1646 */
4508 break;
4509
4510 case 136:
4511 #line 2325 "asm/as1600_real.y" /* yacc.c:1646 */
4512 {
4513 (yyval.intv) = exprnode(PCCASE_CLASSSYM,0,IFC_CLASSIFY,0,0L,(yyvsp[-1].symb));
4514 }
4515 #line 4516 "asm/as1600.tab.c" /* yacc.c:1646 */
4516 break;
4517
4518 case 137:
4519 #line 2329 "asm/as1600_real.y" /* yacc.c:1646 */
4520 {
4521 (yyval.intv) = exprnode(PCCASE_UN,(yyvsp[-1].intv),IFC_CLASSIFY,0,0L, SYMNULL);
4522 }
4523 #line 4524 "asm/as1600.tab.c" /* yacc.c:1646 */
4524 break;
4525
4526 case 138:
4527 #line 2333 "asm/as1600_real.y" /* yacc.c:1646 */
4528 {
4529 char *s = (yyvsp[-1].strng);
4530 int accval = 0;
4531 int length = 0;
4532
4533 while (*s)
4534 {
4535 accval = chtran(&s);
4536 length++;
4537 }
4538 (void)accval;
4539 (yyval.intv) = exprnode(PCCASE_CONS,0,IGP_CONSTANT,0,length++,SYMNULL);
4540 }
4541 #line 4542 "asm/as1600.tab.c" /* yacc.c:1646 */
4542 break;
4543
4544 case 139:
4545 #line 2347 "asm/as1600_real.y" /* yacc.c:1646 */
4546 {
4547 (yyval.intv) = exprnode(PCCASE_CONS,0,IGP_CONSTANT,0,1,SYMNULL);
4548 }
4549 #line 4550 "asm/as1600.tab.c" /* yacc.c:1646 */
4550 break;
4551
4552 case 140:
4553 #line 2351 "asm/as1600_real.y" /* yacc.c:1646 */
4554 {
4555 char *s = (yyvsp[-3].strng);
4556 int accval = 0;
4557 int sindex = 0;
4558
4559 pevalexpr(0, (yyvsp[-1].intv));
4560 if(evalr[0].seg == SSG_ABS)
4561 {
4562 sindex = evalr[0].value;
4563 while (*s && sindex >= 0)
4564 {
4565 accval = chtran(&s);
4566 sindex--;
4567 }
4568 if (sindex >= 0)
4569 accval = 0;
4570
4571 (yyval.intv) = exprnode(PCCASE_CONS,0,IGP_CONSTANT,0,accval,SYMNULL);
4572 }
4573 else
4574 {
4575 fraerror("noncomputable expression for index to ASC");
4576 }
4577 }
4578 #line 4579 "asm/as1600.tab.c" /* yacc.c:1646 */
4579 break;
4580
4581 case 141:
4582 #line 2376 "asm/as1600_real.y" /* yacc.c:1646 */
4583 {
4584 char st[2] = { (yyvsp[-3].longv), 0 }, *s = st;
4585 int accval = 0;
4586
4587 pevalexpr(0, (yyvsp[-1].intv));
4588 if(evalr[0].seg == SSG_ABS)
4589 {
4590 accval = evalr[0].value == 0 ? chtran(&s) : 0;
4591 (yyval.intv) = exprnode(PCCASE_CONS,0,IGP_CONSTANT,0,accval,SYMNULL);
4592 }
4593 else
4594 {
4595 fraerror("noncomputable expression for index to ASC");
4596 }
4597 }
4598 #line 4599 "asm/as1600.tab.c" /* yacc.c:1646 */
4599 break;
4600
4601 case 142:
4602 #line 2391 "asm/as1600_real.y" /* yacc.c:1646 */
4603 { (yyval.intv) = (yyvsp[-1].intv); }
4604 #line 4605 "asm/as1600.tab.c" /* yacc.c:1646 */
4605 break;
4606
4607 case 143:
4608 #line 2393 "asm/as1600_real.y" /* yacc.c:1646 */
4609 {
4610 pevalexpr(0, (yyvsp[-1].intv));
4611 if (evalr[0].seg == SSG_ABS)
4612 {
4613 const int idx = evalr[0].value;
4614 if (idx < (yyvsp[-4].intvec)->len)
4615 (yyval.intv) = (yyvsp[-4].intvec)->data[idx];
4616 else
4617 (yyval.intv) = exprnode(PCCASE_CONS,0,IGP_CONSTANT,0,0,SYMNULL);
4618 }
4619 else
4620 {
4621 fraerror("noncomputable expression for expr-list index");
4622 }
4623 intvec_delete((yyvsp[-4].intvec));
4624 }
4625 #line 4626 "asm/as1600.tab.c" /* yacc.c:1646 */
4626 break;
4627
4628 case 145:
4629 #line 2416 "asm/as1600_real.y" /* yacc.c:1646 */
4630 {
4631 pevalexpr(0, (yyvsp[-1].intv));
4632 if (evalr[0].seg == SSG_ABS)
4633 {
4634 (yyval.symb) = symbentryidx((yyvsp[-3].symb)->symstr, LABEL, 1, evalr[0].value);
4635 (yyval.symb)->flags |= SFLAG_QUIET | SFLAG_ARRAY;
4636
4637 /* track "high water mark" in LABEL's own value */
4638 (yyvsp[-3].symb)->seg = SSG_SET;
4639 (yyvsp[-3].symb)->flags |= SFLAG_QUIET;
4640 if ((yyvsp[-3].symb)->value < evalr[0].value)
4641 (yyvsp[-3].symb)->value = evalr[0].value;
4642 } else
4643 {
4644 fraerror("noncomputable expression for label array index");
4645 }
4646 }
4647 #line 4648 "asm/as1600.tab.c" /* yacc.c:1646 */
4648 break;
4649
4650 case 147:
4651 #line 2437 "asm/as1600_real.y" /* yacc.c:1646 */
4652 {
4653 pevalexpr(0, (yyvsp[-1].intv));
4654 if (evalr[0].seg == SSG_ABS)
4655 {
4656 (yyval.symb) = symbentryidx((yyvsp[-3].symb)->symstr, LABEL, 1, evalr[0].value);
4657 (yyval.symb)->flags |= SFLAG_QUIET | SFLAG_ARRAY;
4658
4659 /* track "high water mark" in LABEL's own value */
4660 (yyvsp[-3].symb)->seg = SSG_SET;
4661 (yyvsp[-3].symb)->flags |= SFLAG_QUIET;
4662 if ((yyvsp[-3].symb)->value < evalr[0].value)
4663 (yyvsp[-3].symb)->value = evalr[0].value;
4664 } else
4665 {
4666 fraerror("noncomputable expression for symbol array index");
4667 }
4668 }
4669 #line 4670 "asm/as1600.tab.c" /* yacc.c:1646 */
4670 break;
4671
4672 case 148:
4673 #line 2458 "asm/as1600_real.y" /* yacc.c:1646 */
4674 {
4675 intvec_t *const RESTRICT iv = intvec_new();
4676 pevalexpr(0, (yyvsp[-3].intv));
4677 pevalexpr(1, (yyvsp[-1].intv));
4678
4679 if (evalr[0].seg != SSG_ABS || evalr[1].seg != SSG_ABS)
4680 {
4681 fraerror("noncomputable expression for symbol slice index");
4682 (yyval.intvec) = iv;
4683 } else
4684 {
4685 int i, s;
4686
4687 s = evalr[0].value > evalr[1].value ? -1 : 1;
4688
4689 for (i = evalr[0].value; i != evalr[1].value + s; i += s)
4690 {
4691 struct symel *sym;
4692 intvec_push(iv,
4693 exprnode(PCCASE_SYMB,0,IFC_SYMB,0,0L,
4694 sym = symbentryidx((yyvsp[-5].symb)->symstr, LABEL, 1, i)));
4695
4696 sym->flags |= SFLAG_ARRAY | SFLAG_QUIET;
4697 }
4698 (yyval.intvec) = iv;
4699 }
4700 }
4701 #line 4702 "asm/as1600.tab.c" /* yacc.c:1646 */
4702 break;
4703
4704 case 149:
4705 #line 2486 "asm/as1600_real.y" /* yacc.c:1646 */
4706 {
4707 pevalexpr(0, (yyvsp[-3].intv));
4708 pevalexpr(1, (yyvsp[-1].intv));
4709 if (evalr[0].seg != SSG_ABS || evalr[1].seg != SSG_ABS)
4710 {
4711 fraerror(
4712 "noncomputable expression for expr-list slice index");
4713 intvec_resize((yyvsp[-6].intvec), 0);
4714 (yyval.intvec) = (yyvsp[-6].intvec);
4715 } else if (evalr[0].value >= (yyvsp[-6].intvec)->len ||
4716 evalr[1].value >= (yyvsp[-6].intvec)->len)
4717 {
4718 fraerror("out of range index for expr-list slice");
4719 intvec_resize((yyvsp[-6].intvec), 0);
4720 (yyval.intvec) = (yyvsp[-6].intvec);
4721 } else
4722 {
4723 const int rev = evalr[0].value > evalr[1].value;
4724 const int lo = rev ? evalr[1].value : evalr[0].value;
4725 const int hi = rev ? evalr[0].value : evalr[1].value;
4726 const int cnt = hi - lo + 1;
4727 int *const data = (yyvsp[-6].intvec)->data;
4728
4729 memmove(&data[0], &data[lo], sizeof(data[0]) * cnt);
4730
4731 if (rev)
4732 {
4733 int i, j;
4734 for (i = 0, j = cnt - 1; i < j; i++, j--)
4735 {
4736 const int tmp = (yyvsp[-6].intvec)->data[i];
4737 (yyvsp[-6].intvec)->data[i] = (yyvsp[-6].intvec)->data[j];
4738 (yyvsp[-6].intvec)->data[j] = tmp;
4739 }
4740 }
4741 (yyvsp[-6].intvec)->len = cnt;
4742 (yyval.intvec) = (yyvsp[-6].intvec);
4743 }
4744 }
4745 #line 4746 "asm/as1600.tab.c" /* yacc.c:1646 */
4746 break;
4747
4748 case 150:
4749 #line 2526 "asm/as1600_real.y" /* yacc.c:1646 */
4750 {
4751 fraerror("array slice allowed on last index only");
4752 (yyval.intvec) = intvec_new();
4753 }
4754 #line 4755 "asm/as1600.tab.c" /* yacc.c:1646 */
4755 break;
4756
4757 case 151:
4758 #line 2531 "asm/as1600_real.y" /* yacc.c:1646 */
4759 {
4760 fraerror("array slice allowed on last index only");
4761 (yyval.intvec) = intvec_new();
4762 }
4763 #line 4764 "asm/as1600.tab.c" /* yacc.c:1646 */
4764 break;
4765
4766 case 152:
4767 #line 2539 "asm/as1600_real.y" /* yacc.c:1646 */
4768 {
4769 pevalexpr(0, (yyvsp[-3].intv));
4770 pevalexpr(1, (yyvsp[-1].intv));
4771
4772 if (evalr[0].seg != SSG_ABS || evalr[1].seg != SSG_ABS)
4773 {
4774 fraerror("noncomputable expression for label slice index");
4775 } else
4776 {
4777 (yyval.slidx).first = evalr[0].value;
4778 (yyval.slidx).last = evalr[1].value;
4779 (yyval.slidx).sym = (yyvsp[-5].symb);
4780 }
4781 }
4782 #line 4783 "asm/as1600.tab.c" /* yacc.c:1646 */
4783 break;
4784
4785 case 153:
4786 #line 2554 "asm/as1600_real.y" /* yacc.c:1646 */
4787 {
4788 fraerror("array slice allowed on last index only");
4789 }
4790 #line 4791 "asm/as1600.tab.c" /* yacc.c:1646 */
4791 break;
4792
4793 case 154:
4794 #line 2558 "asm/as1600_real.y" /* yacc.c:1646 */
4795 {
4796 fraerror("array slice allowed on last index only");
4797 }
4798 #line 4799 "asm/as1600.tab.c" /* yacc.c:1646 */
4799 break;
4800
4801
4802 #line 4803 "asm/as1600.tab.c" /* yacc.c:1646 */
4803 default: break;
4804 }
4805 /* User semantic actions sometimes alter yychar, and that requires
4806 that yytoken be updated with the new translation. We take the
4807 approach of translating immediately before every use of yytoken.
4808 One alternative is translating here after every semantic action,
4809 but that translation would be missed if the semantic action invokes
4810 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
4811 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
4812 incorrect destructor might then be invoked immediately. In the
4813 case of YYERROR or YYBACKUP, subsequent parser actions might lead
4814 to an incorrect destructor call or verbose syntax error message
4815 before the lookahead is translated. */
4816 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
4817
4818 YYPOPSTACK (yylen);
4819 yylen = 0;
4820 YY_STACK_PRINT (yyss, yyssp);
4821
4822 *++yyvsp = yyval;
4823
4824 /* Now 'shift' the result of the reduction. Determine what state
4825 that goes to, based on the state we popped back to and the rule
4826 number reduced by. */
4827
4828 yyn = yyr1[yyn];
4829
4830 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4831 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4832 yystate = yytable[yystate];
4833 else
4834 yystate = yydefgoto[yyn - YYNTOKENS];
4835
4836 goto yynewstate;
4837
4838
4839 /*--------------------------------------.
4840 | yyerrlab -- here on detecting error. |
4841 `--------------------------------------*/
4842 yyerrlab:
4843 /* Make sure we have latest lookahead translation. See comments at
4844 user semantic actions for why this is necessary. */
4845 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
4846
4847 /* If not already recovering from an error, report this error. */
4848 if (!yyerrstatus)
4849 {
4850 ++yynerrs;
4851 #if ! YYERROR_VERBOSE
4852 yyerror (YY_("syntax error"));
4853 #else
4854 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
4855 yyssp, yytoken)
4856 {
4857 char const *yymsgp = YY_("syntax error");
4858 int yysyntax_error_status;
4859 yysyntax_error_status = YYSYNTAX_ERROR;
4860 if (yysyntax_error_status == 0)
4861 yymsgp = yymsg;
4862 else if (yysyntax_error_status == 1)
4863 {
4864 if (yymsg != yymsgbuf)
4865 YYSTACK_FREE (yymsg);
4866 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
4867 if (!yymsg)
4868 {
4869 yymsg = yymsgbuf;
4870 yymsg_alloc = sizeof yymsgbuf;
4871 yysyntax_error_status = 2;
4872 }
4873 else
4874 {
4875 yysyntax_error_status = YYSYNTAX_ERROR;
4876 yymsgp = yymsg;
4877 }
4878 }
4879 yyerror (yymsgp);
4880 if (yysyntax_error_status == 2)
4881 goto yyexhaustedlab;
4882 }
4883 # undef YYSYNTAX_ERROR
4884 #endif
4885 }
4886
4887
4888
4889 if (yyerrstatus == 3)
4890 {
4891 /* If just tried and failed to reuse lookahead token after an
4892 error, discard it. */
4893
4894 if (yychar <= YYEOF)
4895 {
4896 /* Return failure if at end of input. */
4897 if (yychar == YYEOF)
4898 YYABORT;
4899 }
4900 else
4901 {
4902 yydestruct ("Error: discarding",
4903 yytoken, &yylval);
4904 yychar = YYEMPTY;
4905 }
4906 }
4907
4908 /* Else will try to reuse lookahead token after shifting the error
4909 token. */
4910 goto yyerrlab1;
4911
4912
4913 /*---------------------------------------------------.
4914 | yyerrorlab -- error raised explicitly by YYERROR. |
4915 `---------------------------------------------------*/
4916 yyerrorlab:
4917
4918 /* Pacify compilers like GCC when the user code never invokes
4919 YYERROR and the label yyerrorlab therefore never appears in user
4920 code. */
4921 if (/*CONSTCOND*/ 0)
4922 goto yyerrorlab;
4923
4924 /* Do not reclaim the symbols of the rule whose action triggered
4925 this YYERROR. */
4926 YYPOPSTACK (yylen);
4927 yylen = 0;
4928 YY_STACK_PRINT (yyss, yyssp);
4929 yystate = *yyssp;
4930 goto yyerrlab1;
4931
4932
4933 /*-------------------------------------------------------------.
4934 | yyerrlab1 -- common code for both syntax error and YYERROR. |
4935 `-------------------------------------------------------------*/
4936 yyerrlab1:
4937 yyerrstatus = 3; /* Each real token shifted decrements this. */
4938
4939 for (;;)
4940 {
4941 yyn = yypact[yystate];
4942 if (!yypact_value_is_default (yyn))
4943 {
4944 yyn += YYTERROR;
4945 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4946 {
4947 yyn = yytable[yyn];
4948 if (0 < yyn)
4949 break;
4950 }
4951 }
4952
4953 /* Pop the current state because it cannot handle the error token. */
4954 if (yyssp == yyss)
4955 YYABORT;
4956
4957
4958 yydestruct ("Error: popping",
4959 yystos[yystate], yyvsp);
4960 YYPOPSTACK (1);
4961 yystate = *yyssp;
4962 YY_STACK_PRINT (yyss, yyssp);
4963 }
4964
4965 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
4966 *++yyvsp = yylval;
4967 YY_IGNORE_MAYBE_UNINITIALIZED_END
4968
4969
4970 /* Shift the error token. */
4971 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
4972
4973 yystate = yyn;
4974 goto yynewstate;
4975
4976
4977 /*-------------------------------------.
4978 | yyacceptlab -- YYACCEPT comes here. |
4979 `-------------------------------------*/
4980 yyacceptlab:
4981 yyresult = 0;
4982 goto yyreturn;
4983
4984 /*-----------------------------------.
4985 | yyabortlab -- YYABORT comes here. |
4986 `-----------------------------------*/
4987 yyabortlab:
4988 yyresult = 1;
4989 goto yyreturn;
4990
4991 #if !defined yyoverflow || YYERROR_VERBOSE
4992 /*-------------------------------------------------.
4993 | yyexhaustedlab -- memory exhaustion comes here. |
4994 `-------------------------------------------------*/
4995 yyexhaustedlab:
4996 yyerror (YY_("memory exhausted"));
4997 yyresult = 2;
4998 /* Fall through. */
4999 #endif
5000
5001 yyreturn:
5002 if (yychar != YYEMPTY)
5003 {
5004 /* Make sure we have latest lookahead translation. See comments at
5005 user semantic actions for why this is necessary. */
5006 yytoken = YYTRANSLATE (yychar);
5007 yydestruct ("Cleanup: discarding lookahead",
5008 yytoken, &yylval);
5009 }
5010 /* Do not reclaim the symbols of the rule whose action triggered
5011 this YYABORT or YYACCEPT. */
5012 YYPOPSTACK (yylen);
5013 YY_STACK_PRINT (yyss, yyssp);
5014 while (yyssp != yyss)
5015 {
5016 yydestruct ("Cleanup: popping",
5017 yystos[*yyssp], yyvsp);
5018 YYPOPSTACK (1);
5019 }
5020 #ifndef yyoverflow
5021 if (yyss != yyssa)
5022 YYSTACK_FREE (yyss);
5023 #endif
5024 #if YYERROR_VERBOSE
5025 if (yymsg != yymsgbuf)
5026 YYSTACK_FREE (yymsg);
5027 #endif
5028 return yyresult;
5029 }
5030 #line 2587 "asm/as1600_real.y" /* yacc.c:1906 */
5031
5032
lexintercept(void)5033 int lexintercept(void)
5034 /*
5035 description intercept the call to yylex (the lexical analyzer)
5036 and filter out all unnecessary tokens when skipping
5037 the input between a failed IF and its matching ENDI or
5038 ELSE
5039 globals fraifskip the enable flag
5040 */
5041 {
5042 #undef yylex
5043 int rv;
5044
5045 if (!(frarptskip | fraifskip))
5046 {
5047 int token = yylex();
5048 return token;
5049 }
5050
5051 if(frarptskip)
5052 {
5053 for(;;)
5054 {
5055
5056 switch(rv = yylex())
5057 {
5058 case 0:
5059 case KOC_END:
5060 case KOC_ENDR:
5061 case EOL:
5062 return rv;
5063 case KOC_RPT:
5064 frarptpush(0); /* push a dummy loop */
5065 default:
5066 break;
5067 }
5068 }
5069 } else if(fraifskip)
5070 {
5071 for(;;)
5072 {
5073
5074 switch(rv = yylex())
5075 {
5076 case 0:
5077 case KOC_END:
5078 case KOC_IF:
5079 case KOC_ELSE:
5080 case KOC_ENDI:
5081 case KEOP_EXPMAC:
5082 case EOL:
5083 return rv;
5084 default:
5085 break;
5086 }
5087 }
5088 } else
5089 {
5090 int token = yylex();
5091 return token;
5092 }
5093
5094 #define yylex lexintercept
5095 }
5096
5097
5098
setreserved(void)5099 void setreserved(void)
5100 {
5101 reservedsym("and", KEOP_AND, 0);
5102 reservedsym("defined", KEOP_DEFINED, 0);
5103 reservedsym("ge", KEOP_GE, 0);
5104 reservedsym("high", KEOP_HIGH, 0);
5105 reservedsym("le", KEOP_LE, 0);
5106 reservedsym("low", KEOP_LOW, 0);
5107 reservedsym("mod", KEOP_MOD, 0);
5108 reservedsym("ne", KEOP_NE, 0);
5109 reservedsym("not", KEOP_NOT, 0);
5110 reservedsym("or", KEOP_OR, 0);
5111 reservedsym("shl", KEOP_SHL, 0);
5112 reservedsym("shr", KEOP_SHR, 0);
5113 reservedsym("shru", KEOP_SHRU, 0);
5114 reservedsym("xor", KEOP_XOR, 0);
5115 reservedsym("AND", KEOP_AND, 0);
5116 reservedsym("DEFINED", KEOP_DEFINED, 0);
5117 reservedsym("GE", KEOP_GE, 0);
5118 reservedsym("HIGH", KEOP_HIGH, 0);
5119 reservedsym("LE", KEOP_LE, 0);
5120 reservedsym("LOW", KEOP_LOW, 0);
5121 reservedsym("MOD", KEOP_MOD, 0);
5122 reservedsym("NE", KEOP_NE, 0);
5123 reservedsym("NOT", KEOP_NOT, 0);
5124 reservedsym("OR", KEOP_OR, 0);
5125 reservedsym("SHL", KEOP_SHL, 0);
5126 reservedsym("SHR", KEOP_SHR, 0);
5127 reservedsym("SHRU", KEOP_SHRU, 0);
5128 reservedsym("_ROTL16", KEOP_ROTL, 16);
5129 reservedsym("_ROTL32", KEOP_ROTL, 32);
5130 reservedsym("_ROTR16", KEOP_ROTR, 16);
5131 reservedsym("_ROTR32", KEOP_ROTR, 32);
5132 reservedsym("XOR", KEOP_XOR, 0);
5133 reservedsym("STRLEN", KEOP_STRLEN, 0);
5134 reservedsym("ASC", KEOP_ASC, 0);
5135 reservedsym("CLASSIFY", KEOP_CLASSIFY, 0);
5136 reservedsym("TODAY_STR_LOC", KEOP_TODAY_STR, 0);
5137 reservedsym("TODAY_STR_GMT", KEOP_TODAY_STR, 1);
5138 reservedsym("TODAY_VAL_LOC", KEOP_TODAY_VAL, 0);
5139 reservedsym("TODAY_VAL_GMT", KEOP_TODAY_VAL, 1);
5140 reservedsym("_EXPMAC", KEOP_EXPMAC, 1);
5141
5142 /* machine specific token definitions */
5143 reservedsym("r0", CP1600_REG, 0);
5144 reservedsym("r1", CP1600_REG, 1);
5145 reservedsym("r2", CP1600_REG, 2);
5146 reservedsym("r3", CP1600_REG, 3);
5147 reservedsym("r4", CP1600_REG, 4);
5148 reservedsym("r5", CP1600_REG, 5);
5149 reservedsym("r6", CP1600_REG, 6);
5150 reservedsym("r7", CP1600_REG, 7);
5151 reservedsym("sp", CP1600_REG, 6);
5152 reservedsym("pc", CP1600_REG, 7);
5153 reservedsym("R0", CP1600_REG, 0);
5154 reservedsym("R1", CP1600_REG, 1);
5155 reservedsym("R2", CP1600_REG, 2);
5156 reservedsym("R3", CP1600_REG, 3);
5157 reservedsym("R4", CP1600_REG, 4);
5158 reservedsym("R5", CP1600_REG, 5);
5159 reservedsym("R6", CP1600_REG, 6);
5160 reservedsym("R7", CP1600_REG, 7);
5161 reservedsym("SP", CP1600_REG, 6);
5162 reservedsym("PC", CP1600_REG, 7);
5163
5164 reservedsym("__FEATURE.MACRO", FEATURE, 99);
5165 reservedsym("__FEATURE.CFGVAR", FEATURE, 99);
5166 reservedsym("__FEATURE.SRCFILE", FEATURE, 99);
5167 reservedsym("__FEATURE.CLASSIFY", FEATURE, 99);
5168 reservedsym("__FEATURE.TODAY", FEATURE, 99);
5169 reservedsym("__FEATURE.ROTATE", FEATURE, 99);
5170 reservedsym("__FEATURE.EXPMAC", FEATURE, 99);
5171 reservedsym("__FEATURE.LISTCOL", FEATURE, 99);
5172 reservedsym("__FEATURE.OVERWRITE", FEATURE, 99);
5173 reservedsym("MACRO", FEATURE, 99);
5174 reservedsym("ENDM", FEATURE, 99);
5175 }
5176
cpumatch(char * str)5177 int cpumatch(char *str)
5178 {
5179 (void)str;
5180 return TRUE;
5181 }
5182
5183
5184 /* ======================================================================== */
5185 /* Opcode and Instruction Generation Tables */
5186 /* */
5187 /* These tables are used by the assembler framework to generate */
5188 /* instructions from the parsed input. */
5189 /* */
5190 /* OPTAB -- OPcode TABle. Contains the set of supported mnemonics. */
5191 /* OSTAB -- Opcode Syntax TABle. Syntax definition sets for instrs. */
5192 /* IGTAB -- Instruction Generation TABle. Contains RPN code for */
5193 /* generating the instructions. */
5194 /* ======================================================================== */
5195
5196
5197
5198 /* ======================================================================== */
5199 /* OPTAB -- OPcode TABle. Contains the set of supported mnemonics. */
5200 /* ======================================================================== */
5201 struct opsym optab[] =
5202 {
5203 { "invalid", KOC_opcode, 2, 0 },
5204
5205 { "MVO", KOC_opcode, 1, 2 },
5206 { "MVI", KOC_opcode, 1, 3 },
5207 { "ADD", KOC_opcode, 1, 4 },
5208 { "SUB", KOC_opcode, 1, 5 },
5209 { "CMP", KOC_opcode, 1, 6 },
5210 { "AND", KOC_opcode, 1, 7 },
5211 { "XOR", KOC_opcode, 1, 8 },
5212
5213 { "MVO@", KOC_opcode, 1, 9 },
5214 { "MVI@", KOC_opcode_i, 1, 10 },
5215 { "ADD@", KOC_opcode_i, 1, 11 },
5216 { "SUB@", KOC_opcode_i, 1, 12 },
5217 { "CMP@", KOC_opcode_i, 1, 13 },
5218 { "AND@", KOC_opcode_i, 1, 14 },
5219 { "XOR@", KOC_opcode_i, 1, 15 },
5220
5221 { "MVOI", KOC_opcode, 1, 16 },
5222 { "MVII", KOC_opcode, 1, 17 },
5223 { "ADDI", KOC_opcode, 1, 18 },
5224 { "SUBI", KOC_opcode, 1, 19 },
5225 { "CMPI", KOC_opcode, 1, 20 },
5226 { "ANDI", KOC_opcode, 1, 21 },
5227 { "XORI", KOC_opcode, 1, 22 },
5228
5229 { "MOVR", KOC_opcode, 1, 24 },
5230 { "ADDR", KOC_opcode, 1, 25 },
5231 { "SUBR", KOC_opcode, 1, 26 },
5232 { "CMPR", KOC_opcode, 1, 27 },
5233 { "ANDR", KOC_opcode, 1, 28 },
5234 { "XORR", KOC_opcode, 1, 29 },
5235
5236 { "B", KOC_relbr, 1, 30 },
5237 { "BC", KOC_relbr, 1, 31 },
5238 { "BOV", KOC_relbr, 1, 32 },
5239 { "BPL", KOC_relbr, 1, 33 },
5240 { "BZE", KOC_relbr, 1, 34 },
5241 { "BEQ", KOC_relbr, 1, 34 },
5242 { "BLT", KOC_relbr, 1, 35 },
5243 { "BNGE", KOC_relbr, 1, 35 },
5244 { "BLE", KOC_relbr, 1, 36 },
5245 { "BNGT", KOC_relbr, 1, 36 },
5246 { "BUSC", KOC_relbr, 1, 37 },
5247
5248 { "NOPP", KOC_opcode, 2, 92 },
5249 { "BNC", KOC_relbr, 1, 39 },
5250 { "BNOV", KOC_relbr, 1, 40 },
5251 { "BMI", KOC_relbr, 1, 41 },
5252 { "BNZE", KOC_relbr, 1, 42 },
5253 { "BNZ", KOC_relbr, 1, 42 },
5254 { "BNEQ", KOC_relbr, 1, 42 },
5255 { "BNE", KOC_relbr, 1, 42 },
5256 { "BGE", KOC_relbr, 1, 43 },
5257 { "BNLT", KOC_relbr, 1, 43 },
5258 { "BGT", KOC_relbr, 1, 44 },
5259 { "BNLE", KOC_relbr, 1, 44 },
5260 { "BESC", KOC_relbr, 1, 45 },
5261
5262 { "BEXT", KOC_relbr_x, 1, 96 },
5263
5264 { "SWAP", KOC_opcode, 2, 46 },
5265 { "SLL", KOC_opcode, 2, 48 },
5266 { "RLC", KOC_opcode, 2, 50 },
5267 { "SLLC", KOC_opcode, 2, 52 },
5268 { "SLR", KOC_opcode, 2, 54 },
5269 { "SAR", KOC_opcode, 2, 56 },
5270 { "RRC", KOC_opcode, 2, 58 },
5271 { "SARC", KOC_opcode, 2, 60 },
5272
5273 { "NOP", KOC_opcode, 1, 62 },
5274 { "NOP2", KOC_opcode, 1, 94 },
5275 { "SIN", KOC_opcode, 1, 63 },
5276 { "SIN2", KOC_opcode, 1, 95 },
5277
5278 { "J", KOC_opcode, 1, 64 },
5279 { "JE", KOC_opcode, 1, 65 },
5280 { "JD", KOC_opcode, 1, 66 },
5281 { "JSR", KOC_opcode, 1, 67 },
5282 { "JSRE", KOC_opcode, 1, 68 },
5283 { "JSRD", KOC_opcode, 1, 69 },
5284
5285 { "INCR", KOC_opcode, 1, 70 },
5286 { "DECR", KOC_opcode, 1, 71 },
5287 { "COMR", KOC_opcode, 1, 72 },
5288 { "NEGR", KOC_opcode, 1, 73 },
5289 { "ADCR", KOC_opcode, 1, 74 },
5290 { "GSWD", KOC_opcode, 1, 75 },
5291 { "RSWD", KOC_opcode, 1, 76 },
5292
5293 { "HLT", KOC_opcode, 1, 77 },
5294 { "SDBD", KOC_SDBD, 1, 78 },
5295 { "EIS", KOC_opcode, 1, 79 },
5296 { "DIS", KOC_opcode, 1, 80 },
5297 { "TCI", KOC_opcode, 1, 81 },
5298 { "CLRC", KOC_opcode, 1, 82 },
5299 { "SETC", KOC_opcode, 1, 83 },
5300
5301 { "TSTR", KOC_opcode, 1, 84 }, /* MOVR Rx, Rx */
5302 { "CLRR", KOC_opcode, 1, 85 }, /* XORR Rx, Rx */
5303 { "PSHR", KOC_opcode, 1, 86 }, /* MVO@ Rx, SP */
5304 { "PULR", KOC_opcode, 1, 87 }, /* MVI@ SP, Rx */
5305 { "JR", KOC_opcode, 1, 88 }, /* MOVR Rx, PC */
5306 { "CALL", KOC_opcode, 1, 89 }, /* JSR R5, addr */
5307 { "BEGIN", KOC_opcode, 1, 90 }, /* MVO@ R5, SP */
5308 { "RETURN", KOC_opcode, 1, 91 }, /* MVI@ SP, PC */
5309
5310 { "DECLE", KOC_DDEF, 0, 0 }, /* Generates ROMW values */
5311 { "DCW", KOC_DDEF, 0, 0 }, /* Generates ROMW values */
5312 { "BIDECLE", KOC_WDEF, 0, 0 }, /* Generates SDBD values */
5313 { "ROMWIDTH", KOC_ROMW, 0, 0 },
5314 { "ROMW", KOC_ROMW, 0, 0 },
5315 { "PROC", KOC_PROC, 0, 0 },
5316 { "ENDP", KOC_ENDP, 0, 0 },
5317
5318 { "BYTE", KOC_BDEF, 0, 0 }, /* Generates 8-bit values */
5319 { "CHARDEF", KOC_CHDEF, 0, 0 },
5320 { "CHARSET", KOC_CHSET, 0, 0 },
5321 { "CHARUSE", KOC_CHUSE, 0, 0 },
5322 { "CHD", KOC_CHDEF, 0, 0 },
5323 { "DATA", KOC_DDEF, 0, 0 }, /* Generates ROMW values */
5324 { "DB", KOC_BDEF, 0, 0 }, /* Generates 8-bit values */
5325 { "DW", KOC_WDEF, 0, 0 }, /* Generates SDBD values */
5326 { "ELSE", KOC_ELSE, 0, 0 },
5327 { "END", KOC_END, 0, 0 },
5328 { "ENDI", KOC_ENDI, 0, 0 },
5329 { "EQU", KOC_EQU, 0, 0 },
5330 { "FCB", KOC_BDEF, 0, 0 }, /* Generates 8-bit values */
5331 { "FCC", KOC_SDEF, 0, 0 },
5332 { "FDB", KOC_WDEF, 0, 0 }, /* Generates SDBD values */
5333 { "IF", KOC_IF, 0, 0 },
5334 { "INCL", KOC_INCLUDE, 0, 0 },
5335 { "INCLUDE", KOC_INCLUDE, 0, 0 },
5336 { "ORG", KOC_ORG, 0, 0 },
5337 { "RES", KOC_RESM, 0, 0 },
5338 { "RESERVE", KOC_RESM, 0, 0 },
5339 { "RMB", KOC_RESM, 0, 0 },
5340 { "SET", KOC_SET, 0, 0 },
5341 { "STRING", KOC_SDEF, 0, 0 },
5342 { "WORD", KOC_WDEF, 0, 0 }, /* Generates SDBD values */
5343
5344 { "STRUCT", KOC_STRUCT, 0, 0 }, /* Opens a struct def'n */
5345 { "ENDS", KOC_ENDS, 0, 0 }, /* Closes a struct def'n */
5346
5347 { "MEMATTR", KOC_MEMATTR, 0, 0 }, /* Set memory attributes */
5348
5349 { "RPT", KOC_RPT, 0, 0 }, /* Repeat a block of code */
5350 { "REPEAT", KOC_RPT, 0, 0 }, /* Repeat a block of code */
5351 { "ENDR", KOC_ENDR, 0, 0 }, /* End repeated block */
5352
5353 { "ERR", KOC_USRERR, 0, 0 }, /* User-designated error */
5354
5355 { "STRLEN", KEOP_STRLEN, 0, 0 }, /* Returns length of string */
5356 { "ASC", KEOP_ASC, 0, 0 }, /* ASCII val of char in str */
5357
5358 { "LISTING", KOC_LIST, 0, 0 }, /* Assembler listing control */
5359 { "QEQU", KOC_QEQU, 0, 0 }, /* EQU and mark as "quiet" */
5360 { "QSET", KOC_QSET, 0, 0 }, /* SET and mark as "quiet" */
5361
5362 { "MACRO", KOC_MACERR, 0, 0 }, /* We shouldn't see MACRO */
5363 { "ENDM", KOC_MACERR, 0, 0 }, /* We shouldn't see ENDM */
5364
5365 { "BRKIF", KOC_BRKIF, 0, 0 }, /* Break out of RPT if true */
5366
5367 { "CMSG", KOC_CMSG, 0, 0 }, /* Comment message in listing */
5368 { "SMSG", KOC_SMSG, 0, 0 }, /* Status message to stdout */
5369 { "WMSG", KOC_WMSG, 0, 0 }, /* Warning message */
5370
5371 { "CFGVAR", KOC_CFGVAR, 0, 0 }, /* Configuration variable */
5372
5373 { "SRCFILE", KOC_SRCFILE, 0, 0 }, /* HLL source file / line */
5374 { "LISTCOL", KOC_LISTCOL, 0, 0 }, /* Listing formatting */
5375 { "ERR_IF_OVERWRITTEN",
5376 KOC_ERR_IF_OVERWRITTEN, 0, 0 }, /* ROM overwrite control */
5377 { "FORCE_OVERWRITE",
5378 KOC_FORCE_OVERWRITE, 0, 0 }, /* ROM overwrite control */
5379 { "", 0, 0, 0 }
5380 };
5381
5382
5383 /* ======================================================================== */
5384 /* OSTAB -- Opcode Syntax TABle. Syntax definition sets for instrs. */
5385 /* */
5386 /* Legend: */
5387 /* REG Register. */
5388 /* EXP EXPression */
5389 /* CEX Constant EXpression (eg. exp. prefixed w/ #). */
5390 /* IMP Implied operand. */
5391 /* ======================================================================== */
5392 struct opsynt ostab[] =
5393 {
5394 /* invalid 0 */ { 0, 1, 0 },
5395 /* invalid 1 */ { 0xFFFF, 1, 1 },
5396
5397 /* MVO 2 */ { ST_REGEXP, 1, 2 },
5398 /* MVI 3 */ { ST_EXPREG, 1, 3 },
5399 /* ADD 4 */ { ST_EXPREG, 1, 4 },
5400 /* SUB 5 */ { ST_EXPREG, 1, 5 },
5401 /* CMP 6 */ { ST_EXPREG, 1, 6 },
5402 /* AND 7 */ { ST_EXPREG, 1, 7 },
5403 /* XOR 8 */ { ST_EXPREG, 1, 8 },
5404
5405 /* MVO@ 9 */ { ST_REGREG, 1, 9 },
5406 /* MVI@ 10 */ { ST_REGREG, 1, 10 },
5407 /* ADD@ 11 */ { ST_REGREG, 1, 11 },
5408 /* SUB@ 12 */ { ST_REGREG, 1, 12 },
5409 /* CMP@ 13 */ { ST_REGREG, 1, 13 },
5410 /* AND@ 14 */ { ST_REGREG, 1, 14 },
5411 /* XOR@ 15 */ { ST_REGREG, 1, 15 },
5412
5413 /* MVOI 16 */ { ST_REGCEX, 1, 16 },
5414 /* MVII 17 */ { ST_CEXREG, 2, 17 },
5415 /* ADDI 18 */ { ST_CEXREG, 2, 19 },
5416 /* SUBI 19 */ { ST_CEXREG, 2, 21 },
5417 /* CMPI 20 */ { ST_CEXREG, 2, 23 },
5418 /* ANDI 21 */ { ST_CEXREG, 2, 25 },
5419 /* XORI 22 */ { ST_CEXREG, 2, 27 },
5420
5421 /* unused 23 */ { 0, 1, 0 }, /* oops */
5422 /* MOVR 24 */ { ST_REGREG, 1, 29 },
5423 /* ADDR 25 */ { ST_REGREG, 1, 30 },
5424 /* SUBR 26 */ { ST_REGREG, 1, 31 },
5425 /* CMPR 27 */ { ST_REGREG, 1, 32 },
5426 /* ANDR 28 */ { ST_REGREG, 1, 33 },
5427 /* XORR 29 */ { ST_REGREG, 1, 34 },
5428
5429 /* B 30 */ { ST_EXP, 1, 35 },
5430 /* BC 31 */ { ST_EXP, 1, 36 },
5431 /* BOV 32 */ { ST_EXP, 1, 37 },
5432 /* BPL 33 */ { ST_EXP, 1, 38 },
5433 /* BEQ 34 */ { ST_EXP, 1, 39 },
5434 /* BLT 35 */ { ST_EXP, 1, 40 },
5435 /* BLE 36 */ { ST_EXP, 1, 41 },
5436 /* BUSC 37 */ { ST_EXP, 1, 42 },
5437
5438 /* unused 38 */ { 0, 1, 0 }, /* oops */
5439 /* BNC 39 */ { ST_EXP, 1, 44 },
5440 /* BNOV 40 */ { ST_EXP, 1, 45 },
5441 /* BMI 41 */ { ST_EXP, 1, 46 },
5442 /* BNEQ 42 */ { ST_EXP, 1, 47 },
5443 /* BGE 43 */ { ST_EXP, 1, 48 },
5444 /* BGT 44 */ { ST_EXP, 1, 49 },
5445 /* BESC 45 */ { ST_EXP, 1, 50 },
5446
5447 /* SWAP 46 */ { ST_REG, 1, 51 },
5448 /* SWAP 47 */ { ST_REGEXP, 1, 52 },
5449 /* SLL 48 */ { ST_REG, 1, 53 },
5450 /* SLL 49 */ { ST_REGEXP, 1, 54 },
5451 /* RLC 50 */ { ST_REG, 1, 55 },
5452 /* RLC 51 */ { ST_REGEXP, 1, 56 },
5453 /* SLLC 52 */ { ST_REG, 1, 57 },
5454 /* SLLC 53 */ { ST_REGEXP, 1, 58 },
5455 /* SLR 54 */ { ST_REG, 1, 59 },
5456 /* SLR 55 */ { ST_REGEXP, 1, 60 },
5457 /* SAR 56 */ { ST_REG, 1, 61 },
5458 /* SAR 57 */ { ST_REGEXP, 1, 62 },
5459 /* RRC 58 */ { ST_REG, 1, 63 },
5460 /* RRC 59 */ { ST_REGEXP, 1, 64 },
5461 /* SARC 60 */ { ST_REG, 1, 65 },
5462 /* SARC 61 */ { ST_REGEXP, 1, 66 },
5463
5464 /* NOP 62 */ { ST_IMP, 1, 67 },
5465 /* SIN 63 */ { ST_IMP, 1, 68 },
5466
5467 /* J 64 */ { ST_EXP, 1, 69 },
5468 /* JE 65 */ { ST_EXP, 1, 70 },
5469 /* JD 66 */ { ST_EXP, 1, 71 },
5470 /* JSR 67 */ { ST_REGEXP, 1, 72 },
5471 /* JSRE 68 */ { ST_REGEXP, 1, 73 },
5472 /* JSRD 69 */ { ST_REGEXP, 1, 74 },
5473
5474 /* INCR 70 */ { ST_REG, 1, 75 },
5475 /* DECR 71 */ { ST_REG, 1, 76 },
5476 /* COMR 72 */ { ST_REG, 1, 77 },
5477 /* NEGR 73 */ { ST_REG, 1, 78 },
5478 /* ADCR 74 */ { ST_REG, 1, 79 },
5479 /* GSWD 75 */ { ST_REG, 1, 80 },
5480 /* RSWD 76 */ { ST_REG, 1, 81 },
5481
5482 /* HLT 77 */ { ST_IMP, 1, 82 },
5483 /* SDBD 78 */ { ST_IMP, 1, 83 },
5484 /* EIS 79 */ { ST_IMP, 1, 84 },
5485 /* DIS 80 */ { ST_IMP, 1, 85 },
5486 /* TCI 81 */ { ST_IMP, 1, 86 },
5487 /* CLRC 82 */ { ST_IMP, 1, 87 },
5488 /* SETC 83 */ { ST_IMP, 1, 88 },
5489
5490 /* TSTR 84 */ { ST_REG, 1, 89 },
5491 /* CLRR 85 */ { ST_REG, 1, 90 },
5492 /* PSHR 86 */ { ST_REG, 1, 91 },
5493 /* PULR 87 */ { ST_REG, 1, 92 },
5494 /* JR 88 */ { ST_REG, 1, 93 },
5495 /* CALL 89 */ { ST_EXP, 1, 94 },
5496 /* BEGIN 90 */ { ST_IMP, 1, 95 },
5497 /* RETURN 91 */ { ST_IMP, 1, 96 },
5498
5499 /* NOPP 92 */ { ST_EXP, 1, 43 },
5500 /* NOPP 93 */ { ST_IMP, 1, 97 },
5501
5502 /* NOP2 94 */ { ST_IMP, 1, 98 },
5503 /* SIN2 95 */ { ST_IMP, 1, 99 },
5504
5505 /* BEXT 95 */ { ST_EXPEXP, 1, 100 },
5506
5507 /* end */ { 0, 0, 0 }
5508 };
5509
5510
5511 /* ======================================================================== */
5512 /* Helper macros. */
5513 /* MVO_OK Tests arg 2 to make sure it's R1 .. R6. */
5514 /* SH_OK Tests if shift amount is ok. */
5515 /* CST_OK Tests if constant is ok (within field width). */
5516 /* DBD Generate double-byte-data. */
5517 /* RR Register/Register generator. Reused for Direct, Immediate. */
5518 /* BR Branch Relative generator. */
5519 /* SH Shift generator. */
5520 /* SR Single-register generator */
5521 /* JSR Jump/JSR generator */
5522 /* CST Constant arg generator (eg. immediate argument) */
5523 /* ======================================================================== */
5524 #define MVO_OK "[2#].0=.[2#].7=+T$"
5525 #define SH_OK(n) #n ".1>T$" #n ".<0T$"
5526 #define CST_OK(w,c) #c "." #w"I$"
5527 #define DBD(x) #x ".FF&x" #x ".8}.FF&x"
5528 #define RR(o,x,y) #o "." #x ".3{|." #y "|x"
5529 #define BRDIR(a) "P.2+." #a ">."
5530 #define BROFS(a) #a ".P.2+-." BRDIR(a) "!_^"
5531 #define BR(c,a,w) "0200." #c "|." BRDIR(a) "5{|x" BROFS(a) "~x" #w "I$"
5532 #define BX(c,a,w) #c ".4I$" \
5533 "0210." #c "|." BRDIR(a) "5{|x" BROFS(a) "~x" #w "I$"
5534 /*#define BR(c,a,m) "0200." #c "|." BRDIR(a) "5{|x" #a "x"*/
5535 #define CST(c,m) CST_OK(m,c) #c "x"
5536 #define SH(o,n,r) SH_OK(n) "0040." #o ".3{|." #n ".1&.2{|." #r "|x"
5537 #define SR(o,r) "0000." #o ".3{|." #r "|x"
5538 #define JSR(r,e,a) "0004x" #r ".3&.8{." #a ".8}.FC&|." #e "|x" #a ".3FF&x"
5539
5540
5541 /* ======================================================================== */
5542 /* IGTAB -- Instruction Generator Table. */
5543 /* ======================================================================== */
5544 struct igel igtab[] =
5545 {
5546 /* inv 0 */ { SDBD, 0, "[Xnullentry" },
5547 /* inv 1 */ { SDBD, 0, "[Xinvalid opcode" },
5548
5549 /* MVO 2 */ { SDBD, 0, RR(0240,0,[1#]) CST([2=],[3#]) },
5550 /* MVI 3 */ { SDBD, 0, RR(0280,0,[2#]) CST([1=],[3#]) },
5551 /* ADD 4 */ { SDBD, 0, RR(02C0,0,[2#]) CST([1=],[3#]) },
5552 /* SUB 5 */ { SDBD, 0, RR(0300,0,[2#]) CST([1=],[3#]) },
5553 /* CMP 6 */ { SDBD, 0, RR(0340,0,[2#]) CST([1=],[3#]) },
5554 /* AND 7 */ { SDBD, 0, RR(0380,0,[2#]) CST([1=],[3#]) },
5555 /* XOR 8 */ { SDBD, 0, RR(03C0,0,[2#]) CST([1=],[3#]) },
5556
5557 /* MVO@ 9 */ { SDBD, 0, MVO_OK
5558 RR(0240,[2#],[1#]) },
5559 /* MVI@ 10 */ { IND_RG, IND_RG, RR(0280,[1#],[2#]) },
5560 /* ADD@ 11 */ { IND_RG, IND_RG, RR(02C0,[1#],[2#]) },
5561 /* SUB@ 12 */ { IND_RG, IND_RG, RR(0300,[1#],[2#]) },
5562 /* CMP@ 13 */ { IND_RG, IND_RG, RR(0340,[1#],[2#]) },
5563 /* AND@ 14 */ { IND_RG, IND_RG, RR(0380,[1#],[2#]) },
5564 /* XOR@ 15 */ { IND_RG, IND_RG, RR(03C0,[1#],[2#]) },
5565
5566 /* MVOI 16 */ { SDBD, 0, RR(0240,7,[1#]) CST([2=],[3#]) },
5567 /* MVII 17 */ { SDBD, 0, RR(0280,7,[2#]) CST([1=],[3#]) },
5568 /* MVII 18 */ { SDBD, SDBD, RR(0280,7,[2#]) DBD([1=]) },
5569 /* ADDI 19 */ { SDBD, 0, RR(02C0,7,[2#]) CST([1=],[3#]) },
5570 /* ADDI 20 */ { SDBD, SDBD, RR(02C0,7,[2#]) DBD([1=]) },
5571 /* SUBI 21 */ { SDBD, 0, RR(0300,7,[2#]) CST([1=],[3#]) },
5572 /* SUBI 22 */ { SDBD, SDBD, RR(0300,7,[2#]) DBD([1=]) },
5573 /* CMPI 23 */ { SDBD, 0, RR(0340,7,[2#]) CST([1=],[3#]) },
5574 /* CMPI 24 */ { SDBD, SDBD, RR(0340,7,[2#]) DBD([1=]) },
5575 /* ANDI 25 */ { SDBD, 0, RR(0380,7,[2#]) CST([1=],[3#]) },
5576 /* ANDI 26 */ { SDBD, SDBD, RR(0380,7,[2#]) DBD([1=]) },
5577 /* XORI 27 */ { SDBD, 0, RR(03C0,7,[2#]) CST([1=],[3#]) },
5578 /* XORI 28 */ { SDBD, SDBD, RR(03C0,7,[2#]) DBD([1=]) },
5579
5580 /* MOVR 29 */ { SDBD, 0, RR(0080,[1#],[2#]) },
5581 /* ADDR 30 */ { SDBD, 0, RR(00C0,[1#],[2#]) },
5582 /* SUBR 31 */ { SDBD, 0, RR(0100,[1#],[2#]) },
5583 /* CMPR 32 */ { SDBD, 0, RR(0140,[1#],[2#]) },
5584 /* ANDR 33 */ { SDBD, 0, RR(0180,[1#],[2#]) },
5585 /* XORR 34 */ { SDBD, 0, RR(01C0,[1#],[2#]) },
5586
5587 /* B 35 */ { SDBD, 0, BR(0,[1=],[3#]) },
5588 /* BC 36 */ { SDBD, 0, BR(1,[1=],[3#]) },
5589 /* BOV 37 */ { SDBD, 0, BR(2,[1=],[3#]) },
5590 /* BPL 38 */ { SDBD, 0, BR(3,[1=],[3#]) },
5591 /* BEQ 39 */ { SDBD, 0, BR(4,[1=],[3#]) },
5592 /* BLT 40 */ { SDBD, 0, BR(5,[1=],[3#]) },
5593 /* BLE 41 */ { SDBD, 0, BR(6,[1=],[3#]) },
5594 /* BUSC 42 */ { SDBD, 0, BR(7,[1=],[3#]) },
5595 /* NOPP 43 */ { SDBD, 0, BR(8,[1=],[3#]) },
5596 /* BNC 44 */ { SDBD, 0, BR(9,[1=],[3#]) },
5597 /* BNOV 45 */ { SDBD, 0, BR(A,[1=],[3#]) },
5598 /* BMI 46 */ { SDBD, 0, BR(B,[1=],[3#]) },
5599 /* BNEQ 47 */ { SDBD, 0, BR(C,[1=],[3#]) },
5600 /* BGE 48 */ { SDBD, 0, BR(D,[1=],[3#]) },
5601 /* BGT 49 */ { SDBD, 0, BR(E,[1=],[3#]) },
5602 /* BESC 50 */ { SDBD, 0, BR(F,[1=],[3#]) },
5603
5604 /* SWAP 51 */ { SDBD|SHF_RG,SHF_RG, SH(0,0,[1#]) },
5605 /* SWAP 52 */ { SDBD|SHF_RG,SHF_RG, SH(0,[2=].1-,[1#]) },
5606 /* SLL 53 */ { SDBD|SHF_RG,SHF_RG, SH(1,0,[1#]) },
5607 /* SLL 54 */ { SDBD|SHF_RG,SHF_RG, SH(1,[2=].1-,[1#]) },
5608 /* RLC 55 */ { SDBD|SHF_RG,SHF_RG, SH(2,0,[1#]) },
5609 /* RLC 56 */ { SDBD|SHF_RG,SHF_RG, SH(2,[2=].1-,[1#]) },
5610 /* SLLC 57 */ { SDBD|SHF_RG,SHF_RG, SH(3,0,[1#]) },
5611 /* SLLC 58 */ { SDBD|SHF_RG,SHF_RG, SH(3,[2=].1-,[1#]) },
5612 /* SLR 59 */ { SDBD|SHF_RG,SHF_RG, SH(4,0,[1#]) },
5613 /* SLR 60 */ { SDBD|SHF_RG,SHF_RG, SH(4,[2=].1-,[1#]) },
5614 /* SAR 61 */ { SDBD|SHF_RG,SHF_RG, SH(5,0,[1#]) },
5615 /* SAR 62 */ { SDBD|SHF_RG,SHF_RG, SH(5,[2=].1-,[1#]) },
5616 /* RRC 63 */ { SDBD|SHF_RG,SHF_RG, SH(6,0,[1#]) },
5617 /* RRC 64 */ { SDBD|SHF_RG,SHF_RG, SH(6,[2=].1-,[1#]) },
5618 /* SARC 65 */ { SDBD|SHF_RG,SHF_RG, SH(7,0,[1#]) },
5619 /* SARC 66 */ { SDBD|SHF_RG,SHF_RG, SH(7,[2=].1-,[1#]) },
5620
5621 /* NOP 67 */ { SDBD, 0, "0034x" },
5622 /* SIN 68 */ { SDBD, 0, "0036x" },
5623
5624 /* J 69 */ { SDBD, 0, JSR(3,0,[1=]) },
5625 /* JE 70 */ { SDBD, 0, JSR(3,1,[1=]) },
5626 /* JD 71 */ { SDBD, 0, JSR(3,2,[1=]) },
5627 /* JSR 72 */ { SDBD|JSR_RG,JSR_RG, JSR([1#],0,[2=]) },
5628 /* JSRE 73 */ { SDBD|JSR_RG,JSR_RG, JSR([1#],1,[2=]) },
5629 /* JSRD 74 */ { SDBD|JSR_RG,JSR_RG, JSR([1#],2,[2=]) },
5630
5631 /* INCR 75 */ { SDBD, 0, SR(1,[1#]) },
5632 /* DECR 76 */ { SDBD, 0, SR(2,[1#]) },
5633 /* COMR 77 */ { SDBD, 0, SR(3,[1#]) },
5634 /* NEGR 78 */ { SDBD, 0, SR(4,[1#]) },
5635 /* ADCR 79 */ { SDBD, 0, SR(5,[1#]) },
5636 /* GSWD 80 */ { SDBD|SHF_RG,SHF_RG, SR(6,[1#]) },
5637 /* RSWD 81 */ { SDBD, 0, SR(7,[1#]) },
5638
5639 /* HLT 82 */ { SDBD, 0, "0000x" },
5640 /* SDBD 83 */ { SDBD, 0, "0001x" },
5641 /* EIS 84 */ { SDBD, 0, "0002x" },
5642 /* DIS 85 */ { SDBD, 0, "0003x" },
5643 /* TCI 86 */ { SDBD, 0, "0005x" },
5644 /* CLRC 87 */ { SDBD, 0, "0006x" },
5645 /* SETC 88 */ { SDBD, 0, "0007x" },
5646
5647 /* TSTR 89 */ { SDBD, 0, RR(0080,[1#],[1#]) },
5648 /* CLRR 90 */ { SDBD, 0, RR(01C0,[1#],[1#]) },
5649 /* PSHR 91 */ { SDBD, 0, RR(0240,6,[1#]) },
5650 /* PULR 92 */ { 0, 0, RR(0280,6,[1#]) },
5651 /* JR 93 */ { SDBD, 0, RR(0080,[1#],7) },
5652 /* CALL 94 */ { SDBD, 0, JSR(5,0,[1=]) },
5653 /* BEGIN 95 */ { SDBD, 0, RR(0240,6,5) },
5654 /* RETURN 96*/ { SDBD, 0, RR(0280,6,7) },
5655
5656 /* NOPP 97 */ { SDBD, 0, "0208x0000x" },
5657 /* NOP2 98 */ { SDBD, 0, "0035x" },
5658 /* SIN2 99 */ { SDBD, 0, "0037x" },
5659
5660 /* BESC 100 */ { SDBD, 0, BX([4#],[1=],[3#]) },
5661
5662 /* end */ { 0, 0, "[Xinvalid opcode" },
5663 };
5664
5665 #define NUMOPCODE (sizeof(optab)/sizeof(struct opsym))
5666
5667 int gnumopcode = NUMOPCODE;
5668 int ophashlnk[NUMOPCODE];
5669
5670 /* ======================================================================== */
5671 /* End of file: fraptabdef.c */
5672 /* ======================================================================== */
5673