6 #include <X11/Intrinsic.h>
9 #include "../util/VMSparam.h"
12 #include <sys/param.h>
18 #include "interpret.h"
21 /* Macros to add error processing to AddOp and AddSym calls */
22 #define ADD_OP(op) if (!AddOp(op, &ErrMsg)) return 1
23 #define ADD_SYM(sym) if (!AddSym(sym, &ErrMsg)) return 1
24 #define ADD_IMMED(val) if (!AddImmediate(val, &ErrMsg)) return 1
25 #define ADD_BR_OFF(to) if (!AddBranchOffset(to, &ErrMsg)) return 1
26 #define SET_BR_OFF(from, to) *((int *)(from)) = ((Inst *)(to)) - ((Inst *)(from))
28 /* Max. length for a string constant (... there shouldn't be a maximum) */
29 #define MAX_STRING_CONST_LEN 5000
31 static const char CVSID
[] = "$Id: parse_noyacc.c,v 1.3 2002/07/11 21:18:10 slobasso Exp $";
32 static int yyerror(char *s
);
33 static int yylex(void);
35 static int follow(char expect
, int yes
, int no
);
36 static int follow2(char expect1
, int yes1
, char expect2
, int yes2
, int no
);
37 static int follow_non_whitespace(char expect
, int yes
, int no
);
38 static Symbol
*matchesActionRoutine(char **inPtr
);
42 extern Inst
*LoopStack
[]; /* addresses of break, cont stmts */
43 extern Inst
**LoopStackPtr
; /* to fill at the end of a loop */
62 # define IF_NO_ELSE 267
80 # define UNARY_MINUS 285
86 #define yyclearin yychar = -1
87 #define yyerrok yyerrflag = 0
91 #define YYMAXDEPTH 150
93 YYSTYPE yylval
, yyval
;
94 typedef int yytabelem
;
95 # define YYERRCODE 256
98 /* User Subroutines Section */
102 ** Parse a null terminated string and create a program from it (this is the
103 ** parser entry point). The program created by this routine can be
104 ** executed using ExecuteProgram. Returns program on success, or NULL
105 ** on failure. If the command failed, the error message is returned
106 ** as a pointer to a static string in msg, and the length of the string up
107 ** to where parsing failed in stoppedAt.
109 Program
*ParseMacro(char *expr
, char **msg
, char **stoppedAt
)
113 BeginCreatingProgram();
115 /* call yyparse to parse the string and check for success. If the parse
116 failed, return the error message and string index (the grammar aborts
117 parsing at the first error) */
122 FreeProgram(FinishCreatingProgram());
126 /* get the newly created program */
127 prog
= FinishCreatingProgram();
129 /* parse succeeded */
136 static int yylex(void)
140 static int stringConstIndex
= 0;
141 static DataValue value
= {0, {0}};
142 static char escape
[] = "\\\"ntbrfav";
143 static char replace
[] = "\\\"\n\t\b\r\f\a\v";
145 /* skip whitespace and backslash-newline combinations which are
146 also considered whitespace */
148 if (*InPtr
== '\\' && *(InPtr
+ 1) == '\n')
150 else if (*InPtr
== ' ' || *InPtr
== '\t')
158 while (*InPtr
!= '\n' && *InPtr
!= '\0') InPtr
++;
160 /* return end of input at the end of the string */
161 if (*InPtr
== '\0') {
165 /* process number tokens */
166 if (isdigit((unsigned char)*InPtr
)) { /* number */
168 sscanf(InPtr
, "%d%n", &value
.val
.n
, &len
);
169 sprintf(name
, "const %d", value
.val
.n
);
172 if ((yylval
.sym
=LookupSymbol(name
)) == NULL
)
173 yylval
.sym
= InstallSymbol(name
, CONST_SYM
, value
);
177 /* process symbol tokens. "define" is a special case not handled
178 by this parser, considered end of input. Another special case
179 is action routine names which are allowed to contain '-' despite
180 the ambiguity, handled in matchesActionRoutine. */
181 if (isalpha((unsigned char)*InPtr
) || *InPtr
== '$') {
182 if ((s
=matchesActionRoutine(&InPtr
)) == NULL
) {
183 char symName
[MAX_SYM_LEN
+1], *p
= symName
;
185 while (isalnum((unsigned char)*InPtr
) || *InPtr
=='_') {
186 if (p
>= symName
+ MAX_SYM_LEN
)
192 if (!strcmp(symName
, "while")) return WHILE
;
193 if (!strcmp(symName
, "if")) return IF
;
194 if (!strcmp(symName
, "else")) return ELSE
;
195 if (!strcmp(symName
, "for")) return FOR
;
196 if (!strcmp(symName
, "break")) return BREAK
;
197 if (!strcmp(symName
, "continue")) return CONTINUE
;
198 if (!strcmp(symName
, "return")) return RETURN
;
199 if (!strcmp(symName
, "in")) return IN
;
200 if (!strcmp(symName
, "delete") && follow_non_whitespace('(', SYMBOL
, DELETE
) == DELETE
) return DELETE
;
201 if (!strcmp(symName
, "define")) {
205 if ((s
=LookupSymbol(symName
)) == NULL
) {
206 s
= InstallSymbol(symName
, symName
[0]=='$' ?
207 (isdigit((unsigned char)symName
[1]) ?
208 ARG_SYM
: GLOBAL_SYM
) : LOCAL_SYM
, value
);
209 s
->value
.tag
= NO_TAG
;
216 /* process quoted strings w/ embedded escape sequences */
217 if (*InPtr
== '\"') {
218 char string
[MAX_STRING_CONST_LEN
], *p
= string
;
221 while (*InPtr
!= '\0' && *InPtr
!= '\"' && *InPtr
!= '\n') {
222 if (p
>= string
+ MAX_STRING_CONST_LEN
) {
226 if (*InPtr
== '\\') {
228 if (*InPtr
== '\n') {
232 for (i
=0; escape
[i
]!='\0'; i
++) {
233 if (escape
[i
] == '\0') {
236 } else if (escape
[i
] == *InPtr
) {
247 if ((yylval
.sym
= LookupStringConstSymbol(string
)) == NULL
) {
248 value
.val
.str
= AllocString(p
-string
+1);
249 strcpy(value
.val
.str
, string
);
250 value
.tag
= STRING_TAG
;
251 sprintf(stringName
, "string #%d", stringConstIndex
++);
252 yylval
.sym
= InstallSymbol(stringName
, CONST_SYM
, value
);
257 /* process remaining two character tokens or return single char as token */
259 case '>': return follow('=', GE
, GT
);
260 case '<': return follow('=', LE
, LT
);
261 case '=': return follow('=', EQ
, '=');
262 case '!': return follow('=', NE
, NOT
);
263 case '+': return follow2('+', INCR
, '=', ADDEQ
, '+');
264 case '-': return follow2('-', DECR
, '=', SUBEQ
, '-');
265 case '|': return follow2('|', OR
, '=', OREQ
, '|');
266 case '&': return follow2('&', AND
, '=', ANDEQ
, '&');
267 case '*': return follow2('*', POW
, '=', MULEQ
, '*');
268 case '/': return follow('=', DIVEQ
, '/');
269 case '%': return follow('=', MODEQ
, '%');
270 case '^': return POW
;
271 default: return *(InPtr
-1);
276 ** look ahead for >=, etc.
278 static int follow(char expect
, int yes
, int no
)
280 if (*InPtr
++ == expect
)
285 static int follow2(char expect1
, int yes1
, char expect2
, int yes2
, int no
)
287 char next
= *InPtr
++;
296 static int follow_non_whitespace(char expect
, int yes
, int no
)
298 char *localInPtr
= InPtr
;
301 if (*localInPtr
== ' ' || *localInPtr
== '\t') {
304 else if (*localInPtr
== '\\' && *(localInPtr
+ 1) == '\n') {
307 else if (*localInPtr
== expect
) {
317 ** Look (way) ahead for hyphenated routine names which begin at inPtr. A
318 ** hyphenated name is allowed if it is pre-defined in the global symbol
319 ** table. If a matching name exists, returns the symbol, and update "inPtr".
321 ** I know this is horrible language design, but existing nedit action routine
322 ** names contain hyphens. Handling them here in the lexical analysis process
323 ** is much easier than trying to deal with it in the parser itself. (sorry)
325 static Symbol
*matchesActionRoutine(char **inPtr
)
329 char symbolName
[MAX_SYM_LEN
+1];
333 for (c
= *inPtr
; isalnum((unsigned char)*c
) || *c
=='_' ||
334 ( *c
=='-' && isalnum((unsigned char)(*(c
+1)))); c
++) {
342 s
= LookupSymbol(symbolName
);
349 ** Called by yacc to report errors (just stores for returning when
350 ** parsing is aborted. The error token action is to immediate abort
351 ** parsing, so this message is immediately reported to the caller
354 static int yyerror(char *s
)
359 static const yytabelem yyexca
[] ={
374 static const yytabelem yyact
[]={
376 75, 83, 190, 70, 171, 73, 71, 170, 72, 169,
377 74, 168, 110, 167, 75, 83, 36, 136, 166, 73,
378 71, 37, 72, 165, 74, 173, 75, 75, 83, 145,
379 97, 73, 73, 71, 96, 72, 74, 74, 55, 54,
380 75, 83, 15, 53, 3, 73, 71, 8, 72, 4,
381 74, 62, 109, 75, 70, 43, 63, 148, 73, 71,
382 6, 72, 138, 74, 138, 162, 138, 114, 70, 6,
383 17, 18, 19, 56, 163, 64, 41, 6, 112, 111,
384 70, 70, 113, 59, 17, 18, 19, 84, 27, 26,
385 155, 15, 9, 20, 70, 21, 12, 13, 14, 187,
386 25, 84, 114, 6, 67, 29, 42, 70, 6, 147,
387 61, 157, 138, 146, 84, 137, 99, 75, 90, 17,
388 18, 19, 73, 71, 31, 72, 139, 74, 154, 138,
389 28, 24, 153, 152, 36, 151, 15, 9, 20, 37,
390 21, 12, 13, 14, 150, 149, 15, 9, 20, 43,
391 21, 12, 13, 14, 36, 176, 1, 16, 36, 37,
392 101, 86, 144, 37, 17, 18, 19, 85, 172, 10,
393 41, 70, 11, 159, 17, 18, 19, 46, 47, 48,
394 49, 50, 51, 52, 186, 0, 0, 117, 0, 0,
395 0, 0, 57, 160, 0, 0, 7, 143, 22, 0,
396 42, 0, 76, 0, 0, 0, 158, 135, 0, 0,
397 64, 0, 0, 0, 175, 0, 0, 7, 0, 0,
398 0, 5, 0, 0, 185, 0, 140, 0, 0, 0,
399 0, 0, 0, 33, 34, 35, 0, 0, 0, 89,
400 88, 77, 78, 79, 80, 81, 82, 87, 0, 0,
401 22, 0, 0, 76, 88, 77, 78, 79, 80, 81,
402 82, 87, 38, 0, 39, 40, 0, 76, 77, 78,
403 79, 80, 81, 82, 87, 0, 0, 0, 0, 76,
404 76, 77, 78, 79, 80, 81, 82, 87, 0, 0,
405 0, 0, 0, 76, 77, 78, 79, 80, 81, 82,
406 87, 0, 0, 44, 45, 0, 76, 0, 0, 15,
407 9, 20, 0, 21, 12, 13, 14, 0, 15, 9,
408 20, 0, 21, 12, 13, 14, 15, 9, 20, 0,
409 21, 12, 13, 14, 0, 0, 0, 17, 18, 19,
410 0, 0, 0, 0, 0, 0, 17, 18, 19, 161,
411 0, 33, 34, 35, 17, 18, 19, 15, 9, 20,
412 0, 21, 12, 13, 14, 0, 91, 92, 7, 0,
413 76, 33, 34, 35, 0, 33, 34, 35, 0, 22,
414 38, 0, 39, 40, 32, 17, 18, 19, 0, 0,
415 0, 189, 0, 115, 0, 193, 0, 44, 45, 195,
416 38, 0, 39, 40, 38, 0, 39, 40, 0, 0,
417 60, 60, 2, 0, 0, 68, 0, 0, 23, 0,
418 0, 0, 94, 95, 0, 0, 0, 0, 0, 0,
419 0, 0, 0, 0, 0, 0, 0, 58, 0, 0,
420 0, 65, 66, 0, 69, 0, 0, 0, 0, 0,
421 0, 0, 0, 0, 0, 0, 118, 119, 120, 121,
422 122, 123, 124, 125, 126, 127, 128, 129, 130, 131,
423 132, 133, 134, 0, 0, 0, 0, 0, 68, 100,
424 116, 0, 0, 68, 0, 68, 0, 68, 68, 68,
425 68, 68, 68, 68, 30, 0, 0, 0, 60, 0,
426 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
427 0, 0, 0, 0, 0, 0, 93, 0, 0, 0,
428 0, 98, 0, 0, 141, 142, 102, 103, 104, 105,
429 106, 107, 108, 0, 0, 0, 0, 0, 0, 0,
430 0, 68, 0, 0, 0, 0, 0, 0, 0, 68,
431 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
432 0, 0, 68, 68, 68, 68, 68, 68, 68, 0,
433 0, 0, 174, 0, 0, 0, 0, 0, 0, 0,
434 0, 0, 0, 0, 0, 184, 0, 0, 0, 188,
435 0, 0, 0, 0, 0, 0, 0, 0, 0, 191,
436 192, 0, 0, 194, 0, 0, 0, 0, 0, 0,
437 0, 0, 0, 0, 0, 0, 0, 0, 156, 0,
438 0, 0, 0, 0, 0, 0, 0, 0, 164, 0,
439 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
440 0, 0, 0, 0, 0, 177, 178, 179, 180, 181,
442 static const yytabelem yypact
[]={
444 -212, -1000, 98, -1000, -168, -1000, -1000, -1000, 121, 60,
445 49, 48, 120, 95, 114, 15, -91, -216, -220, -221,
446 -1000, -1000, -1000, 67, -1000, 118, 118, -203, -1000, -1000,
447 94, -1000, -37, -1000, -1000, 78, 118, 118, 118, -225,
448 -229, 118, 118, 118, -1000, -1000, 118, 118, 118, 118,
449 118, 118, 118, -39, -1000, -1000, -113, -1000, 93, 38,
450 -37, 37, 23, 109, -1000, 93, 93, -1000, -37, 93,
451 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
452 118, 118, 118, 118, 118, 118, 118, 118, -1000, -1000,
453 118, -1000, -1000, -24, -88, -88, -1000, -1000, 118, 22,
454 118, 85, 118, 118, 118, 118, 118, 118, 118, 118,
455 -1000, -1000, -1000, 118, -217, -230, 93, 20, -11, -11,
456 -88, -88, -88, -88, 80, 80, 80, 80, 80, 80,
457 16, 3, -10, -23, 80, 68, -1000, -4, 118, -1000,
458 18, 50, 50, 6, -1000, 33, -1000, -1000, 118, -245,
459 -251, -257, -260, -263, -266, -270, 118, -1000, -237, -1000,
460 -1000, -1000, -217, -1000, 118, 118, 118, 118, 118, 118,
461 118, 118, -1000, -1000, 59, 58, -1000, 118, 118, 118,
462 118, 118, 118, 118, 50, -123, -1000, -1000, 50, -1000,
463 -1000, 93, 50, -1000, 93, -1000 };
464 static const yytabelem yypgo
[]={
466 0, 116, 83, 51, 172, 169, 168, 167, 161, 157,
467 156, 412, 49, 206, 193, 47, 155, 479, 145, 144,
468 135, 133, 132, 128, 90, 384 };
469 static const yytabelem yyr1
[]={
471 0, 10, 10, 10, 10, 13, 13, 13, 12, 12,
472 14, 14, 14, 14, 14, 16, 14, 14, 14, 14,
473 14, 15, 15, 15, 15, 15, 15, 15, 15, 15,
474 15, 18, 15, 19, 15, 20, 15, 21, 15, 22,
475 15, 23, 15, 24, 15, 15, 15, 15, 15, 15,
476 9, 3, 3, 3, 1, 1, 1, 17, 17, 25,
477 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
478 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
479 25, 25, 25, 25, 25, 25, 25, 25, 5, 4,
480 6, 2, 2, 7, 8, 11, 11 };
481 static const yytabelem yyr2
[]={
483 0, 5, 11, 9, 3, 10, 8, 2, 2, 4,
484 6, 13, 19, 13, 21, 1, 19, 7, 7, 9,
485 7, 7, 7, 7, 7, 7, 7, 7, 7, 11,
486 13, 1, 15, 1, 15, 1, 15, 1, 15, 1,
487 15, 1, 15, 1, 15, 9, 5, 5, 5, 5,
488 3, 1, 3, 7, 1, 3, 7, 2, 5, 3,
489 3, 3, 9, 6, 9, 7, 7, 7, 7, 7,
490 7, 5, 7, 7, 7, 7, 7, 7, 7, 7,
491 7, 7, 5, 5, 5, 5, 5, 7, 3, 3,
492 3, 1, 3, 3, 3, 0, 4 };
493 static const yytabelem yychk
[]={
495 -1000, -10, -11, 256, -12, 123, 10, -14, -15, 260,
496 -5, -4, 264, 265, 266, 259, -9, 287, 288, 289,
497 261, 263, -14, -11, 10, 40, 40, 40, 10, 10,
498 -17, 10, -25, 257, 258, 259, 40, 45, 286, 288,
499 289, 61, 91, 40, 288, 289, 268, 269, 270, 271,
500 272, 273, 274, 259, 259, 259, -12, 125, -11, -2,
501 -25, -2, -3, 259, -15, -11, -11, 10, -25, -11,
502 91, 43, 45, 42, 47, 37, 290, 278, 279, 280,
503 281, 282, 283, 38, 124, -7, -8, 284, 277, 276,
504 40, 288, 289, -17, -25, -25, 259, 259, -17, -1,
505 -17, -1, -17, -17, -17, -17, -17, -17, -17, 91,
506 125, 41, 41, 59, 44, 284, -11, -1, -25, -25,
507 -25, -25, -25, -25, -25, -25, -25, -25, -25, -25,
508 -25, -25, -25, -25, -25, -1, 41, 93, 44, 41,
509 -1, -11, -11, -2, -15, 259, 93, 41, 61, -18,
510 -19, -20, -21, -22, -23, -24, -17, 93, -13, 123,
511 -14, -13, 59, 41, -17, 268, 269, 270, 271, 272,
512 273, 274, -6, 262, -11, -3, -16, -17, -17, -17,
513 -17, -17, -17, -17, -11, -12, 125, 41, -11, -13,
514 125, -11, -11, -13, -11, -13 };
515 static const yytabelem yydef
[]={
517 95, -2, 0, 4, 1, 95, 96, 8, 0, 0,
518 0, 0, 0, 0, 0, 50, 0, 0, 0, 0,
519 88, 89, 9, 0, 95, 91, 91, 51, 95, 95,
520 0, 95, 57, 59, 60, 61, 0, 0, 0, 0,
521 0, 0, 54, 54, 47, 49, 0, 0, 0, 0,
522 0, 0, 0, 0, 46, 48, 0, 3, 10, 0,
523 92, 0, 0, 50, 52, 17, 18, 95, 58, 20,
524 54, 0, 0, 0, 0, 0, 0, 0, 0, 0,
525 0, 0, 0, 0, 0, 0, 0, 0, 93, 94,
526 54, 84, 86, 0, 71, 82, 83, 85, 21, 0,
527 55, 0, 22, 23, 24, 25, 26, 27, 28, 54,
528 2, 95, 95, 91, 0, 0, 19, 0, 65, 66,
529 67, 68, 69, 70, 72, 73, 74, 75, 76, 77,
530 78, 79, 80, 81, 87, 0, 63, -2, 0, 45,
531 0, 0, 0, 0, 53, 0, 64, 62, 0, 0,
532 0, 0, 0, 0, 0, 0, 56, 29, 11, 95,
533 7, 13, 51, 15, 30, 0, 0, 0, 0, 0,
534 0, 0, 95, 90, 0, 0, 95, 32, 34, 36,
535 38, 40, 42, 44, 0, 0, 95, 95, 0, 12,
536 95, 6, 0, 16, 5, 14 };
537 typedef struct { char *t_name
; int t_val
; } yytoktype
;
539 # define YYDEBUG 0 /* don't allow debugging */
590 "-unknown-", -1 /* ends search */
595 "-no such reduction-",
596 "program : blank stmts",
597 "program : blank '{' blank stmts '}'",
598 "program : blank '{' blank '}'",
600 "block : '{' blank stmts '}' blank",
601 "block : '{' blank '}' blank",
604 "stmts : stmts stmt",
605 "stmt : simpstmt '\n' blank",
606 "stmt : IF '(' cond ')' blank block",
607 "stmt : IF '(' cond ')' blank block else blank block",
608 "stmt : while '(' cond ')' blank block",
609 "stmt : for '(' comastmts ';' cond ';' comastmts ')' blank block",
610 "stmt : for '(' SYMBOL IN SYMBOL ')'",
611 "stmt : for '(' SYMBOL IN SYMBOL ')' blank block",
612 "stmt : BREAK '\n' blank",
613 "stmt : CONTINUE '\n' blank",
614 "stmt : RETURN expr '\n' blank",
615 "stmt : RETURN '\n' blank",
616 "simpstmt : SYMBOL '=' expr",
617 "simpstmt : evalsym ADDEQ expr",
618 "simpstmt : evalsym SUBEQ expr",
619 "simpstmt : evalsym MULEQ expr",
620 "simpstmt : evalsym DIVEQ expr",
621 "simpstmt : evalsym MODEQ expr",
622 "simpstmt : evalsym ANDEQ expr",
623 "simpstmt : evalsym OREQ expr",
624 "simpstmt : DELETE SYMBOL '[' arglist ']'",
625 "simpstmt : SYMBOL '[' arglist ']' '=' expr",
626 "simpstmt : SYMBOL '[' arglist ']'",
627 "simpstmt : SYMBOL '[' arglist ']' ADDEQ expr",
628 "simpstmt : SYMBOL '[' arglist ']'",
629 "simpstmt : SYMBOL '[' arglist ']' SUBEQ expr",
630 "simpstmt : SYMBOL '[' arglist ']'",
631 "simpstmt : SYMBOL '[' arglist ']' MULEQ expr",
632 "simpstmt : SYMBOL '[' arglist ']'",
633 "simpstmt : SYMBOL '[' arglist ']' DIVEQ expr",
634 "simpstmt : SYMBOL '[' arglist ']'",
635 "simpstmt : SYMBOL '[' arglist ']' MODEQ expr",
636 "simpstmt : SYMBOL '[' arglist ']'",
637 "simpstmt : SYMBOL '[' arglist ']' ANDEQ expr",
638 "simpstmt : SYMBOL '[' arglist ']'",
639 "simpstmt : SYMBOL '[' arglist ']' OREQ expr",
640 "simpstmt : SYMBOL '(' arglist ')'",
641 "simpstmt : INCR SYMBOL",
642 "simpstmt : SYMBOL INCR",
643 "simpstmt : DECR SYMBOL",
644 "simpstmt : SYMBOL DECR",
646 "comastmts : /* empty */",
647 "comastmts : simpstmt",
648 "comastmts : comastmts ',' simpstmt",
649 "arglist : /* empty */",
651 "arglist : arglist ',' expr",
653 "expr : expr numexpr",
657 "numexpr : SYMBOL '(' arglist ')'",
658 "numexpr : '(' expr ')'",
659 "numexpr : numexpr '[' arglist ']'",
660 "numexpr : numexpr '+' numexpr",
661 "numexpr : numexpr '-' numexpr",
662 "numexpr : numexpr '*' numexpr",
663 "numexpr : numexpr '/' numexpr",
664 "numexpr : numexpr '%' numexpr",
665 "numexpr : numexpr POW numexpr",
666 "numexpr : '-' numexpr",
667 "numexpr : numexpr GT numexpr",
668 "numexpr : numexpr GE numexpr",
669 "numexpr : numexpr LT numexpr",
670 "numexpr : numexpr LE numexpr",
671 "numexpr : numexpr EQ numexpr",
672 "numexpr : numexpr NE numexpr",
673 "numexpr : numexpr '&' numexpr",
674 "numexpr : numexpr '|' numexpr",
675 "numexpr : numexpr and numexpr",
676 "numexpr : numexpr or numexpr",
677 "numexpr : NOT numexpr",
678 "numexpr : INCR SYMBOL",
679 "numexpr : SYMBOL INCR",
680 "numexpr : DECR SYMBOL",
681 "numexpr : SYMBOL DECR",
682 "numexpr : numexpr IN numexpr",
686 "cond : /* empty */",
690 "blank : /* empty */",
691 "blank : blank '\n'",
695 * (c) Copyright 1990, OPEN SOFTWARE FOUNDATION, INC.
696 * ALL RIGHTS RESERVED
701 /* @(#)yaccpar 1.3 com/cmd/lang/yacc,3.1, 9/7/89 18:46:37 */
703 ** Skeleton parser driver for yacc output
707 ** yacc user known macros and defines
710 # define YYERROR return(-2)
712 # define YYERROR goto yyerrlab
715 #define YYACCEPT return(0)
716 #define YYABORT return(1)
717 #define YYBACKUP( newtoken, newvalue )\
719 if ( yychar >= 0 || ( yyr2[ yytmp ] >> 1 ) != 1 )\
721 yyerror( "syntax error - cannot backup" );\
729 #define YYRECOVERING() (!!yyerrflag)
731 # define YYDEBUG 1 /* make debugging available */
735 ** user known globals
737 int yydebug
; /* set to 1 to get debugging */
740 ** driver internal defines
742 #define YYFLAG (-1000)
746 extern int (*yyf[])(); \
747 register int yyret; \
749 if ((yyret=(*yyf[yytmp])()) == -2) \
751 else if (yyret>=0) return(yyret); \
756 ** local variables used by the parser
757 * these should be static in order to support
758 * multiple parsers in a single executable program. POSIX 1003.2-1993
760 static YYSTYPE yyv
[ YYMAXDEPTH
]; /* value stack */
761 static int yys
[ YYMAXDEPTH
]; /* state stack */
763 static YYSTYPE
*yypv
; /* top of value stack */
764 static YYSTYPE
*yypvt
; /* top of value stack for $vars */
765 static int *yyps
; /* top of state stack */
767 static int yystate
; /* current state */
768 static int yytmp
; /* extra var (lasts between blocks) */
771 ** global variables used by the parser - renamed as a result of -p
773 int yynerrs
; /* number of errors */
774 int yyerrflag
; /* error recovery flag */
775 int yychar
; /* current input token number */
778 ** yyparse - return 0 if worked, 1 if syntax error not recovered from
784 ** Initialize externals - yyparse may be called more than once
796 register YYSTYPE
*yy_pv
; /* top of value stack */
797 register int *yy_ps
; /* top of state stack */
798 register int yy_state
; /* current state */
799 register int yy_n
; /* internal state number info */
802 ** get globals into registers.
803 ** branch to here only if YYBACKUP was called.
812 ** get globals into registers.
813 ** either we just started, or we just finished a reduction
821 ** top of for (;;) loop while no reductions done
825 ** put a state and value onto the stacks
829 ** if debugging, look up token value in list of value vs.
830 ** name pairs. 0 and negative (-1) are special values.
831 ** Note: linear search is used since time is not a real
832 ** consideration while debugging.
838 printf( "State %d, token ", yy_state
);
840 printf( "end-of-file\n" );
841 else if ( yychar
< 0 )
842 printf( "-none-\n" );
845 for ( yy_i
= 0; yytoks
[yy_i
].t_val
>= 0;
848 if ( yytoks
[yy_i
].t_val
== yychar
)
851 printf( "%s\n", yytoks
[yy_i
].t_name
);
855 if ( ++yy_ps
>= &yys
[ YYMAXDEPTH
] ) /* room on stack? */
857 yyerror( "yacc stack overflow" );
864 ** we have a new state - find out what to do
867 if ( ( yy_n
= yypact
[ yy_state
] ) <= YYFLAG
)
868 goto yydefault
; /* simple state */
871 ** if debugging, need to mark whether new token grabbed
875 if ( ( yychar
< 0 ) && ( ( yychar
= yylex() ) < 0 ) )
876 yychar
= 0; /* reached EOF */
878 if ( yydebug
&& yytmp
)
882 printf( "Received token " );
884 printf( "end-of-file\n" );
885 else if ( yychar
< 0 )
886 printf( "-none-\n" );
889 for ( yy_i
= 0; yytoks
[yy_i
].t_val
>= 0;
892 if ( yytoks
[yy_i
].t_val
== yychar
)
895 printf( "%s\n", yytoks
[yy_i
].t_name
);
899 if ( ( ( yy_n
+= yychar
) < 0 ) || ( yy_n
>= YYLAST
) )
901 if ( yychk
[ yy_n
= yyact
[ yy_n
] ] == yychar
) /*valid shift*/
912 if ( ( yy_n
= yydef
[ yy_state
] ) == -2 )
917 if ( ( yychar
< 0 ) && ( ( yychar
= yylex() ) < 0 ) )
918 yychar
= 0; /* reached EOF */
920 if ( yydebug
&& yytmp
)
924 printf( "Received token " );
926 printf( "end-of-file\n" );
927 else if ( yychar
< 0 )
928 printf( "-none-\n" );
932 yytoks
[yy_i
].t_val
>= 0;
935 if ( yytoks
[yy_i
].t_val
941 printf( "%s\n", yytoks
[yy_i
].t_name
);
946 ** look through exception table
949 register const int *yyxi
= yyexca
;
951 while ( ( *yyxi
!= -1 ) ||
952 ( yyxi
[1] != yy_state
) )
956 while ( ( *(yyxi
+= 2) >= 0 ) &&
957 ( *yyxi
!= yychar
) )
959 if ( ( yy_n
= yyxi
[1] ) < 0 )
965 ** check for syntax error
967 if ( yy_n
== 0 ) /* have an error */
969 /* no worry about speed here! */
972 case 0: /* new error */
973 yyerror( "syntax error" );
977 ** get globals into registers.
978 ** we have a user generated syntax type error
986 case 2: /* incompletely recovered error */
990 ** find state where "error" is a legal
993 while ( yy_ps
>= yys
)
995 yy_n
= yypact
[ *yy_ps
] + YYERRCODE
;
996 if ( yy_n
>= 0 && yy_n
< YYLAST
&&
997 yychk
[yyact
[yy_n
]] == YYERRCODE
) {
999 ** simulate shift of "error"
1001 yy_state
= yyact
[ yy_n
];
1005 ** current state has no shift on
1006 ** "error", pop stack
1009 # define _POP_ "Error recovery pops state %d, uncovers state %d\n"
1011 printf( _POP_
, *yy_ps
,
1019 ** there is no state on stack with "error" as
1020 ** a valid shift. give up.
1023 case 3: /* no shift yet; eat a token */
1026 ** if debugging, look up token in list of
1027 ** pairs. 0 and negative shouldn't occur,
1028 ** but since timing doesn't matter when
1029 ** debugging, it doesn't hurt to leave the
1036 printf( "Error recovery discards " );
1038 printf( "token end-of-file\n" );
1039 else if ( yychar
< 0 )
1040 printf( "token -none-\n" );
1044 yytoks
[yy_i
].t_val
>= 0;
1047 if ( yytoks
[yy_i
].t_val
1053 printf( "token %s\n",
1054 yytoks
[yy_i
].t_name
);
1057 #endif /* YYDEBUG */
1058 if ( yychar
== 0 ) /* reached EOF. quit */
1063 }/* end if ( yy_n == 0 ) */
1065 ** reduction by production yy_n
1066 ** put stack tops, etc. so things right after switch
1070 ** if debugging, print the string that is the user's
1071 ** specification of the reduction which is just about
1075 printf( "Reduce by (%d) \"%s\"\n",
1076 yy_n
, yyreds
[ yy_n
] );
1078 yytmp
= yy_n
; /* value to switch over */
1079 yypvt
= yy_pv
; /* $vars top of value stack */
1081 ** Look in goto table for next state
1082 ** Sorry about using yy_state here as temporary
1083 ** register variable, but why not, if it works...
1084 ** If yyr2[ yy_n ] doesn't have the low order bit
1085 ** set, then there is no action to be done for
1086 ** this reduction. So, no saving & unsaving of
1087 ** registers done. The only difference between the
1088 ** code just after the if and the body of the if is
1089 ** the goto yy_stack in the body. This way the test
1090 ** can be made before the choice of what to do is needed.
1093 /* length of production doubled with extra bit */
1094 register int yy_len
= yyr2
[ yy_n
];
1096 if ( !( yy_len
& 01 ) )
1099 yyval
= ( yy_pv
-= yy_len
)[1]; /* $$ = $1 */
1100 yy_state
= yypgo
[ yy_n
= yyr1
[ yy_n
] ] +
1101 *( yy_ps
-= yy_len
) + 1;
1102 if ( yy_state
>= YYLAST
||
1104 yyact
[ yy_state
] ] != -yy_n
)
1106 yy_state
= yyact
[ yypgo
[ yy_n
] ];
1111 yyval
= ( yy_pv
-= yy_len
)[1]; /* $$ = $1 */
1112 yy_state
= yypgo
[ yy_n
= yyr1
[ yy_n
] ] +
1113 *( yy_ps
-= yy_len
) + 1;
1114 if ( yy_state
>= YYLAST
||
1115 yychk
[ yy_state
= yyact
[ yy_state
] ] != -yy_n
)
1117 yy_state
= yyact
[ yypgo
[ yy_n
] ];
1120 /* save until reenter driver code */
1126 ** code supplied by user is placed in this switch
1133 { ADD_OP(OP_RETURN_NO_VAL
); return 0; } /*NOTREACHED*/ break;
1136 { ADD_OP(OP_RETURN_NO_VAL
); return 0; } /*NOTREACHED*/ break;
1139 { ADD_OP(OP_RETURN_NO_VAL
); return 0; } /*NOTREACHED*/ break;
1142 { return 1; } /*NOTREACHED*/ break;
1145 { SET_BR_OFF(yypvt
[-3].inst
, GetPC()); } /*NOTREACHED*/ break;
1148 { SET_BR_OFF(yypvt
[-6].inst
, (yypvt
[-2].inst
+1)); SET_BR_OFF(yypvt
[-2].inst
, GetPC()); } /*NOTREACHED*/ break;
1151 { ADD_OP(OP_BRANCH
); ADD_BR_OFF(yypvt
[-5].inst
);
1152 SET_BR_OFF(yypvt
[-3].inst
, GetPC()); FillLoopAddrs(GetPC(), yypvt
[-5].inst
); } /*NOTREACHED*/ break;
1154 # line 101 "parse.y"
1155 { FillLoopAddrs(GetPC()+2+(yypvt
[-3].inst
-(yypvt
[-5].inst
+1)), GetPC());
1156 SwapCode(yypvt
[-5].inst
+1, yypvt
[-3].inst
, GetPC());
1157 ADD_OP(OP_BRANCH
); ADD_BR_OFF(yypvt
[-7].inst
); SET_BR_OFF(yypvt
[-5].inst
, GetPC()); } /*NOTREACHED*/ break;
1159 # line 105 "parse.y"
1160 { Symbol
*iterSym
= InstallIteratorSymbol();
1161 ADD_OP(OP_BEGIN_ARRAY_ITER
); ADD_SYM(yypvt
[-1].sym
); ADD_SYM(iterSym
);
1162 ADD_OP(OP_ARRAY_ITER
); ADD_SYM(yypvt
[-3].sym
); ADD_SYM(iterSym
);
1163 ADD_BR_OFF(0); } /*NOTREACHED*/ break;
1165 # line 110 "parse.y"
1166 { FillLoopAddrs(GetPC()+2, GetPC());
1167 ADD_OP(OP_BRANCH
); ADD_BR_OFF(yypvt
[-8].inst
+3);
1168 SET_BR_OFF(yypvt
[-8].inst
+6, GetPC());} /*NOTREACHED*/ break;
1170 # line 114 "parse.y"
1171 { ADD_OP(OP_BRANCH
); ADD_BR_OFF(0); if(AddBreakAddr(GetPC()-1)) { yyerror("break outside loop"); YYERROR
; } } /*NOTREACHED*/ break;
1173 # line 116 "parse.y"
1174 { ADD_OP(OP_BRANCH
); ADD_BR_OFF(0); if(AddContinueAddr(GetPC()-1)) { yyerror("continue outside loop"); YYERROR
; } } /*NOTREACHED*/ break;
1176 # line 117 "parse.y"
1177 { ADD_OP(OP_RETURN
); } /*NOTREACHED*/ break;
1179 # line 118 "parse.y"
1180 { ADD_OP(OP_RETURN_NO_VAL
); } /*NOTREACHED*/ break;
1182 # line 120 "parse.y"
1183 { ADD_OP(OP_ASSIGN
); ADD_SYM(yypvt
[-2].sym
); } /*NOTREACHED*/ break;
1185 # line 121 "parse.y"
1186 { ADD_OP(OP_ADD
); ADD_OP(OP_ASSIGN
); ADD_SYM(yypvt
[-2].sym
); } /*NOTREACHED*/ break;
1188 # line 122 "parse.y"
1189 { ADD_OP(OP_SUB
); ADD_OP(OP_ASSIGN
); ADD_SYM(yypvt
[-2].sym
); } /*NOTREACHED*/ break;
1191 # line 123 "parse.y"
1192 { ADD_OP(OP_MUL
); ADD_OP(OP_ASSIGN
); ADD_SYM(yypvt
[-2].sym
); } /*NOTREACHED*/ break;
1194 # line 124 "parse.y"
1195 { ADD_OP(OP_DIV
); ADD_OP(OP_ASSIGN
); ADD_SYM(yypvt
[-2].sym
); } /*NOTREACHED*/ break;
1197 # line 125 "parse.y"
1198 { ADD_OP(OP_MOD
); ADD_OP(OP_ASSIGN
); ADD_SYM(yypvt
[-2].sym
); } /*NOTREACHED*/ break;
1200 # line 126 "parse.y"
1201 { ADD_OP(OP_BIT_AND
); ADD_OP(OP_ASSIGN
);
1202 ADD_SYM(yypvt
[-2].sym
); } /*NOTREACHED*/ break;
1204 # line 128 "parse.y"
1205 { ADD_OP(OP_BIT_OR
); ADD_OP(OP_ASSIGN
);
1206 ADD_SYM(yypvt
[-2].sym
); } /*NOTREACHED*/ break;
1208 # line 131 "parse.y"
1209 { ADD_OP(OP_ARRAY_DELETE
); ADD_SYM(yypvt
[-3].sym
); ADD_IMMED((void *)yypvt
[-1].nArgs
); } /*NOTREACHED*/ break;
1211 # line 133 "parse.y"
1212 { ADD_OP(OP_ARRAY_ASSIGN
); ADD_SYM(yypvt
[-5].sym
); ADD_IMMED((void *)yypvt
[-3].nArgs
); } /*NOTREACHED*/ break;
1214 # line 134 "parse.y"
1215 { ADD_OP(OP_PUSH_SYM
);
1216 ADD_SYM(yypvt
[-3].sym
); ADD_OP(OP_ARRAY_REF
); ADD_IMMED((void *)yypvt
[-1].nArgs
); } /*NOTREACHED*/ break;
1218 # line 137 "parse.y"
1219 { ADD_OP(OP_ADD
); ADD_OP(OP_ARRAY_ASSIGN
); ADD_SYM(yypvt
[-6].sym
);
1220 ADD_IMMED((void *)yypvt
[-4].nArgs
);} /*NOTREACHED*/ break;
1222 # line 139 "parse.y"
1223 { ADD_OP(OP_PUSH_SYM
); ADD_SYM(yypvt
[-3].sym
);
1224 ADD_OP(OP_ARRAY_REF
); ADD_IMMED((void *)yypvt
[-1].nArgs
); } /*NOTREACHED*/ break;
1226 # line 142 "parse.y"
1227 { ADD_OP(OP_SUB
); ADD_OP(OP_ARRAY_ASSIGN
); ADD_SYM(yypvt
[-6].sym
);
1228 ADD_IMMED((void *)yypvt
[-4].nArgs
); } /*NOTREACHED*/ break;
1230 # line 145 "parse.y"
1231 { ADD_OP(OP_PUSH_SYM
); ADD_SYM(yypvt
[-3].sym
); ADD_OP(OP_ARRAY_REF
);
1232 ADD_IMMED((void *)yypvt
[-1].nArgs
); } /*NOTREACHED*/ break;
1234 # line 148 "parse.y"
1235 { ADD_OP(OP_MUL
); ADD_OP(OP_ARRAY_ASSIGN
); ADD_SYM(yypvt
[-6].sym
);
1236 ADD_IMMED((void *)yypvt
[-4].nArgs
); } /*NOTREACHED*/ break;
1238 # line 151 "parse.y"
1239 { ADD_OP(OP_PUSH_SYM
); ADD_SYM(yypvt
[-3].sym
); ADD_OP(OP_ARRAY_REF
);
1240 ADD_IMMED((void *)yypvt
[-1].nArgs
); } /*NOTREACHED*/ break;
1242 # line 154 "parse.y"
1243 { ADD_OP(OP_DIV
); ADD_OP(OP_ARRAY_ASSIGN
); ADD_SYM(yypvt
[-6].sym
);
1244 ADD_IMMED((void *)yypvt
[-4].nArgs
); } /*NOTREACHED*/ break;
1246 # line 157 "parse.y"
1247 { ADD_OP(OP_PUSH_SYM
); ADD_SYM(yypvt
[-3].sym
); ADD_OP(OP_ARRAY_REF
);
1248 ADD_IMMED((void *)yypvt
[-1].nArgs
); } /*NOTREACHED*/ break;
1250 # line 160 "parse.y"
1251 { ADD_OP(OP_MOD
); ADD_OP(OP_ARRAY_ASSIGN
); ADD_SYM(yypvt
[-6].sym
);
1252 ADD_IMMED((void *)yypvt
[-4].nArgs
); } /*NOTREACHED*/ break;
1254 # line 163 "parse.y"
1255 { ADD_OP(OP_PUSH_SYM
); ADD_SYM(yypvt
[-3].sym
); ADD_OP(OP_ARRAY_REF
);
1256 ADD_IMMED((void *)yypvt
[-1].nArgs
); } /*NOTREACHED*/ break;
1258 # line 166 "parse.y"
1259 { ADD_OP(OP_BIT_AND
); ADD_OP(OP_ARRAY_ASSIGN
);
1260 ADD_SYM(yypvt
[-6].sym
); ADD_IMMED((void *)yypvt
[-4].nArgs
); } /*NOTREACHED*/ break;
1262 # line 169 "parse.y"
1263 { ADD_OP(OP_PUSH_SYM
); ADD_SYM(yypvt
[-3].sym
); ADD_OP(OP_ARRAY_REF
);
1264 ADD_IMMED((void *)yypvt
[-1].nArgs
); } /*NOTREACHED*/ break;
1266 # line 172 "parse.y"
1267 { ADD_OP(OP_BIT_OR
); ADD_OP(OP_ARRAY_ASSIGN
);
1268 ADD_SYM(yypvt
[-6].sym
); ADD_IMMED((void *)yypvt
[-4].nArgs
); } /*NOTREACHED*/ break;
1270 # line 174 "parse.y"
1271 { ADD_OP(OP_SUBR_CALL
);
1272 ADD_SYM(PromoteToGlobal(yypvt
[-3].sym
)); ADD_IMMED((void *)yypvt
[-1].nArgs
); } /*NOTREACHED*/ break;
1274 # line 176 "parse.y"
1275 { ADD_OP(OP_PUSH_SYM
); ADD_SYM(yypvt
[-0].sym
); ADD_OP(OP_INCR
);
1276 ADD_OP(OP_ASSIGN
); ADD_SYM(yypvt
[-0].sym
); } /*NOTREACHED*/ break;
1278 # line 178 "parse.y"
1279 { ADD_OP(OP_PUSH_SYM
); ADD_SYM(yypvt
[-1].sym
); ADD_OP(OP_INCR
);
1280 ADD_OP(OP_ASSIGN
); ADD_SYM(yypvt
[-1].sym
); } /*NOTREACHED*/ break;
1282 # line 180 "parse.y"
1283 { ADD_OP(OP_PUSH_SYM
); ADD_SYM(yypvt
[-0].sym
); ADD_OP(OP_DECR
);
1284 ADD_OP(OP_ASSIGN
); ADD_SYM(yypvt
[-0].sym
); } /*NOTREACHED*/ break;
1286 # line 182 "parse.y"
1287 { ADD_OP(OP_PUSH_SYM
); ADD_SYM(yypvt
[-1].sym
); ADD_OP(OP_DECR
);
1288 ADD_OP(OP_ASSIGN
); ADD_SYM(yypvt
[-1].sym
); } /*NOTREACHED*/ break;
1290 # line 185 "parse.y"
1291 { yyval
.sym
= yypvt
[-0].sym
; ADD_OP(OP_PUSH_SYM
); ADD_SYM(yypvt
[-0].sym
); } /*NOTREACHED*/ break;
1293 # line 187 "parse.y"
1294 { yyval
.inst
= GetPC(); } /*NOTREACHED*/ break;
1296 # line 188 "parse.y"
1297 { yyval
.inst
= GetPC(); } /*NOTREACHED*/ break;
1299 # line 189 "parse.y"
1300 { yyval
.inst
= GetPC(); } /*NOTREACHED*/ break;
1302 # line 191 "parse.y"
1303 { yyval
.nArgs
= 0;} /*NOTREACHED*/ break;
1305 # line 192 "parse.y"
1306 { yyval
.nArgs
= 1; } /*NOTREACHED*/ break;
1308 # line 193 "parse.y"
1309 { yyval
.nArgs
= yypvt
[-2].nArgs
+ 1; } /*NOTREACHED*/ break;
1311 # line 196 "parse.y"
1312 { ADD_OP(OP_CONCAT
); } /*NOTREACHED*/ break;
1314 # line 198 "parse.y"
1315 { ADD_OP(OP_PUSH_SYM
); ADD_SYM(yypvt
[-0].sym
); } /*NOTREACHED*/ break;
1317 # line 199 "parse.y"
1318 { ADD_OP(OP_PUSH_SYM
); ADD_SYM(yypvt
[-0].sym
); } /*NOTREACHED*/ break;
1320 # line 200 "parse.y"
1321 { ADD_OP(OP_PUSH_SYM
); ADD_SYM(yypvt
[-0].sym
); } /*NOTREACHED*/ break;
1323 # line 201 "parse.y"
1324 { ADD_OP(OP_SUBR_CALL
);
1325 ADD_SYM(PromoteToGlobal(yypvt
[-3].sym
)); ADD_IMMED((void *)yypvt
[-1].nArgs
);
1326 ADD_OP(OP_FETCH_RET_VAL
);} /*NOTREACHED*/ break;
1328 # line 206 "parse.y"
1329 { ADD_OP(OP_ARRAY_REF
); ADD_IMMED((void *)yypvt
[-1].nArgs
); } /*NOTREACHED*/ break;
1331 # line 207 "parse.y"
1332 { ADD_OP(OP_ADD
); } /*NOTREACHED*/ break;
1334 # line 208 "parse.y"
1335 { ADD_OP(OP_SUB
); } /*NOTREACHED*/ break;
1337 # line 209 "parse.y"
1338 { ADD_OP(OP_MUL
); } /*NOTREACHED*/ break;
1340 # line 210 "parse.y"
1341 { ADD_OP(OP_DIV
); } /*NOTREACHED*/ break;
1343 # line 211 "parse.y"
1344 { ADD_OP(OP_MOD
); } /*NOTREACHED*/ break;
1346 # line 212 "parse.y"
1347 { ADD_OP(OP_POWER
); } /*NOTREACHED*/ break;
1349 # line 213 "parse.y"
1350 { ADD_OP(OP_NEGATE
); } /*NOTREACHED*/ break;
1352 # line 214 "parse.y"
1353 { ADD_OP(OP_GT
); } /*NOTREACHED*/ break;
1355 # line 215 "parse.y"
1356 { ADD_OP(OP_GE
); } /*NOTREACHED*/ break;
1358 # line 216 "parse.y"
1359 { ADD_OP(OP_LT
); } /*NOTREACHED*/ break;
1361 # line 217 "parse.y"
1362 { ADD_OP(OP_LE
); } /*NOTREACHED*/ break;
1364 # line 218 "parse.y"
1365 { ADD_OP(OP_EQ
); } /*NOTREACHED*/ break;
1367 # line 219 "parse.y"
1368 { ADD_OP(OP_NE
); } /*NOTREACHED*/ break;
1370 # line 220 "parse.y"
1371 { ADD_OP(OP_BIT_AND
); } /*NOTREACHED*/ break;
1373 # line 221 "parse.y"
1374 { ADD_OP(OP_BIT_OR
); } /*NOTREACHED*/ break;
1376 # line 223 "parse.y"
1377 { ADD_OP(OP_AND
); SET_BR_OFF(yypvt
[-1].inst
, GetPC()); } /*NOTREACHED*/ break;
1379 # line 225 "parse.y"
1380 { ADD_OP(OP_OR
); SET_BR_OFF(yypvt
[-1].inst
, GetPC()); } /*NOTREACHED*/ break;
1382 # line 226 "parse.y"
1383 { ADD_OP(OP_NOT
); } /*NOTREACHED*/ break;
1385 # line 227 "parse.y"
1386 { ADD_OP(OP_PUSH_SYM
); ADD_SYM(yypvt
[-0].sym
); ADD_OP(OP_INCR
);
1387 ADD_OP(OP_DUP
); ADD_OP(OP_ASSIGN
); ADD_SYM(yypvt
[-0].sym
); } /*NOTREACHED*/ break;
1389 # line 229 "parse.y"
1390 { ADD_OP(OP_PUSH_SYM
); ADD_SYM(yypvt
[-1].sym
); ADD_OP(OP_DUP
);
1391 ADD_OP(OP_INCR
); ADD_OP(OP_ASSIGN
); ADD_SYM(yypvt
[-1].sym
); } /*NOTREACHED*/ break;
1393 # line 231 "parse.y"
1394 { ADD_OP(OP_PUSH_SYM
); ADD_SYM(yypvt
[-0].sym
); ADD_OP(OP_DECR
);
1395 ADD_OP(OP_DUP
); ADD_OP(OP_ASSIGN
); ADD_SYM(yypvt
[-0].sym
); } /*NOTREACHED*/ break;
1397 # line 233 "parse.y"
1398 { ADD_OP(OP_PUSH_SYM
); ADD_SYM(yypvt
[-1].sym
); ADD_OP(OP_DUP
);
1399 ADD_OP(OP_DECR
); ADD_OP(OP_ASSIGN
); ADD_SYM(yypvt
[-1].sym
); } /*NOTREACHED*/ break;
1401 # line 235 "parse.y"
1402 { ADD_OP(OP_IN_ARRAY
); } /*NOTREACHED*/ break;
1404 # line 237 "parse.y"
1405 { yyval
.inst
= GetPC(); StartLoopAddrList(); } /*NOTREACHED*/ break;
1407 # line 239 "parse.y"
1408 { StartLoopAddrList(); yyval
.inst
= GetPC(); } /*NOTREACHED*/ break;
1410 # line 241 "parse.y"
1411 { ADD_OP(OP_BRANCH
); yyval
.inst
= GetPC(); ADD_BR_OFF(0); } /*NOTREACHED*/ break;
1413 # line 243 "parse.y"
1414 { ADD_OP(OP_BRANCH_NEVER
); yyval
.inst
= GetPC(); ADD_BR_OFF(0); } /*NOTREACHED*/ break;
1416 # line 244 "parse.y"
1417 { ADD_OP(OP_BRANCH_FALSE
); yyval
.inst
= GetPC(); ADD_BR_OFF(0); } /*NOTREACHED*/ break;
1419 # line 246 "parse.y"
1420 { ADD_OP(OP_DUP
); ADD_OP(OP_BRANCH_FALSE
); yyval
.inst
= GetPC();
1421 ADD_BR_OFF(0); } /*NOTREACHED*/ break;
1423 # line 249 "parse.y"
1424 { ADD_OP(OP_DUP
); ADD_OP(OP_BRANCH_TRUE
); yyval
.inst
= GetPC();
1425 ADD_BR_OFF(0); } /*NOTREACHED*/ break;
1429 goto yystack
; /* reset registers in driver code */