From 49a32136f8976e93cbe18918dc924edd01e61077 Mon Sep 17 00:00:00 2001 From: Justine Tunney Date: Sat, 6 Apr 2024 19:21:48 -0700 Subject: [PATCH] Upgrade the One True Awk --- third_party/awk/BUILD.mk | 3 +- third_party/awk/README.cosmo | 5 +- third_party/awk/awk.h | 244 +- third_party/awk/awkgram.tab.c | 6663 +++++++++++++++++---------------- third_party/awk/awkgram.tab.h | 252 +- third_party/awk/b.c | 511 ++- third_party/awk/lex.c | 129 +- third_party/awk/lib.c | 223 +- third_party/awk/main.c | 147 +- third_party/awk/maketab.c | 66 +- third_party/awk/parse.c | 64 +- third_party/awk/proctab.c | 36 +- third_party/awk/proto.h | 204 + third_party/awk/run.c | 980 +++-- third_party/awk/tran.c | 75 +- 15 files changed, 5280 insertions(+), 4322 deletions(-) create mode 100644 third_party/awk/proto.h diff --git a/third_party/awk/BUILD.mk b/third_party/awk/BUILD.mk index a421bd448..7cbbc4fcf 100644 --- a/third_party/awk/BUILD.mk +++ b/third_party/awk/BUILD.mk @@ -31,8 +31,7 @@ THIRD_PARTY_AWK_A_DEPS := \ $(call uniq,$(foreach x,$(THIRD_PARTY_AWK_A_DIRECTDEPS),$($(x)))) THIRD_PARTY_AWK_CHECKS = \ - $(THIRD_PARTY_AWK_A).pkg \ - $(THIRD_PARTY_AWK_HDRS:%=o/$(MODE)/%.ok) + $(THIRD_PARTY_AWK_A).pkg $(THIRD_PARTY_AWK_A): \ third_party/awk/ \ diff --git a/third_party/awk/README.cosmo b/third_party/awk/README.cosmo index 4281edc4b..c0169a192 100644 --- a/third_party/awk/README.cosmo +++ b/third_party/awk/README.cosmo @@ -10,8 +10,7 @@ SOURCE https://github.com/onetrueawk/awk - commit b92d8cecd132ce8e02a373e28dd42e6be34d3d59 - Author: ozan yigit - Date: Mon May 30 11:34:52 2022 -0400 + commit 2bab10b60b3f4d3bbefdcb60410655f317d1a452 + date Thu Mar 14 14:25:30 2024 +0200 added YACC definition for byacc. diff --git a/third_party/awk/awk.h b/third_party/awk/awk.h index 59362f574..76180e47f 100644 --- a/third_party/awk/awk.h +++ b/third_party/awk/awk.h @@ -1,10 +1,35 @@ -#ifndef COSMOPOLITAN_THIRD_PARTY_AWK_AWK_H_ -#define COSMOPOLITAN_THIRD_PARTY_AWK_AWK_H_ -#include "libc/assert.h" -#include "libc/limits.h" -#include "libc/literal.h" -#include "libc/stdio/stdio.h" -COSMOPOLITAN_C_START_ +/**************************************************************** +Copyright (C) Lucent Technologies 1997 +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name Lucent Technologies or any of +its entities not be used in advertising or publicity pertaining +to distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. +****************************************************************/ + +#include +#include +#include +#if __STDC_VERSION__ <= 199901L +#define noreturn +#else +#include +#endif typedef double Awkfloat; @@ -12,7 +37,7 @@ typedef double Awkfloat; typedef unsigned char uschar; -#define xfree(a) { if ((a) != NULL) { free((void *)(intptr_t)(a)); (a) = NULL; } } +#define xfree(a) { free((void *)(intptr_t)(a)); (a) = NULL; } /* * We sometimes cheat writing read-only pointers to NUL-terminate them * and then put back the original value @@ -39,6 +64,8 @@ extern bool safe; /* false => unsafe, true => safe */ #define RECSIZE (8 * 1024) /* sets limit on records, fields, etc., etc. */ extern int recsize; /* size of current record, orig RECSIZE */ +extern size_t awk_mb_cur_max; /* max size of a multi-byte character */ + extern char EMPTY[]; /* this avoid -Wwritable-strings issues */ extern char **FS; extern char **RS; @@ -53,6 +80,8 @@ extern char **SUBSEP; extern Awkfloat *RSTART; extern Awkfloat *RLENGTH; +extern bool CSV; /* true for csv input */ + extern char *record; /* points to $0 */ extern int lineno; /* line number in awk program */ extern int errorflag; /* 1 if error has occurred */ @@ -200,7 +229,8 @@ extern int pairstack[], paircnt; /* structures used by regular expression matching machinery, mostly b.c: */ -#define NCHARS (256+3) /* 256 handles 8-bit chars; 128 does 7-bit */ +#define NCHARS (1256+3) /* 256 handles 8-bit chars; 128 does 7-bit */ + /* BUG: some overflows (caught) if we use 256 */ /* watch out in match(), etc. */ #define HAT (NCHARS+2) /* matches ^ in regular expr */ #define NSTATES 32 @@ -211,12 +241,24 @@ typedef struct rrow { int i; Node *np; uschar *up; + int *rp; /* rune representation of char class */ } lval; /* because Al stores a pointer in it! */ int *lfollow; } rrow; +typedef struct gtte { /* gototab entry */ + unsigned int ch; + unsigned int state; +} gtte; + +typedef struct gtt { /* gototab */ + size_t allocated; + size_t inuse; + gtte *entries; +} gtt; + typedef struct fa { - unsigned int **gototab; + gtt *gototab; uschar *out; uschar *restr; int **posns; @@ -229,185 +271,5 @@ typedef struct fa { struct rrow re[1]; /* variable: actual size set by calling malloc */ } fa; -extern int yywrap(void); -extern void setfname(Cell *); -extern int constnode(Node *); -extern char *strnode(Node *); -extern Node *notnull(Node *); -extern int yyparse(void); -extern int yylex(void); -extern void startreg(void); -extern int input(void); -extern void unput(int); -extern void unputstr(const char *); -extern int yylook(void); -extern int yyback(int *, int); -extern int yyinput(void); - -extern fa *makedfa(const char *, bool); -extern fa *mkdfa(const char *, bool); -extern int makeinit(fa *, bool); -extern void penter(Node *); -extern void freetr(Node *); -extern int hexstr(const uschar **); -extern int quoted(const uschar **); -extern char *cclenter(const char *); -extern wontreturn void overflo(const char *); -extern void cfoll(fa *, Node *); -extern int first(Node *); -extern void follow(Node *); -extern int member(int, const char *); -extern int match(fa *, const char *); -extern int pmatch(fa *, const char *); -extern int nematch(fa *, const char *); -extern bool fnematch(fa *, FILE *, char **, int *, int); -extern Node *reparse(const char *); -extern Node *regexp(void); -extern Node *primary(void); -extern Node *concat(Node *); -extern Node *alt(Node *); -extern Node *unary(Node *); -extern int relex(void); -extern int cgoto(fa *, int, int); -extern void freefa(fa *); - -extern int pgetc(void); -extern char *cursource(void); - -extern Node *nodealloc(int); -extern Node *exptostat(Node *); -extern Node *node1(int, Node *); -extern Node *node2(int, Node *, Node *); -extern Node *node3(int, Node *, Node *, Node *); -extern Node *node4(int, Node *, Node *, Node *, Node *); -extern Node *stat3(int, Node *, Node *, Node *); -extern Node *op2(int, Node *, Node *); -extern Node *op1(int, Node *); -extern Node *stat1(int, Node *); -extern Node *op3(int, Node *, Node *, Node *); -extern Node *op4(int, Node *, Node *, Node *, Node *); -extern Node *stat2(int, Node *, Node *); -extern Node *stat4(int, Node *, Node *, Node *, Node *); -extern Node *celltonode(Cell *, int); -extern Node *rectonode(void); -extern Node *makearr(Node *); -extern Node *pa2stat(Node *, Node *, Node *); -extern Node *linkum(Node *, Node *); -extern void defn(Cell *, Node *, Node *); -extern int isarg(const char *); -extern const char *tokname(int); -extern Cell *(*proctab[])(Node **, int); -extern int ptoi(void *); -extern Node *itonp(int); - -extern void syminit(void); -extern void arginit(int, char **); -extern void envinit(char **); -extern Array *makesymtab(int); -extern void freesymtab(Cell *); -extern void freeelem(Cell *, const char *); -extern Cell *setsymtab(const char *, const char *, double, unsigned int, Array *); -extern int hash(const char *, int); -extern void rehash(Array *); -extern Cell *lookup(const char *, Array *); -extern double setfval(Cell *, double); -extern void funnyvar(Cell *, const char *); -extern char *setsval(Cell *, const char *); -extern double getfval(Cell *); -extern char *getsval(Cell *); -extern char *getpssval(Cell *); /* for print */ -extern char *tostring(const char *); -extern char *tostringN(const char *, size_t); -extern char *qstring(const char *, int); -extern Cell *catstr(Cell *, Cell *); - -extern void recinit(unsigned int); -extern void initgetrec(void); -extern void makefields(int, int); -extern void growfldtab(int n); -extern void savefs(void); -extern int getrec(char **, int *, bool); -extern void nextfile(void); -extern int readrec(char **buf, int *bufsize, FILE *inf, bool isnew); -extern char *getargv(int); -extern void setclvar(char *); -extern void fldbld(void); -extern void cleanfld(int, int); -extern void newfld(int); -extern void setlastfld(int); -extern int refldbld(const char *, const char *); -extern void recbld(void); -extern Cell *fieldadr(int); -extern void yyerror(const char *); -extern void bracecheck(void); -extern void bcheck2(int, int, int); -extern void SYNTAX(const char *, ...) - __attribute__((__format__(__printf__, 1, 2))); -extern wontreturn void FATAL(const char *, ...) - __attribute__((__format__(__printf__, 1, 2))); -extern void WARNING(const char *, ...) - __attribute__((__format__(__printf__, 1, 2))); -extern void error(void); -extern void eprint(void); -extern void bclass(int); -extern double errcheck(double, const char *); -extern int isclvar(const char *); -extern bool is_valid_number(const char *s, bool trailing_stuff_ok, - bool *no_trailing, double *result); -#define is_number(s, val) is_valid_number(s, false, NULL, val) - -extern int adjbuf(char **pb, int *sz, int min, int q, char **pbp, const char *what); -extern void run(Node *); -extern Cell *execute(Node *); -extern Cell *program(Node **, int); -extern Cell *call(Node **, int); -extern Cell *copycell(Cell *); -extern Cell *arg(Node **, int); -extern Cell *jump(Node **, int); -extern Cell *awkgetline(Node **, int); -extern Cell *getnf(Node **, int); -extern Cell *array(Node **, int); -extern Cell *awkdelete(Node **, int); -extern Cell *intest(Node **, int); -extern Cell *matchop(Node **, int); -extern Cell *boolop(Node **, int); -extern Cell *relop(Node **, int); -extern void tfree(Cell *); -extern Cell *gettemp(void); -extern Cell *field(Node **, int); -extern Cell *indirect(Node **, int); -extern Cell *substr(Node **, int); -extern Cell *sindex(Node **, int); -extern int format(char **, int *, const char *, Node *); -extern Cell *awksprintf(Node **, int); -extern Cell *awkprintf(Node **, int); -extern Cell *arith(Node **, int); -extern double ipow(double, int); -extern Cell *incrdecr(Node **, int); -extern Cell *assign(Node **, int); -extern Cell *cat(Node **, int); -extern Cell *pastat(Node **, int); -extern Cell *dopa2(Node **, int); -extern Cell *split(Node **, int); -extern Cell *condexpr(Node **, int); -extern Cell *ifstat(Node **, int); -extern Cell *whilestat(Node **, int); -extern Cell *dostat(Node **, int); -extern Cell *forstat(Node **, int); -extern Cell *instat(Node **, int); -extern Cell *bltin(Node **, int); -extern Cell *printstat(Node **, int); -extern Cell *nullproc(Node **, int); -extern FILE *redirect(int, Node *); -extern FILE *openfile(int, const char *, bool *); -extern const char *filename(FILE *); -extern Cell *closefile(Node **, int); -extern void closeall(void); -extern Cell *sub(Node **, int); -extern Cell *gsub(Node **, int); - -extern const char *flags2str(int flags); - -COSMOPOLITAN_C_END_ -#endif /* COSMOPOLITAN_THIRD_PARTY_AWK_AWK_H_ */ +#include "proto.h" diff --git a/third_party/awk/awkgram.tab.c b/third_party/awk/awkgram.tab.c index 9ac4d798a..4180b36ab 100644 --- a/third_party/awk/awkgram.tab.c +++ b/third_party/awk/awkgram.tab.c @@ -1,16 +1,24 @@ -#include "libc/mem/mem.h" -#include "libc/str/str.h" -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define YYLEX yylex() -#define YYEMPTY -1 -#define yyclearin (yychar=(YYEMPTY)) -#define yyerrok (yyerrflag=0) -#define YYRECOVERING() (yyerrflag!=0) -#define YYPREFIX "yy" -#line 26 "awkgram.y" -#include "third_party/awk/awk.h" +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + + + + +/* First part of user prologue. */ +#line 25 "awkgram.y" + +#include +#include +#include "awk.h" void checkdup(Node *list, Cell *item); int yywrap(void) { return(1); } @@ -21,2454 +29,3341 @@ bool infunc = false; /* = true if in arglist or body of func */ int inloop = 0; /* >= 1 if in while, for, do; can't be bool, since loops can next */ char *curfname = 0; /* current function name */ Node *arglist = 0; /* list of args for current function */ -#line 41 "awkgram.y" -#ifndef YYSTYPE_DEFINED -#define YYSTYPE_DEFINED -typedef union { - Node *p; - Cell *cp; - int i; - char *s; -} YYSTYPE; -#endif /* YYSTYPE_DEFINED */ -#line 37 "awkgram.tab.c" -#define FIRSTTOKEN 257 -#define PROGRAM 258 -#define PASTAT 259 -#define PASTAT2 260 -#define XBEGIN 261 -#define XEND 262 -#define NL 263 -#define ARRAY 264 -#define MATCH 265 -#define NOTMATCH 266 -#define MATCHOP 267 -#define FINAL 268 -#define DOT 269 -#define ALL 270 -#define CCL 271 -#define NCCL 272 -#define CHAR 273 -#define OR 274 -#define STAR 275 -#define QUEST 276 -#define PLUS 277 -#define EMPTYRE 278 -#define ZERO 279 -#define AND 280 -#define BOR 281 -#define APPEND 282 -#define EQ 283 -#define GE 284 -#define GT 285 -#define LE 286 -#define LT 287 -#define NE 288 -#define IN 289 -#define ARG 290 -#define BLTIN 291 -#define BREAK 292 -#define CLOSE 293 -#define CONTINUE 294 -#define DELETE 295 -#define DO 296 -#define EXIT 297 -#define FOR 298 -#define FUNC 299 -#define SUB 300 -#define GSUB 301 -#define IF 302 -#define INDEX 303 -#define LSUBSTR 304 -#define MATCHFCN 305 -#define NEXT 306 -#define NEXTFILE 307 -#define ADD 308 -#define MINUS 309 -#define MULT 310 -#define DIVIDE 311 -#define MOD 312 -#define ASSIGN 313 -#define ASGNOP 314 -#define ADDEQ 315 -#define SUBEQ 316 -#define MULTEQ 317 -#define DIVEQ 318 -#define MODEQ 319 -#define POWEQ 320 -#define PRINT 321 -#define PRINTF 322 -#define SPRINTF 323 -#define ELSE 324 -#define INTEST 325 -#define CONDEXPR 326 -#define POSTINCR 327 -#define PREINCR 328 -#define POSTDECR 329 -#define PREDECR 330 -#define VAR 331 -#define IVAR 332 -#define VARNF 333 -#define CALL 334 -#define NUMBER 335 -#define STRING 336 -#define REGEXPR 337 -#define GETLINE 338 -#define RETURN 339 -#define SPLIT 340 -#define SUBSTR 341 -#define WHILE 342 -#define CAT 343 -#define NOT 344 -#define UMINUS 345 -#define UPLUS 346 -#define POWER 347 -#define DECR 348 -#define INCR 349 -#define INDIRECT 350 -#define LASTTOKEN 351 -#define YYERRCODE 256 -const short yylhs[] = - { -1, - 0, 0, 36, 36, 37, 37, 33, 33, 26, 26, - 24, 24, 41, 22, 42, 22, 43, 22, 20, 20, - 23, 30, 30, 34, 34, 35, 35, 29, 29, 15, - 15, 1, 1, 10, 11, 11, 11, 11, 11, 11, - 11, 44, 11, 12, 12, 6, 6, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 4, 4, 5, - 5, 7, 7, 7, 39, 39, 28, 28, 28, 28, - 31, 31, 9, 9, 45, 13, 32, 32, 14, 14, - 14, 14, 14, 14, 14, 14, 27, 27, 16, 16, - 46, 47, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 48, 16, 16, 17, 17, 38, - 38, 40, 40, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 18, 18, 18, 18, 21, - 21, 21, 19, 19, 19, 25, + +#line 87 "awkgram.tab.c" + +# ifndef YY_CAST +# ifdef __cplusplus +# define YY_CAST(Type, Val) static_cast (Val) +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) +# else +# define YY_CAST(Type, Val) ((Type) (Val)) +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) +# endif +# endif +# ifndef YY_NULLPTR +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# else +# define YY_NULLPTR ((void*)0) +# endif +# endif + +#include "awkgram.tab.h" +/* Symbol kind. */ +enum yysymbol_kind_t +{ + YYSYMBOL_YYEMPTY = -2, + YYSYMBOL_YYEOF = 0, /* "end of file" */ + YYSYMBOL_YYerror = 1, /* error */ + YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ + YYSYMBOL_FIRSTTOKEN = 3, /* FIRSTTOKEN */ + YYSYMBOL_PROGRAM = 4, /* PROGRAM */ + YYSYMBOL_PASTAT = 5, /* PASTAT */ + YYSYMBOL_PASTAT2 = 6, /* PASTAT2 */ + YYSYMBOL_XBEGIN = 7, /* XBEGIN */ + YYSYMBOL_XEND = 8, /* XEND */ + YYSYMBOL_NL = 9, /* NL */ + YYSYMBOL_10_ = 10, /* ',' */ + YYSYMBOL_11_ = 11, /* '{' */ + YYSYMBOL_12_ = 12, /* '(' */ + YYSYMBOL_13_ = 13, /* '|' */ + YYSYMBOL_14_ = 14, /* ';' */ + YYSYMBOL_15_ = 15, /* '/' */ + YYSYMBOL_16_ = 16, /* ')' */ + YYSYMBOL_17_ = 17, /* '}' */ + YYSYMBOL_18_ = 18, /* '[' */ + YYSYMBOL_19_ = 19, /* ']' */ + YYSYMBOL_ARRAY = 20, /* ARRAY */ + YYSYMBOL_MATCH = 21, /* MATCH */ + YYSYMBOL_NOTMATCH = 22, /* NOTMATCH */ + YYSYMBOL_MATCHOP = 23, /* MATCHOP */ + YYSYMBOL_FINAL = 24, /* FINAL */ + YYSYMBOL_DOT = 25, /* DOT */ + YYSYMBOL_ALL = 26, /* ALL */ + YYSYMBOL_CCL = 27, /* CCL */ + YYSYMBOL_NCCL = 28, /* NCCL */ + YYSYMBOL_CHAR = 29, /* CHAR */ + YYSYMBOL_OR = 30, /* OR */ + YYSYMBOL_STAR = 31, /* STAR */ + YYSYMBOL_QUEST = 32, /* QUEST */ + YYSYMBOL_PLUS = 33, /* PLUS */ + YYSYMBOL_EMPTYRE = 34, /* EMPTYRE */ + YYSYMBOL_ZERO = 35, /* ZERO */ + YYSYMBOL_AND = 36, /* AND */ + YYSYMBOL_BOR = 37, /* BOR */ + YYSYMBOL_APPEND = 38, /* APPEND */ + YYSYMBOL_EQ = 39, /* EQ */ + YYSYMBOL_GE = 40, /* GE */ + YYSYMBOL_GT = 41, /* GT */ + YYSYMBOL_LE = 42, /* LE */ + YYSYMBOL_LT = 43, /* LT */ + YYSYMBOL_NE = 44, /* NE */ + YYSYMBOL_IN = 45, /* IN */ + YYSYMBOL_ARG = 46, /* ARG */ + YYSYMBOL_BLTIN = 47, /* BLTIN */ + YYSYMBOL_BREAK = 48, /* BREAK */ + YYSYMBOL_CLOSE = 49, /* CLOSE */ + YYSYMBOL_CONTINUE = 50, /* CONTINUE */ + YYSYMBOL_DELETE = 51, /* DELETE */ + YYSYMBOL_DO = 52, /* DO */ + YYSYMBOL_EXIT = 53, /* EXIT */ + YYSYMBOL_FOR = 54, /* FOR */ + YYSYMBOL_FUNC = 55, /* FUNC */ + YYSYMBOL_SUB = 56, /* SUB */ + YYSYMBOL_GSUB = 57, /* GSUB */ + YYSYMBOL_IF = 58, /* IF */ + YYSYMBOL_INDEX = 59, /* INDEX */ + YYSYMBOL_LSUBSTR = 60, /* LSUBSTR */ + YYSYMBOL_MATCHFCN = 61, /* MATCHFCN */ + YYSYMBOL_NEXT = 62, /* NEXT */ + YYSYMBOL_NEXTFILE = 63, /* NEXTFILE */ + YYSYMBOL_ADD = 64, /* ADD */ + YYSYMBOL_MINUS = 65, /* MINUS */ + YYSYMBOL_MULT = 66, /* MULT */ + YYSYMBOL_DIVIDE = 67, /* DIVIDE */ + YYSYMBOL_MOD = 68, /* MOD */ + YYSYMBOL_ASSIGN = 69, /* ASSIGN */ + YYSYMBOL_ASGNOP = 70, /* ASGNOP */ + YYSYMBOL_ADDEQ = 71, /* ADDEQ */ + YYSYMBOL_SUBEQ = 72, /* SUBEQ */ + YYSYMBOL_MULTEQ = 73, /* MULTEQ */ + YYSYMBOL_DIVEQ = 74, /* DIVEQ */ + YYSYMBOL_MODEQ = 75, /* MODEQ */ + YYSYMBOL_POWEQ = 76, /* POWEQ */ + YYSYMBOL_PRINT = 77, /* PRINT */ + YYSYMBOL_PRINTF = 78, /* PRINTF */ + YYSYMBOL_SPRINTF = 79, /* SPRINTF */ + YYSYMBOL_ELSE = 80, /* ELSE */ + YYSYMBOL_INTEST = 81, /* INTEST */ + YYSYMBOL_CONDEXPR = 82, /* CONDEXPR */ + YYSYMBOL_POSTINCR = 83, /* POSTINCR */ + YYSYMBOL_PREINCR = 84, /* PREINCR */ + YYSYMBOL_POSTDECR = 85, /* POSTDECR */ + YYSYMBOL_PREDECR = 86, /* PREDECR */ + YYSYMBOL_VAR = 87, /* VAR */ + YYSYMBOL_IVAR = 88, /* IVAR */ + YYSYMBOL_VARNF = 89, /* VARNF */ + YYSYMBOL_CALL = 90, /* CALL */ + YYSYMBOL_NUMBER = 91, /* NUMBER */ + YYSYMBOL_STRING = 92, /* STRING */ + YYSYMBOL_REGEXPR = 93, /* REGEXPR */ + YYSYMBOL_94_ = 94, /* '?' */ + YYSYMBOL_95_ = 95, /* ':' */ + YYSYMBOL_GETLINE = 96, /* GETLINE */ + YYSYMBOL_RETURN = 97, /* RETURN */ + YYSYMBOL_SPLIT = 98, /* SPLIT */ + YYSYMBOL_SUBSTR = 99, /* SUBSTR */ + YYSYMBOL_WHILE = 100, /* WHILE */ + YYSYMBOL_CAT = 101, /* CAT */ + YYSYMBOL_102_ = 102, /* '+' */ + YYSYMBOL_103_ = 103, /* '-' */ + YYSYMBOL_104_ = 104, /* '*' */ + YYSYMBOL_105_ = 105, /* '%' */ + YYSYMBOL_NOT = 106, /* NOT */ + YYSYMBOL_UMINUS = 107, /* UMINUS */ + YYSYMBOL_UPLUS = 108, /* UPLUS */ + YYSYMBOL_POWER = 109, /* POWER */ + YYSYMBOL_DECR = 110, /* DECR */ + YYSYMBOL_INCR = 111, /* INCR */ + YYSYMBOL_INDIRECT = 112, /* INDIRECT */ + YYSYMBOL_LASTTOKEN = 113, /* LASTTOKEN */ + YYSYMBOL_YYACCEPT = 114, /* $accept */ + YYSYMBOL_program = 115, /* program */ + YYSYMBOL_and = 116, /* and */ + YYSYMBOL_bor = 117, /* bor */ + YYSYMBOL_comma = 118, /* comma */ + YYSYMBOL_do = 119, /* do */ + YYSYMBOL_else = 120, /* else */ + YYSYMBOL_for = 121, /* for */ + YYSYMBOL_122_1 = 122, /* $@1 */ + YYSYMBOL_123_2 = 123, /* $@2 */ + YYSYMBOL_124_3 = 124, /* $@3 */ + YYSYMBOL_funcname = 125, /* funcname */ + YYSYMBOL_if = 126, /* if */ + YYSYMBOL_lbrace = 127, /* lbrace */ + YYSYMBOL_nl = 128, /* nl */ + YYSYMBOL_opt_nl = 129, /* opt_nl */ + YYSYMBOL_opt_pst = 130, /* opt_pst */ + YYSYMBOL_opt_simple_stmt = 131, /* opt_simple_stmt */ + YYSYMBOL_pas = 132, /* pas */ + YYSYMBOL_pa_pat = 133, /* pa_pat */ + YYSYMBOL_pa_stat = 134, /* pa_stat */ + YYSYMBOL_135_4 = 135, /* $@4 */ + YYSYMBOL_pa_stats = 136, /* pa_stats */ + YYSYMBOL_patlist = 137, /* patlist */ + YYSYMBOL_ppattern = 138, /* ppattern */ + YYSYMBOL_pattern = 139, /* pattern */ + YYSYMBOL_plist = 140, /* plist */ + YYSYMBOL_pplist = 141, /* pplist */ + YYSYMBOL_prarg = 142, /* prarg */ + YYSYMBOL_print = 143, /* print */ + YYSYMBOL_pst = 144, /* pst */ + YYSYMBOL_rbrace = 145, /* rbrace */ + YYSYMBOL_re = 146, /* re */ + YYSYMBOL_reg_expr = 147, /* reg_expr */ + YYSYMBOL_148_5 = 148, /* $@5 */ + YYSYMBOL_rparen = 149, /* rparen */ + YYSYMBOL_simple_stmt = 150, /* simple_stmt */ + YYSYMBOL_st = 151, /* st */ + YYSYMBOL_stmt = 152, /* stmt */ + YYSYMBOL_153_6 = 153, /* $@6 */ + YYSYMBOL_154_7 = 154, /* $@7 */ + YYSYMBOL_155_8 = 155, /* $@8 */ + YYSYMBOL_stmtlist = 156, /* stmtlist */ + YYSYMBOL_subop = 157, /* subop */ + YYSYMBOL_string = 158, /* string */ + YYSYMBOL_term = 159, /* term */ + YYSYMBOL_var = 160, /* var */ + YYSYMBOL_varlist = 161, /* varlist */ + YYSYMBOL_varname = 162, /* varname */ + YYSYMBOL_while = 163 /* while */ }; -const short yylen[] = - { 2, - 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 0, 12, 0, 10, 0, 8, 1, 1, - 4, 1, 2, 1, 2, 0, 1, 0, 1, 0, - 1, 1, 3, 1, 1, 4, 4, 7, 3, 4, - 4, 0, 9, 1, 3, 1, 3, 3, 5, 3, - 3, 3, 3, 3, 5, 2, 1, 1, 3, 5, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 5, 4, 3, 2, 1, 1, 3, 3, 1, - 3, 0, 1, 3, 1, 1, 1, 1, 2, 2, - 1, 2, 1, 2, 0, 4, 1, 2, 4, 4, - 4, 2, 5, 2, 1, 1, 1, 2, 2, 2, - 0, 0, 9, 3, 2, 1, 4, 2, 3, 2, - 2, 3, 2, 2, 0, 3, 2, 1, 2, 1, - 1, 1, 2, 4, 3, 3, 3, 3, 3, 3, - 2, 2, 2, 3, 4, 1, 3, 4, 2, 2, - 2, 2, 2, 4, 3, 2, 1, 6, 6, 3, - 6, 6, 1, 8, 8, 6, 4, 1, 6, 6, - 8, 8, 8, 6, 1, 1, 4, 1, 2, 0, - 1, 3, 1, 1, 1, 4, -}; -const short yydefred[] = - { 0, - 2, 87, 88, 0, 1, 0, 0, 89, 90, 0, - 0, 22, 0, 95, 184, 0, 0, 0, 130, 131, - 0, 0, 0, 183, 178, 185, 0, 163, 132, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 76, 0, 44, 0, 93, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 19, 20, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 94, 150, 151, 179, 0, 0, - 3, 5, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 152, 153, 0, 106, 23, 0, 0, - 0, 0, 9, 0, 0, 0, 0, 0, 85, 86, - 0, 0, 0, 0, 128, 0, 116, 0, 125, 0, - 0, 0, 0, 133, 0, 0, 7, 160, 0, 0, - 0, 0, 144, 0, 0, 0, 0, 0, 0, 0, - 147, 0, 0, 0, 0, 0, 0, 0, 69, 0, - 0, 0, 0, 0, 0, 71, 0, 4, 0, 6, - 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, - 0, 0, 45, 0, 0, 127, 0, 109, 0, 110, - 0, 0, 115, 0, 0, 120, 121, 0, 123, 0, - 124, 39, 129, 0, 0, 10, 0, 0, 0, 0, - 0, 0, 0, 57, 0, 0, 0, 40, 41, 8, - 0, 0, 0, 96, 145, 0, 181, 0, 0, 0, - 167, 148, 0, 0, 0, 73, 0, 0, 25, 0, - 36, 177, 108, 0, 114, 31, 0, 0, 0, 122, - 0, 11, 0, 126, 112, 91, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 72, 0, 97, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, - 117, 0, 92, 0, 0, 0, 52, 54, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 98, 0, - 182, 158, 159, 162, 161, 166, 0, 174, 0, 0, - 103, 0, 0, 0, 0, 0, 0, 0, 170, 0, - 169, 0, 0, 0, 0, 0, 38, 0, 0, 0, - 0, 55, 0, 0, 0, 0, 0, 164, 165, 173, - 0, 0, 0, 0, 172, 171, 43, 0, 0, 18, - 0, 0, 0, 113, 16, 0, 0, 14, -}; -const short yydgoto[] = - { 4, - 5, 123, 210, 54, 211, 145, 212, 40, 41, 42, - 43, 44, 45, 124, 247, 125, 126, 46, 47, 63, - 228, 127, 128, 253, 129, 130, 188, 6, 7, 131, - 257, 275, 226, 189, 181, 92, 93, 49, 132, 50, - 367, 362, 353, 310, 55, 207, 292, 205, -}; -const short yysindex[] = - { -55, - 0, 0, 0, 0, 0, -39, 8470, 0, 0, -66, - -66, 0, 5698, 0, 0, 32, 1365, -255, 0, 0, - 43, 53, 64, 0, 0, 0, 89, 0, 0, 56, - 90, 107, 1365, 1365, 9050, -114, -114, 1365, 7895, -37, - 0, -13, 0, -29, 0, -264, 40, 5023, 108, -184, - 5023, 5023, 1864, 46, -179, 368, 5698, 1365, -37, -230, - 0, 0, 120, 5698, 5698, 5698, 3071, 1365, -117, 5698, - 5698, -176, -176, -176, 0, 0, 0, 0, -151, 5698, - 0, 0, 5698, 5698, 5698, 5698, 5698, 5698, -178, 5698, - -37, 8646, 8734, 866, 1365, 1365, 1365, 1365, 1365, -74, - 5023, 8470, 5698, 0, 0, 5698, 0, 0, -74, -24, - -24, -178, 0, 8566, 165, 172, -24, -24, 0, 0, - 8566, 205, 7895, -24, 0, 5157, 0, 6011, 0, -2, - 5023, 9074, 5698, 0, 5352, 5425, 0, 0, 8801, -19, - 8801, 203, 0, 7895, 96, 7035, -64, 7107, 7107, 100, - 0, 102, -37, 1365, 7107, 7107, -114, 9202, 0, 9202, - 9202, 9202, 9202, 9202, 9202, 0, 7182, 0, 8331, 0, - 8240, 1365, -176, -35, -35, -176, -176, -176, 0, 3, - 5698, 5486, 0, 7895, -23, 0, -74, 0, 3, 0, - 180, 6709, 0, 1771, 5698, 0, 0, 6709, 0, 5698, - 0, 0, 0, -52, 6011, 0, 6011, 5547, 5698, 8542, - 233, -108, -37, 0, -252, 7107, 233, 0, 0, 0, - 7895, -178, 7895, 0, 0, 8801, 0, 118, 8801, 8801, - 0, 0, -37, -210, 8801, 0, 5698, -37, 0, -66, - 0, 0, 0, 5698, 0, 0, 236, -80, 7289, 0, - 7289, 0, 5621, 0, 0, 0, 44, 134, 9126, -178, - 9126, -37, 8877, 8959, 8983, 1365, 1365, 1365, 9126, 8801, - 8801, 0, 7895, 0, 50, -223, 7374, 256, 7461, 281, - 138, 6781, 7895, 5023, 8, -5, -178, 50, 50, 0, - 0, -17, 0, 38, 5698, 9202, 0, 0, 8407, 4219, - 271, 8542, -37, -37, -37, 8542, 6853, 6963, 0, -66, - 0, 0, 0, 0, 0, 0, 8801, 0, 8801, 5815, - 0, -74, 5698, 282, 291, -178, 142, 9126, 0, 36, - 0, 36, 5023, 7556, 297, 7641, 0, 1771, 7727, 50, - 5698, 0, 38, 8542, 303, 314, 5889, 0, 0, 0, - 282, -74, 6011, 7823, 0, 0, 0, 50, 1771, 0, - -24, 6011, 282, 0, 0, 50, 6011, 0,}; -const short yyrindex[] = - { 3301, - 0, 0, 0, 0, 0, 3353, 356, 0, 0, 0, - 0, 0, 0, 0, 0, 91, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 3620, - 0, 0, 0, 0, 0, 0, 0, 0, 67, 2889, - 0, 3155, 0, 3301, 0, 1993, 1, 0, 0, 185, - 0, 0, 0, 0, 0, 0, 0, 0, 2349, 1682, - 0, 0, 0, 0, 0, 0, 0, 0, 500, 0, - 0, 590, 684, 999, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2983, 0, 0, 0, 0, 0, 0, 0, 0, 9150, - 0, 362, 0, 0, 0, 0, 0, 0, 4816, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -32, 0, 0, 0, 0, 0, 0, 6084, - 0, 239, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 22, 0, 0, 162, 0, 0, 0, - 0, 0, 2443, 0, 0, 0, 3690, 1047, 0, 1546, - 2490, 3723, 3774, 3784, 3817, 0, 0, 0, 4547, 0, - 856, 0, 1089, 2083, 2177, 1183, 1498, 1588, 0, 4099, - 0, 0, 0, 58, 0, 0, 4816, 0, 4928, 0, - -22, 0, 0, 305, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 5950, 0, 0, 0, 0, 0, 1011, - 306, 6, 8077, 0, 4755, 0, 7981, 0, 0, 0, - 163, 0, 169, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 2533, 0, 0, 0, 0, 2799, 0, 3249, - 0, 0, 0, 0, 0, 0, 0, 4662, 0, 0, - 0, 0, 0, 0, 0, 0, 5084, 0, 0, 0, - 0, 8153, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 34, 0, 247, 0, 0, 7981, 0, 7981, - 0, 0, 98, 0, 0, 9150, 0, 6157, 6218, 0, - 0, 0, 0, 403, 0, 216, 0, 0, 0, 179, - 635, 1034, 10, 30, 33, 539, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 6620, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 7981, 0, 0, 342, 0, 6279, - 0, 0, 0, 768, 0, 0, 0, 0, 0, 0, - 0, 6620, 0, 0, 0, 0, 0, 6352, 342, 0, - 0, 0, 0, 0, 0, 6425, 0, 0,}; -const short yygindex[] = - { 0, - 0, 4594, 391, -175, 0, -11, 0, 4313, -10, 204, - 293, 0, -65, -166, -277, 1227, -28, 4033, 891, 0, - 0, 0, 0, 0, 0, 0, -85, 0, 349, 7, - 0, -163, 429, -87, -106, -133, -104, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, -}; -#define YYTABLESIZE 9552 -const short yytable[] = - { 98, - 176, 98, 186, 3, 97, 95, 97, 96, 105, 94, - 106, 94, 180, 48, 159, 266, 51, 52, 104, 9, - 137, 180, 135, 136, 75, 190, 105, 246, 193, 3, - 100, 196, 197, 258, 187, 199, 104, 176, 201, 220, - 176, 176, 176, 176, 176, 176, 102, 176, 101, 103, - 99, 137, 220, 322, 150, 152, 12, 59, 176, 176, - 351, 269, 46, 176, 102, 46, 34, 217, 99, 242, - 100, 56, 182, 101, 47, 61, 263, 47, 62, 15, - 243, 363, 64, 104, 105, 288, 140, 289, 100, 137, - 146, 101, 65, 176, 185, 104, 105, 60, 59, 180, - 321, 59, 208, 66, 59, 264, 245, 311, 48, 12, - 34, 15, 250, 34, 46, 59, 59, 104, 105, 327, - 24, 214, 26, 176, 176, 34, 47, 146, 67, 70, - 106, 146, 146, 146, 146, 146, 225, 146, 60, 137, - 231, 60, 232, 137, 60, 137, 71, 133, 146, 146, - 59, 134, 24, 146, 26, 60, 60, 142, 274, 147, - 340, 137, 263, 278, 280, 263, 263, 263, 263, 154, - 99, 246, 263, 267, 294, 15, 268, 137, 316, 323, - 59, 137, 343, 146, 168, 137, 157, 358, 179, 34, - 60, 264, 246, 297, 264, 264, 264, 264, 180, 366, - 1, 264, 180, 78, 194, 180, 78, 2, 287, 79, - 263, 195, 79, 146, 146, 338, 24, 25, 26, 51, - 60, 168, 51, 8, 168, 168, 168, 168, 168, 168, - 105, 168, 285, 2, 180, 38, 51, 51, 179, 264, - 104, 51, 168, 168, 200, 359, 284, 168, 214, 224, - 214, 335, 214, 214, 214, 320, 53, 179, 214, 53, - 206, 176, 176, 176, 180, 239, 227, 176, 102, 222, - 244, 252, 99, 53, 53, 364, 137, 168, 53, 82, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 100, 176, 286, 101, 313, 82, 220, 176, - 176, 176, 51, 176, 347, 176, 293, 168, 168, 99, - 57, 99, 309, 33, 176, 34, 333, 214, 59, 59, - 59, 315, 274, 176, 325, 15, 326, 34, 34, 34, - 341, 176, 176, 176, 176, 176, 176, 349, 176, 53, - 176, 176, 68, 355, 176, 15, 83, 176, 176, 176, - 176, 146, 146, 146, 356, 32, 59, 146, 60, 60, - 60, 33, 82, 30, 83, 34, 24, 25, 26, 42, - 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, - 146, 146, 30, 146, 240, 38, 24, 25, 26, 146, - 146, 146, 102, 146, 183, 146, 60, 0, 0, 0, - 0, 0, 0, 0, 146, 38, 0, 13, 143, 0, - 33, 0, 34, 146, 14, 0, 0, 0, 0, 0, - 0, 146, 146, 146, 146, 146, 146, 0, 146, 83, - 146, 146, 0, 0, 146, 0, 0, 146, 146, 146, - 146, 51, 0, 84, 0, 168, 168, 168, 0, 0, - 0, 168, 0, 0, 0, 0, 0, 0, 51, 51, - 51, 84, 0, 51, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 0, 168, 53, 0, - 0, 139, 141, 168, 168, 168, 0, 168, 0, 168, - 0, 0, 0, 0, 0, 53, 53, 53, 168, 156, - 53, 82, 0, 0, 0, 0, 0, 168, 0, 0, - 0, 0, 0, 0, 0, 168, 168, 168, 168, 168, - 82, 0, 168, 82, 168, 168, 84, 0, 168, 0, - 0, 168, 168, 168, 168, 0, 156, 259, 0, 156, - 156, 156, 156, 156, 156, 0, 156, 0, 0, 0, - 81, 0, 0, 53, 0, 0, 0, 156, 156, 260, - 15, 16, 156, 17, 0, 0, 0, 0, 83, 0, - 19, 20, 0, 21, 0, 22, 229, 230, 0, 48, - 0, 0, 48, 234, 235, 0, 0, 83, 0, 142, - 83, 0, 156, 23, 0, 0, 48, 48, 0, 0, - 0, 24, 25, 26, 27, 28, 29, 0, 30, 0, - 31, 32, 0, 0, 58, 0, 0, 0, 36, 37, - 38, 0, 156, 156, 0, 0, 142, 0, 0, 142, - 142, 142, 142, 142, 142, 0, 142, 0, 0, 265, - 0, 0, 0, 0, 270, 271, 0, 142, 142, 296, - 0, 299, 142, 300, 301, 302, 276, 15, 16, 306, - 17, 0, 48, 0, 0, 84, 0, 19, 20, 0, - 21, 0, 22, 0, 0, 50, 0, 0, 50, 0, - 0, 0, 142, 141, 84, 0, 141, 84, 0, 0, - 23, 0, 50, 50, 0, 0, 0, 50, 24, 25, - 26, 27, 28, 29, 0, 30, 0, 31, 32, 317, - 319, 35, 142, 142, 0, 36, 37, 38, 344, 0, - 141, 0, 0, 141, 141, 141, 141, 141, 141, 0, - 141, 0, 0, 0, 0, 330, 332, 0, 0, 0, - 0, 141, 141, 0, 0, 0, 141, 0, 0, 0, - 0, 0, 0, 0, 0, 141, 0, 0, 50, 0, - 156, 156, 156, 0, 0, 0, 156, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 141, 0, 0, 156, - 156, 156, 156, 156, 156, 156, 0, 156, 156, 156, - 156, 0, 156, 0, 0, 0, 0, 0, 156, 156, - 156, 48, 156, 0, 156, 0, 141, 141, 49, 0, - 0, 49, 0, 156, 0, 0, 0, 0, 0, 0, - 48, 0, 156, 48, 0, 49, 49, 0, 0, 0, - 156, 156, 156, 156, 156, 156, 0, 156, 0, 156, - 156, 0, 0, 156, 0, 0, 156, 156, 156, 156, - 142, 142, 142, 0, 0, 61, 142, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 142, - 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, - 142, 0, 142, 0, 0, 0, 0, 0, 142, 142, - 142, 49, 142, 0, 142, 0, 61, 50, 0, 61, - 0, 0, 61, 142, 0, 57, 0, 0, 33, 0, - 34, 0, 142, 61, 61, 50, 50, 0, 61, 50, - 142, 142, 142, 142, 142, 142, 0, 142, 0, 142, - 142, 0, 0, 142, 0, 0, 0, 142, 142, 142, - 0, 0, 0, 0, 141, 141, 141, 0, 61, 0, - 141, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 141, 141, 141, 141, 141, 141, 141, - 141, 141, 141, 141, 141, 0, 141, 0, 61, 166, - 0, 0, 141, 141, 141, 0, 141, 0, 141, 0, - 0, 0, 0, 0, 0, 0, 0, 141, 143, 0, - 0, 0, 191, 0, 0, 0, 141, 0, 0, 0, - 0, 0, 0, 0, 141, 141, 141, 141, 141, 141, - 0, 141, 0, 141, 141, 0, 0, 141, 0, 0, - 49, 141, 141, 141, 0, 143, 0, 0, 143, 143, - 143, 143, 143, 143, 0, 143, 70, 0, 0, 49, - 0, 80, 49, 0, 80, 0, 143, 143, 0, 0, - 0, 143, 0, 0, 0, 0, 0, 0, 0, 80, - 0, 0, 0, 0, 81, 0, 0, 81, 0, 0, - 0, 0, 0, 0, 248, 0, 0, 70, 138, 0, - 70, 143, 81, 70, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 70, 70, 0, 0, 0, 70, - 0, 0, 272, 0, 0, 0, 61, 61, 61, 0, - 0, 143, 143, 0, 281, 138, 0, 0, 138, 138, - 138, 138, 138, 138, 80, 138, 61, 0, 0, 70, - 0, 0, 0, 0, 0, 0, 138, 138, 0, 0, - 298, 138, 0, 0, 61, 15, 16, 81, 17, 0, - 0, 0, 0, 0, 0, 19, 20, 0, 21, 70, - 22, 0, 0, 0, 0, 0, 0, 324, 0, 172, - 0, 138, 137, 0, 0, 0, 0, 0, 23, 0, - 0, 0, 0, 0, 0, 0, 24, 25, 26, 27, - 28, 29, 0, 30, 0, 31, 32, 0, 0, 58, - 0, 138, 138, 36, 37, 38, 342, 0, 0, 137, - 0, 0, 137, 137, 137, 137, 137, 137, 0, 137, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 137, 137, 0, 0, 0, 137, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 143, - 143, 143, 0, 0, 0, 143, 0, 0, 0, 0, - 0, 0, 0, 80, 0, 137, 0, 0, 143, 143, - 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, - 0, 143, 80, 0, 0, 80, 81, 143, 143, 143, - 0, 143, 0, 143, 0, 137, 137, 70, 70, 70, - 0, 0, 143, 0, 0, 81, 0, 0, 81, 0, - 0, 143, 0, 0, 0, 0, 70, 70, 0, 143, - 143, 143, 143, 143, 143, 0, 143, 0, 143, 143, - 0, 0, 143, 0, 0, 70, 143, 143, 143, 138, - 138, 138, 203, 0, 204, 138, 0, 0, 0, 0, - 0, 203, 203, 0, 0, 0, 0, 0, 138, 138, - 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, - 0, 138, 0, 0, 70, 0, 0, 138, 138, 138, - 0, 138, 0, 138, 0, 0, 0, 0, 0, 0, - 0, 0, 138, 0, 57, 0, 0, 33, 203, 34, - 0, 138, 0, 0, 0, 0, 0, 0, 0, 138, - 138, 138, 138, 138, 138, 0, 138, 0, 138, 138, - 0, 254, 138, 255, 203, 0, 138, 138, 138, 0, - 0, 0, 0, 137, 137, 137, 0, 0, 0, 137, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 0, 137, 0, 0, 0, 291, - 0, 137, 137, 137, 0, 137, 0, 137, 0, 0, - 0, 0, 0, 0, 0, 0, 137, 139, 0, 0, - 0, 0, 0, 0, 0, 137, 0, 0, 0, 0, - 0, 0, 0, 137, 137, 137, 137, 137, 137, 0, - 137, 0, 137, 137, 0, 0, 137, 0, 0, 0, - 137, 137, 137, 0, 139, 0, 0, 139, 139, 139, - 139, 139, 139, 0, 139, 63, 203, 0, 0, 0, - 0, 0, 0, 0, 0, 139, 139, 0, 0, 0, - 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 203, 0, 0, 0, 0, 0, 360, - 0, 0, 0, 0, 0, 0, 63, 140, 365, 63, - 139, 0, 63, 368, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 63, 63, 0, 0, 0, 63, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 139, 139, 0, 0, 140, 0, 0, 140, 140, 140, - 140, 140, 140, 0, 140, 0, 0, 0, 63, 0, - 0, 0, 0, 0, 0, 140, 140, 0, 0, 0, - 140, 0, 0, 0, 15, 16, 0, 17, 0, 0, - 0, 0, 0, 0, 19, 20, 0, 21, 63, 22, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 140, 175, 0, 0, 0, 0, 0, 23, 0, 0, - 0, 0, 0, 0, 0, 24, 25, 26, 27, 28, - 29, 0, 30, 0, 31, 32, 0, 0, 58, 0, - 140, 140, 36, 37, 38, 0, 0, 0, 175, 0, - 0, 175, 175, 175, 175, 175, 175, 0, 175, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 175, - 175, 0, 0, 0, 175, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 139, 139, - 139, 0, 0, 0, 139, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 175, 0, 0, 139, 139, 139, - 139, 139, 139, 139, 139, 139, 139, 139, 139, 0, - 139, 0, 0, 0, 0, 0, 139, 139, 139, 0, - 139, 0, 139, 0, 175, 175, 63, 63, 63, 0, - 13, 139, 0, 33, 0, 34, 0, 14, 0, 0, - 139, 0, 0, 0, 0, 63, 63, 0, 139, 139, - 139, 139, 139, 139, 0, 139, 0, 139, 139, 0, - 0, 139, 0, 0, 63, 139, 139, 139, 140, 140, - 140, 0, 0, 0, 140, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 140, 140, 140, - 140, 140, 140, 140, 140, 140, 140, 140, 140, 0, - 140, 0, 0, 63, 0, 0, 140, 140, 140, 0, - 140, 0, 140, 0, 0, 0, 0, 0, 0, 0, - 0, 140, 0, 57, 138, 0, 33, 137, 34, 0, - 140, 0, 0, 0, 0, 0, 0, 0, 140, 140, - 140, 140, 140, 140, 0, 140, 90, 140, 140, 0, - 0, 140, 0, 0, 0, 140, 140, 140, 0, 0, - 0, 0, 175, 175, 175, 0, 0, 0, 175, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 175, 175, 175, 175, 175, 175, 175, 175, 175, - 175, 175, 175, 0, 175, 0, 0, 0, 0, 0, - 175, 175, 175, 0, 175, 0, 175, 79, 0, 0, - 0, 0, 175, 0, 0, 175, 0, 0, 0, 0, - 0, 0, 0, 0, 175, 0, 0, 0, 0, 0, - 0, 0, 175, 175, 175, 175, 175, 175, 0, 175, - 0, 175, 175, 0, 0, 175, 107, 0, 175, 175, - 0, 175, 175, 175, 175, 175, 175, 175, 0, 175, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 175, 175, 0, 0, 0, 175, 0, 0, 0, 0, - 15, 16, 0, 17, 0, 112, 0, 0, 0, 0, - 19, 20, 0, 21, 0, 22, 0, 0, 0, 0, - 0, 0, 135, 0, 0, 175, 0, 0, 0, 0, - 0, 119, 120, 23, 0, 0, 0, 0, 0, 0, - 0, 24, 25, 26, 27, 28, 29, 0, 30, 0, - 31, 32, 0, 0, 35, 175, 175, 0, 36, 37, - 38, 0, 135, 135, 0, 135, 135, 135, 0, 0, - 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 135, 135, 0, 81, 82, 135, 83, 84, 85, 86, - 87, 88, 89, 15, 16, 0, 17, 0, 0, 0, - 0, 0, 0, 19, 20, 0, 21, 0, 22, 0, - 0, 0, 0, 0, 0, 135, 136, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, - 0, 0, 0, 0, 24, 25, 26, 27, 28, 29, - 0, 30, 0, 31, 32, 135, 135, 58, 0, 0, - 0, 36, 37, 38, 0, 0, 136, 136, 0, 136, - 136, 136, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 136, 136, 0, 0, 0, 136, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 175, 175, 175, 0, 0, 0, 175, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 136, - 0, 0, 175, 175, 0, 175, 175, 175, 175, 175, - 175, 175, 175, 175, 0, 175, 0, 0, 0, 0, - 0, 175, 175, 175, 0, 175, 0, 175, 0, 136, - 136, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 175, 0, 0, 0, 0, - 0, 0, 0, 175, 175, 175, 175, 175, 175, 0, - 175, 0, 175, 175, 0, 0, 175, 0, 0, 175, - 0, 0, 175, 135, 135, 135, 0, 0, 149, 135, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 135, 135, 135, 135, 135, 135, 135, 135, - 135, 135, 135, 135, 0, 135, 0, 0, 0, 0, - 0, 135, 135, 135, 0, 135, 0, 135, 149, 149, - 0, 0, 149, 0, 0, 0, 135, 0, 0, 0, - 0, 0, 0, 0, 0, 135, 149, 149, 0, 0, - 0, 149, 0, 135, 135, 135, 135, 135, 135, 0, - 135, 0, 135, 135, 0, 0, 135, 0, 0, 0, - 135, 135, 135, 0, 0, 0, 0, 136, 136, 136, - 0, 149, 155, 136, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 136, 136, 136, 136, - 136, 136, 136, 136, 136, 136, 136, 136, 0, 136, - 0, 149, 149, 0, 0, 136, 136, 136, 0, 136, - 0, 136, 155, 155, 0, 0, 155, 0, 0, 64, - 136, 0, 0, 0, 0, 0, 0, 0, 0, 136, - 155, 155, 0, 0, 0, 155, 0, 136, 136, 136, - 136, 136, 136, 0, 136, 0, 136, 136, 0, 0, - 136, 0, 0, 0, 136, 136, 136, 0, 0, 0, - 64, 0, 154, 64, 0, 155, 64, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 64, 64, 0, - 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 155, 155, 0, 0, 0, - 0, 0, 154, 154, 0, 0, 154, 0, 0, 0, - 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, - 154, 154, 0, 0, 0, 154, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 149, - 149, 149, 64, 0, 0, 149, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 154, 0, 0, 149, 149, - 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, - 0, 149, 0, 0, 0, 0, 0, 149, 149, 149, - 0, 149, 0, 149, 0, 154, 154, 0, 0, 0, - 0, 0, 149, 0, 0, 0, 0, 0, 0, 0, - 0, 149, 0, 0, 0, 0, 0, 0, 0, 149, - 149, 149, 149, 149, 149, 0, 149, 0, 149, 149, - 0, 0, 149, 0, 0, 0, 149, 149, 149, 0, - 0, 0, 0, 155, 155, 155, 0, 0, 0, 155, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 155, 155, 155, 155, 155, 155, 155, 155, - 155, 155, 155, 155, 0, 155, 0, 0, 0, 0, - 0, 155, 155, 155, 0, 155, 0, 155, 0, 0, - 64, 64, 64, 0, 0, 0, 155, 0, 0, 0, - 0, 0, 0, 0, 0, 155, 0, 0, 0, 64, - 64, 0, 0, 155, 155, 155, 155, 155, 155, 0, - 155, 0, 155, 155, 0, 0, 155, 0, 64, 0, - 155, 155, 155, 154, 154, 154, 0, 0, 134, 154, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 154, 154, 154, 154, 154, 154, 154, 154, - 154, 154, 154, 154, 0, 154, 0, 64, 0, 0, - 0, 154, 154, 154, 0, 154, 0, 154, 134, 134, - 0, 0, 134, 0, 0, 0, 154, 0, 0, 0, - 0, 0, 0, 0, 0, 154, 134, 134, 0, 0, - 0, 134, 0, 154, 154, 154, 154, 154, 154, 0, - 154, 0, 154, 154, 0, 0, 154, 0, 0, 0, - 154, 154, 154, 0, 0, 0, 0, 0, 77, 0, - 0, 134, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 134, 134, 0, 0, 0, 0, 0, 77, 77, - 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 77, 77, 0, 0, - 0, 77, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 77, 75, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 77, 77, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 75, 75, 0, 0, 75, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 75, 75, 0, 0, 0, 75, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, - 134, 134, 0, 0, 0, 134, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 75, 0, 0, 134, 134, - 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, - 0, 134, 0, 0, 0, 0, 0, 134, 134, 134, - 0, 134, 0, 134, 0, 75, 75, 0, 0, 0, - 13, 151, 134, 33, 0, 34, 0, 14, 0, 0, - 0, 134, 0, 0, 0, 0, 0, 0, 0, 134, - 134, 134, 134, 134, 134, 0, 134, 0, 134, 134, - 0, 0, 134, 0, 0, 0, 134, 134, 134, 77, - 77, 77, 0, 0, 35, 77, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 77, 77, - 0, 77, 77, 77, 77, 77, 77, 77, 77, 77, - 0, 77, 0, 0, 0, 0, 0, 77, 77, 77, - 0, 77, 0, 77, 35, 0, 0, 35, 0, 35, - 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 77, 0, 35, 0, 0, 0, 0, 0, 77, - 77, 77, 77, 77, 77, 0, 77, 0, 77, 77, - 0, 0, 77, 0, 0, 0, 77, 77, 77, 0, - 0, 0, 0, 75, 75, 75, 0, 0, 37, 75, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 75, 75, 0, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 0, 75, 0, 0, 0, 0, - 0, 75, 75, 75, 0, 75, 0, 75, 37, 0, - 0, 37, 0, 37, 0, 37, 0, 0, 0, 0, - 28, 0, 0, 0, 0, 75, 0, 37, 0, 0, - 0, 0, 0, 75, 75, 75, 75, 75, 75, 0, - 75, 0, 75, 75, 0, 0, 75, 0, 0, 0, - 75, 75, 75, 0, 0, 0, 0, 0, 0, 0, - 28, 0, 0, 28, 0, 28, 0, 28, 0, 0, - 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, - 15, 16, 0, 17, 0, 0, 0, 0, 0, 0, - 19, 20, 0, 21, 0, 22, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 29, 23, 0, 29, 0, 29, 0, 29, - 0, 24, 25, 26, 27, 28, 29, 0, 30, 0, - 31, 32, 0, 0, 35, 35, 35, 35, 36, 37, - 38, 0, 0, 28, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 35, 35, 0, 35, 0, 0, - 0, 0, 0, 35, 35, 35, 0, 35, 0, 35, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 29, 0, 35, 0, 0, - 0, 0, 0, 0, 0, 35, 35, 35, 35, 35, - 35, 0, 35, 0, 35, 35, 0, 0, 35, 0, - 0, 0, 35, 35, 35, 0, 0, 0, 0, 37, - 37, 37, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 37, 37, - 0, 37, 0, 0, 0, 0, 0, 37, 37, 37, - 0, 37, 0, 37, 0, 0, 0, 0, 0, 0, - 0, 28, 28, 0, 0, 0, 0, 0, 0, 0, - 0, 37, 0, 0, 0, 0, 0, 0, 0, 37, - 37, 37, 37, 37, 37, 0, 37, 0, 37, 37, - 28, 28, 37, 28, 0, 0, 37, 37, 37, 28, - 28, 28, 0, 28, 0, 28, 0, 0, 0, 0, - 0, 0, 0, 29, 29, 0, 0, 0, 0, 157, - 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, - 0, 28, 28, 28, 28, 28, 28, 0, 28, 0, - 28, 28, 29, 29, 28, 29, 0, 0, 28, 28, - 28, 29, 29, 29, 0, 29, 157, 29, 0, 157, - 157, 157, 157, 157, 157, 0, 157, 0, 0, 0, - 0, 0, 0, 0, 0, 29, 0, 157, 157, 0, - 0, 0, 157, 29, 29, 29, 29, 29, 29, 74, - 29, 0, 29, 29, 0, 0, 29, 0, 0, 0, - 29, 29, 29, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 157, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 65, 0, 0, 0, 0, 0, 0, 74, - 74, 0, 74, 74, 74, 0, 74, 0, 0, 0, - 0, 0, 157, 157, 0, 0, 0, 74, 74, 0, - 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 65, 0, 0, 65, 0, 0, 65, - 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, - 65, 65, 74, 67, 0, 65, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 74, 74, 66, 65, 68, 66, 0, 0, - 66, 0, 0, 0, 67, 0, 0, 67, 0, 0, - 67, 66, 66, 0, 0, 0, 66, 0, 0, 0, - 0, 67, 67, 0, 0, 65, 67, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, - 68, 0, 0, 68, 0, 0, 66, 0, 0, 0, - 0, 0, 0, 0, 68, 68, 67, 0, 0, 68, - 157, 157, 157, 0, 0, 0, 157, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 66, 0, 0, 157, - 157, 157, 157, 157, 157, 157, 67, 157, 157, 68, - 157, 0, 157, 0, 0, 0, 0, 0, 157, 157, - 157, 0, 157, 0, 157, 0, 0, 0, 0, 0, - 0, 0, 0, 157, 0, 0, 0, 0, 0, 68, - 0, 0, 157, 0, 0, 0, 0, 0, 0, 0, - 74, 74, 74, 157, 157, 157, 74, 157, 0, 157, - 157, 0, 0, 157, 0, 0, 157, 157, 157, 74, - 74, 0, 74, 74, 74, 74, 74, 74, 74, 0, - 74, 0, 74, 65, 65, 65, 0, 0, 74, 74, - 74, 0, 74, 0, 74, 0, 0, 0, 0, 0, - 0, 0, 65, 65, 0, 0, 0, 0, 0, 0, - 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, - 0, 65, 0, 74, 74, 74, 0, 74, 0, 74, - 74, 0, 0, 74, 66, 66, 66, 74, 74, 0, - 0, 0, 0, 0, 67, 67, 67, 0, 0, 60, - 0, 0, 0, 66, 66, 0, 0, 0, 0, 0, - 65, 0, 69, 67, 67, 60, 60, 60, 76, 77, - 60, 60, 66, 0, 0, 0, 0, 68, 68, 68, - 0, 0, 67, 0, 0, 60, 0, 0, 0, 0, - 60, 0, 0, 0, 0, 0, 68, 68, 0, 0, - 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 66, 0, 0, 0, 68, 0, 0, 0, 0, - 0, 67, 0, 0, 0, 0, 60, 60, 60, 60, - 60, 60, 0, 0, 0, 0, 0, 0, 27, 27, - 0, 27, 0, 27, 0, 27, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 60, 0, 27, 0, 0, - 0, 0, 0, 0, 215, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 60, 0, 60, 0, - 60, 60, 0, 0, 0, 0, 60, 60, 60, 236, - 60, 0, 60, 60, 60, 60, 60, 60, 0, 60, - 0, 60, 0, 60, 60, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 60, 0, 0, 0, - 0, 27, 0, 27, 60, 0, 0, 0, 0, 0, - 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 60, 0, 0, 0, 0, 0, 60, 0, - 0, 0, 0, 60, 0, 60, 0, 0, 57, 0, - 0, 33, 0, 34, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 60, 0, 60, 0, 0, 0, 0, 0, 0, - 0, 215, 0, 215, 0, 215, 215, 215, 60, 60, - 60, 215, 0, 0, 0, 60, 0, 0, 0, 60, - 0, 60, 0, 0, 60, 60, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 59, - 0, 60, 60, 60, 60, 0, 0, 0, 60, 60, - 60, 0, 0, 0, 0, 72, 73, 74, 0, 0, - 78, 91, 0, 0, 27, 0, 0, 0, 0, 0, - 215, 0, 345, 0, 346, 91, 60, 0, 60, 0, - 74, 60, 0, 0, 0, 0, 60, 0, 0, 0, - 153, 0, 0, 0, 0, 0, 60, 0, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 0, 27, 27, - 27, 27, 0, 27, 27, 27, 173, 174, 175, 176, - 177, 178, 0, 0, 0, 0, 0, 0, 0, 27, - 27, 27, 27, 0, 0, 0, 0, 0, 0, 27, - 27, 27, 27, 27, 27, 91, 27, 27, 27, 27, - 27, 0, 27, 0, 213, 0, 27, 27, 27, 0, - 0, 0, 0, 0, 0, 0, 91, 0, 91, 0, - 91, 91, 0, 0, 0, 0, 233, 91, 91, 0, - 91, 0, 91, 91, 91, 91, 91, 91, 0, 91, - 0, 91, 0, 91, 238, 259, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 91, 0, 0, 0, - 0, 0, 0, 0, 91, 0, 0, 260, 15, 16, - 91, 17, 0, 0, 0, 0, 0, 0, 19, 20, - 0, 21, 262, 22, 0, 0, 0, 0, 91, 0, - 0, 0, 0, 91, 0, 91, 0, 0, 0, 0, - 0, 23, 0, 0, 0, 0, 62, 0, 0, 24, - 25, 26, 27, 28, 29, 0, 30, 0, 31, 32, - 0, 91, 58, 91, 0, 0, 36, 37, 38, 0, - 0, 213, 0, 213, 0, 213, 213, 213, 303, 304, - 305, 213, 0, 0, 0, 91, 0, 62, 0, 91, - 62, 91, 0, 62, 91, 91, 0, 0, 0, 0, - 39, 0, 0, 0, 62, 62, 53, 0, 262, 62, - 0, 262, 262, 262, 262, 0, 0, 0, 262, 91, - 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, - 213, 0, 0, 0, 0, 0, 91, 0, 91, 144, - 146, 91, 0, 0, 0, 0, 262, 148, 149, 144, - 144, 0, 0, 155, 156, 0, 91, 0, 0, 62, - 0, 0, 0, 158, 0, 0, 160, 161, 162, 163, - 164, 165, 0, 167, 0, 169, 171, 0, 0, 0, - 0, 0, 0, 0, 0, 39, 184, 0, 176, 144, - 0, 176, 0, 176, 176, 0, 176, 192, 176, 0, - 0, 0, 0, 0, 198, 0, 0, 0, 0, 0, - 176, 0, 0, 0, 176, 0, 216, 0, 0, 0, - 0, 0, 221, 0, 223, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 39, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 176, 0, 0, 249, 0, - 0, 175, 0, 251, 175, 175, 175, 175, 175, 175, - 0, 175, 53, 0, 0, 0, 0, 62, 62, 62, - 0, 0, 175, 175, 0, 0, 0, 175, 0, 273, - 0, 0, 277, 279, 0, 0, 62, 62, 282, 0, - 283, 0, 0, 0, 0, 0, 0, 144, 0, 0, - 0, 0, 0, 0, 0, 62, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 26, 0, 0, 26, 0, - 26, 0, 26, 307, 308, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 26, 0, 0, 0, 175, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 53, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 334, 0, 336, 0, 0, 0, 339, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 176, 0, - 0, 0, 0, 0, 354, 0, 0, 0, 26, 0, - 26, 176, 176, 0, 176, 176, 176, 176, 176, 176, - 0, 176, 176, 0, 176, 0, 0, 0, 0, 0, - 0, 176, 176, 0, 176, 0, 176, 107, 0, 0, - 107, 0, 107, 0, 107, 176, 0, 0, 0, 0, - 0, 0, 0, 0, 176, 0, 107, 0, 0, 0, - 0, 0, 176, 176, 176, 176, 176, 176, 0, 176, - 0, 176, 176, 0, 0, 176, 0, 0, 176, 176, - 176, 176, 0, 0, 0, 0, 0, 175, 0, 0, - 0, 175, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 175, 175, 175, 0, 0, 175, - 0, 0, 0, 175, 175, 175, 0, 175, 0, 0, - 107, 0, 107, 0, 175, 175, 0, 175, 0, 175, - 0, 0, 13, 0, 0, 33, 0, 34, 0, 14, - 0, 26, 0, 0, 0, 0, 0, 175, 0, 0, - 0, 109, 0, 0, 0, 175, 175, 175, 175, 175, - 175, 0, 175, 0, 175, 175, 0, 0, 175, 0, - 0, 175, 0, 0, 175, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 0, 26, 26, 26, 26, 0, - 26, 26, 26, 119, 0, 0, 119, 0, 119, 0, - 119, 0, 0, 0, 0, 0, 26, 26, 26, 26, - 0, 0, 119, 0, 0, 12, 26, 26, 26, 26, - 26, 26, 0, 26, 26, 26, 26, 26, 0, 26, - 0, 0, 0, 26, 26, 26, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 107, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 13, 0, 0, 33, - 0, 34, 0, 14, 0, 0, 119, 0, 119, 0, - 0, 0, 0, 0, 0, 109, 0, 107, 107, 107, - 107, 107, 107, 107, 107, 107, 0, 107, 107, 107, - 107, 0, 107, 107, 107, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 107, 107, - 107, 107, 0, 0, 0, 0, 0, 0, 107, 107, - 107, 107, 107, 107, 0, 107, 107, 107, 107, 107, - 0, 107, 0, 0, 0, 107, 107, 107, 107, 12, - 0, 202, 0, 0, 0, 108, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 15, 16, 110, 17, 111, 112, 113, 114, - 115, 0, 19, 20, 116, 21, 0, 22, 117, 118, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 119, - 0, 0, 0, 119, 120, 23, 0, 0, 0, 0, - 0, 0, 0, 24, 25, 26, 27, 28, 29, 0, - 30, 121, 31, 32, 122, 0, 35, 0, 0, 0, - 36, 37, 38, 119, 119, 119, 119, 119, 119, 119, - 119, 119, 0, 119, 119, 119, 119, 0, 119, 119, - 119, 13, 0, 0, 33, 0, 34, 0, 14, 0, - 0, 0, 0, 0, 119, 119, 119, 119, 0, 0, - 109, 0, 107, 0, 119, 119, 119, 119, 119, 119, - 0, 119, 119, 119, 119, 119, 0, 119, 0, 0, - 0, 119, 119, 119, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 15, 16, 110, 17, - 111, 112, 113, 114, 115, 0, 19, 20, 116, 21, - 0, 22, 117, 118, 13, 0, 0, 33, 0, 34, - 0, 14, 0, 0, 12, 0, 218, 119, 120, 23, - 0, 0, 0, 109, 0, 0, 0, 24, 25, 26, - 27, 28, 29, 0, 30, 121, 31, 32, 122, 0, - 35, 0, 0, 0, 36, 37, 38, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 13, 0, 0, 33, 0, - 34, 0, 14, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 109, 0, 0, 12, 0, 219, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 13, 0, 0, 33, - 0, 34, 0, 14, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 109, 0, 107, 12, 0, - 241, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 15, 16, 110, 17, 111, 112, 113, 114, 115, - 0, 19, 20, 116, 21, 0, 22, 117, 118, 0, - 13, 0, 0, 33, 0, 34, 0, 14, 0, 12, - 0, 256, 119, 120, 23, 0, 0, 0, 0, 109, - 107, 0, 24, 25, 26, 27, 28, 29, 0, 30, - 121, 31, 32, 122, 0, 35, 0, 0, 0, 36, - 37, 38, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 15, 16, 110, 17, 111, 112, - 113, 114, 115, 0, 19, 20, 116, 21, 0, 22, - 117, 118, 0, 0, 0, 0, 0, 13, 0, 0, - 33, 107, 34, 12, 14, 119, 120, 23, 0, 0, - 0, 0, 0, 0, 0, 24, 25, 26, 27, 28, - 29, 0, 30, 121, 31, 32, 122, 0, 35, 0, - 0, 0, 36, 37, 38, 15, 16, 110, 17, 111, - 112, 113, 114, 115, 0, 19, 20, 116, 21, 0, - 22, 117, 118, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 107, 0, 0, 0, 119, 120, 23, 0, - 0, 0, 0, 0, 0, 0, 24, 25, 26, 27, - 28, 29, 0, 30, 121, 31, 32, 122, 0, 35, - 0, 0, 0, 36, 37, 38, 15, 16, 110, 17, - 111, 112, 113, 114, 115, 0, 19, 20, 116, 21, - 0, 22, 117, 118, 13, 0, 0, 33, 0, 34, - 0, 14, 0, 0, 0, 0, 0, 119, 120, 23, - 0, 0, 0, 109, 0, 0, 107, 24, 25, 26, - 27, 28, 29, 290, 30, 121, 31, 32, 122, 0, - 35, 0, 0, 0, 36, 37, 38, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 15, 16, 110, 17, 111, 112, 113, 114, 115, 0, - 19, 20, 116, 21, 0, 22, 117, 118, 13, 0, - 0, 33, 0, 34, 0, 14, 0, 12, 0, 337, - 0, 119, 120, 23, 0, 0, 0, 109, 0, 0, - 0, 24, 25, 26, 27, 28, 29, 0, 30, 121, - 31, 32, 122, 0, 35, 0, 0, 0, 36, 37, - 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 15, 16, 118, - 17, 0, 118, 0, 118, 0, 118, 19, 20, 0, - 21, 0, 22, 0, 0, 0, 0, 0, 118, 0, - 0, 12, 0, 357, 0, 0, 0, 0, 0, 0, - 23, 0, 0, 0, 0, 0, 0, 0, 24, 25, - 26, 27, 28, 29, 0, 30, 0, 31, 32, 0, - 0, 35, 0, 0, 0, 36, 37, 38, 0, 0, - 13, 0, 0, 33, 0, 34, 0, 14, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, - 107, 0, 118, 0, 118, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 15, 16, 110, 17, 111, 112, - 113, 114, 115, 0, 19, 20, 116, 21, 0, 22, - 117, 118, 0, 111, 0, 0, 111, 0, 111, 0, - 111, 0, 0, 12, 0, 119, 120, 23, 0, 0, - 0, 0, 111, 0, 107, 24, 25, 26, 27, 28, - 29, 0, 30, 121, 31, 32, 122, 0, 35, 0, - 0, 0, 36, 37, 38, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 15, 16, - 110, 17, 111, 112, 113, 114, 115, 0, 19, 20, - 116, 21, 0, 22, 117, 118, 21, 0, 0, 21, - 0, 21, 0, 21, 0, 118, 111, 0, 0, 119, - 120, 23, 0, 0, 0, 21, 0, 0, 0, 24, - 25, 26, 27, 28, 29, 0, 30, 121, 31, 32, - 122, 0, 35, 0, 0, 0, 36, 37, 38, 118, - 118, 118, 118, 118, 118, 118, 118, 118, 0, 118, - 118, 118, 118, 0, 118, 118, 118, 186, 0, 0, - 186, 0, 186, 0, 186, 0, 107, 0, 0, 0, - 118, 118, 118, 0, 0, 0, 186, 0, 0, 21, - 118, 118, 118, 118, 118, 118, 0, 118, 118, 118, - 118, 118, 0, 118, 0, 0, 0, 118, 118, 118, - 15, 16, 110, 17, 111, 112, 113, 114, 115, 0, - 19, 20, 116, 21, 0, 22, 117, 118, 17, 0, - 0, 17, 0, 17, 0, 17, 0, 0, 0, 0, - 0, 119, 120, 23, 0, 0, 0, 17, 0, 111, - 186, 24, 25, 26, 27, 28, 29, 0, 30, 121, - 31, 32, 122, 0, 35, 0, 0, 0, 36, 37, - 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 111, 111, 111, 111, 111, 111, 111, - 111, 111, 0, 111, 111, 111, 111, 0, 111, 111, - 111, 15, 0, 0, 15, 0, 15, 0, 15, 0, - 0, 17, 0, 0, 111, 111, 111, 0, 0, 0, - 15, 0, 21, 0, 111, 111, 111, 111, 111, 111, - 0, 111, 111, 111, 111, 111, 0, 111, 0, 0, - 0, 111, 111, 111, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 21, 21, 21, 21, - 21, 21, 21, 21, 21, 0, 21, 21, 21, 21, - 0, 21, 21, 21, 13, 0, 0, 13, 0, 13, - 0, 13, 0, 186, 15, 0, 0, 21, 21, 21, - 0, 0, 0, 13, 0, 0, 0, 21, 21, 21, - 21, 21, 21, 0, 21, 21, 21, 21, 21, 0, - 21, 0, 0, 0, 21, 21, 21, 186, 186, 186, - 186, 186, 186, 186, 186, 186, 0, 186, 186, 186, - 186, 0, 186, 186, 186, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 17, 0, 0, 0, 186, 186, - 186, 0, 0, 0, 0, 0, 0, 13, 186, 186, - 186, 186, 186, 186, 0, 186, 186, 186, 186, 186, - 0, 186, 0, 0, 0, 186, 186, 186, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 0, 17, 17, - 17, 17, 0, 17, 17, 17, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, - 17, 17, 0, 0, 0, 0, 0, 15, 0, 17, - 17, 17, 17, 17, 17, 0, 17, 17, 17, 17, - 17, 0, 17, 0, 0, 0, 17, 17, 17, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 0, 15, 15, 15, 15, 0, 15, 15, 15, 26, - 26, 0, 26, 0, 26, 0, 26, 0, 0, 0, - 0, 0, 15, 15, 15, 0, 0, 0, 0, 0, - 13, 0, 15, 15, 15, 15, 15, 15, 0, 15, - 15, 15, 15, 15, 0, 15, 0, 0, 0, 15, - 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 0, 13, 13, 13, 13, 0, 13, - 13, 13, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 13, 13, 13, 57, 0, - 0, 33, 0, 34, 0, 13, 13, 13, 13, 13, - 13, 0, 13, 13, 13, 13, 13, 187, 13, 0, - 0, 90, 13, 13, 13, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 57, 318, 0, 33, 137, 34, 0, 0, 0, 0, - 0, 0, 79, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 90, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 57, 329, 0, 33, 137, 34, 0, 0, - 0, 0, 0, 0, 79, 0, 0, 0, 0, 26, - 26, 0, 26, 0, 26, 90, 0, 0, 0, 26, - 26, 0, 26, 0, 26, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 26, 26, 26, 0, 0, 0, 0, 0, 0, 0, - 26, 26, 26, 26, 26, 26, 0, 26, 0, 26, - 26, 0, 0, 26, 0, 0, 0, 26, 26, 26, - 0, 179, 0, 0, 0, 80, 79, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 81, 82, - 0, 83, 84, 85, 86, 87, 88, 89, 15, 16, - 0, 17, 57, 331, 0, 33, 137, 34, 19, 20, - 0, 21, 0, 22, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 90, 0, 0, 0, 0, - 0, 23, 0, 0, 0, 0, 0, 0, 0, 24, - 25, 26, 27, 28, 29, 0, 30, 80, 31, 32, - 0, 0, 58, 0, 0, 0, 36, 37, 38, 0, - 81, 82, 0, 83, 84, 85, 86, 87, 88, 89, - 15, 16, 0, 17, 57, 138, 0, 33, 0, 34, - 19, 20, 0, 21, 0, 22, 79, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 90, 0, 0, - 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, - 0, 24, 25, 26, 27, 28, 29, 0, 30, 80, - 31, 32, 0, 0, 58, 0, 0, 0, 36, 37, - 38, 0, 81, 82, 0, 83, 84, 85, 86, 87, - 88, 89, 15, 16, 0, 17, 57, 0, 0, 33, - 137, 34, 19, 20, 0, 21, 0, 22, 79, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, - 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, - 0, 0, 0, 24, 25, 26, 27, 28, 29, 0, - 30, 0, 31, 32, 0, 0, 58, 0, 0, 0, - 36, 37, 38, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 57, 0, 0, 33, 0, 34, 0, 0, 80, - 79, 0, 0, 0, 0, 0, 0, 0, 0, 237, - 0, 0, 81, 82, 90, 83, 84, 85, 86, 87, - 88, 89, 15, 16, 0, 17, 0, 0, 0, 0, - 0, 0, 19, 20, 0, 21, 0, 22, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, - 0, 0, 0, 24, 25, 26, 27, 28, 29, 0, - 30, 80, 31, 32, 0, 79, 58, 0, 0, 0, - 36, 37, 38, 0, 81, 82, 0, 83, 84, 85, - 86, 87, 88, 89, 15, 16, 0, 17, 57, 274, - 0, 33, 0, 34, 19, 20, 0, 21, 0, 22, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 90, 0, 0, 0, 0, 0, 23, 0, 0, - 0, 0, 0, 0, 0, 24, 25, 26, 27, 28, - 29, 0, 30, 80, 31, 32, 0, 0, 58, 0, - 0, 0, 36, 37, 38, 0, 81, 82, 0, 83, - 84, 85, 86, 87, 88, 89, 15, 16, 0, 17, - 0, 0, 0, 0, 0, 0, 19, 20, 0, 21, - 0, 22, 79, 57, 312, 0, 33, 0, 34, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, - 0, 0, 0, 0, 0, 0, 90, 24, 25, 26, - 27, 28, 29, 0, 30, 0, 31, 32, 80, 0, - 58, 0, 0, 0, 36, 37, 38, 0, 0, 0, - 0, 81, 82, 0, 83, 84, 85, 86, 87, 88, - 89, 15, 16, 0, 17, 0, 0, 0, 0, 0, - 0, 19, 20, 0, 21, 0, 22, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 79, 0, 0, - 57, 314, 0, 33, 23, 34, 0, 0, 0, 0, - 0, 0, 24, 25, 26, 27, 28, 29, 0, 30, - 0, 31, 32, 90, 0, 58, 0, 0, 0, 36, - 37, 38, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 80, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 81, 82, - 0, 83, 84, 85, 86, 87, 88, 89, 15, 16, - 0, 17, 0, 0, 79, 0, 0, 0, 19, 20, - 0, 21, 0, 22, 0, 57, 348, 0, 33, 0, - 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 23, 0, 0, 0, 0, 0, 0, 90, 24, - 25, 26, 27, 28, 29, 0, 30, 0, 31, 32, - 0, 0, 58, 0, 0, 0, 36, 37, 38, 0, - 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 81, 82, 0, 83, 84, 85, 86, - 87, 88, 89, 15, 16, 0, 17, 0, 0, 0, - 0, 0, 0, 19, 20, 0, 21, 0, 22, 79, - 57, 350, 0, 33, 0, 34, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, - 0, 0, 0, 90, 24, 25, 26, 27, 28, 29, - 0, 30, 0, 31, 32, 0, 0, 58, 0, 0, - 0, 36, 37, 38, 0, 0, 0, 80, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 81, 82, 0, 83, 84, 85, 86, 87, 88, 89, - 15, 16, 0, 17, 0, 0, 0, 0, 0, 0, - 19, 20, 0, 21, 79, 22, 57, 0, 0, 33, - 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 23, 0, 352, 0, 0, 0, 90, - 0, 24, 25, 26, 27, 28, 29, 0, 30, 0, - 31, 32, 0, 0, 58, 0, 0, 0, 36, 37, - 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 81, 82, 0, 83, 84, - 85, 86, 87, 88, 89, 15, 16, 0, 17, 0, - 79, 0, 0, 0, 0, 19, 20, 0, 21, 0, - 22, 0, 57, 361, 0, 33, 0, 34, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, - 0, 0, 0, 0, 0, 90, 24, 25, 26, 27, - 28, 29, 0, 30, 0, 31, 32, 0, 0, 58, - 0, 0, 0, 36, 37, 38, 0, 80, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 81, 82, 0, 83, 84, 85, 86, 87, 88, 89, - 15, 16, 0, 17, 57, 0, 0, 33, 0, 34, - 19, 20, 0, 21, 0, 22, 79, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 90, 0, 0, - 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, - 0, 24, 25, 26, 27, 28, 29, 0, 30, 0, - 31, 32, 0, 0, 58, 0, 0, 0, 36, 37, - 38, 0, 0, 80, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 81, 82, 0, 83, - 84, 85, 86, 87, 88, 89, 15, 16, 79, 17, - 93, 0, 0, 93, 0, 93, 19, 20, 0, 21, - 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 93, 0, 0, 0, 0, 0, 23, - 0, 0, 0, 0, 0, 0, 0, 24, 25, 26, - 27, 28, 29, 0, 30, 0, 31, 32, 0, 0, - 58, 0, 0, 0, 36, 37, 38, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 81, 82, 93, 83, 84, 85, 86, 87, - 88, 89, 15, 16, 0, 17, 58, 58, 0, 0, - 58, 0, 19, 20, 0, 21, 0, 22, 0, 0, - 0, 0, 0, 0, 58, 58, 0, 0, 0, 58, - 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, - 0, 0, 0, 24, 25, 26, 27, 28, 29, 0, - 30, 80, 31, 32, 0, 0, 58, 0, 0, 0, - 36, 37, 38, 0, 81, 82, 0, 83, 84, 85, - 86, 87, 88, 89, 15, 16, 0, 17, 0, 0, - 0, 0, 56, 56, 19, 20, 56, 21, 0, 22, - 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 56, 56, 0, 0, 0, 56, 0, 23, 0, 0, - 0, 0, 0, 0, 0, 24, 25, 26, 27, 28, - 29, 0, 30, 0, 31, 32, 0, 0, 58, 0, - 0, 0, 36, 37, 38, 0, 0, 93, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 93, 93, 0, 93, 93, 93, 93, 93, 93, 93, - 93, 93, 0, 93, 0, 0, 56, 0, 0, 57, - 93, 93, 33, 93, 34, 93, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 93, 0, 0, 0, 0, 0, 0, - 0, 93, 93, 93, 93, 93, 93, 0, 93, 0, - 93, 93, 0, 0, 93, 0, 0, 0, 93, 93, - 93, 0, 0, 0, 0, 0, 0, 0, 0, 58, - 0, 0, 0, 58, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 58, 58, 58, 0, - 0, 58, 0, 79, 0, 58, 58, 58, 0, 58, - 57, 0, 0, 33, 0, 34, 58, 58, 0, 58, - 0, 58, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 58, - 0, 0, 0, 0, 0, 0, 0, 58, 58, 58, - 58, 58, 58, 0, 58, 56, 58, 58, 0, 56, - 58, 0, 0, 0, 58, 58, 58, 0, 0, 0, - 0, 0, 56, 56, 56, 0, 0, 56, 0, 0, - 0, 56, 56, 56, 0, 56, 57, 0, 0, 33, - 0, 34, 56, 56, 79, 56, 0, 56, 0, 0, - 0, 0, 0, 0, 328, 0, 0, 0, 0, 261, - 0, 0, 0, 0, 0, 56, 0, 0, 0, 0, - 0, 0, 0, 56, 56, 56, 56, 56, 56, 0, - 56, 0, 56, 56, 0, 0, 56, 0, 0, 0, - 56, 56, 56, 0, 0, 0, 80, 0, 0, 13, - 0, 0, 33, 0, 34, 0, 14, 0, 0, 81, - 0, 0, 83, 84, 85, 86, 87, 88, 89, 15, - 16, 0, 17, 0, 0, 0, 0, 0, 0, 19, - 20, 0, 21, 0, 22, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, - 24, 25, 26, 27, 28, 29, 0, 30, 0, 31, - 32, 57, 0, 58, 33, 0, 34, 36, 37, 38, - 0, 0, 12, 0, 0, 0, 0, 80, 0, 0, - 0, 0, 0, 0, 261, 13, 0, 0, 33, 0, - 34, 0, 14, 83, 84, 85, 86, 87, 88, 89, - 15, 16, 0, 17, 187, 0, 0, 0, 0, 0, - 19, 20, 0, 21, 0, 22, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, - 0, 24, 25, 26, 27, 28, 29, 0, 30, 0, - 31, 32, 0, 259, 58, 0, 0, 0, 36, 37, - 38, 0, 0, 0, 0, 13, 81, 82, 33, 0, - 34, 0, 14, 0, 0, 260, 15, 16, 0, 17, - 0, 0, 0, 0, 0, 0, 19, 20, 0, 21, - 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, - 10, 11, 0, 0, 0, 0, 0, 24, 25, 26, - 27, 28, 29, 0, 30, 0, 31, 32, 0, 0, - 58, 0, 0, 0, 36, 37, 38, 0, 0, 15, - 16, 0, 17, 0, 0, 0, 0, 0, 18, 19, - 20, 0, 21, 13, 22, 0, 33, 0, 34, 0, - 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, - 24, 25, 26, 27, 28, 29, 0, 30, 259, 31, - 32, 0, 0, 35, 0, 0, 0, 36, 37, 38, - 0, 81, 82, 0, 0, 0, 0, 0, 179, 0, - 260, 15, 16, 0, 17, 0, 0, 0, 0, 0, - 13, 19, 20, 33, 21, 34, 22, 14, 0, 0, - 0, 0, 0, 0, 0, 15, 16, 0, 17, 0, - 0, 0, 0, 0, 23, 19, 20, 0, 21, 0, - 22, 0, 24, 25, 26, 27, 28, 29, 0, 30, - 0, 31, 32, 0, 0, 58, 0, 0, 23, 36, - 37, 38, 0, 0, 0, 0, 24, 25, 26, 27, - 28, 29, 0, 30, 0, 31, 32, 0, 168, 35, - 0, 0, 0, 36, 37, 38, 295, 0, 0, 33, - 0, 34, 0, 14, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 15, 16, 0, 17, 0, - 0, 0, 0, 0, 0, 19, 20, 0, 21, 0, - 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, - 0, 0, 0, 0, 0, 0, 24, 25, 26, 27, - 28, 29, 0, 30, 0, 31, 32, 0, 0, 35, - 0, 0, 0, 36, 37, 38, 170, 0, 295, 0, - 0, 33, 0, 34, 0, 14, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 295, 15, 16, 33, 17, 34, 0, 14, - 0, 0, 0, 19, 20, 0, 21, 0, 22, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, - 0, 0, 0, 220, 24, 25, 26, 27, 28, 29, - 0, 30, 0, 31, 32, 0, 0, 35, 0, 0, - 0, 36, 37, 38, 0, 0, 0, 0, 0, 57, - 15, 16, 33, 17, 34, 0, 14, 0, 0, 0, - 19, 20, 0, 21, 0, 22, 0, 0, 0, 0, - 0, 0, 0, 209, 0, 0, 33, 0, 34, 0, - 14, 0, 0, 23, 0, 0, 0, 0, 0, 0, - 0, 24, 25, 26, 27, 28, 29, 0, 30, 168, - 31, 32, 0, 0, 35, 0, 0, 0, 36, 37, - 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 295, 15, 16, 33, 17, - 34, 0, 14, 0, 0, 0, 19, 20, 0, 21, - 0, 22, 0, 0, 0, 0, 0, 0, 0, 26, - 0, 0, 26, 0, 26, 0, 26, 0, 0, 23, - 0, 0, 0, 0, 0, 0, 0, 24, 25, 26, - 27, 28, 29, 0, 30, 0, 31, 32, 0, 0, - 35, 170, 0, 0, 36, 37, 38, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 57, 0, 0, 33, 220, 34, 0, 15, 16, - 0, 17, 0, 0, 0, 0, 0, 0, 19, 20, - 0, 21, 0, 22, 0, 0, 0, 0, 0, 0, - 0, 0, 15, 16, 0, 17, 0, 0, 0, 0, - 0, 23, 19, 20, 0, 21, 0, 22, 0, 24, - 25, 26, 27, 28, 29, 0, 30, 0, 31, 32, - 0, 0, 35, 0, 0, 23, 36, 37, 38, 0, - 0, 0, 0, 24, 25, 26, 27, 28, 29, 0, - 30, 0, 31, 32, 0, 0, 35, 0, 0, 0, - 36, 37, 38, 0, 0, 0, 0, 0, 0, 15, - 16, 0, 17, 0, 0, 0, 0, 0, 0, 19, - 20, 0, 21, 0, 22, 0, 0, 0, 0, 0, - 0, 0, 0, 15, 16, 0, 17, 0, 0, 0, - 0, 0, 23, 19, 20, 0, 21, 0, 22, 0, - 24, 25, 26, 27, 28, 29, 0, 30, 0, 31, - 32, 0, 0, 35, 0, 0, 23, 36, 37, 38, - 0, 0, 0, 0, 24, 25, 26, 27, 28, 29, - 0, 30, 0, 31, 32, 15, 16, 35, 17, 0, - 0, 36, 37, 38, 0, 19, 20, 0, 21, 0, - 22, 0, 0, 0, 0, 0, 0, 0, 0, 26, - 26, 0, 26, 0, 0, 0, 0, 0, 23, 26, - 26, 0, 26, 0, 26, 0, 24, 25, 26, 27, - 28, 29, 0, 30, 0, 31, 32, 0, 0, 35, - 0, 0, 26, 36, 37, 38, 0, 0, 0, 0, - 26, 26, 26, 26, 26, 26, 0, 26, 0, 26, - 26, 15, 16, 26, 17, 0, 0, 26, 26, 26, - 0, 19, 20, 0, 21, 0, 22, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, - 0, 0, 24, 25, 26, 27, 28, 29, 0, 0, - 0, 31, 32, 0, 0, 58, 0, 0, 0, 36, - 37, 38, -}; -const short yycheck[] = - { 37, - 0, 37, 109, 59, 42, 43, 42, 45, 41, 47, - 91, 47, 100, 7, 80, 124, 10, 11, 41, 59, - 44, 109, 51, 52, 35, 111, 59, 194, 114, 59, - 44, 117, 118, 209, 59, 121, 59, 37, 124, 263, - 40, 41, 42, 43, 44, 45, 41, 47, 42, 314, - 41, 44, 263, 59, 66, 67, 123, 0, 58, 59, - 338, 314, 41, 63, 59, 44, 0, 133, 59, 93, - 41, 40, 101, 41, 41, 331, 210, 44, 334, 290, - 187, 359, 40, 348, 349, 249, 41, 251, 59, 44, - 0, 59, 40, 93, 106, 348, 349, 0, 41, 187, - 93, 44, 131, 40, 47, 210, 192, 331, 102, 123, - 44, 290, 198, 47, 93, 58, 59, 348, 349, 295, - 331, 132, 333, 123, 124, 59, 93, 37, 40, 40, - 91, 41, 42, 43, 44, 45, 41, 47, 41, 44, - 41, 44, 41, 44, 47, 44, 40, 40, 58, 59, - 93, 336, 331, 63, 333, 58, 59, 337, 41, 40, - 324, 44, 296, 229, 230, 299, 300, 301, 302, 287, - 347, 338, 306, 282, 41, 290, 285, 44, 41, 286, - 123, 44, 41, 93, 0, 44, 338, 351, 263, 123, - 93, 296, 359, 259, 299, 300, 301, 302, 286, 363, - 256, 306, 41, 41, 40, 44, 44, 263, 289, 41, - 344, 40, 44, 123, 124, 322, 331, 332, 333, 41, - 123, 37, 44, 263, 40, 41, 42, 43, 44, 45, - 263, 47, 244, 263, 322, 350, 58, 59, 263, 344, - 263, 63, 58, 59, 40, 352, 240, 63, 259, 47, - 261, 317, 263, 264, 265, 284, 41, 263, 269, 44, - 263, 261, 262, 263, 352, 263, 331, 267, 263, 289, - 91, 324, 263, 58, 59, 361, 44, 93, 63, 41, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 263, 293, 59, 263, 41, 59, 263, 299, - 300, 301, 124, 303, 333, 305, 263, 123, 124, 347, - 40, 347, 263, 43, 314, 45, 310, 328, 261, 262, - 263, 41, 41, 323, 342, 290, 289, 261, 262, 263, - 40, 331, 332, 333, 334, 335, 336, 41, 338, 124, - 340, 341, 287, 41, 344, 290, 41, 347, 348, 349, - 350, 261, 262, 263, 41, 0, 299, 267, 261, 262, - 263, 0, 124, 59, 59, 299, 331, 332, 333, 123, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 41, 293, 181, 350, 331, 332, 333, 299, - 300, 301, 44, 303, 102, 305, 299, -1, -1, -1, - -1, -1, -1, -1, 314, 350, -1, 40, 41, -1, - 43, -1, 45, 323, 47, -1, -1, -1, -1, -1, - -1, 331, 332, 333, 334, 335, 336, -1, 338, 124, - 340, 341, -1, -1, 344, -1, -1, 347, 348, 349, - 350, 263, -1, 41, -1, 261, 262, 263, -1, -1, - -1, 267, -1, -1, -1, -1, -1, -1, 280, 281, - 282, 59, -1, 285, 280, 281, 282, 283, 284, 285, - 286, 287, 288, 289, 290, 291, -1, 293, 263, -1, - -1, 53, 54, 299, 300, 301, -1, 303, -1, 305, - -1, -1, -1, -1, -1, 280, 281, 282, 314, 0, - 285, 263, -1, -1, -1, -1, -1, 323, -1, -1, - -1, -1, -1, -1, -1, 331, 332, 333, 334, 335, - 282, -1, 338, 285, 340, 341, 124, -1, 344, -1, - -1, 347, 348, 349, 350, -1, 37, 267, -1, 40, - 41, 42, 43, 44, 45, -1, 47, -1, -1, -1, - 280, -1, -1, 338, -1, -1, -1, 58, 59, 289, - 290, 291, 63, 293, -1, -1, -1, -1, 263, -1, - 300, 301, -1, 303, -1, 305, 148, 149, -1, 41, - -1, -1, 44, 155, 156, -1, -1, 282, -1, 0, - 285, -1, 93, 323, -1, -1, 58, 59, -1, -1, - -1, 331, 332, 333, 334, 335, 336, -1, 338, -1, - 340, 341, -1, -1, 344, -1, -1, -1, 348, 349, - 350, -1, 123, 124, -1, -1, 37, -1, -1, 40, - 41, 42, 43, 44, 45, -1, 47, -1, -1, 211, - -1, -1, -1, -1, 216, 217, -1, 58, 59, 259, - -1, 261, 63, 263, 264, 265, 228, 290, 291, 269, - 293, -1, 124, -1, -1, 263, -1, 300, 301, -1, - 303, -1, 305, -1, -1, 41, -1, -1, 44, -1, - -1, -1, 93, 0, 282, -1, 258, 285, -1, -1, - 323, -1, 58, 59, -1, -1, -1, 63, 331, 332, - 333, 334, 335, 336, -1, 338, -1, 340, 341, 281, - 282, 344, 123, 124, -1, 348, 349, 350, 328, -1, - 37, -1, -1, 40, 41, 42, 43, 44, 45, -1, - 47, -1, -1, -1, -1, 307, 308, -1, -1, -1, - -1, 58, 59, -1, -1, -1, 63, -1, -1, -1, - -1, -1, -1, -1, -1, 327, -1, -1, 124, -1, - 261, 262, 263, -1, -1, -1, 267, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 93, -1, -1, 280, - 281, 282, 283, 284, 285, 286, -1, 288, 289, 290, - 291, -1, 293, -1, -1, -1, -1, -1, 299, 300, - 301, 263, 303, -1, 305, -1, 123, 124, 41, -1, - -1, 44, -1, 314, -1, -1, -1, -1, -1, -1, - 282, -1, 323, 285, -1, 58, 59, -1, -1, -1, - 331, 332, 333, 334, 335, 336, -1, 338, -1, 340, - 341, -1, -1, 344, -1, -1, 347, 348, 349, 350, - 261, 262, 263, -1, -1, 0, 267, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, -1, 293, -1, -1, -1, -1, -1, 299, 300, - 301, 124, 303, -1, 305, -1, 41, 263, -1, 44, - -1, -1, 47, 314, -1, 40, -1, -1, 43, -1, - 45, -1, 323, 58, 59, 281, 282, -1, 63, 285, - 331, 332, 333, 334, 335, 336, -1, 338, -1, 340, - 341, -1, -1, 344, -1, -1, -1, 348, 349, 350, - -1, -1, -1, -1, 261, 262, 263, -1, 93, -1, - 267, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 291, -1, 293, -1, 123, 89, - -1, -1, 299, 300, 301, -1, 303, -1, 305, -1, - -1, -1, -1, -1, -1, -1, -1, 314, 0, -1, - -1, -1, 112, -1, -1, -1, 323, -1, -1, -1, - -1, -1, -1, -1, 331, 332, 333, 334, 335, 336, - -1, 338, -1, 340, 341, -1, -1, 344, -1, -1, - 263, 348, 349, 350, -1, 37, -1, -1, 40, 41, - 42, 43, 44, 45, -1, 47, 0, -1, -1, 282, - -1, 41, 285, -1, 44, -1, 58, 59, -1, -1, - -1, 63, -1, -1, -1, -1, -1, -1, -1, 59, - -1, -1, -1, -1, 41, -1, -1, 44, -1, -1, - -1, -1, -1, -1, 194, -1, -1, 41, 0, -1, - 44, 93, 59, 47, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 58, 59, -1, -1, -1, 63, - -1, -1, 222, -1, -1, -1, 261, 262, 263, -1, - -1, 123, 124, -1, 234, 37, -1, -1, 40, 41, - 42, 43, 44, 45, 124, 47, 281, -1, -1, 93, - -1, -1, -1, -1, -1, -1, 58, 59, -1, -1, - 260, 63, -1, -1, 299, 290, 291, 124, 293, -1, - -1, -1, -1, -1, -1, 300, 301, -1, 303, 123, - 305, -1, -1, -1, -1, -1, -1, 287, -1, 314, - -1, 93, 0, -1, -1, -1, -1, -1, 323, -1, - -1, -1, -1, -1, -1, -1, 331, 332, 333, 334, - 335, 336, -1, 338, -1, 340, 341, -1, -1, 344, - -1, 123, 124, 348, 349, 350, 326, -1, -1, 37, - -1, -1, 40, 41, 42, 43, 44, 45, -1, 47, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 58, 59, -1, -1, -1, 63, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 261, - 262, 263, -1, -1, -1, 267, -1, -1, -1, -1, - -1, -1, -1, 263, -1, 93, -1, -1, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, - -1, 293, 282, -1, -1, 285, 263, 299, 300, 301, - -1, 303, -1, 305, -1, 123, 124, 261, 262, 263, - -1, -1, 314, -1, -1, 282, -1, -1, 285, -1, - -1, 323, -1, -1, -1, -1, 280, 281, -1, 331, - 332, 333, 334, 335, 336, -1, 338, -1, 340, 341, - -1, -1, 344, -1, -1, 299, 348, 349, 350, 261, - 262, 263, 126, -1, 128, 267, -1, -1, -1, -1, - -1, 135, 136, -1, -1, -1, -1, -1, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, - -1, 293, -1, -1, 338, -1, -1, 299, 300, 301, - -1, 303, -1, 305, -1, -1, -1, -1, -1, -1, - -1, -1, 314, -1, 40, -1, -1, 43, 182, 45, - -1, 323, -1, -1, -1, -1, -1, -1, -1, 331, - 332, 333, 334, 335, 336, -1, 338, -1, 340, 341, - -1, 205, 344, 207, 208, -1, 348, 349, 350, -1, - -1, -1, -1, 261, 262, 263, -1, -1, -1, 267, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, -1, 293, -1, -1, -1, 253, - -1, 299, 300, 301, -1, 303, -1, 305, -1, -1, - -1, -1, -1, -1, -1, -1, 314, 0, -1, -1, - -1, -1, -1, -1, -1, 323, -1, -1, -1, -1, - -1, -1, -1, 331, 332, 333, 334, 335, 336, -1, - 338, -1, 340, 341, -1, -1, 344, -1, -1, -1, - 348, 349, 350, -1, 37, -1, -1, 40, 41, 42, - 43, 44, 45, -1, 47, 0, 320, -1, -1, -1, - -1, -1, -1, -1, -1, 58, 59, -1, -1, -1, - 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 347, -1, -1, -1, -1, -1, 353, - -1, -1, -1, -1, -1, -1, 41, 0, 362, 44, - 93, -1, 47, 367, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 58, 59, -1, -1, -1, 63, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 123, 124, -1, -1, 37, -1, -1, 40, 41, 42, - 43, 44, 45, -1, 47, -1, -1, -1, 93, -1, - -1, -1, -1, -1, -1, 58, 59, -1, -1, -1, - 63, -1, -1, -1, 290, 291, -1, 293, -1, -1, - -1, -1, -1, -1, 300, 301, -1, 303, 123, 305, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 93, 0, -1, -1, -1, -1, -1, 323, -1, -1, - -1, -1, -1, -1, -1, 331, 332, 333, 334, 335, - 336, -1, 338, -1, 340, 341, -1, -1, 344, -1, - 123, 124, 348, 349, 350, -1, -1, -1, 37, -1, - -1, 40, 41, 42, 43, 44, 45, -1, 47, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 58, - 59, -1, -1, -1, 63, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 261, 262, - 263, -1, -1, -1, 267, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 93, -1, -1, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, - 293, -1, -1, -1, -1, -1, 299, 300, 301, -1, - 303, -1, 305, -1, 123, 124, 261, 262, 263, -1, - 40, 314, -1, 43, -1, 45, -1, 47, -1, -1, - 323, -1, -1, -1, -1, 280, 281, -1, 331, 332, - 333, 334, 335, 336, -1, 338, -1, 340, 341, -1, - -1, 344, -1, -1, 299, 348, 349, 350, 261, 262, - 263, -1, -1, -1, 267, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, - 293, -1, -1, 338, -1, -1, 299, 300, 301, -1, - 303, -1, 305, -1, -1, -1, -1, -1, -1, -1, - -1, 314, -1, 40, 41, -1, 43, 44, 45, -1, - 323, -1, -1, -1, -1, -1, -1, -1, 331, 332, - 333, 334, 335, 336, -1, 338, 63, 340, 341, -1, - -1, 344, -1, -1, -1, 348, 349, 350, -1, -1, - -1, -1, 261, 262, 263, -1, -1, -1, 267, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, -1, 293, -1, -1, -1, -1, -1, - 299, 300, 301, -1, 303, -1, 305, 124, -1, -1, - -1, -1, 0, -1, -1, 314, -1, -1, -1, -1, - -1, -1, -1, -1, 323, -1, -1, -1, -1, -1, - -1, -1, 331, 332, 333, 334, 335, 336, -1, 338, - -1, 340, 341, -1, -1, 344, 256, -1, 347, 37, - -1, 350, 40, 41, 42, 43, 44, 45, -1, 47, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 58, 59, -1, -1, -1, 63, -1, -1, -1, -1, - 290, 291, -1, 293, -1, 295, -1, -1, -1, -1, - 300, 301, -1, 303, -1, 305, -1, -1, -1, -1, - -1, -1, 0, -1, -1, 93, -1, -1, -1, -1, - -1, 321, 322, 323, -1, -1, -1, -1, -1, -1, - -1, 331, 332, 333, 334, 335, 336, -1, 338, -1, - 340, 341, -1, -1, 344, 123, 124, -1, 348, 349, - 350, -1, 40, 41, -1, 43, 44, 45, -1, -1, - 267, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 58, 59, -1, 280, 281, 63, 283, 284, 285, 286, - 287, 288, 289, 290, 291, -1, 293, -1, -1, -1, - -1, -1, -1, 300, 301, -1, 303, -1, 305, -1, - -1, -1, -1, -1, -1, 93, 0, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 323, -1, -1, -1, - -1, -1, -1, -1, 331, 332, 333, 334, 335, 336, - -1, 338, -1, 340, 341, 123, 124, 344, -1, -1, - -1, 348, 349, 350, -1, -1, 40, 41, -1, 43, - 44, 45, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 58, 59, -1, -1, -1, 63, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 261, 262, 263, -1, -1, -1, 267, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 93, - -1, -1, 280, 281, -1, 283, 284, 285, 286, 287, - 288, 289, 290, 291, -1, 293, -1, -1, -1, -1, - -1, 299, 300, 301, -1, 303, -1, 305, -1, 123, - 124, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 323, -1, -1, -1, -1, - -1, -1, -1, 331, 332, 333, 334, 335, 336, -1, - 338, -1, 340, 341, -1, -1, 344, -1, -1, 347, - -1, -1, 350, 261, 262, 263, -1, -1, 0, 267, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, -1, 293, -1, -1, -1, -1, - -1, 299, 300, 301, -1, 303, -1, 305, 40, 41, - -1, -1, 44, -1, -1, -1, 314, -1, -1, -1, - -1, -1, -1, -1, -1, 323, 58, 59, -1, -1, - -1, 63, -1, 331, 332, 333, 334, 335, 336, -1, - 338, -1, 340, 341, -1, -1, 344, -1, -1, -1, - 348, 349, 350, -1, -1, -1, -1, 261, 262, 263, - -1, 93, 0, 267, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, - -1, 123, 124, -1, -1, 299, 300, 301, -1, 303, - -1, 305, 40, 41, -1, -1, 44, -1, -1, 0, - 314, -1, -1, -1, -1, -1, -1, -1, -1, 323, - 58, 59, -1, -1, -1, 63, -1, 331, 332, 333, - 334, 335, 336, -1, 338, -1, 340, 341, -1, -1, - 344, -1, -1, -1, 348, 349, 350, -1, -1, -1, - 41, -1, 0, 44, -1, 93, 47, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 58, 59, -1, - -1, -1, 63, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 123, 124, -1, -1, -1, - -1, -1, 40, 41, -1, -1, 44, -1, -1, -1, - -1, -1, 93, -1, -1, -1, -1, -1, -1, -1, - 58, 59, -1, -1, -1, 63, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 261, - 262, 263, 123, -1, -1, 267, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 93, -1, -1, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, - -1, 293, -1, -1, -1, -1, -1, 299, 300, 301, - -1, 303, -1, 305, -1, 123, 124, -1, -1, -1, - -1, -1, 314, -1, -1, -1, -1, -1, -1, -1, - -1, 323, -1, -1, -1, -1, -1, -1, -1, 331, - 332, 333, 334, 335, 336, -1, 338, -1, 340, 341, - -1, -1, 344, -1, -1, -1, 348, 349, 350, -1, - -1, -1, -1, 261, 262, 263, -1, -1, -1, 267, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, -1, 293, -1, -1, -1, -1, - -1, 299, 300, 301, -1, 303, -1, 305, -1, -1, - 261, 262, 263, -1, -1, -1, 314, -1, -1, -1, - -1, -1, -1, -1, -1, 323, -1, -1, -1, 280, - 281, -1, -1, 331, 332, 333, 334, 335, 336, -1, - 338, -1, 340, 341, -1, -1, 344, -1, 299, -1, - 348, 349, 350, 261, 262, 263, -1, -1, 0, 267, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, -1, 293, -1, 338, -1, -1, - -1, 299, 300, 301, -1, 303, -1, 305, 40, 41, - -1, -1, 44, -1, -1, -1, 314, -1, -1, -1, - -1, -1, -1, -1, -1, 323, 58, 59, -1, -1, - -1, 63, -1, 331, 332, 333, 334, 335, 336, -1, - 338, -1, 340, 341, -1, -1, 344, -1, -1, -1, - 348, 349, 350, -1, -1, -1, -1, -1, 0, -1, - -1, 93, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 123, 124, -1, -1, -1, -1, -1, 40, 41, - -1, -1, 44, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 58, 59, -1, -1, - -1, 63, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 93, 0, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 123, 124, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 40, 41, -1, -1, 44, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 58, 59, -1, -1, -1, 63, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 261, - 262, 263, -1, -1, -1, 267, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 93, -1, -1, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, - -1, 293, -1, -1, -1, -1, -1, 299, 300, 301, - -1, 303, -1, 305, -1, 123, 124, -1, -1, -1, - 40, 41, 314, 43, -1, 45, -1, 47, -1, -1, - -1, 323, -1, -1, -1, -1, -1, -1, -1, 331, - 332, 333, 334, 335, 336, -1, 338, -1, 340, 341, - -1, -1, 344, -1, -1, -1, 348, 349, 350, 261, - 262, 263, -1, -1, 0, 267, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 280, 281, - -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, - -1, 293, -1, -1, -1, -1, -1, 299, 300, 301, - -1, 303, -1, 305, 40, -1, -1, 43, -1, 45, - -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 323, -1, 59, -1, -1, -1, -1, -1, 331, - 332, 333, 334, 335, 336, -1, 338, -1, 340, 341, - -1, -1, 344, -1, -1, -1, 348, 349, 350, -1, - -1, -1, -1, 261, 262, 263, -1, -1, 0, 267, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 280, 281, -1, 283, 284, 285, 286, 287, - 288, 289, 290, 291, -1, 293, -1, -1, -1, -1, - -1, 299, 300, 301, -1, 303, -1, 305, 40, -1, - -1, 43, -1, 45, -1, 47, -1, -1, -1, -1, - 0, -1, -1, -1, -1, 323, -1, 59, -1, -1, - -1, -1, -1, 331, 332, 333, 334, 335, 336, -1, - 338, -1, 340, 341, -1, -1, 344, -1, -1, -1, - 348, 349, 350, -1, -1, -1, -1, -1, -1, -1, - 40, -1, -1, 43, -1, 45, -1, 47, -1, -1, - -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, - 290, 291, -1, 293, -1, -1, -1, -1, -1, -1, - 300, 301, -1, 303, -1, 305, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 40, 323, -1, 43, -1, 45, -1, 47, - -1, 331, 332, 333, 334, 335, 336, -1, 338, -1, - 340, 341, -1, -1, 344, 261, 262, 263, 348, 349, - 350, -1, -1, 123, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 290, 291, -1, 293, -1, -1, - -1, -1, -1, 299, 300, 301, -1, 303, -1, 305, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 123, -1, 323, -1, -1, - -1, -1, -1, -1, -1, 331, 332, 333, 334, 335, - 336, -1, 338, -1, 340, 341, -1, -1, 344, -1, - -1, -1, 348, 349, 350, -1, -1, -1, -1, 261, - 262, 263, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 290, 291, - -1, 293, -1, -1, -1, -1, -1, 299, 300, 301, - -1, 303, -1, 305, -1, -1, -1, -1, -1, -1, - -1, 261, 262, -1, -1, -1, -1, -1, -1, -1, - -1, 323, -1, -1, -1, -1, -1, -1, -1, 331, - 332, 333, 334, 335, 336, -1, 338, -1, 340, 341, - 290, 291, 344, 293, -1, -1, 348, 349, 350, 299, - 300, 301, -1, 303, -1, 305, -1, -1, -1, -1, - -1, -1, -1, 261, 262, -1, -1, -1, -1, 0, - -1, -1, -1, 323, -1, -1, -1, -1, -1, -1, - -1, 331, 332, 333, 334, 335, 336, -1, 338, -1, - 340, 341, 290, 291, 344, 293, -1, -1, 348, 349, - 350, 299, 300, 301, -1, 303, 37, 305, -1, 40, - 41, 42, 43, 44, 45, -1, 47, -1, -1, -1, - -1, -1, -1, -1, -1, 323, -1, 58, 59, -1, - -1, -1, 63, 331, 332, 333, 334, 335, 336, 0, - 338, -1, 340, 341, -1, -1, 344, -1, -1, -1, - 348, 349, 350, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 93, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 0, -1, -1, -1, -1, -1, -1, 40, - 41, -1, 43, 44, 45, -1, 47, -1, -1, -1, - -1, -1, 123, 124, -1, -1, -1, 58, 59, -1, - -1, -1, 63, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 41, -1, -1, 44, -1, -1, 47, - -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, - 58, 59, 93, 0, -1, 63, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 123, 124, 41, 93, 0, 44, -1, -1, - 47, -1, -1, -1, 41, -1, -1, 44, -1, -1, - 47, 58, 59, -1, -1, -1, 63, -1, -1, -1, - -1, 58, 59, -1, -1, 123, 63, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 41, -1, -1, - 44, -1, -1, 47, -1, -1, 93, -1, -1, -1, - -1, -1, -1, -1, 58, 59, 93, -1, -1, 63, - 261, 262, 263, -1, -1, -1, 267, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 123, -1, -1, 280, - 281, 282, 283, 284, 285, 286, 123, 288, 289, 93, - 291, -1, 293, -1, -1, -1, -1, -1, 299, 300, - 301, -1, 303, -1, 305, -1, -1, -1, -1, -1, - -1, -1, -1, 314, -1, -1, -1, -1, -1, 123, - -1, -1, 323, -1, -1, -1, -1, -1, -1, -1, - 261, 262, 263, 334, 335, 336, 267, 338, -1, 340, - 341, -1, -1, 344, -1, -1, 347, 348, 349, 280, - 281, -1, 283, 284, 285, 286, 287, 288, 289, -1, - 291, -1, 293, 261, 262, 263, -1, -1, 299, 300, - 301, -1, 303, -1, 305, -1, -1, -1, -1, -1, - -1, -1, 280, 281, -1, -1, -1, -1, -1, -1, - -1, -1, 323, -1, -1, -1, -1, -1, -1, -1, - -1, 299, -1, 334, 335, 336, -1, 338, -1, 340, - 341, -1, -1, 344, 261, 262, 263, 348, 349, -1, - -1, -1, -1, -1, 261, 262, 263, -1, -1, 17, - -1, -1, -1, 280, 281, -1, -1, -1, -1, -1, - 338, -1, 30, 280, 281, 33, 34, 35, 36, 37, - 38, 39, 299, -1, -1, -1, -1, 261, 262, 263, - -1, -1, 299, -1, -1, 53, -1, -1, -1, -1, - 58, -1, -1, -1, -1, -1, 280, 281, -1, -1, - 68, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 338, -1, -1, -1, 299, -1, -1, -1, -1, - -1, 338, -1, -1, -1, -1, 94, 95, 96, 97, - 98, 99, -1, -1, -1, -1, -1, -1, 40, 41, - -1, 43, -1, 45, -1, 47, -1, -1, -1, -1, - -1, -1, -1, -1, 338, 123, -1, 59, -1, -1, - -1, -1, -1, -1, 132, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 144, -1, 146, -1, - 148, 149, -1, -1, -1, -1, 154, 155, 156, 157, - 158, -1, 160, 161, 162, 163, 164, 165, -1, 167, - -1, 169, -1, 171, 172, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 184, -1, -1, -1, - -1, 123, -1, 125, 192, -1, -1, -1, -1, -1, - 198, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 210, -1, -1, -1, -1, -1, 216, -1, - -1, -1, -1, 221, -1, 223, -1, -1, 40, -1, - -1, 43, -1, 45, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 249, -1, 251, -1, -1, -1, -1, -1, -1, - -1, 259, -1, 261, -1, 263, 264, 265, 266, 267, - 268, 269, -1, -1, -1, 273, -1, -1, -1, 277, - -1, 279, -1, -1, 282, 283, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 296, 17, - -1, 299, 300, 301, 302, -1, -1, -1, 306, 307, - 308, -1, -1, -1, -1, 33, 34, 35, -1, -1, - 38, 39, -1, -1, 256, -1, -1, -1, -1, -1, - 328, -1, 330, -1, 332, 53, 334, -1, 336, -1, - 58, 339, -1, -1, -1, -1, 344, -1, -1, -1, - 68, -1, -1, -1, -1, -1, 354, -1, 290, 291, - 292, 293, 294, 295, 296, 297, 298, -1, 300, 301, - 302, 303, -1, 305, 306, 307, 94, 95, 96, 97, - 98, 99, -1, -1, -1, -1, -1, -1, -1, 321, - 322, 323, 324, -1, -1, -1, -1, -1, -1, 331, - 332, 333, 334, 335, 336, 123, 338, 339, 340, 341, - 342, -1, 344, -1, 132, -1, 348, 349, 350, -1, - -1, -1, -1, -1, -1, -1, 144, -1, 146, -1, - 148, 149, -1, -1, -1, -1, 154, 155, 156, -1, - 158, -1, 160, 161, 162, 163, 164, 165, -1, 167, - -1, 169, -1, 171, 172, 267, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 184, -1, -1, -1, - -1, -1, -1, -1, 192, -1, -1, 289, 290, 291, - 198, 293, -1, -1, -1, -1, -1, -1, 300, 301, - -1, 303, 210, 305, -1, -1, -1, -1, 216, -1, - -1, -1, -1, 221, -1, 223, -1, -1, -1, -1, - -1, 323, -1, -1, -1, -1, 0, -1, -1, 331, - 332, 333, 334, 335, 336, -1, 338, -1, 340, 341, - -1, 249, 344, 251, -1, -1, 348, 349, 350, -1, - -1, 259, -1, 261, -1, 263, 264, 265, 266, 267, - 268, 269, -1, -1, -1, 273, -1, 41, -1, 277, - 44, 279, -1, 47, 282, 283, -1, -1, -1, -1, - 7, -1, -1, -1, 58, 59, 13, -1, 296, 63, - -1, 299, 300, 301, 302, -1, -1, -1, 306, 307, - 308, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 93, - 328, -1, -1, -1, -1, -1, 334, -1, 336, 56, - 57, 339, -1, -1, -1, -1, 344, 64, 65, 66, - 67, -1, -1, 70, 71, -1, 354, -1, -1, 123, - -1, -1, -1, 80, -1, -1, 83, 84, 85, 86, - 87, 88, -1, 90, -1, 92, 93, -1, -1, -1, - -1, -1, -1, -1, -1, 102, 103, -1, 37, 106, - -1, 40, -1, 42, 43, -1, 45, 114, 47, -1, - -1, -1, -1, -1, 121, -1, -1, -1, -1, -1, - 59, -1, -1, -1, 63, -1, 133, -1, -1, -1, - -1, -1, 139, -1, 141, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 181, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 124, -1, -1, 195, -1, - -1, 37, -1, 200, 40, 41, 42, 43, 44, 45, - -1, 47, 209, -1, -1, -1, -1, 261, 262, 263, - -1, -1, 58, 59, -1, -1, -1, 63, -1, 226, - -1, -1, 229, 230, -1, -1, 280, 281, 235, -1, - 237, -1, -1, -1, -1, -1, -1, 244, -1, -1, - -1, -1, -1, -1, -1, 299, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 40, -1, -1, 43, -1, - 45, -1, 47, 270, 271, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 59, -1, -1, -1, 124, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 295, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 317, -1, 319, -1, -1, -1, 323, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 267, -1, - -1, -1, -1, -1, 341, -1, -1, -1, 123, -1, - 125, 280, 281, -1, 283, 284, 285, 286, 287, 288, - -1, 290, 291, -1, 293, -1, -1, -1, -1, -1, - -1, 300, 301, -1, 303, -1, 305, 40, -1, -1, - 43, -1, 45, -1, 47, 314, -1, -1, -1, -1, - -1, -1, -1, -1, 323, -1, 59, -1, -1, -1, - -1, -1, 331, 332, 333, 334, 335, 336, -1, 338, - -1, 340, 341, -1, -1, 344, -1, -1, 347, 348, - 349, 350, -1, -1, -1, -1, -1, 263, -1, -1, - -1, 267, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 280, 281, 282, -1, -1, 285, - -1, -1, -1, 289, 290, 291, -1, 293, -1, -1, - 123, -1, 125, -1, 300, 301, -1, 303, -1, 305, - -1, -1, 40, -1, -1, 43, -1, 45, -1, 47, - -1, 256, -1, -1, -1, -1, -1, 323, -1, -1, - -1, 59, -1, -1, -1, 331, 332, 333, 334, 335, - 336, -1, 338, -1, 340, 341, -1, -1, 344, -1, - -1, 347, -1, -1, 350, 290, 291, 292, 293, 294, - 295, 296, 297, 298, -1, 300, 301, 302, 303, -1, - 305, 306, 307, 40, -1, -1, 43, -1, 45, -1, - 47, -1, -1, -1, -1, -1, 321, 322, 323, 324, - -1, -1, 59, -1, -1, 123, 331, 332, 333, 334, - 335, 336, -1, 338, 339, 340, 341, 342, -1, 344, - -1, -1, -1, 348, 349, 350, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 256, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, - -1, 45, -1, 47, -1, -1, 123, -1, 125, -1, - -1, -1, -1, -1, -1, 59, -1, 290, 291, 292, - 293, 294, 295, 296, 297, 298, -1, 300, 301, 302, - 303, -1, 305, 306, 307, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 321, 322, - 323, 324, -1, -1, -1, -1, -1, -1, 331, 332, - 333, 334, 335, 336, -1, 338, 339, 340, 341, 342, - -1, 344, -1, -1, -1, 348, 349, 350, 256, 123, - -1, 125, -1, -1, -1, 263, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 290, 291, 292, 293, 294, 295, 296, 297, - 298, -1, 300, 301, 302, 303, -1, 305, 306, 307, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 256, - -1, -1, -1, 321, 322, 323, -1, -1, -1, -1, - -1, -1, -1, 331, 332, 333, 334, 335, 336, -1, - 338, 339, 340, 341, 342, -1, 344, -1, -1, -1, - 348, 349, 350, 290, 291, 292, 293, 294, 295, 296, - 297, 298, -1, 300, 301, 302, 303, -1, 305, 306, - 307, 40, -1, -1, 43, -1, 45, -1, 47, -1, - -1, -1, -1, -1, 321, 322, 323, 324, -1, -1, - 59, -1, 256, -1, 331, 332, 333, 334, 335, 336, - -1, 338, 339, 340, 341, 342, -1, 344, -1, -1, - -1, 348, 349, 350, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 290, 291, 292, 293, - 294, 295, 296, 297, 298, -1, 300, 301, 302, 303, - -1, 305, 306, 307, 40, -1, -1, 43, -1, 45, - -1, 47, -1, -1, 123, -1, 125, 321, 322, 323, - -1, -1, -1, 59, -1, -1, -1, 331, 332, 333, - 334, 335, 336, -1, 338, 339, 340, 341, 342, -1, - 344, -1, -1, -1, 348, 349, 350, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 40, -1, -1, 43, -1, - 45, -1, 47, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 59, -1, -1, 123, -1, 125, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, - -1, 45, -1, 47, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 59, -1, 256, 123, -1, - 125, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 290, 291, 292, 293, 294, 295, 296, 297, 298, - -1, 300, 301, 302, 303, -1, 305, 306, 307, -1, - 40, -1, -1, 43, -1, 45, -1, 47, -1, 123, - -1, 125, 321, 322, 323, -1, -1, -1, -1, 59, - 256, -1, 331, 332, 333, 334, 335, 336, -1, 338, - 339, 340, 341, 342, -1, 344, -1, -1, -1, 348, - 349, 350, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 290, 291, 292, 293, 294, 295, - 296, 297, 298, -1, 300, 301, 302, 303, -1, 305, - 306, 307, -1, -1, -1, -1, -1, 40, -1, -1, - 43, 256, 45, 123, 47, 321, 322, 323, -1, -1, - -1, -1, -1, -1, -1, 331, 332, 333, 334, 335, - 336, -1, 338, 339, 340, 341, 342, -1, 344, -1, - -1, -1, 348, 349, 350, 290, 291, 292, 293, 294, - 295, 296, 297, 298, -1, 300, 301, 302, 303, -1, - 305, 306, 307, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 256, -1, -1, -1, 321, 322, 323, -1, - -1, -1, -1, -1, -1, -1, 331, 332, 333, 334, - 335, 336, -1, 338, 339, 340, 341, 342, -1, 344, - -1, -1, -1, 348, 349, 350, 290, 291, 292, 293, - 294, 295, 296, 297, 298, -1, 300, 301, 302, 303, - -1, 305, 306, 307, 40, -1, -1, 43, -1, 45, - -1, 47, -1, -1, -1, -1, -1, 321, 322, 323, - -1, -1, -1, 59, -1, -1, 256, 331, 332, 333, - 334, 335, 336, 263, 338, 339, 340, 341, 342, -1, - 344, -1, -1, -1, 348, 349, 350, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 290, 291, 292, 293, 294, 295, 296, 297, 298, -1, - 300, 301, 302, 303, -1, 305, 306, 307, 40, -1, - -1, 43, -1, 45, -1, 47, -1, 123, -1, 125, - -1, 321, 322, 323, -1, -1, -1, 59, -1, -1, - -1, 331, 332, 333, 334, 335, 336, -1, 338, 339, - 340, 341, 342, -1, 344, -1, -1, -1, 348, 349, - 350, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 290, 291, 40, - 293, -1, 43, -1, 45, -1, 47, 300, 301, -1, - 303, -1, 305, -1, -1, -1, -1, -1, 59, -1, - -1, 123, -1, 125, -1, -1, -1, -1, -1, -1, - 323, -1, -1, -1, -1, -1, -1, -1, 331, 332, - 333, 334, 335, 336, -1, 338, -1, 340, 341, -1, - -1, 344, -1, -1, -1, 348, 349, 350, -1, -1, - 40, -1, -1, 43, -1, 45, -1, 47, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 59, - 256, -1, 123, -1, 125, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 290, 291, 292, 293, 294, 295, - 296, 297, 298, -1, 300, 301, 302, 303, -1, 305, - 306, 307, -1, 40, -1, -1, 43, -1, 45, -1, - 47, -1, -1, 123, -1, 321, 322, 323, -1, -1, - -1, -1, 59, -1, 256, 331, 332, 333, 334, 335, - 336, -1, 338, 339, 340, 341, 342, -1, 344, -1, - -1, -1, 348, 349, 350, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 290, 291, - 292, 293, 294, 295, 296, 297, 298, -1, 300, 301, - 302, 303, -1, 305, 306, 307, 40, -1, -1, 43, - -1, 45, -1, 47, -1, 256, 123, -1, -1, 321, - 322, 323, -1, -1, -1, 59, -1, -1, -1, 331, - 332, 333, 334, 335, 336, -1, 338, 339, 340, 341, - 342, -1, 344, -1, -1, -1, 348, 349, 350, 290, - 291, 292, 293, 294, 295, 296, 297, 298, -1, 300, - 301, 302, 303, -1, 305, 306, 307, 40, -1, -1, - 43, -1, 45, -1, 47, -1, 256, -1, -1, -1, - 321, 322, 323, -1, -1, -1, 59, -1, -1, 123, - 331, 332, 333, 334, 335, 336, -1, 338, 339, 340, - 341, 342, -1, 344, -1, -1, -1, 348, 349, 350, - 290, 291, 292, 293, 294, 295, 296, 297, 298, -1, - 300, 301, 302, 303, -1, 305, 306, 307, 40, -1, - -1, 43, -1, 45, -1, 47, -1, -1, -1, -1, - -1, 321, 322, 323, -1, -1, -1, 59, -1, 256, - 123, 331, 332, 333, 334, 335, 336, -1, 338, 339, - 340, 341, 342, -1, 344, -1, -1, -1, 348, 349, - 350, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 290, 291, 292, 293, 294, 295, 296, - 297, 298, -1, 300, 301, 302, 303, -1, 305, 306, - 307, 40, -1, -1, 43, -1, 45, -1, 47, -1, - -1, 123, -1, -1, 321, 322, 323, -1, -1, -1, - 59, -1, 256, -1, 331, 332, 333, 334, 335, 336, - -1, 338, 339, 340, 341, 342, -1, 344, -1, -1, - -1, 348, 349, 350, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 290, 291, 292, 293, - 294, 295, 296, 297, 298, -1, 300, 301, 302, 303, - -1, 305, 306, 307, 40, -1, -1, 43, -1, 45, - -1, 47, -1, 256, 123, -1, -1, 321, 322, 323, - -1, -1, -1, 59, -1, -1, -1, 331, 332, 333, - 334, 335, 336, -1, 338, 339, 340, 341, 342, -1, - 344, -1, -1, -1, 348, 349, 350, 290, 291, 292, - 293, 294, 295, 296, 297, 298, -1, 300, 301, 302, - 303, -1, 305, 306, 307, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 256, -1, -1, -1, 321, 322, - 323, -1, -1, -1, -1, -1, -1, 123, 331, 332, - 333, 334, 335, 336, -1, 338, 339, 340, 341, 342, - -1, 344, -1, -1, -1, 348, 349, 350, 290, 291, - 292, 293, 294, 295, 296, 297, 298, -1, 300, 301, - 302, 303, -1, 305, 306, 307, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 321, - 322, 323, -1, -1, -1, -1, -1, 256, -1, 331, - 332, 333, 334, 335, 336, -1, 338, 339, 340, 341, - 342, -1, 344, -1, -1, -1, 348, 349, 350, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 290, 291, 292, 293, 294, 295, 296, 297, 298, - -1, 300, 301, 302, 303, -1, 305, 306, 307, 40, - 41, -1, 43, -1, 45, -1, 47, -1, -1, -1, - -1, -1, 321, 322, 323, -1, -1, -1, -1, -1, - 256, -1, 331, 332, 333, 334, 335, 336, -1, 338, - 339, 340, 341, 342, -1, 344, -1, -1, -1, 348, - 349, 350, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 290, 291, 292, 293, 294, 295, - 296, 297, 298, -1, 300, 301, 302, 303, -1, 305, - 306, 307, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 321, 322, 323, 40, -1, - -1, 43, -1, 45, -1, 331, 332, 333, 334, 335, - 336, -1, 338, 339, 340, 341, 342, 59, 344, -1, - -1, 63, 348, 349, 350, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 40, 41, -1, 43, 44, 45, -1, -1, -1, -1, - -1, -1, 124, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 63, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 256, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 40, 41, -1, 43, 44, 45, -1, -1, - -1, -1, -1, -1, 124, -1, -1, -1, -1, 290, - 291, -1, 293, -1, 295, 63, -1, -1, -1, 300, - 301, -1, 303, -1, 305, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 321, 322, 323, -1, -1, -1, -1, -1, -1, -1, - 331, 332, 333, 334, 335, 336, -1, 338, -1, 340, - 341, -1, -1, 344, -1, -1, -1, 348, 349, 350, - -1, 263, -1, -1, -1, 267, 124, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 280, 281, - -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, - -1, 293, 40, 41, -1, 43, 44, 45, 300, 301, - -1, 303, -1, 305, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 63, -1, -1, -1, -1, - -1, 323, -1, -1, -1, -1, -1, -1, -1, 331, - 332, 333, 334, 335, 336, -1, 338, 267, 340, 341, - -1, -1, 344, -1, -1, -1, 348, 349, 350, -1, - 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, - 290, 291, -1, 293, 40, 41, -1, 43, -1, 45, - 300, 301, -1, 303, -1, 305, 124, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 63, -1, -1, - -1, -1, -1, 323, -1, -1, -1, -1, -1, -1, - -1, 331, 332, 333, 334, 335, 336, -1, 338, 267, - 340, 341, -1, -1, 344, -1, -1, -1, 348, 349, - 350, -1, 280, 281, -1, 283, 284, 285, 286, 287, - 288, 289, 290, 291, -1, 293, 40, -1, -1, 43, - 44, 45, 300, 301, -1, 303, -1, 305, 124, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 63, - -1, -1, -1, -1, -1, 323, -1, -1, -1, -1, - -1, -1, -1, 331, 332, 333, 334, 335, 336, -1, - 338, -1, 340, 341, -1, -1, 344, -1, -1, -1, - 348, 349, 350, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 40, -1, -1, 43, -1, 45, -1, -1, 267, - 124, -1, -1, -1, -1, -1, -1, -1, -1, 58, - -1, -1, 280, 281, 63, 283, 284, 285, 286, 287, - 288, 289, 290, 291, -1, 293, -1, -1, -1, -1, - -1, -1, 300, 301, -1, 303, -1, 305, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 323, -1, -1, -1, -1, - -1, -1, -1, 331, 332, 333, 334, 335, 336, -1, - 338, 267, 340, 341, -1, 124, 344, -1, -1, -1, - 348, 349, 350, -1, 280, 281, -1, 283, 284, 285, - 286, 287, 288, 289, 290, 291, -1, 293, 40, 41, - -1, 43, -1, 45, 300, 301, -1, 303, -1, 305, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 63, -1, -1, -1, -1, -1, 323, -1, -1, - -1, -1, -1, -1, -1, 331, 332, 333, 334, 335, - 336, -1, 338, 267, 340, 341, -1, -1, 344, -1, - -1, -1, 348, 349, 350, -1, 280, 281, -1, 283, - 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, - -1, -1, -1, -1, -1, -1, 300, 301, -1, 303, - -1, 305, 124, 40, 41, -1, 43, -1, 45, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 323, - -1, -1, -1, -1, -1, -1, 63, 331, 332, 333, - 334, 335, 336, -1, 338, -1, 340, 341, 267, -1, - 344, -1, -1, -1, 348, 349, 350, -1, -1, -1, - -1, 280, 281, -1, 283, 284, 285, 286, 287, 288, - 289, 290, 291, -1, 293, -1, -1, -1, -1, -1, - -1, 300, 301, -1, 303, -1, 305, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 124, -1, -1, - 40, 41, -1, 43, 323, 45, -1, -1, -1, -1, - -1, -1, 331, 332, 333, 334, 335, 336, -1, 338, - -1, 340, 341, 63, -1, 344, -1, -1, -1, 348, - 349, 350, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 267, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 280, 281, - -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, - -1, 293, -1, -1, 124, -1, -1, -1, 300, 301, - -1, 303, -1, 305, -1, 40, 41, -1, 43, -1, - 45, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 323, -1, -1, -1, -1, -1, -1, 63, 331, - 332, 333, 334, 335, 336, -1, 338, -1, 340, 341, - -1, -1, 344, -1, -1, -1, 348, 349, 350, -1, - 267, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 280, 281, -1, 283, 284, 285, 286, - 287, 288, 289, 290, 291, -1, 293, -1, -1, -1, - -1, -1, -1, 300, 301, -1, 303, -1, 305, 124, - 40, 41, -1, 43, -1, 45, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 323, -1, -1, -1, - -1, -1, -1, 63, 331, 332, 333, 334, 335, 336, - -1, 338, -1, 340, 341, -1, -1, 344, -1, -1, - -1, 348, 349, 350, -1, -1, -1, 267, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, - 290, 291, -1, 293, -1, -1, -1, -1, -1, -1, - 300, 301, -1, 303, 124, 305, 40, -1, -1, 43, - -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 323, -1, 59, -1, -1, -1, 63, - -1, 331, 332, 333, 334, 335, 336, -1, 338, -1, - 340, 341, -1, -1, 344, -1, -1, -1, 348, 349, - 350, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 267, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 280, 281, -1, 283, 284, - 285, 286, 287, 288, 289, 290, 291, -1, 293, -1, - 124, -1, -1, -1, -1, 300, 301, -1, 303, -1, - 305, -1, 40, 41, -1, 43, -1, 45, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 323, -1, - -1, -1, -1, -1, -1, 63, 331, 332, 333, 334, - 335, 336, -1, 338, -1, 340, 341, -1, -1, 344, - -1, -1, -1, 348, 349, 350, -1, 267, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, - 290, 291, -1, 293, 40, -1, -1, 43, -1, 45, - 300, 301, -1, 303, -1, 305, 124, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 63, -1, -1, - -1, -1, -1, 323, -1, -1, -1, -1, -1, -1, - -1, 331, 332, 333, 334, 335, 336, -1, 338, -1, - 340, 341, -1, -1, 344, -1, -1, -1, 348, 349, - 350, -1, -1, 267, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 280, 281, -1, 283, - 284, 285, 286, 287, 288, 289, 290, 291, 124, 293, - 40, -1, -1, 43, -1, 45, 300, 301, -1, 303, - -1, 305, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 63, -1, -1, -1, -1, -1, 323, - -1, -1, -1, -1, -1, -1, -1, 331, 332, 333, - 334, 335, 336, -1, 338, -1, 340, 341, -1, -1, - 344, -1, -1, -1, 348, 349, 350, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 267, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 280, 281, 124, 283, 284, 285, 286, 287, - 288, 289, 290, 291, -1, 293, 40, 41, -1, -1, - 44, -1, 300, 301, -1, 303, -1, 305, -1, -1, - -1, -1, -1, -1, 58, 59, -1, -1, -1, 63, - -1, -1, -1, -1, -1, 323, -1, -1, -1, -1, - -1, -1, -1, 331, 332, 333, 334, 335, 336, -1, - 338, 267, 340, 341, -1, -1, 344, -1, -1, -1, - 348, 349, 350, -1, 280, 281, -1, 283, 284, 285, - 286, 287, 288, 289, 290, 291, -1, 293, -1, -1, - -1, -1, 40, 41, 300, 301, 44, 303, -1, 305, - 124, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 58, 59, -1, -1, -1, 63, -1, 323, -1, -1, - -1, -1, -1, -1, -1, 331, 332, 333, 334, 335, - 336, -1, 338, -1, 340, 341, -1, -1, 344, -1, - -1, -1, 348, 349, 350, -1, -1, 267, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, - 290, 291, -1, 293, -1, -1, 124, -1, -1, 40, - 300, 301, 43, 303, 45, 305, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 323, -1, -1, -1, -1, -1, -1, - -1, 331, 332, 333, 334, 335, 336, -1, 338, -1, - 340, 341, -1, -1, 344, -1, -1, -1, 348, 349, - 350, -1, -1, -1, -1, -1, -1, -1, -1, 263, - -1, -1, -1, 267, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 280, 281, 282, -1, - -1, 285, -1, 124, -1, 289, 290, 291, -1, 293, - 40, -1, -1, 43, -1, 45, 300, 301, -1, 303, - -1, 305, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 323, - -1, -1, -1, -1, -1, -1, -1, 331, 332, 333, - 334, 335, 336, -1, 338, 263, 340, 341, -1, 267, - 344, -1, -1, -1, 348, 349, 350, -1, -1, -1, - -1, -1, 280, 281, 282, -1, -1, 285, -1, -1, - -1, 289, 290, 291, -1, 293, 40, -1, -1, 43, - -1, 45, 300, 301, 124, 303, -1, 305, -1, -1, - -1, -1, -1, -1, 58, -1, -1, -1, -1, 63, - -1, -1, -1, -1, -1, 323, -1, -1, -1, -1, - -1, -1, -1, 331, 332, 333, 334, 335, 336, -1, - 338, -1, 340, 341, -1, -1, 344, -1, -1, -1, - 348, 349, 350, -1, -1, -1, 267, -1, -1, 40, - -1, -1, 43, -1, 45, -1, 47, -1, -1, 280, - -1, -1, 283, 284, 285, 286, 287, 288, 289, 290, - 291, -1, 293, -1, -1, -1, -1, -1, -1, 300, - 301, -1, 303, -1, 305, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 323, -1, -1, -1, -1, -1, -1, -1, - 331, 332, 333, 334, 335, 336, -1, 338, -1, 340, - 341, 40, -1, 344, 43, -1, 45, 348, 349, 350, - -1, -1, 123, -1, -1, -1, -1, 267, -1, -1, - -1, -1, -1, -1, 63, 40, -1, -1, 43, -1, - 45, -1, 47, 283, 284, 285, 286, 287, 288, 289, - 290, 291, -1, 293, 59, -1, -1, -1, -1, -1, - 300, 301, -1, 303, -1, 305, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 323, -1, -1, -1, -1, -1, -1, - -1, 331, 332, 333, 334, 335, 336, -1, 338, -1, - 340, 341, -1, 267, 344, -1, -1, -1, 348, 349, - 350, -1, -1, -1, -1, 40, 280, 281, 43, -1, - 45, -1, 47, -1, -1, 289, 290, 291, -1, 293, - -1, -1, -1, -1, -1, -1, 300, 301, -1, 303, - -1, 305, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 323, - 261, 262, -1, -1, -1, -1, -1, 331, 332, 333, - 334, 335, 336, -1, 338, -1, 340, 341, -1, -1, - 344, -1, -1, -1, 348, 349, 350, -1, -1, 290, - 291, -1, 293, -1, -1, -1, -1, -1, 299, 300, - 301, -1, 303, 40, 305, -1, 43, -1, 45, -1, - 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 323, -1, -1, -1, -1, -1, -1, -1, - 331, 332, 333, 334, 335, 336, -1, 338, 267, 340, - 341, -1, -1, 344, -1, -1, -1, 348, 349, 350, - -1, 280, 281, -1, -1, -1, -1, -1, 263, -1, - 289, 290, 291, -1, 293, -1, -1, -1, -1, -1, - 40, 300, 301, 43, 303, 45, 305, 47, -1, -1, - -1, -1, -1, -1, -1, 290, 291, -1, 293, -1, - -1, -1, -1, -1, 323, 300, 301, -1, 303, -1, - 305, -1, 331, 332, 333, 334, 335, 336, -1, 338, - -1, 340, 341, -1, -1, 344, -1, -1, 323, 348, - 349, 350, -1, -1, -1, -1, 331, 332, 333, 334, - 335, 336, -1, 338, -1, 340, 341, -1, 263, 344, - -1, -1, -1, 348, 349, 350, 40, -1, -1, 43, - -1, 45, -1, 47, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 290, 291, -1, 293, -1, - -1, -1, -1, -1, -1, 300, 301, -1, 303, -1, - 305, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 323, -1, - -1, -1, -1, -1, -1, -1, 331, 332, 333, 334, - 335, 336, -1, 338, -1, 340, 341, -1, -1, 344, - -1, -1, -1, 348, 349, 350, 263, -1, 40, -1, - -1, 43, -1, 45, -1, 47, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 40, 290, 291, 43, 293, 45, -1, 47, - -1, -1, -1, 300, 301, -1, 303, -1, 305, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 323, -1, -1, -1, - -1, -1, -1, 263, 331, 332, 333, 334, 335, 336, - -1, 338, -1, 340, 341, -1, -1, 344, -1, -1, - -1, 348, 349, 350, -1, -1, -1, -1, -1, 40, - 290, 291, 43, 293, 45, -1, 47, -1, -1, -1, - 300, 301, -1, 303, -1, 305, -1, -1, -1, -1, - -1, -1, -1, 40, -1, -1, 43, -1, 45, -1, - 47, -1, -1, 323, -1, -1, -1, -1, -1, -1, - -1, 331, 332, 333, 334, 335, 336, -1, 338, 263, - 340, 341, -1, -1, 344, -1, -1, -1, 348, 349, - 350, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 40, 290, 291, 43, 293, - 45, -1, 47, -1, -1, -1, 300, 301, -1, 303, - -1, 305, -1, -1, -1, -1, -1, -1, -1, 40, - -1, -1, 43, -1, 45, -1, 47, -1, -1, 323, - -1, -1, -1, -1, -1, -1, -1, 331, 332, 333, - 334, 335, 336, -1, 338, -1, 340, 341, -1, -1, - 344, 263, -1, -1, 348, 349, 350, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 40, -1, -1, 43, 263, 45, -1, 290, 291, - -1, 293, -1, -1, -1, -1, -1, -1, 300, 301, - -1, 303, -1, 305, -1, -1, -1, -1, -1, -1, - -1, -1, 290, 291, -1, 293, -1, -1, -1, -1, - -1, 323, 300, 301, -1, 303, -1, 305, -1, 331, - 332, 333, 334, 335, 336, -1, 338, -1, 340, 341, - -1, -1, 344, -1, -1, 323, 348, 349, 350, -1, - -1, -1, -1, 331, 332, 333, 334, 335, 336, -1, - 338, -1, 340, 341, -1, -1, 344, -1, -1, -1, - 348, 349, 350, -1, -1, -1, -1, -1, -1, 290, - 291, -1, 293, -1, -1, -1, -1, -1, -1, 300, - 301, -1, 303, -1, 305, -1, -1, -1, -1, -1, - -1, -1, -1, 290, 291, -1, 293, -1, -1, -1, - -1, -1, 323, 300, 301, -1, 303, -1, 305, -1, - 331, 332, 333, 334, 335, 336, -1, 338, -1, 340, - 341, -1, -1, 344, -1, -1, 323, 348, 349, 350, - -1, -1, -1, -1, 331, 332, 333, 334, 335, 336, - -1, 338, -1, 340, 341, 290, 291, 344, 293, -1, - -1, 348, 349, 350, -1, 300, 301, -1, 303, -1, - 305, -1, -1, -1, -1, -1, -1, -1, -1, 290, - 291, -1, 293, -1, -1, -1, -1, -1, 323, 300, - 301, -1, 303, -1, 305, -1, 331, 332, 333, 334, - 335, 336, -1, 338, -1, 340, 341, -1, -1, 344, - -1, -1, 323, 348, 349, 350, -1, -1, -1, -1, - 331, 332, 333, 334, 335, 336, -1, 338, -1, 340, - 341, 290, 291, 344, 293, -1, -1, 348, 349, 350, - -1, 300, 301, -1, 303, -1, 305, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 323, -1, -1, -1, -1, -1, - -1, -1, 331, 332, 333, 334, 335, 336, -1, -1, - -1, 340, 341, -1, -1, 344, -1, -1, -1, 348, - 349, 350, -}; -#define YYFINAL 4 -#ifndef YYDEBUG -#define YYDEBUG 0 +typedef enum yysymbol_kind_t yysymbol_kind_t; + + + + +#ifdef short +# undef short #endif -#define YYMAXTOKEN 351 + +/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure + and (if available) are included + so that the code can choose integer types of a good width. */ + +#ifndef __PTRDIFF_MAX__ +# include /* INFRINGES ON USER NAME SPACE */ +# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_STDINT_H +# endif +#endif + +/* Narrow types that promote to a signed type and that can represent a + signed or unsigned integer of at least N bits. In tables they can + save space and decrease cache pressure. Promoting to a signed type + helps avoid bugs in integer arithmetic. */ + +#ifdef __INT_LEAST8_MAX__ +typedef __INT_LEAST8_TYPE__ yytype_int8; +#elif defined YY_STDINT_H +typedef int_least8_t yytype_int8; +#else +typedef signed char yytype_int8; +#endif + +#ifdef __INT_LEAST16_MAX__ +typedef __INT_LEAST16_TYPE__ yytype_int16; +#elif defined YY_STDINT_H +typedef int_least16_t yytype_int16; +#else +typedef short yytype_int16; +#endif + +/* Work around bug in HP-UX 11.23, which defines these macros + incorrectly for preprocessor constants. This workaround can likely + be removed in 2023, as HPE has promised support for HP-UX 11.23 + (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of + . */ +#ifdef __hpux +# undef UINT_LEAST8_MAX +# undef UINT_LEAST16_MAX +# define UINT_LEAST8_MAX 255 +# define UINT_LEAST16_MAX 65535 +#endif + +#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST8_TYPE__ yytype_uint8; +#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST8_MAX <= INT_MAX) +typedef uint_least8_t yytype_uint8; +#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX +typedef unsigned char yytype_uint8; +#else +typedef short yytype_uint8; +#endif + +#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST16_TYPE__ yytype_uint16; +#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST16_MAX <= INT_MAX) +typedef uint_least16_t yytype_uint16; +#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX +typedef unsigned short yytype_uint16; +#else +typedef int yytype_uint16; +#endif + +#ifndef YYPTRDIFF_T +# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ +# define YYPTRDIFF_T __PTRDIFF_TYPE__ +# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ +# elif defined PTRDIFF_MAX +# ifndef ptrdiff_t +# include /* INFRINGES ON USER NAME SPACE */ +# endif +# define YYPTRDIFF_T ptrdiff_t +# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX +# else +# define YYPTRDIFF_T long +# define YYPTRDIFF_MAXIMUM LONG_MAX +# endif +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned +# endif +#endif + +#define YYSIZE_MAXIMUM \ + YY_CAST (YYPTRDIFF_T, \ + (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ + ? YYPTRDIFF_MAXIMUM \ + : YY_CAST (YYSIZE_T, -1))) + +#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) + + +/* Stored state numbers (used for stacks). */ +typedef yytype_int16 yy_state_t; + +/* State numbers in computations. */ +typedef int yy_state_fast_t; + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) +# endif +# endif +# ifndef YY_ +# define YY_(Msgid) Msgid +# endif +#endif + + +#ifndef YY_ATTRIBUTE_PURE +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define YY_ATTRIBUTE_PURE +# endif +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +# else +# define YY_ATTRIBUTE_UNUSED +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YY_USE(E) ((void) (E)) +#else +# define YY_USE(E) /* empty */ +#endif + +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ +# define YY_IGNORE_USELESS_CAST_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") +# define YY_IGNORE_USELESS_CAST_END \ + _Pragma ("GCC diagnostic pop") +#endif +#ifndef YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_END +#endif + + +#define YY_ASSERT(E) ((void) (0 && (E))) + +#if !defined yyoverflow + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS +# include /* INFRINGES ON USER NAME SPACE */ + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined EXIT_SUCCESS +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined EXIT_SUCCESS +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* !defined yyoverflow */ + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yy_state_t yyss_alloc; + YYSTYPE yyvs_alloc; +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +# define YYCOPY_NEEDED 1 + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYPTRDIFF_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / YYSIZEOF (*yyptr); \ + } \ + while (0) + +#endif + +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from SRC to DST. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) +# else +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYPTRDIFF_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (0) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 8 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 4608 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 114 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 50 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 187 +/* YYNSTATES -- Number of states. */ +#define YYNSTATES 370 + +/* YYMAXUTOK -- Last valid token kind. */ +#define YYMAXUTOK 352 + + +/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, with out-of-bounds checking. */ +#define YYTRANSLATE(YYX) \ + (0 <= (YYX) && (YYX) <= YYMAXUTOK \ + ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ + : YYSYMBOL_YYUNDEF) + +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex. */ +static const yytype_int8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 105, 2, 2, + 12, 16, 104, 102, 10, 103, 2, 15, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 95, 14, + 2, 2, 2, 94, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 18, 2, 19, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 11, 13, 17, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 96, + 97, 98, 99, 100, 101, 106, 107, 108, 109, 110, + 111, 112, 113 +}; + #if YYDEBUG -const char * const yyname[] = - { -"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,"'%'",0,0,"'('","')'","'*'","'+'","','","'-'",0,"'/'",0,0,0,0,0,0,0,0,0,0, -"':'","';'",0,0,0,"'?'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -"'['",0,"']'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'{'", -"'|'","'}'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"FIRSTTOKEN","PROGRAM","PASTAT","PASTAT2", -"XBEGIN","XEND","NL","ARRAY","MATCH","NOTMATCH","MATCHOP","FINAL","DOT","ALL", -"CCL","NCCL","CHAR","OR","STAR","QUEST","PLUS","EMPTYRE","ZERO","AND","BOR", -"APPEND","EQ","GE","GT","LE","LT","NE","IN","ARG","BLTIN","BREAK","CLOSE", -"CONTINUE","DELETE","DO","EXIT","FOR","FUNC","SUB","GSUB","IF","INDEX", -"LSUBSTR","MATCHFCN","NEXT","NEXTFILE","ADD","MINUS","MULT","DIVIDE","MOD", -"ASSIGN","ASGNOP","ADDEQ","SUBEQ","MULTEQ","DIVEQ","MODEQ","POWEQ","PRINT", -"PRINTF","SPRINTF","ELSE","INTEST","CONDEXPR","POSTINCR","PREINCR","POSTDECR", -"PREDECR","VAR","IVAR","VARNF","CALL","NUMBER","STRING","REGEXPR","GETLINE", -"RETURN","SPLIT","SUBSTR","WHILE","CAT","NOT","UMINUS","UPLUS","POWER","DECR", -"INCR","INDIRECT","LASTTOKEN", -}; -const char * const yyrule[] = - {"$accept : program", -"program : pas", -"program : error", -"and : AND", -"and : and NL", -"bor : BOR", -"bor : bor NL", -"comma : ','", -"comma : comma NL", -"do : DO", -"do : do NL", -"else : ELSE", -"else : else NL", -"$$1 :", -"for : FOR '(' opt_simple_stmt ';' opt_nl pattern ';' opt_nl opt_simple_stmt rparen $$1 stmt", -"$$2 :", -"for : FOR '(' opt_simple_stmt ';' ';' opt_nl opt_simple_stmt rparen $$2 stmt", -"$$3 :", -"for : FOR '(' varname IN varname rparen $$3 stmt", -"funcname : VAR", -"funcname : CALL", -"if : IF '(' pattern rparen", -"lbrace : '{'", -"lbrace : lbrace NL", -"nl : NL", -"nl : nl NL", -"opt_nl :", -"opt_nl : nl", -"opt_pst :", -"opt_pst : pst", -"opt_simple_stmt :", -"opt_simple_stmt : simple_stmt", -"pas : opt_pst", -"pas : opt_pst pa_stats opt_pst", -"pa_pat : pattern", -"pa_stat : pa_pat", -"pa_stat : pa_pat lbrace stmtlist '}'", -"pa_stat : pa_pat ',' opt_nl pa_pat", -"pa_stat : pa_pat ',' opt_nl pa_pat lbrace stmtlist '}'", -"pa_stat : lbrace stmtlist '}'", -"pa_stat : XBEGIN lbrace stmtlist '}'", -"pa_stat : XEND lbrace stmtlist '}'", -"$$4 :", -"pa_stat : FUNC funcname '(' varlist rparen $$4 lbrace stmtlist '}'", -"pa_stats : pa_stat", -"pa_stats : pa_stats opt_pst pa_stat", -"patlist : pattern", -"patlist : patlist comma pattern", -"ppattern : var ASGNOP ppattern", -"ppattern : ppattern '?' ppattern ':' ppattern", -"ppattern : ppattern bor ppattern", -"ppattern : ppattern and ppattern", -"ppattern : ppattern MATCHOP reg_expr", -"ppattern : ppattern MATCHOP ppattern", -"ppattern : ppattern IN varname", -"ppattern : '(' plist ')' IN varname", -"ppattern : ppattern term", -"ppattern : re", -"ppattern : term", -"pattern : var ASGNOP pattern", -"pattern : pattern '?' pattern ':' pattern", -"pattern : pattern bor pattern", -"pattern : pattern and pattern", -"pattern : pattern EQ pattern", -"pattern : pattern GE pattern", -"pattern : pattern GT pattern", -"pattern : pattern LE pattern", -"pattern : pattern LT pattern", -"pattern : pattern NE pattern", -"pattern : pattern MATCHOP reg_expr", -"pattern : pattern MATCHOP pattern", -"pattern : pattern IN varname", -"pattern : '(' plist ')' IN varname", -"pattern : pattern '|' GETLINE var", -"pattern : pattern '|' GETLINE", -"pattern : pattern term", -"pattern : re", -"pattern : term", -"plist : pattern comma pattern", -"plist : plist comma pattern", -"pplist : ppattern", -"pplist : pplist comma ppattern", -"prarg :", -"prarg : pplist", -"prarg : '(' plist ')'", -"print : PRINT", -"print : PRINTF", -"pst : NL", -"pst : ';'", -"pst : pst NL", -"pst : pst ';'", -"rbrace : '}'", -"rbrace : rbrace NL", -"re : reg_expr", -"re : NOT re", -"$$5 :", -"reg_expr : '/' $$5 REGEXPR '/'", -"rparen : ')'", -"rparen : rparen NL", -"simple_stmt : print prarg '|' term", -"simple_stmt : print prarg APPEND term", -"simple_stmt : print prarg GT term", -"simple_stmt : print prarg", -"simple_stmt : DELETE varname '[' patlist ']'", -"simple_stmt : DELETE varname", -"simple_stmt : pattern", -"simple_stmt : error", -"st : nl", -"st : ';' opt_nl", -"stmt : BREAK st", -"stmt : CONTINUE st", -"$$6 :", -"$$7 :", -"stmt : do $$6 stmt $$7 WHILE '(' pattern ')' st", -"stmt : EXIT pattern st", -"stmt : EXIT st", -"stmt : for", -"stmt : if stmt else stmt", -"stmt : if stmt", -"stmt : lbrace stmtlist rbrace", -"stmt : NEXT st", -"stmt : NEXTFILE st", -"stmt : RETURN pattern st", -"stmt : RETURN st", -"stmt : simple_stmt st", -"$$8 :", -"stmt : while $$8 stmt", -"stmt : ';' opt_nl", -"stmtlist : stmt", -"stmtlist : stmtlist stmt", -"subop : SUB", -"subop : GSUB", -"string : STRING", -"string : string STRING", -"term : term '/' ASGNOP term", -"term : term '+' term", -"term : term '-' term", -"term : term '*' term", -"term : term '/' term", -"term : term '%' term", -"term : term POWER term", -"term : '-' term", -"term : '+' term", -"term : NOT term", -"term : BLTIN '(' ')'", -"term : BLTIN '(' patlist ')'", -"term : BLTIN", -"term : CALL '(' ')'", -"term : CALL '(' patlist ')'", -"term : CLOSE term", -"term : DECR var", -"term : INCR var", -"term : var DECR", -"term : var INCR", -"term : GETLINE var LT term", -"term : GETLINE LT term", -"term : GETLINE var", -"term : GETLINE", -"term : INDEX '(' pattern comma pattern ')'", -"term : INDEX '(' pattern comma reg_expr ')'", -"term : '(' pattern ')'", -"term : MATCHFCN '(' pattern comma reg_expr ')'", -"term : MATCHFCN '(' pattern comma pattern ')'", -"term : NUMBER", -"term : SPLIT '(' pattern comma varname comma pattern ')'", -"term : SPLIT '(' pattern comma varname comma reg_expr ')'", -"term : SPLIT '(' pattern comma varname ')'", -"term : SPRINTF '(' patlist ')'", -"term : string", -"term : subop '(' reg_expr comma pattern ')'", -"term : subop '(' pattern comma pattern ')'", -"term : subop '(' reg_expr comma pattern comma var ')'", -"term : subop '(' pattern comma pattern comma var ')'", -"term : SUBSTR '(' pattern comma pattern comma pattern ')'", -"term : SUBSTR '(' pattern comma pattern ')'", -"term : var", -"var : varname", -"var : varname '[' patlist ']'", -"var : IVAR", -"var : INDIRECT term", -"varlist :", -"varlist : VAR", -"varlist : varlist comma VAR", -"varname : VAR", -"varname : ARG", -"varname : VARNF", -"while : WHILE '(' pattern rparen", +/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +static const yytype_int16 yyrline[] = +{ + 0, 99, 99, 101, 105, 105, 109, 109, 113, 113, + 117, 117, 121, 121, 125, 125, 127, 127, 129, 129, + 134, 135, 139, 143, 143, 147, 147, 151, 152, 156, + 157, 162, 163, 167, 168, 172, 176, 177, 178, 179, + 180, 181, 183, 185, 185, 190, 191, 195, 196, 200, + 201, 203, 205, 207, 208, 214, 215, 216, 217, 218, + 222, 223, 225, 227, 229, 230, 231, 232, 233, 234, + 235, 236, 242, 243, 244, 247, 250, 251, 252, 256, + 257, 261, 262, 266, 267, 268, 272, 272, 276, 276, + 276, 276, 280, 280, 284, 286, 290, 290, 294, 294, + 298, 301, 304, 307, 308, 309, 310, 311, 315, 316, + 320, 322, 324, 324, 324, 326, 327, 328, 329, 330, + 331, 332, 335, 338, 339, 340, 341, 341, 342, 346, + 347, 351, 351, 355, 356, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, + 386, 389, 390, 392, 398, 399, 401, 403, 405, 406, + 407, 409, 415, 417, 423, 425, 427, 431, 432, 433, + 434, 438, 439, 440, 446, 447, 448, 453 }; #endif -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 10000 -#define YYMAXDEPTH 10000 + +/** Accessing symbol of state STATE. */ +#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) + +#if YYDEBUG || 0 +/* The user-facing name of the symbol whose (internal) number is + YYSYMBOL. No bounds checking. */ +static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; + +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "\"end of file\"", "error", "\"invalid token\"", "FIRSTTOKEN", + "PROGRAM", "PASTAT", "PASTAT2", "XBEGIN", "XEND", "NL", "','", "'{'", + "'('", "'|'", "';'", "'/'", "')'", "'}'", "'['", "']'", "ARRAY", "MATCH", + "NOTMATCH", "MATCHOP", "FINAL", "DOT", "ALL", "CCL", "NCCL", "CHAR", + "OR", "STAR", "QUEST", "PLUS", "EMPTYRE", "ZERO", "AND", "BOR", "APPEND", + "EQ", "GE", "GT", "LE", "LT", "NE", "IN", "ARG", "BLTIN", "BREAK", + "CLOSE", "CONTINUE", "DELETE", "DO", "EXIT", "FOR", "FUNC", "SUB", + "GSUB", "IF", "INDEX", "LSUBSTR", "MATCHFCN", "NEXT", "NEXTFILE", "ADD", + "MINUS", "MULT", "DIVIDE", "MOD", "ASSIGN", "ASGNOP", "ADDEQ", "SUBEQ", + "MULTEQ", "DIVEQ", "MODEQ", "POWEQ", "PRINT", "PRINTF", "SPRINTF", + "ELSE", "INTEST", "CONDEXPR", "POSTINCR", "PREINCR", "POSTDECR", + "PREDECR", "VAR", "IVAR", "VARNF", "CALL", "NUMBER", "STRING", "REGEXPR", + "'?'", "':'", "GETLINE", "RETURN", "SPLIT", "SUBSTR", "WHILE", "CAT", + "'+'", "'-'", "'*'", "'%'", "NOT", "UMINUS", "UPLUS", "POWER", "DECR", + "INCR", "INDIRECT", "LASTTOKEN", "$accept", "program", "and", "bor", + "comma", "do", "else", "for", "$@1", "$@2", "$@3", "funcname", "if", + "lbrace", "nl", "opt_nl", "opt_pst", "opt_simple_stmt", "pas", "pa_pat", + "pa_stat", "$@4", "pa_stats", "patlist", "ppattern", "pattern", "plist", + "pplist", "prarg", "print", "pst", "rbrace", "re", "reg_expr", "$@5", + "rparen", "simple_stmt", "st", "stmt", "$@6", "$@7", "$@8", "stmtlist", + "subop", "string", "term", "var", "varlist", "varname", "while", YY_NULLPTR +}; + +static const char * +yysymbol_name (yysymbol_kind_t yysymbol) +{ + return yytname[yysymbol]; +} #endif -#endif -#define YYINITSTACKSIZE 200 -/* LINTUSED */ + +#define YYPACT_NINF (-316) + +#define yypact_value_is_default(Yyn) \ + ((Yyn) == YYPACT_NINF) + +#define YYTABLE_NINF (-32) + +#define yytable_value_is_error(Yyn) \ + ((Yyn) == YYTABLE_NINF) + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +static const yytype_int16 yypact[] = +{ + 635, -316, -316, -316, 10, 1580, -316, 151, -316, 3, + 3, -316, 4178, -316, -316, 29, 4496, 18, -316, -316, + 40, 44, 56, -316, -316, -316, 71, -316, -316, 81, + 95, 104, 4496, 4496, 4226, 261, 261, 4496, 763, 76, + -316, 157, 3511, -316, -316, 106, -62, -3, -34, 117, + -316, -316, 763, 763, 2184, 39, 53, 4014, 4178, 4496, + -3, 32, -316, -316, 113, 4178, 4178, 4178, 4072, 4496, + 115, 4178, 4178, 65, 65, -316, 65, -316, -316, -316, + -316, -316, 166, 158, 158, -14, -316, 1733, 164, 178, + 158, 158, -316, -316, 1733, 186, 190, -316, 1386, 763, + 3511, 4284, 158, -316, 832, -316, 166, 763, 1580, 108, + 4178, -316, -316, 4178, 4178, 4178, 4178, 4178, 4178, -14, + 4178, 1791, 1849, -3, 4178, -316, 4332, 4496, 4496, 4496, + 4496, 4496, 4178, -316, -316, 4178, 901, 970, -316, -316, + 1907, 155, 1907, 192, -316, 62, 3511, 2680, 116, 2588, + 2588, 80, -316, 87, -3, 4496, 2588, 2588, -316, 196, + -316, 166, 196, -316, -316, 191, 1675, -316, 1454, 4178, + -316, -316, 1675, -316, 4178, -316, 1386, 130, 1039, 4178, + 3894, 201, 57, -316, -3, -30, -316, -316, -316, 1386, + 4178, 1108, -316, 261, 3765, -316, 3765, 3765, 3765, 3765, + 3765, 3765, -316, 2772, -316, 3684, -316, 3603, 2588, 201, + 4496, 65, 43, 43, 65, 65, 65, 3511, 27, -316, + -316, -316, 3511, -14, 3511, -316, -316, 1907, -316, 107, + 1907, 1907, -316, -316, -3, 2, 1907, -316, -316, 4178, + -316, 203, -316, -11, 2864, -316, 2864, -316, -316, 1179, + -316, 206, 128, 4400, -14, 4400, 1965, 2023, -3, 2081, + 4496, 4496, 4496, 4400, -316, 3, -316, -316, 4178, 1907, + 1907, -3, -316, -316, 3511, -316, 6, 210, 2956, 204, + 3048, 213, 143, 2287, 47, 188, -14, 210, 210, 132, + -316, -316, -316, 193, 4178, 4448, -316, -316, 3813, 4120, + 3966, 3894, -3, -3, -3, 3894, 763, 3511, 2390, 2493, + -316, -316, 3, -316, -316, -316, -316, -316, 1907, -316, + 1907, -316, 166, 4178, 217, 223, -14, 147, 4400, 1248, + -316, 33, -316, 33, 763, 3140, 220, 3232, 1522, 3327, + 210, 4178, -316, 193, 3894, -316, 226, 232, 1317, -316, + -316, -316, 217, 166, 1386, 3419, -316, -316, -316, 210, + 1522, -316, 158, 1386, 217, -316, -316, 210, 1386, -316 +}; + +/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 0, 3, 88, 89, 0, 33, 2, 30, 1, 0, + 0, 23, 0, 96, 185, 147, 0, 0, 131, 132, + 0, 0, 0, 184, 179, 186, 0, 164, 133, 158, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, + 45, 29, 35, 77, 94, 0, 169, 78, 176, 177, + 90, 91, 0, 0, 0, 0, 0, 0, 0, 0, + 150, 176, 20, 21, 0, 0, 0, 0, 0, 0, + 157, 0, 0, 143, 142, 95, 144, 151, 152, 180, + 107, 24, 27, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 86, 87, 0, 0, 112, 117, 0, 0, + 106, 83, 0, 129, 0, 126, 27, 0, 34, 0, + 0, 4, 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 76, 0, 134, 0, 0, 0, 0, + 0, 0, 0, 153, 154, 0, 0, 0, 8, 161, + 0, 0, 0, 0, 145, 0, 47, 0, 181, 0, + 0, 0, 148, 0, 156, 0, 0, 0, 25, 28, + 128, 27, 108, 110, 111, 105, 0, 116, 0, 0, + 121, 122, 0, 124, 0, 11, 0, 119, 0, 0, + 81, 84, 103, 58, 59, 176, 125, 40, 130, 0, + 0, 0, 46, 75, 71, 70, 64, 65, 66, 67, + 68, 69, 72, 0, 5, 63, 7, 62, 0, 94, + 0, 139, 136, 137, 138, 140, 141, 60, 0, 41, + 42, 9, 79, 0, 80, 97, 146, 0, 182, 0, + 0, 0, 168, 149, 155, 0, 0, 26, 109, 0, + 115, 0, 32, 177, 0, 123, 0, 113, 12, 0, + 92, 120, 0, 0, 0, 0, 0, 0, 57, 0, + 0, 0, 0, 0, 127, 38, 37, 74, 0, 0, + 0, 135, 178, 73, 48, 98, 0, 43, 0, 94, + 0, 94, 0, 0, 0, 27, 0, 22, 187, 0, + 13, 118, 93, 85, 0, 54, 53, 55, 0, 52, + 51, 82, 100, 101, 102, 49, 0, 61, 0, 0, + 183, 99, 0, 159, 160, 163, 162, 167, 0, 175, + 0, 104, 27, 0, 0, 0, 0, 0, 0, 0, + 171, 0, 170, 0, 0, 0, 94, 0, 0, 0, + 18, 0, 56, 0, 50, 39, 0, 0, 0, 165, + 166, 174, 0, 27, 0, 0, 173, 172, 44, 16, + 0, 19, 0, 0, 0, 114, 17, 14, 0, 15 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -316, -316, -1, 46, 5, -316, -316, -316, -316, -316, + -316, -316, -316, -4, -73, -67, 209, -315, -316, 61, + 145, -316, -316, -43, -192, 482, -175, -316, -316, -316, + -316, -316, -32, -102, -316, -215, -165, -40, 381, -316, + -316, -316, -25, -316, -316, 236, -16, -316, 103, -316 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + 0, 4, 121, 122, 227, 96, 249, 97, 368, 363, + 354, 64, 98, 99, 162, 160, 5, 241, 6, 39, + 40, 312, 41, 145, 180, 100, 55, 181, 182, 101, + 7, 251, 43, 44, 56, 277, 102, 163, 103, 176, + 289, 189, 104, 45, 46, 47, 48, 229, 49, 105 +}; + +/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ +static const yytype_int16 yytable[] = +{ + 61, 38, 75, 242, 252, 52, 53, 135, 195, 159, + 8, 221, 126, 70, 11, 221, 61, 61, 61, 77, + 78, 61, 209, 352, 151, 153, 61, 136, 137, 287, + 125, 288, 14, 159, 286, 107, 132, 138, 61, 190, + 263, 57, 221, 61, 164, 364, 272, 167, 14, 138, + 170, 171, 65, 61, 173, 141, 66, 138, 126, 140, + 142, 295, 186, 298, 299, 300, 321, 301, 67, 183, + 260, 305, 138, 23, 178, 25, 133, 134, 226, 14, + 133, 134, 191, 68, 61, 185, 106, 11, 159, 23, + 138, 25, 218, 310, 238, 261, 232, 138, 262, 127, + 128, 129, 130, 233, 38, 62, 131, 71, 63, 340, + 61, 61, 61, 61, 61, 61, 72, 138, 124, 327, + 23, 24, 25, 275, 69, 148, 240, 14, 279, 281, + 61, 61, 245, 61, 61, 135, 344, 359, 138, 61, + 61, 61, 133, 134, 293, 37, 143, 129, 130, 367, + 61, 296, 131, 138, 230, 231, 61, 138, 155, 317, + 50, 235, 236, 343, 61, 51, 2, 158, 23, 24, + 25, 3, 161, 242, 131, 158, 168, 267, 61, 256, + 61, 61, 61, 61, 61, 61, 259, 61, 165, 61, + 169, 61, 61, 37, 61, 242, 284, 158, 174, 175, + 223, 61, 322, 228, 193, 237, 61, 225, 61, 239, + 248, 138, 159, 269, 270, 292, 336, 285, 323, 311, + 314, 183, 202, 183, 183, 183, 257, 183, 61, 316, + 61, 183, 325, 275, 276, 341, 350, 185, 326, 185, + 185, 185, 356, 185, 61, 61, 61, 185, 357, 159, + 108, 265, 60, 192, 0, 338, 0, 142, 61, 0, + 0, 306, 61, 0, 61, 0, 0, 61, 73, 74, + 76, 243, 0, 79, 0, 0, 0, 0, 123, 61, + 159, 329, 61, 61, 61, 61, 360, 318, 320, 61, + 123, 61, 61, 61, 256, 76, 183, 256, 256, 256, + 256, 0, 0, 0, 256, 154, 0, 14, 334, 348, + 0, 0, 185, 331, 333, 346, 0, 347, 0, 61, + 0, 61, 365, 61, 0, 0, 273, 0, 61, 0, + 0, 0, 142, 0, 0, 0, 123, 184, 282, 61, + 0, 257, 0, 256, 257, 257, 257, 257, 23, 24, + 25, 257, 0, 0, 0, 0, 0, 297, 0, 0, + 0, 0, 211, 212, 213, 214, 215, 216, 0, 0, + 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, + 0, 0, 123, 123, 0, 123, 123, 0, 0, 324, + 257, 234, 123, 123, 0, 0, 0, 0, 0, 0, + 0, 0, 123, 0, 0, 0, 0, 0, 123, 0, + 0, 0, 0, 0, 0, 0, 258, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 342, + 123, 0, 123, 123, 123, 123, 123, 123, 0, 123, + 0, 123, 0, 123, 123, 0, 271, 0, 0, 0, + 0, 0, 0, 123, 0, 0, 0, 0, 123, 0, + 123, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 177, + 123, 0, 123, 0, 0, 188, 0, 42, 0, 184, + 0, 184, 184, 184, 54, 184, 302, 303, 304, 184, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 123, 0, 0, 0, 123, 0, 123, 188, 188, 123, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 258, 0, 0, 258, 258, 258, 258, 0, 146, + 147, 258, 0, 123, 123, 123, 0, 149, 150, 146, + 146, 0, 0, 156, 157, 0, 0, 247, 0, 188, + 0, 0, 0, 0, 184, 0, 0, 0, 0, 166, + 264, 123, 188, 123, 0, 123, 172, 0, 0, 0, + 258, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 42, 123, 194, 0, 0, 196, 197, 198, 199, 200, + 201, 0, 203, 205, 207, 0, 208, 0, 0, 0, + 0, 0, 0, 0, 217, 0, 0, 146, 0, 0, + 0, 0, 222, 0, 224, 0, 0, 0, 0, 0, + 291, 0, 0, 0, 0, -29, 1, 0, 0, 0, + 0, 0, -29, -29, 2, 0, -29, -29, 0, 3, + -29, 244, 0, 0, 0, 0, 246, 0, 0, 0, + 0, 54, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 42, 0, 0, 0, 0, 0, 0, 0, + 0, -29, -29, 0, -29, 0, 0, 0, 0, 0, + -29, -29, -29, 0, -29, 0, -29, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 274, + 188, 0, 278, 280, -29, 0, 0, 0, 283, 0, + 0, 146, -29, -29, -29, -29, -29, -29, 0, 188, + 0, -29, 0, -29, -29, 361, 0, -29, -29, 0, + 0, -29, 0, 0, 366, -29, -29, -29, 0, 369, + 307, 308, 309, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 80, 0, 0, 0, 0, 0, + 0, 0, 81, 0, 11, 12, 54, 82, 13, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 335, 0, 337, 0, 0, 339, 0, 0, 0, 14, + 15, 83, 16, 84, 85, 86, 87, 88, 0, 18, + 19, 89, 20, 355, 21, 90, 91, 0, 0, 0, + 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, + 92, 93, 22, 11, 12, 0, 82, 13, 0, 187, + 23, 24, 25, 26, 27, 28, 0, 0, 0, 29, + 94, 30, 31, 95, 0, 32, 33, 0, 0, 34, + 0, 0, 0, 35, 36, 37, 0, 0, 14, 15, + 83, 16, 84, 85, 86, 87, 88, 0, 18, 19, + 89, 20, 0, 21, 90, 91, 0, 0, 0, 0, + 0, 0, 80, 0, 0, 0, 0, 0, 0, 92, + 93, 22, 11, 12, 0, 82, 13, 0, 219, 23, + 24, 25, 26, 27, 28, 0, 0, 0, 29, 94, + 30, 31, 95, 0, 32, 33, 0, 0, 34, 0, + 0, 0, 35, 36, 37, 0, 0, 14, 15, 83, + 16, 84, 85, 86, 87, 88, 0, 18, 19, 89, + 20, 0, 21, 90, 91, 0, 0, 0, 0, 0, + 0, 80, 0, 0, 0, 0, 0, 0, 92, 93, + 22, 11, 12, 0, 82, 13, 0, 220, 23, 24, + 25, 26, 27, 28, 0, 0, 0, 29, 94, 30, + 31, 95, 0, 32, 33, 0, 0, 34, 0, 0, + 0, 35, 36, 37, 0, 0, 14, 15, 83, 16, + 84, 85, 86, 87, 88, 0, 18, 19, 89, 20, + 0, 21, 90, 91, 0, 0, 0, 0, 0, 0, + 80, 0, 0, 0, 0, 0, 0, 92, 93, 22, + 11, 12, 0, 82, 13, 0, 250, 23, 24, 25, + 26, 27, 28, 0, 0, 0, 29, 94, 30, 31, + 95, 0, 32, 33, 0, 0, 34, 0, 0, 0, + 35, 36, 37, 0, 0, 14, 15, 83, 16, 84, + 85, 86, 87, 88, 0, 18, 19, 89, 20, 0, + 21, 90, 91, 0, 0, 0, 0, 0, 0, 80, + 0, 0, 0, 0, 0, 0, 92, 93, 22, 11, + 12, 0, 82, 13, 0, 266, 23, 24, 25, 26, + 27, 28, 0, 0, 0, 29, 94, 30, 31, 95, + 0, 32, 33, 0, 0, 34, 0, 0, 0, 35, + 36, 37, 0, 0, 14, 15, 83, 16, 84, 85, + 86, 87, 88, 0, 18, 19, 89, 20, 0, 21, + 90, 91, 0, 0, 0, 0, 0, 0, 0, 0, + 80, 0, 0, 0, 0, 92, 93, 22, 290, 0, + 11, 12, 0, 82, 13, 23, 24, 25, 26, 27, + 28, 0, 0, 0, 29, 94, 30, 31, 95, 0, + 32, 33, 0, 0, 34, 0, 0, 0, 35, 36, + 37, 0, 0, 0, 0, 14, 15, 83, 16, 84, + 85, 86, 87, 88, 0, 18, 19, 89, 20, 0, + 21, 90, 91, 0, 0, 0, 0, 0, 0, 80, + 0, 0, 0, 0, 0, 0, 92, 93, 22, 11, + 12, 0, 82, 13, 0, 345, 23, 24, 25, 26, + 27, 28, 0, 0, 0, 29, 94, 30, 31, 95, + 0, 32, 33, 0, 0, 34, 0, 0, 0, 35, + 36, 37, 0, 0, 14, 15, 83, 16, 84, 85, + 86, 87, 88, 0, 18, 19, 89, 20, 0, 21, + 90, 91, 0, 0, 0, 0, 0, 0, 80, 0, + 0, 0, 0, 0, 0, 92, 93, 22, 11, 12, + 0, 82, 13, 0, 358, 23, 24, 25, 26, 27, + 28, 0, 0, 0, 29, 94, 30, 31, 95, 0, + 32, 33, 0, 0, 34, 0, 0, 0, 35, 36, + 37, 0, 0, 14, 15, 83, 16, 84, 85, 86, + 87, 88, 0, 18, 19, 89, 20, 0, 21, 90, + 91, 0, 0, 0, 0, 0, 0, 80, 0, 0, + 0, 0, 0, 0, 92, 93, 22, 11, 12, 0, + 82, 13, 0, 0, 23, 24, 25, 26, 27, 28, + 0, 0, 0, 29, 94, 30, 31, 95, 0, 32, + 33, 0, 0, 34, 0, 0, 0, 35, 36, 37, + 0, 0, 14, 15, 83, 16, 84, 85, 86, 87, + 88, 0, 18, 19, 89, 20, 0, 21, 90, 91, + 0, 0, 0, 0, 0, 80, 0, 0, 0, 0, + 0, 0, 0, 92, 93, 22, 12, 0, -31, 13, + 0, 0, 0, 23, 24, 25, 26, 27, 28, 0, + 0, 0, 29, 94, 30, 31, 95, 0, 32, 33, + 0, 0, 34, 0, 0, 0, 35, 36, 37, 0, + 14, 15, 0, 16, 0, 85, 0, 0, 0, 0, + 18, 19, 0, 20, 0, 21, 0, 0, 0, 0, + 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, + 0, 92, 93, 22, 12, 0, 0, 13, -31, 0, + 0, 23, 24, 25, 26, 27, 28, 0, 0, 0, + 29, 0, 30, 31, 0, 0, 32, 33, 0, 0, + 34, 0, 0, 0, 35, 36, 37, 0, 14, 15, + 0, 16, 0, 85, 0, 0, 0, 0, 18, 19, + 0, 20, 0, 21, 0, 0, 0, 9, 10, 0, + 0, 11, 12, 0, 0, 13, 0, 0, 0, 92, + 93, 22, 0, 0, 0, 0, 0, 0, 0, 23, + 24, 25, 26, 27, 28, 0, 0, 0, 29, 0, + 30, 31, 0, 0, 32, 33, 14, 15, 34, 16, + 0, 0, 35, 36, 37, 17, 18, 19, 0, 20, + 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, + 0, 0, 0, 0, 0, 0, 0, 23, 24, 25, + 26, 27, 28, 0, 0, 0, 29, 0, 30, 31, + 0, 0, 32, 33, 158, 0, 34, 58, 109, 161, + 35, 36, 37, 0, 0, 0, 0, 0, 110, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 111, 112, 0, 113, 114, 115, 116, 117, 118, + 119, 14, 15, 0, 16, 0, 0, 0, 0, 0, + 0, 18, 19, 0, 20, 0, 21, 0, 0, 0, + 0, 0, 158, 0, 0, 12, 0, 161, 13, 0, + 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, + 0, 0, 23, 24, 25, 26, 27, 28, 0, 120, + 0, 29, 0, 30, 31, 0, 0, 32, 33, 14, + 15, 59, 16, 0, 0, 35, 36, 37, 0, 18, + 19, 0, 20, 0, 21, 0, 0, 0, 0, 0, + 204, 0, 0, 12, 0, 0, 13, 0, 0, 0, + 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, + 23, 24, 25, 26, 27, 28, 0, 0, 0, 29, + 0, 30, 31, 0, 0, 32, 33, 14, 15, 34, + 16, 0, 0, 35, 36, 37, 0, 18, 19, 0, + 20, 0, 21, 0, 0, 0, 0, 0, 206, 0, + 0, 12, 0, 0, 13, 0, 0, 0, 0, 0, + 22, 0, 0, 0, 0, 0, 0, 0, 23, 24, + 25, 26, 27, 28, 0, 0, 0, 29, 0, 30, + 31, 0, 0, 32, 33, 14, 15, 34, 16, 0, + 0, 35, 36, 37, 0, 18, 19, 0, 20, 0, + 21, 0, 0, 0, 0, 0, 221, 0, 0, 12, + 0, 0, 13, 0, 0, 0, 0, 0, 22, 0, + 0, 0, 0, 0, 0, 0, 23, 24, 25, 26, + 27, 28, 0, 0, 0, 29, 0, 30, 31, 0, + 0, 32, 33, 14, 15, 34, 16, 0, 0, 35, + 36, 37, 0, 18, 19, 0, 20, 0, 21, 0, + 0, 0, 0, 0, 204, 0, 0, 294, 0, 0, + 13, 0, 0, 0, 0, 0, 22, 0, 0, 0, + 0, 0, 0, 0, 23, 24, 25, 26, 27, 28, + 0, 0, 0, 29, 0, 30, 31, 0, 0, 32, + 33, 14, 15, 34, 16, 0, 0, 35, 36, 37, + 0, 18, 19, 0, 20, 0, 21, 0, 0, 0, + 0, 0, 206, 0, 0, 294, 0, 0, 13, 0, + 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, + 0, 0, 23, 24, 25, 26, 27, 28, 0, 0, + 0, 29, 0, 30, 31, 0, 0, 32, 33, 14, + 15, 34, 16, 0, 0, 35, 36, 37, 0, 18, + 19, 0, 20, 0, 21, 0, 0, 0, 0, 0, + 221, 0, 0, 294, 0, 0, 13, 0, 0, 0, + 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, + 23, 24, 25, 26, 27, 28, 0, 0, 0, 29, + 0, 30, 31, 0, 0, 32, 33, 14, 15, 34, + 16, 0, 0, 35, 36, 37, 0, 18, 19, 0, + 20, 0, 21, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 22, 0, 0, 0, 0, 0, 0, 0, 23, 24, + 25, 26, 27, 28, 0, 0, 0, 29, 0, 30, + 31, 0, 0, 32, 33, 0, 0, 34, 0, 0, + 0, 35, 36, 37, 138, 0, 58, 109, 0, 0, + 139, 0, 0, 0, 0, 0, 0, 110, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 111, 112, 0, 113, 114, 115, 116, 117, 118, 119, + 14, 15, 0, 16, 0, 0, 0, 0, 0, 0, + 18, 19, 0, 20, 0, 21, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, + 0, 23, 24, 25, 26, 27, 28, 0, 120, 0, + 29, 0, 30, 31, 0, 0, 32, 33, 0, 0, + 59, 0, 0, 0, 35, 36, 37, 138, 0, 58, + 109, 0, 0, 319, 0, 0, 0, 0, 0, 0, + 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 111, 112, 0, 113, 114, 115, 116, + 117, 118, 119, 14, 15, 0, 16, 0, 0, 0, + 0, 0, 0, 18, 19, 0, 20, 0, 21, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, + 0, 0, 0, 0, 23, 24, 25, 26, 27, 28, + 0, 120, 0, 29, 0, 30, 31, 0, 0, 32, + 33, 0, 0, 59, 0, 0, 0, 35, 36, 37, + 138, 0, 58, 109, 0, 0, 330, 0, 0, 0, + 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 111, 112, 0, 113, + 114, 115, 116, 117, 118, 119, 14, 15, 0, 16, + 0, 0, 0, 0, 0, 0, 18, 19, 0, 20, + 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, + 0, 0, 0, 0, 0, 0, 0, 23, 24, 25, + 26, 27, 28, 0, 120, 0, 29, 0, 30, 31, + 0, 0, 32, 33, 0, 0, 59, 0, 0, 0, + 35, 36, 37, 138, 0, 58, 109, 0, 0, 332, + 0, 0, 0, 0, 0, 0, 110, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 111, + 112, 0, 113, 114, 115, 116, 117, 118, 119, 14, + 15, 0, 16, 0, 0, 0, 0, 0, 0, 18, + 19, 0, 20, 0, 21, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, + 23, 24, 25, 26, 27, 28, 0, 120, 0, 29, + 0, 30, 31, 0, 0, 32, 33, 0, 138, 59, + 58, 109, 0, 35, 36, 37, 0, 0, 0, 0, + 0, 110, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 111, 112, 0, 113, 114, 115, + 116, 117, 118, 119, 14, 15, 0, 16, 0, 0, + 0, 0, 0, 0, 18, 19, 0, 20, 0, 21, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, + 0, 0, 0, 0, 0, 23, 24, 25, 26, 27, + 28, 0, 120, 0, 29, 0, 30, 31, 0, 0, + 32, 33, 58, 109, 59, 0, 139, 0, 35, 36, + 37, 0, 0, 110, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 111, 112, 0, 113, + 114, 115, 116, 117, 118, 119, 14, 15, 0, 16, + 0, 0, 0, 0, 0, 0, 18, 19, 0, 20, + 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, + 0, 0, 0, 0, 0, 0, 0, 23, 24, 25, + 26, 27, 28, 0, 120, 0, 29, 0, 30, 31, + 0, 0, 32, 33, 58, 109, 59, 0, 0, 0, + 35, 36, 37, 0, 0, 110, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 111, 112, + 0, 113, 114, 115, 116, 117, 118, 119, 14, 15, + 0, 16, 0, 0, 0, 0, 0, 0, 18, 19, + 0, 20, 0, 21, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 22, 0, 0, 0, 0, 0, 0, 0, 23, + 24, 25, 26, 27, 28, 0, 120, 268, 29, 0, + 30, 31, 0, 0, 32, 33, 58, 109, 59, 0, + 275, 0, 35, 36, 37, 0, 0, 110, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 111, 112, 0, 113, 114, 115, 116, 117, 118, 119, + 14, 15, 0, 16, 0, 0, 0, 0, 0, 0, + 18, 19, 0, 20, 0, 21, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, + 0, 23, 24, 25, 26, 27, 28, 0, 120, 0, + 29, 0, 30, 31, 0, 0, 32, 33, 58, 109, + 59, 0, 313, 0, 35, 36, 37, 0, 0, 110, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 111, 112, 0, 113, 114, 115, 116, 117, + 118, 119, 14, 15, 0, 16, 0, 0, 0, 0, + 0, 0, 18, 19, 0, 20, 0, 21, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, + 0, 0, 0, 23, 24, 25, 26, 27, 28, 0, + 120, 0, 29, 0, 30, 31, 0, 0, 32, 33, + 58, 109, 59, 0, 315, 0, 35, 36, 37, 0, + 0, 110, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 111, 112, 0, 113, 114, 115, + 116, 117, 118, 119, 14, 15, 0, 16, 0, 0, + 0, 0, 0, 0, 18, 19, 0, 20, 0, 21, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, + 0, 0, 0, 0, 0, 23, 24, 25, 26, 27, + 28, 0, 120, 0, 29, 0, 30, 31, 0, 0, + 32, 33, 58, 109, 59, 0, 349, 0, 35, 36, + 37, 0, 0, 110, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 111, 112, 0, 113, + 114, 115, 116, 117, 118, 119, 14, 15, 0, 16, + 0, 0, 0, 0, 0, 0, 18, 19, 0, 20, + 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, + 0, 0, 0, 0, 0, 0, 0, 23, 24, 25, + 26, 27, 28, 0, 120, 0, 29, 0, 30, 31, + 0, 0, 32, 33, 58, 109, 59, 0, 351, 0, + 35, 36, 37, 0, 0, 110, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 111, 112, + 0, 113, 114, 115, 116, 117, 118, 119, 14, 15, + 0, 16, 0, 0, 0, 0, 0, 0, 18, 19, + 0, 20, 0, 21, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 22, 0, 0, 0, 0, 0, 0, 0, 23, + 24, 25, 26, 27, 28, 0, 120, 0, 29, 0, + 30, 31, 0, 0, 32, 33, 0, 0, 59, 58, + 109, 353, 35, 36, 37, 0, 0, 0, 0, 0, + 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 111, 112, 0, 113, 114, 115, 116, + 117, 118, 119, 14, 15, 0, 16, 0, 0, 0, + 0, 0, 0, 18, 19, 0, 20, 0, 21, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, + 0, 0, 0, 0, 23, 24, 25, 26, 27, 28, + 0, 120, 0, 29, 0, 30, 31, 0, 0, 32, + 33, 58, 109, 59, 0, 362, 0, 35, 36, 37, + 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 111, 112, 0, 113, 114, + 115, 116, 117, 118, 119, 14, 15, 0, 16, 0, + 0, 0, 0, 0, 0, 18, 19, 0, 20, 0, + 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, + 0, 0, 0, 0, 0, 0, 23, 24, 25, 26, + 27, 28, 0, 120, 0, 29, 0, 30, 31, 0, + 0, 32, 33, 58, 109, 59, 0, 0, 0, 35, + 36, 37, 0, 0, 110, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 111, 112, 0, + 113, 114, 115, 116, 117, 118, 119, 14, 15, 0, + 16, 0, 0, 0, 0, 0, 0, 18, 19, 0, + 20, 0, 21, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 22, 0, 0, 0, 0, 0, 0, 0, 23, 24, + 25, 26, 27, 28, 0, 120, 0, 29, 0, 30, + 31, 0, 0, 32, 33, 58, 109, 59, 0, 0, + 0, 35, 36, 37, 0, 0, 110, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 111, + 0, 0, 113, 114, 115, 116, 117, 118, 119, 14, + 15, 0, 16, 0, 0, 0, 0, 0, 0, 18, + 19, 0, 20, 0, 21, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, + 23, 24, 25, 26, 27, 28, 58, 109, 0, 29, + 0, 30, 31, 0, 0, 32, 33, 110, 0, 59, + 0, 0, 0, 35, 36, 37, 0, 0, 0, 0, + 0, 0, 0, 113, 114, 115, 116, 117, 118, 119, + 14, 15, 0, 16, 0, 0, 0, 0, 0, 0, + 18, 19, 0, 20, 0, 21, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, + 0, 23, 24, 25, 26, 27, 28, 58, -32, 0, + 29, 0, 30, 31, 0, 0, 32, 33, -32, 0, + 59, 0, 0, 0, 35, 36, 37, 0, 0, 0, + 0, 0, 0, 0, -32, -32, -32, -32, -32, -32, + -32, 14, 15, 0, 16, 0, 0, 0, 0, 0, + 0, 18, 19, 0, 20, 58, 21, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 253, 0, 0, 0, + 0, 0, 0, 0, 22, 0, 0, 0, 0, 111, + 112, 0, 23, 24, 25, 26, 27, 28, 254, 14, + 15, 0, 16, 30, 31, 0, 0, 32, 33, 18, + 19, 59, 20, 0, 21, 35, 36, 37, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, + 23, 24, 25, 26, 27, 28, 58, 255, 328, 29, + 0, 30, 31, 0, 0, 32, 33, 253, 0, 59, + 0, 0, 0, 35, 36, 37, 0, 0, 0, 0, + 111, 112, 0, 0, 0, 0, 0, 0, 0, 254, + 14, 15, 0, 16, 0, 0, 0, 0, 0, 0, + 18, 19, 0, 20, 0, 21, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 22, 0, 0, 0, 0, 58, 0, + 0, 23, 24, 25, 26, 27, 28, 0, 255, 253, + 29, 0, 30, 31, 0, 0, 32, 33, 0, 0, + 59, 0, 111, 0, 35, 36, 37, 0, 0, 0, + 0, 254, 14, 15, 0, 16, 0, 0, 0, 0, + 0, 0, 18, 19, 0, 20, 12, 21, 0, 13, + 144, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, + 0, 0, 0, 23, 24, 25, 26, 27, 28, 0, + 14, 15, 29, 16, 30, 31, 0, 0, 32, 33, + 18, 19, 59, 20, 0, 21, 35, 36, 37, 0, + 0, 0, 0, 0, 12, 0, 0, 13, 152, 0, + 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, + 0, 23, 24, 25, 26, 27, 28, 0, 0, 0, + 29, 0, 30, 31, 0, 0, 32, 33, 14, 15, + 34, 16, 0, 0, 35, 36, 37, 0, 18, 19, + 0, 20, 58, 21, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 253, 0, 0, 0, 0, 0, 0, + 0, 22, 0, 0, 0, 0, 0, 0, 0, 23, + 24, 25, 26, 27, 28, 254, 14, 15, 29, 16, + 30, 31, 0, 0, 32, 33, 18, 19, 34, 20, + 0, 21, 35, 36, 37, 0, 0, 0, 0, 0, + 12, 0, 0, 13, 0, 0, 0, 0, 0, 22, + 0, 0, 0, 0, 0, 0, 0, 23, 24, 25, + 26, 27, 28, 0, 0, 0, 29, 0, 30, 31, + 0, 0, 32, 33, 14, 15, 59, 16, 0, 0, + 35, 36, 37, 0, 18, 19, 0, 20, 58, 21, + 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, + 0, 0, 0, 0, 0, 23, 24, 25, 26, 27, + 28, 0, 14, 15, 29, 16, 30, 31, 0, 0, + 32, 33, 18, 19, 34, 20, 0, 21, 35, 36, + 37, 0, 0, 0, 0, 0, 179, 0, 0, 13, + 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, + 0, 0, 0, 23, 24, 25, 26, 27, 28, 0, + 0, 0, 29, 0, 30, 31, 0, 0, 32, 33, + 14, 15, 34, 16, 0, 0, 35, 36, 37, 0, + 18, 19, 0, 20, 58, 21, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, + 0, 23, 24, 25, 26, 27, 28, 0, 14, 15, + 29, 16, 30, 31, 0, 0, 32, 33, 18, 19, + 34, 20, 0, 21, 35, 36, 37, 0, 0, 0, + 0, 0, 210, 0, 0, 0, 0, 0, 0, 0, + 0, 22, 294, 0, 0, 13, 0, 0, 0, 23, + 24, 25, 26, 27, 28, 0, 0, 0, 29, 0, + 30, 31, 0, 0, 32, 33, 0, 0, 59, 0, + 0, 0, 35, 36, 37, 0, 14, 15, 0, 16, + 0, 0, 0, 0, 0, 0, 18, 19, 0, 20, + 58, 21, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -32, 0, 0, 0, 0, 0, 0, 0, 22, + 0, 0, 0, 0, 0, 0, 0, 23, 24, 25, + 26, 27, 28, -32, 14, 15, 29, 16, 30, 31, + 0, 0, 32, 33, 18, 19, 34, 20, 58, 21, + 35, 36, 37, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, + 0, 0, 0, 0, 0, 23, 24, 25, 26, 27, + 28, 0, 14, 15, 0, 16, 30, 31, 0, 0, + 32, 33, 18, 19, 59, 20, 0, 21, 35, 36, + 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, + 0, 0, 0, 23, 24, 25, 26, 27, 28, 0, + 0, 0, 29, 0, 30, 31, 0, 0, 32, 33, + 0, 0, 59, 0, 0, 0, 35, 36, 37 +}; + +static const yytype_int16 yycheck[] = +{ + 16, 5, 34, 168, 179, 9, 10, 18, 110, 82, + 0, 9, 15, 29, 11, 9, 32, 33, 34, 35, + 36, 37, 124, 338, 67, 68, 42, 52, 53, 244, + 92, 246, 46, 106, 45, 39, 70, 10, 54, 106, + 70, 12, 9, 59, 84, 360, 19, 87, 46, 10, + 90, 91, 12, 69, 94, 16, 12, 10, 15, 54, + 55, 253, 102, 255, 256, 257, 19, 259, 12, 101, + 13, 263, 10, 87, 99, 89, 110, 111, 16, 46, + 110, 111, 107, 12, 100, 101, 10, 11, 161, 87, + 10, 89, 135, 87, 161, 38, 16, 10, 41, 102, + 103, 104, 105, 16, 108, 87, 109, 12, 90, 324, + 126, 127, 128, 129, 130, 131, 12, 10, 12, 294, + 87, 88, 89, 16, 43, 12, 166, 46, 230, 231, + 146, 147, 172, 149, 150, 18, 328, 352, 10, 155, + 156, 157, 110, 111, 16, 112, 93, 104, 105, 364, + 166, 253, 109, 10, 149, 150, 172, 10, 43, 16, + 9, 156, 157, 16, 180, 14, 9, 9, 87, 88, + 89, 14, 14, 338, 109, 9, 12, 193, 194, 180, + 196, 197, 198, 199, 200, 201, 181, 203, 85, 205, + 12, 207, 208, 112, 210, 360, 239, 9, 12, 9, + 45, 217, 14, 87, 96, 9, 222, 15, 224, 18, + 80, 10, 285, 208, 209, 9, 318, 14, 285, 9, + 16, 253, 119, 255, 256, 257, 180, 259, 244, 16, + 246, 263, 100, 16, 229, 12, 16, 253, 45, 255, + 256, 257, 16, 259, 260, 261, 262, 263, 16, 322, + 41, 190, 16, 108, -1, 322, -1, 252, 274, -1, + -1, 265, 278, -1, 280, -1, -1, 283, 32, 33, + 34, 168, -1, 37, -1, -1, -1, -1, 42, 295, + 353, 306, 298, 299, 300, 301, 353, 282, 283, 305, + 54, 307, 308, 309, 295, 59, 328, 298, 299, 300, + 301, -1, -1, -1, 305, 69, -1, 46, 312, 334, + -1, -1, 328, 308, 309, 331, -1, 333, -1, 335, + -1, 337, 362, 339, -1, -1, 223, -1, 344, -1, + -1, -1, 327, -1, -1, -1, 100, 101, 235, 355, + -1, 295, -1, 344, 298, 299, 300, 301, 87, 88, + 89, 305, -1, -1, -1, -1, -1, 254, -1, -1, + -1, -1, 126, 127, 128, 129, 130, 131, -1, -1, + -1, -1, -1, 112, -1, -1, -1, -1, -1, -1, + -1, -1, 146, 147, -1, 149, 150, -1, -1, 286, + 344, 155, 156, 157, -1, -1, -1, -1, -1, -1, + -1, -1, 166, -1, -1, -1, -1, -1, 172, -1, + -1, -1, -1, -1, -1, -1, 180, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 326, + 194, -1, 196, 197, 198, 199, 200, 201, -1, 203, + -1, 205, -1, 207, 208, -1, 210, -1, -1, -1, + -1, -1, -1, 217, -1, -1, -1, -1, 222, -1, + 224, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 98, + 244, -1, 246, -1, -1, 104, -1, 5, -1, 253, + -1, 255, 256, 257, 12, 259, 260, 261, 262, 263, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 274, -1, -1, -1, 278, -1, 280, 136, 137, 283, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 295, -1, -1, 298, 299, 300, 301, -1, 57, + 58, 305, -1, 307, 308, 309, -1, 65, 66, 67, + 68, -1, -1, 71, 72, -1, -1, 176, -1, 178, + -1, -1, -1, -1, 328, -1, -1, -1, -1, 87, + 189, 335, 191, 337, -1, 339, 94, -1, -1, -1, + 344, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 108, 355, 110, -1, -1, 113, 114, 115, 116, 117, + 118, -1, 120, 121, 122, -1, 124, -1, -1, -1, + -1, -1, -1, -1, 132, -1, -1, 135, -1, -1, + -1, -1, 140, -1, 142, -1, -1, -1, -1, -1, + 249, -1, -1, -1, -1, 0, 1, -1, -1, -1, + -1, -1, 7, 8, 9, -1, 11, 12, -1, 14, + 15, 169, -1, -1, -1, -1, 174, -1, -1, -1, + -1, 179, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 190, -1, -1, -1, -1, -1, -1, -1, + -1, 46, 47, -1, 49, -1, -1, -1, -1, -1, + 55, 56, 57, -1, 59, -1, 61, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 227, + 329, -1, 230, 231, 79, -1, -1, -1, 236, -1, + -1, 239, 87, 88, 89, 90, 91, 92, -1, 348, + -1, 96, -1, 98, 99, 354, -1, 102, 103, -1, + -1, 106, -1, -1, 363, 110, 111, 112, -1, 368, + 268, 269, 270, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, + -1, -1, 9, -1, 11, 12, 294, 14, 15, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 318, -1, 320, -1, -1, 323, -1, -1, -1, 46, + 47, 48, 49, 50, 51, 52, 53, 54, -1, 56, + 57, 58, 59, 341, 61, 62, 63, -1, -1, -1, + -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, + 77, 78, 79, 11, 12, -1, 14, 15, -1, 17, + 87, 88, 89, 90, 91, 92, -1, -1, -1, 96, + 97, 98, 99, 100, -1, 102, 103, -1, -1, 106, + -1, -1, -1, 110, 111, 112, -1, -1, 46, 47, + 48, 49, 50, 51, 52, 53, 54, -1, 56, 57, + 58, 59, -1, 61, 62, 63, -1, -1, -1, -1, + -1, -1, 1, -1, -1, -1, -1, -1, -1, 77, + 78, 79, 11, 12, -1, 14, 15, -1, 17, 87, + 88, 89, 90, 91, 92, -1, -1, -1, 96, 97, + 98, 99, 100, -1, 102, 103, -1, -1, 106, -1, + -1, -1, 110, 111, 112, -1, -1, 46, 47, 48, + 49, 50, 51, 52, 53, 54, -1, 56, 57, 58, + 59, -1, 61, 62, 63, -1, -1, -1, -1, -1, + -1, 1, -1, -1, -1, -1, -1, -1, 77, 78, + 79, 11, 12, -1, 14, 15, -1, 17, 87, 88, + 89, 90, 91, 92, -1, -1, -1, 96, 97, 98, + 99, 100, -1, 102, 103, -1, -1, 106, -1, -1, + -1, 110, 111, 112, -1, -1, 46, 47, 48, 49, + 50, 51, 52, 53, 54, -1, 56, 57, 58, 59, + -1, 61, 62, 63, -1, -1, -1, -1, -1, -1, + 1, -1, -1, -1, -1, -1, -1, 77, 78, 79, + 11, 12, -1, 14, 15, -1, 17, 87, 88, 89, + 90, 91, 92, -1, -1, -1, 96, 97, 98, 99, + 100, -1, 102, 103, -1, -1, 106, -1, -1, -1, + 110, 111, 112, -1, -1, 46, 47, 48, 49, 50, + 51, 52, 53, 54, -1, 56, 57, 58, 59, -1, + 61, 62, 63, -1, -1, -1, -1, -1, -1, 1, + -1, -1, -1, -1, -1, -1, 77, 78, 79, 11, + 12, -1, 14, 15, -1, 17, 87, 88, 89, 90, + 91, 92, -1, -1, -1, 96, 97, 98, 99, 100, + -1, 102, 103, -1, -1, 106, -1, -1, -1, 110, + 111, 112, -1, -1, 46, 47, 48, 49, 50, 51, + 52, 53, 54, -1, 56, 57, 58, 59, -1, 61, + 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, + 1, -1, -1, -1, -1, 77, 78, 79, 9, -1, + 11, 12, -1, 14, 15, 87, 88, 89, 90, 91, + 92, -1, -1, -1, 96, 97, 98, 99, 100, -1, + 102, 103, -1, -1, 106, -1, -1, -1, 110, 111, + 112, -1, -1, -1, -1, 46, 47, 48, 49, 50, + 51, 52, 53, 54, -1, 56, 57, 58, 59, -1, + 61, 62, 63, -1, -1, -1, -1, -1, -1, 1, + -1, -1, -1, -1, -1, -1, 77, 78, 79, 11, + 12, -1, 14, 15, -1, 17, 87, 88, 89, 90, + 91, 92, -1, -1, -1, 96, 97, 98, 99, 100, + -1, 102, 103, -1, -1, 106, -1, -1, -1, 110, + 111, 112, -1, -1, 46, 47, 48, 49, 50, 51, + 52, 53, 54, -1, 56, 57, 58, 59, -1, 61, + 62, 63, -1, -1, -1, -1, -1, -1, 1, -1, + -1, -1, -1, -1, -1, 77, 78, 79, 11, 12, + -1, 14, 15, -1, 17, 87, 88, 89, 90, 91, + 92, -1, -1, -1, 96, 97, 98, 99, 100, -1, + 102, 103, -1, -1, 106, -1, -1, -1, 110, 111, + 112, -1, -1, 46, 47, 48, 49, 50, 51, 52, + 53, 54, -1, 56, 57, 58, 59, -1, 61, 62, + 63, -1, -1, -1, -1, -1, -1, 1, -1, -1, + -1, -1, -1, -1, 77, 78, 79, 11, 12, -1, + 14, 15, -1, -1, 87, 88, 89, 90, 91, 92, + -1, -1, -1, 96, 97, 98, 99, 100, -1, 102, + 103, -1, -1, 106, -1, -1, -1, 110, 111, 112, + -1, -1, 46, 47, 48, 49, 50, 51, 52, 53, + 54, -1, 56, 57, 58, 59, -1, 61, 62, 63, + -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, + -1, -1, -1, 77, 78, 79, 12, -1, 14, 15, + -1, -1, -1, 87, 88, 89, 90, 91, 92, -1, + -1, -1, 96, 97, 98, 99, 100, -1, 102, 103, + -1, -1, 106, -1, -1, -1, 110, 111, 112, -1, + 46, 47, -1, 49, -1, 51, -1, -1, -1, -1, + 56, 57, -1, 59, -1, 61, -1, -1, -1, -1, + -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, + -1, 77, 78, 79, 12, -1, -1, 15, 16, -1, + -1, 87, 88, 89, 90, 91, 92, -1, -1, -1, + 96, -1, 98, 99, -1, -1, 102, 103, -1, -1, + 106, -1, -1, -1, 110, 111, 112, -1, 46, 47, + -1, 49, -1, 51, -1, -1, -1, -1, 56, 57, + -1, 59, -1, 61, -1, -1, -1, 7, 8, -1, + -1, 11, 12, -1, -1, 15, -1, -1, -1, 77, + 78, 79, -1, -1, -1, -1, -1, -1, -1, 87, + 88, 89, 90, 91, 92, -1, -1, -1, 96, -1, + 98, 99, -1, -1, 102, 103, 46, 47, 106, 49, + -1, -1, 110, 111, 112, 55, 56, 57, -1, 59, + -1, 61, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 79, + -1, -1, -1, -1, -1, -1, -1, 87, 88, 89, + 90, 91, 92, -1, -1, -1, 96, -1, 98, 99, + -1, -1, 102, 103, 9, -1, 106, 12, 13, 14, + 110, 111, 112, -1, -1, -1, -1, -1, 23, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 36, 37, -1, 39, 40, 41, 42, 43, 44, + 45, 46, 47, -1, 49, -1, -1, -1, -1, -1, + -1, 56, 57, -1, 59, -1, 61, -1, -1, -1, + -1, -1, 9, -1, -1, 12, -1, 14, 15, -1, + -1, -1, -1, -1, 79, -1, -1, -1, -1, -1, + -1, -1, 87, 88, 89, 90, 91, 92, -1, 94, + -1, 96, -1, 98, 99, -1, -1, 102, 103, 46, + 47, 106, 49, -1, -1, 110, 111, 112, -1, 56, + 57, -1, 59, -1, 61, -1, -1, -1, -1, -1, + 9, -1, -1, 12, -1, -1, 15, -1, -1, -1, + -1, -1, 79, -1, -1, -1, -1, -1, -1, -1, + 87, 88, 89, 90, 91, 92, -1, -1, -1, 96, + -1, 98, 99, -1, -1, 102, 103, 46, 47, 106, + 49, -1, -1, 110, 111, 112, -1, 56, 57, -1, + 59, -1, 61, -1, -1, -1, -1, -1, 9, -1, + -1, 12, -1, -1, 15, -1, -1, -1, -1, -1, + 79, -1, -1, -1, -1, -1, -1, -1, 87, 88, + 89, 90, 91, 92, -1, -1, -1, 96, -1, 98, + 99, -1, -1, 102, 103, 46, 47, 106, 49, -1, + -1, 110, 111, 112, -1, 56, 57, -1, 59, -1, + 61, -1, -1, -1, -1, -1, 9, -1, -1, 12, + -1, -1, 15, -1, -1, -1, -1, -1, 79, -1, + -1, -1, -1, -1, -1, -1, 87, 88, 89, 90, + 91, 92, -1, -1, -1, 96, -1, 98, 99, -1, + -1, 102, 103, 46, 47, 106, 49, -1, -1, 110, + 111, 112, -1, 56, 57, -1, 59, -1, 61, -1, + -1, -1, -1, -1, 9, -1, -1, 12, -1, -1, + 15, -1, -1, -1, -1, -1, 79, -1, -1, -1, + -1, -1, -1, -1, 87, 88, 89, 90, 91, 92, + -1, -1, -1, 96, -1, 98, 99, -1, -1, 102, + 103, 46, 47, 106, 49, -1, -1, 110, 111, 112, + -1, 56, 57, -1, 59, -1, 61, -1, -1, -1, + -1, -1, 9, -1, -1, 12, -1, -1, 15, -1, + -1, -1, -1, -1, 79, -1, -1, -1, -1, -1, + -1, -1, 87, 88, 89, 90, 91, 92, -1, -1, + -1, 96, -1, 98, 99, -1, -1, 102, 103, 46, + 47, 106, 49, -1, -1, 110, 111, 112, -1, 56, + 57, -1, 59, -1, 61, -1, -1, -1, -1, -1, + 9, -1, -1, 12, -1, -1, 15, -1, -1, -1, + -1, -1, 79, -1, -1, -1, -1, -1, -1, -1, + 87, 88, 89, 90, 91, 92, -1, -1, -1, 96, + -1, 98, 99, -1, -1, 102, 103, 46, 47, 106, + 49, -1, -1, 110, 111, 112, -1, 56, 57, -1, + 59, -1, 61, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 79, -1, -1, -1, -1, -1, -1, -1, 87, 88, + 89, 90, 91, 92, -1, -1, -1, 96, -1, 98, + 99, -1, -1, 102, 103, -1, -1, 106, -1, -1, + -1, 110, 111, 112, 10, -1, 12, 13, -1, -1, + 16, -1, -1, -1, -1, -1, -1, 23, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 36, 37, -1, 39, 40, 41, 42, 43, 44, 45, + 46, 47, -1, 49, -1, -1, -1, -1, -1, -1, + 56, 57, -1, 59, -1, 61, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 79, -1, -1, -1, -1, -1, -1, + -1, 87, 88, 89, 90, 91, 92, -1, 94, -1, + 96, -1, 98, 99, -1, -1, 102, 103, -1, -1, + 106, -1, -1, -1, 110, 111, 112, 10, -1, 12, + 13, -1, -1, 16, -1, -1, -1, -1, -1, -1, + 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 36, 37, -1, 39, 40, 41, 42, + 43, 44, 45, 46, 47, -1, 49, -1, -1, -1, + -1, -1, -1, 56, 57, -1, 59, -1, 61, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 79, -1, -1, -1, + -1, -1, -1, -1, 87, 88, 89, 90, 91, 92, + -1, 94, -1, 96, -1, 98, 99, -1, -1, 102, + 103, -1, -1, 106, -1, -1, -1, 110, 111, 112, + 10, -1, 12, 13, -1, -1, 16, -1, -1, -1, + -1, -1, -1, 23, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 36, 37, -1, 39, + 40, 41, 42, 43, 44, 45, 46, 47, -1, 49, + -1, -1, -1, -1, -1, -1, 56, 57, -1, 59, + -1, 61, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 79, + -1, -1, -1, -1, -1, -1, -1, 87, 88, 89, + 90, 91, 92, -1, 94, -1, 96, -1, 98, 99, + -1, -1, 102, 103, -1, -1, 106, -1, -1, -1, + 110, 111, 112, 10, -1, 12, 13, -1, -1, 16, + -1, -1, -1, -1, -1, -1, 23, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 36, + 37, -1, 39, 40, 41, 42, 43, 44, 45, 46, + 47, -1, 49, -1, -1, -1, -1, -1, -1, 56, + 57, -1, 59, -1, 61, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 79, -1, -1, -1, -1, -1, -1, -1, + 87, 88, 89, 90, 91, 92, -1, 94, -1, 96, + -1, 98, 99, -1, -1, 102, 103, -1, 10, 106, + 12, 13, -1, 110, 111, 112, -1, -1, -1, -1, + -1, 23, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 36, 37, -1, 39, 40, 41, + 42, 43, 44, 45, 46, 47, -1, 49, -1, -1, + -1, -1, -1, -1, 56, 57, -1, 59, -1, 61, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 79, -1, -1, + -1, -1, -1, -1, -1, 87, 88, 89, 90, 91, + 92, -1, 94, -1, 96, -1, 98, 99, -1, -1, + 102, 103, 12, 13, 106, -1, 16, -1, 110, 111, + 112, -1, -1, 23, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 36, 37, -1, 39, + 40, 41, 42, 43, 44, 45, 46, 47, -1, 49, + -1, -1, -1, -1, -1, -1, 56, 57, -1, 59, + -1, 61, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 79, + -1, -1, -1, -1, -1, -1, -1, 87, 88, 89, + 90, 91, 92, -1, 94, -1, 96, -1, 98, 99, + -1, -1, 102, 103, 12, 13, 106, -1, -1, -1, + 110, 111, 112, -1, -1, 23, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 36, 37, + -1, 39, 40, 41, 42, 43, 44, 45, 46, 47, + -1, 49, -1, -1, -1, -1, -1, -1, 56, 57, + -1, 59, -1, 61, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 79, -1, -1, -1, -1, -1, -1, -1, 87, + 88, 89, 90, 91, 92, -1, 94, 95, 96, -1, + 98, 99, -1, -1, 102, 103, 12, 13, 106, -1, + 16, -1, 110, 111, 112, -1, -1, 23, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 36, 37, -1, 39, 40, 41, 42, 43, 44, 45, + 46, 47, -1, 49, -1, -1, -1, -1, -1, -1, + 56, 57, -1, 59, -1, 61, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 79, -1, -1, -1, -1, -1, -1, + -1, 87, 88, 89, 90, 91, 92, -1, 94, -1, + 96, -1, 98, 99, -1, -1, 102, 103, 12, 13, + 106, -1, 16, -1, 110, 111, 112, -1, -1, 23, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 36, 37, -1, 39, 40, 41, 42, 43, + 44, 45, 46, 47, -1, 49, -1, -1, -1, -1, + -1, -1, 56, 57, -1, 59, -1, 61, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 79, -1, -1, -1, -1, + -1, -1, -1, 87, 88, 89, 90, 91, 92, -1, + 94, -1, 96, -1, 98, 99, -1, -1, 102, 103, + 12, 13, 106, -1, 16, -1, 110, 111, 112, -1, + -1, 23, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 36, 37, -1, 39, 40, 41, + 42, 43, 44, 45, 46, 47, -1, 49, -1, -1, + -1, -1, -1, -1, 56, 57, -1, 59, -1, 61, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 79, -1, -1, + -1, -1, -1, -1, -1, 87, 88, 89, 90, 91, + 92, -1, 94, -1, 96, -1, 98, 99, -1, -1, + 102, 103, 12, 13, 106, -1, 16, -1, 110, 111, + 112, -1, -1, 23, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 36, 37, -1, 39, + 40, 41, 42, 43, 44, 45, 46, 47, -1, 49, + -1, -1, -1, -1, -1, -1, 56, 57, -1, 59, + -1, 61, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 79, + -1, -1, -1, -1, -1, -1, -1, 87, 88, 89, + 90, 91, 92, -1, 94, -1, 96, -1, 98, 99, + -1, -1, 102, 103, 12, 13, 106, -1, 16, -1, + 110, 111, 112, -1, -1, 23, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 36, 37, + -1, 39, 40, 41, 42, 43, 44, 45, 46, 47, + -1, 49, -1, -1, -1, -1, -1, -1, 56, 57, + -1, 59, -1, 61, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 79, -1, -1, -1, -1, -1, -1, -1, 87, + 88, 89, 90, 91, 92, -1, 94, -1, 96, -1, + 98, 99, -1, -1, 102, 103, -1, -1, 106, 12, + 13, 14, 110, 111, 112, -1, -1, -1, -1, -1, + 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 36, 37, -1, 39, 40, 41, 42, + 43, 44, 45, 46, 47, -1, 49, -1, -1, -1, + -1, -1, -1, 56, 57, -1, 59, -1, 61, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 79, -1, -1, -1, + -1, -1, -1, -1, 87, 88, 89, 90, 91, 92, + -1, 94, -1, 96, -1, 98, 99, -1, -1, 102, + 103, 12, 13, 106, -1, 16, -1, 110, 111, 112, + -1, -1, 23, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 36, 37, -1, 39, 40, + 41, 42, 43, 44, 45, 46, 47, -1, 49, -1, + -1, -1, -1, -1, -1, 56, 57, -1, 59, -1, + 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 79, -1, + -1, -1, -1, -1, -1, -1, 87, 88, 89, 90, + 91, 92, -1, 94, -1, 96, -1, 98, 99, -1, + -1, 102, 103, 12, 13, 106, -1, -1, -1, 110, + 111, 112, -1, -1, 23, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 36, 37, -1, + 39, 40, 41, 42, 43, 44, 45, 46, 47, -1, + 49, -1, -1, -1, -1, -1, -1, 56, 57, -1, + 59, -1, 61, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 79, -1, -1, -1, -1, -1, -1, -1, 87, 88, + 89, 90, 91, 92, -1, 94, -1, 96, -1, 98, + 99, -1, -1, 102, 103, 12, 13, 106, -1, -1, + -1, 110, 111, 112, -1, -1, 23, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 36, + -1, -1, 39, 40, 41, 42, 43, 44, 45, 46, + 47, -1, 49, -1, -1, -1, -1, -1, -1, 56, + 57, -1, 59, -1, 61, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 79, -1, -1, -1, -1, -1, -1, -1, + 87, 88, 89, 90, 91, 92, 12, 13, -1, 96, + -1, 98, 99, -1, -1, 102, 103, 23, -1, 106, + -1, -1, -1, 110, 111, 112, -1, -1, -1, -1, + -1, -1, -1, 39, 40, 41, 42, 43, 44, 45, + 46, 47, -1, 49, -1, -1, -1, -1, -1, -1, + 56, 57, -1, 59, -1, 61, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 79, -1, -1, -1, -1, -1, -1, + -1, 87, 88, 89, 90, 91, 92, 12, 13, -1, + 96, -1, 98, 99, -1, -1, 102, 103, 23, -1, + 106, -1, -1, -1, 110, 111, 112, -1, -1, -1, + -1, -1, -1, -1, 39, 40, 41, 42, 43, 44, + 45, 46, 47, -1, 49, -1, -1, -1, -1, -1, + -1, 56, 57, -1, 59, 12, 61, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 23, -1, -1, -1, + -1, -1, -1, -1, 79, -1, -1, -1, -1, 36, + 37, -1, 87, 88, 89, 90, 91, 92, 45, 46, + 47, -1, 49, 98, 99, -1, -1, 102, 103, 56, + 57, 106, 59, -1, 61, 110, 111, 112, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 79, -1, -1, -1, -1, -1, -1, -1, + 87, 88, 89, 90, 91, 92, 12, 94, 95, 96, + -1, 98, 99, -1, -1, 102, 103, 23, -1, 106, + -1, -1, -1, 110, 111, 112, -1, -1, -1, -1, + 36, 37, -1, -1, -1, -1, -1, -1, -1, 45, + 46, 47, -1, 49, -1, -1, -1, -1, -1, -1, + 56, 57, -1, 59, -1, 61, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 79, -1, -1, -1, -1, 12, -1, + -1, 87, 88, 89, 90, 91, 92, -1, 94, 23, + 96, -1, 98, 99, -1, -1, 102, 103, -1, -1, + 106, -1, 36, -1, 110, 111, 112, -1, -1, -1, + -1, 45, 46, 47, -1, 49, -1, -1, -1, -1, + -1, -1, 56, 57, -1, 59, 12, 61, -1, 15, + 16, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 79, -1, -1, -1, -1, + -1, -1, -1, 87, 88, 89, 90, 91, 92, -1, + 46, 47, 96, 49, 98, 99, -1, -1, 102, 103, + 56, 57, 106, 59, -1, 61, 110, 111, 112, -1, + -1, -1, -1, -1, 12, -1, -1, 15, 16, -1, + -1, -1, -1, 79, -1, -1, -1, -1, -1, -1, + -1, 87, 88, 89, 90, 91, 92, -1, -1, -1, + 96, -1, 98, 99, -1, -1, 102, 103, 46, 47, + 106, 49, -1, -1, 110, 111, 112, -1, 56, 57, + -1, 59, 12, 61, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 23, -1, -1, -1, -1, -1, -1, + -1, 79, -1, -1, -1, -1, -1, -1, -1, 87, + 88, 89, 90, 91, 92, 45, 46, 47, 96, 49, + 98, 99, -1, -1, 102, 103, 56, 57, 106, 59, + -1, 61, 110, 111, 112, -1, -1, -1, -1, -1, + 12, -1, -1, 15, -1, -1, -1, -1, -1, 79, + -1, -1, -1, -1, -1, -1, -1, 87, 88, 89, + 90, 91, 92, -1, -1, -1, 96, -1, 98, 99, + -1, -1, 102, 103, 46, 47, 106, 49, -1, -1, + 110, 111, 112, -1, 56, 57, -1, 59, 12, 61, + -1, 15, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 79, -1, -1, + -1, -1, -1, -1, -1, 87, 88, 89, 90, 91, + 92, -1, 46, 47, 96, 49, 98, 99, -1, -1, + 102, 103, 56, 57, 106, 59, -1, 61, 110, 111, + 112, -1, -1, -1, -1, -1, 12, -1, -1, 15, + -1, -1, -1, -1, -1, 79, -1, -1, -1, -1, + -1, -1, -1, 87, 88, 89, 90, 91, 92, -1, + -1, -1, 96, -1, 98, 99, -1, -1, 102, 103, + 46, 47, 106, 49, -1, -1, 110, 111, 112, -1, + 56, 57, -1, 59, 12, 61, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 79, -1, -1, -1, -1, -1, -1, + -1, 87, 88, 89, 90, 91, 92, -1, 46, 47, + 96, 49, 98, 99, -1, -1, 102, 103, 56, 57, + 106, 59, -1, 61, 110, 111, 112, -1, -1, -1, + -1, -1, 70, -1, -1, -1, -1, -1, -1, -1, + -1, 79, 12, -1, -1, 15, -1, -1, -1, 87, + 88, 89, 90, 91, 92, -1, -1, -1, 96, -1, + 98, 99, -1, -1, 102, 103, -1, -1, 106, -1, + -1, -1, 110, 111, 112, -1, 46, 47, -1, 49, + -1, -1, -1, -1, -1, -1, 56, 57, -1, 59, + 12, 61, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 23, -1, -1, -1, -1, -1, -1, -1, 79, + -1, -1, -1, -1, -1, -1, -1, 87, 88, 89, + 90, 91, 92, 45, 46, 47, 96, 49, 98, 99, + -1, -1, 102, 103, 56, 57, 106, 59, 12, 61, + 110, 111, 112, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 79, -1, -1, + -1, -1, -1, -1, -1, 87, 88, 89, 90, 91, + 92, -1, 46, 47, -1, 49, 98, 99, -1, -1, + 102, 103, 56, 57, 106, 59, -1, 61, 110, 111, + 112, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 79, -1, -1, -1, -1, + -1, -1, -1, 87, 88, 89, 90, 91, 92, -1, + -1, -1, 96, -1, 98, 99, -1, -1, 102, 103, + -1, -1, 106, -1, -1, -1, 110, 111, 112 +}; + +/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + state STATE-NUM. */ +static const yytype_uint8 yystos[] = +{ + 0, 1, 9, 14, 115, 130, 132, 144, 0, 7, + 8, 11, 12, 15, 46, 47, 49, 55, 56, 57, + 59, 61, 79, 87, 88, 89, 90, 91, 92, 96, + 98, 99, 102, 103, 106, 110, 111, 112, 127, 133, + 134, 136, 139, 146, 147, 157, 158, 159, 160, 162, + 9, 14, 127, 127, 139, 140, 148, 12, 12, 106, + 159, 160, 87, 90, 125, 12, 12, 12, 12, 43, + 160, 12, 12, 159, 159, 146, 159, 160, 160, 159, + 1, 9, 14, 48, 50, 51, 52, 53, 54, 58, + 62, 63, 77, 78, 97, 100, 119, 121, 126, 127, + 139, 143, 150, 152, 156, 163, 10, 127, 130, 13, + 23, 36, 37, 39, 40, 41, 42, 43, 44, 45, + 94, 116, 117, 159, 12, 92, 15, 102, 103, 104, + 105, 109, 70, 110, 111, 18, 156, 156, 10, 16, + 118, 16, 118, 93, 16, 137, 139, 139, 12, 139, + 139, 137, 16, 137, 159, 43, 139, 139, 9, 128, + 129, 14, 128, 151, 151, 162, 139, 151, 12, 12, + 151, 151, 139, 151, 12, 9, 153, 152, 156, 12, + 138, 141, 142, 146, 159, 160, 151, 17, 152, 155, + 129, 156, 134, 96, 139, 147, 139, 139, 139, 139, + 139, 139, 162, 139, 9, 139, 9, 139, 139, 147, + 70, 159, 159, 159, 159, 159, 159, 139, 137, 17, + 17, 9, 139, 45, 139, 15, 16, 118, 87, 161, + 118, 118, 16, 16, 159, 118, 118, 9, 129, 18, + 151, 131, 150, 162, 139, 151, 139, 152, 80, 120, + 17, 145, 140, 23, 45, 94, 116, 117, 159, 118, + 13, 38, 41, 70, 152, 133, 17, 160, 95, 118, + 118, 159, 19, 162, 139, 16, 118, 149, 139, 147, + 139, 147, 162, 139, 137, 14, 45, 149, 149, 154, + 9, 152, 9, 16, 12, 138, 147, 162, 138, 138, + 138, 138, 159, 159, 159, 138, 127, 139, 139, 139, + 87, 9, 135, 16, 16, 16, 16, 16, 118, 16, + 118, 19, 14, 129, 162, 100, 45, 140, 95, 156, + 16, 118, 16, 118, 127, 139, 147, 139, 129, 139, + 149, 12, 162, 16, 138, 17, 160, 160, 156, 16, + 16, 16, 131, 14, 124, 139, 16, 16, 17, 149, + 129, 152, 16, 123, 131, 151, 152, 149, 122, 152 +}; + +/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ +static const yytype_uint8 yyr1[] = +{ + 0, 114, 115, 115, 116, 116, 117, 117, 118, 118, + 119, 119, 120, 120, 122, 121, 123, 121, 124, 121, + 125, 125, 126, 127, 127, 128, 128, 129, 129, 130, + 130, 131, 131, 132, 132, 133, 134, 134, 134, 134, + 134, 134, 134, 135, 134, 136, 136, 137, 137, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 140, + 140, 141, 141, 142, 142, 142, 143, 143, 144, 144, + 144, 144, 145, 145, 146, 146, 148, 147, 149, 149, + 150, 150, 150, 150, 150, 150, 150, 150, 151, 151, + 152, 152, 153, 154, 152, 152, 152, 152, 152, 152, + 152, 152, 152, 152, 152, 152, 155, 152, 152, 156, + 156, 157, 157, 158, 158, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 160, 160, 160, + 160, 161, 161, 161, 162, 162, 162, 163 +}; + +/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ +static const yytype_int8 yyr2[] = +{ + 0, 2, 1, 1, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 0, 12, 0, 10, 0, 8, + 1, 1, 4, 1, 2, 1, 2, 0, 1, 0, + 1, 0, 1, 1, 3, 1, 1, 4, 4, 7, + 3, 4, 4, 0, 9, 1, 3, 1, 3, 3, + 5, 3, 3, 3, 3, 3, 5, 2, 1, 1, + 3, 5, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 5, 4, 3, 2, 1, 1, 3, + 3, 1, 3, 0, 1, 3, 1, 1, 1, 1, + 2, 2, 1, 2, 1, 2, 0, 4, 1, 2, + 4, 4, 4, 2, 5, 2, 1, 1, 1, 2, + 2, 2, 0, 0, 9, 3, 2, 1, 4, 2, + 3, 2, 2, 3, 2, 2, 0, 3, 2, 1, + 2, 1, 1, 1, 2, 4, 3, 3, 3, 3, + 3, 3, 2, 2, 2, 3, 4, 1, 3, 4, + 2, 2, 2, 2, 2, 4, 3, 2, 1, 6, + 6, 3, 6, 6, 1, 8, 8, 6, 4, 1, + 6, 6, 8, 8, 8, 6, 1, 1, 4, 1, + 2, 0, 1, 3, 1, 1, 1, 4 +}; + + +enum { YYENOMEM = -2 }; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab +#define YYNOMEM goto yyexhaustedlab + + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ + do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ + while (0) + +/* Backward compatibility with an undocumented macro. + Use YYerror or YYUNDEF. */ +#define YYERRCODE YYUNDEF + + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + + + + +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Kind, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + + +/*-----------------------------------. +| Print this symbol's value on YYO. | +`-----------------------------------*/ + +static void +yy_symbol_value_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) +{ + FILE *yyoutput = yyo; + YY_USE (yyoutput); + if (!yyvaluep) + return; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YY_USE (yykind); + YY_IGNORE_MAYBE_UNINITIALIZED_END +} + + +/*---------------------------. +| Print this symbol on YYO. | +`---------------------------*/ + +static void +yy_symbol_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) +{ + YYFPRINTF (yyo, "%s %s (", + yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); + + yy_symbol_value_print (yyo, yykind, yyvaluep); + YYFPRINTF (yyo, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +static void +yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +static void +yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, + int yyrule) +{ + int yylno = yyrline[yyrule]; + int yynrhs = yyr2[yyrule]; + int yyi; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, + YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), + &yyvsp[(yyi + 1) - (yynrhs)]); + YYFPRINTF (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule); \ +} while (0) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ int yydebug; -int yynerrs; -int yyerrflag; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) ((void) 0) +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + + + + + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +static void +yydestruct (const char *yymsg, + yysymbol_kind_t yykind, YYSTYPE *yyvaluep) +{ + YY_USE (yyvaluep); + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YY_USE (yykind); + YY_IGNORE_MAYBE_UNINITIALIZED_END +} + + +/* Lookahead token kind. */ int yychar; -short *yyssp; -YYSTYPE *yyvsp; -YYSTYPE yyval; + +/* The semantic value of the lookahead symbol. */ YYSTYPE yylval; -short *yyss; -short *yysslim; -YYSTYPE *yyvs; -unsigned int yystacksize; -int yyparse(void); -#line 452 "awkgram.y" +/* Number of syntax errors so far. */ +int yynerrs; + + + + +/*----------. +| yyparse. | +`----------*/ + +int +yyparse (void) +{ + yy_state_fast_t yystate = 0; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus = 0; + + /* Refer to the stacks through separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* Their size. */ + YYPTRDIFF_T yystacksize = YYINITDEPTH; + + /* The state stack: array, bottom, top. */ + yy_state_t yyssa[YYINITDEPTH]; + yy_state_t *yyss = yyssa; + yy_state_t *yyssp = yyss; + + /* The semantic value stack: array, bottom, top. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp = yyvs; + + int yyn; + /* The return value of yyparse. */ + int yyresult; + /* Lookahead symbol kind. */ + yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yychar = YYEMPTY; /* Cause a token to be read. */ + + goto yysetstate; + + +/*------------------------------------------------------------. +| yynewstate -- push a new state, which is found in yystate. | +`------------------------------------------------------------*/ +yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + +/*--------------------------------------------------------------------. +| yysetstate -- set current state (the top of the stack) to yystate. | +`--------------------------------------------------------------------*/ +yysetstate: + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + YY_ASSERT (0 <= yystate && yystate < YYNSTATES); + YY_IGNORE_USELESS_CAST_BEGIN + *yyssp = YY_CAST (yy_state_t, yystate); + YY_IGNORE_USELESS_CAST_END + YY_STACK_PRINT (yyss, yyssp); + + if (yyss + yystacksize - 1 <= yyssp) +#if !defined yyoverflow && !defined YYSTACK_RELOCATE + YYNOMEM; +#else + { + /* Get the current used size of the three stacks, in elements. */ + YYPTRDIFF_T yysize = yyssp - yyss + 1; + +# if defined yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + yy_state_t *yyss1 = yyss; + YYSTYPE *yyvs1 = yyvs; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * YYSIZEOF (*yyssp), + &yyvs1, yysize * YYSIZEOF (*yyvsp), + &yystacksize); + yyss = yyss1; + yyvs = yyvs1; + } +# else /* defined YYSTACK_RELOCATE */ + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + YYNOMEM; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yy_state_t *yyss1 = yyss; + union yyalloc *yyptr = + YY_CAST (union yyalloc *, + YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); + if (! yyptr) + YYNOMEM; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + YY_IGNORE_USELESS_CAST_BEGIN + YYDPRINTF ((stderr, "Stack size increased to %ld\n", + YY_CAST (long, yystacksize))); + YY_IGNORE_USELESS_CAST_END + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } +#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ + + + if (yystate == YYFINAL) + YYACCEPT; + + goto yybackup; + + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yypact_value_is_default (yyn)) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token\n")); + yychar = yylex (); + } + + if (yychar <= YYEOF) + { + yychar = YYEOF; + yytoken = YYSYMBOL_YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else if (yychar == YYerror) + { + /* The scanner already issued an error message, process directly + to error recovery. But do not keep the error token as + lookahead, it is too special and may lead us to an endless + loop in error recovery. */ + yychar = YYUNDEF; + yytoken = YYSYMBOL_YYerror; + goto yyerrlab1; + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yytable_value_is_error (yyn)) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + + /* Discard the shifted token. */ + yychar = YYEMPTY; + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + '$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 2: /* program: pas */ +#line 99 "awkgram.y" + { if (errorflag==0) + winner = (Node *)stat3(PROGRAM, beginloc, (yyvsp[0].p), endloc); } +#line 2343 "awkgram.tab.c" + break; + + case 3: /* program: error */ +#line 101 "awkgram.y" + { yyclearin; bracecheck(); SYNTAX("bailing out"); } +#line 2349 "awkgram.tab.c" + break; + + case 14: /* $@1: %empty */ +#line 125 "awkgram.y" + {inloop++;} +#line 2355 "awkgram.tab.c" + break; + + case 15: /* for: FOR '(' opt_simple_stmt ';' opt_nl pattern ';' opt_nl opt_simple_stmt rparen $@1 stmt */ +#line 126 "awkgram.y" + { --inloop; (yyval.p) = stat4(FOR, (yyvsp[-9].p), notnull((yyvsp[-6].p)), (yyvsp[-3].p), (yyvsp[0].p)); } +#line 2361 "awkgram.tab.c" + break; + + case 16: /* $@2: %empty */ +#line 127 "awkgram.y" + {inloop++;} +#line 2367 "awkgram.tab.c" + break; + + case 17: /* for: FOR '(' opt_simple_stmt ';' ';' opt_nl opt_simple_stmt rparen $@2 stmt */ +#line 128 "awkgram.y" + { --inloop; (yyval.p) = stat4(FOR, (yyvsp[-7].p), NIL, (yyvsp[-3].p), (yyvsp[0].p)); } +#line 2373 "awkgram.tab.c" + break; + + case 18: /* $@3: %empty */ +#line 129 "awkgram.y" + {inloop++;} +#line 2379 "awkgram.tab.c" + break; + + case 19: /* for: FOR '(' varname IN varname rparen $@3 stmt */ +#line 130 "awkgram.y" + { --inloop; (yyval.p) = stat3(IN, (yyvsp[-5].p), makearr((yyvsp[-3].p)), (yyvsp[0].p)); } +#line 2385 "awkgram.tab.c" + break; + + case 20: /* funcname: VAR */ +#line 134 "awkgram.y" + { setfname((yyvsp[0].cp)); } +#line 2391 "awkgram.tab.c" + break; + + case 21: /* funcname: CALL */ +#line 135 "awkgram.y" + { setfname((yyvsp[0].cp)); } +#line 2397 "awkgram.tab.c" + break; + + case 22: /* if: IF '(' pattern rparen */ +#line 139 "awkgram.y" + { (yyval.p) = notnull((yyvsp[-1].p)); } +#line 2403 "awkgram.tab.c" + break; + + case 27: /* opt_nl: %empty */ +#line 151 "awkgram.y" + { (yyval.i) = 0; } +#line 2409 "awkgram.tab.c" + break; + + case 29: /* opt_pst: %empty */ +#line 156 "awkgram.y" + { (yyval.i) = 0; } +#line 2415 "awkgram.tab.c" + break; + + case 31: /* opt_simple_stmt: %empty */ +#line 162 "awkgram.y" + { (yyval.p) = 0; } +#line 2421 "awkgram.tab.c" + break; + + case 33: /* pas: opt_pst */ +#line 167 "awkgram.y" + { (yyval.p) = 0; } +#line 2427 "awkgram.tab.c" + break; + + case 34: /* pas: opt_pst pa_stats opt_pst */ +#line 168 "awkgram.y" + { (yyval.p) = (yyvsp[-1].p); } +#line 2433 "awkgram.tab.c" + break; + + case 35: /* pa_pat: pattern */ +#line 172 "awkgram.y" + { (yyval.p) = notnull((yyvsp[0].p)); } +#line 2439 "awkgram.tab.c" + break; + + case 36: /* pa_stat: pa_pat */ +#line 176 "awkgram.y" + { (yyval.p) = stat2(PASTAT, (yyvsp[0].p), stat2(PRINT, rectonode(), NIL)); } +#line 2445 "awkgram.tab.c" + break; + + case 37: /* pa_stat: pa_pat lbrace stmtlist '}' */ +#line 177 "awkgram.y" + { (yyval.p) = stat2(PASTAT, (yyvsp[-3].p), (yyvsp[-1].p)); } +#line 2451 "awkgram.tab.c" + break; + + case 38: /* pa_stat: pa_pat ',' opt_nl pa_pat */ +#line 178 "awkgram.y" + { (yyval.p) = pa2stat((yyvsp[-3].p), (yyvsp[0].p), stat2(PRINT, rectonode(), NIL)); } +#line 2457 "awkgram.tab.c" + break; + + case 39: /* pa_stat: pa_pat ',' opt_nl pa_pat lbrace stmtlist '}' */ +#line 179 "awkgram.y" + { (yyval.p) = pa2stat((yyvsp[-6].p), (yyvsp[-3].p), (yyvsp[-1].p)); } +#line 2463 "awkgram.tab.c" + break; + + case 40: /* pa_stat: lbrace stmtlist '}' */ +#line 180 "awkgram.y" + { (yyval.p) = stat2(PASTAT, NIL, (yyvsp[-1].p)); } +#line 2469 "awkgram.tab.c" + break; + + case 41: /* pa_stat: XBEGIN lbrace stmtlist '}' */ +#line 182 "awkgram.y" + { beginloc = linkum(beginloc, (yyvsp[-1].p)); (yyval.p) = 0; } +#line 2475 "awkgram.tab.c" + break; + + case 42: /* pa_stat: XEND lbrace stmtlist '}' */ +#line 184 "awkgram.y" + { endloc = linkum(endloc, (yyvsp[-1].p)); (yyval.p) = 0; } +#line 2481 "awkgram.tab.c" + break; + + case 43: /* $@4: %empty */ +#line 185 "awkgram.y" + {infunc = true;} +#line 2487 "awkgram.tab.c" + break; + + case 44: /* pa_stat: FUNC funcname '(' varlist rparen $@4 lbrace stmtlist '}' */ +#line 186 "awkgram.y" + { infunc = false; curfname=0; defn((Cell *)(yyvsp[-7].p), (yyvsp[-5].p), (yyvsp[-1].p)); (yyval.p) = 0; } +#line 2493 "awkgram.tab.c" + break; + + case 46: /* pa_stats: pa_stats opt_pst pa_stat */ +#line 191 "awkgram.y" + { (yyval.p) = linkum((yyvsp[-2].p), (yyvsp[0].p)); } +#line 2499 "awkgram.tab.c" + break; + + case 48: /* patlist: patlist comma pattern */ +#line 196 "awkgram.y" + { (yyval.p) = linkum((yyvsp[-2].p), (yyvsp[0].p)); } +#line 2505 "awkgram.tab.c" + break; + + case 49: /* ppattern: var ASGNOP ppattern */ +#line 200 "awkgram.y" + { (yyval.p) = op2((yyvsp[-1].i), (yyvsp[-2].p), (yyvsp[0].p)); } +#line 2511 "awkgram.tab.c" + break; + + case 50: /* ppattern: ppattern '?' ppattern ':' ppattern */ +#line 202 "awkgram.y" + { (yyval.p) = op3(CONDEXPR, notnull((yyvsp[-4].p)), (yyvsp[-2].p), (yyvsp[0].p)); } +#line 2517 "awkgram.tab.c" + break; + + case 51: /* ppattern: ppattern bor ppattern */ +#line 204 "awkgram.y" + { (yyval.p) = op2(BOR, notnull((yyvsp[-2].p)), notnull((yyvsp[0].p))); } +#line 2523 "awkgram.tab.c" + break; + + case 52: /* ppattern: ppattern and ppattern */ +#line 206 "awkgram.y" + { (yyval.p) = op2(AND, notnull((yyvsp[-2].p)), notnull((yyvsp[0].p))); } +#line 2529 "awkgram.tab.c" + break; + + case 53: /* ppattern: ppattern MATCHOP reg_expr */ +#line 207 "awkgram.y" + { (yyval.p) = op3((yyvsp[-1].i), NIL, (yyvsp[-2].p), (Node*)makedfa((yyvsp[0].s), 0)); free((yyvsp[0].s)); } +#line 2535 "awkgram.tab.c" + break; + + case 54: /* ppattern: ppattern MATCHOP ppattern */ +#line 209 "awkgram.y" + { if (constnode((yyvsp[0].p))) { + (yyval.p) = op3((yyvsp[-1].i), NIL, (yyvsp[-2].p), (Node*)makedfa(strnode((yyvsp[0].p)), 0)); + free((yyvsp[0].p)); + } else + (yyval.p) = op3((yyvsp[-1].i), (Node *)1, (yyvsp[-2].p), (yyvsp[0].p)); } +#line 2545 "awkgram.tab.c" + break; + + case 55: /* ppattern: ppattern IN varname */ +#line 214 "awkgram.y" + { (yyval.p) = op2(INTEST, (yyvsp[-2].p), makearr((yyvsp[0].p))); } +#line 2551 "awkgram.tab.c" + break; + + case 56: /* ppattern: '(' plist ')' IN varname */ +#line 215 "awkgram.y" + { (yyval.p) = op2(INTEST, (yyvsp[-3].p), makearr((yyvsp[0].p))); } +#line 2557 "awkgram.tab.c" + break; + + case 57: /* ppattern: ppattern term */ +#line 216 "awkgram.y" + { (yyval.p) = op2(CAT, (yyvsp[-1].p), (yyvsp[0].p)); } +#line 2563 "awkgram.tab.c" + break; + + case 60: /* pattern: var ASGNOP pattern */ +#line 222 "awkgram.y" + { (yyval.p) = op2((yyvsp[-1].i), (yyvsp[-2].p), (yyvsp[0].p)); } +#line 2569 "awkgram.tab.c" + break; + + case 61: /* pattern: pattern '?' pattern ':' pattern */ +#line 224 "awkgram.y" + { (yyval.p) = op3(CONDEXPR, notnull((yyvsp[-4].p)), (yyvsp[-2].p), (yyvsp[0].p)); } +#line 2575 "awkgram.tab.c" + break; + + case 62: /* pattern: pattern bor pattern */ +#line 226 "awkgram.y" + { (yyval.p) = op2(BOR, notnull((yyvsp[-2].p)), notnull((yyvsp[0].p))); } +#line 2581 "awkgram.tab.c" + break; + + case 63: /* pattern: pattern and pattern */ +#line 228 "awkgram.y" + { (yyval.p) = op2(AND, notnull((yyvsp[-2].p)), notnull((yyvsp[0].p))); } +#line 2587 "awkgram.tab.c" + break; + + case 64: /* pattern: pattern EQ pattern */ +#line 229 "awkgram.y" + { (yyval.p) = op2((yyvsp[-1].i), (yyvsp[-2].p), (yyvsp[0].p)); } +#line 2593 "awkgram.tab.c" + break; + + case 65: /* pattern: pattern GE pattern */ +#line 230 "awkgram.y" + { (yyval.p) = op2((yyvsp[-1].i), (yyvsp[-2].p), (yyvsp[0].p)); } +#line 2599 "awkgram.tab.c" + break; + + case 66: /* pattern: pattern GT pattern */ +#line 231 "awkgram.y" + { (yyval.p) = op2((yyvsp[-1].i), (yyvsp[-2].p), (yyvsp[0].p)); } +#line 2605 "awkgram.tab.c" + break; + + case 67: /* pattern: pattern LE pattern */ +#line 232 "awkgram.y" + { (yyval.p) = op2((yyvsp[-1].i), (yyvsp[-2].p), (yyvsp[0].p)); } +#line 2611 "awkgram.tab.c" + break; + + case 68: /* pattern: pattern LT pattern */ +#line 233 "awkgram.y" + { (yyval.p) = op2((yyvsp[-1].i), (yyvsp[-2].p), (yyvsp[0].p)); } +#line 2617 "awkgram.tab.c" + break; + + case 69: /* pattern: pattern NE pattern */ +#line 234 "awkgram.y" + { (yyval.p) = op2((yyvsp[-1].i), (yyvsp[-2].p), (yyvsp[0].p)); } +#line 2623 "awkgram.tab.c" + break; + + case 70: /* pattern: pattern MATCHOP reg_expr */ +#line 235 "awkgram.y" + { (yyval.p) = op3((yyvsp[-1].i), NIL, (yyvsp[-2].p), (Node*)makedfa((yyvsp[0].s), 0)); free((yyvsp[0].s)); } +#line 2629 "awkgram.tab.c" + break; + + case 71: /* pattern: pattern MATCHOP pattern */ +#line 237 "awkgram.y" + { if (constnode((yyvsp[0].p))) { + (yyval.p) = op3((yyvsp[-1].i), NIL, (yyvsp[-2].p), (Node*)makedfa(strnode((yyvsp[0].p)), 0)); + free((yyvsp[0].p)); + } else + (yyval.p) = op3((yyvsp[-1].i), (Node *)1, (yyvsp[-2].p), (yyvsp[0].p)); } +#line 2639 "awkgram.tab.c" + break; + + case 72: /* pattern: pattern IN varname */ +#line 242 "awkgram.y" + { (yyval.p) = op2(INTEST, (yyvsp[-2].p), makearr((yyvsp[0].p))); } +#line 2645 "awkgram.tab.c" + break; + + case 73: /* pattern: '(' plist ')' IN varname */ +#line 243 "awkgram.y" + { (yyval.p) = op2(INTEST, (yyvsp[-3].p), makearr((yyvsp[0].p))); } +#line 2651 "awkgram.tab.c" + break; + + case 74: /* pattern: pattern '|' GETLINE var */ +#line 244 "awkgram.y" + { + if (safe) SYNTAX("cmd | getline is unsafe"); + else (yyval.p) = op3(GETLINE, (yyvsp[0].p), itonp((yyvsp[-2].i)), (yyvsp[-3].p)); } +#line 2659 "awkgram.tab.c" + break; + + case 75: /* pattern: pattern '|' GETLINE */ +#line 247 "awkgram.y" + { + if (safe) SYNTAX("cmd | getline is unsafe"); + else (yyval.p) = op3(GETLINE, (Node*)0, itonp((yyvsp[-1].i)), (yyvsp[-2].p)); } +#line 2667 "awkgram.tab.c" + break; + + case 76: /* pattern: pattern term */ +#line 250 "awkgram.y" + { (yyval.p) = op2(CAT, (yyvsp[-1].p), (yyvsp[0].p)); } +#line 2673 "awkgram.tab.c" + break; + + case 79: /* plist: pattern comma pattern */ +#line 256 "awkgram.y" + { (yyval.p) = linkum((yyvsp[-2].p), (yyvsp[0].p)); } +#line 2679 "awkgram.tab.c" + break; + + case 80: /* plist: plist comma pattern */ +#line 257 "awkgram.y" + { (yyval.p) = linkum((yyvsp[-2].p), (yyvsp[0].p)); } +#line 2685 "awkgram.tab.c" + break; + + case 82: /* pplist: pplist comma ppattern */ +#line 262 "awkgram.y" + { (yyval.p) = linkum((yyvsp[-2].p), (yyvsp[0].p)); } +#line 2691 "awkgram.tab.c" + break; + + case 83: /* prarg: %empty */ +#line 266 "awkgram.y" + { (yyval.p) = rectonode(); } +#line 2697 "awkgram.tab.c" + break; + + case 85: /* prarg: '(' plist ')' */ +#line 268 "awkgram.y" + { (yyval.p) = (yyvsp[-1].p); } +#line 2703 "awkgram.tab.c" + break; + + case 94: /* re: reg_expr */ +#line 285 "awkgram.y" + { (yyval.p) = op3(MATCH, NIL, rectonode(), (Node*)makedfa((yyvsp[0].s), 0)); free((yyvsp[0].s)); } +#line 2709 "awkgram.tab.c" + break; + + case 95: /* re: NOT re */ +#line 286 "awkgram.y" + { (yyval.p) = op1(NOT, notnull((yyvsp[0].p))); } +#line 2715 "awkgram.tab.c" + break; + + case 96: /* $@5: %empty */ +#line 290 "awkgram.y" + {startreg();} +#line 2721 "awkgram.tab.c" + break; + + case 97: /* reg_expr: '/' $@5 REGEXPR '/' */ +#line 290 "awkgram.y" + { (yyval.s) = (yyvsp[-1].s); } +#line 2727 "awkgram.tab.c" + break; + + case 100: /* simple_stmt: print prarg '|' term */ +#line 298 "awkgram.y" + { + if (safe) SYNTAX("print | is unsafe"); + else (yyval.p) = stat3((yyvsp[-3].i), (yyvsp[-2].p), itonp((yyvsp[-1].i)), (yyvsp[0].p)); } +#line 2735 "awkgram.tab.c" + break; + + case 101: /* simple_stmt: print prarg APPEND term */ +#line 301 "awkgram.y" + { + if (safe) SYNTAX("print >> is unsafe"); + else (yyval.p) = stat3((yyvsp[-3].i), (yyvsp[-2].p), itonp((yyvsp[-1].i)), (yyvsp[0].p)); } +#line 2743 "awkgram.tab.c" + break; + + case 102: /* simple_stmt: print prarg GT term */ +#line 304 "awkgram.y" + { + if (safe) SYNTAX("print > is unsafe"); + else (yyval.p) = stat3((yyvsp[-3].i), (yyvsp[-2].p), itonp((yyvsp[-1].i)), (yyvsp[0].p)); } +#line 2751 "awkgram.tab.c" + break; + + case 103: /* simple_stmt: print prarg */ +#line 307 "awkgram.y" + { (yyval.p) = stat3((yyvsp[-1].i), (yyvsp[0].p), NIL, NIL); } +#line 2757 "awkgram.tab.c" + break; + + case 104: /* simple_stmt: DELETE varname '[' patlist ']' */ +#line 308 "awkgram.y" + { (yyval.p) = stat2(DELETE, makearr((yyvsp[-3].p)), (yyvsp[-1].p)); } +#line 2763 "awkgram.tab.c" + break; + + case 105: /* simple_stmt: DELETE varname */ +#line 309 "awkgram.y" + { (yyval.p) = stat2(DELETE, makearr((yyvsp[0].p)), 0); } +#line 2769 "awkgram.tab.c" + break; + + case 106: /* simple_stmt: pattern */ +#line 310 "awkgram.y" + { (yyval.p) = exptostat((yyvsp[0].p)); } +#line 2775 "awkgram.tab.c" + break; + + case 107: /* simple_stmt: error */ +#line 311 "awkgram.y" + { yyclearin; SYNTAX("illegal statement"); } +#line 2781 "awkgram.tab.c" + break; + + case 110: /* stmt: BREAK st */ +#line 320 "awkgram.y" + { if (!inloop) SYNTAX("break illegal outside of loops"); + (yyval.p) = stat1(BREAK, NIL); } +#line 2788 "awkgram.tab.c" + break; + + case 111: /* stmt: CONTINUE st */ +#line 322 "awkgram.y" + { if (!inloop) SYNTAX("continue illegal outside of loops"); + (yyval.p) = stat1(CONTINUE, NIL); } +#line 2795 "awkgram.tab.c" + break; + + case 112: /* $@6: %empty */ +#line 324 "awkgram.y" + {inloop++;} +#line 2801 "awkgram.tab.c" + break; + + case 113: /* $@7: %empty */ +#line 324 "awkgram.y" + {--inloop;} +#line 2807 "awkgram.tab.c" + break; + + case 114: /* stmt: do $@6 stmt $@7 WHILE '(' pattern ')' st */ +#line 325 "awkgram.y" + { (yyval.p) = stat2(DO, (yyvsp[-6].p), notnull((yyvsp[-2].p))); } +#line 2813 "awkgram.tab.c" + break; + + case 115: /* stmt: EXIT pattern st */ +#line 326 "awkgram.y" + { (yyval.p) = stat1(EXIT, (yyvsp[-1].p)); } +#line 2819 "awkgram.tab.c" + break; + + case 116: /* stmt: EXIT st */ +#line 327 "awkgram.y" + { (yyval.p) = stat1(EXIT, NIL); } +#line 2825 "awkgram.tab.c" + break; + + case 118: /* stmt: if stmt else stmt */ +#line 329 "awkgram.y" + { (yyval.p) = stat3(IF, (yyvsp[-3].p), (yyvsp[-2].p), (yyvsp[0].p)); } +#line 2831 "awkgram.tab.c" + break; + + case 119: /* stmt: if stmt */ +#line 330 "awkgram.y" + { (yyval.p) = stat3(IF, (yyvsp[-1].p), (yyvsp[0].p), NIL); } +#line 2837 "awkgram.tab.c" + break; + + case 120: /* stmt: lbrace stmtlist rbrace */ +#line 331 "awkgram.y" + { (yyval.p) = (yyvsp[-1].p); } +#line 2843 "awkgram.tab.c" + break; + + case 121: /* stmt: NEXT st */ +#line 332 "awkgram.y" + { if (infunc) + SYNTAX("next is illegal inside a function"); + (yyval.p) = stat1(NEXT, NIL); } +#line 2851 "awkgram.tab.c" + break; + + case 122: /* stmt: NEXTFILE st */ +#line 335 "awkgram.y" + { if (infunc) + SYNTAX("nextfile is illegal inside a function"); + (yyval.p) = stat1(NEXTFILE, NIL); } +#line 2859 "awkgram.tab.c" + break; + + case 123: /* stmt: RETURN pattern st */ +#line 338 "awkgram.y" + { (yyval.p) = stat1(RETURN, (yyvsp[-1].p)); } +#line 2865 "awkgram.tab.c" + break; + + case 124: /* stmt: RETURN st */ +#line 339 "awkgram.y" + { (yyval.p) = stat1(RETURN, NIL); } +#line 2871 "awkgram.tab.c" + break; + + case 126: /* $@8: %empty */ +#line 341 "awkgram.y" + {inloop++;} +#line 2877 "awkgram.tab.c" + break; + + case 127: /* stmt: while $@8 stmt */ +#line 341 "awkgram.y" + { --inloop; (yyval.p) = stat2(WHILE, (yyvsp[-2].p), (yyvsp[0].p)); } +#line 2883 "awkgram.tab.c" + break; + + case 128: /* stmt: ';' opt_nl */ +#line 342 "awkgram.y" + { (yyval.p) = 0; } +#line 2889 "awkgram.tab.c" + break; + + case 130: /* stmtlist: stmtlist stmt */ +#line 347 "awkgram.y" + { (yyval.p) = linkum((yyvsp[-1].p), (yyvsp[0].p)); } +#line 2895 "awkgram.tab.c" + break; + + case 134: /* string: string STRING */ +#line 356 "awkgram.y" + { (yyval.cp) = catstr((yyvsp[-1].cp), (yyvsp[0].cp)); } +#line 2901 "awkgram.tab.c" + break; + + case 135: /* term: term '/' ASGNOP term */ +#line 360 "awkgram.y" + { (yyval.p) = op2(DIVEQ, (yyvsp[-3].p), (yyvsp[0].p)); } +#line 2907 "awkgram.tab.c" + break; + + case 136: /* term: term '+' term */ +#line 361 "awkgram.y" + { (yyval.p) = op2(ADD, (yyvsp[-2].p), (yyvsp[0].p)); } +#line 2913 "awkgram.tab.c" + break; + + case 137: /* term: term '-' term */ +#line 362 "awkgram.y" + { (yyval.p) = op2(MINUS, (yyvsp[-2].p), (yyvsp[0].p)); } +#line 2919 "awkgram.tab.c" + break; + + case 138: /* term: term '*' term */ +#line 363 "awkgram.y" + { (yyval.p) = op2(MULT, (yyvsp[-2].p), (yyvsp[0].p)); } +#line 2925 "awkgram.tab.c" + break; + + case 139: /* term: term '/' term */ +#line 364 "awkgram.y" + { (yyval.p) = op2(DIVIDE, (yyvsp[-2].p), (yyvsp[0].p)); } +#line 2931 "awkgram.tab.c" + break; + + case 140: /* term: term '%' term */ +#line 365 "awkgram.y" + { (yyval.p) = op2(MOD, (yyvsp[-2].p), (yyvsp[0].p)); } +#line 2937 "awkgram.tab.c" + break; + + case 141: /* term: term POWER term */ +#line 366 "awkgram.y" + { (yyval.p) = op2(POWER, (yyvsp[-2].p), (yyvsp[0].p)); } +#line 2943 "awkgram.tab.c" + break; + + case 142: /* term: '-' term */ +#line 367 "awkgram.y" + { (yyval.p) = op1(UMINUS, (yyvsp[0].p)); } +#line 2949 "awkgram.tab.c" + break; + + case 143: /* term: '+' term */ +#line 368 "awkgram.y" + { (yyval.p) = op1(UPLUS, (yyvsp[0].p)); } +#line 2955 "awkgram.tab.c" + break; + + case 144: /* term: NOT term */ +#line 369 "awkgram.y" + { (yyval.p) = op1(NOT, notnull((yyvsp[0].p))); } +#line 2961 "awkgram.tab.c" + break; + + case 145: /* term: BLTIN '(' ')' */ +#line 370 "awkgram.y" + { (yyval.p) = op2(BLTIN, itonp((yyvsp[-2].i)), rectonode()); } +#line 2967 "awkgram.tab.c" + break; + + case 146: /* term: BLTIN '(' patlist ')' */ +#line 371 "awkgram.y" + { (yyval.p) = op2(BLTIN, itonp((yyvsp[-3].i)), (yyvsp[-1].p)); } +#line 2973 "awkgram.tab.c" + break; + + case 147: /* term: BLTIN */ +#line 372 "awkgram.y" + { (yyval.p) = op2(BLTIN, itonp((yyvsp[0].i)), rectonode()); } +#line 2979 "awkgram.tab.c" + break; + + case 148: /* term: CALL '(' ')' */ +#line 373 "awkgram.y" + { (yyval.p) = op2(CALL, celltonode((yyvsp[-2].cp),CVAR), NIL); } +#line 2985 "awkgram.tab.c" + break; + + case 149: /* term: CALL '(' patlist ')' */ +#line 374 "awkgram.y" + { (yyval.p) = op2(CALL, celltonode((yyvsp[-3].cp),CVAR), (yyvsp[-1].p)); } +#line 2991 "awkgram.tab.c" + break; + + case 150: /* term: CLOSE term */ +#line 375 "awkgram.y" + { (yyval.p) = op1(CLOSE, (yyvsp[0].p)); } +#line 2997 "awkgram.tab.c" + break; + + case 151: /* term: DECR var */ +#line 376 "awkgram.y" + { (yyval.p) = op1(PREDECR, (yyvsp[0].p)); } +#line 3003 "awkgram.tab.c" + break; + + case 152: /* term: INCR var */ +#line 377 "awkgram.y" + { (yyval.p) = op1(PREINCR, (yyvsp[0].p)); } +#line 3009 "awkgram.tab.c" + break; + + case 153: /* term: var DECR */ +#line 378 "awkgram.y" + { (yyval.p) = op1(POSTDECR, (yyvsp[-1].p)); } +#line 3015 "awkgram.tab.c" + break; + + case 154: /* term: var INCR */ +#line 379 "awkgram.y" + { (yyval.p) = op1(POSTINCR, (yyvsp[-1].p)); } +#line 3021 "awkgram.tab.c" + break; + + case 155: /* term: GETLINE var LT term */ +#line 380 "awkgram.y" + { (yyval.p) = op3(GETLINE, (yyvsp[-2].p), itonp((yyvsp[-1].i)), (yyvsp[0].p)); } +#line 3027 "awkgram.tab.c" + break; + + case 156: /* term: GETLINE LT term */ +#line 381 "awkgram.y" + { (yyval.p) = op3(GETLINE, NIL, itonp((yyvsp[-1].i)), (yyvsp[0].p)); } +#line 3033 "awkgram.tab.c" + break; + + case 157: /* term: GETLINE var */ +#line 382 "awkgram.y" + { (yyval.p) = op3(GETLINE, (yyvsp[0].p), NIL, NIL); } +#line 3039 "awkgram.tab.c" + break; + + case 158: /* term: GETLINE */ +#line 383 "awkgram.y" + { (yyval.p) = op3(GETLINE, NIL, NIL, NIL); } +#line 3045 "awkgram.tab.c" + break; + + case 159: /* term: INDEX '(' pattern comma pattern ')' */ +#line 385 "awkgram.y" + { (yyval.p) = op2(INDEX, (yyvsp[-3].p), (yyvsp[-1].p)); } +#line 3051 "awkgram.tab.c" + break; + + case 160: /* term: INDEX '(' pattern comma reg_expr ')' */ +#line 387 "awkgram.y" + { SYNTAX("index() doesn't permit regular expressions"); + (yyval.p) = op2(INDEX, (yyvsp[-3].p), (Node*)(yyvsp[-1].s)); } +#line 3058 "awkgram.tab.c" + break; + + case 161: /* term: '(' pattern ')' */ +#line 389 "awkgram.y" + { (yyval.p) = (yyvsp[-1].p); } +#line 3064 "awkgram.tab.c" + break; + + case 162: /* term: MATCHFCN '(' pattern comma reg_expr ')' */ +#line 391 "awkgram.y" + { (yyval.p) = op3(MATCHFCN, NIL, (yyvsp[-3].p), (Node*)makedfa((yyvsp[-1].s), 1)); free((yyvsp[-1].s)); } +#line 3070 "awkgram.tab.c" + break; + + case 163: /* term: MATCHFCN '(' pattern comma pattern ')' */ +#line 393 "awkgram.y" + { if (constnode((yyvsp[-1].p))) { + (yyval.p) = op3(MATCHFCN, NIL, (yyvsp[-3].p), (Node*)makedfa(strnode((yyvsp[-1].p)), 1)); + free((yyvsp[-1].p)); + } else + (yyval.p) = op3(MATCHFCN, (Node *)1, (yyvsp[-3].p), (yyvsp[-1].p)); } +#line 3080 "awkgram.tab.c" + break; + + case 164: /* term: NUMBER */ +#line 398 "awkgram.y" + { (yyval.p) = celltonode((yyvsp[0].cp), CCON); } +#line 3086 "awkgram.tab.c" + break; + + case 165: /* term: SPLIT '(' pattern comma varname comma pattern ')' */ +#line 400 "awkgram.y" + { (yyval.p) = op4(SPLIT, (yyvsp[-5].p), makearr((yyvsp[-3].p)), (yyvsp[-1].p), (Node*)STRING); } +#line 3092 "awkgram.tab.c" + break; + + case 166: /* term: SPLIT '(' pattern comma varname comma reg_expr ')' */ +#line 402 "awkgram.y" + { (yyval.p) = op4(SPLIT, (yyvsp[-5].p), makearr((yyvsp[-3].p)), (Node*)makedfa((yyvsp[-1].s), 1), (Node *)REGEXPR); free((yyvsp[-1].s)); } +#line 3098 "awkgram.tab.c" + break; + + case 167: /* term: SPLIT '(' pattern comma varname ')' */ +#line 404 "awkgram.y" + { (yyval.p) = op4(SPLIT, (yyvsp[-3].p), makearr((yyvsp[-1].p)), NIL, (Node*)STRING); } +#line 3104 "awkgram.tab.c" + break; + + case 168: /* term: SPRINTF '(' patlist ')' */ +#line 405 "awkgram.y" + { (yyval.p) = op1((yyvsp[-3].i), (yyvsp[-1].p)); } +#line 3110 "awkgram.tab.c" + break; + + case 169: /* term: string */ +#line 406 "awkgram.y" + { (yyval.p) = celltonode((yyvsp[0].cp), CCON); } +#line 3116 "awkgram.tab.c" + break; + + case 170: /* term: subop '(' reg_expr comma pattern ')' */ +#line 408 "awkgram.y" + { (yyval.p) = op4((yyvsp[-5].i), NIL, (Node*)makedfa((yyvsp[-3].s), 1), (yyvsp[-1].p), rectonode()); free((yyvsp[-3].s)); } +#line 3122 "awkgram.tab.c" + break; + + case 171: /* term: subop '(' pattern comma pattern ')' */ +#line 410 "awkgram.y" + { if (constnode((yyvsp[-3].p))) { + (yyval.p) = op4((yyvsp[-5].i), NIL, (Node*)makedfa(strnode((yyvsp[-3].p)), 1), (yyvsp[-1].p), rectonode()); + free((yyvsp[-3].p)); + } else + (yyval.p) = op4((yyvsp[-5].i), (Node *)1, (yyvsp[-3].p), (yyvsp[-1].p), rectonode()); } +#line 3132 "awkgram.tab.c" + break; + + case 172: /* term: subop '(' reg_expr comma pattern comma var ')' */ +#line 416 "awkgram.y" + { (yyval.p) = op4((yyvsp[-7].i), NIL, (Node*)makedfa((yyvsp[-5].s), 1), (yyvsp[-3].p), (yyvsp[-1].p)); free((yyvsp[-5].s)); } +#line 3138 "awkgram.tab.c" + break; + + case 173: /* term: subop '(' pattern comma pattern comma var ')' */ +#line 418 "awkgram.y" + { if (constnode((yyvsp[-5].p))) { + (yyval.p) = op4((yyvsp[-7].i), NIL, (Node*)makedfa(strnode((yyvsp[-5].p)), 1), (yyvsp[-3].p), (yyvsp[-1].p)); + free((yyvsp[-5].p)); + } else + (yyval.p) = op4((yyvsp[-7].i), (Node *)1, (yyvsp[-5].p), (yyvsp[-3].p), (yyvsp[-1].p)); } +#line 3148 "awkgram.tab.c" + break; + + case 174: /* term: SUBSTR '(' pattern comma pattern comma pattern ')' */ +#line 424 "awkgram.y" + { (yyval.p) = op3(SUBSTR, (yyvsp[-5].p), (yyvsp[-3].p), (yyvsp[-1].p)); } +#line 3154 "awkgram.tab.c" + break; + + case 175: /* term: SUBSTR '(' pattern comma pattern ')' */ +#line 426 "awkgram.y" + { (yyval.p) = op3(SUBSTR, (yyvsp[-3].p), (yyvsp[-1].p), NIL); } +#line 3160 "awkgram.tab.c" + break; + + case 178: /* var: varname '[' patlist ']' */ +#line 432 "awkgram.y" + { (yyval.p) = op2(ARRAY, makearr((yyvsp[-3].p)), (yyvsp[-1].p)); } +#line 3166 "awkgram.tab.c" + break; + + case 179: /* var: IVAR */ +#line 433 "awkgram.y" + { (yyval.p) = op1(INDIRECT, celltonode((yyvsp[0].cp), CVAR)); } +#line 3172 "awkgram.tab.c" + break; + + case 180: /* var: INDIRECT term */ +#line 434 "awkgram.y" + { (yyval.p) = op1(INDIRECT, (yyvsp[0].p)); } +#line 3178 "awkgram.tab.c" + break; + + case 181: /* varlist: %empty */ +#line 438 "awkgram.y" + { arglist = (yyval.p) = 0; } +#line 3184 "awkgram.tab.c" + break; + + case 182: /* varlist: VAR */ +#line 439 "awkgram.y" + { arglist = (yyval.p) = celltonode((yyvsp[0].cp),CVAR); } +#line 3190 "awkgram.tab.c" + break; + + case 183: /* varlist: varlist comma VAR */ +#line 440 "awkgram.y" + { + checkdup((yyvsp[-2].p), (yyvsp[0].cp)); + arglist = (yyval.p) = linkum((yyvsp[-2].p),celltonode((yyvsp[0].cp),CVAR)); } +#line 3198 "awkgram.tab.c" + break; + + case 184: /* varname: VAR */ +#line 446 "awkgram.y" + { (yyval.p) = celltonode((yyvsp[0].cp), CVAR); } +#line 3204 "awkgram.tab.c" + break; + + case 185: /* varname: ARG */ +#line 447 "awkgram.y" + { (yyval.p) = op1(ARG, itonp((yyvsp[0].i))); } +#line 3210 "awkgram.tab.c" + break; + + case 186: /* varname: VARNF */ +#line 448 "awkgram.y" + { (yyval.p) = op1(VARNF, (Node *) (yyvsp[0].cp)); } +#line 3216 "awkgram.tab.c" + break; + + case 187: /* while: WHILE '(' pattern rparen */ +#line 453 "awkgram.y" + { (yyval.p) = notnull((yyvsp[-1].p)); } +#line 3222 "awkgram.tab.c" + break; + + +#line 3226 "awkgram.tab.c" + + default: break; + } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ + YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + + *++yyvsp = yyval; + + /* Now 'shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + { + const int yylhs = yyr1[yyn] - YYNTOKENS; + const int yyi = yypgoto[yylhs] + *yyssp; + yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp + ? yytable[yyi] + : yydefgoto[yylhs]); + } + + goto yynewstate; + + +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ +yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; + yyerror (YY_("syntax error")); + } + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + /* Pacify compilers when the user code never invokes YYERROR and the + label yyerrorlab therefore never appears in user code. */ + if (0) + YYERROR; + ++yynerrs; + + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + /* Pop stack until we find a state that shifts the error token. */ + for (;;) + { + yyn = yypact[yystate]; + if (!yypact_value_is_default (yyn)) + { + yyn += YYSYMBOL_YYerror; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + YY_ACCESSING_SYMBOL (yystate), yyvsp); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturnlab; + + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturnlab; + + +/*-----------------------------------------------------------. +| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | +`-----------------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); + yyresult = 2; + goto yyreturnlab; + + +/*----------------------------------------------------------. +| yyreturnlab -- parsing is finished, clean up and return. | +`----------------------------------------------------------*/ +yyreturnlab: + if (yychar != YYEMPTY) + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + } + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + YY_ACCESSING_SYMBOL (+*yyssp), yyvsp); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif + + return yyresult; +} + +#line 456 "awkgram.y" + void setfname(Cell *p) { @@ -2510,867 +3405,3 @@ void checkdup(Node *vl, Cell *cp) /* check if name already in list */ } } } -#line 2508 "awkgram.tab.c" -/* allocate initial stack or double stack size, up to YYMAXDEPTH */ -static int yygrowstack(void) -{ - unsigned int newsize; - long sslen; - short *newss; - YYSTYPE *newvs; - - if ((newsize = yystacksize) == 0) - newsize = YYINITSTACKSIZE; - else if (newsize >= YYMAXDEPTH) - return -1; - else if ((newsize *= 2) > YYMAXDEPTH) - newsize = YYMAXDEPTH; - sslen = yyssp - yyss; -#ifdef SIZE_MAX -#define YY_SIZE_MAX SIZE_MAX -#else -#define YY_SIZE_MAX 0xffffffffU -#endif - if (newsize && YY_SIZE_MAX / newsize < sizeof *newss) - goto bail; - newss = yyss ? (short *)realloc(yyss, newsize * sizeof *newss) : - (short *)malloc(newsize * sizeof *newss); /* overflow check above */ - if (newss == NULL) - goto bail; - yyss = newss; - yyssp = newss + sslen; - if (newsize && YY_SIZE_MAX / newsize < sizeof *newvs) - goto bail; - newvs = yyvs ? (YYSTYPE *)realloc(yyvs, newsize * sizeof *newvs) : - (YYSTYPE *)malloc(newsize * sizeof *newvs); /* overflow check above */ - if (newvs == NULL) - goto bail; - yyvs = newvs; - yyvsp = newvs + sslen; - yystacksize = newsize; - yysslim = yyss + newsize - 1; - return 0; -bail: - if (yyss) - free(yyss); - if (yyvs) - free(yyvs); - yyss = yyssp = NULL; - yyvs = yyvsp = NULL; - yystacksize = 0; - return -1; -} - -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab -int -yyparse(void) -{ - int yym, yyn, yystate; -#if YYDEBUG - const char *yys; - - if ((yys = getenv("YYDEBUG"))) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif /* YYDEBUG */ - - yynerrs = 0; - yyerrflag = 0; - yychar = (-1); - - if (yyss == NULL && yygrowstack()) goto yyoverflow; - yyssp = yyss; - yyvsp = yyvs; - *yyssp = yystate = 0; - -yyloop: - if ((yyn = yydefred[yystate]) != 0) goto yyreduce; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yyssp >= yysslim && yygrowstack()) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - yychar = (-1); - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; -#if defined(__GNUC__) - goto yynewerror; -#endif -yynewerror: - yyerror("syntax error"); -#if defined(__GNUC__) - goto yyerrlab; -#endif -yyerrlab: - ++yynerrs; -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yyssp, yytable[yyn]); -#endif - if (yyssp >= yysslim && yygrowstack()) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yyssp); -#endif - if (yyssp <= yyss) goto yyabort; - --yyssp; - --yyvsp; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = (-1); - goto yyloop; - } -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - if (yym) - yyval = yyvsp[1-yym]; - else - memset(&yyval, 0, sizeof yyval); - switch (yyn) - { -case 1: -#line 99 "awkgram.y" -{ if (errorflag==0) - winner = (Node *)stat3(PROGRAM, beginloc, yyvsp[0].p, endloc); } -break; -case 2: -#line 101 "awkgram.y" -{ yyclearin; bracecheck(); SYNTAX("bailing out"); } -break; -case 13: -#line 125 "awkgram.y" -{inloop++;} -break; -case 14: -#line 126 "awkgram.y" -{ --inloop; yyval.p = stat4(FOR, yyvsp[-9].p, notnull(yyvsp[-6].p), yyvsp[-3].p, yyvsp[0].p); } -break; -case 15: -#line 127 "awkgram.y" -{inloop++;} -break; -case 16: -#line 128 "awkgram.y" -{ --inloop; yyval.p = stat4(FOR, yyvsp[-7].p, NIL, yyvsp[-3].p, yyvsp[0].p); } -break; -case 17: -#line 129 "awkgram.y" -{inloop++;} -break; -case 18: -#line 130 "awkgram.y" -{ --inloop; yyval.p = stat3(IN, yyvsp[-5].p, makearr(yyvsp[-3].p), yyvsp[0].p); } -break; -case 19: -#line 134 "awkgram.y" -{ setfname(yyvsp[0].cp); } -break; -case 20: -#line 135 "awkgram.y" -{ setfname(yyvsp[0].cp); } -break; -case 21: -#line 139 "awkgram.y" -{ yyval.p = notnull(yyvsp[-1].p); } -break; -case 26: -#line 151 "awkgram.y" -{ yyval.i = 0; } -break; -case 28: -#line 156 "awkgram.y" -{ yyval.i = 0; } -break; -case 30: -#line 162 "awkgram.y" -{ yyval.p = 0; } -break; -case 32: -#line 167 "awkgram.y" -{ yyval.p = 0; } -break; -case 33: -#line 168 "awkgram.y" -{ yyval.p = yyvsp[-1].p; } -break; -case 34: -#line 172 "awkgram.y" -{ yyval.p = notnull(yyvsp[0].p); } -break; -case 35: -#line 176 "awkgram.y" -{ yyval.p = stat2(PASTAT, yyvsp[0].p, stat2(PRINT, rectonode(), NIL)); } -break; -case 36: -#line 177 "awkgram.y" -{ yyval.p = stat2(PASTAT, yyvsp[-3].p, yyvsp[-1].p); } -break; -case 37: -#line 178 "awkgram.y" -{ yyval.p = pa2stat(yyvsp[-3].p, yyvsp[0].p, stat2(PRINT, rectonode(), NIL)); } -break; -case 38: -#line 179 "awkgram.y" -{ yyval.p = pa2stat(yyvsp[-6].p, yyvsp[-3].p, yyvsp[-1].p); } -break; -case 39: -#line 180 "awkgram.y" -{ yyval.p = stat2(PASTAT, NIL, yyvsp[-1].p); } -break; -case 40: -#line 182 "awkgram.y" -{ beginloc = linkum(beginloc, yyvsp[-1].p); yyval.p = 0; } -break; -case 41: -#line 184 "awkgram.y" -{ endloc = linkum(endloc, yyvsp[-1].p); yyval.p = 0; } -break; -case 42: -#line 185 "awkgram.y" -{infunc = true;} -break; -case 43: -#line 186 "awkgram.y" -{ infunc = false; curfname=0; defn((Cell *)yyvsp[-7].p, yyvsp[-5].p, yyvsp[-1].p); yyval.p = 0; } -break; -case 45: -#line 191 "awkgram.y" -{ yyval.p = linkum(yyvsp[-2].p, yyvsp[0].p); } -break; -case 47: -#line 196 "awkgram.y" -{ yyval.p = linkum(yyvsp[-2].p, yyvsp[0].p); } -break; -case 48: -#line 200 "awkgram.y" -{ yyval.p = op2(yyvsp[-1].i, yyvsp[-2].p, yyvsp[0].p); } -break; -case 49: -#line 202 "awkgram.y" -{ yyval.p = op3(CONDEXPR, notnull(yyvsp[-4].p), yyvsp[-2].p, yyvsp[0].p); } -break; -case 50: -#line 204 "awkgram.y" -{ yyval.p = op2(BOR, notnull(yyvsp[-2].p), notnull(yyvsp[0].p)); } -break; -case 51: -#line 206 "awkgram.y" -{ yyval.p = op2(AND, notnull(yyvsp[-2].p), notnull(yyvsp[0].p)); } -break; -case 52: -#line 207 "awkgram.y" -{ yyval.p = op3(yyvsp[-1].i, NIL, yyvsp[-2].p, (Node*)makedfa(yyvsp[0].s, 0)); } -break; -case 53: -#line 209 "awkgram.y" -{ if (constnode(yyvsp[0].p)) - yyval.p = op3(yyvsp[-1].i, NIL, yyvsp[-2].p, (Node*)makedfa(strnode(yyvsp[0].p), 0)); - else - yyval.p = op3(yyvsp[-1].i, (Node *)1, yyvsp[-2].p, yyvsp[0].p); } -break; -case 54: -#line 213 "awkgram.y" -{ yyval.p = op2(INTEST, yyvsp[-2].p, makearr(yyvsp[0].p)); } -break; -case 55: -#line 214 "awkgram.y" -{ yyval.p = op2(INTEST, yyvsp[-3].p, makearr(yyvsp[0].p)); } -break; -case 56: -#line 215 "awkgram.y" -{ yyval.p = op2(CAT, yyvsp[-1].p, yyvsp[0].p); } -break; -case 59: -#line 221 "awkgram.y" -{ yyval.p = op2(yyvsp[-1].i, yyvsp[-2].p, yyvsp[0].p); } -break; -case 60: -#line 223 "awkgram.y" -{ yyval.p = op3(CONDEXPR, notnull(yyvsp[-4].p), yyvsp[-2].p, yyvsp[0].p); } -break; -case 61: -#line 225 "awkgram.y" -{ yyval.p = op2(BOR, notnull(yyvsp[-2].p), notnull(yyvsp[0].p)); } -break; -case 62: -#line 227 "awkgram.y" -{ yyval.p = op2(AND, notnull(yyvsp[-2].p), notnull(yyvsp[0].p)); } -break; -case 63: -#line 228 "awkgram.y" -{ yyval.p = op2(yyvsp[-1].i, yyvsp[-2].p, yyvsp[0].p); } -break; -case 64: -#line 229 "awkgram.y" -{ yyval.p = op2(yyvsp[-1].i, yyvsp[-2].p, yyvsp[0].p); } -break; -case 65: -#line 230 "awkgram.y" -{ yyval.p = op2(yyvsp[-1].i, yyvsp[-2].p, yyvsp[0].p); } -break; -case 66: -#line 231 "awkgram.y" -{ yyval.p = op2(yyvsp[-1].i, yyvsp[-2].p, yyvsp[0].p); } -break; -case 67: -#line 232 "awkgram.y" -{ yyval.p = op2(yyvsp[-1].i, yyvsp[-2].p, yyvsp[0].p); } -break; -case 68: -#line 233 "awkgram.y" -{ yyval.p = op2(yyvsp[-1].i, yyvsp[-2].p, yyvsp[0].p); } -break; -case 69: -#line 234 "awkgram.y" -{ yyval.p = op3(yyvsp[-1].i, NIL, yyvsp[-2].p, (Node*)makedfa(yyvsp[0].s, 0)); } -break; -case 70: -#line 236 "awkgram.y" -{ if (constnode(yyvsp[0].p)) - yyval.p = op3(yyvsp[-1].i, NIL, yyvsp[-2].p, (Node*)makedfa(strnode(yyvsp[0].p), 0)); - else - yyval.p = op3(yyvsp[-1].i, (Node *)1, yyvsp[-2].p, yyvsp[0].p); } -break; -case 71: -#line 240 "awkgram.y" -{ yyval.p = op2(INTEST, yyvsp[-2].p, makearr(yyvsp[0].p)); } -break; -case 72: -#line 241 "awkgram.y" -{ yyval.p = op2(INTEST, yyvsp[-3].p, makearr(yyvsp[0].p)); } -break; -case 73: -#line 242 "awkgram.y" -{ - if (safe) SYNTAX("cmd | getline is unsafe"); - else yyval.p = op3(GETLINE, yyvsp[0].p, itonp(yyvsp[-2].i), yyvsp[-3].p); } -break; -case 74: -#line 245 "awkgram.y" -{ - if (safe) SYNTAX("cmd | getline is unsafe"); - else yyval.p = op3(GETLINE, (Node*)0, itonp(yyvsp[-1].i), yyvsp[-2].p); } -break; -case 75: -#line 248 "awkgram.y" -{ yyval.p = op2(CAT, yyvsp[-1].p, yyvsp[0].p); } -break; -case 78: -#line 254 "awkgram.y" -{ yyval.p = linkum(yyvsp[-2].p, yyvsp[0].p); } -break; -case 79: -#line 255 "awkgram.y" -{ yyval.p = linkum(yyvsp[-2].p, yyvsp[0].p); } -break; -case 81: -#line 260 "awkgram.y" -{ yyval.p = linkum(yyvsp[-2].p, yyvsp[0].p); } -break; -case 82: -#line 264 "awkgram.y" -{ yyval.p = rectonode(); } -break; -case 84: -#line 266 "awkgram.y" -{ yyval.p = yyvsp[-1].p; } -break; -case 93: -#line 283 "awkgram.y" -{ yyval.p = op3(MATCH, NIL, rectonode(), (Node*)makedfa(yyvsp[0].s, 0)); } -break; -case 94: -#line 284 "awkgram.y" -{ yyval.p = op1(NOT, notnull(yyvsp[0].p)); } -break; -case 95: -#line 288 "awkgram.y" -{startreg();} -break; -case 96: -#line 288 "awkgram.y" -{ yyval.s = yyvsp[-1].s; } -break; -case 99: -#line 296 "awkgram.y" -{ - if (safe) SYNTAX("print | is unsafe"); - else yyval.p = stat3(yyvsp[-3].i, yyvsp[-2].p, itonp(yyvsp[-1].i), yyvsp[0].p); } -break; -case 100: -#line 299 "awkgram.y" -{ - if (safe) SYNTAX("print >> is unsafe"); - else yyval.p = stat3(yyvsp[-3].i, yyvsp[-2].p, itonp(yyvsp[-1].i), yyvsp[0].p); } -break; -case 101: -#line 302 "awkgram.y" -{ - if (safe) SYNTAX("print > is unsafe"); - else yyval.p = stat3(yyvsp[-3].i, yyvsp[-2].p, itonp(yyvsp[-1].i), yyvsp[0].p); } -break; -case 102: -#line 305 "awkgram.y" -{ yyval.p = stat3(yyvsp[-1].i, yyvsp[0].p, NIL, NIL); } -break; -case 103: -#line 306 "awkgram.y" -{ yyval.p = stat2(DELETE, makearr(yyvsp[-3].p), yyvsp[-1].p); } -break; -case 104: -#line 307 "awkgram.y" -{ yyval.p = stat2(DELETE, makearr(yyvsp[0].p), 0); } -break; -case 105: -#line 308 "awkgram.y" -{ yyval.p = exptostat(yyvsp[0].p); } -break; -case 106: -#line 309 "awkgram.y" -{ yyclearin; SYNTAX("illegal statement"); } -break; -case 109: -#line 318 "awkgram.y" -{ if (!inloop) SYNTAX("break illegal outside of loops"); - yyval.p = stat1(BREAK, NIL); } -break; -case 110: -#line 320 "awkgram.y" -{ if (!inloop) SYNTAX("continue illegal outside of loops"); - yyval.p = stat1(CONTINUE, NIL); } -break; -case 111: -#line 322 "awkgram.y" -{inloop++;} -break; -case 112: -#line 322 "awkgram.y" -{--inloop;} -break; -case 113: -#line 323 "awkgram.y" -{ yyval.p = stat2(DO, yyvsp[-6].p, notnull(yyvsp[-2].p)); } -break; -case 114: -#line 324 "awkgram.y" -{ yyval.p = stat1(EXIT, yyvsp[-1].p); } -break; -case 115: -#line 325 "awkgram.y" -{ yyval.p = stat1(EXIT, NIL); } -break; -case 117: -#line 327 "awkgram.y" -{ yyval.p = stat3(IF, yyvsp[-3].p, yyvsp[-2].p, yyvsp[0].p); } -break; -case 118: -#line 328 "awkgram.y" -{ yyval.p = stat3(IF, yyvsp[-1].p, yyvsp[0].p, NIL); } -break; -case 119: -#line 329 "awkgram.y" -{ yyval.p = yyvsp[-1].p; } -break; -case 120: -#line 330 "awkgram.y" -{ if (infunc) - SYNTAX("next is illegal inside a function"); - yyval.p = stat1(NEXT, NIL); } -break; -case 121: -#line 333 "awkgram.y" -{ if (infunc) - SYNTAX("nextfile is illegal inside a function"); - yyval.p = stat1(NEXTFILE, NIL); } -break; -case 122: -#line 336 "awkgram.y" -{ yyval.p = stat1(RETURN, yyvsp[-1].p); } -break; -case 123: -#line 337 "awkgram.y" -{ yyval.p = stat1(RETURN, NIL); } -break; -case 125: -#line 339 "awkgram.y" -{inloop++;} -break; -case 126: -#line 339 "awkgram.y" -{ --inloop; yyval.p = stat2(WHILE, yyvsp[-2].p, yyvsp[0].p); } -break; -case 127: -#line 340 "awkgram.y" -{ yyval.p = 0; } -break; -case 129: -#line 345 "awkgram.y" -{ yyval.p = linkum(yyvsp[-1].p, yyvsp[0].p); } -break; -case 133: -#line 354 "awkgram.y" -{ yyval.cp = catstr(yyvsp[-1].cp, yyvsp[0].cp); } -break; -case 134: -#line 358 "awkgram.y" -{ yyval.p = op2(DIVEQ, yyvsp[-3].p, yyvsp[0].p); } -break; -case 135: -#line 359 "awkgram.y" -{ yyval.p = op2(ADD, yyvsp[-2].p, yyvsp[0].p); } -break; -case 136: -#line 360 "awkgram.y" -{ yyval.p = op2(MINUS, yyvsp[-2].p, yyvsp[0].p); } -break; -case 137: -#line 361 "awkgram.y" -{ yyval.p = op2(MULT, yyvsp[-2].p, yyvsp[0].p); } -break; -case 138: -#line 362 "awkgram.y" -{ yyval.p = op2(DIVIDE, yyvsp[-2].p, yyvsp[0].p); } -break; -case 139: -#line 363 "awkgram.y" -{ yyval.p = op2(MOD, yyvsp[-2].p, yyvsp[0].p); } -break; -case 140: -#line 364 "awkgram.y" -{ yyval.p = op2(POWER, yyvsp[-2].p, yyvsp[0].p); } -break; -case 141: -#line 365 "awkgram.y" -{ yyval.p = op1(UMINUS, yyvsp[0].p); } -break; -case 142: -#line 366 "awkgram.y" -{ yyval.p = op1(UPLUS, yyvsp[0].p); } -break; -case 143: -#line 367 "awkgram.y" -{ yyval.p = op1(NOT, notnull(yyvsp[0].p)); } -break; -case 144: -#line 368 "awkgram.y" -{ yyval.p = op2(BLTIN, itonp(yyvsp[-2].i), rectonode()); } -break; -case 145: -#line 369 "awkgram.y" -{ yyval.p = op2(BLTIN, itonp(yyvsp[-3].i), yyvsp[-1].p); } -break; -case 146: -#line 370 "awkgram.y" -{ yyval.p = op2(BLTIN, itonp(yyvsp[0].i), rectonode()); } -break; -case 147: -#line 371 "awkgram.y" -{ yyval.p = op2(CALL, celltonode(yyvsp[-2].cp,CVAR), NIL); } -break; -case 148: -#line 372 "awkgram.y" -{ yyval.p = op2(CALL, celltonode(yyvsp[-3].cp,CVAR), yyvsp[-1].p); } -break; -case 149: -#line 373 "awkgram.y" -{ yyval.p = op1(CLOSE, yyvsp[0].p); } -break; -case 150: -#line 374 "awkgram.y" -{ yyval.p = op1(PREDECR, yyvsp[0].p); } -break; -case 151: -#line 375 "awkgram.y" -{ yyval.p = op1(PREINCR, yyvsp[0].p); } -break; -case 152: -#line 376 "awkgram.y" -{ yyval.p = op1(POSTDECR, yyvsp[-1].p); } -break; -case 153: -#line 377 "awkgram.y" -{ yyval.p = op1(POSTINCR, yyvsp[-1].p); } -break; -case 154: -#line 378 "awkgram.y" -{ yyval.p = op3(GETLINE, yyvsp[-2].p, itonp(yyvsp[-1].i), yyvsp[0].p); } -break; -case 155: -#line 379 "awkgram.y" -{ yyval.p = op3(GETLINE, NIL, itonp(yyvsp[-1].i), yyvsp[0].p); } -break; -case 156: -#line 380 "awkgram.y" -{ yyval.p = op3(GETLINE, yyvsp[0].p, NIL, NIL); } -break; -case 157: -#line 381 "awkgram.y" -{ yyval.p = op3(GETLINE, NIL, NIL, NIL); } -break; -case 158: -#line 383 "awkgram.y" -{ yyval.p = op2(INDEX, yyvsp[-3].p, yyvsp[-1].p); } -break; -case 159: -#line 385 "awkgram.y" -{ SYNTAX("index() doesn't permit regular expressions"); - yyval.p = op2(INDEX, yyvsp[-3].p, (Node*)yyvsp[-1].s); } -break; -case 160: -#line 387 "awkgram.y" -{ yyval.p = yyvsp[-1].p; } -break; -case 161: -#line 389 "awkgram.y" -{ yyval.p = op3(MATCHFCN, NIL, yyvsp[-3].p, (Node*)makedfa(yyvsp[-1].s, 1)); } -break; -case 162: -#line 391 "awkgram.y" -{ if (constnode(yyvsp[-1].p)) - yyval.p = op3(MATCHFCN, NIL, yyvsp[-3].p, (Node*)makedfa(strnode(yyvsp[-1].p), 1)); - else - yyval.p = op3(MATCHFCN, (Node *)1, yyvsp[-3].p, yyvsp[-1].p); } -break; -case 163: -#line 395 "awkgram.y" -{ yyval.p = celltonode(yyvsp[0].cp, CCON); } -break; -case 164: -#line 397 "awkgram.y" -{ yyval.p = op4(SPLIT, yyvsp[-5].p, makearr(yyvsp[-3].p), yyvsp[-1].p, (Node*)STRING); } -break; -case 165: -#line 399 "awkgram.y" -{ yyval.p = op4(SPLIT, yyvsp[-5].p, makearr(yyvsp[-3].p), (Node*)makedfa(yyvsp[-1].s, 1), (Node *)REGEXPR); } -break; -case 166: -#line 401 "awkgram.y" -{ yyval.p = op4(SPLIT, yyvsp[-3].p, makearr(yyvsp[-1].p), NIL, (Node*)STRING); } -break; -case 167: -#line 402 "awkgram.y" -{ yyval.p = op1(yyvsp[-3].i, yyvsp[-1].p); } -break; -case 168: -#line 403 "awkgram.y" -{ yyval.p = celltonode(yyvsp[0].cp, CCON); } -break; -case 169: -#line 405 "awkgram.y" -{ yyval.p = op4(yyvsp[-5].i, NIL, (Node*)makedfa(yyvsp[-3].s, 1), yyvsp[-1].p, rectonode()); } -break; -case 170: -#line 407 "awkgram.y" -{ if (constnode(yyvsp[-3].p)) - yyval.p = op4(yyvsp[-5].i, NIL, (Node*)makedfa(strnode(yyvsp[-3].p), 1), yyvsp[-1].p, rectonode()); - else - yyval.p = op4(yyvsp[-5].i, (Node *)1, yyvsp[-3].p, yyvsp[-1].p, rectonode()); } -break; -case 171: -#line 412 "awkgram.y" -{ yyval.p = op4(yyvsp[-7].i, NIL, (Node*)makedfa(yyvsp[-5].s, 1), yyvsp[-3].p, yyvsp[-1].p); } -break; -case 172: -#line 414 "awkgram.y" -{ if (constnode(yyvsp[-5].p)) - yyval.p = op4(yyvsp[-7].i, NIL, (Node*)makedfa(strnode(yyvsp[-5].p), 1), yyvsp[-3].p, yyvsp[-1].p); - else - yyval.p = op4(yyvsp[-7].i, (Node *)1, yyvsp[-5].p, yyvsp[-3].p, yyvsp[-1].p); } -break; -case 173: -#line 419 "awkgram.y" -{ yyval.p = op3(SUBSTR, yyvsp[-5].p, yyvsp[-3].p, yyvsp[-1].p); } -break; -case 174: -#line 421 "awkgram.y" -{ yyval.p = op3(SUBSTR, yyvsp[-3].p, yyvsp[-1].p, NIL); } -break; -case 177: -#line 427 "awkgram.y" -{ yyval.p = op2(ARRAY, makearr(yyvsp[-3].p), yyvsp[-1].p); } -break; -case 178: -#line 428 "awkgram.y" -{ yyval.p = op1(INDIRECT, celltonode(yyvsp[0].cp, CVAR)); } -break; -case 179: -#line 429 "awkgram.y" -{ yyval.p = op1(INDIRECT, yyvsp[0].p); } -break; -case 180: -#line 433 "awkgram.y" -{ arglist = yyval.p = 0; } -break; -case 181: -#line 434 "awkgram.y" -{ arglist = yyval.p = celltonode(yyvsp[0].cp,CVAR); } -break; -case 182: -#line 435 "awkgram.y" -{ - checkdup(yyvsp[-2].p, yyvsp[0].cp); - arglist = yyval.p = linkum(yyvsp[-2].p,celltonode(yyvsp[0].cp,CVAR)); } -break; -case 183: -#line 441 "awkgram.y" -{ yyval.p = celltonode(yyvsp[0].cp, CVAR); } -break; -case 184: -#line 442 "awkgram.y" -{ yyval.p = op1(ARG, itonp(yyvsp[0].i)); } -break; -case 185: -#line 443 "awkgram.y" -{ yyval.p = op1(VARNF, (Node *) yyvsp[0].cp); } -break; -case 186: -#line 448 "awkgram.y" -{ yyval.p = notnull(yyvsp[-1].p); } -break; -#line 3301 "awkgram.tab.c" - } - yyssp -= yym; - yystate = *yyssp; - yyvsp -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yyssp = YYFINAL; - *++yyvsp = yyval; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yyssp, yystate); -#endif - if (yyssp >= yysslim && yygrowstack()) - { - goto yyoverflow; - } - *++yyssp = yystate; - *++yyvsp = yyval; - goto yyloop; -yyoverflow: - yyerror("yacc stack overflow"); -yyabort: - if (yyss) - free(yyss); - if (yyvs) - free(yyvs); - yyss = yyssp = NULL; - yyvs = yyvsp = NULL; - yystacksize = 0; - return (1); -yyaccept: - if (yyss) - free(yyss); - if (yyvs) - free(yyvs); - yyss = yyssp = NULL; - yyvs = yyvsp = NULL; - yystacksize = 0; - return (0); -} diff --git a/third_party/awk/awkgram.tab.h b/third_party/awk/awkgram.tab.h index 23a7754f8..ebb4779f6 100644 --- a/third_party/awk/awkgram.tab.h +++ b/third_party/awk/awkgram.tab.h @@ -1,113 +1,145 @@ -#ifndef COSMOPOLITAN_THIRD_PARTY_AWK_AWKGRAM_TAB_H_ -#define COSMOPOLITAN_THIRD_PARTY_AWK_AWKGRAM_TAB_H_ -#include "third_party/awk/awk.h" -COSMOPOLITAN_C_START_ +#ifndef YY_YY_AWKGRAM_TAB_H_INCLUDED +# define YY_YY_AWKGRAM_TAB_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int yydebug; +#endif + +/* Token kinds. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + enum yytokentype + { + YYEMPTY = -2, + YYEOF = 0, /* "end of file" */ + YYerror = 256, /* error */ + YYUNDEF = 257, /* "invalid token" */ + FIRSTTOKEN = 258, /* FIRSTTOKEN */ + PROGRAM = 259, /* PROGRAM */ + PASTAT = 260, /* PASTAT */ + PASTAT2 = 261, /* PASTAT2 */ + XBEGIN = 262, /* XBEGIN */ + XEND = 263, /* XEND */ + NL = 264, /* NL */ + ARRAY = 265, /* ARRAY */ + MATCH = 266, /* MATCH */ + NOTMATCH = 267, /* NOTMATCH */ + MATCHOP = 268, /* MATCHOP */ + FINAL = 269, /* FINAL */ + DOT = 270, /* DOT */ + ALL = 271, /* ALL */ + CCL = 272, /* CCL */ + NCCL = 273, /* NCCL */ + CHAR = 274, /* CHAR */ + OR = 275, /* OR */ + STAR = 276, /* STAR */ + QUEST = 277, /* QUEST */ + PLUS = 278, /* PLUS */ + EMPTYRE = 279, /* EMPTYRE */ + ZERO = 280, /* ZERO */ + AND = 281, /* AND */ + BOR = 282, /* BOR */ + APPEND = 283, /* APPEND */ + EQ = 284, /* EQ */ + GE = 285, /* GE */ + GT = 286, /* GT */ + LE = 287, /* LE */ + LT = 288, /* LT */ + NE = 289, /* NE */ + IN = 290, /* IN */ + ARG = 291, /* ARG */ + BLTIN = 292, /* BLTIN */ + BREAK = 293, /* BREAK */ + CLOSE = 294, /* CLOSE */ + CONTINUE = 295, /* CONTINUE */ + DELETE = 296, /* DELETE */ + DO = 297, /* DO */ + EXIT = 298, /* EXIT */ + FOR = 299, /* FOR */ + FUNC = 300, /* FUNC */ + SUB = 301, /* SUB */ + GSUB = 302, /* GSUB */ + IF = 303, /* IF */ + INDEX = 304, /* INDEX */ + LSUBSTR = 305, /* LSUBSTR */ + MATCHFCN = 306, /* MATCHFCN */ + NEXT = 307, /* NEXT */ + NEXTFILE = 308, /* NEXTFILE */ + ADD = 309, /* ADD */ + MINUS = 310, /* MINUS */ + MULT = 311, /* MULT */ + DIVIDE = 312, /* DIVIDE */ + MOD = 313, /* MOD */ + ASSIGN = 314, /* ASSIGN */ + ASGNOP = 315, /* ASGNOP */ + ADDEQ = 316, /* ADDEQ */ + SUBEQ = 317, /* SUBEQ */ + MULTEQ = 318, /* MULTEQ */ + DIVEQ = 319, /* DIVEQ */ + MODEQ = 320, /* MODEQ */ + POWEQ = 321, /* POWEQ */ + PRINT = 322, /* PRINT */ + PRINTF = 323, /* PRINTF */ + SPRINTF = 324, /* SPRINTF */ + ELSE = 325, /* ELSE */ + INTEST = 326, /* INTEST */ + CONDEXPR = 327, /* CONDEXPR */ + POSTINCR = 328, /* POSTINCR */ + PREINCR = 329, /* PREINCR */ + POSTDECR = 330, /* POSTDECR */ + PREDECR = 331, /* PREDECR */ + VAR = 332, /* VAR */ + IVAR = 333, /* IVAR */ + VARNF = 334, /* VARNF */ + CALL = 335, /* CALL */ + NUMBER = 336, /* NUMBER */ + STRING = 337, /* STRING */ + REGEXPR = 338, /* REGEXPR */ + GETLINE = 339, /* GETLINE */ + RETURN = 340, /* RETURN */ + SPLIT = 341, /* SPLIT */ + SUBSTR = 342, /* SUBSTR */ + WHILE = 343, /* WHILE */ + CAT = 344, /* CAT */ + NOT = 345, /* NOT */ + UMINUS = 346, /* UMINUS */ + UPLUS = 347, /* UPLUS */ + POWER = 348, /* POWER */ + DECR = 349, /* DECR */ + INCR = 350, /* INCR */ + INDIRECT = 351, /* INDIRECT */ + LASTTOKEN = 352 /* LASTTOKEN */ + }; + typedef enum yytokentype yytoken_kind_t; +#endif + +/* Value type. */ +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +union YYSTYPE +{ +#line 41 "awkgram.y" + + Node *p; + Cell *cp; + int i; + char *s; + +#line 168 "awkgram.tab.h" + +}; +typedef union YYSTYPE YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define YYSTYPE_IS_DECLARED 1 +#endif + -#define FIRSTTOKEN 257 -#define PROGRAM 258 -#define PASTAT 259 -#define PASTAT2 260 -#define XBEGIN 261 -#define XEND 262 -#define NL 263 -#define ARRAY 264 -#define MATCH 265 -#define NOTMATCH 266 -#define MATCHOP 267 -#define FINAL 268 -#define DOT 269 -#define ALL 270 -#define CCL 271 -#define NCCL 272 -#define CHAR 273 -#define OR 274 -#define STAR 275 -#define QUEST 276 -#define PLUS 277 -#define EMPTYRE 278 -#define ZERO 279 -#define AND 280 -#define BOR 281 -#define APPEND 282 -#define EQ 283 -#define GE 284 -#define GT 285 -#define LE 286 -#define LT 287 -#define NE 288 -#define IN 289 -#define ARG 290 -#define BLTIN 291 -#define BREAK 292 -#define CLOSE 293 -#define CONTINUE 294 -#define DELETE 295 -#define DO 296 -#define EXIT 297 -#define FOR 298 -#define FUNC 299 -#define SUB 300 -#define GSUB 301 -#define IF 302 -#define INDEX 303 -#define LSUBSTR 304 -#define MATCHFCN 305 -#define NEXT 306 -#define NEXTFILE 307 -#define ADD 308 -#define MINUS 309 -#define MULT 310 -#define DIVIDE 311 -#define MOD 312 -#define ASSIGN 313 -#define ASGNOP 314 -#define ADDEQ 315 -#define SUBEQ 316 -#define MULTEQ 317 -#define DIVEQ 318 -#define MODEQ 319 -#define POWEQ 320 -#define PRINT 321 -#define PRINTF 322 -#define SPRINTF 323 -#define ELSE 324 -#define INTEST 325 -#define CONDEXPR 326 -#define POSTINCR 327 -#define PREINCR 328 -#define POSTDECR 329 -#define PREDECR 330 -#define VAR 331 -#define IVAR 332 -#define VARNF 333 -#define CALL 334 -#define NUMBER 335 -#define STRING 336 -#define REGEXPR 337 -#define GETLINE 338 -#define RETURN 339 -#define SPLIT 340 -#define SUBSTR 341 -#define WHILE 342 -#define CAT 343 -#define NOT 344 -#define UMINUS 345 -#define UPLUS 346 -#define POWER 347 -#define DECR 348 -#define INCR 349 -#define INDIRECT 350 -#define LASTTOKEN 351 -#ifndef YYSTYPE_DEFINED -#define YYSTYPE_DEFINED -typedef union { - Node *p; - Cell *cp; - int i; - char *s; -} YYSTYPE; -#endif /* YYSTYPE_DEFINED */ extern YYSTYPE yylval; -COSMOPOLITAN_C_END_ -#endif /* COSMOPOLITAN_THIRD_PARTY_AWK_AWKGRAM_TAB_H_ */ + +int yyparse (void); + + +#endif /* !YY_YY_AWKGRAM_TAB_H_INCLUDED */ diff --git a/third_party/awk/b.c b/third_party/awk/b.c index ad907eab2..870eecf58 100644 --- a/third_party/awk/b.c +++ b/third_party/awk/b.c @@ -1,39 +1,39 @@ -/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ -│ vi: set noet ft=c ts=8 sw=8 fenc=utf-8 :vi │ -╚──────────────────────────────────────────────────────────────────────────────╝ -│ │ -│ Copyright (C) Lucent Technologies 1997 │ -│ All Rights Reserved │ -│ │ -│ Permission to use, copy, modify, and distribute this software and │ -│ its documentation for any purpose and without fee is hereby │ -│ granted, provided that the above copyright notice appear in all │ -│ copies and that both that the copyright notice and this │ -│ permission notice and warranty disclaimer appear in supporting │ -│ documentation, and that the name Lucent Technologies or any of │ -│ its entities not be used in advertising or publicity pertaining │ -│ to distribution of the software without specific, written prior │ -│ permission. │ -│ │ -│ LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, │ -│ INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. │ -│ IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY │ -│ SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES │ -│ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER │ -│ IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, │ -│ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF │ -│ THIS SOFTWARE. │ -│ │ -╚─────────────────────────────────────────────────────────────────────────────*/ -#define DEBUG -#include "libc/calls/calls.h" -#include "libc/mem/mem.h" -#include "libc/str/str.h" -#include "third_party/awk/awk.h" -#include "third_party/awk/awkgram.tab.h" +/**************************************************************** +Copyright (C) Lucent Technologies 1997 +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name Lucent Technologies or any of +its entities not be used in advertising or publicity pertaining +to distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. +****************************************************************/ /* lasciate ogne speranza, voi ch'intrate. */ +#define DEBUG + +#include +#include +#include +#include +#include +#include "awk.h" +#include "awkgram.tab.h" + #define MAXLIN 22 #define type(v) (v)->nobj /* badly overloaded here */ @@ -80,6 +80,44 @@ int patlen; fa *fatab[NFA]; int nfatab = 0; /* entries in fatab */ +extern int u8_nextlen(const char *s); + + +/* utf-8 mechanism: + + For most of Awk, utf-8 strings just "work", since they look like + null-terminated sequences of 8-bit bytes. + + Functions like length(), index(), and substr() have to operate + in units of utf-8 characters. The u8_* functions in run.c + handle this. + + Regular expressions are more complicated, since the basic + mechanism of the goto table used 8-bit byte indices into the + gototab entries to compute the next state. Unicode is a lot + bigger, so the gototab entries are now structs with a character + and a next state. These are sorted by code point and binary + searched. + + Throughout the RE mechanism in b.c, utf-8 characters are + converted to their utf-32 value. This mostly shows up in + cclenter, which expands character class ranges like a-z and now + alpha-omega. The size of a gototab array is still about 256. + This should be dynamic, but for now things work ok for a single + code page of Unicode, which is the most likely case. + + The code changes are localized in run.c and b.c. I have added a + handful of functions to somewhat better hide the implementation, + but a lot more could be done. + + */ + +static int entry_cmp(const void *l, const void *r); +static int get_gototab(fa*, int, int); +static int set_gototab(fa*, int, int, int); +static void clear_gototab(fa*, int); +extern int u8_rune(int *, const char *); + static int * intalloc(size_t n, const char *f) { @@ -105,7 +143,7 @@ resizesetvec(const char *f) static void resize_state(fa *f, int state) { - unsigned int **p; + gtt *p; uschar *p2; int **p3; int i, new_count; @@ -115,7 +153,7 @@ resize_state(fa *f, int state) new_count = state + 10; /* needs to be tuned */ - p = (unsigned int **) realloc(f->gototab, new_count * sizeof(f->gototab[0])); + p = (gtt *) realloc(f->gototab, new_count * sizeof(gtt)); if (p == NULL) goto out; f->gototab = p; @@ -131,10 +169,12 @@ resize_state(fa *f, int state) f->posns = p3; for (i = f->state_count; i < new_count; ++i) { - f->gototab[i] = (unsigned int *) calloc(NCHARS, sizeof(**f->gototab)); - if (f->gototab[i] == NULL) + f->gototab[i].entries = (gtte *) calloc(NCHARS, sizeof(gtte)); + if (f->gototab[i].entries == NULL) goto out; - f->out[i] = 0; + f->gototab[i].allocated = NCHARS; + f->gototab[i].inuse = 0; + f->out[i] = 0; f->posns[i] = NULL; } f->state_count = new_count; @@ -230,8 +270,7 @@ int makeinit(fa *f, bool anchor) } if ((f->posns[2])[1] == f->accept) f->out[2] = 1; - for (i = 0; i < NCHARS; i++) - f->gototab[2][i] = 0; + clear_gototab(f, 2); f->curstat = cgoto(f, 2, HAT); if (anchor) { *f->posns[2] = k-1; /* leave out position 0 */ @@ -300,14 +339,14 @@ void freetr(Node *p) /* free parse tree */ /* in the parsing of regular expressions, metacharacters like . have */ /* to be seen literally; \056 is not a metacharacter. */ -int hexstr(const uschar **pp) /* find and eval hex string at pp, return new p */ +int hexstr(const uschar **pp, int max) /* find and eval hex string at pp, return new p */ { /* only pick up one 8-bit byte (2 chars) */ const uschar *p; int n = 0; int i; - for (i = 0, p = *pp; i < 2 && isxdigit(*p); i++, p++) { - if (isdigit(*p)) + for (i = 0, p = *pp; i < max && isxdigit(*p); i++, p++) { + if (isdigit((int) *p)) n = 16 * n + *p - '0'; else if (*p >= 'a' && *p <= 'f') n = 16 * n + *p - 'a' + 10; @@ -318,6 +357,8 @@ int hexstr(const uschar **pp) /* find and eval hex string at pp, return new p */ return n; } + + #define isoctdigit(c) ((c) >= '0' && (c) <= '7') /* multiple use of arg */ int quoted(const uschar **pp) /* pick up next thing after a \\ */ @@ -326,24 +367,28 @@ int quoted(const uschar **pp) /* pick up next thing after a \\ */ const uschar *p = *pp; int c; - if ((c = *p++) == 't') +/* BUG: should advance by utf-8 char even if makes no sense */ + + if ((c = *p++) == 't') { c = '\t'; - else if (c == 'n') + } else if (c == 'n') { c = '\n'; - else if (c == 'f') + } else if (c == 'f') { c = '\f'; - else if (c == 'r') + } else if (c == 'r') { c = '\r'; - else if (c == 'b') + } else if (c == 'b') { c = '\b'; - else if (c == 'v') + } else if (c == 'v') { c = '\v'; - else if (c == 'a') + } else if (c == 'a') { c = '\a'; - else if (c == '\\') + } else if (c == '\\') { c = '\\'; - else if (c == 'x') { /* hexadecimal goo follows */ - c = hexstr(&p); /* this adds a null if number is invalid */ + } else if (c == 'x') { /* 2 hex digits follow */ + c = hexstr(&p, 2); /* this adds a null if number is invalid */ + } else if (c == 'u') { /* unicode char number up to 8 hex digits */ + c = hexstr(&p, 8); } else if (isoctdigit(c)) { /* \d \dd \ddd */ int n = c - '0'; if (isoctdigit(*p)) { @@ -358,50 +403,67 @@ int quoted(const uschar **pp) /* pick up next thing after a \\ */ return c; } -char *cclenter(const char *argp) /* add a character class */ +int *cclenter(const char *argp) /* add a character class */ { int i, c, c2; - const uschar *op, *p = (const uschar *) argp; - uschar *bp; - static uschar *buf = NULL; + int n; + const uschar *p = (const uschar *) argp; + int *bp, *retp; + static int *buf = NULL; static int bufsz = 100; - op = p; - if (buf == NULL && (buf = (uschar *) malloc(bufsz)) == NULL) + if (buf == NULL && (buf = (int *) calloc(bufsz, sizeof(int))) == NULL) FATAL("out of space for character class [%.10s...] 1", p); bp = buf; - for (i = 0; (c = *p++) != 0; ) { + for (i = 0; *p != 0; ) { + n = u8_rune(&c, (const char *) p); + p += n; if (c == '\\') { c = quoted(&p); } else if (c == '-' && i > 0 && bp[-1] != 0) { if (*p != 0) { c = bp[-1]; - c2 = *p++; + /* c2 = *p++; */ + n = u8_rune(&c2, (const char *) p); + p += n; if (c2 == '\\') - c2 = quoted(&p); + c2 = quoted(&p); /* BUG: sets p, has to be u8 size */ if (c > c2) { /* empty; ignore */ bp--; i--; continue; } while (c < c2) { - if (!adjbuf((char **) &buf, &bufsz, bp-buf+2, 100, (char **) &bp, "cclenter1")) - FATAL("out of space for character class [%.10s...] 2", p); + if (i >= bufsz) { + bufsz *= 2; + buf = (int *) realloc(buf, bufsz * sizeof(int)); + if (buf == NULL) + FATAL("out of space for character class [%.10s...] 2", p); + bp = buf + i; + } *bp++ = ++c; i++; } continue; } } - if (!adjbuf((char **) &buf, &bufsz, bp-buf+2, 100, (char **) &bp, "cclenter2")) - FATAL("out of space for character class [%.10s...] 3", p); + if (i >= bufsz) { + bufsz *= 2; + buf = (int *) realloc(buf, bufsz * sizeof(int)); + if (buf == NULL) + FATAL("out of space for character class [%.10s...] 2", p); + bp = buf + i; + } *bp++ = c; i++; } *bp = 0; - DPRINTF("cclenter: in = |%s|, out = |%s|\n", op, buf); - xfree(op); - return (char *) tostring((char *) buf); + /* DPRINTF("cclenter: in = |%s|, out = |%s|\n", op, buf); BUG: can't print array of int */ + /* xfree(op); BUG: what are we freeing here? */ + retp = (int *) calloc(bp-buf+1, sizeof(int)); + for (i = 0; i < bp-buf+1; i++) + retp[i] = buf[i]; + return retp; } void overflo(const char *s) @@ -468,7 +530,7 @@ int first(Node *p) /* collects initially active leaves of p into setvec */ setvec[lp] = 1; setcnt++; } - if (type(p) == CCL && (*(char *) right(p)) == '\0') + if (type(p) == CCL && (*(int *) right(p)) == 0) return(0); /* empty CCL */ return(1); case PLUS: @@ -524,9 +586,9 @@ void follow(Node *v) /* collects leaves that can follow v into setvec */ } } -int member(int c, const char *sarg) /* is c in s? */ +int member(int c, int *sarg) /* is c in s? */ { - const uschar *s = (const uschar *) sarg; + int *s = (int *) sarg; while (*s) if (c == *s++) @@ -534,11 +596,113 @@ int member(int c, const char *sarg) /* is c in s? */ return(0); } +static void resize_gototab(fa *f, int state) +{ + size_t new_size = f->gototab[state].allocated * 2; + gtte *p = (gtte *) realloc(f->gototab[state].entries, new_size * sizeof(gtte)); + if (p == NULL) + overflo(__func__); + + // need to initialized the new memory to zero + size_t orig_size = f->gototab[state].allocated; // 2nd half of new mem is this size + memset(p + orig_size, 0, orig_size * sizeof(gtte)); // clean it out + + f->gototab[state].allocated = new_size; // update gototab info + f->gototab[state].entries = p; +} + +static int get_gototab(fa *f, int state, int ch) /* hide gototab implementation */ +{ + gtte key; + gtte *item; + + key.ch = ch; + key.state = 0; /* irrelevant */ + item = (gtte *) bsearch(& key, f->gototab[state].entries, + f->gototab[state].inuse, sizeof(gtte), + entry_cmp); + + if (item == NULL) + return 0; + else + return item->state; +} + +static int entry_cmp(const void *l, const void *r) +{ + const gtte *left, *right; + + left = (const gtte *) l; + right = (const gtte *) r; + + return left->ch - right->ch; +} + +static int set_gototab(fa *f, int state, int ch, int val) /* hide gototab implementation */ +{ + if (f->gototab[state].inuse == 0) { + f->gototab[state].entries[0].ch = ch; + f->gototab[state].entries[0].state = val; + f->gototab[state].inuse++; + return val; + } else if (ch > f->gototab[state].entries[f->gototab[state].inuse-1].ch) { + // not seen yet, insert and return + gtt *tab = & f->gototab[state]; + if (tab->inuse + 1 >= tab->allocated) + resize_gototab(f, state); + + f->gototab[state].entries[f->gototab[state].inuse-1].ch = ch; + f->gototab[state].entries[f->gototab[state].inuse-1].state = val; + f->gototab[state].inuse++; + return val; + } else { + // maybe we have it, maybe we don't + gtte key; + gtte *item; + + key.ch = ch; + key.state = 0; /* irrelevant */ + item = (gtte *) bsearch(& key, f->gototab[state].entries, + f->gototab[state].inuse, sizeof(gtte), + entry_cmp); + + if (item != NULL) { + // we have it, update state and return + item->state = val; + return item->state; + } + // otherwise, fall through to insert and reallocate. + } + + gtt *tab = & f->gototab[state]; + if (tab->inuse + 1 >= tab->allocated) + resize_gototab(f, state); + ++tab->inuse; + f->gototab[state].entries[tab->inuse].ch = ch; + f->gototab[state].entries[tab->inuse].state = val; + + qsort(f->gototab[state].entries, + f->gototab[state].inuse, sizeof(gtte), entry_cmp); + + return val; /* not used anywhere at the moment */ +} + +static void clear_gototab(fa *f, int state) +{ + memset(f->gototab[state].entries, 0, + f->gototab[state].allocated * sizeof(gtte)); + f->gototab[state].inuse = 0; +} + int match(fa *f, const char *p0) /* shortest match ? */ { int s, ns; + int n; + int rune; const uschar *p = (const uschar *) p0; + /* return pmatch(f, p0); does it matter whether longest or shortest? */ + s = f->initstat; assert (s < f->state_count); @@ -546,19 +710,25 @@ int match(fa *f, const char *p0) /* shortest match ? */ return(1); do { /* assert(*p < NCHARS); */ - if ((ns = f->gototab[s][*p]) != 0) + n = u8_rune(&rune, (const char *) p); + if ((ns = get_gototab(f, s, rune)) != 0) s = ns; else - s = cgoto(f, s, *p); + s = cgoto(f, s, rune); if (f->out[s]) return(1); - } while (*p++ != 0); + if (*p == 0) + break; + p += n; + } while (1); /* was *p++ != 0 */ return(0); } int pmatch(fa *f, const char *p0) /* longest match, for sub */ { int s, ns; + int n; + int rune; const uschar *p = (const uschar *) p0; const uschar *q; @@ -573,10 +743,11 @@ int pmatch(fa *f, const char *p0) /* longest match, for sub */ if (f->out[s]) /* final state */ patlen = q-p; /* assert(*q < NCHARS); */ - if ((ns = f->gototab[s][*q]) != 0) + n = u8_rune(&rune, (const char *) q); + if ((ns = get_gototab(f, s, rune)) != 0) s = ns; else - s = cgoto(f, s, *q); + s = cgoto(f, s, rune); assert(s < f->state_count); @@ -588,7 +759,11 @@ int pmatch(fa *f, const char *p0) /* longest match, for sub */ else goto nextin; /* no match */ } - } while (*q++ != 0); + if (*q == 0) + break; + q += n; + } while (1); + q++; /* was *q++ */ if (f->out[s]) patlen = q-p-1; /* don't count $ */ if (patlen >= 0) { @@ -597,13 +772,19 @@ int pmatch(fa *f, const char *p0) /* longest match, for sub */ } nextin: s = 2; - } while (*p++); + if (*p == 0) + break; + n = u8_rune(&rune, (const char *) p); + p += n; + } while (1); /* was *p++ */ return (0); } int nematch(fa *f, const char *p0) /* non-empty match, for sub */ { int s, ns; + int n; + int rune; const uschar *p = (const uschar *) p0; const uschar *q; @@ -618,10 +799,11 @@ int nematch(fa *f, const char *p0) /* non-empty match, for sub */ if (f->out[s]) /* final state */ patlen = q-p; /* assert(*q < NCHARS); */ - if ((ns = f->gototab[s][*q]) != 0) + n = u8_rune(&rune, (const char *) q); + if ((ns = get_gototab(f, s, rune)) != 0) s = ns; else - s = cgoto(f, s, *q); + s = cgoto(f, s, rune); if (s == 1) { /* no transition */ if (patlen > 0) { patbeg = (const char *) p; @@ -629,7 +811,11 @@ int nematch(fa *f, const char *p0) /* non-empty match, for sub */ } else goto nnextin; /* no nonempty match */ } - } while (*q++ != 0); + if (*q == 0) + break; + q += n; + } while (1); + q++; if (f->out[s]) patlen = q-p-1; /* don't count $ */ if (patlen > 0 ) { @@ -661,54 +847,84 @@ int nematch(fa *f, const char *p0) /* non-empty match, for sub */ bool fnematch(fa *pfa, FILE *f, char **pbuf, int *pbufsize, int quantum) { - char *buf = *pbuf; + char *i, *j, *k, *buf = *pbuf; int bufsize = *pbufsize; - int c, i, j, k, ns, s; + int c, n, ns, s; s = pfa->initstat; patlen = 0; /* - * All indices relative to buf. - * i <= j <= k <= bufsize + * buf <= i <= j <= k <= buf+bufsize * * i: origin of active substring * j: current character - * k: destination of next getc() + * k: destination of the next getc */ - i = -1, k = 0; - do { - j = i++; - do { - if (++j == k) { - if (k == bufsize) - if (!adjbuf((char **) &buf, &bufsize, bufsize+1, quantum, 0, "fnematch")) - FATAL("stream '%.30s...' too long", buf); - buf[k++] = (c = getc(f)) != EOF ? c : 0; - } - c = (uschar)buf[j]; - /* assert(c < NCHARS); */ - if ((ns = pfa->gototab[s][c]) != 0) - s = ns; - else - s = cgoto(pfa, s, c); + i = j = k = buf; - if (pfa->out[s]) { /* final state */ - patlen = j - i + 1; - if (c == 0) /* don't count $ */ - patlen--; + do { + /* + * Call u8_rune with at least awk_mb_cur_max ahead in + * the buffer until EOF interferes. + */ + if (k - j < awk_mb_cur_max) { + if (k + awk_mb_cur_max > buf + bufsize) { + char *obuf = buf; + adjbuf((char **) &buf, &bufsize, + bufsize + awk_mb_cur_max, + quantum, 0, "fnematch"); + + /* buf resized, maybe moved. update pointers */ + *pbufsize = bufsize; + if (obuf != buf) { + i = buf + (i - obuf); + j = buf + (j - obuf); + k = buf + (k - obuf); + *pbuf = buf; + if (patlen) + patbeg = buf + (patbeg - obuf); + } } - } while (buf[j] && s != 1); + for (n = awk_mb_cur_max ; n > 0; n--) { + *k++ = (c = getc(f)) != EOF ? c : 0; + if (c == EOF) { + if (ferror(f)) + FATAL("fnematch: getc error"); + break; + } + } + } + + j += u8_rune(&c, j); + + if ((ns = get_gototab(pfa, s, c)) != 0) + s = ns; + else + s = cgoto(pfa, s, c); + + if (pfa->out[s]) { /* final state */ + patbeg = i; + patlen = j - i; + if (c == 0) /* don't count $ */ + patlen--; + } + + if (c && s != 1) + continue; /* origin i still viable, next j */ + if (patlen) + break; /* best match found */ + + /* no match at origin i, next i and start over */ + i += u8_rune(&c, i); + if (c == 0) + break; /* no match */ + j = i; s = 2; - } while (buf[i] && !patlen); - - /* adjbuf() may have relocated a resized buffer. Inform the world. */ - *pbuf = buf; - *pbufsize = bufsize; + } while (1); if (patlen) { - patbeg = (char *) buf + i; /* * Under no circumstances is the last character fed to * the automaton part of the match. It is EOF's nullbyte, @@ -721,10 +937,10 @@ bool fnematch(fa *pfa, FILE *f, char **pbuf, int *pbufsize, int quantum) * terminate the buffer. */ do - if (buf[--k] && ungetc(buf[k], f) == EOF) - FATAL("unable to ungetc '%c'", buf[k]); - while (k > i + patlen); - buf[k] = '\0'; + if (*--k && ungetc(*k, f) == EOF) + FATAL("unable to ungetc '%c'", *k); + while (k > patbeg + patlen); + *k = '\0'; return true; } else @@ -797,7 +1013,7 @@ Node *primary(void) rtok = relex(); if (rtok == ')') { /* special pleading for () */ rtok = relex(); - return unary(op2(CCL, NIL, (Node *) tostring(""))); + return unary(op2(CCL, NIL, (Node *) cclenter(""))); } np = regexp(); if (rtok == ')') { @@ -820,7 +1036,7 @@ Node *concat(Node *np) return (concat(op2(CAT, np, primary()))); case EMPTYRE: rtok = relex(); - return (concat(op2(CAT, op2(CCL, NIL, (Node *) tostring("")), + return (concat(op2(CAT, op2(CCL, NIL, (Node *) cclenter("")), primary()))); } return (np); @@ -866,6 +1082,25 @@ Node *unary(Node *np) * must be less than twice the size of their full name. */ +/* Because isblank doesn't show up in any of the header files on any + * system i use, it's defined here. if some other locale has a richer + * definition of "blank", define HAS_ISBLANK and provide your own + * version. + * the parentheses here are an attempt to find a path through the maze + * of macro definition and/or function and/or version provided. thanks + * to nelson beebe for the suggestion; let's see if it works everywhere. + */ + +/* #define HAS_ISBLANK */ +#ifndef HAS_ISBLANK + +int (xisblank)(int c) +{ + return c==' ' || c=='\t'; +} + +#endif + static const struct charclass { const char *cc_name; int cc_namelen; @@ -873,7 +1108,11 @@ static const struct charclass { } charclasses[] = { { "alnum", 5, isalnum }, { "alpha", 5, isalpha }, +#ifndef HAS_ISBLANK + { "blank", 5, xisblank }, +#else { "blank", 5, isblank }, +#endif { "cntrl", 5, iscntrl }, { "digit", 5, isdigit }, { "graph", 5, isgraph }, @@ -1013,6 +1252,12 @@ int relex(void) /* lexical analyzer for reparse */ rescan: starttok = prestr; + if ((n = u8_rune(&rlxval, (const char *) prestr)) > 1) { + prestr += n; + starttok = prestr; + return CHAR; + } + switch (c = *prestr++) { case '|': return OR; case '*': return STAR; @@ -1050,10 +1295,15 @@ rescan: } else cflag = 0; - n = 2 * strlen((const char *) prestr)+1; + n = 5 * strlen((const char *) prestr)+1; /* BUG: was 2. what value? */ if (!adjbuf((char **) &buf, &bufsz, n, n, (char **) &bp, "relex1")) FATAL("out of space for reg expr %.10s...", lastre); for (; ; ) { + if ((n = u8_rune(&rlxval, (const char *) prestr)) > 1) { + for (i = 0; i < n; i++) + *bp++ = *prestr++; + continue; + } if ((c = *prestr++) == '\\') { *bp++ = '\\'; if ((c = *prestr++) == '\0') @@ -1143,7 +1393,7 @@ rescan: } break; case '{': - if (isdigit(*(prestr))) { + if (isdigit((int) *(prestr))) { num = 0; /* Process as a repetition */ n = -1; m = -1; commafound = false; @@ -1213,7 +1463,6 @@ rescan: } break; } - return 0; /* [jart] why wasn't this here? */ } int cgoto(fa *f, int s, int c) @@ -1221,7 +1470,7 @@ int cgoto(fa *f, int s, int c) int *p, *q; int i, j, k; - assert(c == HAT || c < NCHARS); + /* assert(c == HAT || c < NCHARS); BUG: seg fault if disable test */ while (f->accept >= maxsetvec) { /* guessing here! */ resizesetvec(__func__); } @@ -1237,8 +1486,8 @@ int cgoto(fa *f, int s, int c) || (k == DOT && c != 0 && c != HAT) || (k == ALL && c != 0) || (k == EMPTYRE && c != 0) - || (k == CCL && member(c, (char *) f->re[p[i]].lval.up)) - || (k == NCCL && !member(c, (char *) f->re[p[i]].lval.up) && c != 0 && c != HAT)) { + || (k == CCL && member(c, (int *) f->re[p[i]].lval.rp)) + || (k == NCCL && !member(c, (int *) f->re[p[i]].lval.rp) && c != 0 && c != HAT)) { q = f->re[p[i]].lfollow; for (j = 1; j <= *q; j++) { if (q[j] >= maxsetvec) { @@ -1270,7 +1519,7 @@ int cgoto(fa *f, int s, int c) goto different; /* setvec is state i */ if (c != HAT) - f->gototab[s][c] = i; + set_gototab(f, s, c, i); return i; different:; } @@ -1278,14 +1527,13 @@ int cgoto(fa *f, int s, int c) /* add tmpset to current set of states */ ++(f->curstat); resize_state(f, f->curstat); - for (i = 0; i < NCHARS; i++) - f->gototab[f->curstat][i] = 0; + clear_gototab(f, f->curstat); xfree(f->posns[f->curstat]); p = intalloc(setcnt + 1, __func__); f->posns[f->curstat] = p; if (c != HAT) - f->gototab[s][c] = f->curstat; + set_gototab(f, s, c, f->curstat); for (i = 0; i <= setcnt; i++) p[i] = tmpset[i]; if (setvec[f->accept]) @@ -1303,7 +1551,8 @@ void freefa(fa *f) /* free a finite automaton */ if (f == NULL) return; for (i = 0; i < f->state_count; i++) - xfree(f->gototab[i]) + xfree(f->gototab[i].entries); + xfree(f->gototab); for (i = 0; i <= f->curstat; i++) xfree(f->posns[i]); for (i = 0; i <= f->accept; i++) { diff --git a/third_party/awk/lex.c b/third_party/awk/lex.c index 04d528853..0473a338c 100644 --- a/third_party/awk/lex.c +++ b/third_party/awk/lex.c @@ -1,40 +1,35 @@ -/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ -│ vi: set noet ft=c ts=8 sw=8 fenc=utf-8 :vi │ -╚──────────────────────────────────────────────────────────────────────────────╝ -│ │ -│ Copyright (C) Lucent Technologies 1997 │ -│ All Rights Reserved │ -│ │ -│ Permission to use, copy, modify, and distribute this software and │ -│ its documentation for any purpose and without fee is hereby │ -│ granted, provided that the above copyright notice appear in all │ -│ copies and that both that the copyright notice and this │ -│ permission notice and warranty disclaimer appear in supporting │ -│ documentation, and that the name Lucent Technologies or any of │ -│ its entities not be used in advertising or publicity pertaining │ -│ to distribution of the software without specific, written prior │ -│ permission. │ -│ │ -│ LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, │ -│ INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. │ -│ IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY │ -│ SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES │ -│ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER │ -│ IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, │ -│ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF │ -│ THIS SOFTWARE. │ -│ │ -╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/calls/calls.h" -#include "libc/fmt/conv.h" -#include "libc/mem/mem.h" -#include "libc/runtime/runtime.h" -#include "libc/stdio/stdio.h" -#include "libc/str/str.h" -#include "third_party/awk/awk.h" -#include "third_party/awk/awkgram.tab.h" -#include "third_party/gdtoa/gdtoa.h" +/**************************************************************** +Copyright (C) Lucent Technologies 1997 +All Rights Reserved +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name Lucent Technologies or any of +its entities not be used in advertising or publicity pertaining +to distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. +****************************************************************/ + +#include +#include +#include +#include +#include "awk.h" +#include "awkgram.tab.h" + +extern YYSTYPE yylval; extern bool infunc; int lineno = 1; @@ -373,6 +368,8 @@ int yylex(void) } } +extern int runetochar(char *str, int c); + int string(void) { int c, n; @@ -420,20 +417,54 @@ int string(void) *bp++ = n; break; - case 'x': /* hex \x0-9a-fA-F + */ - { char xbuf[100], *px; - for (px = xbuf; (c = input()) != 0 && px-xbuf < 100-2; ) { - if (isdigit(c) - || (c >= 'a' && c <= 'f') - || (c >= 'A' && c <= 'F')) - *px++ = c; - else - break; + case 'x': /* hex \x0-9a-fA-F (exactly two) */ + { + int i; + + if (!isxdigit(peek())) { + unput(c); + break; + } + n = 0; + for (i = 0; i < 2; i++) { + c = input(); + if (c == 0) + break; + if (isxdigit(c)) { + c = tolower(c); + n *= 16; + if (isdigit(c)) + n += (c - '0'); + else + n += 10 + (c - 'a'); + } else { + unput(c); + break; + } + } + if (i) + *bp++ = n; + break; + } + + case 'u': /* utf \u0-9a-fA-F (1..8) */ + { + int i; + + n = 0; + for (i = 0; i < 8; i++) { + c = input(); + if (!isxdigit(c) || c == 0) + break; + c = tolower(c); + n *= 16; + if (isdigit(c)) + n += (c - '0'); + else + n += 10 + (c - 'a'); } - *px = 0; unput(c); - sscanf(xbuf, "%x", (unsigned int *) &n); - *bp++ = n; + bp += runetochar(bp, n); break; } @@ -530,7 +561,7 @@ int regexpr(void) char *bp; if (buf == NULL && (buf = (char *) malloc(bufsz)) == NULL) - FATAL("out of space for rex expr"); + FATAL("out of space for reg expr"); bp = buf; for ( ; (c = input()) != '/' && c != 0; ) { if (!adjbuf(&buf, &bufsz, bp-buf+3, 500, &bp, "regexpr")) diff --git a/third_party/awk/lib.c b/third_party/awk/lib.c index a437fc675..0dac1f929 100644 --- a/third_party/awk/lib.c +++ b/third_party/awk/lib.c @@ -1,43 +1,43 @@ -/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ -│ vi: set noet ft=c ts=8 sw=8 fenc=utf-8 :vi │ -╚──────────────────────────────────────────────────────────────────────────────╝ -│ │ -│ Copyright (C) Lucent Technologies 1997 │ -│ All Rights Reserved │ -│ │ -│ Permission to use, copy, modify, and distribute this software and │ -│ its documentation for any purpose and without fee is hereby │ -│ granted, provided that the above copyright notice appear in all │ -│ copies and that both that the copyright notice and this │ -│ permission notice and warranty disclaimer appear in supporting │ -│ documentation, and that the name Lucent Technologies or any of │ -│ its entities not be used in advertising or publicity pertaining │ -│ to distribution of the software without specific, written prior │ -│ permission. │ -│ │ -│ LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, │ -│ INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. │ -│ IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY │ -│ SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES │ -│ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER │ -│ IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, │ -│ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF │ -│ THIS SOFTWARE. │ -│ │ -╚─────────────────────────────────────────────────────────────────────────────*/ +/**************************************************************** +Copyright (C) Lucent Technologies 1997 +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name Lucent Technologies or any of +its entities not be used in advertising or publicity pertaining +to distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. +****************************************************************/ + #define DEBUG -#include "libc/calls/calls.h" -#include "libc/errno.h" -#include "libc/fmt/conv.h" -#include "libc/limits.h" -#include "libc/math.h" -#include "libc/mem/mem.h" -#include "libc/runtime/runtime.h" -#include "libc/str/str.h" -#include "third_party/awk/awk.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "awk.h" + +extern int u8_nextlen(const char *s); char EMPTY[] = { '\0' }; -static FILE *infile = NULL; +FILE *infile = NULL; bool innew; /* true = infile has not been read by readrec */ char *file = EMPTY; char *record; @@ -152,11 +152,6 @@ int getrec(char **pbuf, int *pbufsize, bool isrecord) /* get next input record * } DPRINTF("RS=<%s>, FS=<%s>, ARGC=%g, FILENAME=%s\n", *RS, *FS, *ARGC, *FILENAME); - if (isrecord) { - donefld = false; - donerec = true; - savefs(); - } saveb0 = buf[0]; buf[0] = 0; while (argno < *ARGC || infile == stdin) { @@ -196,6 +191,9 @@ int getrec(char **pbuf, int *pbufsize, bool isrecord) /* get next input record * fldtab[0]->fval = result; fldtab[0]->tval |= NUM; } + donefld = false; + donerec = true; + savefs(); } setfval(nrloc, nrloc->fval+1); setfval(fnrloc, fnrloc->fval+1); @@ -223,16 +221,22 @@ void nextfile(void) argno++; } +extern int readcsvrec(char **pbuf, int *pbufsize, FILE *inf, bool newflag); + int readrec(char **pbuf, int *pbufsize, FILE *inf, bool newflag) /* read one record into buf */ { - int sep, c, isrec; - char *rr, *buf = *pbuf; + int sep, c, isrec; // POTENTIAL BUG? isrec is a macro in awk.h + char *rr = *pbuf, *buf = *pbuf; int bufsize = *pbufsize; char *rs = getsval(rsloc); - if (*rs && rs[1]) { + if (CSV) { + c = readcsvrec(pbuf, pbufsize, inf, newflag); + isrec = (c == EOF && rr == buf) ? false : true; + } else if (*rs && rs[1]) { bool found; + memset(buf, 0, bufsize); fa *pfa = makedfa(rs, 1); if (newflag) found = fnematch(pfa, inf, &buf, &bufsize, recsize); @@ -245,6 +249,7 @@ int readrec(char **pbuf, int *pbufsize, FILE *inf, bool newflag) /* read one rec if (found) setptr(patbeg, '\0'); isrec = (found == 0 && *buf == '\0') ? false : true; + } else { if ((sep = *rs) == 0) { sep = '\n'; @@ -282,6 +287,52 @@ int readrec(char **pbuf, int *pbufsize, FILE *inf, bool newflag) /* read one rec return isrec; } + +/******************* + * loose ends here: + * \r\n should become \n + * what about bare \r? Excel uses that for embedded newlines + * can't have "" in unquoted fields, according to RFC 4180 +*/ + + +int readcsvrec(char **pbuf, int *pbufsize, FILE *inf, bool newflag) /* csv can have \n's */ +{ /* so read a complete record that might be multiple lines */ + int sep, c; + char *rr = *pbuf, *buf = *pbuf; + int bufsize = *pbufsize; + bool in_quote = false; + + sep = '\n'; /* the only separator; have to skip over \n embedded in "..." */ + rr = buf; + while ((c = getc(inf)) != EOF) { + if (c == sep) { + if (! in_quote) + break; + if (rr > buf && rr[-1] == '\r') // remove \r if was \r\n + rr--; + } + + if (rr-buf+1 > bufsize) + if (!adjbuf(&buf, &bufsize, 1+rr-buf, + recsize, &rr, "readcsvrec 1")) + FATAL("input record `%.30s...' too long", buf); + *rr++ = c; + if (c == '"') + in_quote = ! in_quote; + } + if (c == '\n' && rr > buf && rr[-1] == '\r') // remove \r if was \r\n + rr--; + + if (!adjbuf(&buf, &bufsize, 1+rr-buf, recsize, &rr, "readcsvrec 4")) + FATAL("input record `%.30s...' too long", buf); + *rr = 0; + *pbuf = buf; + *pbufsize = bufsize; + DPRINTF("readcsvrec saw <%s>, returns %d\n", buf, c); + return c; +} + char *getargv(int n) /* get ARGV[n] */ { Cell *x; @@ -303,6 +354,9 @@ void setclvar(char *s) /* set var=value from s */ Cell *q; double result; +/* commit f3d9187d4e0f02294fb1b0e31152070506314e67 broke T.argv test */ +/* I don't understand why it was changed. */ + for (p=s; *p != '='; p++) ; e = p; @@ -315,6 +369,7 @@ void setclvar(char *s) /* set var=value from s */ q->tval |= NUM; } DPRINTF("command line set %s to |%s|\n", s, p); + free(p); *e = '='; } @@ -344,9 +399,9 @@ void fldbld(void) /* create fields from current record */ i = 0; /* number of fields accumulated here */ if (inputFS == NULL) /* make sure we have a copy of FS */ savefs(); - if (strlen(inputFS) > 1) { /* it's a regular expression */ + if (!CSV && strlen(inputFS) > 1) { /* it's a regular expression */ i = refldbld(r, inputFS); - } else if ((sep = *inputFS) == ' ') { /* default whitespace */ + } else if (!CSV && (sep = *inputFS) == ' ') { /* default whitespace */ for (i = 0; ; ) { while (*r == ' ' || *r == '\t' || *r == '\n') r++; @@ -365,26 +420,58 @@ void fldbld(void) /* create fields from current record */ *fr++ = 0; } *fr = 0; - } else if ((sep = *inputFS) == 0) { /* new: FS="" => 1 char/field */ - for (i = 0; *r != '\0'; r += n) { - char buf[MB_LEN_MAX + 1]; - + } else if (CSV) { /* CSV processing. no error handling */ + if (*r != 0) { + for (;;) { + i++; + if (i > nfields) + growfldtab(i); + if (freeable(fldtab[i])) + xfree(fldtab[i]->sval); + fldtab[i]->sval = fr; + fldtab[i]->tval = FLD | STR | DONTFREE; + if (*r == '"' ) { /* start of "..." */ + for (r++ ; *r != '\0'; ) { + if (*r == '"' && r[1] != '\0' && r[1] == '"') { + r += 2; /* doubled quote */ + *fr++ = '"'; + } else if (*r == '"' && (r[1] == '\0' || r[1] == ',')) { + r++; /* skip over closing quote */ + break; + } else { + *fr++ = *r++; + } + } + *fr++ = 0; + } else { /* unquoted field */ + while (*r != ',' && *r != '\0') + *fr++ = *r++; + *fr++ = 0; + } + if (*r++ == 0) + break; + + } + } + *fr = 0; + } else if ((sep = *inputFS) == 0) { /* new: FS="" => 1 char/field */ + for (i = 0; *r != '\0'; ) { + char buf[10]; i++; if (i > nfields) growfldtab(i); if (freeable(fldtab[i])) xfree(fldtab[i]->sval); - n = mblen(r, MB_LEN_MAX); - if (n < 0) - n = 1; - memcpy(buf, r, n); - buf[n] = '\0'; + n = u8_nextlen(r); + for (j = 0; j < n; j++) + buf[j] = *r++; + buf[j] = '\0'; fldtab[i]->sval = tostring(buf); fldtab[i]->tval = FLD | STR; } *fr = 0; } else if (*r != 0) { /* if 0, it's a null field */ - /* subtlecase : if length(FS) == 1 && length(RS > 0) + /* subtle case: if length(FS) == 1 && length(RS > 0) * \n is NOT a field separator (cf awk book 61,84). * this variable is tested in the inner while loop. */ @@ -587,11 +674,9 @@ void yyerror(const char *s) SYNTAX("%s", s); } -extern char *cmdname; - void SYNTAX(const char *fmt, ...) { - extern char *curfname; + extern char *cmdname, *curfname; static int been_here = 0; va_list varg; @@ -641,6 +726,7 @@ void bcheck2(int n, int c1, int c2) void FATAL(const char *fmt, ...) { + extern char *cmdname; va_list varg; fflush(stdout); @@ -656,6 +742,7 @@ void FATAL(const char *fmt, ...) void WARNING(const char *fmt, ...) { + extern char *cmdname; va_list varg; fflush(stdout); @@ -758,10 +845,10 @@ int isclvar(const char *s) /* is s of form var=something ? */ { const char *os = s; - if (!isalpha((uschar) *s) && *s != '_') + if (!isalpha((int) *s) && *s != '_') return 0; for ( ; *s; s++) - if (!(isalnum((uschar) *s) || *s == '_')) + if (!(isalnum((int) *s) || *s == '_')) break; return *s == '=' && s > os; } @@ -796,19 +883,19 @@ bool is_valid_number(const char *s, bool trailing_stuff_ok, if (no_trailing) *no_trailing = false; - while (isspace(*s)) + while (isspace((int) *s)) s++; - // no hex floating point, sorry + /* no hex floating point, sorry */ if (s[0] == '0' && tolower(s[1]) == 'x') return false; - // allow +nan, -nan, +inf, -inf, any other letter, no + /* allow +nan, -nan, +inf, -inf, any other letter, no */ if (s[0] == '+' || s[0] == '-') { is_nan = (strncasecmp(s+1, "nan", 3) == 0); is_inf = (strncasecmp(s+1, "inf", 3) == 0); if ((is_nan || is_inf) - && (isspace(s[4]) || s[4] == '\0')) + && (isspace((int) s[4]) || s[4] == '\0')) goto convert; else if (! isdigit(s[1]) && s[1] != '.') return false; @@ -831,13 +918,13 @@ convert: /* * check for trailing stuff */ - while (isspace(*ep)) + while (isspace((int) *ep)) ep++; if (no_trailing != NULL) *no_trailing = (*ep == '\0'); - // return true if found the end, or trailing stuff is allowed + /* return true if found the end, or trailing stuff is allowed */ retval = *ep == '\0' || trailing_stuff_ok; return retval; diff --git a/third_party/awk/main.c b/third_party/awk/main.c index 07fba0946..387f3f9cc 100644 --- a/third_party/awk/main.c +++ b/third_party/awk/main.c @@ -1,46 +1,5 @@ -/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ -│ vi: set noet ft=c ts=8 sw=8 fenc=utf-8 :vi │ -╚──────────────────────────────────────────────────────────────────────────────╝ -│ │ -│ Copyright (C) Lucent Technologies 1997 │ -│ All Rights Reserved │ -│ │ -│ Permission to use, copy, modify, and distribute this software and │ -│ its documentation for any purpose and without fee is hereby │ -│ granted, provided that the above copyright notice appear in all │ -│ copies and that both that the copyright notice and this │ -│ permission notice and warranty disclaimer appear in supporting │ -│ documentation, and that the name Lucent Technologies or any of │ -│ its entities not be used in advertising or publicity pertaining │ -│ to distribution of the software without specific, written prior │ -│ permission. │ -│ │ -│ LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, │ -│ INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. │ -│ IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY │ -│ SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES │ -│ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER │ -│ IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, │ -│ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF │ -│ THIS SOFTWARE. │ -│ │ -╚─────────────────────────────────────────────────────────────────────────────*/ -#define DEBUG -#include "libc/calls/calls.h" -#include "libc/calls/struct/sigaction.h" -#include "libc/calls/struct/siginfo.h" -#include "libc/mem/mem.h" -#include "libc/runtime/runtime.h" -#include "libc/stdio/rand.h" -#include "libc/str/locale.h" -#include "libc/str/str.h" -#include "libc/sysv/consts/sa.h" -#include "libc/sysv/consts/sicode.h" -#include "libc/sysv/consts/sig.h" -#include "third_party/awk/awk.h" - -__notice(awk_notice, "\ -The One True Awk\n\ +__notice(awk_license, "\ +/****************************************************************\n\ Copyright (C) Lucent Technologies 1997\n\ All Rights Reserved\n\ \n\ @@ -61,9 +20,21 @@ SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n\ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER\n\ IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\n\ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\n\ -THIS SOFTWARE."); +THIS SOFTWARE.\n\ +****************************************************************/"); -const char *version = "version 20220530"; +const char *version = "version 20240311"; + +#define DEBUG +#include +#include +#include +#include +#include +#include +#include "awk.h" + +extern char **environ; extern int nfields; int dbg = 0; @@ -71,6 +42,7 @@ Awkfloat srand_seed = 1; char *cmdname; /* gets argv[0] for error messages */ extern FILE *yyin; /* lex input file */ char *lexprog; /* points to program argument if it exists */ +extern int errorflag; /* non-zero if any syntax errors; set by yyerror */ enum compile_states compile_time = ERROR_PRINTING; static char **pfile; /* program filenames from -f's */ @@ -78,23 +50,37 @@ static size_t maxpfile; /* max program filename */ static size_t npfile; /* number of filenames */ static size_t curpfile; /* current filename */ +bool CSV = false; /* true for csv input */ + bool safe = false; /* true => "safe" mode */ -static wontreturn void fpecatch(int n, siginfo_t *si, void *uc) +size_t awk_mb_cur_max = 1; + +static noreturn void fpecatch(int n +#ifdef SA_SIGINFO + , siginfo_t *si, void *uc +#endif +) { - const char *emsg[10]; - emsg[0] = "Unknown error"; - emsg[FPE_INTDIV] = "Integer divide by zero"; - emsg[FPE_INTOVF] = "Integer overflow"; - emsg[FPE_FLTDIV] = "Floating point divide by zero"; - emsg[FPE_FLTOVF] = "Floating point overflow"; - emsg[FPE_FLTUND] = "Floating point underflow"; - emsg[FPE_FLTRES] = "Floating point inexact result"; - emsg[FPE_FLTINV] = "Invalid Floating point operation"; - emsg[FPE_FLTSUB] = "Subscript out of range"; - FATAL("floating point exception: %s", - (size_t)si->si_code < sizeof(emsg) / sizeof(emsg[0]) && - emsg[si->si_code] ? emsg[si->si_code] : emsg[0]); +#ifdef SA_SIGINFOz + static const char *emsg[] = { + [0] = "Unknown error", + [FPE_INTDIV] = "Integer divide by zero", + [FPE_INTOVF] = "Integer overflow", + [FPE_FLTDIV] = "Floating point divide by zero", + [FPE_FLTOVF] = "Floating point overflow", + [FPE_FLTUND] = "Floating point underflow", + [FPE_FLTRES] = "Floating point inexact result", + [FPE_FLTINV] = "Invalid Floating point operation", + [FPE_FLTSUB] = "Subscript out of range", + }; +#endif + FATAL("floating point exception" +#ifdef SA_SIGINFOz + ": %s", (size_t)si->si_code < sizeof(emsg) / sizeof(emsg[0]) && + emsg[si->si_code] ? emsg[si->si_code] : emsg[0] +#endif + ); } /* Can this work with recursive calls? I don't think so. @@ -129,30 +115,30 @@ getarg(int *argc, char ***argv, const char *msg) int _awk(int argc, char *argv[]) { const char *fs = NULL; - struct sigaction sa; char *fn, *vn; setlocale(LC_CTYPE, ""); setlocale(LC_NUMERIC, "C"); /* for parsing cmdline & prog */ + awk_mb_cur_max = MB_CUR_MAX; cmdname = argv[0]; - - if (pledge("stdio rpath wpath cpath proc exec", NULL) == -1) { - fprintf(stderr, "%s: pledge: incorrect arguments\n", - cmdname); - exit(1); - } - if (argc == 1) { fprintf(stderr, - "usage: %s [-F fs] [-v var=value] [-f progfile | 'prog'] [file ...]\n", + "usage: %s [-F fs | --csv] [-v var=value] [-f progfile | 'prog'] [file ...]\n", cmdname); exit(1); } - - sa.sa_sigaction = fpecatch; - sa.sa_flags = SA_SIGINFO; - sigemptyset(&sa.sa_mask); - (void)sigaction(SIGFPE, &sa, NULL); +#ifdef SA_SIGINFO + { + struct sigaction sa; + sa.sa_sigaction = fpecatch; + sa.sa_flags = SA_SIGINFO; + sigemptyset(&sa.sa_mask); + (void)sigaction(SIGFPE, &sa, NULL); + } +#else + (void)signal(SIGFPE, fpecatch); +#endif + /*signal(SIGSEGV, segvcatch); experiment */ /* Set and keep track of the random seed */ srand_seed = 1; @@ -170,6 +156,12 @@ int _awk(int argc, char *argv[]) argv++; break; } + if (strcmp(argv[1], "--csv") == 0) { /* turn on csv input processing */ + CSV = true; + argc--; + argv++; + continue; + } switch (argv[1][1]) { case 's': if (strcmp(argv[1], "-safe") == 0) @@ -208,6 +200,10 @@ int _awk(int argc, char *argv[]) argc--; argv++; } + + if (CSV && (fs != NULL || lookup("FS", symtab) != NULL)) + WARNING("danger: don't set FS when --csv is in effect"); + /* argv[1] is now the first argument */ if (npfile == 0) { /* no -f; first argument is program */ if (argc <= 1) { @@ -229,6 +225,11 @@ int _awk(int argc, char *argv[]) if (!safe) envinit(environ); yyparse(); +#if 0 + // Doing this would comply with POSIX, but is not compatible with + // other awks and with what most users expect. So comment it out. + setlocale(LC_NUMERIC, ""); /* back to whatever it is locally */ +#endif if (fs) *FS = qstring(fs, '\0'); DPRINTF("errorflag=%d\n", errorflag); diff --git a/third_party/awk/maketab.c b/third_party/awk/maketab.c index 68b3f4f95..3747efa03 100644 --- a/third_party/awk/maketab.c +++ b/third_party/awk/maketab.c @@ -1,36 +1,26 @@ -/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ -│ vi: set noet ft=c ts=8 sw=8 fenc=utf-8 :vi │ -╚──────────────────────────────────────────────────────────────────────────────╝ -│ │ -│ Copyright (C) Lucent Technologies 1997 │ -│ All Rights Reserved │ -│ │ -│ Permission to use, copy, modify, and distribute this software and │ -│ its documentation for any purpose and without fee is hereby │ -│ granted, provided that the above copyright notice appear in all │ -│ copies and that both that the copyright notice and this │ -│ permission notice and warranty disclaimer appear in supporting │ -│ documentation, and that the name Lucent Technologies or any of │ -│ its entities not be used in advertising or publicity pertaining │ -│ to distribution of the software without specific, written prior │ -│ permission. │ -│ │ -│ LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, │ -│ INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. │ -│ IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY │ -│ SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES │ -│ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER │ -│ IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, │ -│ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF │ -│ THIS SOFTWARE. │ -│ │ -╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/mem/mem.h" -#include "libc/runtime/runtime.h" -#include "libc/stdio/stdio.h" -#include "libc/str/str.h" -#include "third_party/awk/awk.h" -#include "third_party/awk/awkgram.tab.h" +/**************************************************************** +Copyright (C) Lucent Technologies 1997 +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name Lucent Technologies or any of +its entities not be used in advertising or publicity pertaining +to distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. +****************************************************************/ /* * this program makes the table to link function names @@ -38,6 +28,12 @@ * it finds the indices in awkgram.tab.h, produced by bison. */ +#include +#include +#include +#include "awk.h" +#include "awkgram.tab.h" + struct xx { int token; const char *name; @@ -56,8 +52,8 @@ struct xx { ARRAY, "array", NULL }, { INDIRECT, "indirect", "$(" }, { SUBSTR, "substr", "substr" }, - { SUB, "sub", "sub" }, - { GSUB, "gsub", "gsub" }, + { SUB, "dosub", "sub" }, + { GSUB, "dosub", "gsub" }, { INDEX, "sindex", "sindex" }, { SPRINTF, "awksprintf", "sprintf " }, { ADD, "arith", " + " }, diff --git a/third_party/awk/parse.c b/third_party/awk/parse.c index 04ad4faf3..14608be75 100644 --- a/third_party/awk/parse.c +++ b/third_party/awk/parse.c @@ -1,37 +1,35 @@ -/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ -│ vi: set noet ft=c ts=8 sw=8 fenc=utf-8 :vi │ -╚──────────────────────────────────────────────────────────────────────────────╝ -│ │ -│ Copyright (C) Lucent Technologies 1997 │ -│ All Rights Reserved │ -│ │ -│ Permission to use, copy, modify, and distribute this software and │ -│ its documentation for any purpose and without fee is hereby │ -│ granted, provided that the above copyright notice appear in all │ -│ copies and that both that the copyright notice and this │ -│ permission notice and warranty disclaimer appear in supporting │ -│ documentation, and that the name Lucent Technologies or any of │ -│ its entities not be used in advertising or publicity pertaining │ -│ to distribution of the software without specific, written prior │ -│ permission. │ -│ │ -│ LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, │ -│ INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. │ -│ IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY │ -│ SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES │ -│ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER │ -│ IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, │ -│ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF │ -│ THIS SOFTWARE. │ -│ │ -╚─────────────────────────────────────────────────────────────────────────────*/ -#define DEBUG -#include "libc/mem/mem.h" -#include "libc/str/str.h" -#include "third_party/awk/awk.h" -#include "third_party/awk/awkgram.tab.h" +/**************************************************************** +Copyright (C) Lucent Technologies 1997 +All Rights Reserved -Node *nodealloc(int n) +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name Lucent Technologies or any of +its entities not be used in advertising or publicity pertaining +to distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. +****************************************************************/ + +#define DEBUG +#include +#include +#include +#include "awk.h" +#include "awkgram.tab.h" + +Node *nodealloc(size_t n) { Node *x; diff --git a/third_party/awk/proctab.c b/third_party/awk/proctab.c index e36c5c814..3b6eb7643 100644 --- a/third_party/awk/proctab.c +++ b/third_party/awk/proctab.c @@ -1,32 +1,6 @@ -/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ -│ vi: set noet ft=c ts=8 sw=8 fenc=utf-8 :vi │ -╚──────────────────────────────────────────────────────────────────────────────╝ -│ │ -│ Copyright (C) Lucent Technologies 1997 │ -│ All Rights Reserved │ -│ │ -│ Permission to use, copy, modify, and distribute this software and │ -│ its documentation for any purpose and without fee is hereby │ -│ granted, provided that the above copyright notice appear in all │ -│ copies and that both that the copyright notice and this │ -│ permission notice and warranty disclaimer appear in supporting │ -│ documentation, and that the name Lucent Technologies or any of │ -│ its entities not be used in advertising or publicity pertaining │ -│ to distribution of the software without specific, written prior │ -│ permission. │ -│ │ -│ LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, │ -│ INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. │ -│ IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY │ -│ SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES │ -│ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER │ -│ IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, │ -│ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF │ -│ THIS SOFTWARE. │ -│ │ -╚─────────────────────────────────────────────────────────────────────────────*/ -#include "third_party/awk/awk.h" -#include "third_party/awk/awkgram.tab.h" +#include +#include "awk.h" +#include "awkgram.tab.h" static const char * const printname[95] = { "FIRSTTOKEN", /* 258 */ @@ -171,8 +145,8 @@ Cell *(*proctab[95])(Node **, int) = { jump, /* EXIT */ forstat, /* FOR */ nullproc, /* FUNC */ - sub, /* SUB */ - gsub, /* GSUB */ + dosub, /* SUB */ + dosub, /* GSUB */ ifstat, /* IF */ sindex, /* INDEX */ nullproc, /* LSUBSTR */ diff --git a/third_party/awk/proto.h b/third_party/awk/proto.h new file mode 100644 index 000000000..ed63e7875 --- /dev/null +++ b/third_party/awk/proto.h @@ -0,0 +1,204 @@ +/**************************************************************** +Copyright (C) Lucent Technologies 1997 +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name Lucent Technologies or any of +its entities not be used in advertising or publicity pertaining +to distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. +****************************************************************/ + +extern int yywrap(void); +extern void setfname(Cell *); +extern int constnode(Node *); +extern char *strnode(Node *); +extern Node *notnull(Node *); +extern int yyparse(void); + +extern int yylex(void); +extern void startreg(void); +extern int input(void); +extern void unput(int); +extern void unputstr(const char *); +extern int yylook(void); +extern int yyback(int *, int); +extern int yyinput(void); + +extern fa *makedfa(const char *, bool); +extern fa *mkdfa(const char *, bool); +extern int makeinit(fa *, bool); +extern void penter(Node *); +extern void freetr(Node *); +extern int quoted(const uschar **); +extern int *cclenter(const char *); +extern noreturn void overflo(const char *); +extern void cfoll(fa *, Node *); +extern int first(Node *); +extern void follow(Node *); +extern int member(int, int *); +extern int match(fa *, const char *); +extern int pmatch(fa *, const char *); +extern int nematch(fa *, const char *); +extern bool fnematch(fa *, FILE *, char **, int *, int); +extern Node *reparse(const char *); +extern Node *regexp(void); +extern Node *primary(void); +extern Node *concat(Node *); +extern Node *alt(Node *); +extern Node *unary(Node *); +extern int relex(void); +extern int cgoto(fa *, int, int); +extern void freefa(fa *); + +extern int pgetc(void); +extern char *cursource(void); + +extern Node *nodealloc(size_t); +extern Node *exptostat(Node *); +extern Node *node1(int, Node *); +extern Node *node2(int, Node *, Node *); +extern Node *node3(int, Node *, Node *, Node *); +extern Node *node4(int, Node *, Node *, Node *, Node *); +extern Node *stat3(int, Node *, Node *, Node *); +extern Node *op2(int, Node *, Node *); +extern Node *op1(int, Node *); +extern Node *stat1(int, Node *); +extern Node *op3(int, Node *, Node *, Node *); +extern Node *op4(int, Node *, Node *, Node *, Node *); +extern Node *stat2(int, Node *, Node *); +extern Node *stat4(int, Node *, Node *, Node *, Node *); +extern Node *celltonode(Cell *, int); +extern Node *rectonode(void); +extern Node *makearr(Node *); +extern Node *pa2stat(Node *, Node *, Node *); +extern Node *linkum(Node *, Node *); +extern void defn(Cell *, Node *, Node *); +extern int isarg(const char *); +extern const char *tokname(int); +extern Cell *(*proctab[])(Node **, int); +extern int ptoi(void *); +extern Node *itonp(int); + +extern void syminit(void); +extern void arginit(int, char **); +extern void envinit(char **); +extern Array *makesymtab(int); +extern void freesymtab(Cell *); +extern void freeelem(Cell *, const char *); +extern Cell *setsymtab(const char *, const char *, double, unsigned int, Array *); +extern int hash(const char *, int); +extern void rehash(Array *); +extern Cell *lookup(const char *, Array *); +extern double setfval(Cell *, double); +extern void funnyvar(Cell *, const char *); +extern char *setsval(Cell *, const char *); +extern double getfval(Cell *); +extern char *getsval(Cell *); +extern char *getpssval(Cell *); /* for print */ +extern char *tostring(const char *); +extern char *tostringN(const char *, size_t); +extern char *qstring(const char *, int); +extern Cell *catstr(Cell *, Cell *); + +extern void recinit(unsigned int); +extern void initgetrec(void); +extern void makefields(int, int); +extern void growfldtab(int n); +extern void savefs(void); +extern int getrec(char **, int *, bool); +extern void nextfile(void); +extern int readrec(char **buf, int *bufsize, FILE *inf, bool isnew); +extern char *getargv(int); +extern void setclvar(char *); +extern void fldbld(void); +extern void cleanfld(int, int); +extern void newfld(int); +extern void setlastfld(int); +extern int refldbld(const char *, const char *); +extern void recbld(void); +extern Cell *fieldadr(int); +extern void yyerror(const char *); +extern void bracecheck(void); +extern void bcheck2(int, int, int); +extern void SYNTAX(const char *, ...) + __attribute__((__format__(__printf__, 1, 2))); +extern noreturn void FATAL(const char *, ...) + __attribute__((__format__(__printf__, 1, 2))); +extern void WARNING(const char *, ...) + __attribute__((__format__(__printf__, 1, 2))); +extern void error(void); +extern void eprint(void); +extern void bclass(int); +extern double errcheck(double, const char *); +extern int isclvar(const char *); +extern bool is_valid_number(const char *s, bool trailing_stuff_ok, + bool *no_trailing, double *result); +#define is_number(s, val) is_valid_number(s, false, NULL, val) + +extern int adjbuf(char **pb, int *sz, int min, int q, char **pbp, const char *what); +extern void run(Node *); +extern Cell *execute(Node *); +extern Cell *program(Node **, int); +extern Cell *call(Node **, int); +extern Cell *copycell(Cell *); +extern Cell *arg(Node **, int); +extern Cell *jump(Node **, int); +extern Cell *awkgetline(Node **, int); +extern Cell *getnf(Node **, int); +extern Cell *array(Node **, int); +extern Cell *awkdelete(Node **, int); +extern Cell *intest(Node **, int); +extern Cell *matchop(Node **, int); +extern Cell *boolop(Node **, int); +extern Cell *relop(Node **, int); +extern void tfree(Cell *); +extern Cell *gettemp(void); +extern Cell *field(Node **, int); +extern Cell *indirect(Node **, int); +extern Cell *substr(Node **, int); +extern Cell *sindex(Node **, int); +extern int format(char **, int *, const char *, Node *); +extern Cell *awksprintf(Node **, int); +extern Cell *awkprintf(Node **, int); +extern Cell *arith(Node **, int); +extern double ipow(double, int); +extern Cell *incrdecr(Node **, int); +extern Cell *assign(Node **, int); +extern Cell *cat(Node **, int); +extern Cell *pastat(Node **, int); +extern Cell *dopa2(Node **, int); +extern Cell *split(Node **, int); +extern Cell *condexpr(Node **, int); +extern Cell *ifstat(Node **, int); +extern Cell *whilestat(Node **, int); +extern Cell *dostat(Node **, int); +extern Cell *forstat(Node **, int); +extern Cell *instat(Node **, int); +extern Cell *bltin(Node **, int); +extern Cell *printstat(Node **, int); +extern Cell *nullproc(Node **, int); +extern FILE *redirect(int, Node *); +extern FILE *openfile(int, const char *, bool *); +extern const char *filename(FILE *); +extern Cell *closefile(Node **, int); +extern void closeall(void); +extern Cell *dosub(Node **, int); + +extern FILE *popen(const char *, const char *); +extern int pclose(FILE *); + +extern const char *flags2str(int flags); diff --git a/third_party/awk/run.c b/third_party/awk/run.c index 1ee408e4d..e0ab6208d 100644 --- a/third_party/awk/run.c +++ b/third_party/awk/run.c @@ -1,47 +1,48 @@ -/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ -│ vi: set noet ft=c ts=8 sw=8 fenc=utf-8 :vi │ -╚──────────────────────────────────────────────────────────────────────────────╝ -│ │ -│ Copyright (C) Lucent Technologies 1997 │ -│ All Rights Reserved │ -│ │ -│ Permission to use, copy, modify, and distribute this software and │ -│ its documentation for any purpose and without fee is hereby │ -│ granted, provided that the above copyright notice appear in all │ -│ copies and that both that the copyright notice and this │ -│ permission notice and warranty disclaimer appear in supporting │ -│ documentation, and that the name Lucent Technologies or any of │ -│ its entities not be used in advertising or publicity pertaining │ -│ to distribution of the software without specific, written prior │ -│ permission. │ -│ │ -│ LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, │ -│ INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. │ -│ IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY │ -│ SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES │ -│ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER │ -│ IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, │ -│ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF │ -│ THIS SOFTWARE. │ -│ │ -╚─────────────────────────────────────────────────────────────────────────────*/ +/**************************************************************** +Copyright (C) Lucent Technologies 1997 +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name Lucent Technologies or any of +its entities not be used in advertising or publicity pertaining +to distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. +****************************************************************/ + #define DEBUG -#include "libc/calls/calls.h" -#include "libc/calls/weirdtypes.h" -#include "libc/errno.h" -#include "libc/fmt/conv.h" -#include "libc/mem/mem.h" -#include "libc/runtime/runtime.h" -#include "libc/str/str.h" -#include "libc/sysv/consts/f.h" -#include "libc/sysv/consts/fd.h" -#include "libc/time/time.h" -#include "third_party/awk/awk.h" -#include "third_party/awk/awkgram.tab.h" -#include "third_party/libcxx/math.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "awk.h" +#include "awkgram.tab.h" + static void stdinit(void); static void flush_all(void); +static char *wide_char_to_byte_str(int rune, size_t *outlen); #if 1 #define tempfree(x) do { if (istemp(x)) tfree(x); } while (/*CONSTCOND*/0) @@ -56,7 +57,23 @@ void tempfree(Cell *p) { } #endif +/* do we really need these? */ +/* #ifdef _NFILE */ +/* #ifndef FOPEN_MAX */ +/* #define FOPEN_MAX _NFILE */ +/* #endif */ +/* #endif */ +/* */ +/* #ifndef FOPEN_MAX */ +/* #define FOPEN_MAX 40 */ /* max number of open files */ +/* #endif */ +/* */ +/* #ifndef RAND_MAX */ +/* #define RAND_MAX 32767 */ /* all that ansi guarantees */ +/* #endif */ + jmp_buf env; +extern int pairstack[]; extern Awkfloat srand_seed; Node *winner = NULL; /* root of parse tree */ @@ -103,8 +120,7 @@ int adjbuf(char **pbuf, int *psiz, int minlen, int quantum, char **pbptr, if (rminlen) minlen += quantum - rminlen; tbuf = (char *) realloc(*pbuf, minlen); - // [jart] use after free error - // DPRINTF("adjbuf %s: %d %d (pbuf=%p, tbuf=%p)\n", whatrtn, *psiz, minlen, (void*)*pbuf, (void*)tbuf); + DPRINTF("adjbuf %s: %d %d (pbuf=%p, tbuf=%p)\n", whatrtn, *psiz, minlen, (void*)*pbuf, (void*)tbuf); if (tbuf == NULL) { if (whatrtn) FATAL("out of memory in %s", whatrtn); @@ -564,11 +580,225 @@ Cell *intest(Node **a, int n) /* a[0] is index (list), a[1] is symtab */ } +/* ======== utf-8 code ========== */ + +/* + * Awk strings can contain ascii, random 8-bit items (eg Latin-1), + * or utf-8. u8_isutf tests whether a string starts with a valid + * utf-8 sequence, and returns 0 if not (e.g., high bit set). + * u8_nextlen returns length of next valid sequence, which is + * 1 for ascii, 2..4 for utf-8, or 1 for high bit non-utf. + * u8_strlen returns length of string in valid utf-8 sequences + * and/or high-bit bytes. Conversion functions go between byte + * number and character number. + * + * In theory, this behaves the same as before for non-utf8 bytes. + * + * Limited checking! This is a potential security hole. + */ + +/* is s the beginning of a valid utf-8 string? */ +/* return length 1..4 if yes, 0 if no */ +int u8_isutf(const char *s) +{ + int n, ret; + unsigned char c; + + c = s[0]; + if (c < 128 || awk_mb_cur_max == 1) + return 1; /* what if it's 0? */ + + n = strlen(s); + if (n >= 2 && ((c>>5) & 0x7) == 0x6 && (s[1] & 0xC0) == 0x80) { + ret = 2; /* 110xxxxx 10xxxxxx */ + } else if (n >= 3 && ((c>>4) & 0xF) == 0xE && (s[1] & 0xC0) == 0x80 + && (s[2] & 0xC0) == 0x80) { + ret = 3; /* 1110xxxx 10xxxxxx 10xxxxxx */ + } else if (n >= 4 && ((c>>3) & 0x1F) == 0x1E && (s[1] & 0xC0) == 0x80 + && (s[2] & 0xC0) == 0x80 && (s[3] & 0xC0) == 0x80) { + ret = 4; /* 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */ + } else { + ret = 0; + } + return ret; +} + +/* Convert (prefix of) utf8 string to utf-32 rune. */ +/* Sets *rune to the value, returns the length. */ +/* No error checking: watch out. */ +int u8_rune(int *rune, const char *s) +{ + int n, ret; + unsigned char c; + + c = s[0]; + if (c < 128 || awk_mb_cur_max == 1) { + *rune = c; + return 1; + } + + n = strlen(s); + if (n >= 2 && ((c>>5) & 0x7) == 0x6 && (s[1] & 0xC0) == 0x80) { + *rune = ((c & 0x1F) << 6) | (s[1] & 0x3F); /* 110xxxxx 10xxxxxx */ + ret = 2; + } else if (n >= 3 && ((c>>4) & 0xF) == 0xE && (s[1] & 0xC0) == 0x80 + && (s[2] & 0xC0) == 0x80) { + *rune = ((c & 0xF) << 12) | ((s[1] & 0x3F) << 6) | (s[2] & 0x3F); + /* 1110xxxx 10xxxxxx 10xxxxxx */ + ret = 3; + } else if (n >= 4 && ((c>>3) & 0x1F) == 0x1E && (s[1] & 0xC0) == 0x80 + && (s[2] & 0xC0) == 0x80 && (s[3] & 0xC0) == 0x80) { + *rune = ((c & 0x7) << 18) | ((s[1] & 0x3F) << 12) | ((s[2] & 0x3F) << 6) | (s[3] & 0x3F); + /* 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */ + ret = 4; + } else { + *rune = c; + ret = 1; + } + return ret; /* returns one byte if sequence doesn't look like utf */ +} + +/* return length of next sequence: 1 for ascii or random, 2..4 for valid utf8 */ +int u8_nextlen(const char *s) +{ + int len; + + len = u8_isutf(s); + if (len == 0) + len = 1; + return len; +} + +/* return number of utf characters or single non-utf bytes */ +int u8_strlen(const char *s) +{ + int i, len, n, totlen; + unsigned char c; + + n = strlen(s); + totlen = 0; + for (i = 0; i < n; i += len) { + c = s[i]; + if (c < 128 || awk_mb_cur_max == 1) { + len = 1; + } else { + len = u8_nextlen(&s[i]); + } + totlen++; + if (i > n) + FATAL("bad utf count [%s] n=%d i=%d\n", s, n, i); + } + return totlen; +} + +/* convert utf-8 char number in a string to its byte offset */ +int u8_char2byte(const char *s, int charnum) +{ + int n; + int bytenum = 0; + + while (charnum > 0) { + n = u8_nextlen(s); + s += n; + bytenum += n; + charnum--; + } + return bytenum; +} + +/* convert byte offset in s to utf-8 char number that starts there */ +int u8_byte2char(const char *s, int bytenum) +{ + int i, len, b; + int charnum = 0; /* BUG: what origin? */ + /* should be 0 to match start==0 which means no match */ + + b = strlen(s); + if (bytenum > b) { + return -1; /* ??? */ + } + for (i = 0; i <= bytenum; i += len) { + len = u8_nextlen(s+i); + charnum++; + } + return charnum; +} + +/* runetochar() adapted from rune.c in the Plan 9 distributione */ + +enum +{ + Runeerror = 128, /* from somewhere else */ + Runemax = 0x10FFFF, + + Bit1 = 7, + Bitx = 6, + Bit2 = 5, + Bit3 = 4, + Bit4 = 3, + Bit5 = 2, + + T1 = ((1<<(Bit1+1))-1) ^ 0xFF, /* 0000 0000 */ + Tx = ((1<<(Bitx+1))-1) ^ 0xFF, /* 1000 0000 */ + T2 = ((1<<(Bit2+1))-1) ^ 0xFF, /* 1100 0000 */ + T3 = ((1<<(Bit3+1))-1) ^ 0xFF, /* 1110 0000 */ + T4 = ((1<<(Bit4+1))-1) ^ 0xFF, /* 1111 0000 */ + T5 = ((1<<(Bit5+1))-1) ^ 0xFF, /* 1111 1000 */ + + Rune1 = (1<<(Bit1+0*Bitx))-1, /* 0000 0000 0000 0000 0111 1111 */ + Rune2 = (1<<(Bit2+1*Bitx))-1, /* 0000 0000 0000 0111 1111 1111 */ + Rune3 = (1<<(Bit3+2*Bitx))-1, /* 0000 0000 1111 1111 1111 1111 */ + Rune4 = (1<<(Bit4+3*Bitx))-1, /* 0011 1111 1111 1111 1111 1111 */ + + Maskx = (1< 00-7F */ + if (c <= Rune1) { + str[0] = c; + return 1; + } + + /* two character sequence 00080-007FF => T2 Tx */ + if (c <= Rune2) { + str[0] = T2 | (c >> 1*Bitx); + str[1] = Tx | (c & Maskx); + return 2; + } + + /* three character sequence 00800-0FFFF => T3 Tx Tx */ + if (c > Runemax) + c = Runeerror; + if (c <= Rune3) { + str[0] = T3 | (c >> 2*Bitx); + str[1] = Tx | ((c >> 1*Bitx) & Maskx); + str[2] = Tx | (c & Maskx); + return 3; + } + + /* four character sequence 010000-1FFFFF => T4 Tx Tx Tx */ + str[0] = T4 | (c >> 3*Bitx); + str[1] = Tx | ((c >> 2*Bitx) & Maskx); + str[2] = Tx | ((c >> 1*Bitx) & Maskx); + str[3] = Tx | (c & Maskx); + return 4; +} + + +/* ========== end of utf8 code =========== */ + + + Cell *matchop(Node **a, int n) /* ~ and match() */ { - Cell *x, *y; + Cell *x, *y, *z; char *s, *t; int i; + int cstart, cpatlen, len; fa *pfa; int (*mf)(fa *, const char *) = match, mode = 0; @@ -587,21 +817,35 @@ Cell *matchop(Node **a, int n) /* ~ and match() */ i = (*mf)(pfa, s); tempfree(y); } - tempfree(x); + z = x; if (n == MATCHFCN) { - int start = patbeg - s + 1; - if (patlen < 0) - start = 0; + int start = patbeg - s + 1; /* origin 1 */ + if (patlen < 0) { + start = 0; /* not found */ + } else { + cstart = u8_byte2char(s, start-1); + cpatlen = 0; + for (i = 0; i < patlen; i += len) { + len = u8_nextlen(patbeg+i); + cpatlen++; + } + + start = cstart; + patlen = cpatlen; + } + setfval(rstartloc, (Awkfloat) start); setfval(rlengthloc, (Awkfloat) patlen); x = gettemp(); x->tval = NUM; x->fval = start; - return x; } else if ((n == MATCH && i == 1) || (n == NOTMATCH && i == 0)) - return(True); + x = True; else - return(False); + x = False; + + tempfree(z); + return x; } @@ -642,10 +886,15 @@ Cell *relop(Node **a, int n) /* a[0 < a[1], etc. */ int i; Cell *x, *y; Awkfloat j; + bool x_is_nan, y_is_nan; x = execute(a[0]); y = execute(a[1]); + x_is_nan = isnan(x->fval); + y_is_nan = isnan(y->fval); if (x->tval&NUM && y->tval&NUM) { + if ((x_is_nan || y_is_nan) && n != NE) + return(False); j = x->fval - y->fval; i = j<0? -1: (j>0? 1: 0); } else { @@ -658,7 +907,8 @@ Cell *relop(Node **a, int n) /* a[0 < a[1], etc. */ else return(False); case LE: if (i<=0) return(True); else return(False); - case NE: if (i!=0) return(True); + case NE: if (x_is_nan && y_is_nan) return(True); + else if (i!=0) return(True); else return(False); case EQ: if (i == 0) return(True); else return(False); @@ -727,6 +977,7 @@ Cell *indirect(Node **a, int n) /* $( a[0] ) */ Cell *substr(Node **a, int nnn) /* substr(a[0], a[1], a[2]) */ { int k, m, n; + int mb, nb; char *s; int temp; Cell *x, *y, *z = NULL; @@ -736,7 +987,7 @@ Cell *substr(Node **a, int nnn) /* substr(a[0], a[1], a[2]) */ if (a[2] != NULL) z = execute(a[2]); s = getsval(x); - k = strlen(s) + 1; + k = u8_strlen(s) + 1; if (k <= 1) { tempfree(x); tempfree(y); @@ -762,12 +1013,16 @@ Cell *substr(Node **a, int nnn) /* substr(a[0], a[1], a[2]) */ n = 0; else if (n > k - m) n = k - m; + /* m is start, n is length from there */ DPRINTF("substr: m=%d, n=%d, s=%s\n", m, n, s); y = gettemp(); - temp = s[n+m-1]; /* with thanks to John Linderman */ - s[n+m-1] = '\0'; - setsval(y, s + m - 1); - s[n+m-1] = temp; + mb = u8_char2byte(s, m-1); /* byte offset of start char in s */ + nb = u8_char2byte(s, m-1+n); /* byte offset of end+1 char in s */ + + temp = s[nb]; /* with thanks to John Linderman */ + s[nb] = '\0'; + setsval(y, s + mb); + s[nb] = temp; tempfree(x); return(y); } @@ -788,7 +1043,15 @@ Cell *sindex(Node **a, int nnn) /* index(a[0], a[1]) */ for (q = p1, p2 = s2; *p2 != '\0' && *q == *p2; q++, p2++) continue; if (*p2 == '\0') { - v = (Awkfloat) (p1 - s1 + 1); /* origin 1 */ + /* v = (Awkfloat) (p1 - s1 + 1); origin 1 */ + + /* should be a function: used in match() as well */ + int i, len; + v = 0; + for (i = 0; i < p1-s1+1; i += len) { + len = u8_nextlen(s1+i); + v++; + } break; } } @@ -798,6 +1061,18 @@ Cell *sindex(Node **a, int nnn) /* index(a[0], a[1]) */ return(z); } +int has_utf8(char *s) /* return 1 if s contains any utf-8 (2 bytes or more) character */ +{ + int n; + + for (n = 0; *s != 0; s += n) { + n = u8_nextlen(s); + if (n > 1) + return 1; + } + return 0; +} + #define MAXNUMSIZE 50 int format(char **pbuf, int *pbufsize, const char *s, Node *a) /* printf-like conversions */ @@ -840,7 +1115,6 @@ int format(char **pbuf, int *pbufsize, const char *s, Node *a) /* printf-like co s += 2; continue; } - /* have to be real careful in case this is a huge number, eg, %100000d */ fmtwd = atoi(s+1); if (fmtwd < 0) fmtwd = -fmtwd; @@ -913,7 +1187,8 @@ int format(char **pbuf, int *pbufsize, const char *s, Node *a) /* printf-like co n = fmtwd; adjbuf(&buf, &bufsize, 1+n+p-buf, recsize, &p, "format5"); switch (flag) { - case '?': snprintf(p, BUFSZ(p), "%s", fmt); /* unknown, so dump it too */ + case '?': + snprintf(p, BUFSZ(p), "%s", fmt); /* unknown, so dump it too */ t = getsval(x); n = strlen(t); if (fmtwd > n) @@ -927,37 +1202,187 @@ int format(char **pbuf, int *pbufsize, const char *s, Node *a) /* printf-like co case 'f': snprintf(p, BUFSZ(p), fmt, getfval(x)); break; case 'd': snprintf(p, BUFSZ(p), fmt, (intmax_t) getfval(x)); break; case 'u': snprintf(p, BUFSZ(p), fmt, (uintmax_t) getfval(x)); break; - case 's': + + case 's': { t = getsval(x); n = strlen(t); - if (fmtwd > n) - n = fmtwd; - if (!adjbuf(&buf, &bufsize, 1+n+p-buf, recsize, &p, "format7")) - FATAL("huge string/format (%d chars) in printf %.30s... ran format() out of memory", n, t); - snprintf(p, BUFSZ(p), fmt, t); + /* if simple format or no utf-8 in the string, sprintf works */ + if (!has_utf8(t) || strcmp(fmt,"%s") == 0) { + if (fmtwd > n) + n = fmtwd; + if (!adjbuf(&buf, &bufsize, 1+n+p-buf, recsize, &p, "format7")) + FATAL("huge string/format (%d chars) in printf %.30s..." \ + " ran format() out of memory", n, t); + snprintf(p, BUFSZ(p), fmt, t); + break; + } + + /* get here if string has utf-8 chars and fmt is not plain %s */ + /* "%-w.ps", where -, w and .p are all optional */ + /* '0' before the w is a flag character */ + /* fmt points at % */ + int ljust = 0, wid = 0, prec = n, pad = 0; + char *f = fmt+1; + if (f[0] == '-') { + ljust = 1; + f++; + } + // flags '0' and '+' are recognized but skipped + if (f[0] == '0') { + f++; + if (f[0] == '+') + f++; + } + if (f[0] == '+') { + f++; + if (f[0] == '0') + f++; + } + if (isdigit(f[0])) { /* there is a wid */ + wid = strtol(f, &f, 10); + } + if (f[0] == '.') { /* there is a .prec */ + prec = strtol(++f, &f, 10); + } + if (prec > u8_strlen(t)) + prec = u8_strlen(t); + pad = wid>prec ? wid - prec : 0; // has to be >= 0 + int i, k, n; + + if (ljust) { // print prec chars from t, then pad blanks + n = u8_char2byte(t, prec); + for (k = 0; k < n; k++) { + //putchar(t[k]); + *p++ = t[k]; + } + for (i = 0; i < pad; i++) { + //printf(" "); + *p++ = ' '; + } + } else { // print pad blanks, then prec chars from t + for (i = 0; i < pad; i++) { + //printf(" "); + *p++ = ' '; + } + n = u8_char2byte(t, prec); + for (k = 0; k < n; k++) { + //putchar(t[k]); + *p++ = t[k]; + } + } + *p = 0; break; - case 'c': + } + + case 'c': { + /* + * If a numeric value is given, awk should just turn + * it into a character and print it: + * BEGIN { printf("%c\n", 65) } + * prints "A". + * + * But what if the numeric value is > 128 and + * represents a valid Unicode code point?!? We do + * our best to convert it back into UTF-8. If we + * can't, we output the encoding of the Unicode + * "invalid character", 0xFFFD. + */ if (isnum(x)) { - if ((int)getfval(x)) - snprintf(p, BUFSZ(p), fmt, (int) getfval(x)); - else { + int charval = (int) getfval(x); + + if (charval != 0) { + if (charval < 128 || awk_mb_cur_max == 1) + snprintf(p, BUFSZ(p), fmt, charval); + else { + // possible unicode character + size_t count; + char *bs = wide_char_to_byte_str(charval, &count); + + if (bs == NULL) { // invalid character + // use unicode invalid character, 0xFFFD + static char invalid_char[] = "\357\277\275"; + bs = invalid_char; + count = 3; + } + t = bs; + n = count; + goto format_percent_c; + } + } else { *p++ = '\0'; /* explicit null byte */ *p = '\0'; /* next output will start here */ } - } else + break; + } + t = getsval(x); + n = u8_nextlen(t); + format_percent_c: + if (n < 2) { /* not utf8 */ snprintf(p, BUFSZ(p), fmt, getsval(x)[0]); + break; + } + + // utf8 character, almost same song and dance as for %s + int ljust = 0, wid = 0, prec = n, pad = 0; + char *f = fmt+1; + if (f[0] == '-') { + ljust = 1; + f++; + } + // flags '0' and '+' are recognized but skipped + if (f[0] == '0') { + f++; + if (f[0] == '+') + f++; + } + if (f[0] == '+') { + f++; + if (f[0] == '0') + f++; + } + if (isdigit(f[0])) { /* there is a wid */ + wid = strtol(f, &f, 10); + } + if (f[0] == '.') { /* there is a .prec */ + prec = strtol(++f, &f, 10); + } + if (prec > 1) // %c --> only one character + prec = 1; + pad = wid>prec ? wid - prec : 0; // has to be >= 0 + int i; + + if (ljust) { // print one char from t, then pad blanks + for (i = 0; i < n; i++) + *p++ = t[i]; + for (i = 0; i < pad; i++) { + //printf(" "); + *p++ = ' '; + } + } else { // print pad blanks, then prec chars from t + for (i = 0; i < pad; i++) { + //printf(" "); + *p++ = ' '; + } + for (i = 0; i < n; i++) + *p++ = t[i]; + } + *p = 0; break; + } default: FATAL("can't happen: bad conversion %c in format()", flag); } + tempfree(x); p += strlen(p); s++; } *p = '\0'; free(fmt); - for ( ; a; a = a->nnext) /* evaluate any remaining args */ - execute(a); + for ( ; a; a = a->nnext) { /* evaluate any remaining args */ + x = execute(a); + tempfree(x); + } *pbuf = buf; *pbufsize = bufsize; return p - buf; @@ -1118,8 +1543,9 @@ Cell *assign(Node **a, int n) /* a[0] = a[1], a[0] += a[1], etc. */ if (x == y && !(x->tval & (FLD|REC)) && x != nfloc) ; /* self-assignment: leave alone unless it's a field or NF */ else if ((y->tval & (STR|NUM)) == (STR|NUM)) { + yf = getfval(y); setsval(x, getsval(y)); - x->fval = getfval(y); + x->fval = yf; x->tval |= NUM; } else if (isstr(y)) @@ -1180,16 +1606,17 @@ Cell *cat(Node **a, int q) /* a[0] cat a[1] */ x = execute(a[0]); n1 = strlen(getsval(x)); - adjbuf(&s, &ssz, n1, recsize, 0, "cat1"); + adjbuf(&s, &ssz, n1 + 1, recsize, 0, "cat1"); memcpy(s, x->sval, n1); + tempfree(x); + y = execute(a[1]); n2 = strlen(getsval(y)); adjbuf(&s, &ssz, n1 + n2 + 1, recsize, 0, "cat2"); memcpy(s + n1, y->sval, n2); s[n1 + n2] = '\0'; - tempfree(x); tempfree(y); z = gettemp(); @@ -1247,23 +1674,27 @@ Cell *split(Node **a, int nnn) /* split(a[0], a[1], a[2]); a[3] is type */ int sep; char temp, num[50]; int n, tempstat, arg3type; + int j; double result; y = execute(a[0]); /* source string */ origs = s = strdup(getsval(y)); + tempfree(y); arg3type = ptoi(a[3]); - if (a[2] == NULL) /* fs string */ + if (a[2] == NULL) { /* BUG: CSV should override implicit fs but not explicit */ fs = getsval(fsloc); - else if (arg3type == STRING) { /* split(str,arr,"string") */ + } else if (arg3type == STRING) { /* split(str,arr,"string") */ x = execute(a[2]); fs = origfs = strdup(getsval(x)); tempfree(x); - } else if (arg3type == REGEXPR) + } else if (arg3type == REGEXPR) { fs = "(regexpr)"; /* split(str,arr,/regexpr/) */ - else + } else { FATAL("illegal type of split"); + } sep = *fs; ap = execute(a[1]); /* array name */ +/* BUG 7/26/22: this appears not to reset array: see C1/asplit */ freesymtab(ap); DPRINTF("split: s=|%s|, a=%s, sep=|%s|\n", s, NN(ap->nval), fs); ap->tval &= ~STR; @@ -1317,7 +1748,41 @@ Cell *split(Node **a, int nnn) /* split(a[0], a[1], a[2]); a[3] is type */ setsymtab(num, s, 0.0, STR, (Array *) ap->sval); spdone: pfa = NULL; - } else if (sep == ' ') { + + } else if (a[2] == NULL && CSV) { /* CSV only if no explicit separator */ + char *newt = (char *) malloc(strlen(s)); /* for building new string; reuse for each field */ + for (;;) { + char *fr = newt; + n++; + if (*s == '"' ) { /* start of "..." */ + for (s++ ; *s != '\0'; ) { + if (*s == '"' && s[1] != '\0' && s[1] == '"') { + s += 2; /* doubled quote */ + *fr++ = '"'; + } else if (*s == '"' && (s[1] == '\0' || s[1] == ',')) { + s++; /* skip over closing quote */ + break; + } else { + *fr++ = *s++; + } + } + *fr++ = 0; + } else { /* unquoted field */ + while (*s != ',' && *s != '\0') + *fr++ = *s++; + *fr++ = 0; + } + snprintf(num, sizeof(num), "%d", n); + if (is_number(newt, &result)) + setsymtab(num, newt, result, STR|NUM, (Array *) ap->sval); + else + setsymtab(num, newt, 0.0, STR, (Array *) ap->sval); + if (*s++ == '\0') + break; + } + free(newt); + + } else if (!CSV && sep == ' ') { /* usual case: split on white space */ for (n = 0; ; ) { #define ISWS(c) ((c) == ' ' || (c) == '\t' || (c) == '\n') while (ISWS(*s)) @@ -1340,19 +1805,25 @@ Cell *split(Node **a, int nnn) /* split(a[0], a[1], a[2]); a[3] is type */ if (*s != '\0') s++; } + } else if (sep == 0) { /* new: split(s, a, "") => 1 char/elem */ - for (n = 0; *s != '\0'; s++) { - char buf[2]; + for (n = 0; *s != '\0'; s += u8_nextlen(s)) { + char buf[10]; n++; snprintf(num, sizeof(num), "%d", n); - buf[0] = *s; - buf[1] = '\0'; + + for (j = 0; j < u8_nextlen(s); j++) { + buf[j] = s[j]; + } + buf[j] = '\0'; + if (isdigit((uschar)buf[0])) setsymtab(num, buf, atof(buf), STR|NUM, (Array *) ap->sval); else setsymtab(num, buf, 0.0, STR, (Array *) ap->sval); } - } else if (*s != '\0') { + + } else if (*s != '\0') { /* some random single character */ for (;;) { n++; t = s; @@ -1371,7 +1842,6 @@ Cell *split(Node **a, int nnn) /* split(a[0], a[1], a[2]); a[3] is type */ } } tempfree(ap); - tempfree(y); xfree(origs); xfree(origfs); x = gettemp(); @@ -1511,7 +1981,8 @@ static char *nawk_convert(const char *s, int (*fun_c)(int), const char *ps = NULL; size_t n = 0; wchar_t wc; - size_t sz = MB_CUR_MAX; + const size_t sz = awk_mb_cur_max; + int unused; if (sz == 1) { buf = tostring(s); @@ -1531,7 +2002,7 @@ static char *nawk_convert(const char *s, int (*fun_c)(int), * doesn't work.) * Increment said variable to avoid a different warning. */ - int unused = wctomb(NULL, L'\0'); + unused = wctomb(NULL, L'\0'); unused++; ps = s; @@ -1585,6 +2056,8 @@ static char *nawk_tolower(const char *s) return nawk_convert(s, tolower, towlower); } + + Cell *bltin(Node **a, int n) /* builtin functions. a[0] is type, a[1] is arg list */ { Cell *x, *y; @@ -1595,6 +2068,7 @@ Cell *bltin(Node **a, int n) /* builtin functions. a[0] is type, a[1] is arg lis Node *nextarg; FILE *fp; int status = 0; + int estatus = 0; t = ptoi(a[0]); x = execute(a[1]); @@ -1604,7 +2078,7 @@ Cell *bltin(Node **a, int n) /* builtin functions. a[0] is type, a[1] is arg lis if (isarr(x)) u = ((Array *) x->sval)->nelem; /* GROT. should be function*/ else - u = strlen(getsval(x)); + u = u8_strlen(getsval(x)); break; case FLOG: errno = 0; @@ -1637,18 +2111,21 @@ Cell *bltin(Node **a, int n) /* builtin functions. a[0] is type, a[1] is arg lis break; case FSYSTEM: fflush(stdout); /* in case something is buffered already */ - status = system(getsval(x)); - u = status; + estatus = status = system(getsval(x)); if (status != -1) { if (WIFEXITED(status)) { - u = WEXITSTATUS(status); + estatus = WEXITSTATUS(status); } else if (WIFSIGNALED(status)) { - u = WTERMSIG(status) + 256; + estatus = WTERMSIG(status) + 256; +#ifdef WCOREDUMP if (WCOREDUMP(status)) - u += 256; + estatus += 256; +#endif } else /* something else?!? */ - u = 0; + estatus = 0; } + /* else estatus was set to -1 */ + u = estatus; break; case FRAND: /* random() returns numbers in [0..2^31-1] @@ -1695,8 +2172,10 @@ Cell *bltin(Node **a, int n) /* builtin functions. a[0] is type, a[1] is arg lis setfval(x, u); if (nextarg != NULL) { WARNING("warning: function has too many arguments"); - for ( ; nextarg; nextarg = nextarg->nnext) - execute(nextarg); + for ( ; nextarg; nextarg = nextarg->nnext) { + y = execute(nextarg); + tempfree(y); + } } return(x); } @@ -1924,166 +2403,143 @@ static void flush_all(void) void backsub(char **pb_ptr, const char **sptr_ptr); -Cell *sub(Node **a, int nnn) /* substitute command */ +Cell *dosub(Node **a, int subop) /* sub and gsub */ { - const char *sptr, *q; - Cell *x, *y, *result; - char *t, *buf, *pb; fa *pfa; + int tempstat = 0; + char *repl; + Cell *x; + + char *buf = NULL; + char *pb = NULL; int bufsz = recsize; - if ((buf = (char *) malloc(bufsz)) == NULL) - FATAL("out of memory in sub"); - x = execute(a[3]); /* target string */ - t = getsval(x); - if (a[0] == NULL) /* 0 => a[1] is already-compiled regexpr */ - pfa = (fa *) a[1]; /* regular expression */ - else { - y = execute(a[1]); - pfa = makedfa(getsval(y), 1); - tempfree(y); - } - y = execute(a[2]); /* replacement string */ - result = False; - if (pmatch(pfa, t)) { - sptr = t; - adjbuf(&buf, &bufsz, 1+patbeg-sptr, recsize, 0, "sub"); - pb = buf; - while (sptr < patbeg) - *pb++ = *sptr++; - sptr = getsval(y); - while (*sptr != '\0') { - adjbuf(&buf, &bufsz, 5+pb-buf, recsize, &pb, "sub"); - if (*sptr == '\\') { - backsub(&pb, &sptr); - } else if (*sptr == '&') { - sptr++; - adjbuf(&buf, &bufsz, 1+patlen+pb-buf, recsize, &pb, "sub"); - for (q = patbeg; q < patbeg+patlen; ) - *pb++ = *q++; - } else - *pb++ = *sptr++; - } - *pb = '\0'; - if (pb > buf + bufsz) - FATAL("sub result1 %.30s too big; can't happen", buf); - sptr = patbeg + patlen; - if ((patlen == 0 && *patbeg) || (patlen && *(sptr-1))) { - adjbuf(&buf, &bufsz, 1+strlen(sptr)+pb-buf, 0, &pb, "sub"); - while ((*pb++ = *sptr++) != '\0') - continue; - } - if (pb > buf + bufsz) - FATAL("sub result2 %.30s too big; can't happen", buf); - setsval(x, buf); /* BUG: should be able to avoid copy */ - result = True; + const char *r, *s; + const char *start; + const char *noempty = NULL; /* empty match disallowed here */ + size_t m = 0; /* match count */ + size_t whichm; /* which match to select, 0 = global */ + int mtype; /* match type */ + + if (a[0] == NULL) { /* 0 => a[1] is already-compiled regexpr */ + pfa = (fa *) a[1]; + } else { + x = execute(a[1]); + pfa = makedfa(getsval(x), 1); + tempfree(x); } + + x = execute(a[2]); /* replacement string */ + repl = tostring(getsval(x)); tempfree(x); - tempfree(y); - free(buf); - return result; -} -Cell *gsub(Node **a, int nnn) /* global substitute */ -{ - Cell *x, *y; - char *rptr, *pb; - const char *q, *t, *sptr; - char *buf; - fa *pfa; - int mflag, tempstat, num; - int bufsz = recsize; - - if ((buf = (char *) malloc(bufsz)) == NULL) - FATAL("out of memory in gsub"); - mflag = 0; /* if mflag == 0, can replace empty string */ - num = 0; - x = execute(a[3]); /* target string */ - t = getsval(x); - if (a[0] == NULL) /* 0 => a[1] is already-compiled regexpr */ - pfa = (fa *) a[1]; /* regular expression */ - else { - y = execute(a[1]); - pfa = makedfa(getsval(y), 1); - tempfree(y); + switch (subop) { + case SUB: + whichm = 1; + x = execute(a[3]); /* source string */ + break; + case GSUB: + whichm = 0; + x = execute(a[3]); /* source string */ + break; + default: + FATAL("dosub: unrecognized subop: %d", subop); } - y = execute(a[2]); /* replacement string */ - if (pmatch(pfa, t)) { - tempstat = pfa->initstat; - pfa->initstat = 2; - pb = buf; - rptr = getsval(y); - do { - if (patlen == 0 && *patbeg != '\0') { /* matched empty string */ - if (mflag == 0) { /* can replace empty */ - num++; - sptr = rptr; - while (*sptr != '\0') { - adjbuf(&buf, &bufsz, 5+pb-buf, recsize, &pb, "gsub"); - if (*sptr == '\\') { - backsub(&pb, &sptr); - } else if (*sptr == '&') { - sptr++; - adjbuf(&buf, &bufsz, 1+patlen+pb-buf, recsize, &pb, "gsub"); - for (q = patbeg; q < patbeg+patlen; ) - *pb++ = *q++; - } else - *pb++ = *sptr++; - } - } - if (*t == '\0') /* at end */ - goto done; - adjbuf(&buf, &bufsz, 2+pb-buf, recsize, &pb, "gsub"); - *pb++ = *t++; - if (pb > buf + bufsz) /* BUG: not sure of this test */ - FATAL("gsub result0 %.30s too big; can't happen", buf); - mflag = 0; + + start = getsval(x); + while (pmatch(pfa, start)) { + if (buf == NULL) { + if ((pb = buf = (char *) malloc(bufsz)) == NULL) + FATAL("out of memory in dosub"); + tempstat = pfa->initstat; + pfa->initstat = 2; + } + + /* match types */ + #define MT_IGNORE 0 /* unselected or invalid */ + #define MT_INSERT 1 /* selected, empty */ + #define MT_REPLACE 2 /* selected, not empty */ + + /* an empty match just after replacement is invalid */ + + if (patbeg == noempty && patlen == 0) { + mtype = MT_IGNORE; /* invalid, not counted */ + } else if (whichm == ++m || whichm == 0) { + mtype = patlen ? MT_REPLACE : MT_INSERT; + } else { + mtype = MT_IGNORE; /* unselected, but counted */ + } + + /* leading text: */ + if (patbeg > start) { + adjbuf(&buf, &bufsz, (pb - buf) + (patbeg - start), + recsize, &pb, "dosub"); + s = start; + while (s < patbeg) + *pb++ = *s++; + } + + if (mtype == MT_IGNORE) + goto matching_text; /* skip replacement text */ + + r = repl; + while (*r != 0) { + adjbuf(&buf, &bufsz, 5+pb-buf, recsize, &pb, "dosub"); + if (*r == '\\') { + backsub(&pb, &r); + } else if (*r == '&') { + r++; + adjbuf(&buf, &bufsz, 1+patlen+pb-buf, recsize, + &pb, "dosub"); + for (s = patbeg; s < patbeg+patlen; ) + *pb++ = *s++; + } else { + *pb++ = *r++; } - else { /* matched nonempty string */ - num++; - sptr = t; - adjbuf(&buf, &bufsz, 1+(patbeg-sptr)+pb-buf, recsize, &pb, "gsub"); - while (sptr < patbeg) - *pb++ = *sptr++; - sptr = rptr; - while (*sptr != '\0') { - adjbuf(&buf, &bufsz, 5+pb-buf, recsize, &pb, "gsub"); - if (*sptr == '\\') { - backsub(&pb, &sptr); - } else if (*sptr == '&') { - sptr++; - adjbuf(&buf, &bufsz, 1+patlen+pb-buf, recsize, &pb, "gsub"); - for (q = patbeg; q < patbeg+patlen; ) - *pb++ = *q++; - } else - *pb++ = *sptr++; - } - t = patbeg + patlen; - if (patlen == 0 || *t == '\0' || *(t-1) == '\0') - goto done; - if (pb > buf + bufsz) - FATAL("gsub result1 %.30s too big; can't happen", buf); - mflag = 1; - } - } while (pmatch(pfa,t)); - sptr = t; - adjbuf(&buf, &bufsz, 1+strlen(sptr)+pb-buf, 0, &pb, "gsub"); - while ((*pb++ = *sptr++) != '\0') - continue; - done: if (pb < buf + bufsz) - *pb = '\0'; - else if (*(pb-1) != '\0') - FATAL("gsub result2 %.30s truncated; can't happen", buf); - setsval(x, buf); /* BUG: should be able to avoid copy + free */ + } + +matching_text: + if (mtype == MT_REPLACE || *patbeg == '\0') + goto next_search; /* skip matching text */ + + if (patlen == 0) + patlen = u8_nextlen(patbeg); + adjbuf(&buf, &bufsz, (pb-buf) + patlen, recsize, &pb, "dosub"); + s = patbeg; + while (s < patbeg + patlen) + *pb++ = *s++; + +next_search: + start = patbeg + patlen; + if (m == whichm || *patbeg == '\0') + break; + if (mtype == MT_REPLACE) + noempty = start; + + #undef MT_IGNORE + #undef MT_INSERT + #undef MT_REPLACE + } + + xfree(repl); + + if (buf != NULL) { pfa->initstat = tempstat; + + /* trailing text */ + adjbuf(&buf, &bufsz, 1+strlen(start)+pb-buf, 0, &pb, "dosub"); + while ((*pb++ = *start++) != '\0') + ; + + setsval(x, buf); + free(buf); } + tempfree(x); - tempfree(y); x = gettemp(); x->tval = NUM; - x->fval = num; - free(buf); - return(x); + x->fval = m; + return x; } void backsub(char **pb_ptr, const char **sptr_ptr) /* handle \\& variations */ @@ -2122,3 +2578,41 @@ void backsub(char **pb_ptr, const char **sptr_ptr) /* handle \\& variations */ *pb_ptr = pb; *sptr_ptr = sptr; } + +static char *wide_char_to_byte_str(int rune, size_t *outlen) +{ + static char buf[5]; + int len; + + if (rune < 0 || rune > 0x10FFFF) + return NULL; + + memset(buf, 0, sizeof(buf)); + + len = 0; + if (rune <= 0x0000007F) { + buf[len++] = rune; + } else if (rune <= 0x000007FF) { + // 110xxxxx 10xxxxxx + buf[len++] = 0xC0 | (rune >> 6); + buf[len++] = 0x80 | (rune & 0x3F); + } else if (rune <= 0x0000FFFF) { + // 1110xxxx 10xxxxxx 10xxxxxx + buf[len++] = 0xE0 | (rune >> 12); + buf[len++] = 0x80 | ((rune >> 6) & 0x3F); + buf[len++] = 0x80 | (rune & 0x3F); + + } else { + // 0x00010000 - 0x10FFFF + // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx + buf[len++] = 0xF0 | (rune >> 18); + buf[len++] = 0x80 | ((rune >> 12) & 0x3F); + buf[len++] = 0x80 | ((rune >> 6) & 0x3F); + buf[len++] = 0x80 | (rune & 0x3F); + } + + *outlen = len; + buf[len++] = '\0'; + + return buf; +} diff --git a/third_party/awk/tran.c b/third_party/awk/tran.c index fc39c4eb6..482eede1d 100644 --- a/third_party/awk/tran.c +++ b/third_party/awk/tran.c @@ -1,36 +1,34 @@ -/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ -│ vi: set noet ft=c ts=8 sw=8 fenc=utf-8 :vi │ -╚──────────────────────────────────────────────────────────────────────────────╝ -│ │ -│ Copyright (C) Lucent Technologies 1997 │ -│ All Rights Reserved │ -│ │ -│ Permission to use, copy, modify, and distribute this software and │ -│ its documentation for any purpose and without fee is hereby │ -│ granted, provided that the above copyright notice appear in all │ -│ copies and that both that the copyright notice and this │ -│ permission notice and warranty disclaimer appear in supporting │ -│ documentation, and that the name Lucent Technologies or any of │ -│ its entities not be used in advertising or publicity pertaining │ -│ to distribution of the software without specific, written prior │ -│ permission. │ -│ │ -│ LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, │ -│ INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. │ -│ IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY │ -│ SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES │ -│ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER │ -│ IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, │ -│ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF │ -│ THIS SOFTWARE. │ -│ │ -╚─────────────────────────────────────────────────────────────────────────────*/ -#define DEBUG -#include "libc/fmt/conv.h" -#include "libc/math.h" -#include "libc/mem/mem.h" -#include "libc/str/str.h" -#include "third_party/awk/awk.h" +/**************************************************************** +Copyright (C) Lucent Technologies 1997 +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name Lucent Technologies or any of +its entities not be used in advertising or publicity pertaining +to distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. +****************************************************************/ + +#define DEBUG +#include +#include +#include +#include +#include +#include "awk.h" #define FULLTAB 2 /* rehash when table gets this x full */ #define GROWTAB 4 /* grow table by this factor */ @@ -310,7 +308,7 @@ Awkfloat setfval(Cell *vp, Awkfloat f) /* set float val of a Cell */ } else if (&vp->fval == NF) { donerec = false; /* mark $0 invalid */ setlastfld(f); - DPRINTF("setting NF to %g\n", f); + DPRINTF("setfval: setting NF to %g\n", f); } else if (isrec(vp)) { donefld = false; /* mark $1... invalid */ donerec = true; @@ -350,6 +348,10 @@ char *setsval(Cell *vp, const char *s) /* set string val of a Cell */ (void*)vp, NN(vp->nval), s, vp->tval, donerec, donefld); if ((vp->tval & (NUM | STR)) == 0) funnyvar(vp, "assign to"); + if (CSV && (vp == rsloc)) + WARNING("danger: don't set RS when --csv is in effect"); + if (CSV && (vp == fsloc)) + WARNING("danger: don't set FS when --csv is in effect"); if (isfld(vp)) { donerec = false; /* mark $0 invalid */ fldno = atoi(vp->nval); @@ -377,7 +379,7 @@ char *setsval(Cell *vp, const char *s) /* set string val of a Cell */ donerec = false; /* mark $0 invalid */ f = getfval(vp); setlastfld(f); - DPRINTF("setting NF to %g\n", f); + DPRINTF("setsval: setting NF to %g\n", f); } return(vp->sval); @@ -565,7 +567,6 @@ Cell *catstr(Cell *a, Cell *b) /* concatenate a and b */ char *qstring(const char *is, int delim) /* collect string up to next delim */ { - const char *os = is; int c, n; const uschar *s = (const uschar *) is; uschar *buf, *bp; @@ -574,7 +575,7 @@ char *qstring(const char *is, int delim) /* collect string up to next delim */ FATAL( "out of space in qstring(%s)", s); for (bp = buf; (c = *s) != delim; s++) { if (c == '\n') - SYNTAX( "newline in string %.20s...", os ); + SYNTAX( "newline in string %.20s...", is ); else if (c != '\\') *bp++ = c; else { /* \something */