diff options
Diffstat (limited to 'contrib/perl5/x2p')
-rw-r--r-- | contrib/perl5/x2p/EXTERN.h | 17 | ||||
-rw-r--r-- | contrib/perl5/x2p/INTERN.h | 17 | ||||
-rwxr-xr-x | contrib/perl5/x2p/Makefile.SH | 186 | ||||
-rw-r--r-- | contrib/perl5/x2p/a2p.c | 2807 | ||||
-rw-r--r-- | contrib/perl5/x2p/a2p.h | 486 | ||||
-rw-r--r-- | contrib/perl5/x2p/a2p.pod | 177 | ||||
-rw-r--r-- | contrib/perl5/x2p/a2p.y | 404 | ||||
-rw-r--r-- | contrib/perl5/x2p/a2py.c | 1291 | ||||
-rwxr-xr-x | contrib/perl5/x2p/cflags.SH | 95 | ||||
-rw-r--r-- | contrib/perl5/x2p/find2perl.PL | 885 | ||||
-rw-r--r-- | contrib/perl5/x2p/hash.c | 229 | ||||
-rw-r--r-- | contrib/perl5/x2p/hash.h | 52 | ||||
-rw-r--r-- | contrib/perl5/x2p/proto.h | 8 | ||||
-rw-r--r-- | contrib/perl5/x2p/s2p.PL | 858 | ||||
-rw-r--r-- | contrib/perl5/x2p/str.c | 442 | ||||
-rw-r--r-- | contrib/perl5/x2p/str.h | 53 | ||||
-rw-r--r-- | contrib/perl5/x2p/util.c | 221 | ||||
-rw-r--r-- | contrib/perl5/x2p/util.h | 39 | ||||
-rw-r--r-- | contrib/perl5/x2p/walk.c | 2066 |
19 files changed, 0 insertions, 10333 deletions
diff --git a/contrib/perl5/x2p/EXTERN.h b/contrib/perl5/x2p/EXTERN.h deleted file mode 100644 index 80fffb4..0000000 --- a/contrib/perl5/x2p/EXTERN.h +++ /dev/null @@ -1,17 +0,0 @@ -/* $RCSfile: EXTERN.h,v $$Revision: 4.1 $$Date: 92/08/07 18:29:05 $ - * - * Copyright (c) 1991-2001, Larry Wall - * - * You may distribute under the terms of either the GNU General Public - * License or the Artistic License, as specified in the README file. - * - * $Log: EXTERN.h,v $ - */ - -#undef EXT -#define EXT extern - -#undef INIT -#define INIT(x) - -#undef DOINIT diff --git a/contrib/perl5/x2p/INTERN.h b/contrib/perl5/x2p/INTERN.h deleted file mode 100644 index 2303ea3..0000000 --- a/contrib/perl5/x2p/INTERN.h +++ /dev/null @@ -1,17 +0,0 @@ -/* $RCSfile: INTERN.h,v $$Revision: 4.1 $$Date: 92/08/07 18:29:06 $ - * - * Copyright (c) 1991-2001, Larry Wall - * - * You may distribute under the terms of either the GNU General Public - * License or the Artistic License, as specified in the README file. - * - * $Log: INTERN.h,v $ - */ - -#undef EXT -#define EXT - -#undef INIT -#define INIT(x) = x - -#define DOINIT diff --git a/contrib/perl5/x2p/Makefile.SH b/contrib/perl5/x2p/Makefile.SH deleted file mode 100755 index a0ba96a..0000000 --- a/contrib/perl5/x2p/Makefile.SH +++ /dev/null @@ -1,186 +0,0 @@ -case $CONFIGDOTSH in -'') - if test -f config.sh; then TOP=.; - elif test -f ../config.sh; then TOP=..; - elif test -f ../../config.sh; then TOP=../..; - elif test -f ../../../config.sh; then TOP=../../..; - elif test -f ../../../../config.sh; then TOP=../../../..; - else - echo "Can't find config.sh."; exit 1 - fi - . $TOP/config.sh - ;; -esac -: This forces SH files to create target in same directory as SH file. -: This is so that make depend always knows where to find SH derivatives. -case "$0" in -*/Makefile.SH) cd `expr X$0 : 'X\(.*\)/'` ;; -Makefile.SH) ;; -*) case `pwd` in - */x2p) ;; - *) if test -d x2p; then cd x2p - else echo "Can't figure out where to write output."; exit 1 - fi;; - esac;; -esac - -echo "Extracting x2p/Makefile (with variable substitutions)" -rm -f Makefile -cat >Makefile <<!GROK!THIS! -# $RCSfile: Makefile.SH,v $$Revision: 4.1 $$Date: 92/08/07 18:29:07 $ -# -# $Log: Makefile.SH,v $ - -CC = $cc -BYACC = $byacc -LDFLAGS = $ldflags -# XXX Perl malloc temporarily unusable (declaration collisions with stdlib.h) -#mallocsrc = $mallocsrc -#mallocobj = $mallocobj -shellflags = $shellflags - -libs = $libs - -$make_set_make -# grrr -SHELL = $sh - -# These variables may need to be manually set for non-Unix systems. -AR = $ar -EXE_EXT = $_ext -LIB_EXT = $_a -OBJ_EXT = $_o -PATH_SEP = $p_ - -FIRSTMAKEFILE = $firstmakefile - -# how to tr(anslate) newlines - -TRNL = '$trnl' - -.SUFFIXES: .c \$(OBJ_EXT) - -!GROK!THIS! - -cat >>Makefile <<'!NO!SUBS!' - -REALPERL = ../perl -CCCMD = `sh $(shellflags) cflags $@` - -public = a2p s2p find2perl - -private = - -manpages = a2p.man s2p.man - -util = - -sh = Makefile.SH cflags.SH -shextract = Makefile cflags - -pl = find2perl.PL s2p.PL -plextract = find2perl s2p -plexe = find2perl.exe s2p.exe -plc = find2perl.c s2p.c -plm = a2p.loadmap - -addedbyconf = $(shextract) $(plextract) - -h = EXTERN.h INTERN.h ../config.h ../handy.h hash.h a2p.h str.h util.h - -c = hash.c $(mallocsrc) str.c util.c walk.c - -obj = hash$(OBJ_EXT) $(mallocobj) str$(OBJ_EXT) util$(OBJ_EXT) walk$(OBJ_EXT) - -lintflags = -phbvxac - - -.c$(OBJ_EXT): - $(CCCMD) -DPERL_FOR_X2P $*.c - -all: $(public) $(private) $(util) - @echo " " - -compile: all - $(REALPERL) -I../lib ../utils/perlcc -regex 's/$$/.exe/' $(plextract) -prog -verbose dcf -log ../compilelog; - -a2p: $(obj) a2p$(OBJ_EXT) - $(CC) -o a2p $(LDFLAGS) $(obj) a2p$(OBJ_EXT) $(libs) - -# I now supply a2p.c with the kits, so the following section is -# used only if you force byacc to run by saying -# make run_byacc - -run_byacc: FORCE - @ echo Expect many shift/reduce and reduce/reduce conflicts - $(BYACC) a2p.y - rm -f a2p.c - mv y.tab.c a2p.c - -FORCE: - -# We don't want to regenerate a2p.c, but it might appear out-of-date -# after a patch is applied or a new distribution is made. -a2p.c: a2p.y - -@sh -c true - -a2p$(OBJ_EXT): a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h \ - ../handy.h ../config.h str.h hash.h - $(CCCMD) a2p.c - -clean: - rm -f a2p *$(OBJ_EXT) $(plexe) $(plc) $(plm) - -realclean: clean - rm -f core $(addedbyconf) all malloc.c - rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old - -veryclean: realclean - rm -f *~ *.orig - -# The following lint has practically everything turned on. Unfortunately, -# you have to wade through a lot of mumbo jumbo that can't be suppressed. -# If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message -# for that spot. - -lint: - lint $(lintflags) $(defs) $(c) > a2p.fuzz - -depend: $(mallocsrc) ../makedepend - sh ../makedepend MAKE=$(MAKE) - -clist: - echo $(c) | tr ' ' $(TRNL) >.clist - -hlist: - echo $(h) | tr ' ' $(TRNL) >.hlist - -shlist: - echo $(sh) | tr ' ' $(TRNL) >.shlist - -# These should be automatically generated - -$(plextract): - ../miniperl -I../lib $@.PL - -malloc.c: ../malloc.c - rm -f malloc.c - sed <../malloc.c >malloc.c \ - -e 's/"EXTERN.h"/"..\/EXTERN.h"/' \ - -e 's/"perl.h"/"..\/perl.h"/' \ - -e 's/my_exit/exit/' \ - -e 's/MUTEX_[A-Z_]*(&PL_malloc_mutex);//' - -# AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE -$(obj): - @ echo "You haven't done a "'"make depend" yet!'; exit 1 -makedepend: depend -!NO!SUBS! -$eunicefix Makefile -case `pwd` in -*SH) - $rm -f ../Makefile - $ln Makefile ../Makefile - ;; -esac -rm -f $firstmakefile diff --git a/contrib/perl5/x2p/a2p.c b/contrib/perl5/x2p/a2p.c deleted file mode 100644 index cd667a3..0000000 --- a/contrib/perl5/x2p/a2p.c +++ /dev/null @@ -1,2807 +0,0 @@ -#ifndef lint -static char yysccsid[] = "@(#)yaccpar 1.8 (Berkeley) 01/20/91"; -#endif -#define YYBYACC 1 -#line 2 "a2p.y" -/* $RCSfile: a2p.y,v $$Revision: 4.1 $$Date: 92/08/07 18:29:12 $ - * - * Copyright (c) 1991-2001, Larry Wall - * - * You may distribute under the terms of either the GNU General Public - * License or the Artistic License, as specified in the README file. - * - * $Log: a2p.y,v $ - */ - -#include "INTERN.h" -#include "a2p.h" - -int root; -int begins = Nullop; -int ends = Nullop; - -#line 24 "y.tab.c" -#define BEGIN 257 -#define END 258 -#define REGEX 259 -#define SEMINEW 260 -#define NEWLINE 261 -#define COMMENT 262 -#define FUN1 263 -#define FUNN 264 -#define GRGR 265 -#define PRINT 266 -#define PRINTF 267 -#define SPRINTF_OLD 268 -#define SPRINTF_NEW 269 -#define SPLIT 270 -#define IF 271 -#define ELSE 272 -#define WHILE 273 -#define FOR 274 -#define IN 275 -#define EXIT 276 -#define NEXT 277 -#define BREAK 278 -#define CONTINUE 279 -#define RET 280 -#define GETLINE 281 -#define DO 282 -#define SUB 283 -#define GSUB 284 -#define MATCH 285 -#define FUNCTION 286 -#define USERFUN 287 -#define DELETE 288 -#define ASGNOP 289 -#define OROR 290 -#define ANDAND 291 -#define NUMBER 292 -#define VAR 293 -#define SUBSTR 294 -#define INDEX 295 -#define MATCHOP 296 -#define RELOP 297 -#define OR 298 -#define STRING 299 -#define UMINUS 300 -#define NOT 301 -#define INCR 302 -#define DECR 303 -#define FIELD 304 -#define VFIELD 305 -#define YYERRCODE 256 -short yylhs[] = { -1, - 0, 3, 6, 6, 2, 2, 7, 7, 7, 7, - 7, 7, 9, 8, 8, 11, 11, 11, 11, 11, - 15, 15, 15, 15, 14, 14, 14, 14, 13, 13, - 13, 13, 12, 12, 12, 12, 18, 18, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 17, 17, 17, 17, 10, 10, - 10, 19, 19, 19, 1, 1, 20, 20, 20, 20, - 4, 4, 21, 21, 22, 22, 22, 22, 5, 5, - 23, 23, 23, 23, 26, 26, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 27, - 27, 27, 25, 25, 25, 25, 25, 25, 25, 25, -}; -short yylen[] = { 2, - 2, 6, 5, 2, 3, 0, 1, 5, 10, 4, - 1, 1, 1, 1, 3, 1, 1, 1, 1, 5, - 3, 4, 4, 2, 3, 3, 3, 3, 3, 3, - 1, 3, 1, 2, 5, 3, 1, 1, 1, 1, - 1, 3, 3, 3, 3, 3, 3, 3, 2, 2, - 2, 2, 2, 2, 3, 1, 2, 3, 4, 3, - 4, 1, 3, 4, 4, 4, 4, 2, 8, 6, - 8, 8, 6, 6, 6, 6, 6, 6, 6, 6, - 8, 8, 8, 8, 1, 4, 1, 2, 1, 1, - 0, 4, 4, 3, 2, 0, 1, 1, 1, 1, - 2, 0, 1, 1, 2, 2, 2, 2, 2, 0, - 3, 2, 2, 1, 1, 0, 1, 4, 2, 4, - 2, 1, 1, 1, 2, 1, 1, 2, 5, 1, - 1, 1, 6, 9, 6, 7, 10, 9, 6, 5, -}; -short yydefred[] = { 96, - 0, 0, 98, 99, 100, 97, 0, 95, 0, 0, - 31, 0, 0, 38, 0, 0, 0, 0, 0, 0, - 0, 0, 40, 0, 0, 0, 41, 0, 0, 0, - 0, 0, 87, 0, 102, 0, 11, 0, 96, 0, - 0, 0, 17, 18, 19, 0, 0, 0, 102, 102, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 24, 51, - 52, 0, 0, 0, 0, 0, 0, 4, 0, 102, - 0, 102, 102, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, - 50, 0, 68, 0, 0, 0, 0, 63, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 103, 104, 0, 101, 55, 32, - 28, 21, 0, 0, 0, 0, 0, 0, 30, 0, - 0, 0, 0, 48, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 102, 102, 0, 0, 64, - 65, 67, 0, 0, 0, 0, 0, 0, 0, 0, - 13, 66, 86, 0, 0, 102, 0, 0, 0, 0, - 0, 0, 123, 122, 126, 0, 102, 0, 102, 10, - 102, 0, 109, 0, 114, 0, 0, 0, 22, 0, - 61, 94, 0, 0, 96, 3, 0, 0, 0, 0, - 0, 0, 0, 102, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 102, 102, - 102, 102, 102, 8, 0, 0, 0, 0, 0, 73, - 0, 78, 0, 77, 0, 80, 0, 79, 0, 75, - 76, 0, 70, 0, 74, 131, 130, 132, 0, 0, - 0, 0, 0, 115, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 102, - 0, 0, 0, 102, 102, 102, 0, 0, 0, 102, - 72, 71, 82, 81, 84, 83, 0, 69, 0, 0, - 0, 0, 0, 0, 129, 0, 0, 0, 135, 139, - 0, 0, 0, 9, 102, 102, 0, 136, 0, 0, - 102, 134, 138, 0, 137, -}; -short yydgoto[] = { 1, - 2, 7, 37, 73, 127, 38, 39, 40, 170, 103, - 74, 192, 43, 44, 45, 46, 47, 48, 105, 8, - 128, 233, 193, 194, 195, 265, 259, -}; -short yysindex[] = { 0, - 0, -52, 0, 0, 0, 0, 2796, 0, -90, -86, - 0, 17, 25, 0, 38, 44, -57, 45, 47, 48, - -219, 49, 0, -1, 51, 52, 0, 7708, 7708, 6350, - -238, -238, 0, 7708, 0, 6350, 0, -165, 0, -21, - -12, 5968, 0, 0, 0, -32, -253, 7759, 0, 0, - 7372, 7759, 7759, 7708, 7708, 46, 7419, 7473, 7708, 65, - 7759, 7759, 7708, 7708, 6350, -54, -228, -54, 0, 0, - 0, -5, -185, -41, 71, 76, 80, 0, -52, 0, - 7708, 0, 0, 6350, 7708, 7528, 7708, 7708, 7708, -32, - -171, 7708, 7708, 7708, 7708, 7708, 7708, -152, 6350, 0, - 0, 6397, 0, 6481, 86, -185, -185, 0, 6528, 90, - 91, 6583, 184, 7708, 89, 6630, 93, 6673, 6716, 7759, - 94, 41, 6761, 6816, 0, 0, 5228, 0, 0, 0, - 0, 0, -185, 6863, 6015, 6015, -49, 6906, 0, 184, - 184, 184, 184, 0, -8, -8, -54, -54, -54, -54, - -238, -49, 6397, 5924, 28, 0, 0, 5320, 5411, 0, - 0, 0, -154, 184, 7708, 7708, 7708, 7708, 7575, 100, - 0, 0, 0, 7708, 7708, 0, 7759, 7759, 104, 105, - 117, 7708, 0, 0, 0, 7708, 0, -151, 0, 0, - 0, 7618, 0, -43, 0, 5495, 7708, -129, 0, 7708, - 0, 0, 3816, 3816, 0, 0, 29, 6062, 6119, 6203, - 6248, 122, 6949, 0, 6295, 6994, -185, -45, -45, 6350, - 6350, 4306, 7618, 7618, 4429, 81, -185, -185, 0, 0, - 0, 0, 0, 0, 7618, 7618, 7618, 7618, -52, 0, - 7665, 0, 7708, 0, 7708, 0, 7708, 0, 7708, 0, - 0, -96, 0, 7708, 0, 0, 0, 0, 7708, 7708, - -39, -37, 7049, 0, 108, -97, 7759, 5586, -185, -185, - -185, -185, -185, 136, 7096, 7139, 7182, 7227, 7282, 0, - 7329, 7618, 7618, 0, 0, 0, 3890, 138, 88, 0, - 0, 0, 0, 0, 0, 0, -185, 0, 4429, 4429, - 4429, 4306, -51, 6350, 0, -185, 5678, -89, 0, 0, - 141, 4306, -35, 0, 0, 0, 143, 0, 4429, 4429, - 0, 0, 0, 4429, 0, -}; -short yyrindex[] = { 0, - 0, 2452, 0, 0, 0, 0, 185, 0, 0, 0, - 0, 56, 0, 0, 111, 0, 2886, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 2279, 0, 2328, - 2048, 4023, 0, 0, 0, 2120, 1671, 3590, 0, 0, - 0, 145, 145, 0, 0, 382, 0, 0, 0, 0, - 145, 95, 0, 0, 0, 818, 872, 946, 0, 0, - 0, 437, 5769, 0, -16, -10, 18, 0, 2511, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 2170, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3951, 492, 5769, 5769, 0, 0, 0, - 0, 0, 2934, 0, 0, 0, 0, 0, 0, 145, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 5769, 0, 0, 0, 2221, 0, 0, 2982, - 3222, 3267, 3312, 0, 1781, 1854, 1217, 1271, 1325, 1400, - 2619, 1726, 0, -23, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3381, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 102, 102, 0, 0, - 0, 171, 0, 0, 0, 174, 0, 0, 0, 0, - 0, 242, 0, 0, 0, 0, 0, 763, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 4508, 248, 297, 0, - 0, 128, 350, 358, 0, 0, 5769, 4604, 0, 0, - 0, 0, 0, 0, 3657, 3705, 3760, 3866, 2561, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 130, 0, 0, 0, 95, 0, 4695, 4779, - 4870, 4962, 5053, 0, 0, 0, 0, 0, 0, 0, - 0, 398, 431, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 5769, 0, 0, 0, - 0, 149, 0, 0, 0, 5137, 0, 5853, 0, 0, - 0, 149, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, -}; -short yygindex[] = { 0, - -30, 0, 0, 4250, -24, 0, 0, 0, 0, 397, - 24, 4208, -17, -15, -13, 7990, 4404, 0, -82, 0, - 0, 0, -173, -192, 0, -277, -28, -}; -#define YYTABLESIZE 8273 -short yytable[] = { 129, - 85, 284, 55, 285, 96, 318, 6, 312, 79, 94, - 92, 81, 93, 81, 95, 232, 257, 16, 75, 155, - 76, 81, 77, 81, 311, 81, 280, 81, 96, 264, - 41, 84, 49, 94, 317, 99, 50, 85, 95, 97, - 85, 85, 85, 85, 85, 85, 17, 85, 100, 101, - 81, 266, 18, 69, 24, 62, 51, 98, 85, 85, - 85, 97, 85, 85, 52, 33, 34, 60, 202, 240, - 155, 157, 241, 100, 101, 125, 126, 53, 258, 98, - 19, 158, 159, 54, 57, 97, 58, 59, 61, 62, - 63, 64, 62, 85, 85, 78, 62, 62, 62, 62, - 62, 80, 62, 98, 120, 114, 98, 137, 196, 264, - 37, 130, 85, 62, 62, 62, 131, 62, 62, 264, - 132, 144, 152, 85, 85, 308, 309, 310, 151, 157, - 161, 162, 165, 173, 172, 75, 167, 76, 207, 77, - 214, 226, 91, 220, 221, 322, 323, 37, 62, 62, - 325, 37, 37, 37, 37, 37, 222, 37, 198, 199, - 91, 83, 250, 91, 125, 126, 287, 62, 37, 37, - 37, 267, 37, 37, 239, 288, 291, 304, 62, 62, - 305, 316, 315, 321, 1, 91, 116, 91, 117, 116, - 260, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 268, 37, 37, 0, 0, 3, 4, 5, - 0, 124, 0, 0, 127, 0, 229, 230, 231, 256, - 0, 0, 37, 65, 0, 91, 28, 0, 29, 124, - 0, 0, 127, 37, 37, 24, 0, 0, 82, 83, - 82, 83, 91, 261, 262, 0, 33, 34, 82, 83, - 82, 83, 82, 83, 82, 83, 0, 85, 85, 85, - 85, 85, 85, 85, 85, 85, 16, 16, 85, 85, - 85, 0, 307, 17, 17, 85, 0, 82, 83, 18, - 18, 85, 117, 85, 85, 85, 85, 85, 119, 85, - 85, 85, 85, 85, 85, 85, 85, 85, 0, 85, - 117, 85, 85, 85, 85, 85, 119, 19, 19, 0, - 303, 0, 62, 62, 62, 62, 62, 62, 62, 62, - 62, 0, 0, 62, 62, 62, 0, 313, 0, 0, - 62, 0, 0, 0, 0, 0, 62, 121, 62, 62, - 62, 62, 62, 0, 62, 62, 62, 62, 62, 62, - 62, 62, 62, 0, 62, 121, 62, 62, 62, 62, - 62, 91, 91, 91, 0, 0, 91, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 0, 0, 37, 37, - 37, 57, 0, 0, 0, 37, 0, 0, 0, 0, - 125, 37, 0, 37, 37, 37, 37, 37, 128, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 125, 37, - 0, 37, 37, 37, 37, 37, 128, 0, 57, 0, - 0, 57, 57, 57, 57, 57, 57, 0, 57, 0, - 124, 124, 124, 127, 127, 127, 88, 0, 118, 57, - 57, 0, 0, 57, 57, 0, 12, 13, 110, 111, - 0, 14, 15, 16, 0, 0, 118, 121, 122, 0, - 0, 0, 0, 0, 17, 0, 18, 19, 20, 0, - 22, 120, 0, 88, 57, 57, 88, 88, 88, 88, - 88, 88, 27, 88, 0, 31, 32, 33, 34, 120, - 0, 90, 0, 57, 88, 88, 88, 0, 88, 88, - 0, 117, 117, 117, 57, 57, 0, 119, 119, 119, - 0, 0, 0, 0, 0, 0, 171, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 90, 88, - 88, 90, 90, 90, 90, 0, 90, 0, 90, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, - 90, 90, 0, 90, 90, 0, 121, 121, 121, 88, - 88, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 218, 219, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 90, 90, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 90, 0, 0, 0, 0, 0, 125, - 125, 125, 0, 0, 90, 90, 0, 128, 128, 128, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 0, 0, 57, - 57, 57, 0, 0, 0, 0, 57, 118, 118, 118, - 0, 0, 57, 289, 57, 57, 57, 57, 57, 0, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 0, - 57, 0, 57, 57, 57, 57, 57, 0, 0, 0, - 120, 120, 120, 88, 88, 88, 88, 88, 88, 88, - 88, 88, 0, 0, 88, 88, 88, 0, 0, 0, - 0, 88, 0, 0, 0, 0, 0, 88, 0, 88, - 88, 88, 88, 88, 0, 88, 88, 88, 88, 88, - 88, 88, 88, 88, 0, 88, 0, 88, 88, 88, - 88, 88, 0, 0, 0, 0, 0, 0, 90, 90, - 90, 90, 90, 90, 90, 90, 90, 0, 0, 90, - 90, 90, 23, 0, 0, 0, 90, 0, 0, 0, - 0, 0, 90, 0, 90, 90, 90, 90, 90, 0, - 90, 90, 90, 90, 90, 90, 90, 90, 90, 0, - 90, 0, 90, 90, 90, 90, 90, 0, 0, 23, - 0, 0, 23, 23, 23, 23, 23, 23, 0, 23, - 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, - 23, 23, 23, 0, 23, 23, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 54, 23, 23, 54, 54, 54, - 54, 54, 54, 0, 54, 0, 0, 0, 0, 0, - 0, 39, 0, 0, 23, 54, 54, 54, 0, 54, - 54, 0, 0, 0, 0, 23, 23, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 39, 0, - 54, 39, 39, 39, 39, 39, 39, 0, 39, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, - 39, 39, 0, 39, 39, 0, 0, 0, 0, 0, - 54, 54, 0, 0, 0, 53, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 39, 39, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 53, 39, 0, 53, 53, 53, 53, 53, - 53, 0, 53, 0, 39, 39, 0, 0, 0, 0, - 0, 0, 0, 53, 53, 53, 0, 53, 53, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, - 23, 23, 23, 23, 23, 23, 23, 23, 0, 0, - 23, 23, 23, 0, 0, 0, 0, 23, 53, 0, - 0, 0, 0, 23, 0, 23, 23, 23, 23, 23, - 0, 23, 23, 0, 23, 23, 23, 23, 23, 23, - 0, 23, 0, 23, 23, 23, 23, 23, 53, 53, - 0, 0, 0, 0, 54, 54, 54, 54, 54, 54, - 54, 54, 54, 0, 0, 54, 54, 54, 0, 0, - 0, 0, 54, 0, 0, 0, 0, 0, 54, 0, - 54, 54, 54, 54, 54, 0, 54, 54, 54, 54, - 54, 54, 54, 54, 54, 0, 54, 0, 54, 54, - 54, 54, 54, 0, 0, 0, 0, 0, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 0, 0, 39, - 39, 39, 0, 0, 0, 0, 39, 0, 0, 0, - 0, 0, 39, 0, 39, 39, 39, 39, 39, 0, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 0, - 39, 0, 39, 0, 0, 39, 39, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 0, 0, 53, 53, 53, 44, 0, 0, 0, - 53, 0, 0, 0, 0, 0, 53, 0, 53, 53, - 53, 53, 53, 0, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 0, 53, 0, 53, 53, 53, 53, - 53, 0, 0, 44, 0, 0, 44, 44, 44, 44, - 44, 44, 0, 44, 0, 0, 0, 0, 0, 0, - 45, 0, 0, 0, 44, 44, 44, 0, 44, 44, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 45, 0, 44, - 45, 45, 45, 45, 45, 45, 0, 45, 0, 0, - 0, 0, 0, 0, 46, 0, 0, 0, 45, 45, - 45, 0, 45, 45, 0, 0, 0, 0, 0, 44, - 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 46, 0, 45, 46, 46, 46, 46, 46, 46, - 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 46, 46, 46, 0, 46, 46, 0, 0, - 0, 0, 0, 45, 45, 0, 0, 0, 0, 47, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 47, 0, 0, 47, - 47, 47, 47, 47, 47, 0, 47, 46, 46, 0, - 0, 0, 0, 0, 0, 0, 0, 47, 47, 47, - 0, 47, 47, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 0, 0, 44, 44, 44, 0, 0, 0, - 0, 44, 47, 0, 0, 0, 0, 44, 0, 44, - 44, 44, 44, 44, 0, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 0, 44, 0, 44, 44, 44, - 44, 44, 47, 47, 0, 0, 0, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 0, 0, 45, 45, - 45, 0, 0, 0, 0, 45, 0, 0, 0, 0, - 0, 45, 0, 45, 45, 45, 45, 45, 0, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 0, 45, - 0, 45, 45, 45, 45, 45, 0, 0, 0, 0, - 0, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 0, 0, 46, 46, 46, 0, 0, 0, 0, 46, - 0, 0, 0, 0, 0, 46, 0, 46, 46, 46, - 46, 46, 0, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 0, 46, 0, 46, 46, 46, 46, 46, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 0, 0, 47, 47, 47, - 39, 0, 0, 0, 47, 0, 0, 0, 0, 0, - 47, 0, 47, 47, 47, 47, 47, 0, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 0, 47, 0, - 47, 47, 47, 47, 47, 0, 0, 39, 0, 0, - 39, 39, 39, 39, 39, 39, 0, 39, 0, 0, - 0, 0, 0, 0, 0, 36, 0, 0, 39, 39, - 39, 0, 39, 39, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 36, 39, 39, 36, 36, 36, 36, 36, - 36, 0, 36, 0, 0, 0, 0, 0, 0, 0, - 42, 0, 39, 36, 36, 36, 0, 36, 0, 0, - 0, 0, 0, 39, 39, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 36, 36, - 42, 42, 0, 42, 42, 42, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 36, 42, 42, - 42, 0, 42, 42, 0, 0, 0, 0, 36, 36, - 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 43, 43, 0, 43, 43, 43, 0, - 0, 0, 0, 42, 42, 0, 0, 0, 0, 0, - 0, 43, 43, 43, 0, 43, 43, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 0, 0, 39, 39, - 39, 0, 0, 0, 0, 39, 43, 0, 0, 0, - 0, 39, 0, 39, 39, 39, 39, 39, 0, 0, - 39, 39, 39, 39, 39, 39, 39, 39, 0, 39, - 0, 39, 0, 0, 39, 39, 43, 43, 0, 0, - 0, 0, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 0, 0, 36, 36, 36, 0, 0, 0, 0, - 36, 0, 0, 0, 0, 0, 36, 0, 36, 36, - 36, 36, 36, 0, 36, 0, 0, 36, 36, 36, - 36, 36, 36, 0, 36, 0, 36, 36, 36, 36, - 36, 0, 0, 0, 0, 0, 0, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 0, 14, 42, 42, - 42, 0, 0, 0, 0, 42, 0, 0, 0, 0, - 0, 42, 0, 42, 42, 42, 42, 42, 0, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 0, 42, - 0, 42, 42, 42, 42, 42, 0, 14, 0, 0, - 14, 0, 14, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 33, - 0, 43, 43, 43, 0, 0, 0, 0, 43, 0, - 0, 0, 0, 0, 43, 0, 43, 43, 43, 43, - 43, 0, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 0, 43, 0, 43, 43, 43, 43, 43, 33, - 33, 0, 0, 33, 0, 0, 0, 0, 0, 34, - 14, 0, 0, 0, 0, 0, 0, 33, 33, 33, - 0, 33, 33, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, - 34, 0, 33, 34, 0, 0, 0, 0, 0, 0, - 15, 0, 0, 0, 0, 0, 0, 34, 34, 34, - 0, 34, 34, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 33, 33, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 15, 0, 34, 15, 0, 15, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 12, 15, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 34, 34, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, - 14, 14, 0, 0, 0, 14, 14, 14, 12, 0, - 0, 12, 0, 12, 0, 0, 0, 7, 14, 0, - 14, 14, 14, 14, 14, 0, 0, 12, 0, 14, - 14, 14, 14, 15, 0, 0, 14, 0, 14, 14, - 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, - 7, 0, 7, 0, 0, 0, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 0, 7, 33, 33, 33, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 33, 12, 33, 33, 33, 33, 33, 0, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 0, 33, 0, - 33, 33, 33, 33, 33, 0, 34, 34, 34, 34, - 34, 34, 34, 34, 34, 0, 0, 34, 34, 34, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 34, 6, 34, 34, 34, 34, 34, 0, 34, 34, - 34, 34, 34, 34, 34, 34, 34, 0, 34, 0, - 34, 34, 34, 34, 34, 0, 0, 15, 15, 15, - 15, 15, 15, 15, 15, 0, 0, 0, 15, 15, - 15, 6, 0, 0, 6, 0, 6, 0, 0, 0, - 0, 15, 0, 15, 15, 15, 15, 15, 0, 0, - 5, 0, 15, 15, 15, 15, 0, 0, 0, 15, - 0, 15, 15, 15, 15, 15, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 12, 12, 12, 12, 0, - 12, 12, 12, 0, 0, 0, 12, 12, 12, 0, - 5, 0, 0, 5, 0, 5, 0, 0, 0, 12, - 2, 12, 12, 12, 12, 12, 0, 0, 0, 0, - 12, 12, 12, 12, 6, 0, 0, 12, 0, 12, - 12, 12, 12, 12, 7, 7, 7, 7, 7, 7, - 7, 7, 0, 0, 0, 7, 7, 7, 0, 0, - 2, 0, 0, 2, 0, 2, 0, 0, 7, 0, - 7, 7, 7, 7, 7, 0, 0, 0, 60, 7, - 7, 7, 7, 0, 0, 0, 7, 0, 7, 7, - 7, 7, 7, 5, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 60, 0, 0, 60, 60, - 60, 60, 60, 60, 0, 60, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 60, 60, 60, 0, - 60, 60, 0, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, - 6, 60, 60, 0, 6, 6, 0, 0, 0, 6, - 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, - 60, 0, 6, 0, 6, 6, 6, 6, 6, 0, - 0, 60, 60, 6, 6, 6, 6, 0, 0, 0, - 6, 0, 6, 6, 6, 6, 6, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, - 0, 0, 0, 5, 5, 0, 0, 0, 5, 5, - 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 5, 0, 5, 5, 5, 5, 5, 0, 0, - 0, 0, 5, 5, 5, 5, 0, 0, 0, 5, - 0, 5, 5, 5, 5, 5, 0, 2, 2, 2, - 0, 0, 0, 2, 2, 0, 0, 0, 2, 2, - 2, 0, 0, 0, 0, 36, 0, 0, 28, 0, - 29, 2, 0, 2, 2, 2, 2, 2, 0, 0, - 0, 0, 2, 2, 2, 2, 0, 0, 0, 2, - 0, 2, 2, 2, 2, 2, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 60, 60, 60, 60, 60, - 60, 60, 60, 60, 0, 56, 60, 60, 60, 0, - 0, 0, 0, 60, 0, 0, 0, 0, 0, 60, - 0, 60, 60, 60, 60, 60, 0, 60, 60, 60, - 60, 0, 60, 60, 60, 60, 0, 60, 35, 60, - 60, 60, 56, 0, 0, 56, 56, 56, 56, 56, - 56, 0, 56, 58, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 56, 56, 0, 0, 56, 56, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 58, 0, 0, 0, 58, 58, 0, 58, 56, 56, - 58, 29, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 58, 58, 58, 0, 58, 58, 56, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 56, 56, - 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, - 0, 0, 29, 29, 0, 29, 58, 58, 29, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, - 29, 29, 0, 29, 29, 58, 0, 0, 0, 0, - 0, 0, 9, 10, 11, 0, 58, 58, 12, 13, - 0, 0, 0, 14, 15, 16, 0, 0, 0, 0, - 0, 0, 0, 0, 29, 29, 17, 0, 18, 19, - 20, 21, 22, 0, 0, 0, 0, 23, 24, 25, - 26, 0, 0, 29, 27, 0, 30, 31, 32, 33, - 34, 0, 0, 0, 29, 29, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 0, 0, 56, 56, 56, 0, 0, 0, 0, - 56, 0, 0, 0, 0, 0, 56, 0, 56, 56, - 56, 56, 56, 0, 56, 56, 56, 56, 0, 56, - 56, 56, 56, 0, 56, 0, 56, 56, 56, 0, - 58, 58, 58, 58, 58, 58, 0, 0, 58, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 58, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 58, - 0, 25, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 0, 0, 0, 58, 0, 0, 0, 29, 29, - 29, 29, 29, 29, 0, 0, 29, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 29, 0, 25, 0, - 0, 0, 25, 25, 0, 25, 27, 29, 25, 0, - 29, 29, 29, 29, 29, 29, 29, 29, 29, 25, - 25, 25, 29, 25, 25, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 27, 0, 0, 0, 27, 27, 0, - 27, 26, 0, 27, 25, 25, 0, 0, 0, 0, - 0, 0, 0, 0, 27, 27, 27, 0, 27, 27, - 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 25, 25, 0, 0, 26, 0, - 0, 0, 26, 26, 0, 26, 0, 0, 26, 27, - 27, 0, 0, 0, 0, 0, 0, 0, 0, 26, - 26, 26, 0, 26, 26, 0, 0, 0, 27, 0, - 59, 0, 0, 0, 0, 0, 0, 0, 0, 27, - 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 26, 26, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 59, 0, 0, - 0, 59, 59, 26, 59, 0, 0, 59, 0, 0, - 0, 0, 0, 0, 26, 26, 0, 0, 59, 59, - 59, 0, 59, 59, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 59, 59, 0, 0, 0, 25, 25, - 25, 25, 25, 25, 0, 0, 25, 0, 0, 0, - 0, 0, 59, 0, 0, 0, 25, 0, 0, 0, - 0, 0, 0, 59, 59, 0, 0, 25, 0, 0, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 0, - 0, 0, 25, 27, 27, 27, 27, 27, 27, 0, - 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 27, 0, 0, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 0, 0, 0, 27, 26, 26, - 26, 26, 26, 26, 0, 0, 26, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 26, 0, 0, 91, - 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, - 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, - 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 91, 0, 0, 0, - 91, 91, 0, 91, 0, 0, 91, 59, 59, 59, - 59, 59, 59, 0, 0, 59, 0, 91, 91, 91, - 0, 91, 91, 0, 0, 59, 20, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 59, 0, 0, 59, - 59, 59, 59, 59, 59, 59, 59, 59, 0, 0, - 0, 59, 91, 91, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 20, 0, 0, 0, 20, 20, 0, - 20, 91, 0, 20, 35, 0, 0, 0, 0, 0, - 0, 0, 91, 91, 20, 20, 20, 0, 20, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 35, 0, 0, 0, 35, 35, 0, 35, 20, - 20, 35, 0, 0, 0, 0, 0, 0, 0, 92, - 0, 0, 35, 35, 35, 0, 35, 0, 20, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, - 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 92, 35, 35, 0, - 92, 92, 0, 92, 0, 0, 92, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 35, 92, 92, 92, - 0, 92, 0, 0, 0, 0, 0, 35, 35, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 91, 91, 91, 91, - 91, 91, 92, 92, 91, 65, 0, 0, 28, 0, - 29, 0, 0, 0, 91, 93, 0, 0, 0, 0, - 0, 92, 0, 0, 0, 91, 0, 0, 91, 91, - 91, 0, 92, 92, 0, 91, 91, 0, 0, 0, - 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 93, 0, 0, 0, 93, 93, 0, 93, - 0, 0, 93, 20, 20, 20, 20, 20, 20, 0, - 0, 20, 0, 93, 93, 93, 0, 93, 0, 36, - 0, 20, 28, 0, 29, 0, 0, 0, 0, 0, - 0, 0, 20, 0, 0, 20, 20, 20, 302, 0, - 89, 0, 20, 20, 0, 0, 0, 20, 93, 93, - 0, 35, 35, 35, 35, 35, 35, 0, 0, 35, - 0, 0, 0, 0, 0, 0, 0, 93, 0, 35, - 0, 0, 0, 0, 0, 0, 0, 89, 93, 93, - 35, 89, 89, 35, 35, 35, 0, 89, 0, 0, - 35, 35, 0, 0, 0, 35, 0, 0, 89, 89, - 89, 0, 89, 0, 0, 0, 92, 92, 92, 92, - 92, 92, 16, 0, 92, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 92, 0, 0, 0, 0, 0, - 0, 0, 0, 89, 89, 92, 0, 0, 92, 92, - 92, 0, 0, 0, 0, 92, 92, 0, 0, 16, - 92, 0, 89, 16, 16, 0, 16, 0, 0, 16, - 0, 0, 0, 89, 89, 0, 125, 126, 12, 13, - 16, 16, 0, 14, 15, 16, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 17, 0, 18, 19, - 20, 0, 22, 0, 0, 0, 0, 23, 24, 25, - 26, 0, 0, 0, 27, 16, 16, 31, 32, 33, - 34, 0, 93, 93, 93, 93, 93, 93, 0, 0, - 93, 0, 0, 0, 16, 0, 0, 0, 0, 0, - 93, 0, 0, 0, 0, 16, 16, 0, 11, 0, - 0, 93, 12, 13, 93, 93, 93, 14, 15, 16, - 0, 93, 93, 0, 0, 0, 93, 0, 0, 0, - 17, 0, 18, 19, 20, 0, 22, 0, 0, 0, - 0, 23, 24, 25, 26, 0, 0, 0, 27, 0, - 30, 31, 32, 33, 34, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 89, 89, 89, - 89, 89, 89, 0, 42, 89, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 89, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 89, 42, 0, 89, - 89, 89, 0, 42, 0, 0, 89, 89, 0, 0, - 0, 89, 0, 0, 0, 104, 0, 0, 109, 104, - 104, 112, 113, 0, 116, 118, 119, 0, 104, 104, - 123, 124, 42, 0, 0, 0, 0, 0, 0, 16, - 16, 16, 16, 16, 16, 0, 0, 16, 134, 0, - 0, 42, 138, 140, 141, 142, 143, 16, 106, 107, - 0, 0, 0, 0, 0, 0, 42, 0, 16, 154, - 0, 16, 16, 16, 0, 0, 0, 0, 0, 0, - 0, 164, 0, 16, 0, 0, 0, 104, 0, 133, - 0, 135, 136, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 42, 42, 0, 65, 0, 0, 28, 0, - 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 154, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 208, 209, 210, 211, 213, 0, 0, 0, - 0, 215, 216, 0, 104, 104, 0, 0, 0, 223, - 0, 0, 0, 224, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 235, 203, 204, 236, 0, 0, - 237, 238, 0, 0, 0, 0, 0, 0, 0, 0, - 56, 0, 0, 0, 0, 217, 0, 42, 42, 263, - 0, 67, 67, 0, 70, 71, 225, 67, 227, 0, - 228, 0, 0, 0, 0, 67, 0, 0, 275, 0, - 276, 0, 277, 0, 278, 0, 279, 0, 0, 0, - 0, 281, 0, 252, 0, 0, 282, 283, 65, 0, - 0, 28, 0, 29, 104, 0, 0, 0, 269, 270, - 271, 272, 273, 0, 0, 0, 0, 191, 0, 0, - 0, 0, 0, 0, 42, 67, 67, 67, 67, 67, - 67, 0, 0, 0, 0, 0, 0, 67, 0, 0, - 0, 42, 67, 0, 0, 67, 67, 0, 0, 67, - 0, 67, 67, 0, 0, 0, 67, 67, 0, 297, - 0, 0, 0, 299, 300, 301, 0, 67, 0, 306, - 0, 67, 0, 67, 67, 67, 67, 113, 0, 0, - 113, 189, 113, 0, 201, 0, 0, 67, 0, 0, - 0, 0, 0, 0, 319, 320, 113, 67, 12, 13, - 324, 177, 178, 14, 15, 16, 0, 0, 0, 0, - 0, 182, 183, 184, 185, 186, 17, 0, 18, 19, - 20, 0, 22, 188, 0, 67, 0, 23, 24, 25, - 26, 0, 0, 0, 27, 0, 0, 31, 32, 33, - 34, 67, 67, 67, 67, 0, 67, 0, 67, 67, - 0, 0, 0, 0, 0, 0, 67, 67, 0, 0, - 113, 0, 113, 0, 0, 0, 0, 0, 67, 67, - 67, 67, 0, 112, 0, 0, 112, 0, 112, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 112, 0, 0, 0, 67, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 67, 67, - 67, 67, 67, 0, 67, 67, 67, 0, 176, 125, - 126, 12, 13, 0, 177, 178, 14, 15, 16, 179, - 0, 180, 181, 0, 182, 183, 184, 185, 186, 17, - 187, 18, 19, 20, 0, 22, 188, 0, 0, 0, - 23, 24, 25, 26, 0, 0, 112, 27, 112, 0, - 31, 32, 33, 34, 106, 0, 0, 106, 0, 106, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 106, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 113, 0, 0, - 113, 113, 0, 113, 113, 113, 113, 113, 113, 113, - 113, 113, 0, 113, 113, 113, 113, 113, 113, 113, - 113, 113, 113, 0, 113, 113, 0, 0, 0, 113, - 113, 113, 113, 0, 0, 0, 113, 0, 0, 113, - 113, 113, 113, 0, 0, 0, 0, 106, 107, 106, - 0, 107, 0, 107, 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, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 112, 0, 0, 112, 112, 0, 112, - 112, 112, 112, 112, 112, 112, 112, 112, 0, 112, - 112, 112, 112, 112, 112, 112, 112, 112, 112, 0, - 112, 112, 0, 0, 0, 112, 112, 112, 112, 0, - 0, 107, 112, 107, 0, 112, 112, 112, 112, 108, - 0, 0, 108, 0, 108, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 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, 106, 0, 0, 106, 106, 0, - 106, 106, 106, 106, 106, 106, 106, 106, 106, 0, - 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, - 0, 106, 106, 0, 0, 0, 106, 106, 106, 106, - 0, 0, 108, 106, 108, 0, 106, 106, 106, 106, - 0, 105, 0, 0, 105, 0, 105, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 107, 0, - 0, 107, 107, 0, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 0, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 107, 0, 107, 107, 0, 0, 0, - 107, 107, 107, 107, 0, 0, 0, 107, 0, 0, - 107, 107, 107, 107, 105, 0, 105, 0, 0, 0, - 0, 0, 111, 0, 0, 111, 0, 111, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 111, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 108, - 0, 0, 108, 108, 0, 108, 108, 108, 108, 108, - 108, 108, 108, 108, 0, 108, 108, 108, 108, 108, - 108, 108, 108, 108, 108, 0, 108, 108, 0, 0, - 0, 108, 108, 108, 108, 0, 0, 0, 108, 0, - 0, 108, 108, 108, 108, 111, 140, 111, 0, 140, - 0, 140, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 105, 0, 0, 105, 105, 0, 105, 105, 105, - 105, 105, 105, 105, 105, 105, 0, 105, 105, 105, - 105, 105, 105, 105, 105, 105, 105, 0, 105, 105, - 0, 0, 0, 105, 105, 105, 105, 0, 0, 140, - 105, 140, 0, 105, 105, 105, 105, 65, 0, 0, - 28, 0, 29, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 191, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 111, 0, 0, 111, 111, 0, 111, 111, - 111, 111, 111, 111, 111, 111, 111, 0, 111, 111, - 111, 111, 111, 111, 111, 111, 111, 111, 0, 111, - 111, 0, 0, 0, 111, 111, 111, 111, 0, 0, - 189, 111, 190, 0, 111, 111, 111, 111, 0, 65, - 0, 0, 28, 0, 29, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 191, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 140, 0, 0, 140, - 140, 0, 140, 140, 140, 140, 140, 140, 140, 140, - 140, 0, 140, 140, 140, 140, 140, 140, 140, 140, - 140, 140, 0, 140, 140, 0, 0, 0, 140, 140, - 140, 140, 0, 0, 0, 140, 0, 0, 140, 140, - 140, 140, 189, 0, 205, 0, 0, 0, 0, 0, - 65, 0, 0, 28, 0, 29, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 176, 0, 0, - 12, 13, 0, 177, 178, 14, 15, 16, 179, 0, - 180, 181, 0, 182, 183, 184, 185, 186, 17, 187, - 18, 19, 20, 0, 22, 188, 0, 0, 0, 23, - 24, 25, 26, 0, 0, 0, 27, 0, 0, 31, - 32, 33, 34, 189, 65, 206, 0, 28, 0, 29, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 191, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 176, - 0, 0, 12, 13, 0, 177, 178, 14, 15, 16, - 179, 0, 180, 181, 0, 182, 183, 184, 185, 186, - 17, 187, 18, 19, 20, 0, 22, 188, 0, 0, - 0, 23, 24, 25, 26, 0, 0, 189, 27, 234, - 0, 31, 32, 33, 34, 65, 0, 0, 28, 0, - 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 191, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 176, 0, 0, 12, 13, 0, 177, 178, 14, 15, - 16, 179, 0, 180, 181, 0, 182, 183, 184, 185, - 186, 17, 187, 18, 19, 20, 0, 22, 188, 0, - 0, 0, 23, 24, 25, 26, 0, 0, 189, 27, - 290, 0, 31, 32, 33, 34, 0, 65, 0, 0, - 28, 0, 29, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 191, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 176, 0, 0, 12, 13, 0, - 177, 178, 14, 15, 16, 179, 0, 180, 181, 0, - 182, 183, 184, 185, 186, 17, 187, 18, 19, 20, - 0, 22, 188, 0, 0, 0, 23, 24, 25, 26, - 0, 0, 0, 27, 0, 0, 31, 32, 33, 34, - 189, 0, 314, 0, 0, 0, 0, 0, 110, 0, - 0, 110, 0, 110, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 110, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 176, 0, 0, 12, 13, - 0, 177, 178, 14, 15, 16, 179, 0, 180, 181, - 0, 182, 183, 184, 185, 186, 17, 187, 18, 19, - 20, 0, 22, 188, 0, 0, 0, 23, 24, 25, - 26, 0, 0, 0, 27, 0, 0, 31, 32, 33, - 34, 110, 133, 110, 0, 133, 0, 133, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 133, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 176, 0, 0, - 12, 13, 0, 177, 178, 14, 15, 16, 179, 0, - 180, 181, 0, 182, 183, 184, 185, 186, 17, 187, - 18, 19, 20, 65, 22, 188, 28, 156, 29, 23, - 24, 25, 26, 0, 0, 133, 27, 133, 0, 31, - 32, 33, 34, 88, 0, 89, 85, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, - 28, 0, 29, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 88, 110, 89, - 85, 110, 110, 0, 110, 110, 110, 110, 110, 110, - 0, 110, 110, 0, 110, 110, 110, 110, 110, 110, - 110, 110, 110, 110, 36, 110, 110, 28, 0, 29, - 110, 110, 110, 110, 0, 0, 0, 110, 0, 0, - 110, 110, 110, 110, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 65, 242, 0, 28, 243, 29, 0, 0, 0, - 0, 0, 133, 0, 0, 133, 133, 0, 133, 133, - 133, 133, 133, 133, 85, 133, 133, 0, 133, 133, - 133, 133, 133, 133, 133, 133, 133, 133, 0, 133, - 133, 0, 0, 0, 133, 133, 133, 133, 0, 0, - 0, 133, 0, 0, 133, 133, 133, 133, 65, 244, - 0, 28, 245, 29, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 85, 0, 0, 0, 0, 12, 13, 0, 0, - 0, 14, 15, 16, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 17, 0, 18, 19, 20, 0, - 22, 0, 0, 0, 0, 23, 24, 25, 26, 86, - 87, 0, 27, 0, 0, 31, 32, 33, 34, 0, - 12, 13, 0, 0, 0, 14, 15, 16, 0, 0, - 0, 0, 65, 246, 0, 28, 247, 29, 17, 0, - 18, 19, 20, 0, 22, 0, 0, 0, 0, 23, - 24, 25, 26, 86, 87, 85, 27, 0, 0, 31, - 32, 33, 34, 11, 0, 125, 126, 12, 13, 0, - 0, 0, 14, 15, 16, 0, 0, 65, 248, 0, - 28, 249, 29, 0, 0, 17, 0, 18, 19, 20, - 0, 22, 0, 0, 0, 0, 23, 24, 25, 26, - 85, 0, 0, 27, 0, 30, 31, 32, 33, 34, - 0, 0, 0, 0, 12, 13, 0, 0, 0, 14, - 15, 16, 0, 0, 65, 253, 0, 28, 254, 29, - 0, 0, 17, 0, 18, 19, 20, 0, 22, 0, - 0, 0, 0, 23, 24, 25, 26, 85, 0, 0, - 27, 0, 0, 31, 32, 33, 34, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 12, 13, 0, 0, 0, 14, 15, 16, 36, - 0, 0, 28, 0, 29, 0, 0, 0, 0, 17, - 0, 18, 19, 20, 0, 22, 0, 0, 0, 0, - 23, 24, 25, 26, 0, 0, 0, 27, 0, 0, - 31, 32, 33, 34, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 153, 0, 0, 28, - 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 12, 13, 0, 0, 0, - 14, 15, 16, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 17, 0, 18, 19, 20, 0, 22, - 0, 0, 0, 0, 23, 24, 25, 26, 0, 0, - 0, 27, 0, 0, 31, 32, 33, 34, 0, 0, - 12, 13, 0, 0, 0, 14, 15, 16, 0, 0, - 65, 0, 0, 28, 156, 29, 0, 0, 17, 0, - 18, 19, 20, 0, 22, 0, 0, 0, 0, 23, - 24, 25, 26, 85, 0, 0, 27, 0, 0, 31, - 32, 33, 34, 0, 0, 0, 0, 12, 13, 0, - 0, 0, 14, 15, 16, 0, 0, 65, 160, 0, - 28, 0, 29, 0, 0, 17, 0, 18, 19, 20, - 0, 22, 0, 0, 0, 0, 23, 24, 25, 26, - 85, 0, 0, 27, 0, 0, 31, 32, 33, 34, - 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, - 0, 0, 12, 13, 0, 0, 0, 14, 15, 16, - 0, 0, 65, 0, 0, 28, 163, 29, 0, 0, - 17, 0, 18, 19, 20, 0, 22, 0, 0, 0, - 0, 23, 24, 25, 26, 85, 0, 0, 27, 0, - 30, 31, 32, 33, 34, 11, 0, 0, 0, 12, - 13, 0, 0, 0, 14, 15, 16, 0, 0, 65, - 0, 0, 28, 166, 29, 0, 0, 17, 0, 18, - 19, 20, 0, 22, 0, 0, 0, 0, 23, 24, - 25, 26, 85, 0, 0, 27, 0, 30, 31, 32, - 33, 34, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 65, 0, 0, 28, 168, 29, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, - 0, 0, 0, 12, 13, 0, 0, 0, 14, 15, - 16, 0, 0, 0, 0, 65, 0, 0, 28, 169, - 29, 17, 0, 18, 19, 20, 0, 22, 0, 0, - 0, 0, 23, 24, 25, 26, 0, 0, 85, 27, - 0, 0, 31, 32, 33, 34, 0, 0, 0, 0, - 12, 13, 0, 0, 0, 14, 15, 16, 0, 0, - 65, 0, 0, 28, 174, 29, 0, 0, 17, 0, - 18, 19, 20, 0, 22, 0, 0, 0, 0, 23, - 24, 25, 26, 85, 0, 0, 27, 0, 0, 31, - 32, 33, 34, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 12, 13, 0, 0, 0, - 14, 15, 16, 0, 0, 65, 0, 0, 28, 175, - 29, 0, 0, 17, 0, 18, 19, 20, 0, 22, - 0, 0, 0, 0, 23, 24, 25, 26, 85, 0, - 0, 27, 0, 0, 31, 32, 33, 34, 0, 0, - 0, 0, 12, 13, 0, 0, 0, 14, 15, 16, - 0, 0, 65, 0, 0, 28, 0, 29, 0, 0, - 17, 0, 18, 19, 20, 0, 22, 0, 0, 0, - 197, 23, 24, 25, 26, 85, 0, 0, 27, 0, - 0, 31, 32, 33, 34, 12, 13, 0, 0, 0, - 14, 15, 16, 0, 0, 65, 0, 0, 28, 0, - 29, 0, 0, 17, 0, 18, 19, 20, 0, 22, - 0, 0, 0, 200, 23, 24, 25, 26, 85, 0, - 0, 27, 0, 0, 31, 32, 33, 34, 12, 13, - 0, 0, 0, 14, 15, 16, 0, 0, 65, 251, - 0, 28, 0, 29, 0, 0, 17, 0, 18, 19, - 20, 0, 22, 0, 0, 0, 0, 23, 24, 25, - 26, 85, 0, 0, 27, 0, 0, 31, 32, 33, - 34, 0, 0, 12, 13, 0, 0, 0, 14, 15, - 16, 0, 0, 65, 255, 0, 28, 0, 29, 0, - 0, 17, 0, 18, 19, 20, 0, 22, 0, 0, - 0, 0, 23, 24, 25, 26, 85, 0, 0, 27, - 0, 0, 31, 32, 33, 34, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 12, 13, - 0, 0, 0, 14, 15, 16, 0, 0, 65, 286, - 0, 28, 0, 29, 0, 0, 17, 0, 18, 19, - 20, 0, 22, 0, 0, 0, 0, 23, 24, 25, - 26, 85, 0, 0, 27, 0, 0, 31, 32, 33, - 34, 0, 0, 0, 0, 12, 13, 0, 0, 0, - 14, 15, 16, 0, 0, 65, 292, 0, 28, 0, - 29, 0, 0, 17, 0, 18, 19, 20, 0, 22, - 0, 0, 0, 0, 23, 24, 25, 26, 85, 0, - 0, 27, 0, 0, 31, 32, 33, 34, 12, 13, - 0, 0, 0, 14, 15, 16, 0, 0, 65, 293, - 0, 28, 0, 29, 0, 0, 17, 0, 18, 19, - 20, 0, 22, 0, 0, 0, 0, 23, 24, 25, - 26, 85, 0, 0, 27, 0, 0, 31, 32, 33, - 34, 12, 13, 0, 0, 0, 14, 15, 16, 0, - 0, 65, 294, 0, 28, 0, 29, 0, 0, 17, - 0, 18, 19, 20, 0, 22, 0, 0, 0, 0, - 23, 24, 25, 26, 85, 0, 0, 27, 0, 0, - 31, 32, 33, 34, 0, 0, 12, 13, 0, 0, - 0, 14, 15, 16, 0, 0, 65, 295, 0, 28, - 0, 29, 0, 0, 17, 0, 18, 19, 20, 0, - 22, 0, 0, 0, 0, 23, 24, 25, 26, 85, - 0, 0, 27, 0, 0, 31, 32, 33, 34, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 12, 13, 0, 0, 0, 14, 15, 16, 0, - 0, 65, 296, 0, 28, 0, 29, 0, 0, 17, - 0, 18, 19, 20, 0, 22, 0, 0, 0, 0, - 23, 24, 25, 26, 85, 0, 0, 27, 0, 0, - 31, 32, 33, 34, 0, 0, 0, 0, 12, 13, - 0, 0, 0, 14, 15, 16, 0, 0, 65, 298, - 0, 28, 0, 29, 0, 0, 17, 0, 18, 19, - 20, 0, 22, 0, 0, 0, 0, 23, 24, 25, - 26, 85, 0, 0, 27, 0, 0, 31, 32, 33, - 34, 12, 13, 0, 0, 0, 14, 15, 16, 0, - 0, 65, 108, 0, 28, 0, 29, 0, 0, 17, - 0, 18, 19, 20, 0, 22, 0, 0, 0, 0, - 23, 24, 25, 26, 0, 0, 0, 27, 0, 0, - 31, 32, 33, 34, 12, 13, 0, 0, 0, 14, - 15, 16, 0, 0, 0, 0, 0, 0, 65, 0, - 0, 28, 17, 29, 18, 19, 20, 0, 22, 0, - 0, 0, 0, 23, 24, 25, 26, 0, 0, 0, - 27, 0, 0, 31, 32, 33, 34, 0, 0, 12, - 13, 0, 0, 0, 14, 15, 16, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 17, 0, 18, - 19, 20, 65, 22, 0, 28, 0, 29, 23, 24, - 25, 26, 0, 0, 0, 27, 0, 0, 31, 32, - 33, 34, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 12, 13, 0, 0, 0, 14, - 15, 16, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 17, 0, 18, 19, 20, 65, 22, 0, - 28, 0, 29, 23, 24, 25, 26, 0, 0, 0, - 27, 0, 0, 31, 32, 33, 34, 0, 0, 0, - 0, 12, 13, 0, 0, 0, 14, 15, 16, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, - 0, 18, 19, 20, 65, 22, 0, 28, 0, 29, - 23, 24, 25, 26, 0, 0, 0, 27, 0, 0, - 31, 32, 33, 34, 12, 13, 0, 0, 0, 14, - 15, 16, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 17, 0, 18, 19, 20, 65, 22, 0, - 28, 0, 29, 23, 24, 25, 26, 0, 0, 0, - 27, 0, 0, 31, 32, 33, 34, 115, 0, 0, - 85, 12, 13, 0, 0, 0, 14, 15, 16, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, - 0, 18, 19, 20, 65, 22, 0, 28, 0, 29, - 23, 24, 25, 26, 0, 0, 0, 27, 0, 0, - 31, 32, 33, 34, 0, 0, 0, 0, 0, 0, - 0, 117, 0, 0, 0, 12, 13, 0, 0, 0, - 14, 15, 16, 0, 0, 0, 0, 65, 0, 0, - 28, 0, 29, 17, 0, 18, 19, 20, 0, 22, - 0, 0, 0, 0, 23, 24, 25, 26, 0, 0, - 0, 27, 0, 0, 31, 32, 33, 34, 0, 0, - 0, 0, 0, 0, 0, 0, 139, 0, 0, 0, - 12, 13, 0, 0, 0, 14, 15, 16, 102, 0, - 0, 28, 0, 29, 0, 0, 0, 0, 17, 0, - 18, 19, 20, 0, 22, 0, 0, 0, 0, 23, - 24, 25, 26, 0, 0, 0, 27, 0, 0, 31, - 32, 33, 34, 212, 0, 0, 0, 12, 13, 0, - 0, 0, 14, 15, 16, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 17, 0, 18, 19, 20, - 0, 22, 0, 0, 0, 0, 23, 24, 25, 26, - 0, 0, 0, 27, 0, 0, 31, 32, 33, 34, - 12, 13, 0, 0, 0, 14, 15, 16, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, - 18, 19, 20, 0, 22, 0, 0, 0, 0, 23, - 24, 25, 26, 0, 0, 0, 27, 0, 0, 31, - 32, 33, 34, 274, 0, 0, 0, 12, 13, 0, - 0, 0, 14, 15, 16, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 17, 0, 18, 19, 20, - 0, 22, 0, 0, 0, 0, 23, 24, 25, 26, - 0, 0, 0, 27, 0, 0, 31, 32, 33, 34, - 12, 13, 0, 0, 0, 14, 15, 16, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, - 18, 19, 20, 0, 22, 0, 0, 0, 0, 23, - 24, 25, 26, 0, 0, 0, 27, 0, 0, 31, - 32, 33, 34, 0, 0, 0, 0, 66, 68, 0, - 0, 12, 13, 72, 0, 0, 14, 15, 16, 0, - 0, 90, 0, 0, 0, 0, 0, 0, 0, 17, - 0, 18, 19, 20, 0, 22, 0, 0, 0, 0, - 23, 24, 25, 26, 0, 0, 0, 27, 0, 0, - 31, 32, 33, 34, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 145, 146, 147, 148, 149, 150, 0, 0, 0, - 0, 0, 0, 90, 0, 0, 0, 0, 90, 0, - 0, 90, 90, 0, 0, 90, 0, 90, 90, 0, - 0, 0, 90, 90, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 90, 0, 0, 0, 90, 0, 90, - 90, 90, 90, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 90, 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, 90, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 90, 90, 90, - 90, 0, 90, 0, 90, 90, 0, 0, 0, 0, - 0, 0, 90, 90, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 90, 90, 90, 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, 90, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 90, 90, 90, 90, 90, 0, - 90, 90, 90, -}; -short yycheck[] = { 41, - 0, 41, 60, 41, 37, 41, 59, 59, 39, 42, - 43, 63, 45, 63, 47, 59, 62, 41, 36, 102, - 36, 63, 36, 63, 302, 63, 123, 63, 37, 222, - 7, 44, 123, 42, 312, 289, 123, 37, 47, 94, - 40, 41, 42, 43, 44, 45, 63, 47, 302, 303, - 63, 225, 63, 30, 293, 0, 40, 112, 58, 59, - 60, 94, 62, 63, 40, 304, 305, 287, 41, 41, - 153, 44, 44, 302, 303, 261, 262, 40, 124, 112, - 63, 106, 107, 40, 40, 94, 40, 40, 40, 91, - 40, 40, 37, 93, 94, 261, 41, 42, 43, 44, - 45, 123, 47, 112, 40, 60, 112, 84, 133, 302, - 0, 41, 112, 58, 59, 60, 41, 62, 63, 312, - 41, 293, 99, 123, 124, 299, 300, 301, 281, 44, - 41, 41, 44, 93, 41, 153, 44, 153, 293, 153, - 41, 293, 41, 40, 40, 319, 320, 37, 93, 94, - 324, 41, 42, 43, 44, 45, 40, 47, 135, 136, - 59, 291, 41, 62, 261, 262, 59, 112, 58, 59, - 60, 91, 62, 63, 205, 273, 41, 40, 123, 124, - 93, 41, 272, 41, 0, 41, 59, 93, 59, 41, - 219, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 227, 93, 94, -1, -1, 260, 261, 262, - -1, 41, -1, -1, 41, -1, 260, 261, 262, 265, - -1, -1, 112, 40, -1, 124, 43, -1, 45, 59, - -1, -1, 59, 123, 124, 293, -1, -1, 290, 291, - 290, 291, 275, 220, 221, -1, 304, 305, 290, 291, - 290, 291, 290, 291, 290, 291, -1, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 290, 291, 268, 269, - 270, -1, 297, 290, 291, 275, -1, 290, 291, 290, - 291, 281, 41, 283, 284, 285, 286, 287, 41, 289, - 290, 291, 292, 293, 294, 295, 296, 297, -1, 299, - 59, 301, 302, 303, 304, 305, 59, 290, 291, -1, - 287, -1, 257, 258, 259, 260, 261, 262, 263, 264, - 265, -1, -1, 268, 269, 270, -1, 304, -1, -1, - 275, -1, -1, -1, -1, -1, 281, 41, 283, 284, - 285, 286, 287, -1, 289, 290, 291, 292, 293, 294, - 295, 296, 297, -1, 299, 59, 301, 302, 303, 304, - 305, 260, 261, 262, -1, -1, 265, 257, 258, 259, - 260, 261, 262, 263, 264, 265, -1, -1, 268, 269, - 270, 0, -1, -1, -1, 275, -1, -1, -1, -1, - 41, 281, -1, 283, 284, 285, 286, 287, 41, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 59, 299, - -1, 301, 302, 303, 304, 305, 59, -1, 37, -1, - -1, 40, 41, 42, 43, 44, 45, -1, 47, -1, - 260, 261, 262, 260, 261, 262, 0, -1, 41, 58, - 59, -1, -1, 62, 63, -1, 263, 264, 52, 53, - -1, 268, 269, 270, -1, -1, 59, 61, 62, -1, - -1, -1, -1, -1, 281, -1, 283, 284, 285, -1, - 287, 41, -1, 37, 93, 94, 40, 41, 42, 43, - 44, 45, 299, 47, -1, 302, 303, 304, 305, 59, - -1, 0, -1, 112, 58, 59, 60, -1, 62, 63, - -1, 260, 261, 262, 123, 124, -1, 260, 261, 262, - -1, -1, -1, -1, -1, -1, 120, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 37, 93, - 94, 40, 41, 42, 43, -1, 45, -1, 47, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 58, - 59, 60, -1, 62, 63, -1, 260, 261, 262, 123, - 124, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 177, 178, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 93, 94, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 112, -1, -1, -1, -1, -1, 260, - 261, 262, -1, -1, 123, 124, -1, 260, 261, 262, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 257, 258, - 259, 260, 261, 262, 263, 264, 265, -1, -1, 268, - 269, 270, -1, -1, -1, -1, 275, 260, 261, 262, - -1, -1, 281, 267, 283, 284, 285, 286, 287, -1, - 289, 290, 291, 292, 293, 294, 295, 296, 297, -1, - 299, -1, 301, 302, 303, 304, 305, -1, -1, -1, - 260, 261, 262, 257, 258, 259, 260, 261, 262, 263, - 264, 265, -1, -1, 268, 269, 270, -1, -1, -1, - -1, 275, -1, -1, -1, -1, -1, 281, -1, 283, - 284, 285, 286, 287, -1, 289, 290, 291, 292, 293, - 294, 295, 296, 297, -1, 299, -1, 301, 302, 303, - 304, 305, -1, -1, -1, -1, -1, -1, 257, 258, - 259, 260, 261, 262, 263, 264, 265, -1, -1, 268, - 269, 270, 0, -1, -1, -1, 275, -1, -1, -1, - -1, -1, 281, -1, 283, 284, 285, 286, 287, -1, - 289, 290, 291, 292, 293, 294, 295, 296, 297, -1, - 299, -1, 301, 302, 303, 304, 305, -1, -1, 37, - -1, -1, 40, 41, 42, 43, 44, 45, -1, 47, - -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, - 58, 59, 60, -1, 62, 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, 37, 93, 94, 40, 41, 42, - 43, 44, 45, -1, 47, -1, -1, -1, -1, -1, - -1, 0, -1, -1, 112, 58, 59, 60, -1, 62, - 63, -1, -1, -1, -1, 123, 124, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 37, -1, - 93, 40, 41, 42, 43, 44, 45, -1, 47, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 58, - 59, 60, -1, 62, 63, -1, -1, -1, -1, -1, - 123, 124, -1, -1, -1, 0, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 93, 94, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 37, 112, -1, 40, 41, 42, 43, 44, - 45, -1, 47, -1, 123, 124, -1, -1, -1, -1, - -1, -1, -1, 58, 59, 60, -1, 62, 63, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 257, - 258, 259, 260, 261, 262, 263, 264, 265, -1, -1, - 268, 269, 270, -1, -1, -1, -1, 275, 93, -1, - -1, -1, -1, 281, -1, 283, 284, 285, 286, 287, - -1, 289, 290, -1, 292, 293, 294, 295, 296, 297, - -1, 299, -1, 301, 302, 303, 304, 305, 123, 124, - -1, -1, -1, -1, 257, 258, 259, 260, 261, 262, - 263, 264, 265, -1, -1, 268, 269, 270, -1, -1, - -1, -1, 275, -1, -1, -1, -1, -1, 281, -1, - 283, 284, 285, 286, 287, -1, 289, 290, 291, 292, - 293, 294, 295, 296, 297, -1, 299, -1, 301, 302, - 303, 304, 305, -1, -1, -1, -1, -1, 257, 258, - 259, 260, 261, 262, 263, 264, 265, -1, -1, 268, - 269, 270, -1, -1, -1, -1, 275, -1, -1, -1, - -1, -1, 281, -1, 283, 284, 285, 286, 287, -1, - 289, 290, 291, 292, 293, 294, 295, 296, 297, -1, - 299, -1, 301, -1, -1, 304, 305, -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, 257, 258, 259, 260, 261, 262, 263, 264, - 265, -1, -1, 268, 269, 270, 0, -1, -1, -1, - 275, -1, -1, -1, -1, -1, 281, -1, 283, 284, - 285, 286, 287, -1, 289, 290, 291, 292, 293, 294, - 295, 296, 297, -1, 299, -1, 301, 302, 303, 304, - 305, -1, -1, 37, -1, -1, 40, 41, 42, 43, - 44, 45, -1, 47, -1, -1, -1, -1, -1, -1, - 0, -1, -1, -1, 58, 59, 60, -1, 62, 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, 37, -1, 93, - 40, 41, 42, 43, 44, 45, -1, 47, -1, -1, - -1, -1, -1, -1, 0, -1, -1, -1, 58, 59, - 60, -1, 62, 63, -1, -1, -1, -1, -1, 123, - 124, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 37, -1, 93, 40, 41, 42, 43, 44, 45, - -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 58, 59, 60, -1, 62, 63, -1, -1, - -1, -1, -1, 123, 124, -1, -1, -1, -1, 0, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 93, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 37, -1, -1, 40, - 41, 42, 43, 44, 45, -1, 47, 123, 124, -1, - -1, -1, -1, -1, -1, -1, -1, 58, 59, 60, - -1, 62, 63, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 257, 258, 259, 260, 261, 262, 263, - 264, 265, -1, -1, 268, 269, 270, -1, -1, -1, - -1, 275, 93, -1, -1, -1, -1, 281, -1, 283, - 284, 285, 286, 287, -1, 289, 290, 291, 292, 293, - 294, 295, 296, 297, -1, 299, -1, 301, 302, 303, - 304, 305, 123, 124, -1, -1, -1, 257, 258, 259, - 260, 261, 262, 263, 264, 265, -1, -1, 268, 269, - 270, -1, -1, -1, -1, 275, -1, -1, -1, -1, - -1, 281, -1, 283, 284, 285, 286, 287, -1, 289, - 290, 291, 292, 293, 294, 295, 296, 297, -1, 299, - -1, 301, 302, 303, 304, 305, -1, -1, -1, -1, - -1, 257, 258, 259, 260, 261, 262, 263, 264, 265, - -1, -1, 268, 269, 270, -1, -1, -1, -1, 275, - -1, -1, -1, -1, -1, 281, -1, 283, 284, 285, - 286, 287, -1, 289, 290, 291, 292, 293, 294, 295, - 296, 297, -1, 299, -1, 301, 302, 303, 304, 305, - -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, 257, 258, 259, 260, - 261, 262, 263, 264, 265, -1, -1, 268, 269, 270, - 0, -1, -1, -1, 275, -1, -1, -1, -1, -1, - 281, -1, 283, 284, 285, 286, 287, -1, 289, 290, - 291, 292, 293, 294, 295, 296, 297, -1, 299, -1, - 301, 302, 303, 304, 305, -1, -1, 37, -1, -1, - 40, 41, 42, 43, 44, 45, -1, 47, -1, -1, - -1, -1, -1, -1, -1, 0, -1, -1, 58, 59, - 60, -1, 62, 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, 37, 93, 94, 40, 41, 42, 43, 44, - 45, -1, 47, -1, -1, -1, -1, -1, -1, -1, - 0, -1, 112, 58, 59, 60, -1, 62, -1, -1, - -1, -1, -1, 123, 124, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 93, 94, - 40, 41, -1, 43, 44, 45, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 112, 58, 59, - 60, -1, 62, 63, -1, -1, -1, -1, 123, 124, - -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 93, -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, 123, 124, -1, -1, -1, -1, -1, - -1, 58, 59, 60, -1, 62, 63, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 257, 258, 259, - 260, 261, 262, 263, 264, 265, -1, -1, 268, 269, - 270, -1, -1, -1, -1, 275, 93, -1, -1, -1, - -1, 281, -1, 283, 284, 285, 286, 287, -1, -1, - 290, 291, 292, 293, 294, 295, 296, 297, -1, 299, - -1, 301, -1, -1, 304, 305, 123, 124, -1, -1, - -1, -1, 257, 258, 259, 260, 261, 262, 263, 264, - 265, -1, -1, 268, 269, 270, -1, -1, -1, -1, - 275, -1, -1, -1, -1, -1, 281, -1, 283, 284, - 285, 286, 287, -1, 289, -1, -1, 292, 293, 294, - 295, 296, 297, -1, 299, -1, 301, 302, 303, 304, - 305, -1, -1, -1, -1, -1, -1, 257, 258, 259, - 260, 261, 262, 263, 264, 265, -1, 0, 268, 269, - 270, -1, -1, -1, -1, 275, -1, -1, -1, -1, - -1, 281, -1, 283, 284, 285, 286, 287, -1, 289, - 290, 291, 292, 293, 294, 295, 296, 297, -1, 299, - -1, 301, 302, 303, 304, 305, -1, 40, -1, -1, - 43, -1, 45, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 59, -1, -1, -1, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 0, - -1, 268, 269, 270, -1, -1, -1, -1, 275, -1, - -1, -1, -1, -1, 281, -1, 283, 284, 285, 286, - 287, -1, 289, 290, 291, 292, 293, 294, 295, 296, - 297, -1, 299, -1, 301, 302, 303, 304, 305, 40, - 41, -1, -1, 44, -1, -1, -1, -1, -1, 0, - 123, -1, -1, -1, -1, -1, -1, 58, 59, 60, - -1, 62, 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, 40, - 41, -1, 93, 44, -1, -1, -1, -1, -1, -1, - 0, -1, -1, -1, -1, -1, -1, 58, 59, 60, - -1, 62, 63, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 123, 124, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 40, -1, 93, 43, -1, 45, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 0, 59, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 123, 124, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 257, 258, 259, 260, 261, 262, - 263, 264, -1, -1, -1, 268, 269, 270, 40, -1, - -1, 43, -1, 45, -1, -1, -1, 0, 281, -1, - 283, 284, 285, 286, 287, -1, -1, 59, -1, 292, - 293, 294, 295, 123, -1, -1, 299, -1, 301, 302, - 303, 304, 305, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, - 43, -1, 45, -1, -1, -1, 257, 258, 259, 260, - 261, 262, 263, 264, 265, -1, 59, 268, 269, 270, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 281, 123, 283, 284, 285, 286, 287, -1, 289, 290, - 291, 292, 293, 294, 295, 296, 297, -1, 299, -1, - 301, 302, 303, 304, 305, -1, 257, 258, 259, 260, - 261, 262, 263, 264, 265, -1, -1, 268, 269, 270, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 281, 0, 283, 284, 285, 286, 287, -1, 289, 290, - 291, 292, 293, 294, 295, 296, 297, -1, 299, -1, - 301, 302, 303, 304, 305, -1, -1, 257, 258, 259, - 260, 261, 262, 263, 264, -1, -1, -1, 268, 269, - 270, 40, -1, -1, 43, -1, 45, -1, -1, -1, - -1, 281, -1, 283, 284, 285, 286, 287, -1, -1, - 0, -1, 292, 293, 294, 295, -1, -1, -1, 299, - -1, 301, 302, 303, 304, 305, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 257, 258, 259, 260, -1, - 262, 263, 264, -1, -1, -1, 268, 269, 270, -1, - 40, -1, -1, 43, -1, 45, -1, -1, -1, 281, - 0, 283, 284, 285, 286, 287, -1, -1, -1, -1, - 292, 293, 294, 295, 123, -1, -1, 299, -1, 301, - 302, 303, 304, 305, 257, 258, 259, 260, 261, 262, - 263, 264, -1, -1, -1, 268, 269, 270, -1, -1, - 40, -1, -1, 43, -1, 45, -1, -1, 281, -1, - 283, 284, 285, 286, 287, -1, -1, -1, 0, 292, - 293, 294, 295, -1, -1, -1, 299, -1, 301, 302, - 303, 304, 305, 123, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -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, 60, -1, - 62, 63, -1, 123, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 257, 258, - 259, 93, 94, -1, 263, 264, -1, -1, -1, 268, - 269, 270, -1, -1, -1, -1, -1, -1, -1, -1, - 112, -1, 281, -1, 283, 284, 285, 286, 287, -1, - -1, 123, 124, 292, 293, 294, 295, -1, -1, -1, - 299, -1, 301, 302, 303, 304, 305, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 257, 258, 259, - -1, -1, -1, 263, 264, -1, -1, -1, 268, 269, - 270, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 281, -1, 283, 284, 285, 286, 287, -1, -1, - -1, -1, 292, 293, 294, 295, -1, -1, -1, 299, - -1, 301, 302, 303, 304, 305, -1, 257, 258, 259, - -1, -1, -1, 263, 264, -1, -1, -1, 268, 269, - 270, -1, -1, -1, -1, 40, -1, -1, 43, -1, - 45, 281, -1, 283, 284, 285, 286, 287, -1, -1, - -1, -1, 292, 293, 294, 295, -1, -1, -1, 299, - -1, 301, 302, 303, 304, 305, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 257, 258, 259, 260, 261, - 262, 263, 264, 265, -1, 0, 268, 269, 270, -1, - -1, -1, -1, 275, -1, -1, -1, -1, -1, 281, - -1, 283, 284, 285, 286, 287, -1, 289, 290, 291, - 292, -1, 294, 295, 296, 297, -1, 299, 123, 301, - 302, 303, 37, -1, -1, 40, 41, 42, 43, 44, - 45, -1, 47, 0, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 58, 59, -1, -1, 62, 63, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 37, -1, -1, -1, 41, 42, -1, 44, 93, 94, - 47, 0, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 58, 59, 60, -1, 62, 63, 112, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 123, 124, - -1, -1, -1, -1, -1, -1, -1, -1, 37, -1, - -1, -1, 41, 42, -1, 44, 93, 94, 47, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 58, - 59, 60, -1, 62, 63, 112, -1, -1, -1, -1, - -1, -1, 257, 258, 259, -1, 123, 124, 263, 264, - -1, -1, -1, 268, 269, 270, -1, -1, -1, -1, - -1, -1, -1, -1, 93, 94, 281, -1, 283, 284, - 285, 286, 287, -1, -1, -1, -1, 292, 293, 294, - 295, -1, -1, 112, 299, -1, 301, 302, 303, 304, - 305, -1, -1, -1, 123, 124, -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, 257, 258, 259, 260, 261, 262, 263, 264, - 265, -1, -1, 268, 269, 270, -1, -1, -1, -1, - 275, -1, -1, -1, -1, -1, 281, -1, 283, 284, - 285, 286, 287, -1, 289, 290, 291, 292, -1, 294, - 295, 296, 297, -1, 299, -1, 301, 302, 303, -1, - 257, 258, 259, 260, 261, 262, -1, -1, 265, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 275, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 286, - -1, 0, 289, 290, 291, 292, 293, 294, 295, 296, - 297, -1, -1, -1, 301, -1, -1, -1, 257, 258, - 259, 260, 261, 262, -1, -1, 265, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 275, -1, 37, -1, - -1, -1, 41, 42, -1, 44, 0, 286, 47, -1, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 58, - 59, 60, 301, 62, 63, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 37, -1, -1, -1, 41, 42, -1, - 44, 0, -1, 47, 93, 94, -1, -1, -1, -1, - -1, -1, -1, -1, 58, 59, 60, -1, 62, 63, - -1, -1, -1, 112, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 123, 124, -1, -1, 37, -1, - -1, -1, 41, 42, -1, 44, -1, -1, 47, 93, - 94, -1, -1, -1, -1, -1, -1, -1, -1, 58, - 59, 60, -1, 62, 63, -1, -1, -1, 112, -1, - 0, -1, -1, -1, -1, -1, -1, -1, -1, 123, - 124, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 93, 94, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 37, -1, -1, - -1, 41, 42, 112, 44, -1, -1, 47, -1, -1, - -1, -1, -1, -1, 123, 124, -1, -1, 58, 59, - 60, -1, 62, 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, 94, -1, -1, -1, 257, 258, - 259, 260, 261, 262, -1, -1, 265, -1, -1, -1, - -1, -1, 112, -1, -1, -1, 275, -1, -1, -1, - -1, -1, -1, 123, 124, -1, -1, 286, -1, -1, - 289, 290, 291, 292, 293, 294, 295, 296, 297, -1, - -1, -1, 301, 257, 258, 259, 260, 261, 262, -1, - -1, 265, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 275, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 286, -1, -1, 289, 290, 291, 292, 293, - 294, 295, 296, 297, -1, -1, -1, 301, 257, 258, - 259, 260, 261, 262, -1, -1, 265, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 275, -1, -1, 0, - -1, -1, -1, -1, -1, -1, -1, 286, -1, -1, - 289, 290, 291, 292, 293, 294, 295, 296, 297, -1, - -1, -1, 301, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 37, -1, -1, -1, - 41, 42, -1, 44, -1, -1, 47, 257, 258, 259, - 260, 261, 262, -1, -1, 265, -1, 58, 59, 60, - -1, 62, 63, -1, -1, 275, 0, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 286, -1, -1, 289, - 290, 291, 292, 293, 294, 295, 296, 297, -1, -1, - -1, 301, 93, 94, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 37, -1, -1, -1, 41, 42, -1, - 44, 112, -1, 47, 0, -1, -1, -1, -1, -1, - -1, -1, 123, 124, 58, 59, 60, -1, 62, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 37, -1, -1, -1, 41, 42, -1, 44, 93, - 94, 47, -1, -1, -1, -1, -1, -1, -1, 0, - -1, -1, 58, 59, 60, -1, 62, -1, 112, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 123, - 124, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 37, 93, 94, -1, - 41, 42, -1, 44, -1, -1, 47, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 112, 58, 59, 60, - -1, 62, -1, -1, -1, -1, -1, 123, 124, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 257, 258, 259, 260, - 261, 262, 93, 94, 265, 40, -1, -1, 43, -1, - 45, -1, -1, -1, 275, 0, -1, -1, -1, -1, - -1, 112, -1, -1, -1, 286, -1, -1, 289, 290, - 291, -1, 123, 124, -1, 296, 297, -1, -1, -1, - 301, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 37, -1, -1, -1, 41, 42, -1, 44, - -1, -1, 47, 257, 258, 259, 260, 261, 262, -1, - -1, 265, -1, 58, 59, 60, -1, 62, -1, 40, - -1, 275, 43, -1, 45, -1, -1, -1, -1, -1, - -1, -1, 286, -1, -1, 289, 290, 291, 59, -1, - 0, -1, 296, 297, -1, -1, -1, 301, 93, 94, - -1, 257, 258, 259, 260, 261, 262, -1, -1, 265, - -1, -1, -1, -1, -1, -1, -1, 112, -1, 275, - -1, -1, -1, -1, -1, -1, -1, 37, 123, 124, - 286, 41, 42, 289, 290, 291, -1, 47, -1, -1, - 296, 297, -1, -1, -1, 301, -1, -1, 58, 59, - 60, -1, 62, -1, -1, -1, 257, 258, 259, 260, - 261, 262, 0, -1, 265, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 275, -1, -1, -1, -1, -1, - -1, -1, -1, 93, 94, 286, -1, -1, 289, 290, - 291, -1, -1, -1, -1, 296, 297, -1, -1, 37, - 301, -1, 112, 41, 42, -1, 44, -1, -1, 47, - -1, -1, -1, 123, 124, -1, 261, 262, 263, 264, - 58, 59, -1, 268, 269, 270, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 281, -1, 283, 284, - 285, -1, 287, -1, -1, -1, -1, 292, 293, 294, - 295, -1, -1, -1, 299, 93, 94, 302, 303, 304, - 305, -1, 257, 258, 259, 260, 261, 262, -1, -1, - 265, -1, -1, -1, 112, -1, -1, -1, -1, -1, - 275, -1, -1, -1, -1, 123, 124, -1, 259, -1, - -1, 286, 263, 264, 289, 290, 291, 268, 269, 270, - -1, 296, 297, -1, -1, -1, 301, -1, -1, -1, - 281, -1, 283, 284, 285, -1, 287, -1, -1, -1, - -1, 292, 293, 294, 295, -1, -1, -1, 299, -1, - 301, 302, 303, 304, 305, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 257, 258, 259, - 260, 261, 262, -1, 7, 265, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 275, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 286, 30, -1, 289, - 290, 291, -1, 36, -1, -1, 296, 297, -1, -1, - -1, 301, -1, -1, -1, 48, -1, -1, 51, 52, - 53, 54, 55, -1, 57, 58, 59, -1, 61, 62, - 63, 64, 65, -1, -1, -1, -1, -1, -1, 257, - 258, 259, 260, 261, 262, -1, -1, 265, 81, -1, - -1, 84, 85, 86, 87, 88, 89, 275, 49, 50, - -1, -1, -1, -1, -1, -1, 99, -1, 286, 102, - -1, 289, 290, 291, -1, -1, -1, -1, -1, -1, - -1, 114, -1, 301, -1, -1, -1, 120, -1, 80, - -1, 82, 83, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 135, 136, -1, 40, -1, -1, 43, -1, - 45, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 153, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 165, 166, 167, 168, 169, -1, -1, -1, - -1, 174, 175, -1, 177, 178, -1, -1, -1, 182, - -1, -1, -1, 186, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 197, 156, 157, 200, -1, -1, - 203, 204, -1, -1, -1, -1, -1, -1, -1, -1, - 17, -1, -1, -1, -1, 176, -1, 220, 221, 222, - -1, 28, 29, -1, 31, 32, 187, 34, 189, -1, - 191, -1, -1, -1, -1, 42, -1, -1, 241, -1, - 243, -1, 245, -1, 247, -1, 249, -1, -1, -1, - -1, 254, -1, 214, -1, -1, 259, 260, 40, -1, - -1, 43, -1, 45, 267, -1, -1, -1, 229, 230, - 231, 232, 233, -1, -1, -1, -1, 59, -1, -1, - -1, -1, -1, -1, 287, 92, 93, 94, 95, 96, - 97, -1, -1, -1, -1, -1, -1, 104, -1, -1, - -1, 304, 109, -1, -1, 112, 113, -1, -1, 116, - -1, 118, 119, -1, -1, -1, 123, 124, -1, 280, - -1, -1, -1, 284, 285, 286, -1, 134, -1, 290, - -1, 138, -1, 140, 141, 142, 143, 40, -1, -1, - 43, 123, 45, -1, 151, -1, -1, 154, -1, -1, - -1, -1, -1, -1, 315, 316, 59, 164, 263, 264, - 321, 266, 267, 268, 269, 270, -1, -1, -1, -1, - -1, 276, 277, 278, 279, 280, 281, -1, 283, 284, - 285, -1, 287, 288, -1, 192, -1, 292, 293, 294, - 295, -1, -1, -1, 299, -1, -1, 302, 303, 304, - 305, 208, 209, 210, 211, -1, 213, -1, 215, 216, - -1, -1, -1, -1, -1, -1, 223, 224, -1, -1, - 123, -1, 125, -1, -1, -1, -1, -1, 235, 236, - 237, 238, -1, 40, -1, -1, 43, -1, 45, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 59, -1, -1, -1, 263, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 275, 276, - 277, 278, 279, -1, 281, 282, 283, -1, 260, 261, - 262, 263, 264, -1, 266, 267, 268, 269, 270, 271, - -1, 273, 274, -1, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, -1, 287, 288, -1, -1, -1, - 292, 293, 294, 295, -1, -1, 123, 299, 125, -1, - 302, 303, 304, 305, 40, -1, -1, 43, -1, 45, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 59, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 260, -1, -1, - 263, 264, -1, 266, 267, 268, 269, 270, 271, 272, - 273, 274, -1, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, -1, 287, 288, -1, -1, -1, 292, - 293, 294, 295, -1, -1, -1, 299, -1, -1, 302, - 303, 304, 305, -1, -1, -1, -1, 123, 40, 125, - -1, 43, -1, 45, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 59, -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, 260, -1, -1, 263, 264, -1, 266, - 267, 268, 269, 270, 271, 272, 273, 274, -1, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, -1, - 287, 288, -1, -1, -1, 292, 293, 294, 295, -1, - -1, 123, 299, 125, -1, 302, 303, 304, 305, 40, - -1, -1, 43, -1, 45, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 59, -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, 260, -1, -1, 263, 264, -1, - 266, 267, 268, 269, 270, 271, 272, 273, 274, -1, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - -1, 287, 288, -1, -1, -1, 292, 293, 294, 295, - -1, -1, 123, 299, 125, -1, 302, 303, 304, 305, - -1, 40, -1, -1, 43, -1, 45, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 59, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 260, -1, - -1, 263, 264, -1, 266, 267, 268, 269, 270, 271, - 272, 273, 274, -1, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, -1, 287, 288, -1, -1, -1, - 292, 293, 294, 295, -1, -1, -1, 299, -1, -1, - 302, 303, 304, 305, 123, -1, 125, -1, -1, -1, - -1, -1, 40, -1, -1, 43, -1, 45, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 59, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 260, - -1, -1, 263, 264, -1, 266, 267, 268, 269, 270, - 271, 272, 273, 274, -1, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, -1, 287, 288, -1, -1, - -1, 292, 293, 294, 295, -1, -1, -1, 299, -1, - -1, 302, 303, 304, 305, 123, 40, 125, -1, 43, - -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 59, -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, 260, -1, -1, 263, 264, -1, 266, 267, 268, - 269, 270, 271, 272, 273, 274, -1, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, -1, 287, 288, - -1, -1, -1, 292, 293, 294, 295, -1, -1, 123, - 299, 125, -1, 302, 303, 304, 305, 40, -1, -1, - 43, -1, 45, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 59, -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, 260, -1, -1, 263, 264, -1, 266, 267, - 268, 269, 270, 271, 272, 273, 274, -1, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, - 288, -1, -1, -1, 292, 293, 294, 295, -1, -1, - 123, 299, 125, -1, 302, 303, 304, 305, -1, 40, - -1, -1, 43, -1, 45, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 59, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 260, -1, -1, 263, - 264, -1, 266, 267, 268, 269, 270, 271, 272, 273, - 274, -1, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, -1, 287, 288, -1, -1, -1, 292, 293, - 294, 295, -1, -1, -1, 299, -1, -1, 302, 303, - 304, 305, 123, -1, 125, -1, -1, -1, -1, -1, - 40, -1, -1, 43, -1, 45, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 59, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 260, -1, -1, - 263, 264, -1, 266, 267, 268, 269, 270, 271, -1, - 273, 274, -1, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, -1, 287, 288, -1, -1, -1, 292, - 293, 294, 295, -1, -1, -1, 299, -1, -1, 302, - 303, 304, 305, 123, 40, 125, -1, 43, -1, 45, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 59, -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, 260, - -1, -1, 263, 264, -1, 266, 267, 268, 269, 270, - 271, -1, 273, 274, -1, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, -1, 287, 288, -1, -1, - -1, 292, 293, 294, 295, -1, -1, 123, 299, 125, - -1, 302, 303, 304, 305, 40, -1, -1, 43, -1, - 45, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 59, -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, - 260, -1, -1, 263, 264, -1, 266, 267, 268, 269, - 270, 271, -1, 273, 274, -1, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, -1, 287, 288, -1, - -1, -1, 292, 293, 294, 295, -1, -1, 123, 299, - 125, -1, 302, 303, 304, 305, -1, 40, -1, -1, - 43, -1, 45, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 59, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 260, -1, -1, 263, 264, -1, - 266, 267, 268, 269, 270, 271, -1, 273, 274, -1, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - -1, 287, 288, -1, -1, -1, 292, 293, 294, 295, - -1, -1, -1, 299, -1, -1, 302, 303, 304, 305, - 123, -1, 125, -1, -1, -1, -1, -1, 40, -1, - -1, 43, -1, 45, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 59, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 260, -1, -1, 263, 264, - -1, 266, 267, 268, 269, 270, 271, -1, 273, 274, - -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, -1, 287, 288, -1, -1, -1, 292, 293, 294, - 295, -1, -1, -1, 299, -1, -1, 302, 303, 304, - 305, 123, 40, 125, -1, 43, -1, 45, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 59, -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, 260, -1, -1, - 263, 264, -1, 266, 267, 268, 269, 270, 271, -1, - 273, 274, -1, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 40, 287, 288, 43, 44, 45, 292, - 293, 294, 295, -1, -1, 123, 299, 125, -1, 302, - 303, 304, 305, 60, -1, 62, 63, -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, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 60, 260, 62, - 63, 263, 264, -1, 266, 267, 268, 269, 270, 271, - -1, 273, 274, -1, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 40, 287, 288, 43, -1, 45, - 292, 293, 294, 295, -1, -1, -1, 299, -1, -1, - 302, 303, 304, 305, -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, 260, -1, -1, 263, 264, -1, 266, 267, - 268, 269, 270, 271, 63, 273, 274, -1, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, -1, 287, - 288, -1, -1, -1, 292, 293, 294, 295, -1, -1, - -1, 299, -1, -1, 302, 303, 304, 305, 40, 41, - -1, 43, 44, 45, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 63, -1, -1, -1, -1, 263, 264, -1, -1, - -1, 268, 269, 270, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 281, -1, 283, 284, 285, -1, - 287, -1, -1, -1, -1, 292, 293, 294, 295, 296, - 297, -1, 299, -1, -1, 302, 303, 304, 305, -1, - 263, 264, -1, -1, -1, 268, 269, 270, -1, -1, - -1, -1, 40, 41, -1, 43, 44, 45, 281, -1, - 283, 284, 285, -1, 287, -1, -1, -1, -1, 292, - 293, 294, 295, 296, 297, 63, 299, -1, -1, 302, - 303, 304, 305, 259, -1, 261, 262, 263, 264, -1, - -1, -1, 268, 269, 270, -1, -1, 40, 41, -1, - 43, 44, 45, -1, -1, 281, -1, 283, 284, 285, - -1, 287, -1, -1, -1, -1, 292, 293, 294, 295, - 63, -1, -1, 299, -1, 301, 302, 303, 304, 305, - -1, -1, -1, -1, 263, 264, -1, -1, -1, 268, - 269, 270, -1, -1, 40, 41, -1, 43, 44, 45, - -1, -1, 281, -1, 283, 284, 285, -1, 287, -1, - -1, -1, -1, 292, 293, 294, 295, 63, -1, -1, - 299, -1, -1, 302, 303, 304, 305, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 263, 264, -1, -1, -1, 268, 269, 270, 40, - -1, -1, 43, -1, 45, -1, -1, -1, -1, 281, - -1, 283, 284, 285, -1, 287, -1, -1, -1, -1, - 292, 293, 294, 295, -1, -1, -1, 299, -1, -1, - 302, 303, 304, 305, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -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, -1, - -1, -1, -1, -1, -1, 263, 264, -1, -1, -1, - 268, 269, 270, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 281, -1, 283, 284, 285, -1, 287, - -1, -1, -1, -1, 292, 293, 294, 295, -1, -1, - -1, 299, -1, -1, 302, 303, 304, 305, -1, -1, - 263, 264, -1, -1, -1, 268, 269, 270, -1, -1, - 40, -1, -1, 43, 44, 45, -1, -1, 281, -1, - 283, 284, 285, -1, 287, -1, -1, -1, -1, 292, - 293, 294, 295, 63, -1, -1, 299, -1, -1, 302, - 303, 304, 305, -1, -1, -1, -1, 263, 264, -1, - -1, -1, 268, 269, 270, -1, -1, 40, 41, -1, - 43, -1, 45, -1, -1, 281, -1, 283, 284, 285, - -1, 287, -1, -1, -1, -1, 292, 293, 294, 295, - 63, -1, -1, 299, -1, -1, 302, 303, 304, 305, - -1, -1, -1, -1, -1, -1, -1, -1, 259, -1, - -1, -1, 263, 264, -1, -1, -1, 268, 269, 270, - -1, -1, 40, -1, -1, 43, 44, 45, -1, -1, - 281, -1, 283, 284, 285, -1, 287, -1, -1, -1, - -1, 292, 293, 294, 295, 63, -1, -1, 299, -1, - 301, 302, 303, 304, 305, 259, -1, -1, -1, 263, - 264, -1, -1, -1, 268, 269, 270, -1, -1, 40, - -1, -1, 43, 44, 45, -1, -1, 281, -1, 283, - 284, 285, -1, 287, -1, -1, -1, -1, 292, 293, - 294, 295, 63, -1, -1, 299, -1, 301, 302, 303, - 304, 305, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 40, -1, -1, 43, 44, 45, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 63, -1, -1, -1, -1, - -1, -1, -1, 263, 264, -1, -1, -1, 268, 269, - 270, -1, -1, -1, -1, 40, -1, -1, 43, 44, - 45, 281, -1, 283, 284, 285, -1, 287, -1, -1, - -1, -1, 292, 293, 294, 295, -1, -1, 63, 299, - -1, -1, 302, 303, 304, 305, -1, -1, -1, -1, - 263, 264, -1, -1, -1, 268, 269, 270, -1, -1, - 40, -1, -1, 43, 44, 45, -1, -1, 281, -1, - 283, 284, 285, -1, 287, -1, -1, -1, -1, 292, - 293, 294, 295, 63, -1, -1, 299, -1, -1, 302, - 303, 304, 305, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 263, 264, -1, -1, -1, - 268, 269, 270, -1, -1, 40, -1, -1, 43, 44, - 45, -1, -1, 281, -1, 283, 284, 285, -1, 287, - -1, -1, -1, -1, 292, 293, 294, 295, 63, -1, - -1, 299, -1, -1, 302, 303, 304, 305, -1, -1, - -1, -1, 263, 264, -1, -1, -1, 268, 269, 270, - -1, -1, 40, -1, -1, 43, -1, 45, -1, -1, - 281, -1, 283, 284, 285, -1, 287, -1, -1, -1, - 58, 292, 293, 294, 295, 63, -1, -1, 299, -1, - -1, 302, 303, 304, 305, 263, 264, -1, -1, -1, - 268, 269, 270, -1, -1, 40, -1, -1, 43, -1, - 45, -1, -1, 281, -1, 283, 284, 285, -1, 287, - -1, -1, -1, 58, 292, 293, 294, 295, 63, -1, - -1, 299, -1, -1, 302, 303, 304, 305, 263, 264, - -1, -1, -1, 268, 269, 270, -1, -1, 40, 41, - -1, 43, -1, 45, -1, -1, 281, -1, 283, 284, - 285, -1, 287, -1, -1, -1, -1, 292, 293, 294, - 295, 63, -1, -1, 299, -1, -1, 302, 303, 304, - 305, -1, -1, 263, 264, -1, -1, -1, 268, 269, - 270, -1, -1, 40, 41, -1, 43, -1, 45, -1, - -1, 281, -1, 283, 284, 285, -1, 287, -1, -1, - -1, -1, 292, 293, 294, 295, 63, -1, -1, 299, - -1, -1, 302, 303, 304, 305, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 263, 264, - -1, -1, -1, 268, 269, 270, -1, -1, 40, 41, - -1, 43, -1, 45, -1, -1, 281, -1, 283, 284, - 285, -1, 287, -1, -1, -1, -1, 292, 293, 294, - 295, 63, -1, -1, 299, -1, -1, 302, 303, 304, - 305, -1, -1, -1, -1, 263, 264, -1, -1, -1, - 268, 269, 270, -1, -1, 40, 41, -1, 43, -1, - 45, -1, -1, 281, -1, 283, 284, 285, -1, 287, - -1, -1, -1, -1, 292, 293, 294, 295, 63, -1, - -1, 299, -1, -1, 302, 303, 304, 305, 263, 264, - -1, -1, -1, 268, 269, 270, -1, -1, 40, 41, - -1, 43, -1, 45, -1, -1, 281, -1, 283, 284, - 285, -1, 287, -1, -1, -1, -1, 292, 293, 294, - 295, 63, -1, -1, 299, -1, -1, 302, 303, 304, - 305, 263, 264, -1, -1, -1, 268, 269, 270, -1, - -1, 40, 41, -1, 43, -1, 45, -1, -1, 281, - -1, 283, 284, 285, -1, 287, -1, -1, -1, -1, - 292, 293, 294, 295, 63, -1, -1, 299, -1, -1, - 302, 303, 304, 305, -1, -1, 263, 264, -1, -1, - -1, 268, 269, 270, -1, -1, 40, 41, -1, 43, - -1, 45, -1, -1, 281, -1, 283, 284, 285, -1, - 287, -1, -1, -1, -1, 292, 293, 294, 295, 63, - -1, -1, 299, -1, -1, 302, 303, 304, 305, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 263, 264, -1, -1, -1, 268, 269, 270, -1, - -1, 40, 41, -1, 43, -1, 45, -1, -1, 281, - -1, 283, 284, 285, -1, 287, -1, -1, -1, -1, - 292, 293, 294, 295, 63, -1, -1, 299, -1, -1, - 302, 303, 304, 305, -1, -1, -1, -1, 263, 264, - -1, -1, -1, 268, 269, 270, -1, -1, 40, 41, - -1, 43, -1, 45, -1, -1, 281, -1, 283, 284, - 285, -1, 287, -1, -1, -1, -1, 292, 293, 294, - 295, 63, -1, -1, 299, -1, -1, 302, 303, 304, - 305, 263, 264, -1, -1, -1, 268, 269, 270, -1, - -1, 40, 41, -1, 43, -1, 45, -1, -1, 281, - -1, 283, 284, 285, -1, 287, -1, -1, -1, -1, - 292, 293, 294, 295, -1, -1, -1, 299, -1, -1, - 302, 303, 304, 305, 263, 264, -1, -1, -1, 268, - 269, 270, -1, -1, -1, -1, -1, -1, 40, -1, - -1, 43, 281, 45, 283, 284, 285, -1, 287, -1, - -1, -1, -1, 292, 293, 294, 295, -1, -1, -1, - 299, -1, -1, 302, 303, 304, 305, -1, -1, 263, - 264, -1, -1, -1, 268, 269, 270, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 281, -1, 283, - 284, 285, 40, 287, -1, 43, -1, 45, 292, 293, - 294, 295, -1, -1, -1, 299, -1, -1, 302, 303, - 304, 305, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 263, 264, -1, -1, -1, 268, - 269, 270, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 281, -1, 283, 284, 285, 40, 287, -1, - 43, -1, 45, 292, 293, 294, 295, -1, -1, -1, - 299, -1, -1, 302, 303, 304, 305, -1, -1, -1, - -1, 263, 264, -1, -1, -1, 268, 269, 270, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 281, - -1, 283, 284, 285, 40, 287, -1, 43, -1, 45, - 292, 293, 294, 295, -1, -1, -1, 299, -1, -1, - 302, 303, 304, 305, 263, 264, -1, -1, -1, 268, - 269, 270, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 281, -1, 283, 284, 285, 40, 287, -1, - 43, -1, 45, 292, 293, 294, 295, -1, -1, -1, - 299, -1, -1, 302, 303, 304, 305, 259, -1, -1, - 63, 263, 264, -1, -1, -1, 268, 269, 270, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 281, - -1, 283, 284, 285, 40, 287, -1, 43, -1, 45, - 292, 293, 294, 295, -1, -1, -1, 299, -1, -1, - 302, 303, 304, 305, -1, -1, -1, -1, -1, -1, - -1, 259, -1, -1, -1, 263, 264, -1, -1, -1, - 268, 269, 270, -1, -1, -1, -1, 40, -1, -1, - 43, -1, 45, 281, -1, 283, 284, 285, -1, 287, - -1, -1, -1, -1, 292, 293, 294, 295, -1, -1, - -1, 299, -1, -1, 302, 303, 304, 305, -1, -1, - -1, -1, -1, -1, -1, -1, 259, -1, -1, -1, - 263, 264, -1, -1, -1, 268, 269, 270, 40, -1, - -1, 43, -1, 45, -1, -1, -1, -1, 281, -1, - 283, 284, 285, -1, 287, -1, -1, -1, -1, 292, - 293, 294, 295, -1, -1, -1, 299, -1, -1, 302, - 303, 304, 305, 259, -1, -1, -1, 263, 264, -1, - -1, -1, 268, 269, 270, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 281, -1, 283, 284, 285, - -1, 287, -1, -1, -1, -1, 292, 293, 294, 295, - -1, -1, -1, 299, -1, -1, 302, 303, 304, 305, - 263, 264, -1, -1, -1, 268, 269, 270, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 281, -1, - 283, 284, 285, -1, 287, -1, -1, -1, -1, 292, - 293, 294, 295, -1, -1, -1, 299, -1, -1, 302, - 303, 304, 305, 259, -1, -1, -1, 263, 264, -1, - -1, -1, 268, 269, 270, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 281, -1, 283, 284, 285, - -1, 287, -1, -1, -1, -1, 292, 293, 294, 295, - -1, -1, -1, 299, -1, -1, 302, 303, 304, 305, - 263, 264, -1, -1, -1, 268, 269, 270, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 281, -1, - 283, 284, 285, -1, 287, -1, -1, -1, -1, 292, - 293, 294, 295, -1, -1, -1, 299, -1, -1, 302, - 303, 304, 305, -1, -1, -1, -1, 28, 29, -1, - -1, 263, 264, 34, -1, -1, 268, 269, 270, -1, - -1, 42, -1, -1, -1, -1, -1, -1, -1, 281, - -1, 283, 284, 285, -1, 287, -1, -1, -1, -1, - 292, 293, 294, 295, -1, -1, -1, 299, -1, -1, - 302, 303, 304, 305, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 92, 93, 94, 95, 96, 97, -1, -1, -1, - -1, -1, -1, 104, -1, -1, -1, -1, 109, -1, - -1, 112, 113, -1, -1, 116, -1, 118, 119, -1, - -1, -1, 123, 124, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 134, -1, -1, -1, 138, -1, 140, - 141, 142, 143, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 154, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 164, -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, 192, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 208, 209, 210, - 211, -1, 213, -1, 215, 216, -1, -1, -1, -1, - -1, -1, 223, 224, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 235, 236, 237, 238, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 263, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 275, 276, 277, 278, 279, -1, - 281, 282, 283, -}; -#define YYFINAL 1 -#ifndef YYDEBUG -#define YYDEBUG 0 -#endif -#define YYMAXTOKEN 305 -#if YYDEBUG -char *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,"'p'",0,0,0,0,0,0,0, -0,0,0,"'{'","'|'","'}'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"BEGIN","END","REGEX","SEMINEW", -"NEWLINE","COMMENT","FUN1","FUNN","GRGR","PRINT","PRINTF","SPRINTF_OLD", -"SPRINTF_NEW","SPLIT","IF","ELSE","WHILE","FOR","IN","EXIT","NEXT","BREAK", -"CONTINUE","RET","GETLINE","DO","SUB","GSUB","MATCH","FUNCTION","USERFUN", -"DELETE","ASGNOP","OROR","ANDAND","NUMBER","VAR","SUBSTR","INDEX","MATCHOP", -"RELOP","OR","STRING","UMINUS","NOT","INCR","DECR","FIELD","VFIELD", -}; -char *yyrule[] = { -"$accept : program", -"program : junk hunks", -"begin : BEGIN '{' maybe states '}' junk", -"end : END '{' maybe states '}'", -"end : end NEWLINE", -"hunks : hunks hunk junk", -"hunks :", -"hunk : patpat", -"hunk : patpat '{' maybe states '}'", -"hunk : FUNCTION USERFUN '(' arg_list ')' maybe '{' maybe states '}'", -"hunk : '{' maybe states '}'", -"hunk : begin", -"hunk : end", -"arg_list : expr_list", -"patpat : cond", -"patpat : cond ',' cond", -"cond : expr", -"cond : match", -"cond : rel", -"cond : compound_cond", -"cond : cond '?' expr ':' expr", -"compound_cond : '(' compound_cond ')'", -"compound_cond : cond ANDAND maybe cond", -"compound_cond : cond OROR maybe cond", -"compound_cond : NOT cond", -"rel : expr RELOP expr", -"rel : expr '>' expr", -"rel : expr '<' expr", -"rel : '(' rel ')'", -"match : expr MATCHOP expr", -"match : expr MATCHOP REGEX", -"match : REGEX", -"match : '(' match ')'", -"expr : term", -"expr : expr term", -"expr : expr '?' expr ':' expr", -"expr : variable ASGNOP cond", -"sprintf : SPRINTF_NEW", -"sprintf : SPRINTF_OLD", -"term : variable", -"term : NUMBER", -"term : STRING", -"term : term '+' term", -"term : term '-' term", -"term : term '*' term", -"term : term '/' term", -"term : term '%' term", -"term : term '^' term", -"term : term IN VAR", -"term : variable INCR", -"term : variable DECR", -"term : INCR variable", -"term : DECR variable", -"term : '-' term", -"term : '+' term", -"term : '(' cond ')'", -"term : GETLINE", -"term : GETLINE variable", -"term : GETLINE '<' expr", -"term : GETLINE variable '<' expr", -"term : term 'p' GETLINE", -"term : term 'p' GETLINE variable", -"term : FUN1", -"term : FUN1 '(' ')'", -"term : FUN1 '(' expr ')'", -"term : FUNN '(' expr_list ')'", -"term : USERFUN '(' expr_list ')'", -"term : SPRINTF_NEW '(' expr_list ')'", -"term : sprintf expr_list", -"term : SUBSTR '(' expr ',' expr ',' expr ')'", -"term : SUBSTR '(' expr ',' expr ')'", -"term : SPLIT '(' expr ',' VAR ',' expr ')'", -"term : SPLIT '(' expr ',' VAR ',' REGEX ')'", -"term : SPLIT '(' expr ',' VAR ')'", -"term : INDEX '(' expr ',' expr ')'", -"term : MATCH '(' expr ',' REGEX ')'", -"term : MATCH '(' expr ',' expr ')'", -"term : SUB '(' expr ',' expr ')'", -"term : SUB '(' REGEX ',' expr ')'", -"term : GSUB '(' expr ',' expr ')'", -"term : GSUB '(' REGEX ',' expr ')'", -"term : SUB '(' expr ',' expr ',' expr ')'", -"term : SUB '(' REGEX ',' expr ',' expr ')'", -"term : GSUB '(' expr ',' expr ',' expr ')'", -"term : GSUB '(' REGEX ',' expr ',' expr ')'", -"variable : VAR", -"variable : VAR '[' expr_list ']'", -"variable : FIELD", -"variable : VFIELD term", -"expr_list : expr", -"expr_list : clist", -"expr_list :", -"clist : expr ',' maybe expr", -"clist : clist ',' maybe expr", -"clist : '(' clist ')'", -"junk : junk hunksep", -"junk :", -"hunksep : ';'", -"hunksep : SEMINEW", -"hunksep : NEWLINE", -"hunksep : COMMENT", -"maybe : maybe nlstuff", -"maybe :", -"nlstuff : NEWLINE", -"nlstuff : COMMENT", -"separator : ';' maybe", -"separator : SEMINEW maybe", -"separator : NEWLINE maybe", -"separator : COMMENT maybe", -"states : states statement", -"states :", -"statement : simple separator maybe", -"statement : ';' maybe", -"statement : SEMINEW maybe", -"statement : compound", -"simpnull : simple", -"simpnull :", -"simple : expr", -"simple : PRINT expr_list redir expr", -"simple : PRINT expr_list", -"simple : PRINTF expr_list redir expr", -"simple : PRINTF expr_list", -"simple : BREAK", -"simple : NEXT", -"simple : EXIT", -"simple : EXIT expr", -"simple : CONTINUE", -"simple : RET", -"simple : RET expr", -"simple : DELETE VAR '[' expr_list ']'", -"redir : '>'", -"redir : GRGR", -"redir : '|'", -"compound : IF '(' cond ')' maybe statement", -"compound : IF '(' cond ')' maybe statement ELSE maybe statement", -"compound : WHILE '(' cond ')' maybe statement", -"compound : DO maybe statement WHILE '(' cond ')'", -"compound : FOR '(' simpnull ';' cond ';' simpnull ')' maybe statement", -"compound : FOR '(' simpnull ';' ';' simpnull ')' maybe statement", -"compound : FOR '(' expr ')' maybe statement", -"compound : '{' maybe states '}' maybe", -}; -#endif -#ifndef YYSTYPE -typedef int YYSTYPE; -#endif -#define yyclearin (yychar=(-1)) -#define yyerrok (yyerrflag=0) -#ifdef YYSTACKSIZE -#ifndef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#endif -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 -#endif -#endif -int yydebug; -int yynerrs; -int yyerrflag; -int yychar; -short *yyssp; -YYSTYPE *yyvsp; -YYSTYPE yyval; -YYSTYPE yylval; -short yyss[YYSTACKSIZE]; -YYSTYPE yyvs[YYSTACKSIZE]; -#define yystacksize YYSTACKSIZE -#line 401 "a2p.y" - -int yyparse (void); - -#include "a2py.c" -#line 2081 "y.tab.c" -#define YYABORT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab -int -yyparse() -{ - register int yym, yyn, yystate; -#if YYDEBUG - register char *yys; -#ifndef __cplusplus - extern char *getenv(); -#endif - if (yys = getenv("YYDEBUG")) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif - - yynerrs = 0; - yyerrflag = 0; - yychar = (-1); - - yyssp = yyss; - yyvsp = yyvs; - *yyssp = yystate = 0; - -yyloop: - if (yyn = yydefred[yystate]) 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("yydebug: state %d, reading %d (%s)\n", yystate, - yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("yydebug: state %d, shifting to state %d\n", - yystate, yytable[yyn]); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - 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; -#ifdef lint - goto yynewerror; -#endif -yynewerror: - yyerror("syntax error"); -#ifdef lint - 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("yydebug: state %d, error recovery shifting\ - to state %d\n", *yyssp, yytable[yyn]); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("yydebug: error recovery discarding state %d\n", - *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("yydebug: state %d, error recovery discards token %d (%s)\n", - yystate, yychar, yys); - } -#endif - yychar = (-1); - goto yyloop; - } -yyreduce: -#if YYDEBUG - if (yydebug) - printf("yydebug: state %d, reducing by rule %d (%s)\n", - yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - yyval = yyvsp[1-yym]; - switch (yyn) - { -case 1: -#line 51 "a2p.y" -{ root = oper4(OPROG,yyvsp[-1],begins,yyvsp[0],ends); } -break; -case 2: -#line 55 "a2p.y" -{ begins = oper4(OJUNK,begins,yyvsp[-3],yyvsp[-2],yyvsp[0]); in_begin = FALSE; - yyval = Nullop; } -break; -case 3: -#line 60 "a2p.y" -{ ends = oper3(OJUNK,ends,yyvsp[-2],yyvsp[-1]); yyval = Nullop; } -break; -case 4: -#line 62 "a2p.y" -{ yyval = yyvsp[-1]; } -break; -case 5: -#line 66 "a2p.y" -{ yyval = oper3(OHUNKS,yyvsp[-2],yyvsp[-1],yyvsp[0]); } -break; -case 6: -#line 68 "a2p.y" -{ yyval = Nullop; } -break; -case 7: -#line 72 "a2p.y" -{ yyval = oper1(OHUNK,yyvsp[0]); need_entire = TRUE; } -break; -case 8: -#line 74 "a2p.y" -{ yyval = oper2(OHUNK,yyvsp[-4],oper2(OJUNK,yyvsp[-2],yyvsp[-1])); } -break; -case 9: -#line 76 "a2p.y" -{ fixfargs(yyvsp[-8],yyvsp[-6],0); yyval = oper5(OUSERDEF,yyvsp[-8],yyvsp[-6],yyvsp[-4],yyvsp[-2],yyvsp[-1]); } -break; -case 10: -#line 78 "a2p.y" -{ yyval = oper2(OHUNK,Nullop,oper2(OJUNK,yyvsp[-2],yyvsp[-1])); } -break; -case 13: -#line 84 "a2p.y" -{ yyval = rememberargs(yyval); } -break; -case 14: -#line 88 "a2p.y" -{ yyval = oper1(OPAT,yyvsp[0]); } -break; -case 15: -#line 90 "a2p.y" -{ yyval = oper2(ORANGE,yyvsp[-2],yyvsp[0]); } -break; -case 20: -#line 98 "a2p.y" -{ yyval = oper3(OCOND,yyvsp[-4],yyvsp[-2],yyvsp[0]); } -break; -case 21: -#line 103 "a2p.y" -{ yyval = oper1(OCPAREN,yyvsp[-1]); } -break; -case 22: -#line 105 "a2p.y" -{ yyval = oper3(OCANDAND,yyvsp[-3],yyvsp[-1],yyvsp[0]); } -break; -case 23: -#line 107 "a2p.y" -{ yyval = oper3(OCOROR,yyvsp[-3],yyvsp[-1],yyvsp[0]); } -break; -case 24: -#line 109 "a2p.y" -{ yyval = oper1(OCNOT,yyvsp[0]); } -break; -case 25: -#line 113 "a2p.y" -{ yyval = oper3(ORELOP,yyvsp[-1],yyvsp[-2],yyvsp[0]); } -break; -case 26: -#line 115 "a2p.y" -{ yyval = oper3(ORELOP,string(">",1),yyvsp[-2],yyvsp[0]); } -break; -case 27: -#line 117 "a2p.y" -{ yyval = oper3(ORELOP,string("<",1),yyvsp[-2],yyvsp[0]); } -break; -case 28: -#line 119 "a2p.y" -{ yyval = oper1(ORPAREN,yyvsp[-1]); } -break; -case 29: -#line 123 "a2p.y" -{ yyval = oper3(OMATCHOP,yyvsp[-1],yyvsp[-2],yyvsp[0]); } -break; -case 30: -#line 125 "a2p.y" -{ yyval = oper3(OMATCHOP,yyvsp[-1],yyvsp[-2],oper1(OREGEX,yyvsp[0])); } -break; -case 31: -#line 127 "a2p.y" -{ yyval = oper1(OREGEX,yyvsp[0]); } -break; -case 32: -#line 129 "a2p.y" -{ yyval = oper1(OMPAREN,yyvsp[-1]); } -break; -case 33: -#line 133 "a2p.y" -{ yyval = yyvsp[0]; } -break; -case 34: -#line 135 "a2p.y" -{ yyval = oper2(OCONCAT,yyvsp[-1],yyvsp[0]); } -break; -case 35: -#line 137 "a2p.y" -{ yyval = oper3(OCOND,yyvsp[-4],yyvsp[-2],yyvsp[0]); } -break; -case 36: -#line 139 "a2p.y" -{ yyval = oper3(OASSIGN,yyvsp[-1],yyvsp[-2],yyvsp[0]); - if ((ops[yyvsp[-2]].ival & 255) == OFLD) - lval_field = TRUE; - if ((ops[yyvsp[-2]].ival & 255) == OVFLD) - lval_field = TRUE; - } -break; -case 39: -#line 151 "a2p.y" -{ yyval = yyvsp[0]; } -break; -case 40: -#line 153 "a2p.y" -{ yyval = oper1(ONUM,yyvsp[0]); } -break; -case 41: -#line 155 "a2p.y" -{ yyval = oper1(OSTR,yyvsp[0]); } -break; -case 42: -#line 157 "a2p.y" -{ yyval = oper2(OADD,yyvsp[-2],yyvsp[0]); } -break; -case 43: -#line 159 "a2p.y" -{ yyval = oper2(OSUBTRACT,yyvsp[-2],yyvsp[0]); } -break; -case 44: -#line 161 "a2p.y" -{ yyval = oper2(OMULT,yyvsp[-2],yyvsp[0]); } -break; -case 45: -#line 163 "a2p.y" -{ yyval = oper2(ODIV,yyvsp[-2],yyvsp[0]); } -break; -case 46: -#line 165 "a2p.y" -{ yyval = oper2(OMOD,yyvsp[-2],yyvsp[0]); } -break; -case 47: -#line 167 "a2p.y" -{ yyval = oper2(OPOW,yyvsp[-2],yyvsp[0]); } -break; -case 48: -#line 169 "a2p.y" -{ yyval = oper2(ODEFINED,aryrefarg(yyvsp[0]),yyvsp[-2]); } -break; -case 49: -#line 171 "a2p.y" -{ yyval = oper1(OPOSTINCR,yyvsp[-1]); } -break; -case 50: -#line 173 "a2p.y" -{ yyval = oper1(OPOSTDECR,yyvsp[-1]); } -break; -case 51: -#line 175 "a2p.y" -{ yyval = oper1(OPREINCR,yyvsp[0]); } -break; -case 52: -#line 177 "a2p.y" -{ yyval = oper1(OPREDECR,yyvsp[0]); } -break; -case 53: -#line 179 "a2p.y" -{ yyval = oper1(OUMINUS,yyvsp[0]); } -break; -case 54: -#line 181 "a2p.y" -{ yyval = oper1(OUPLUS,yyvsp[0]); } -break; -case 55: -#line 183 "a2p.y" -{ yyval = oper1(OPAREN,yyvsp[-1]); } -break; -case 56: -#line 185 "a2p.y" -{ yyval = oper0(OGETLINE); } -break; -case 57: -#line 187 "a2p.y" -{ yyval = oper1(OGETLINE,yyvsp[0]); } -break; -case 58: -#line 189 "a2p.y" -{ yyval = oper3(OGETLINE,Nullop,string("<",1),yyvsp[0]); - if (ops[yyvsp[0]].ival != OSTR + (1<<8)) do_fancy_opens = TRUE; } -break; -case 59: -#line 192 "a2p.y" -{ yyval = oper3(OGETLINE,yyvsp[-2],string("<",1),yyvsp[0]); - if (ops[yyvsp[0]].ival != OSTR + (1<<8)) do_fancy_opens = TRUE; } -break; -case 60: -#line 195 "a2p.y" -{ yyval = oper3(OGETLINE,Nullop,string("|",1),yyvsp[-2]); - if (ops[yyvsp[-2]].ival != OSTR + (1<<8)) do_fancy_opens = TRUE; } -break; -case 61: -#line 198 "a2p.y" -{ yyval = oper3(OGETLINE,yyvsp[0],string("|",1),yyvsp[-3]); - if (ops[yyvsp[-3]].ival != OSTR + (1<<8)) do_fancy_opens = TRUE; } -break; -case 62: -#line 201 "a2p.y" -{ yyval = oper0(yyvsp[0]); need_entire = do_chop = TRUE; } -break; -case 63: -#line 203 "a2p.y" -{ yyval = oper1(yyvsp[-2],Nullop); need_entire = do_chop = TRUE; } -break; -case 64: -#line 205 "a2p.y" -{ yyval = oper1(yyvsp[-3],yyvsp[-1]); } -break; -case 65: -#line 207 "a2p.y" -{ yyval = oper1(yyvsp[-3],yyvsp[-1]); } -break; -case 66: -#line 209 "a2p.y" -{ yyval = oper2(OUSERFUN,yyvsp[-3],yyvsp[-1]); } -break; -case 67: -#line 211 "a2p.y" -{ yyval = oper1(OSPRINTF,yyvsp[-1]); } -break; -case 68: -#line 213 "a2p.y" -{ yyval = oper1(OSPRINTF,yyvsp[0]); } -break; -case 69: -#line 215 "a2p.y" -{ yyval = oper3(OSUBSTR,yyvsp[-5],yyvsp[-3],yyvsp[-1]); } -break; -case 70: -#line 217 "a2p.y" -{ yyval = oper2(OSUBSTR,yyvsp[-3],yyvsp[-1]); } -break; -case 71: -#line 219 "a2p.y" -{ yyval = oper3(OSPLIT,yyvsp[-5],aryrefarg(numary(yyvsp[-3])),yyvsp[-1]); } -break; -case 72: -#line 221 "a2p.y" -{ yyval = oper3(OSPLIT,yyvsp[-5],aryrefarg(numary(yyvsp[-3])),oper1(OREGEX,yyvsp[-1]));} -break; -case 73: -#line 223 "a2p.y" -{ yyval = oper2(OSPLIT,yyvsp[-3],aryrefarg(numary(yyvsp[-1]))); } -break; -case 74: -#line 225 "a2p.y" -{ yyval = oper2(OINDEX,yyvsp[-3],yyvsp[-1]); } -break; -case 75: -#line 227 "a2p.y" -{ yyval = oper2(OMATCH,yyvsp[-3],oper1(OREGEX,yyvsp[-1])); } -break; -case 76: -#line 229 "a2p.y" -{ yyval = oper2(OMATCH,yyvsp[-3],yyvsp[-1]); } -break; -case 77: -#line 231 "a2p.y" -{ yyval = oper2(OSUB,yyvsp[-3],yyvsp[-1]); } -break; -case 78: -#line 233 "a2p.y" -{ yyval = oper2(OSUB,oper1(OREGEX,yyvsp[-3]),yyvsp[-1]); } -break; -case 79: -#line 235 "a2p.y" -{ yyval = oper2(OGSUB,yyvsp[-3],yyvsp[-1]); } -break; -case 80: -#line 237 "a2p.y" -{ yyval = oper2(OGSUB,oper1(OREGEX,yyvsp[-3]),yyvsp[-1]); } -break; -case 81: -#line 239 "a2p.y" -{ yyval = oper3(OSUB,yyvsp[-5],yyvsp[-3],yyvsp[-1]); } -break; -case 82: -#line 241 "a2p.y" -{ yyval = oper3(OSUB,oper1(OREGEX,yyvsp[-5]),yyvsp[-3],yyvsp[-1]); } -break; -case 83: -#line 243 "a2p.y" -{ yyval = oper3(OGSUB,yyvsp[-5],yyvsp[-3],yyvsp[-1]); } -break; -case 84: -#line 245 "a2p.y" -{ yyval = oper3(OGSUB,oper1(OREGEX,yyvsp[-5]),yyvsp[-3],yyvsp[-1]); } -break; -case 85: -#line 249 "a2p.y" -{ yyval = oper1(OVAR,yyvsp[0]); } -break; -case 86: -#line 251 "a2p.y" -{ yyval = oper2(OVAR,aryrefarg(yyvsp[-3]),yyvsp[-1]); } -break; -case 87: -#line 253 "a2p.y" -{ yyval = oper1(OFLD,yyvsp[0]); } -break; -case 88: -#line 255 "a2p.y" -{ yyval = oper1(OVFLD,yyvsp[0]); } -break; -case 91: -#line 262 "a2p.y" -{ yyval = Nullop; } -break; -case 92: -#line 266 "a2p.y" -{ yyval = oper3(OCOMMA,yyvsp[-3],yyvsp[-1],yyvsp[0]); } -break; -case 93: -#line 268 "a2p.y" -{ yyval = oper3(OCOMMA,yyvsp[-3],yyvsp[-1],yyvsp[0]); } -break; -case 94: -#line 270 "a2p.y" -{ yyval = yyvsp[-1]; } -break; -case 95: -#line 274 "a2p.y" -{ yyval = oper2(OJUNK,yyvsp[-1],yyvsp[0]); } -break; -case 96: -#line 276 "a2p.y" -{ yyval = Nullop; } -break; -case 97: -#line 280 "a2p.y" -{ yyval = oper2(OJUNK,oper0(OSEMICOLON),oper0(ONEWLINE)); } -break; -case 98: -#line 282 "a2p.y" -{ yyval = oper2(OJUNK,oper0(OSEMICOLON),oper0(ONEWLINE)); } -break; -case 99: -#line 284 "a2p.y" -{ yyval = oper0(ONEWLINE); } -break; -case 100: -#line 286 "a2p.y" -{ yyval = oper1(OCOMMENT,yyvsp[0]); } -break; -case 101: -#line 290 "a2p.y" -{ yyval = oper2(OJUNK,yyvsp[-1],yyvsp[0]); } -break; -case 102: -#line 292 "a2p.y" -{ yyval = Nullop; } -break; -case 103: -#line 296 "a2p.y" -{ yyval = oper0(ONEWLINE); } -break; -case 104: -#line 298 "a2p.y" -{ yyval = oper1(OCOMMENT,yyvsp[0]); } -break; -case 105: -#line 303 "a2p.y" -{ yyval = oper2(OJUNK,oper0(OSEMICOLON),yyvsp[0]); } -break; -case 106: -#line 305 "a2p.y" -{ yyval = oper2(OJUNK,oper0(OSNEWLINE),yyvsp[0]); } -break; -case 107: -#line 307 "a2p.y" -{ yyval = oper2(OJUNK,oper0(OSNEWLINE),yyvsp[0]); } -break; -case 108: -#line 309 "a2p.y" -{ yyval = oper2(OJUNK,oper1(OSCOMMENT,yyvsp[-1]),yyvsp[0]); } -break; -case 109: -#line 313 "a2p.y" -{ yyval = oper2(OSTATES,yyvsp[-1],yyvsp[0]); } -break; -case 110: -#line 315 "a2p.y" -{ yyval = Nullop; } -break; -case 111: -#line 320 "a2p.y" -{ yyval = oper2(OJUNK,oper2(OSTATE,yyvsp[-2],yyvsp[-1]),yyvsp[0]); } -break; -case 112: -#line 322 "a2p.y" -{ yyval = oper2(OSTATE,Nullop,oper2(OJUNK,oper0(OSEMICOLON),yyvsp[0])); } -break; -case 113: -#line 324 "a2p.y" -{ yyval = oper2(OSTATE,Nullop,oper2(OJUNK,oper0(OSNEWLINE),yyvsp[0])); } -break; -case 116: -#line 330 "a2p.y" -{ yyval = Nullop; } -break; -case 118: -#line 336 "a2p.y" -{ yyval = oper3(OPRINT,yyvsp[-2],yyvsp[-1],yyvsp[0]); - do_opens = TRUE; - saw_ORS = saw_OFS = TRUE; - if (!yyvsp[-2]) need_entire = TRUE; - if (ops[yyvsp[0]].ival != OSTR + (1<<8)) do_fancy_opens = TRUE; } -break; -case 119: -#line 342 "a2p.y" -{ yyval = oper1(OPRINT,yyvsp[0]); - if (!yyvsp[0]) need_entire = TRUE; - saw_ORS = saw_OFS = TRUE; - } -break; -case 120: -#line 347 "a2p.y" -{ yyval = oper3(OPRINTF,yyvsp[-2],yyvsp[-1],yyvsp[0]); - do_opens = TRUE; - if (!yyvsp[-2]) need_entire = TRUE; - if (ops[yyvsp[0]].ival != OSTR + (1<<8)) do_fancy_opens = TRUE; } -break; -case 121: -#line 352 "a2p.y" -{ yyval = oper1(OPRINTF,yyvsp[0]); - if (!yyvsp[0]) need_entire = TRUE; - } -break; -case 122: -#line 356 "a2p.y" -{ yyval = oper0(OBREAK); } -break; -case 123: -#line 358 "a2p.y" -{ yyval = oper0(ONEXT); } -break; -case 124: -#line 360 "a2p.y" -{ yyval = oper0(OEXIT); } -break; -case 125: -#line 362 "a2p.y" -{ yyval = oper1(OEXIT,yyvsp[0]); } -break; -case 126: -#line 364 "a2p.y" -{ yyval = oper0(OCONTINUE); } -break; -case 127: -#line 366 "a2p.y" -{ yyval = oper0(ORETURN); } -break; -case 128: -#line 368 "a2p.y" -{ yyval = oper1(ORETURN,yyvsp[0]); } -break; -case 129: -#line 370 "a2p.y" -{ yyval = oper2(ODELETE,aryrefarg(yyvsp[-3]),yyvsp[-1]); } -break; -case 130: -#line 374 "a2p.y" -{ yyval = oper1(OREDIR,string(">",1)); } -break; -case 131: -#line 376 "a2p.y" -{ yyval = oper1(OREDIR,string(">>",2)); } -break; -case 132: -#line 378 "a2p.y" -{ yyval = oper1(OREDIR,string("|",1)); } -break; -case 133: -#line 383 "a2p.y" -{ yyval = oper2(OIF,yyvsp[-3],bl(yyvsp[0],yyvsp[-1])); } -break; -case 134: -#line 385 "a2p.y" -{ yyval = oper3(OIF,yyvsp[-6],bl(yyvsp[-3],yyvsp[-4]),bl(yyvsp[0],yyvsp[-1])); } -break; -case 135: -#line 387 "a2p.y" -{ yyval = oper2(OWHILE,yyvsp[-3],bl(yyvsp[0],yyvsp[-1])); } -break; -case 136: -#line 389 "a2p.y" -{ yyval = oper2(ODO,bl(yyvsp[-4],yyvsp[-5]),yyvsp[-1]); } -break; -case 137: -#line 391 "a2p.y" -{ yyval = oper4(OFOR,yyvsp[-7],yyvsp[-5],yyvsp[-3],bl(yyvsp[0],yyvsp[-1])); } -break; -case 138: -#line 393 "a2p.y" -{ yyval = oper4(OFOR,yyvsp[-6],string("",0),yyvsp[-3],bl(yyvsp[0],yyvsp[-1])); } -break; -case 139: -#line 395 "a2p.y" -{ yyval = oper2(OFORIN,yyvsp[-3],bl(yyvsp[0],yyvsp[-1])); } -break; -case 140: -#line 397 "a2p.y" -{ yyval = oper3(OBLOCK,oper2(OJUNK,yyvsp[-3],yyvsp[-2]),Nullop,yyvsp[0]); } -break; -#line 2751 "y.tab.c" - } - yyssp -= yym; - yystate = *yyssp; - yyvsp -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("yydebug: after reduction, shifting from state 0 to\ - state %d\n", 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("yydebug: state %d, reading %d (%s)\n", - 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("yydebug: after reduction, shifting from state %d \ -to state %d\n", *yyssp, yystate); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate; - *++yyvsp = yyval; - goto yyloop; -yyoverflow: - yyerror("yacc stack overflow"); -yyabort: - return (1); -yyaccept: - return (0); -} diff --git a/contrib/perl5/x2p/a2p.h b/contrib/perl5/x2p/a2p.h deleted file mode 100644 index cbcb80c..0000000 --- a/contrib/perl5/x2p/a2p.h +++ /dev/null @@ -1,486 +0,0 @@ -/* $RCSfile: a2p.h,v $$Revision: 4.1 $$Date: 92/08/07 18:29:09 $ - * - * Copyright (c) 1991-2001, Larry Wall - * - * You may distribute under the terms of either the GNU General Public - * License or the Artistic License, as specified in the README file. - * - * $Log: a2p.h,v $ - */ - -#define VOIDUSED 1 - -#ifdef WIN32 -#define _INC_WIN32_PERL5 /* kludge around win32 stdio layer */ -#endif - -#ifdef VMS -# include "config.h" -#else -# include "../config.h" -#endif - -#if defined(__STDC__) || defined(vax11c) || defined(_AIX) || defined(__stdc__) || defined(__cplusplus) -# define STANDARD_C 1 -#endif - -#ifdef WIN32 -#undef USE_STDIO_PTR /* XXX fast gets won't work, must investigate */ -# ifndef STANDARD_C -# define STANDARD_C -# endif -# if defined(__BORLANDC__) -# pragma warn -ccc -# pragma warn -rch -# pragma warn -sig -# pragma warn -pia -# pragma warn -par -# pragma warn -aus -# pragma warn -use -# pragma warn -csu -# pragma warn -pro -# elif defined(_MSC_VER) -# elif defined(__MINGW32__) -# endif -#endif - -/* Use all the "standard" definitions? */ -#if defined(STANDARD_C) && defined(I_STDLIB) -# include <stdlib.h> -#endif /* STANDARD_C */ - -#include <stdio.h> - -#ifdef I_MATH -#include <math.h> -#endif - -#ifdef I_SYS_TYPES -# include <sys/types.h> -#endif - -#ifdef USE_NEXT_CTYPE - -#if NX_CURRENT_COMPILER_RELEASE >= 400 -#include <objc/NXCType.h> -#else /* NX_CURRENT_COMPILER_RELEASE < 400 */ -#include <appkit/NXCType.h> -#endif /* NX_CURRENT_COMPILER_RELEASE >= 400 */ - -#else /* !USE_NEXT_CTYPE */ -#include <ctype.h> -#endif /* USE_NEXT_CTYPE */ - -#define MEM_SIZE Size_t - -#ifndef STANDARD_C - Malloc_t malloc (MEM_SIZE nbytes); - Malloc_t calloc (MEM_SIZE elements, MEM_SIZE size); - Malloc_t realloc (Malloc_t where, MEM_SIZE nbytes); - Free_t free (Malloc_t where); -#endif - -#if defined(I_STRING) || defined(__cplusplus) -# include <string.h> -#else -# include <strings.h> -#endif - -#if !defined(HAS_BCOPY) || defined(__cplusplus) -# define bcopy(s1,s2,l) memcpy(s2,s1,l) -#endif -#if !defined(HAS_BZERO) || defined(__cplusplus) -# define bzero(s,l) memset(s,0,l) -#endif - -#if !defined(HAS_STRCHR) && defined(HAS_INDEX) && !defined(strchr) -#define strchr index -#define strrchr rindex -#endif - - -#ifdef I_TIME -# include <time.h> -#endif - -#ifdef I_SYS_TIME -# ifdef I_SYS_TIME_KERNEL -# define KERNEL -# endif -# include <sys/time.h> -# ifdef I_SYS_TIME_KERNEL -# undef KERNEL -# endif -#endif - -#ifndef MSDOS -# if defined(HAS_TIMES) && defined(I_SYS_TIMES) -# include <sys/times.h> -# endif -#endif - -#ifdef DOSISH -# if defined(OS2) -# define PTHX_UNUSED -# include "../os2ish.h" -# else -# include "../dosish.h" -# endif -#else -# if defined(VMS) -# define NO_PERL_TYPEDEFS -# include "vmsish.h" -# endif -#endif - -#ifndef STANDARD_C -/* All of these are in stdlib.h or time.h for ANSI C */ -Time_t time(); -struct tm *gmtime(), *localtime(); -#if defined(OEMVS) || defined(__OPEN_VM) -char *(strchr)(), *(strrchr)(); -char *(strcpy)(), *(strcat)(); -#else -char *strchr(), *strrchr(); -char *strcpy(), *strcat(); -#endif -#endif /* ! STANDARD_C */ - -#ifdef VMS -# include "handy.h" -#else -# include "../handy.h" -#endif - -#undef Nullfp -#define Nullfp Null(FILE*) - -#define Nullop 0 - -#define OPROG 1 -#define OJUNK 2 -#define OHUNKS 3 -#define ORANGE 4 -#define OPAT 5 -#define OHUNK 6 -#define OPPAREN 7 -#define OPANDAND 8 -#define OPOROR 9 -#define OPNOT 10 -#define OCPAREN 11 -#define OCANDAND 12 -#define OCOROR 13 -#define OCNOT 14 -#define ORELOP 15 -#define ORPAREN 16 -#define OMATCHOP 17 -#define OMPAREN 18 -#define OCONCAT 19 -#define OASSIGN 20 -#define OADD 21 -#define OSUBTRACT 22 -#define OMULT 23 -#define ODIV 24 -#define OMOD 25 -#define OPOSTINCR 26 -#define OPOSTDECR 27 -#define OPREINCR 28 -#define OPREDECR 29 -#define OUMINUS 30 -#define OUPLUS 31 -#define OPAREN 32 -#define OGETLINE 33 -#define OSPRINTF 34 -#define OSUBSTR 35 -#define OSTRING 36 -#define OSPLIT 37 -#define OSNEWLINE 38 -#define OINDEX 39 -#define ONUM 40 -#define OSTR 41 -#define OVAR 42 -#define OFLD 43 -#define ONEWLINE 44 -#define OCOMMENT 45 -#define OCOMMA 46 -#define OSEMICOLON 47 -#define OSCOMMENT 48 -#define OSTATES 49 -#define OSTATE 50 -#define OPRINT 51 -#define OPRINTF 52 -#define OBREAK 53 -#define ONEXT 54 -#define OEXIT 55 -#define OCONTINUE 56 -#define OREDIR 57 -#define OIF 58 -#define OWHILE 59 -#define OFOR 60 -#define OFORIN 61 -#define OVFLD 62 -#define OBLOCK 63 -#define OREGEX 64 -#define OLENGTH 65 -#define OLOG 66 -#define OEXP 67 -#define OSQRT 68 -#define OINT 69 -#define ODO 70 -#define OPOW 71 -#define OSUB 72 -#define OGSUB 73 -#define OMATCH 74 -#define OUSERFUN 75 -#define OUSERDEF 76 -#define OCLOSE 77 -#define OATAN2 78 -#define OSIN 79 -#define OCOS 80 -#define ORAND 81 -#define OSRAND 82 -#define ODELETE 83 -#define OSYSTEM 84 -#define OCOND 85 -#define ORETURN 86 -#define ODEFINED 87 -#define OSTAR 88 - -#ifdef DOINIT -char *opname[] = { - "0", - "PROG", - "JUNK", - "HUNKS", - "RANGE", - "PAT", - "HUNK", - "PPAREN", - "PANDAND", - "POROR", - "PNOT", - "CPAREN", - "CANDAND", - "COROR", - "CNOT", - "RELOP", - "RPAREN", - "MATCHOP", - "MPAREN", - "CONCAT", - "ASSIGN", - "ADD", - "SUBTRACT", - "MULT", - "DIV", - "MOD", - "POSTINCR", - "POSTDECR", - "PREINCR", - "PREDECR", - "UMINUS", - "UPLUS", - "PAREN", - "GETLINE", - "SPRINTF", - "SUBSTR", - "STRING", - "SPLIT", - "SNEWLINE", - "INDEX", - "NUM", - "STR", - "VAR", - "FLD", - "NEWLINE", - "COMMENT", - "COMMA", - "SEMICOLON", - "SCOMMENT", - "STATES", - "STATE", - "PRINT", - "PRINTF", - "BREAK", - "NEXT", - "EXIT", - "CONTINUE", - "REDIR", - "IF", - "WHILE", - "FOR", - "FORIN", - "VFLD", - "BLOCK", - "REGEX", - "LENGTH", - "LOG", - "EXP", - "SQRT", - "INT", - "DO", - "POW", - "SUB", - "GSUB", - "MATCH", - "USERFUN", - "USERDEF", - "CLOSE", - "ATAN2", - "SIN", - "COS", - "RAND", - "SRAND", - "DELETE", - "SYSTEM", - "COND", - "RETURN", - "DEFINED", - "STAR", - "89" -}; -#else -extern char *opname[]; -#endif - -EXT int mop INIT(1); - -union u_ops { - int ival; - char *cval; -}; -#if defined(iAPX286) || defined(M_I286) || defined(I80286) /* 80286 hack */ -#define OPSMAX (64000/sizeof(union u_ops)) /* approx. max segment size */ -#else -#define OPSMAX 50000 -#endif /* 80286 hack */ -EXT union u_ops ops[OPSMAX]; - -typedef struct string STR; -typedef struct htbl HASH; - -#include "str.h" -#include "hash.h" - - -/* A string is TRUE if not "" or "0". */ -#define True(val) (tmps = (val), (*tmps && !(*tmps == '0' && !tmps[1]))) -EXT char *Yes INIT("1"); -EXT char *No INIT(""); - -#define str_true(str) (Str = (str), (Str->str_pok ? True(Str->str_ptr) : (Str->str_nok ? (Str->str_nval != 0.0) : 0 ))) - -#define str_peek(str) (Str = (str), (Str->str_pok ? Str->str_ptr : (Str->str_nok ? (sprintf(buf,"num(%g)",Str->str_nval),buf) : "" ))) -#define str_get(str) (Str = (str), (Str->str_pok ? Str->str_ptr : str_2ptr(Str))) -#define str_gnum(str) (Str = (str), (Str->str_nok ? Str->str_nval : str_2num(Str))) -EXT STR *Str; - -#define GROWSTR(pp,lp,len) if (*(lp) < (len)) growstr(pp,lp,len) - -/* Prototypes for things in a2p.c */ -int aryrefarg ( int arg ); -int bl ( int arg, int maybe ); -void dump ( int branch ); -int fixfargs ( int name, int arg, int prevargs ); -int fixrargs ( char *name, int arg, int prevargs ); -void fixup ( STR *str ); -int numary ( int arg ); -int oper0 ( int type ); -int oper1 ( int type, int arg1 ); -int oper2 ( int type, int arg1, int arg2 ); -int oper3 ( int type, int arg1, int arg2, int arg3 ); -int oper4 ( int type, int arg1, int arg2, int arg3, int arg4 ); -int oper5 ( int type, int arg1, int arg2, int arg3, int arg4, int arg5 ); -void putlines ( STR *str ); -void putone ( void ); -int rememberargs ( int arg ); -char * scannum ( char *s ); -char * scanpat ( char *s ); -int string ( char *ptr, int len ); -void yyerror ( char *s ); -int yylex ( void ); - -EXT int line INIT(0); - -EXT FILE *rsfp; -EXT char buf[2048]; -EXT char *bufptr INIT(buf); - -EXT STR *linestr INIT(Nullstr); - -EXT char tokenbuf[2048]; -EXT int expectterm INIT(TRUE); - -#ifdef DEBUGGING -EXT int debug INIT(0); -EXT int dlevel INIT(0); -#define YYDEBUG 1 -extern int yydebug; -#else -# ifndef YYDEBUG -# define YYDEBUG 0 -# endif -#endif - -EXT STR *freestrroot INIT(Nullstr); - -EXT STR str_no; -EXT STR str_yes; - -EXT bool do_split INIT(FALSE); -EXT bool split_to_array INIT(FALSE); -EXT bool set_array_base INIT(FALSE); -EXT bool saw_RS INIT(FALSE); -EXT bool saw_OFS INIT(FALSE); -EXT bool saw_ORS INIT(FALSE); -EXT bool saw_line_op INIT(FALSE); -EXT bool in_begin INIT(TRUE); -EXT bool do_opens INIT(FALSE); -EXT bool do_fancy_opens INIT(FALSE); -EXT bool lval_field INIT(FALSE); -EXT bool do_chop INIT(FALSE); -EXT bool need_entire INIT(FALSE); -EXT bool absmaxfld INIT(FALSE); -EXT bool saw_altinput INIT(FALSE); - -EXT bool nomemok INIT(FALSE); - -EXT char const_FS INIT(0); -EXT char *namelist INIT(Nullch); -EXT char fswitch INIT(0); -EXT bool old_awk INIT(0); - -EXT int saw_FS INIT(0); -EXT int maxfld INIT(0); -EXT int arymax INIT(0); -EXT char *nameary[100]; - -EXT STR *opens; - -EXT HASH *symtab; -EXT HASH *curarghash; - -#define P_MIN 0 -#define P_LISTOP 5 -#define P_COMMA 10 -#define P_ASSIGN 15 -#define P_COND 20 -#define P_DOTDOT 25 -#define P_OROR 30 -#define P_ANDAND 35 -#define P_OR 40 -#define P_AND 45 -#define P_EQ 50 -#define P_REL 55 -#define P_UNI 60 -#define P_FILETEST 65 -#define P_SHIFT 70 -#define P_ADD 75 -#define P_MUL 80 -#define P_MATCH 85 -#define P_UNARY 90 -#define P_POW 95 -#define P_AUTO 100 -#define P_MAX 999 - -EXT int an; diff --git a/contrib/perl5/x2p/a2p.pod b/contrib/perl5/x2p/a2p.pod deleted file mode 100644 index f6395a4..0000000 --- a/contrib/perl5/x2p/a2p.pod +++ /dev/null @@ -1,177 +0,0 @@ -=head1 NAME - -a2p - Awk to Perl translator - -=head1 SYNOPSIS - -B<a2p [options] filename> - -=head1 DESCRIPTION - -I<A2p> takes an awk script specified on the command line (or from -standard input) and produces a comparable I<perl> script on the -standard output. - -=head2 Options - -Options include: - -=over 5 - -=item B<-DE<lt>numberE<gt>> - -sets debugging flags. - -=item B<-FE<lt>characterE<gt>> - -tells a2p that this awk script is always invoked with this B<-F> -switch. - -=item B<-nE<lt>fieldlistE<gt>> - -specifies the names of the input fields if input does not have to be -split into an array. If you were translating an awk script that -processes the password file, you might say: - - a2p -7 -nlogin.password.uid.gid.gcos.shell.home - -Any delimiter can be used to separate the field names. - -=item B<-E<lt>numberE<gt>> - -causes a2p to assume that input will always have that many fields. - -=item B<-o> - -tells a2p to use old awk behavior. The only current differences are: - -=over 5 - -=item - -Old awk always has a line loop, even if there are no line -actions, whereas new awk does not. - -=item - -In old awk, sprintf is extremely greedy about its arguments. -For example, given the statement - - print sprintf(some_args), extra_args; - -old awk considers I<extra_args> to be arguments to C<sprintf>; new awk -considers them arguments to C<print>. - -=back - -=head2 "Considerations" - -A2p cannot do as good a job translating as a human would, but it -usually does pretty well. There are some areas where you may want to -examine the perl script produced and tweak it some. Here are some of -them, in no particular order. - -There is an awk idiom of putting int() around a string expression to -force numeric interpretation, even though the argument is always -integer anyway. This is generally unneeded in perl, but a2p can't -tell if the argument is always going to be integer, so it leaves it -in. You may wish to remove it. - -Perl differentiates numeric comparison from string comparison. Awk -has one operator for both that decides at run time which comparison to -do. A2p does not try to do a complete job of awk emulation at this -point. Instead it guesses which one you want. It's almost always -right, but it can be spoofed. All such guesses are marked with the -comment "C<#???>". You should go through and check them. You might -want to run at least once with the B<-w> switch to perl, which will -warn you if you use == where you should have used eq. - -Perl does not attempt to emulate the behavior of awk in which -nonexistent array elements spring into existence simply by being -referenced. If somehow you are relying on this mechanism to create -null entries for a subsequent for...in, they won't be there in perl. - -If a2p makes a split line that assigns to a list of variables that -looks like (Fld1, Fld2, Fld3...) you may want to rerun a2p using the -B<-n> option mentioned above. This will let you name the fields -throughout the script. If it splits to an array instead, the script -is probably referring to the number of fields somewhere. - -The exit statement in awk doesn't necessarily exit; it goes to the END -block if there is one. Awk scripts that do contortions within the END -block to bypass the block under such circumstances can be simplified -by removing the conditional in the END block and just exiting directly -from the perl script. - -Perl has two kinds of array, numerically-indexed and associative. -Perl associative arrays are called "hashes". Awk arrays are usually -translated to hashes, but if you happen to know that the index is -always going to be numeric you could change the {...} to [...]. -Iteration over a hash is done using the keys() function, but iteration -over an array is NOT. You might need to modify any loop that iterates -over such an array. - -Awk starts by assuming OFMT has the value %.6g. Perl starts by -assuming its equivalent, $#, to have the value %.20g. You'll want to -set $# explicitly if you use the default value of OFMT. - -Near the top of the line loop will be the split operation that is -implicit in the awk script. There are times when you can move this -down past some conditionals that test the entire record so that the -split is not done as often. - -For aesthetic reasons you may wish to change the array base $[ from 1 -back to perl's default of 0, but remember to change all array -subscripts AND all substr() and index() operations to match. - -Cute comments that say "# Here is a workaround because awk is dumb" -are passed through unmodified. - -Awk scripts are often embedded in a shell script that pipes stuff into -and out of awk. Often the shell script wrapper can be incorporated -into the perl script, since perl can start up pipes into and out of -itself, and can do other things that awk can't do by itself. - -Scripts that refer to the special variables RSTART and RLENGTH can -often be simplified by referring to the variables $`, $& and $', as -long as they are within the scope of the pattern match that sets them. - -The produced perl script may have subroutines defined to deal with -awk's semantics regarding getline and print. Since a2p usually picks -correctness over efficiency. it is almost always possible to rewrite -such code to be more efficient by discarding the semantic sugar. - -For efficiency, you may wish to remove the keyword from any return -statement that is the last statement executed in a subroutine. A2p -catches the most common case, but doesn't analyze embedded blocks for -subtler cases. - -ARGV[0] translates to $ARGV0, but ARGV[n] translates to $ARGV[$n]. A -loop that tries to iterate over ARGV[0] won't find it. - -=head1 ENVIRONMENT - -A2p uses no environment variables. - -=head1 AUTHOR - -Larry Wall E<lt>F<larry@wall.org>E<gt> - -=head1 FILES - -=head1 SEE ALSO - - perl The perl compiler/interpreter - - s2p sed to perl translator - -=head1 DIAGNOSTICS - -=head1 BUGS - -It would be possible to emulate awk's behavior in selecting string -versus numeric operations at run time by inspection of the operands, -but it would be gross and inefficient. Besides, a2p almost always -guesses right. - -Storage for the awk syntax tree is currently static, and can run out. diff --git a/contrib/perl5/x2p/a2p.y b/contrib/perl5/x2p/a2p.y deleted file mode 100644 index beec3a6..0000000 --- a/contrib/perl5/x2p/a2p.y +++ /dev/null @@ -1,404 +0,0 @@ -%{ -/* $RCSfile: a2p.y,v $$Revision: 4.1 $$Date: 92/08/07 18:29:12 $ - * - * Copyright (c) 1991-2001, Larry Wall - * - * You may distribute under the terms of either the GNU General Public - * License or the Artistic License, as specified in the README file. - * - * $Log: a2p.y,v $ - */ - -#include "INTERN.h" -#include "a2p.h" - -int root; -int begins = Nullop; -int ends = Nullop; - -%} -%token BEGIN END -%token REGEX -%token SEMINEW NEWLINE COMMENT -%token FUN1 FUNN GRGR -%token PRINT PRINTF SPRINTF_OLD SPRINTF_NEW SPLIT -%token IF ELSE WHILE FOR IN -%token EXIT NEXT BREAK CONTINUE RET -%token GETLINE DO SUB GSUB MATCH -%token FUNCTION USERFUN DELETE - -%right ASGNOP -%right '?' ':' -%left OROR -%left ANDAND -%left IN -%left NUMBER VAR SUBSTR INDEX -%left MATCHOP -%left RELOP '<' '>' -%left OR -%left STRING -%left '+' '-' -%left '*' '/' '%' -%right UMINUS -%left NOT -%right '^' -%left INCR DECR -%left FIELD VFIELD - -%% - -program : junk hunks - { root = oper4(OPROG,$1,begins,$2,ends); } - ; - -begin : BEGIN '{' maybe states '}' junk - { begins = oper4(OJUNK,begins,$3,$4,$6); in_begin = FALSE; - $$ = Nullop; } - ; - -end : END '{' maybe states '}' - { ends = oper3(OJUNK,ends,$3,$4); $$ = Nullop; } - | end NEWLINE - { $$ = $1; } - ; - -hunks : hunks hunk junk - { $$ = oper3(OHUNKS,$1,$2,$3); } - | /* NULL */ - { $$ = Nullop; } - ; - -hunk : patpat - { $$ = oper1(OHUNK,$1); need_entire = TRUE; } - | patpat '{' maybe states '}' - { $$ = oper2(OHUNK,$1,oper2(OJUNK,$3,$4)); } - | FUNCTION USERFUN '(' arg_list ')' maybe '{' maybe states '}' - { fixfargs($2,$4,0); $$ = oper5(OUSERDEF,$2,$4,$6,$8,$9); } - | '{' maybe states '}' - { $$ = oper2(OHUNK,Nullop,oper2(OJUNK,$2,$3)); } - | begin - | end - ; - -arg_list: expr_list - { $$ = rememberargs($$); } - ; - -patpat : cond - { $$ = oper1(OPAT,$1); } - | cond ',' cond - { $$ = oper2(ORANGE,$1,$3); } - ; - -cond : expr - | match - | rel - | compound_cond - | cond '?' expr ':' expr - { $$ = oper3(OCOND,$1,$3,$5); } - ; - -compound_cond - : '(' compound_cond ')' - { $$ = oper1(OCPAREN,$2); } - | cond ANDAND maybe cond - { $$ = oper3(OCANDAND,$1,$3,$4); } - | cond OROR maybe cond - { $$ = oper3(OCOROR,$1,$3,$4); } - | NOT cond - { $$ = oper1(OCNOT,$2); } - ; - -rel : expr RELOP expr - { $$ = oper3(ORELOP,$2,$1,$3); } - | expr '>' expr - { $$ = oper3(ORELOP,string(">",1),$1,$3); } - | expr '<' expr - { $$ = oper3(ORELOP,string("<",1),$1,$3); } - | '(' rel ')' - { $$ = oper1(ORPAREN,$2); } - ; - -match : expr MATCHOP expr - { $$ = oper3(OMATCHOP,$2,$1,$3); } - | expr MATCHOP REGEX - { $$ = oper3(OMATCHOP,$2,$1,oper1(OREGEX,$3)); } - | REGEX %prec MATCHOP - { $$ = oper1(OREGEX,$1); } - | '(' match ')' - { $$ = oper1(OMPAREN,$2); } - ; - -expr : term - { $$ = $1; } - | expr term - { $$ = oper2(OCONCAT,$1,$2); } - | expr '?' expr ':' expr - { $$ = oper3(OCOND,$1,$3,$5); } - | variable ASGNOP cond - { $$ = oper3(OASSIGN,$2,$1,$3); - if ((ops[$1].ival & 255) == OFLD) - lval_field = TRUE; - if ((ops[$1].ival & 255) == OVFLD) - lval_field = TRUE; - } - ; - -sprintf : SPRINTF_NEW - | SPRINTF_OLD ; - -term : variable - { $$ = $1; } - | NUMBER - { $$ = oper1(ONUM,$1); } - | STRING - { $$ = oper1(OSTR,$1); } - | term '+' term - { $$ = oper2(OADD,$1,$3); } - | term '-' term - { $$ = oper2(OSUBTRACT,$1,$3); } - | term '*' term - { $$ = oper2(OMULT,$1,$3); } - | term '/' term - { $$ = oper2(ODIV,$1,$3); } - | term '%' term - { $$ = oper2(OMOD,$1,$3); } - | term '^' term - { $$ = oper2(OPOW,$1,$3); } - | term IN VAR - { $$ = oper2(ODEFINED,aryrefarg($3),$1); } - | variable INCR - { $$ = oper1(OPOSTINCR,$1); } - | variable DECR - { $$ = oper1(OPOSTDECR,$1); } - | INCR variable - { $$ = oper1(OPREINCR,$2); } - | DECR variable - { $$ = oper1(OPREDECR,$2); } - | '-' term %prec UMINUS - { $$ = oper1(OUMINUS,$2); } - | '+' term %prec UMINUS - { $$ = oper1(OUPLUS,$2); } - | '(' cond ')' - { $$ = oper1(OPAREN,$2); } - | GETLINE - { $$ = oper0(OGETLINE); } - | GETLINE variable - { $$ = oper1(OGETLINE,$2); } - | GETLINE '<' expr - { $$ = oper3(OGETLINE,Nullop,string("<",1),$3); - if (ops[$3].ival != OSTR + (1<<8)) do_fancy_opens = TRUE; } - | GETLINE variable '<' expr - { $$ = oper3(OGETLINE,$2,string("<",1),$4); - if (ops[$4].ival != OSTR + (1<<8)) do_fancy_opens = TRUE; } - | term 'p' GETLINE - { $$ = oper3(OGETLINE,Nullop,string("|",1),$1); - if (ops[$1].ival != OSTR + (1<<8)) do_fancy_opens = TRUE; } - | term 'p' GETLINE variable - { $$ = oper3(OGETLINE,$4,string("|",1),$1); - if (ops[$1].ival != OSTR + (1<<8)) do_fancy_opens = TRUE; } - | FUN1 - { $$ = oper0($1); need_entire = do_chop = TRUE; } - | FUN1 '(' ')' - { $$ = oper1($1,Nullop); need_entire = do_chop = TRUE; } - | FUN1 '(' expr ')' - { $$ = oper1($1,$3); } - | FUNN '(' expr_list ')' - { $$ = oper1($1,$3); } - | USERFUN '(' expr_list ')' - { $$ = oper2(OUSERFUN,$1,$3); } - | SPRINTF_NEW '(' expr_list ')' - { $$ = oper1(OSPRINTF,$3); } - | sprintf expr_list - { $$ = oper1(OSPRINTF,$2); } - | SUBSTR '(' expr ',' expr ',' expr ')' - { $$ = oper3(OSUBSTR,$3,$5,$7); } - | SUBSTR '(' expr ',' expr ')' - { $$ = oper2(OSUBSTR,$3,$5); } - | SPLIT '(' expr ',' VAR ',' expr ')' - { $$ = oper3(OSPLIT,$3,aryrefarg(numary($5)),$7); } - | SPLIT '(' expr ',' VAR ',' REGEX ')' - { $$ = oper3(OSPLIT,$3,aryrefarg(numary($5)),oper1(OREGEX,$7));} - | SPLIT '(' expr ',' VAR ')' - { $$ = oper2(OSPLIT,$3,aryrefarg(numary($5))); } - | INDEX '(' expr ',' expr ')' - { $$ = oper2(OINDEX,$3,$5); } - | MATCH '(' expr ',' REGEX ')' - { $$ = oper2(OMATCH,$3,oper1(OREGEX,$5)); } - | MATCH '(' expr ',' expr ')' - { $$ = oper2(OMATCH,$3,$5); } - | SUB '(' expr ',' expr ')' - { $$ = oper2(OSUB,$3,$5); } - | SUB '(' REGEX ',' expr ')' - { $$ = oper2(OSUB,oper1(OREGEX,$3),$5); } - | GSUB '(' expr ',' expr ')' - { $$ = oper2(OGSUB,$3,$5); } - | GSUB '(' REGEX ',' expr ')' - { $$ = oper2(OGSUB,oper1(OREGEX,$3),$5); } - | SUB '(' expr ',' expr ',' expr ')' - { $$ = oper3(OSUB,$3,$5,$7); } - | SUB '(' REGEX ',' expr ',' expr ')' - { $$ = oper3(OSUB,oper1(OREGEX,$3),$5,$7); } - | GSUB '(' expr ',' expr ',' expr ')' - { $$ = oper3(OGSUB,$3,$5,$7); } - | GSUB '(' REGEX ',' expr ',' expr ')' - { $$ = oper3(OGSUB,oper1(OREGEX,$3),$5,$7); } - ; - -variable: VAR - { $$ = oper1(OVAR,$1); } - | VAR '[' expr_list ']' - { $$ = oper2(OVAR,aryrefarg($1),$3); } - | FIELD - { $$ = oper1(OFLD,$1); } - | VFIELD term - { $$ = oper1(OVFLD,$2); } - ; - -expr_list - : expr - | clist - | /* NULL */ - { $$ = Nullop; } - ; - -clist : expr ',' maybe expr - { $$ = oper3(OCOMMA,$1,$3,$4); } - | clist ',' maybe expr - { $$ = oper3(OCOMMA,$1,$3,$4); } - | '(' clist ')' /* these parens are invisible */ - { $$ = $2; } - ; - -junk : junk hunksep - { $$ = oper2(OJUNK,$1,$2); } - | /* NULL */ - { $$ = Nullop; } - ; - -hunksep : ';' - { $$ = oper2(OJUNK,oper0(OSEMICOLON),oper0(ONEWLINE)); } - | SEMINEW - { $$ = oper2(OJUNK,oper0(OSEMICOLON),oper0(ONEWLINE)); } - | NEWLINE - { $$ = oper0(ONEWLINE); } - | COMMENT - { $$ = oper1(OCOMMENT,$1); } - ; - -maybe : maybe nlstuff - { $$ = oper2(OJUNK,$1,$2); } - | /* NULL */ - { $$ = Nullop; } - ; - -nlstuff : NEWLINE - { $$ = oper0(ONEWLINE); } - | COMMENT - { $$ = oper1(OCOMMENT,$1); } - ; - -separator - : ';' maybe - { $$ = oper2(OJUNK,oper0(OSEMICOLON),$2); } - | SEMINEW maybe - { $$ = oper2(OJUNK,oper0(OSNEWLINE),$2); } - | NEWLINE maybe - { $$ = oper2(OJUNK,oper0(OSNEWLINE),$2); } - | COMMENT maybe - { $$ = oper2(OJUNK,oper1(OSCOMMENT,$1),$2); } - ; - -states : states statement - { $$ = oper2(OSTATES,$1,$2); } - | /* NULL */ - { $$ = Nullop; } - ; - -statement - : simple separator maybe - { $$ = oper2(OJUNK,oper2(OSTATE,$1,$2),$3); } - | ';' maybe - { $$ = oper2(OSTATE,Nullop,oper2(OJUNK,oper0(OSEMICOLON),$2)); } - | SEMINEW maybe - { $$ = oper2(OSTATE,Nullop,oper2(OJUNK,oper0(OSNEWLINE),$2)); } - | compound - ; - -simpnull: simple - | /* NULL */ - { $$ = Nullop; } - ; - -simple - : expr - | PRINT expr_list redir expr - { $$ = oper3(OPRINT,$2,$3,$4); - do_opens = TRUE; - saw_ORS = saw_OFS = TRUE; - if (!$2) need_entire = TRUE; - if (ops[$4].ival != OSTR + (1<<8)) do_fancy_opens = TRUE; } - | PRINT expr_list - { $$ = oper1(OPRINT,$2); - if (!$2) need_entire = TRUE; - saw_ORS = saw_OFS = TRUE; - } - | PRINTF expr_list redir expr - { $$ = oper3(OPRINTF,$2,$3,$4); - do_opens = TRUE; - if (!$2) need_entire = TRUE; - if (ops[$4].ival != OSTR + (1<<8)) do_fancy_opens = TRUE; } - | PRINTF expr_list - { $$ = oper1(OPRINTF,$2); - if (!$2) need_entire = TRUE; - } - | BREAK - { $$ = oper0(OBREAK); } - | NEXT - { $$ = oper0(ONEXT); } - | EXIT - { $$ = oper0(OEXIT); } - | EXIT expr - { $$ = oper1(OEXIT,$2); } - | CONTINUE - { $$ = oper0(OCONTINUE); } - | RET - { $$ = oper0(ORETURN); } - | RET expr - { $$ = oper1(ORETURN,$2); } - | DELETE VAR '[' expr_list ']' - { $$ = oper2(ODELETE,aryrefarg($2),$4); } - ; - -redir : '>' %prec FIELD - { $$ = oper1(OREDIR,string(">",1)); } - | GRGR - { $$ = oper1(OREDIR,string(">>",2)); } - | '|' - { $$ = oper1(OREDIR,string("|",1)); } - ; - -compound - : IF '(' cond ')' maybe statement - { $$ = oper2(OIF,$3,bl($6,$5)); } - | IF '(' cond ')' maybe statement ELSE maybe statement - { $$ = oper3(OIF,$3,bl($6,$5),bl($9,$8)); } - | WHILE '(' cond ')' maybe statement - { $$ = oper2(OWHILE,$3,bl($6,$5)); } - | DO maybe statement WHILE '(' cond ')' - { $$ = oper2(ODO,bl($3,$2),$6); } - | FOR '(' simpnull ';' cond ';' simpnull ')' maybe statement - { $$ = oper4(OFOR,$3,$5,$7,bl($10,$9)); } - | FOR '(' simpnull ';' ';' simpnull ')' maybe statement - { $$ = oper4(OFOR,$3,string("",0),$6,bl($9,$8)); } - | FOR '(' expr ')' maybe statement - { $$ = oper2(OFORIN,$3,bl($6,$5)); } - | '{' maybe states '}' maybe - { $$ = oper3(OBLOCK,oper2(OJUNK,$2,$3),Nullop,$5); } - ; - -%% - -int yyparse (void); - -#include "a2py.c" diff --git a/contrib/perl5/x2p/a2py.c b/contrib/perl5/x2p/a2py.c deleted file mode 100644 index 6884f95..0000000 --- a/contrib/perl5/x2p/a2py.c +++ /dev/null @@ -1,1291 +0,0 @@ -/* $RCSfile: a2py.c,v $$Revision: 4.1 $$Date: 92/08/07 18:29:14 $ - * - * Copyright (c) 1991-2001, Larry Wall - * - * You may distribute under the terms of either the GNU General Public - * License or the Artistic License, as specified in the README file. - * - * $Log: a2py.c,v $ - */ - -#if defined(OS2) || defined(WIN32) -#if defined(WIN32) -#include <io.h> -#endif -#include "../patchlevel.h" -#endif -#include "util.h" - -char *filename; -char *myname; - -int checkers = 0; - -int oper0(int type); -int oper1(int type, int arg1); -int oper2(int type, int arg1, int arg2); -int oper3(int type, int arg1, int arg2, int arg3); -int oper4(int type, int arg1, int arg2, int arg3, int arg4); -int oper5(int type, int arg1, int arg2, int arg3, int arg4, int arg5); -STR *walk(int useval, int level, register int node, int *numericptr, int minprec); - -#if defined(OS2) || defined(WIN32) -static void usage(void); - -static void -usage() -{ - printf("\nThis is the AWK to PERL translator, revision %d.0, version %d\n", PERL_REVISION, PERL_VERSION); - printf("\nUsage: %s [-D<number>] [-F<char>] [-n<fieldlist>] [-<number>] filename\n", myname); - printf("\n -D<number> sets debugging flags." - "\n -F<character> the awk script to translate is always invoked with" - "\n this -F switch." - "\n -n<fieldlist> specifies the names of the input fields if input does" - "\n not have to be split into an array." - "\n -<number> causes a2p to assume that input will always have that" - "\n many fields.\n"); - exit(1); -} -#endif - -int -main(register int argc, register char **argv, register char **env) -{ - register STR *str; - int i; - STR *tmpstr; - - myname = argv[0]; - linestr = str_new(80); - str = str_new(0); /* first used for -I flags */ - for (argc--,argv++; argc; argc--,argv++) { - if (argv[0][0] != '-' || !argv[0][1]) - break; - reswitch: - switch (argv[0][1]) { -#ifdef DEBUGGING - case 'D': - debug = atoi(argv[0]+2); -#if YYDEBUG - yydebug = (debug & 1); -#endif - break; -#endif - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - maxfld = atoi(argv[0]+1); - absmaxfld = TRUE; - break; - case 'F': - fswitch = argv[0][2]; - break; - case 'n': - namelist = savestr(argv[0]+2); - break; - case 'o': - old_awk = TRUE; - break; - case '-': - argc--,argv++; - goto switch_end; - case 0: - break; - default: -#if defined(OS2) || defined(WIN32) - fprintf(stderr, "Unrecognized switch: %s\n",argv[0]); - usage(); -#else - fatal("Unrecognized switch: %s\n",argv[0]); -#endif - } - } - switch_end: - - /* open script */ - - if (argv[0] == Nullch) { -#if defined(OS2) || defined(WIN32) - if ( isatty(fileno(stdin)) ) - usage(); -#endif - argv[0] = "-"; - } - filename = savestr(argv[0]); - - filename = savestr(argv[0]); - if (strEQ(filename,"-")) - argv[0] = ""; - if (!*argv[0]) - rsfp = stdin; - else - rsfp = fopen(argv[0],"r"); - if (rsfp == Nullfp) - fatal("Awk script \"%s\" doesn't seem to exist.\n",filename); - - /* init tokener */ - - bufptr = str_get(linestr); - symtab = hnew(); - curarghash = hnew(); - - /* now parse the report spec */ - - if (yyparse()) - fatal("Translation aborted due to syntax errors.\n"); - -#ifdef DEBUGGING - if (debug & 2) { - int type, len; - - for (i=1; i<mop;) { - type = ops[i].ival; - len = type >> 8; - type &= 255; - printf("%d\t%d\t%d\t%-10s",i++,type,len,opname[type]); - if (type == OSTRING) - printf("\t\"%s\"\n",ops[i].cval),i++; - else { - while (len--) { - printf("\t%d",ops[i].ival),i++; - } - putchar('\n'); - } - } - } - if (debug & 8) - dump(root); -#endif - - /* first pass to look for numeric variables */ - - prewalk(0,0,root,&i); - - /* second pass to produce new program */ - - tmpstr = walk(0,0,root,&i,P_MIN); - str = str_make(STARTPERL); - str_cat(str, "\neval 'exec "); - str_cat(str, BIN); - str_cat(str, "/perl -S $0 ${1+\"$@\"}'\n\ - if $running_under_some_shell;\n\ - # this emulates #! processing on NIH machines.\n\ - # (remove #! line above if indigestible)\n\n"); - str_cat(str, - "eval '$'.$1.'$2;' while $ARGV[0] =~ /^([A-Za-z_0-9]+=)(.*)/ && shift;\n"); - str_cat(str, - " # process any FOO=bar switches\n\n"); - if (do_opens && opens) { - str_scat(str,opens); - str_free(opens); - str_cat(str,"\n"); - } - str_scat(str,tmpstr); - str_free(tmpstr); -#ifdef DEBUGGING - if (!(debug & 16)) -#endif - fixup(str); - putlines(str); - if (checkers) { - fprintf(stderr, - "Please check my work on the %d line%s I've marked with \"#???\".\n", - checkers, checkers == 1 ? "" : "s" ); - fprintf(stderr, - "The operation I've selected may be wrong for the operand types.\n"); - } - exit(0); -} - -#define RETURN(retval) return (bufptr = s,retval) -#define XTERM(retval) return (expectterm = TRUE,bufptr = s,retval) -#define XOP(retval) return (expectterm = FALSE,bufptr = s,retval) -#define ID(x) return (yylval=string(x,0),expectterm = FALSE,bufptr = s,idtype) - -int idtype; - -int -yylex(void) -{ - register char *s = bufptr; - register char *d; - register int tmp; - - retry: -#if YYDEBUG - if (yydebug) - if (strchr(s,'\n')) - fprintf(stderr,"Tokener at %s",s); - else - fprintf(stderr,"Tokener at %s\n",s); -#endif - switch (*s) { - default: - fprintf(stderr, - "Unrecognized character %c in file %s line %d--ignoring.\n", - *s++,filename,line); - goto retry; - case '\\': - s++; - if (*s && *s != '\n') { - yyerror("Ignoring spurious backslash"); - goto retry; - } - /*FALLSTHROUGH*/ - case 0: - s = str_get(linestr); - *s = '\0'; - if (!rsfp) - RETURN(0); - line++; - if ((s = str_gets(linestr, rsfp)) == Nullch) { - if (rsfp != stdin) - fclose(rsfp); - rsfp = Nullfp; - s = str_get(linestr); - RETURN(0); - } - goto retry; - case ' ': case '\t': - s++; - goto retry; - case '\n': - *s = '\0'; - XTERM(NEWLINE); - case '#': - yylval = string(s,0); - *s = '\0'; - XTERM(COMMENT); - case ';': - tmp = *s++; - if (*s == '\n') { - s++; - XTERM(SEMINEW); - } - XTERM(tmp); - case '(': - tmp = *s++; - XTERM(tmp); - case '{': - case '[': - case ')': - case ']': - case '?': - case ':': - tmp = *s++; - XOP(tmp); -#ifdef EBCDIC - case 7: -#else - case 127: -#endif - s++; - XTERM('}'); - case '}': - for (d = s + 1; isspace(*d); d++) ; - if (!*d) - s = d - 1; - *s = 127; - XTERM(';'); - case ',': - tmp = *s++; - XTERM(tmp); - case '~': - s++; - yylval = string("~",1); - XTERM(MATCHOP); - case '+': - case '-': - if (s[1] == *s) { - s++; - if (*s++ == '+') - XTERM(INCR); - else - XTERM(DECR); - } - /* FALL THROUGH */ - case '*': - case '%': - case '^': - tmp = *s++; - if (*s == '=') { - if (tmp == '^') - yylval = string("**=",3); - else - yylval = string(s-1,2); - s++; - XTERM(ASGNOP); - } - XTERM(tmp); - case '&': - s++; - tmp = *s++; - if (tmp == '&') - XTERM(ANDAND); - s--; - XTERM('&'); - case '|': - s++; - tmp = *s++; - if (tmp == '|') - XTERM(OROR); - s--; - while (*s == ' ' || *s == '\t') - s++; - if (strnEQ(s,"getline",7)) - XTERM('p'); - else - XTERM('|'); - case '=': - s++; - tmp = *s++; - if (tmp == '=') { - yylval = string("==",2); - XTERM(RELOP); - } - s--; - yylval = string("=",1); - XTERM(ASGNOP); - case '!': - s++; - tmp = *s++; - if (tmp == '=') { - yylval = string("!=",2); - XTERM(RELOP); - } - if (tmp == '~') { - yylval = string("!~",2); - XTERM(MATCHOP); - } - s--; - XTERM(NOT); - case '<': - s++; - tmp = *s++; - if (tmp == '=') { - yylval = string("<=",2); - XTERM(RELOP); - } - s--; - XTERM('<'); - case '>': - s++; - tmp = *s++; - if (tmp == '>') { - yylval = string(">>",2); - XTERM(GRGR); - } - if (tmp == '=') { - yylval = string(">=",2); - XTERM(RELOP); - } - s--; - XTERM('>'); - -#define SNARFWORD \ - d = tokenbuf; \ - while (isalpha(*s) || isdigit(*s) || *s == '_') \ - *d++ = *s++; \ - *d = '\0'; \ - d = tokenbuf; \ - if (*s == '(') \ - idtype = USERFUN; \ - else \ - idtype = VAR; - - case '$': - s++; - if (*s == '0') { - s++; - do_chop = TRUE; - need_entire = TRUE; - idtype = VAR; - ID("0"); - } - do_split = TRUE; - if (isdigit(*s)) { - for (d = s; isdigit(*s); s++) ; - yylval = string(d,s-d); - tmp = atoi(d); - if (tmp > maxfld) - maxfld = tmp; - XOP(FIELD); - } - split_to_array = set_array_base = TRUE; - XOP(VFIELD); - - case '/': /* may either be division or pattern */ - if (expectterm) { - s = scanpat(s); - XTERM(REGEX); - } - tmp = *s++; - if (*s == '=') { - yylval = string("/=",2); - s++; - XTERM(ASGNOP); - } - XTERM(tmp); - - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': case '.': - s = scannum(s); - XOP(NUMBER); - case '"': - s++; - s = cpy2(tokenbuf,s,s[-1]); - if (!*s) - fatal("String not terminated:\n%s",str_get(linestr)); - s++; - yylval = string(tokenbuf,0); - XOP(STRING); - - case 'a': case 'A': - SNARFWORD; - if (strEQ(d,"ARGC")) - set_array_base = TRUE; - if (strEQ(d,"ARGV")) { - yylval=numary(string("ARGV",0)); - XOP(VAR); - } - if (strEQ(d,"atan2")) { - yylval = OATAN2; - XTERM(FUNN); - } - ID(d); - case 'b': case 'B': - SNARFWORD; - if (strEQ(d,"break")) - XTERM(BREAK); - if (strEQ(d,"BEGIN")) - XTERM(BEGIN); - ID(d); - case 'c': case 'C': - SNARFWORD; - if (strEQ(d,"continue")) - XTERM(CONTINUE); - if (strEQ(d,"cos")) { - yylval = OCOS; - XTERM(FUN1); - } - if (strEQ(d,"close")) { - do_fancy_opens = 1; - yylval = OCLOSE; - XTERM(FUN1); - } - if (strEQ(d,"chdir")) - *d = toupper(*d); - else if (strEQ(d,"crypt")) - *d = toupper(*d); - else if (strEQ(d,"chop")) - *d = toupper(*d); - else if (strEQ(d,"chmod")) - *d = toupper(*d); - else if (strEQ(d,"chown")) - *d = toupper(*d); - ID(d); - case 'd': case 'D': - SNARFWORD; - if (strEQ(d,"do")) - XTERM(DO); - if (strEQ(d,"delete")) - XTERM(DELETE); - if (strEQ(d,"die")) - *d = toupper(*d); - ID(d); - case 'e': case 'E': - SNARFWORD; - if (strEQ(d,"END")) - XTERM(END); - if (strEQ(d,"else")) - XTERM(ELSE); - if (strEQ(d,"exit")) { - saw_line_op = TRUE; - XTERM(EXIT); - } - if (strEQ(d,"exp")) { - yylval = OEXP; - XTERM(FUN1); - } - if (strEQ(d,"elsif")) - *d = toupper(*d); - else if (strEQ(d,"eq")) - *d = toupper(*d); - else if (strEQ(d,"eval")) - *d = toupper(*d); - else if (strEQ(d,"eof")) - *d = toupper(*d); - else if (strEQ(d,"each")) - *d = toupper(*d); - else if (strEQ(d,"exec")) - *d = toupper(*d); - ID(d); - case 'f': case 'F': - SNARFWORD; - if (strEQ(d,"FS")) { - saw_FS++; - if (saw_FS == 1 && in_begin) { - for (d = s; *d && isspace(*d); d++) ; - if (*d == '=') { - for (d++; *d && isspace(*d); d++) ; - if (*d == '"' && d[2] == '"') - const_FS = d[1]; - } - } - ID(tokenbuf); - } - if (strEQ(d,"for")) - XTERM(FOR); - else if (strEQ(d,"function")) - XTERM(FUNCTION); - if (strEQ(d,"FILENAME")) - d = "ARGV"; - if (strEQ(d,"foreach")) - *d = toupper(*d); - else if (strEQ(d,"format")) - *d = toupper(*d); - else if (strEQ(d,"fork")) - *d = toupper(*d); - else if (strEQ(d,"fh")) - *d = toupper(*d); - ID(d); - case 'g': case 'G': - SNARFWORD; - if (strEQ(d,"getline")) - XTERM(GETLINE); - if (strEQ(d,"gsub")) - XTERM(GSUB); - if (strEQ(d,"ge")) - *d = toupper(*d); - else if (strEQ(d,"gt")) - *d = toupper(*d); - else if (strEQ(d,"goto")) - *d = toupper(*d); - else if (strEQ(d,"gmtime")) - *d = toupper(*d); - ID(d); - case 'h': case 'H': - SNARFWORD; - if (strEQ(d,"hex")) - *d = toupper(*d); - ID(d); - case 'i': case 'I': - SNARFWORD; - if (strEQ(d,"if")) - XTERM(IF); - if (strEQ(d,"in")) - XTERM(IN); - if (strEQ(d,"index")) { - set_array_base = TRUE; - XTERM(INDEX); - } - if (strEQ(d,"int")) { - yylval = OINT; - XTERM(FUN1); - } - ID(d); - case 'j': case 'J': - SNARFWORD; - if (strEQ(d,"join")) - *d = toupper(*d); - ID(d); - case 'k': case 'K': - SNARFWORD; - if (strEQ(d,"keys")) - *d = toupper(*d); - else if (strEQ(d,"kill")) - *d = toupper(*d); - ID(d); - case 'l': case 'L': - SNARFWORD; - if (strEQ(d,"length")) { - yylval = OLENGTH; - XTERM(FUN1); - } - if (strEQ(d,"log")) { - yylval = OLOG; - XTERM(FUN1); - } - if (strEQ(d,"last")) - *d = toupper(*d); - else if (strEQ(d,"local")) - *d = toupper(*d); - else if (strEQ(d,"lt")) - *d = toupper(*d); - else if (strEQ(d,"le")) - *d = toupper(*d); - else if (strEQ(d,"locatime")) - *d = toupper(*d); - else if (strEQ(d,"link")) - *d = toupper(*d); - ID(d); - case 'm': case 'M': - SNARFWORD; - if (strEQ(d,"match")) { - set_array_base = TRUE; - XTERM(MATCH); - } - if (strEQ(d,"m")) - *d = toupper(*d); - ID(d); - case 'n': case 'N': - SNARFWORD; - if (strEQ(d,"NF")) - do_chop = do_split = split_to_array = set_array_base = TRUE; - if (strEQ(d,"next")) { - saw_line_op = TRUE; - XTERM(NEXT); - } - if (strEQ(d,"ne")) - *d = toupper(*d); - ID(d); - case 'o': case 'O': - SNARFWORD; - if (strEQ(d,"ORS")) { - saw_ORS = TRUE; - d = "\\"; - } - if (strEQ(d,"OFS")) { - saw_OFS = TRUE; - d = ","; - } - if (strEQ(d,"OFMT")) { - d = "#"; - } - if (strEQ(d,"open")) - *d = toupper(*d); - else if (strEQ(d,"ord")) - *d = toupper(*d); - else if (strEQ(d,"oct")) - *d = toupper(*d); - ID(d); - case 'p': case 'P': - SNARFWORD; - if (strEQ(d,"print")) { - XTERM(PRINT); - } - if (strEQ(d,"printf")) { - XTERM(PRINTF); - } - if (strEQ(d,"push")) - *d = toupper(*d); - else if (strEQ(d,"pop")) - *d = toupper(*d); - ID(d); - case 'q': case 'Q': - SNARFWORD; - ID(d); - case 'r': case 'R': - SNARFWORD; - if (strEQ(d,"RS")) { - d = "/"; - saw_RS = TRUE; - } - if (strEQ(d,"rand")) { - yylval = ORAND; - XTERM(FUN1); - } - if (strEQ(d,"return")) - XTERM(RET); - if (strEQ(d,"reset")) - *d = toupper(*d); - else if (strEQ(d,"redo")) - *d = toupper(*d); - else if (strEQ(d,"rename")) - *d = toupper(*d); - ID(d); - case 's': case 'S': - SNARFWORD; - if (strEQ(d,"split")) { - set_array_base = TRUE; - XOP(SPLIT); - } - if (strEQ(d,"substr")) { - set_array_base = TRUE; - XTERM(SUBSTR); - } - if (strEQ(d,"sub")) - XTERM(SUB); - if (strEQ(d,"sprintf")) { - /* In old awk, { print sprintf("str%sg"),"in" } prints - * "string"; in new awk, "in" is not considered an argument to - * sprintf, so the statement breaks. To support both, the - * grammar treats arguments to SPRINTF_OLD like old awk, - * SPRINTF_NEW like new. Here we return the appropriate one. - */ - XTERM(old_awk ? SPRINTF_OLD : SPRINTF_NEW); - } - if (strEQ(d,"sqrt")) { - yylval = OSQRT; - XTERM(FUN1); - } - if (strEQ(d,"SUBSEP")) { - d = ";"; - } - if (strEQ(d,"sin")) { - yylval = OSIN; - XTERM(FUN1); - } - if (strEQ(d,"srand")) { - yylval = OSRAND; - XTERM(FUN1); - } - if (strEQ(d,"system")) { - yylval = OSYSTEM; - XTERM(FUN1); - } - if (strEQ(d,"s")) - *d = toupper(*d); - else if (strEQ(d,"shift")) - *d = toupper(*d); - else if (strEQ(d,"select")) - *d = toupper(*d); - else if (strEQ(d,"seek")) - *d = toupper(*d); - else if (strEQ(d,"stat")) - *d = toupper(*d); - else if (strEQ(d,"study")) - *d = toupper(*d); - else if (strEQ(d,"sleep")) - *d = toupper(*d); - else if (strEQ(d,"symlink")) - *d = toupper(*d); - else if (strEQ(d,"sort")) - *d = toupper(*d); - ID(d); - case 't': case 'T': - SNARFWORD; - if (strEQ(d,"tr")) - *d = toupper(*d); - else if (strEQ(d,"tell")) - *d = toupper(*d); - else if (strEQ(d,"time")) - *d = toupper(*d); - else if (strEQ(d,"times")) - *d = toupper(*d); - ID(d); - case 'u': case 'U': - SNARFWORD; - if (strEQ(d,"until")) - *d = toupper(*d); - else if (strEQ(d,"unless")) - *d = toupper(*d); - else if (strEQ(d,"umask")) - *d = toupper(*d); - else if (strEQ(d,"unshift")) - *d = toupper(*d); - else if (strEQ(d,"unlink")) - *d = toupper(*d); - else if (strEQ(d,"utime")) - *d = toupper(*d); - ID(d); - case 'v': case 'V': - SNARFWORD; - if (strEQ(d,"values")) - *d = toupper(*d); - ID(d); - case 'w': case 'W': - SNARFWORD; - if (strEQ(d,"while")) - XTERM(WHILE); - if (strEQ(d,"write")) - *d = toupper(*d); - else if (strEQ(d,"wait")) - *d = toupper(*d); - ID(d); - case 'x': case 'X': - SNARFWORD; - if (strEQ(d,"x")) - *d = toupper(*d); - ID(d); - case 'y': case 'Y': - SNARFWORD; - if (strEQ(d,"y")) - *d = toupper(*d); - ID(d); - case 'z': case 'Z': - SNARFWORD; - ID(d); - } -} - -char * -scanpat(register char *s) -{ - register char *d; - - switch (*s++) { - case '/': - break; - default: - fatal("Search pattern not found:\n%s",str_get(linestr)); - } - - d = tokenbuf; - for (; *s; s++,d++) { - if (*s == '\\') { - if (s[1] == '/') - *d++ = *s++; - else if (s[1] == '\\') - *d++ = *s++; - else if (s[1] == '[') - *d++ = *s++; - } - else if (*s == '[') { - *d++ = *s++; - do { - if (*s == '\\' && s[1]) - *d++ = *s++; - if (*s == '/' || (*s == '-' && s[1] == ']')) - *d++ = '\\'; - *d++ = *s++; - } while (*s && *s != ']'); - } - else if (*s == '/') - break; - *d = *s; - } - *d = '\0'; - - if (!*s) - fatal("Search pattern not terminated:\n%s",str_get(linestr)); - s++; - yylval = string(tokenbuf,0); - return s; -} - -void -yyerror(char *s) -{ - fprintf(stderr,"%s in file %s at line %d\n", - s,filename,line); -} - -char * -scannum(register char *s) -{ - register char *d; - - switch (*s) { - case '1': case '2': case '3': case '4': case '5': - case '6': case '7': case '8': case '9': case '0' : case '.': - d = tokenbuf; - while (isdigit(*s)) { - *d++ = *s++; - } - if (*s == '.') { - if (isdigit(s[1])) { - *d++ = *s++; - while (isdigit(*s)) { - *d++ = *s++; - } - } - else - s++; - } - if (strchr("eE",*s) && strchr("+-0123456789",s[1])) { - *d++ = *s++; - if (*s == '+' || *s == '-') - *d++ = *s++; - while (isdigit(*s)) - *d++ = *s++; - } - *d = '\0'; - yylval = string(tokenbuf,0); - break; - } - return s; -} - -int -string(char *ptr, int len) -{ - int retval = mop; - - ops[mop++].ival = OSTRING + (1<<8); - if (!len) - len = strlen(ptr); - ops[mop].cval = (char *) safemalloc(len+1); - strncpy(ops[mop].cval,ptr,len); - ops[mop++].cval[len] = '\0'; - if (mop >= OPSMAX) - fatal("Recompile a2p with larger OPSMAX\n"); - return retval; -} - -int -oper0(int type) -{ - int retval = mop; - - if (type > 255) - fatal("type > 255 (%d)\n",type); - ops[mop++].ival = type; - if (mop >= OPSMAX) - fatal("Recompile a2p with larger OPSMAX\n"); - return retval; -} - -int -oper1(int type, int arg1) -{ - int retval = mop; - - if (type > 255) - fatal("type > 255 (%d)\n",type); - ops[mop++].ival = type + (1<<8); - ops[mop++].ival = arg1; - if (mop >= OPSMAX) - fatal("Recompile a2p with larger OPSMAX\n"); - return retval; -} - -int -oper2(int type, int arg1, int arg2) -{ - int retval = mop; - - if (type > 255) - fatal("type > 255 (%d)\n",type); - ops[mop++].ival = type + (2<<8); - ops[mop++].ival = arg1; - ops[mop++].ival = arg2; - if (mop >= OPSMAX) - fatal("Recompile a2p with larger OPSMAX\n"); - return retval; -} - -int -oper3(int type, int arg1, int arg2, int arg3) -{ - int retval = mop; - - if (type > 255) - fatal("type > 255 (%d)\n",type); - ops[mop++].ival = type + (3<<8); - ops[mop++].ival = arg1; - ops[mop++].ival = arg2; - ops[mop++].ival = arg3; - if (mop >= OPSMAX) - fatal("Recompile a2p with larger OPSMAX\n"); - return retval; -} - -int -oper4(int type, int arg1, int arg2, int arg3, int arg4) -{ - int retval = mop; - - if (type > 255) - fatal("type > 255 (%d)\n",type); - ops[mop++].ival = type + (4<<8); - ops[mop++].ival = arg1; - ops[mop++].ival = arg2; - ops[mop++].ival = arg3; - ops[mop++].ival = arg4; - if (mop >= OPSMAX) - fatal("Recompile a2p with larger OPSMAX\n"); - return retval; -} - -int -oper5(int type, int arg1, int arg2, int arg3, int arg4, int arg5) -{ - int retval = mop; - - if (type > 255) - fatal("type > 255 (%d)\n",type); - ops[mop++].ival = type + (5<<8); - ops[mop++].ival = arg1; - ops[mop++].ival = arg2; - ops[mop++].ival = arg3; - ops[mop++].ival = arg4; - ops[mop++].ival = arg5; - if (mop >= OPSMAX) - fatal("Recompile a2p with larger OPSMAX\n"); - return retval; -} - -int depth = 0; - -void -dump(int branch) -{ - register int type; - register int len; - register int i; - - type = ops[branch].ival; - len = type >> 8; - type &= 255; - for (i=depth; i; i--) - printf(" "); - if (type == OSTRING) { - printf("%-5d\"%s\"\n",branch,ops[branch+1].cval); - } - else { - printf("(%-5d%s %d\n",branch,opname[type],len); - depth++; - for (i=1; i<=len; i++) - dump(ops[branch+i].ival); - depth--; - for (i=depth; i; i--) - printf(" "); - printf(")\n"); - } -} - -int -bl(int arg, int maybe) -{ - if (!arg) - return 0; - else if ((ops[arg].ival & 255) != OBLOCK) - return oper2(OBLOCK,arg,maybe); - else if ((ops[arg].ival >> 8) < 2) - return oper2(OBLOCK,ops[arg+1].ival,maybe); - else - return arg; -} - -void -fixup(STR *str) -{ - register char *s; - register char *t; - - for (s = str->str_ptr; *s; s++) { - if (*s == ';' && s[1] == ' ' && s[2] == '\n') { - strcpy(s+1,s+2); - s++; - } - else if (*s == '\n') { - for (t = s+1; isspace(*t & 127); t++) ; - t--; - while (isspace(*t & 127) && *t != '\n') t--; - if (*t == '\n' && t-s > 1) { - if (s[-1] == '{') - s--; - strcpy(s+1,t); - } - s++; - } - } -} - -void -putlines(STR *str) -{ - register char *d, *s, *t, *e; - register int pos, newpos; - - d = tokenbuf; - pos = 0; - for (s = str->str_ptr; *s; s++) { - *d++ = *s; - pos++; - if (*s == '\n') { - *d = '\0'; - d = tokenbuf; - pos = 0; - putone(); - } - else if (*s == '\t') - pos += 7; - if (pos > 78) { /* split a long line? */ - *d-- = '\0'; - newpos = 0; - for (t = tokenbuf; isspace(*t & 127); t++) { - if (*t == '\t') - newpos += 8; - else - newpos += 1; - } - e = d; - while (d > tokenbuf && (*d != ' ' || d[-1] != ';')) - d--; - if (d < t+10) { - d = e; - while (d > tokenbuf && - (*d != ' ' || d[-1] != '|' || d[-2] != '|') ) - d--; - } - if (d < t+10) { - d = e; - while (d > tokenbuf && - (*d != ' ' || d[-1] != '&' || d[-2] != '&') ) - d--; - } - if (d < t+10) { - d = e; - while (d > tokenbuf && (*d != ' ' || d[-1] != ',')) - d--; - } - if (d < t+10) { - d = e; - while (d > tokenbuf && *d != ' ') - d--; - } - if (d > t+3) { - char save[2048]; - strcpy(save, d); - *d = '\n'; - d[1] = '\0'; - putone(); - putchar('\n'); - if (d[-1] != ';' && !(newpos % 4)) { - *t++ = ' '; - *t++ = ' '; - newpos += 2; - } - strcpy(t,save+1); - newpos += strlen(t); - d = t + strlen(t); - pos = newpos; - } - else - d = e + 1; - } - } -} - -void -putone(void) -{ - register char *t; - - for (t = tokenbuf; *t; t++) { - *t &= 127; - if (*t == 127) { - *t = ' '; - strcpy(t+strlen(t)-1, "\t#???\n"); - checkers++; - } - } - t = tokenbuf; - if (*t == '#') { - if (strnEQ(t,"#!/bin/awk",10) || strnEQ(t,"#! /bin/awk",11)) - return; - if (strnEQ(t,"#!/usr/bin/awk",14) || strnEQ(t,"#! /usr/bin/awk",15)) - return; - } - fputs(tokenbuf,stdout); -} - -int -numary(int arg) -{ - STR *key; - int dummy; - - key = walk(0,0,arg,&dummy,P_MIN); - str_cat(key,"[]"); - hstore(symtab,key->str_ptr,str_make("1")); - str_free(key); - set_array_base = TRUE; - return arg; -} - -int -rememberargs(int arg) -{ - int type; - STR *str; - - if (!arg) - return arg; - type = ops[arg].ival & 255; - if (type == OCOMMA) { - rememberargs(ops[arg+1].ival); - rememberargs(ops[arg+3].ival); - } - else if (type == OVAR) { - str = str_new(0); - hstore(curarghash,ops[ops[arg+1].ival+1].cval,str); - } - else - fatal("panic: unknown argument type %d, line %d\n",type,line); - return arg; -} - -int -aryrefarg(int arg) -{ - int type = ops[arg].ival & 255; - STR *str; - - if (type != OSTRING) - fatal("panic: aryrefarg %d, line %d\n",type,line); - str = hfetch(curarghash,ops[arg+1].cval); - if (str) - str_set(str,"*"); - return arg; -} - -int -fixfargs(int name, int arg, int prevargs) -{ - int type; - STR *str; - int numargs; - - if (!arg) - return prevargs; - type = ops[arg].ival & 255; - if (type == OCOMMA) { - numargs = fixfargs(name,ops[arg+1].ival,prevargs); - numargs = fixfargs(name,ops[arg+3].ival,numargs); - } - else if (type == OVAR) { - str = hfetch(curarghash,ops[ops[arg+1].ival+1].cval); - if (strEQ(str_get(str),"*")) { - char tmpbuf[128]; - - str_set(str,""); /* in case another routine has this */ - ops[arg].ival &= ~255; - ops[arg].ival |= OSTAR; - sprintf(tmpbuf,"%s:%d",ops[name+1].cval,prevargs); - fprintf(stderr,"Adding %s\n",tmpbuf); - str = str_new(0); - str_set(str,"*"); - hstore(curarghash,tmpbuf,str); - } - numargs = prevargs + 1; - } - else - fatal("panic: unknown argument type %d, arg %d, line %d\n", - type,prevargs+1,line); - return numargs; -} - -int -fixrargs(char *name, int arg, int prevargs) -{ - int type; - STR *str; - int numargs; - - if (!arg) - return prevargs; - type = ops[arg].ival & 255; - if (type == OCOMMA) { - numargs = fixrargs(name,ops[arg+1].ival,prevargs); - numargs = fixrargs(name,ops[arg+3].ival,numargs); - } - else { - char *tmpbuf = (char *) safemalloc(strlen(name) + (sizeof(prevargs) * 3) + 5); - sprintf(tmpbuf,"%s:%d",name,prevargs); - str = hfetch(curarghash,tmpbuf); - safefree(tmpbuf); - if (str && strEQ(str->str_ptr,"*")) { - if (type == OVAR || type == OSTAR) { - ops[arg].ival &= ~255; - ops[arg].ival |= OSTAR; - } - else - fatal("Can't pass expression by reference as arg %d of %s\n", - prevargs+1, name); - } - numargs = prevargs + 1; - } - return numargs; -} diff --git a/contrib/perl5/x2p/cflags.SH b/contrib/perl5/x2p/cflags.SH deleted file mode 100755 index dcd97a1..0000000 --- a/contrib/perl5/x2p/cflags.SH +++ /dev/null @@ -1,95 +0,0 @@ -case $CONFIGDOTSH in -'') - if test -f config.sh; then TOP=.; - elif test -f ../config.sh; then TOP=..; - elif test -f ../../config.sh; then TOP=../..; - elif test -f ../../../config.sh; then TOP=../../..; - elif test -f ../../../../config.sh; then TOP=../../../..; - else - echo "Can't find config.sh."; exit 1 - fi - . $TOP/config.sh - ;; -esac -: This forces SH files to create target in same directory as SH file. -: This is so that make depend always knows where to find SH derivatives. -case "$0" in -*/cflags.SH) cd `expr X$0 : 'X\(.*\)/'` ;; -cflags.SH) ;; -*) case `pwd` in - */x2p) ;; - *) if test -d x2p; then cd x2p - else echo "Can't figure out where to write output."; exit 1 - fi;; - esac;; -esac -echo "Extracting x2p/cflags (with variable substitutions)" -: This section of the file will have variable substitutions done on it. -: Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!. -: Protect any dollar signs and backticks that you do not want interpreted -: by putting a backslash in front. You may delete these comments. -rm -f cflags -$spitshell >cflags <<!GROK!THIS! -!GROK!THIS! - -: In the following dollars and backticks do not need the extra backslash. -$spitshell >>cflags <<'!NO!SUBS!' -case $CONFIG in -'') - if test -f config.sh; then TOP=.; - elif test -f ../config.sh; then TOP=..; - elif test -f ../../config.sh; then TOP=../..; - elif test -f ../../../config.sh; then TOP=../../..; - elif test -f ../../../../config.sh; then TOP=../../../..; - else - echo "Can't find config.sh."; exit 1 - fi - . $TOP/config.sh - ;; -esac - -also=': ' -case $# in -1) also='echo 1>&2 " CCCMD = "' -esac - -case $# in -0) set *.c; echo "The current C flags are:" ;; -esac - -set `echo "$* " | sed -e 's/\.[oc] / /g' -e 's/\.obj / /g' -e "s/\\$obj_ext / /g"` - -for file do - - case "$#" in - 1) ;; - *) echo $n " $file.c $c" ;; - esac - - : allow variables like str_cflags to be evaluated - - eval 'eval ${'"${file}_cflags"'-""}' - - : or customize here - - case "$file" in - a2p) ;; - a2py) ;; - hash) ;; - str) ;; - util) ;; - walk) ;; - *) ;; - esac - - ccflags="`echo $ccflags | sed -e 's/-DMULTIPLICITY//'`" - - echo "$cc -c $ccflags $optimize" - eval "$also "'"$cc -c $ccflags $optimize"' - - . $TOP/config.sh - -done -!NO!SUBS! -chmod 755 cflags -$eunicefix cflags diff --git a/contrib/perl5/x2p/find2perl.PL b/contrib/perl5/x2p/find2perl.PL deleted file mode 100644 index adcf42a..0000000 --- a/contrib/perl5/x2p/find2perl.PL +++ /dev/null @@ -1,885 +0,0 @@ -#!/usr/local/bin/perl - -use Config; -use File::Basename qw(&basename &dirname); -use Cwd; - -# List explicitly here the variables you want Configure to -# generate. Metaconfig only looks for shell variables, so you -# have to mention them as if they were shell variables, not -# %Config entries. Thus you write -# $startperl -# to ensure Configure will look for $Config{startperl}. - -# This forces PL files to create target in same directory as PL file. -# This is so that make depend always knows where to find PL derivatives. -$origdir = cwd; -chdir dirname($0); -$file = basename($0, '.PL'); -$file .= '.com' if $^O eq 'VMS'; - -open OUT,">$file" or die "Can't create $file: $!"; - -print "Extracting $file (with variable substitutions)\n"; - -# In this section, perl variables will be expanded during extraction. -# You can use $Config{...} to use Configure variables. - -print OUT <<"!GROK!THIS!"; -$Config{startperl} - eval 'exec $Config{perlpath} -S \$0 \${1+"\$@"}' - if \$running_under_some_shell; -(my \$perlpath = <<'/../') =~ s/\\s*\\z//; -$Config{perlpath} -/../ -!GROK!THIS! - -# In the following, perl variables are not expanded during extraction. - -print OUT <<'!NO!SUBS!'; -use strict; -use vars qw/$statdone/; -use File::Spec::Functions 'curdir'; -my $startperl = "#! $perlpath -w"; - -# -# Modified September 26, 1993 to provide proper handling of years after 1999 -# Tom Link <tml+@pitt.edu> -# University of Pittsburgh -# -# Modified April 7, 1998 with nasty hacks to implement the troublesome -follow -# Billy Constantine <wdconsta@cs.adelaide.edu.au> <billy@smug.adelaide.edu.au> -# University of Adelaide, Adelaide, South Australia -# -# Modified 1999-06-10, 1999-07-07 to migrate to cleaner perl5 usage -# Ken Pizzini <ken@halcyon.com> -# -# Modified 2000-01-28 to use the 'follow' option of File::Find - -my @roots = (); -while ($ARGV[0] =~ /^[^-!(]/) { - push(@roots, shift); -} -@roots = (curdir()) unless @roots; -for (@roots) { $_ = "e($_) } -my $roots = join(', ', @roots); - -my $find = "find"; -my $indent_depth = 1; -my $stat = 'lstat'; -my $decl = ''; -my $flushall = ''; -my $initfile = ''; -my $initnewer = ''; -my $out = ''; -my %init = (); -my ($follow_in_effect,$Skip_And) = (0,0); - -while (@ARGV) { - $_ = shift; - s/^-// || /^[()!]/ || die "Unrecognized switch: $_\n"; - if ($_ eq '(') { - $out .= &tab . "(\n"; - $indent_depth++; - next; - } elsif ($_ eq ')') { - --$indent_depth; - $out .= &tab . ")"; - } elsif ($_ eq 'follow') { - $follow_in_effect= 1; - $stat = 'stat'; - $Skip_And= 1; - } elsif ($_ eq '!') { - $out .= &tab . "!"; - next; - } elsif ($_ eq 'name') { - $out .= &tab . '/' . &fileglob_to_re(shift) . "/s"; - } elsif ($_ eq 'perm') { - my $onum = shift; - $onum =~ /^-?[0-7]+$/ - || die "Malformed -perm argument: $onum\n"; - $out .= &tab; - if ($onum =~ s/^-//) { - $onum = sprintf("0%o", oct($onum) & 07777); - $out .= "((\$mode & $onum) == $onum)"; - } else { - $onum =~ s/^0*/0/; - $out .= "((\$mode & 0777) == $onum)"; - } - } elsif ($_ eq 'type') { - (my $filetest = shift) =~ tr/s/S/; - $out .= &tab . "-$filetest _"; - } elsif ($_ eq 'print') { - $out .= &tab . 'print("$name\n")'; - } elsif ($_ eq 'print0') { - $out .= &tab . 'print("$name\0")'; - } elsif ($_ eq 'fstype') { - my $type = shift; - $out .= &tab; - if ($type eq 'nfs') { - $out .= '($dev < 0)'; - } else { - $out .= '($dev >= 0)'; #XXX - } - } elsif ($_ eq 'user') { - my $uname = shift; - $out .= &tab . "(\$uid == \$uid{'$uname'})"; - $init{user} = 1; - } elsif ($_ eq 'group') { - my $gname = shift; - $out .= &tab . "(\$gid == \$gid{'$gname'})"; - $init{group} = 1; - } elsif ($_ eq 'nouser') { - $out .= &tab . '!exists $uid{$uid}'; - $init{user} = 1; - } elsif ($_ eq 'nogroup') { - $out .= &tab . '!exists $gid{$gid}'; - $init{group} = 1; - } elsif ($_ eq 'links') { - $out .= &tab . &n('$nlink', shift); - } elsif ($_ eq 'inum') { - $out .= &tab . &n('$ino', shift); - } elsif ($_ eq 'size') { - $_ = shift; - my $n = 'int(((-s _) + 511) / 512)'; - if (s/c\z//) { - $n = 'int(-s _)'; - } elsif (s/k\z//) { - $n = 'int(((-s _) + 1023) / 1024)'; - } - $out .= &tab . &n($n, $_); - } elsif ($_ eq 'atime') { - $out .= &tab . &n('int(-A _)', shift); - } elsif ($_ eq 'mtime') { - $out .= &tab . &n('int(-M _)', shift); - } elsif ($_ eq 'ctime') { - $out .= &tab . &n('int(-C _)', shift); - } elsif ($_ eq 'exec') { - my @cmd = (); - while (@ARGV && $ARGV[0] ne ';') - { push(@cmd, shift) } - shift; - $out .= &tab; - if ($cmd[0] =~m#^(?:(?:/usr)?/bin/)?rm$# - && $cmd[$#cmd] eq '{}' - && (@cmd == 2 || (@cmd == 3 && $cmd[1] eq '-f'))) { - if (@cmd == 2) { - $out .= '(unlink($_) || warn "$name: $!\n")'; - } elsif (!@ARGV) { - $out .= 'unlink($_)'; - } else { - $out .= '(unlink($_) || 1)'; - } - } else { - for (@cmd) - { s/'/\\'/g } - { local $" = "','"; $out .= "&doexec(0, '@cmd')"; } - $init{doexec} = 1; - } - } elsif ($_ eq 'ok') { - my @cmd = (); - while (@ARGV && $ARGV[0] ne ';') - { push(@cmd, shift) } - shift; - $out .= &tab; - for (@cmd) - { s/'/\\'/g } - { local $" = "','"; $out .= "&doexec(0, '@cmd')"; } - $init{doexec} = 1; - } elsif ($_ eq 'prune') { - $out .= &tab . '($File::Find::prune = 1)'; - } elsif ($_ eq 'xdev') { - $out .= &tab . '!($File::Find::prune |= ($dev != $File::Find::topdev))' -; - } elsif ($_ eq 'newer') { - my $file = shift; - my $newername = 'AGE_OF' . $file; - $newername =~ s/\W/_/g; - $newername = '$' . $newername; - $out .= &tab . "(-M _ < $newername)"; - $initnewer .= "my $newername = -M " . "e($file) . ";\n"; - } elsif ($_ eq 'eval') { - my $prog = shift; - $prog =~ s/'/\\'/g; - $out .= &tab . "eval {$prog}"; - } elsif ($_ eq 'depth') { - $find = 'finddepth'; - next; - } elsif ($_ eq 'ls') { - $out .= &tab . "&ls"; - $init{ls} = 1; - } elsif ($_ eq 'tar') { - die "-tar must have a filename argument\n" unless @ARGV; - my $file = shift; - my $fh = 'FH' . $file; - $fh =~ s/\W/_/g; - $out .= &tab . "&tar(*$fh, \$name)"; - $flushall .= "&tflushall;\n"; - $initfile .= "open($fh, " . "e('> ' . $file) . - qq{) || die "Can't open $fh: \$!\\n";\n}; - $init{tar} = 1; - } elsif (/^(n?)cpio\z/) { - die "-$_ must have a filename argument\n" unless @ARGV; - my $file = shift; - my $fh = 'FH' . $file; - $fh =~ s/\W/_/g; - $out .= &tab . "&cpio(*$fh, \$name, '$1')"; - $find = 'finddepth'; - $flushall .= "&cflushall;\n"; - $initfile .= "open($fh, " . "e('> ' . $file) . - qq{) || die "Can't open $fh: \$!\\n";\n}; - $init{cpio} = 1; - } else { - die "Unrecognized switch: -$_\n"; - } - - if (@ARGV) { - if ($ARGV[0] eq '-o') { - { local($statdone) = 1; $out .= "\n" . &tab . "||\n"; } - $statdone = 0 if $indent_depth == 1 && exists $init{delayedstat}; - $init{saw_or} = 1; - shift; - } else { - $out .= " &&" unless $Skip_And || $ARGV[0] eq ')'; - $out .= "\n"; - shift if $ARGV[0] eq '-a'; - } - } -} - - -print <<"END"; -$startperl - eval 'exec $perlpath -S \$0 \${1+"\$@"}' - if 0; #\$running_under_some_shell - -use strict; -use File::Find (); - -# Set the variable \$File::Find::dont_use_nlink if you're using AFS, -# since AFS cheats. - -# for the convenience of &wanted calls, including -eval statements: -use vars qw/*name *dir *prune/; -*name = *File::Find::name; -*dir = *File::Find::dir; -*prune = *File::Find::prune; - -END - - -if (exists $init{ls}) { - print <<'END'; -my @rwx = qw(--- --x -w- -wx r-- r-x rw- rwx); -my @moname = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec); - -END -} - -if (exists $init{user} || exists $init{ls} || exists $init{tar}) { - print "my (%uid, %user);\n"; - print "while (my (\$name, \$pw, \$uid) = getpwent) {\n"; - print ' $uid{$name} = $uid{$uid} = $uid;', "\n" - if exists $init{user}; - print ' $user{$uid} = $name unless exists $user{$uid};', "\n" - if exists $init{ls} || exists $init{tar}; - print "}\n\n"; -} - -if (exists $init{group} || exists $init{ls} || exists $init{tar}) { - print "my (%gid, %group);\n"; - print "while (my (\$name, \$pw, \$gid) = getgrent) {\n"; - print ' $gid{$name} = $gid{$gid} = $gid;', "\n" - if exists $init{group}; - print ' $group{$gid} = $name unless exists $group{$gid};', "\n" - if exists $init{ls} || exists $init{tar}; - print "}\n\n"; -} - -print $initnewer, "\n" if $initnewer ne ''; -print $initfile, "\n" if $initfile ne ''; -$flushall .= "exit;\n"; -if (exists $init{declarestat}) { - $out = <<'END' . $out; - my ($dev,$ino,$mode,$nlink,$uid,$gid); - -END -} - -if ( $follow_in_effect ) { -$out =~ s/lstat\(\$_\)/lstat(_)/; -print <<"END"; -$decl -# Traverse desired filesystems -File::Find::$find( {wanted => \\&wanted, follow => 1}, $roots); -$flushall - -sub wanted { -$out; -} - -END -} else { -print <<"END"; -$decl -# Traverse desired filesystems -File::Find::$find({wanted => \\&wanted}, $roots); -$flushall - -sub wanted { -$out; -} - -END -} - -if (exists $init{doexec}) { - print <<'END'; - -use Cwd (); -my $cwd = Cwd::cwd(); - -sub doexec { - my $ok = shift; - for my $word (@_) - { $word =~ s#{}#$name#g } - if ($ok) { - my $old = select(STDOUT); - $| = 1; - print "@_"; - select($old); - return 0 unless <STDIN> =~ /^y/; - } - chdir $cwd; #sigh - system @_; - chdir $File::Find::dir; - return !$?; -} - -END -} - -if (exists $init{ls}) { - print <<'INTRO', <<"SUB", <<'END'; - -sub sizemm { - my $rdev = shift; - sprintf("%3d, %3d", ($rdev >> 8) & 0xff, $rdev & 0xff); -} - -sub ls { - my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, -INTRO - \$atime,\$mtime,\$ctime,\$blksize,\$blocks) = $stat(_); -SUB - my $pname = $name; - - $blocks - or $blocks = int(($size + 1023) / 1024); - - my $perms = $rwx[$mode & 7]; - $mode >>= 3; - $perms = $rwx[$mode & 7] . $perms; - $mode >>= 3; - $perms = $rwx[$mode & 7] . $perms; - substr($perms, 2, 1) =~ tr/-x/Ss/ if -u _; - substr($perms, 5, 1) =~ tr/-x/Ss/ if -g _; - substr($perms, 8, 1) =~ tr/-x/Tt/ if -k _; - if (-f _) { $perms = '-' . $perms; } - elsif (-d _) { $perms = 'd' . $perms; } - elsif (-l _) { $perms = 'l' . $perms; $pname .= ' -> ' . readlink($_); } - elsif (-c _) { $perms = 'c' . $perms; $size = sizemm($rdev); } - elsif (-b _) { $perms = 'b' . $perms; $size = sizemm($rdev); } - elsif (-p _) { $perms = 'p' . $perms; } - elsif (-S _) { $perms = 's' . $perms; } - else { $perms = '?' . $perms; } - - my $user = $user{$uid} || $uid; - my $group = $group{$gid} || $gid; - - my ($sec,$min,$hour,$mday,$mon,$timeyear) = localtime($mtime); - if (-M _ > 365.25 / 2) { - $timeyear += 1900; - } else { - $timeyear = sprintf("%02d:%02d", $hour, $min); - } - - printf "%5lu %4ld %-10s %3d %-8s %-8s %8s %s %2d %5s %s\n", - $ino, - $blocks, - $perms, - $nlink, - $user, - $group, - $size, - $moname[$mon], - $mday, - $timeyear, - $pname; - 1; -} - -END -} - - -if (exists $init{cpio} || exists $init{tar}) { -print <<'END'; - -my %blocks = (); - -sub flush { - my ($fh, $varref, $blksz) = @_; - - while (length($$varref) >= $blksz) { - no strict qw/refs/; - syswrite($fh, $$varref, $blksz); - substr($$varref, 0, $blksz) = ''; - ++$blocks{$fh}; - } -} - -END -} - - -if (exists $init{cpio}) { - print <<'INTRO', <<"SUB", <<'END'; - -my %cpout = (); -my %nc = (); - -sub cpio { - my ($fh, $fname, $nc) = @_; - my $text = ''; - my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, - $atime,$mtime,$ctime,$blksize,$blocks); - local (*IN); - - if ( ! defined $fname ) { - $fname = 'TRAILER!!!'; - ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, - $atime,$mtime,$ctime,$blksize,$blocks) = (0) x 13; - } else { - ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, -INTRO - \$atime,\$mtime,\$ctime,\$blksize,\$blocks) = $stat(_); -SUB - if (-f _) { - open(IN, "./$_\0") || do { - warn "Couldn't open $fname: $!\n"; - return; - } - } else { - $text = readlink($_); - $size = 0 unless defined $text; - } - } - - $fname =~ s#^\./##; - $nc{$fh} = $nc; - if ($nc eq 'n') { - $cpout{$fh} .= - sprintf("%06o%06o%06o%06o%06o%06o%06o%06o%011lo%06o%011lo%s\0", - 070707, - $dev & 0777777, - $ino & 0777777, - $mode & 0777777, - $uid & 0777777, - $gid & 0777777, - $nlink & 0777777, - $rdev & 0177777, - $mtime, - length($fname)+1, - $size, - $fname); - } else { - $cpout{$fh} .= "\0" if length($cpout{$fh}) & 1; - $cpout{$fh} .= pack("SSSSSSSSLSLa*", - 070707, $dev, $ino, $mode, $uid, $gid, $nlink, $rdev, $mtime, - length($fname)+1, $size, - $fname . (length($fname) & 1 ? "\0" : "\0\0")); - } - - if ($text ne '') { - $cpout{$fh} .= $text; - } elsif ($size) { - my $l; - flush($fh, \$cpout{$fh}, 5120) - while ($l = length($cpout{$fh})) >= 5120; - while (sysread(IN, $cpout{$fh}, 5120 - $l, $l)) { - flush($fh, \$cpout{$fh}, 5120); - $l = length($cpout{$fh}); - } - close IN; - } -} - -sub cflushall { - for my $fh (keys %cpout) { - &cpio($fh, undef, $nc{$fh}); - $cpout{$fh} .= "0" x (5120 - length($cpout{$fh})); - flush($fh, \$cpout{$fh}, 5120); - print $blocks{$fh} * 10, " blocks\n"; - } -} - -END -} - -if (exists $init{tar}) { - print <<'INTRO', <<"SUB", <<'END'; - -my %tarout = (); -my %linkseen = (); - -sub tar { - my ($fh, $fname) = @_; - my $prefix = ''; - my $typeflag = '0'; - my $linkname; - my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, -INTRO - \$atime,\$mtime,\$ctime,\$blksize,\$blocks) = $stat(_); -SUB - local (*IN); - - if ($nlink > 1) { - if ($linkname = $linkseen{$fh, $dev, $ino}) { - if (length($linkname) > 100) { - warn "$0: omitting file with linkname ", - "too long for tar output: $linkname\n"; - return; - } - $typeflag = '1'; - $size = 0; - } else { - $linkseen{$fh, $dev, $ino} = $fname; - } - } - if ($typeflag eq '0') { - if (-f _) { - open(IN, "./$_\0") || do { - warn "Couldn't open $fname: $!\n"; - return; - } - } else { - $linkname = readlink($_); - if (defined $linkname) { $typeflag = '2' } - elsif (-c _) { $typeflag = '3' } - elsif (-b _) { $typeflag = '4' } - elsif (-d _) { $typeflag = '5' } - elsif (-p _) { $typeflag = '6' } - } - } - - if (length($fname) > 100) { - ($prefix, $fname) = ($fname =~ m#\A(.*?)/(.{,100})\Z(?!\n)#); - if (!defined($fname) || length($prefix) > 155) { - warn "$0: omitting file with name too long for tar output: ", - $fname, "\n"; - return; - } - } - - $size = 0 if $typeflag ne '0'; - my $header = pack("a100a8a8a8a12a12a8a1a100a6a2a32a32a8a8a155", - $fname, - sprintf("%7o ", $mode & 0777), - sprintf("%7o ", $uid & 0777777), - sprintf("%7o ", $gid & 0777777), - sprintf("%11o ", $size), - sprintf("%11o ", $mtime), - ' 'x8, - $typeflag, - defined $linkname ? $linkname : '', - "ustar\0", - "00", - $user{$uid}, - $group{$gid}, - ($rdev >> 8) & 0xff, - $rdev & 0xff, - $prefix, - ); - substr($header, 148, 8) = sprintf("%7o ", unpack("%16C*", $header)); - my $l = length($header) % 512; - $tarout{$fh} .= $header; - $tarout{$fh} .= "\0" x (512 - $l) if $l; - - if ($size) { - flush($fh, \$tarout{$fh}, 10240) - while ($l = length($tarout{$fh})) >= 10240; - while (sysread(IN, $tarout{$fh}, 10240 - $l, $l)) { - my $slop = length($tarout{$fh}) % 512; - $tarout{$fh} .= "\0" x (512 - $slop) if $slop; - flush($fh, \$tarout{$fh}, 10240); - $l = length($tarout{$fh}); - } - close IN; - } -} - -sub tflushall { - my $len; - for my $fh (keys %tarout) { - $len = 10240 - length($tarout{$fh}); - $len += 10240 if $len < 1024; - $tarout{$fh} .= "\0" x $len; - flush($fh, \$tarout{$fh}, 10240); - } -} - -END -} - -exit; - -############################################################################ - -sub tab { - my $tabstring; - - $tabstring = "\t" x ($indent_depth/2) . ' ' x ($indent_depth%2 * 4); - if (!$statdone) { - if ($_ =~ /^(?:name|print|prune|exec|ok|\(|\))/) { - $init{delayedstat} = 1; - } else { - my $statcall = '(($dev,$ino,$mode,$nlink,$uid,$gid) = ' - . $stat . '($_))'; - if (exists $init{saw_or}) { - $tabstring .= "(\$nlink || $statcall) &&\n" . $tabstring; - } else { - $tabstring .= "$statcall &&\n" . $tabstring; - } - $statdone = 1; - $init{declarestat} = 1; - } - } - $tabstring =~ s/^\s+/ / if $out =~ /!$/; - $tabstring; -} - -sub fileglob_to_re { - my $x = shift; - $x =~ s#([./^\$()])#\\$1#g; - $x =~ s#([?*])#.$1#g; - "^$x\\z"; -} - -sub n { - my ($pre, $n) = @_; - $n =~ s/^-/< / || $n =~ s/^\+/> / || $n =~ s/^/== /; - $n =~ s/ 0*(\d)/ $1/; - "($pre $n)"; -} - -sub quote { - my $string = shift; - $string =~ s/\\/\\\\/g; - $string =~ s/'/\\'/g; - "'$string'"; -} - -__END__ - -=head1 NAME - -find2perl - translate find command lines to Perl code - -=head1 SYNOPSIS - - find2perl [paths] [predicates] | perl - -=head1 DESCRIPTION - -find2perl is a little translator to convert find command lines to -equivalent Perl code. The resulting code is typically faster than -running find itself. - -"paths" are a set of paths where find2perl will start its searches and -"predicates" are taken from the following list. - -=over 4 - -=item C<! PREDICATE> - -Negate the sense of the following predicate. The C<!> must be passed as -a distinct argument, so it may need to be surrounded by whitespace and/or -quoted from interpretation by the shell using a backslash (just as with -using C<find(1)>). - -=item C<( PREDICATES )> - -Group the given PREDICATES. The parentheses must be passed as distinct -arguments, so they may need to be surrounded by whitespace and/or -quoted from interpretation by the shell using a backslash (just as with -using C<find(1)>). - -=item C<PREDICATE1 PREDICATE2> - -True if _both_ PREDICATE1 and PREDICATE2 are true; PREDICATE2 is not -evaluated if PREDICATE1 is false. - -=item C<PREDICATE1 -o PREDICATE2> - -True if either one of PREDICATE1 or PREDICATE2 is true; PREDICATE2 is -not evaluated if PREDICATE1 is true. - -=item C<-follow> - -Follow (dereference) symlinks. The checking of file attributes depends -on the position of the C<-follow> option. If it precedes the file -check option, an C<stat> is done which means the file check applies to the -file the symbolic link is pointing to. If C<-follow> option follows the -file check option, this now applies to the symbolic link itself, i.e. -an C<lstat> is done. - -=item C<-depth> - -Change directory traversal algorithm from breadth-first to depth-first. - -=item C<-prune> - -Do not descend into the directory currently matched. - -=item C<-xdev> - -Do not traverse mount points (prunes search at mount-point directories). - -=item C<-name GLOB> - -File name matches specified GLOB wildcard pattern. GLOB may need to be -quoted to avoid interpretation by the shell (just as with using -C<find(1)>). - -=item C<-perm PERM> - -Low-order 9 bits of permission match octal value PERM. - -=item C<-perm -PERM> - -The bits specified in PERM are all set in file's permissions. - -=item C<-type X> - -The file's type matches perl's C<-X> operator. - -=item C<-fstype TYPE> - -Filesystem of current path is of type TYPE (only NFS/non-NFS distinction -is implemented). - -=item C<-user USER> - -True if USER is owner of file. - -=item C<-group GROUP> - -True if file's group is GROUP. - -=item C<-nouser> - -True if file's owner is not in password database. - -=item C<-nogroup> - -True if file's group is not in group database. - -=item C<-inum INUM> - -True file's inode number is INUM. - -=item C<-links N> - -True if (hard) link count of file matches N (see below). - -=item C<-size N> - -True if file's size matches N (see below) N is normally counted in -512-byte blocks, but a suffix of "c" specifies that size should be -counted in characters (bytes) and a suffix of "k" specifes that -size should be counted in 1024-byte blocks. - -=item C<-atime N> - -True if last-access time of file matches N (measured in days) (see -below). - -=item C<-ctime N> - -True if last-changed time of file's inode matches N (measured in days, -see below). - -=item C<-mtime N> - -True if last-modified time of file matches N (measured in days, see below). - -=item C<-newer FILE> - -True if last-modified time of file matches N. - -=item C<-print> - -Print out path of file (always true). - -=item C<-print0> - -Like -print, but terminates with \0 instead of \n. - -=item C<-exec OPTIONS ;> - -exec() the arguments in OPTIONS in a subprocess; any occurence of {} in -OPTIONS will first be substituted with the path of the current -file. Note that the command "rm" has been special-cased to use perl's -unlink() function instead (as an optimization). The C<;> must be passed as -a distinct argument, so it may need to be surrounded by whitespace and/or -quoted from interpretation by the shell using a backslash (just as with -using C<find(1)>). - -=item C<-ok OPTIONS ;> - -Like -exec, but first prompts user; if user's response does not begin -with a y, skip the exec. The C<;> must be passed as -a distinct argument, so it may need to be surrounded by whitespace and/or -quoted from interpretation by the shell using a backslash (just as with -using C<find(1)>). - -=item C<-eval EXPR> - -Has the perl script eval() the EXPR. - -=item C<-ls> - -Simulates C<-exec ls -dils {} ;> - -=item C<-tar FILE> - -Adds current output to tar-format FILE. - -=item C<-cpio FILE> - -Adds current output to old-style cpio-format FILE. - -=item C<-ncpio FILE> - -Adds current output to "new"-style cpio-format FILE. - -=back - -Predicates which take a numeric argument N can come in three forms: - - * N is prefixed with a +: match values greater than N - * N is prefixed with a -: match values less than N - * N is not prefixed with either + or -: match only values equal to N - -=head1 SEE ALSO - -find - -=cut -!NO!SUBS! - -close OUT or die "Can't close $file: $!"; -chmod 0755, $file or die "Can't reset permissions for $file: $!\n"; -exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':'; -chdir $origdir; diff --git a/contrib/perl5/x2p/hash.c b/contrib/perl5/x2p/hash.c deleted file mode 100644 index a266403..0000000 --- a/contrib/perl5/x2p/hash.c +++ /dev/null @@ -1,229 +0,0 @@ -/* $RCSfile: hash.c,v $$Revision: 4.1 $$Date: 92/08/07 18:29:20 $ - * - * Copyright (c) 1991-2001, Larry Wall - * - * You may distribute under the terms of either the GNU General Public - * License or the Artistic License, as specified in the README file. - * - * $Log: hash.c,v $ - */ - -#include <stdio.h> -#include "EXTERN.h" -#include "a2p.h" -#include "util.h" - -STR * -hfetch(register HASH *tb, char *key) -{ - register char *s; - register int i; - register int hash; - register HENT *entry; - - if (!tb) - return Nullstr; - for (s=key, i=0, hash = 0; - /* while */ *s; - s++, i++, hash *= 5) { - hash += *s * coeff[i]; - } - entry = tb->tbl_array[hash & tb->tbl_max]; - for (; entry; entry = entry->hent_next) { - if (entry->hent_hash != hash) /* strings can't be equal */ - continue; - if (strNE(entry->hent_key,key)) /* is this it? */ - continue; - return entry->hent_val; - } - return Nullstr; -} - -bool -hstore(register HASH *tb, char *key, STR *val) -{ - register char *s; - register int i; - register int hash; - register HENT *entry; - register HENT **oentry; - - if (!tb) - return FALSE; - for (s=key, i=0, hash = 0; - /* while */ *s; - s++, i++, hash *= 5) { - hash += *s * coeff[i]; - } - - oentry = &(tb->tbl_array[hash & tb->tbl_max]); - i = 1; - - for (entry = *oentry; entry; i=0, entry = entry->hent_next) { - if (entry->hent_hash != hash) /* strings can't be equal */ - continue; - if (strNE(entry->hent_key,key)) /* is this it? */ - continue; - /*NOSTRICT*/ - safefree(entry->hent_val); - entry->hent_val = val; - return TRUE; - } - /*NOSTRICT*/ - entry = (HENT*) safemalloc(sizeof(HENT)); - - entry->hent_key = savestr(key); - entry->hent_val = val; - entry->hent_hash = hash; - entry->hent_next = *oentry; - *oentry = entry; - - if (i) { /* initial entry? */ - tb->tbl_fill++; - if ((tb->tbl_fill * 100 / (tb->tbl_max + 1)) > FILLPCT) - hsplit(tb); - } - - return FALSE; -} - -#ifdef NOTUSED -bool -hdelete(register HASH *tb, char *key) -{ - register char *s; - register int i; - register int hash; - register HENT *entry; - register HENT **oentry; - - if (!tb) - return FALSE; - for (s=key, i=0, hash = 0; - /* while */ *s; - s++, i++, hash *= 5) { - hash += *s * coeff[i]; - } - - oentry = &(tb->tbl_array[hash & tb->tbl_max]); - entry = *oentry; - i = 1; - for (; entry; i=0, oentry = &entry->hent_next, entry = entry->hent_next) { - if (entry->hent_hash != hash) /* strings can't be equal */ - continue; - if (strNE(entry->hent_key,key)) /* is this it? */ - continue; - safefree((char*)entry->hent_val); - safefree(entry->hent_key); - *oentry = entry->hent_next; - safefree((char*)entry); - if (i) - tb->tbl_fill--; - return TRUE; - } - return FALSE; -} -#endif - -void -hsplit(HASH *tb) -{ - int oldsize = tb->tbl_max + 1; - register int newsize = oldsize * 2; - register int i; - register HENT **a; - register HENT **b; - register HENT *entry; - register HENT **oentry; - - a = (HENT**) saferealloc((char*)tb->tbl_array, newsize * sizeof(HENT*)); - bzero((char*)&a[oldsize], oldsize * sizeof(HENT*)); /* zero second half */ - tb->tbl_max = --newsize; - tb->tbl_array = a; - - for (i=0; i<oldsize; i++,a++) { - if (!*a) /* non-existent */ - continue; - b = a+oldsize; - for (oentry = a, entry = *a; entry; entry = *oentry) { - if ((entry->hent_hash & newsize) != i) { - *oentry = entry->hent_next; - entry->hent_next = *b; - if (!*b) - tb->tbl_fill++; - *b = entry; - continue; - } - else - oentry = &entry->hent_next; - } - if (!*a) /* everything moved */ - tb->tbl_fill--; - } -} - -HASH * -hnew(void) -{ - register HASH *tb = (HASH*)safemalloc(sizeof(HASH)); - - tb->tbl_array = (HENT**) safemalloc(8 * sizeof(HENT*)); - tb->tbl_fill = 0; - tb->tbl_max = 7; - hiterinit(tb); /* so each() will start off right */ - bzero((char*)tb->tbl_array, 8 * sizeof(HENT*)); - return tb; -} - -#ifdef NOTUSED -hshow(register HASH *tb) -{ - fprintf(stderr,"%5d %4d (%2d%%)\n", - tb->tbl_max+1, - tb->tbl_fill, - tb->tbl_fill * 100 / (tb->tbl_max+1)); -} -#endif - -int -hiterinit(register HASH *tb) -{ - tb->tbl_riter = -1; - tb->tbl_eiter = Null(HENT*); - return tb->tbl_fill; -} - -HENT * -hiternext(register HASH *tb) -{ - register HENT *entry; - - entry = tb->tbl_eiter; - do { - if (entry) - entry = entry->hent_next; - if (!entry) { - tb->tbl_riter++; - if (tb->tbl_riter > tb->tbl_max) { - tb->tbl_riter = -1; - break; - } - entry = tb->tbl_array[tb->tbl_riter]; - } - } while (!entry); - - tb->tbl_eiter = entry; - return entry; -} - -char * -hiterkey(register HENT *entry) -{ - return entry->hent_key; -} - -STR * -hiterval(register HENT *entry) -{ - return entry->hent_val; -} diff --git a/contrib/perl5/x2p/hash.h b/contrib/perl5/x2p/hash.h deleted file mode 100644 index 7b2b668..0000000 --- a/contrib/perl5/x2p/hash.h +++ /dev/null @@ -1,52 +0,0 @@ -/* $RCSfile: hash.h,v $$Revision: 4.1 $$Date: 92/08/07 18:29:21 $ - * - * Copyright (c) 1991-2001, Larry Wall - * - * You may distribute under the terms of either the GNU General Public - * License or the Artistic License, as specified in the README file. - * - * $Log: hash.h,v $ - */ - -#define FILLPCT 60 /* don't make greater than 99 */ - -#ifdef DOINIT -char coeff[] = { - 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1, - 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1, - 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1, - 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1, - 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1, - 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1, - 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1, - 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1}; -#else -extern char coeff[]; -#endif - -typedef struct hentry HENT; - -struct hentry { - HENT *hent_next; - char *hent_key; - STR *hent_val; - int hent_hash; -}; - -struct htbl { - HENT **tbl_array; - int tbl_max; - int tbl_fill; - int tbl_riter; /* current root of iterator */ - HENT *tbl_eiter; /* current entry of iterator */ -}; - -bool hdelete (HASH *tb, char *key); -STR * hfetch ( HASH *tb, char *key ); -int hiterinit ( HASH *tb ); -char * hiterkey ( HENT *entry ); -HENT * hiternext ( HASH *tb ); -STR * hiterval ( HENT *entry ); -HASH * hnew ( void ); -void hsplit ( HASH *tb ); -bool hstore ( HASH *tb, char *key, STR *val ); diff --git a/contrib/perl5/x2p/proto.h b/contrib/perl5/x2p/proto.h deleted file mode 100644 index e57b4fc..0000000 --- a/contrib/perl5/x2p/proto.h +++ /dev/null @@ -1,8 +0,0 @@ -/* proto.h - * - * Copyright (c) 1991-2001, Larry Wall - * - * You may distribute under the terms of either the GNU General Public - * License or the Artistic License, as specified in the README file. - * - */ diff --git a/contrib/perl5/x2p/s2p.PL b/contrib/perl5/x2p/s2p.PL deleted file mode 100644 index 2d44dd2..0000000 --- a/contrib/perl5/x2p/s2p.PL +++ /dev/null @@ -1,858 +0,0 @@ -#!/usr/local/bin/perl - -use Config; -use File::Basename qw(&basename &dirname); -use Cwd; - -# List explicitly here the variables you want Configure to -# generate. Metaconfig only looks for shell variables, so you -# have to mention them as if they were shell variables, not -# %Config entries. Thus you write -# $startperl -# to ensure Configure will look for $Config{startperl}. - -# This forces PL files to create target in same directory as PL file. -# This is so that make depend always knows where to find PL derivatives. -$origdir = cwd; -chdir dirname($0); -$file = basename($0, '.PL'); -$file .= '.com' if $^O eq 'VMS'; - -open OUT,">$file" or die "Can't create $file: $!"; - -print "Extracting $file (with variable substitutions)\n"; - -# In this section, perl variables will be expanded during extraction. -# You can use $Config{...} to use Configure variables. - -print OUT <<"!GROK!THIS!"; -$Config{startperl} - eval 'exec $Config{perlpath} -S \$0 \${1+"\$@"}' - if \$running_under_some_shell; -(\$startperl = <<'/../') =~ s/\\s*\\z//; -$Config{startperl} -/../ -(\$perlpath = <<'/../') =~ s/\\s*\\z//; -$Config{perlpath} -/../ -!GROK!THIS! - -# In the following, perl variables are not expanded during extraction. - -print OUT <<'!NO!SUBS!'; - -# $RCSfile: s2p.SH,v $$Revision: 4.1 $$Date: 92/08/07 18:29:23 $ -# -# $Log: s2p.SH,v $ - -=head1 NAME - -s2p - Sed to Perl translator - -=head1 SYNOPSIS - -B<s2p [options] filename> - -=head1 DESCRIPTION - -I<s2p> takes a sed script specified on the command line (or from -standard input) and produces a comparable I<perl> script on the -standard output. - -=head2 Options - -Options include: - -=over 5 - -=item B<-DE<lt>numberE<gt>> - -sets debugging flags. - -=item B<-n> - -specifies that this sed script was always invoked with a B<sed -n>. -Otherwise a switch parser is prepended to the front of the script. - -=item B<-p> - -specifies that this sed script was never invoked with a B<sed -n>. -Otherwise a switch parser is prepended to the front of the script. - -=back - -=head2 Considerations - -The perl script produced looks very sed-ish, and there may very well -be better ways to express what you want to do in perl. For instance, -s2p does not make any use of the split operator, but you might want -to. - -The perl script you end up with may be either faster or slower than -the original sed script. If you're only interested in speed you'll -just have to try it both ways. Of course, if you want to do something -sed doesn't do, you have no choice. It's often possible to speed up -the perl script by various methods, such as deleting all references to -$\ and chop. - -=head1 ENVIRONMENT - -s2p uses no environment variables. - -=head1 AUTHOR - -Larry Wall E<lt>F<larry@wall.org>E<gt> - -=head1 FILES - -=head1 SEE ALSO - - perl The perl compiler/interpreter - - a2p awk to perl translator - -=head1 DIAGNOSTICS - -=head1 BUGS - -=cut - -$indent = 4; -$shiftwidth = 4; -$l = '{'; $r = '}'; - -while ($ARGV[0] =~ /^-/) { - $_ = shift; - last if /^--/; - if (/^-D/) { - $debug++; - open(BODY,'>-'); - next; - } - if (/^-n/) { - $assumen++; - next; - } - if (/^-p/) { - $assumep++; - next; - } - die "I don't recognize this switch: $_\n"; -} - -unless ($debug) { - open(BODY,"+>/tmp/sperl$$") || - &Die("Can't open temp file: $!\n"); -} - -if (!$assumen && !$assumep) { - print BODY &q(<<'EOT'); -: while ($ARGV[0] =~ /^-/) { -: $_ = shift; -: last if /^--/; -: if (/^-n/) { -: $nflag++; -: next; -: } -: die "I don't recognize this switch: $_\\n"; -: } -: -EOT -} - -print BODY &q(<<'EOT'); -: #ifdef PRINTIT -: #ifdef ASSUMEP -: $printit++; -: #else -: $printit++ unless $nflag; -: #endif -: #endif -: <><> -: $\ = "\n"; # automatically add newline on print -: <><> -: #ifdef TOPLABEL -: LINE: -: while (chop($_ = <>)) { -: #else -: LINE: -: while (<>) { -: chop; -: #endif -EOT - -LINE: -while (<>) { - - # Wipe out surrounding whitespace. - - s/[ \t]*(.*)\n$/$1/; - - # Perhaps it's a label/comment. - - if (/^:/) { - s/^:[ \t]*//; - $label = &make_label($_); - if ($. == 1) { - $toplabel = $label; - if (/^(top|(re)?start|redo|begin(ning)|again|input)$/i) { - $_ = <>; - redo LINE; # Never referenced, so delete it if not a comment. - } - } - $_ = "$label:"; - if ($lastlinewaslabel++) { - $indent += 4; - print BODY &tab, ";\n"; - $indent -= 4; - } - if ($indent >= 2) { - $indent -= 2; - $indmod = 2; - } - next; - } else { - $lastlinewaslabel = ''; - } - - # Look for one or two address clauses - - $addr1 = ''; - $addr2 = ''; - if (s/^([0-9]+)//) { - $addr1 = "$1"; - $addr1 = "\$. == $addr1" unless /^,/; - } - elsif (s/^\$//) { - $addr1 = 'eof()'; - } - elsif (s|^/||) { - $addr1 = &fetchpat('/'); - } - if (s/^,//) { - if (s/^([0-9]+)//) { - $addr2 = "$1"; - } elsif (s/^\$//) { - $addr2 = "eof()"; - } elsif (s|^/||) { - $addr2 = &fetchpat('/'); - } else { - &Die("Invalid second address at line $.\n"); - } - if ($addr2 =~ /^\d+$/) { - $addr1 .= "..$addr2"; - } - else { - $addr1 .= "...$addr2"; - } - } - - # Now we check for metacommands {, }, and ! and worry - # about indentation. - - s/^[ \t]+//; - # a { to keep vi happy - if ($_ eq '}') { - $indent -= 4; - next; - } - if (s/^!//) { - $if = 'unless'; - $else = "$r else $l\n"; - } else { - $if = 'if'; - $else = ''; - } - if (s/^{//) { # a } to keep vi happy - $indmod = 4; - $redo = $_; - $_ = ''; - $rmaybe = ''; - } else { - $rmaybe = "\n$r"; - if ($addr2 || $addr1) { - $space = ' ' x $shiftwidth; - } else { - $space = ''; - } - $_ = &transmogrify(); - } - - # See if we can optimize to modifier form. - - if ($addr1) { - if ($_ !~ /[\n{}]/ && $rmaybe && !$change && - $_ !~ / if / && $_ !~ / unless /) { - s/;$/ $if $addr1;/; - $_ = substr($_,$shiftwidth,1000); - } else { - $_ = "$if ($addr1) $l\n$change$_$rmaybe"; - } - $change = ''; - next LINE; - } -} continue { - @lines = split(/\n/,$_); - for (@lines) { - unless (s/^ *<<--//) { - print BODY &tab; - } - print BODY $_, "\n"; - } - $indent += $indmod; - $indmod = 0; - if ($redo) { - $_ = $redo; - $redo = ''; - redo LINE; - } -} -if ($lastlinewaslabel++) { - $indent += 4; - print BODY &tab, ";\n"; - $indent -= 4; -} - -if ($appendseen || $tseen || !$assumen) { - $printit++ if $dseen || (!$assumen && !$assumep); - print BODY &q(<<'EOT'); -: #ifdef SAWNEXT -: } -: continue { -: #endif -: #ifdef PRINTIT -: #ifdef DSEEN -: #ifdef ASSUMEP -: print if $printit++; -: #else -: if ($printit) -: { print; } -: else -: { $printit++ unless $nflag; } -: #endif -: #else -: print if $printit; -: #endif -: #else -: print; -: #endif -: #ifdef TSEEN -: $tflag = 0; -: #endif -: #ifdef APPENDSEEN -: if ($atext) { chop $atext; print $atext; $atext = ''; } -: #endif -EOT -} - -print BODY &q(<<'EOT'); -: } -EOT - -unless ($debug) { - - print &q(<<"EOT"); -: $startperl -: eval 'exec $perlpath -S \$0 \${1+"\$@"}' -: if \$running_under_some_shell; -: -EOT - print"$opens\n" if $opens; - seek(BODY, 0, 0) || die "Can't rewind temp file: $!\n"; - while (<BODY>) { - /^[ \t]*$/ && next; - /^#ifdef (\w+)/ && ((${lc $1} || &skip), next); - /^#else/ && (&skip, next); - /^#endif/ && next; - s/^<><>//; - print; - } -} - -&Cleanup; -exit; - -sub Cleanup { - unlink "/tmp/sperl$$"; -} -sub Die { - &Cleanup; - die $_[0]; -} -sub tab { - "\t" x ($indent / 8) . ' ' x ($indent % 8); -} -sub make_filehandle { - local($_) = $_[0]; - local($fname) = $_; - if (!$seen{$fname}) { - $_ = "FH_" . $_ if /^\d/; - s/[^a-zA-Z0-9]/_/g; - s/^_*//; - $_ = "\U$_"; - if ($fhseen{$_}) { - for ($tmp = "a"; $fhseen{"$_$tmp"}; $a++) {} - $_ .= $tmp; - } - $fhseen{$_} = 1; - $opens .= &q(<<"EOT"); -: open($_, '>$fname') || die "Can't create $fname: \$!"; -EOT - $seen{$fname} = $_; - } - $seen{$fname}; -} - -sub make_label { - local($label) = @_; - $label =~ s/[^a-zA-Z0-9]/_/g; - if ($label =~ /^[0-9_]/) { $label = 'L' . $label; } - $label = substr($label,0,8); - - # Could be a reserved word, so capitalize it. - substr($label,0,1) =~ y/a-z/A-Z/ - if $label =~ /^[a-z]/; - - $label; -} - -sub transmogrify { - { # case - if (/^d/) { - $dseen++; - chop($_ = &q(<<'EOT')); -: <<--#ifdef PRINTIT -: $printit = 0; -: <<--#endif -: next LINE; -EOT - $sawnext++; - next; - } - - if (/^n/) { - chop($_ = &q(<<'EOT')); -: <<--#ifdef PRINTIT -: <<--#ifdef DSEEN -: <<--#ifdef ASSUMEP -: print if $printit++; -: <<--#else -: if ($printit) -: { print; } -: else -: { $printit++ unless $nflag; } -: <<--#endif -: <<--#else -: print if $printit; -: <<--#endif -: <<--#else -: print; -: <<--#endif -: <<--#ifdef APPENDSEEN -: if ($atext) {chop $atext; print $atext; $atext = '';} -: <<--#endif -: $_ = <>; -: chop; -: <<--#ifdef TSEEN -: $tflag = 0; -: <<--#endif -EOT - next; - } - - if (/^a/) { - $appendseen++; - $command = $space . "\$atext .= <<'End_Of_Text';\n<<--"; - $lastline = 0; - while (<>) { - s/^[ \t]*//; - s/^[\\]//; - unless (s|\\$||) { $lastline = 1;} - s/^([ \t]*\n)/<><>$1/; - $command .= $_; - $command .= '<<--'; - last if $lastline; - } - $_ = $command . "End_Of_Text"; - last; - } - - if (/^[ic]/) { - if (/^c/) { $change = 1; } - $addr1 = 1 if $addr1 eq ''; - $addr1 = '$iter = (' . $addr1 . ')'; - $command = $space . - " if (\$iter == 1) { print <<'End_Of_Text'; }\n<<--"; - $lastline = 0; - while (<>) { - s/^[ \t]*//; - s/^[\\]//; - unless (s/\\$//) { $lastline = 1;} - s/'/\\'/g; - s/^([ \t]*\n)/<><>$1/; - $command .= $_; - $command .= '<<--'; - last if $lastline; - } - $_ = $command . "End_Of_Text"; - if ($change) { - $dseen++; - $change = "$_\n"; - chop($_ = &q(<<"EOT")); -: <<--#ifdef PRINTIT -: $space\$printit = 0; -: <<--#endif -: ${space}next LINE; -EOT - $sawnext++; - } - last; - } - - if (/^s/) { - $delim = substr($_,1,1); - $len = length($_); - $repl = $end = 0; - $inbracket = 0; - for ($i = 2; $i < $len; $i++) { - $c = substr($_,$i,1); - if ($c eq $delim) { - if ($inbracket) { - substr($_, $i, 0) = '\\'; - $i++; - $len++; - } - else { - if ($repl) { - $end = $i; - last; - } else { - $repl = $i; - } - } - } - elsif ($c eq '\\') { - $i++; - if ($i >= $len) { - $_ .= 'n'; - $_ .= <>; - $len = length($_); - $_ = substr($_,0,--$len); - } - elsif (substr($_,$i,1) =~ /^[n]$/) { - ; - } - elsif (!$repl && - substr($_,$i,1) =~ /^[(){}\w]$/) { - $i--; - $len--; - substr($_, $i, 1) = ''; - } - elsif (!$repl && - substr($_,$i,1) =~ /^[<>]$/) { - substr($_,$i,1) = 'b'; - } - elsif ($repl && substr($_,$i,1) =~ /^\d$/) { - substr($_,$i-1,1) = '$'; - } - } - elsif ($c eq '@') { - substr($_, $i, 0) = '\\'; - $i++; - $len++; - } - elsif ($c eq '&' && $repl) { - substr($_, $i, 0) = '$'; - $i++; - $len++; - } - elsif ($c eq '$' && $repl) { - substr($_, $i, 0) = '\\'; - $i++; - $len++; - } - elsif ($c eq '[' && !$repl) { - $i++ if substr($_,$i,1) eq '^'; - $i++ if substr($_,$i,1) eq ']'; - $inbracket = 1; - } - elsif ($c eq ']') { - $inbracket = 0; - } - elsif ($c eq "\t") { - substr($_, $i, 1) = '\\t'; - $i++; - $len++; - } - elsif (!$repl && index("()+",$c) >= 0) { - substr($_, $i, 0) = '\\'; - $i++; - $len++; - } - } - &Die("Malformed substitution at line $.\n") - unless $end; - $pat = substr($_, 0, $repl + 1); - $repl = substr($_, $repl+1, $end-$repl-1); - $end = substr($_, $end + 1, 1000); - &simplify($pat); - $subst = "$pat$repl$delim"; - $cmd = ''; - while ($end) { - if ($end =~ s/^g//) { - $subst .= 'g'; - next; - } - if ($end =~ s/^p//) { - $cmd .= ' && (print)'; - next; - } - if ($end =~ s/^w[ \t]*//) { - $fh = &make_filehandle($end); - $cmd .= " && (print $fh \$_)"; - $end = ''; - next; - } - &Die("Unrecognized substitution command". - "($end) at line $.\n"); - } - chop ($_ = &q(<<"EOT")); -: <<--#ifdef TSEEN -: $subst && \$tflag++$cmd; -: <<--#else -: $subst$cmd; -: <<--#endif -EOT - next; - } - - if (/^p/) { - $_ = 'print;'; - next; - } - - if (/^w/) { - s/^w[ \t]*//; - $fh = &make_filehandle($_); - $_ = "print $fh \$_;"; - next; - } - - if (/^r/) { - $appendseen++; - s/^r[ \t]*//; - $file = $_; - $_ = "\$atext .= `cat $file 2>/dev/null`;"; - next; - } - - if (/^P/) { - $_ = 'print $1 if /^(.*)/;'; - next; - } - - if (/^D/) { - chop($_ = &q(<<'EOT')); -: s/^.*\n?//; -: redo LINE if $_; -: next LINE; -EOT - $sawnext++; - next; - } - - if (/^N/) { - chop($_ = &q(<<'EOT')); -: $_ .= "\n"; -: $len1 = length; -: $_ .= <>; -: chop if $len1 < length; -: <<--#ifdef TSEEN -: $tflag = 0; -: <<--#endif -EOT - next; - } - - if (/^h/) { - $_ = '$hold = $_;'; - next; - } - - if (/^H/) { - $_ = '$hold .= "\n", $hold .= $_;'; - next; - } - - if (/^g/) { - $_ = '$_ = $hold;'; - next; - } - - if (/^G/) { - $_ = '$_ .= "\n", $_ .= $hold;'; - next; - } - - if (/^x/) { - $_ = '($_, $hold) = ($hold, $_);'; - next; - } - - if (/^b$/) { - $_ = 'next LINE;'; - $sawnext++; - next; - } - - if (/^b/) { - s/^b[ \t]*//; - $lab = &make_label($_); - if ($lab eq $toplabel) { - $_ = 'redo LINE;'; - } else { - $_ = "goto $lab;"; - } - next; - } - - if (/^t$/) { - $_ = 'next LINE if $tflag;'; - $sawnext++; - $tseen++; - next; - } - - if (/^t/) { - s/^t[ \t]*//; - $lab = &make_label($_); - $_ = q/if ($tflag) {$tflag = 0; /; - if ($lab eq $toplabel) { - $_ .= 'redo LINE;}'; - } else { - $_ .= "goto $lab;}"; - } - $tseen++; - next; - } - - if (/^y/) { - s/abcdefghijklmnopqrstuvwxyz/a-z/g; - s/ABCDEFGHIJKLMNOPQRSTUVWXYZ/A-Z/g; - s/abcdef/a-f/g; - s/ABCDEF/A-F/g; - s/0123456789/0-9/g; - s/01234567/0-7/g; - $_ .= ';'; - } - - if (/^=/) { - $_ = 'print $.;'; - next; - } - - if (/^q/) { - chop($_ = &q(<<'EOT')); -: close(ARGV); -: @ARGV = (); -: next LINE; -EOT - $sawnext++; - next; - } - } continue { - if ($space) { - s/^/$space/; - s/(\n)(.)/$1$space$2/g; - } - last; - } - $_; -} - -sub fetchpat { - local($outer) = @_; - local($addr) = $outer; - local($inbracket); - local($prefix,$delim,$ch); - - # Process pattern one potential delimiter at a time. - - DELIM: while (s#^([^\]+(|)[\\/]*)([]+(|)[\\/])##) { - $prefix = $1; - $delim = $2; - if ($delim eq '\\') { - s/(.)//; - $ch = $1; - $delim = '' if $ch =~ /^[(){}A-Za-mo-z]$/; - $ch = 'b' if $ch =~ /^[<>]$/; - $delim .= $ch; - } - elsif ($delim eq '[') { - $inbracket = 1; - s/^\^// && ($delim .= '^'); - s/^]// && ($delim .= ']'); - } - elsif ($delim eq ']') { - $inbracket = 0; - } - elsif ($inbracket || $delim ne $outer) { - $delim = '\\' . $delim; - } - $addr .= $prefix; - $addr .= $delim; - if ($delim eq $outer && !$inbracket) { - last DELIM; - } - } - $addr =~ s/\t/\\t/g; - $addr =~ s/\@/\\@/g; - &simplify($addr); - $addr; -} - -sub q { - local($string) = @_; - local($*) = 1; - $string =~ s/^:\t?//g; - $string; -} - -sub simplify { - $_[0] =~ s/_a-za-z0-9/\\w/ig; - $_[0] =~ s/a-z_a-z0-9/\\w/ig; - $_[0] =~ s/a-za-z_0-9/\\w/ig; - $_[0] =~ s/a-za-z0-9_/\\w/ig; - $_[0] =~ s/_0-9a-za-z/\\w/ig; - $_[0] =~ s/0-9_a-za-z/\\w/ig; - $_[0] =~ s/0-9a-z_a-z/\\w/ig; - $_[0] =~ s/0-9a-za-z_/\\w/ig; - $_[0] =~ s/\[\\w\]/\\w/g; - $_[0] =~ s/\[^\\w\]/\\W/g; - $_[0] =~ s/\[0-9\]/\\d/g; - $_[0] =~ s/\[^0-9\]/\\D/g; - $_[0] =~ s/\\d\\d\*/\\d+/g; - $_[0] =~ s/\\D\\D\*/\\D+/g; - $_[0] =~ s/\\w\\w\*/\\w+/g; - $_[0] =~ s/\\t\\t\*/\\t+/g; - $_[0] =~ s/(\[.[^]]*\])\1\*/$1+/g; - $_[0] =~ s/([\w\s!@#%^&-=,:;'"])\1\*/$1+/g; -} - -sub skip { - local($level) = 0; - - while(<BODY>) { - /^#ifdef/ && $level++; - /^#else/ && !$level && return; - /^#endif/ && !$level-- && return; - } - - die "Unterminated `#ifdef' conditional\n"; -} -!NO!SUBS! - -close OUT or die "Can't close $file: $!"; -chmod 0755, $file or die "Can't reset permissions for $file: $!\n"; -exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':'; -chdir $origdir; diff --git a/contrib/perl5/x2p/str.c b/contrib/perl5/x2p/str.c deleted file mode 100644 index 310bcd6..0000000 --- a/contrib/perl5/x2p/str.c +++ /dev/null @@ -1,442 +0,0 @@ -/* $RCSfile: str.c,v $$Revision: 4.1 $$Date: 92/08/07 18:29:26 $ - * - * Copyright (c) 1991-2001, Larry Wall - * - * You may distribute under the terms of either the GNU General Public - * License or the Artistic License, as specified in the README file. - * - * $Log: str.c,v $ - */ - -#include "EXTERN.h" -#include "a2p.h" -#include "util.h" - -void -str_numset(register STR *str, double num) -{ - str->str_nval = num; - str->str_pok = 0; /* invalidate pointer */ - str->str_nok = 1; /* validate number */ -} - -char * -str_2ptr(register STR *str) -{ - register char *s; - - if (!str) - return ""; - GROWSTR(&(str->str_ptr), &(str->str_len), 24); - s = str->str_ptr; - if (str->str_nok) { - sprintf(s,"%.20g",str->str_nval); - while (*s) s++; - } - *s = '\0'; - str->str_cur = s - str->str_ptr; - str->str_pok = 1; -#ifdef DEBUGGING - if (debug & 32) - fprintf(stderr,"0x%lx ptr(%s)\n",(unsigned long)str,str->str_ptr); -#endif - return str->str_ptr; -} - -double -str_2num(register STR *str) -{ - if (!str) - return 0.0; - if (str->str_len && str->str_pok) - str->str_nval = atof(str->str_ptr); - else - str->str_nval = 0.0; - str->str_nok = 1; -#ifdef DEBUGGING - if (debug & 32) - fprintf(stderr,"0x%lx num(%g)\n",(unsigned long)str,str->str_nval); -#endif - return str->str_nval; -} - -void -str_sset(STR *dstr, register STR *sstr) -{ - if (!sstr) - str_nset(dstr,No,0); - else if (sstr->str_nok) - str_numset(dstr,sstr->str_nval); - else if (sstr->str_pok) - str_nset(dstr,sstr->str_ptr,sstr->str_cur); - else - str_nset(dstr,"",0); -} - -void -str_nset(register STR *str, register char *ptr, register int len) -{ - GROWSTR(&(str->str_ptr), &(str->str_len), len + 1); - bcopy(ptr,str->str_ptr,len); - str->str_cur = len; - *(str->str_ptr+str->str_cur) = '\0'; - str->str_nok = 0; /* invalidate number */ - str->str_pok = 1; /* validate pointer */ -} - -void -str_set(register STR *str, register char *ptr) -{ - register int len; - - if (!ptr) - ptr = ""; - len = strlen(ptr); - GROWSTR(&(str->str_ptr), &(str->str_len), len + 1); - bcopy(ptr,str->str_ptr,len+1); - str->str_cur = len; - str->str_nok = 0; /* invalidate number */ - str->str_pok = 1; /* validate pointer */ -} - -void -str_chop(register STR *str, register char *ptr) /* like set but assuming ptr is in str */ - - -{ - if (!(str->str_pok)) - str_2ptr(str); - str->str_cur -= (ptr - str->str_ptr); - bcopy(ptr,str->str_ptr, str->str_cur + 1); - str->str_nok = 0; /* invalidate number */ - str->str_pok = 1; /* validate pointer */ -} - -void -str_ncat(register STR *str, register char *ptr, register int len) -{ - if (!(str->str_pok)) - str_2ptr(str); - GROWSTR(&(str->str_ptr), &(str->str_len), str->str_cur + len + 1); - bcopy(ptr,str->str_ptr+str->str_cur,len); - str->str_cur += len; - *(str->str_ptr+str->str_cur) = '\0'; - str->str_nok = 0; /* invalidate number */ - str->str_pok = 1; /* validate pointer */ -} - -void -str_scat(STR *dstr, register STR *sstr) -{ - if (!(sstr->str_pok)) - str_2ptr(sstr); - if (sstr) - str_ncat(dstr,sstr->str_ptr,sstr->str_cur); -} - -void -str_cat(register STR *str, register char *ptr) -{ - register int len; - - if (!ptr) - return; - if (!(str->str_pok)) - str_2ptr(str); - len = strlen(ptr); - GROWSTR(&(str->str_ptr), &(str->str_len), str->str_cur + len + 1); - bcopy(ptr,str->str_ptr+str->str_cur,len+1); - str->str_cur += len; - str->str_nok = 0; /* invalidate number */ - str->str_pok = 1; /* validate pointer */ -} - -char * -str_append_till(register STR *str, register char *from, register int delim, char *keeplist) -{ - register char *to; - register int len; - - if (!from) - return Nullch; - len = strlen(from); - GROWSTR(&(str->str_ptr), &(str->str_len), str->str_cur + len + 1); - str->str_nok = 0; /* invalidate number */ - str->str_pok = 1; /* validate pointer */ - to = str->str_ptr+str->str_cur; - for (; *from; from++,to++) { - if (*from == '\\' && from[1] && delim != '\\') { - if (!keeplist) { - if (from[1] == delim || from[1] == '\\') - from++; - else - *to++ = *from++; - } - else if (strchr(keeplist,from[1])) - *to++ = *from++; - else - from++; - } - else if (*from == delim) - break; - *to = *from; - } - *to = '\0'; - str->str_cur = to - str->str_ptr; - return from; -} - -STR * -str_new(int len) -{ - register STR *str; - - if (freestrroot) { - str = freestrroot; - freestrroot = str->str_link.str_next; - } - else { - str = (STR *) safemalloc(sizeof(STR)); - bzero((char*)str,sizeof(STR)); - } - if (len) - GROWSTR(&(str->str_ptr), &(str->str_len), len + 1); - return str; -} - -void -str_grow(register STR *str, int len) -{ - if (len && str) - GROWSTR(&(str->str_ptr), &(str->str_len), len + 1); -} - -/* make str point to what nstr did */ - -void -str_replace(register STR *str, register STR *nstr) -{ - safefree(str->str_ptr); - str->str_ptr = nstr->str_ptr; - str->str_len = nstr->str_len; - str->str_cur = nstr->str_cur; - str->str_pok = nstr->str_pok; - if (str->str_nok = nstr->str_nok) - str->str_nval = nstr->str_nval; - safefree((char*)nstr); -} - -void -str_free(register STR *str) -{ - if (!str) - return; - if (str->str_len) - str->str_ptr[0] = '\0'; - str->str_cur = 0; - str->str_nok = 0; - str->str_pok = 0; - str->str_link.str_next = freestrroot; - freestrroot = str; -} - -int -str_len(register STR *str) -{ - if (!str) - return 0; - if (!(str->str_pok)) - str_2ptr(str); - if (str->str_len) - return str->str_cur; - else - return 0; -} - -char * -str_gets(register STR *str, register FILE *fp) -{ -#if defined(USE_STDIO_PTR) && defined(STDIO_PTR_LVALUE) && defined(STDIO_CNT_LVALUE) - /* Here is some breathtakingly efficient cheating */ - - register char *bp; /* we're going to steal some values */ - register int cnt; /* from the stdio struct and put EVERYTHING */ - register STDCHAR *ptr; /* in the innermost loop into registers */ - register char newline = '\n'; /* (assuming at least 6 registers) */ - int i; - int bpx; - -#if defined(VMS) - /* An ungetc()d char is handled separately from the regular - * buffer, so we getc() it back out and stuff it in the buffer. - */ - i = getc(fp); - if (i == EOF) return Nullch; - *(--((*fp)->_ptr)) = (unsigned char) i; - (*fp)->_cnt++; -#endif - - cnt = FILE_cnt(fp); /* get count into register */ - str->str_nok = 0; /* invalidate number */ - str->str_pok = 1; /* validate pointer */ - if (str->str_len <= cnt) /* make sure we have the room */ - GROWSTR(&(str->str_ptr), &(str->str_len), cnt+1); - bp = str->str_ptr; /* move these two too to registers */ - ptr = FILE_ptr(fp); - for (;;) { - while (--cnt >= 0) { - if ((*bp++ = *ptr++) == newline) - if (bp <= str->str_ptr || bp[-2] != '\\') - goto thats_all_folks; - else { - line++; - bp -= 2; - } - } - - FILE_cnt(fp) = cnt; /* deregisterize cnt and ptr */ - FILE_ptr(fp) = ptr; - i = getc(fp); /* get more characters */ - cnt = FILE_cnt(fp); - ptr = FILE_ptr(fp); /* reregisterize cnt and ptr */ - - bpx = bp - str->str_ptr; /* prepare for possible relocation */ - GROWSTR(&(str->str_ptr), &(str->str_len), str->str_cur + cnt + 1); - bp = str->str_ptr + bpx; /* reconstitute our pointer */ - - if (i == newline) { /* all done for now? */ - *bp++ = i; - goto thats_all_folks; - } - else if (i == EOF) /* all done for ever? */ - goto thats_all_folks; - *bp++ = i; /* now go back to screaming loop */ - } - -thats_all_folks: - FILE_cnt(fp) = cnt; /* put these back or we're in trouble */ - FILE_ptr(fp) = ptr; - *bp = '\0'; - str->str_cur = bp - str->str_ptr; /* set length */ - -#else /* USE_STDIO_PTR && STDIO_PTR_LVALUE && STDIO_CNT_LVALUE */ - /* The big, slow, and stupid way */ - - static char buf[4192]; - - if (fgets(buf, sizeof buf, fp) != Nullch) - str_set(str, buf); - else - str_set(str, No); - -#endif /* USE_STDIO_PTR && STDIO_PTR_LVALUE && STDIO_CNT_LVALUE */ - - return str->str_cur ? str->str_ptr : Nullch; -} - -void -str_inc(register STR *str) -{ - register char *d; - - if (!str) - return; - if (str->str_nok) { - str->str_nval += 1.0; - str->str_pok = 0; - return; - } - if (!str->str_pok) { - str->str_nval = 1.0; - str->str_nok = 1; - return; - } - for (d = str->str_ptr; *d && *d != '.'; d++) ; - d--; - if (!isdigit(*str->str_ptr) || !isdigit(*d) ) { - str_numset(str,atof(str->str_ptr) + 1.0); /* punt */ - return; - } - while (d >= str->str_ptr) { - if (++*d <= '9') - return; - *(d--) = '0'; - } - /* oh,oh, the number grew */ - GROWSTR(&(str->str_ptr), &(str->str_len), str->str_cur + 2); - str->str_cur++; - for (d = str->str_ptr + str->str_cur; d > str->str_ptr; d--) - *d = d[-1]; - *d = '1'; -} - -void -str_dec(register STR *str) -{ - register char *d; - - if (!str) - return; - if (str->str_nok) { - str->str_nval -= 1.0; - str->str_pok = 0; - return; - } - if (!str->str_pok) { - str->str_nval = -1.0; - str->str_nok = 1; - return; - } - for (d = str->str_ptr; *d && *d != '.'; d++) ; - d--; - if (!isdigit(*str->str_ptr) || !isdigit(*d) || (*d == '0' && d == str->str_ptr)) { - str_numset(str,atof(str->str_ptr) - 1.0); /* punt */ - return; - } - while (d >= str->str_ptr) { - if (--*d >= '0') - return; - *(d--) = '9'; - } -} - -/* make a string that will exist for the duration of the expression eval */ - -STR * -str_mortal(STR *oldstr) -{ - register STR *str = str_new(0); - static long tmps_size = -1; - - str_sset(str,oldstr); - if (++tmps_max > tmps_size) { - tmps_size = tmps_max; - if (!(tmps_size & 127)) { - if (tmps_size) - tmps_list = (STR**)saferealloc((char*)tmps_list, - (tmps_size + 128) * sizeof(STR*) ); - else - tmps_list = (STR**)safemalloc(128 * sizeof(char*)); - } - } - tmps_list[tmps_max] = str; - return str; -} - -STR * -str_make(char *s) -{ - register STR *str = str_new(0); - - str_set(str,s); - return str; -} - -STR * -str_nmake(double n) -{ - register STR *str = str_new(0); - - str_numset(str,n); - return str; -} diff --git a/contrib/perl5/x2p/str.h b/contrib/perl5/x2p/str.h deleted file mode 100644 index 311c5e6..0000000 --- a/contrib/perl5/x2p/str.h +++ /dev/null @@ -1,53 +0,0 @@ -/* $RCSfile: str.h,v $$Revision: 4.1 $$Date: 92/08/07 18:29:27 $ - * - * Copyright (c) 1991-2001, Larry Wall - * - * You may distribute under the terms of either the GNU General Public - * License or the Artistic License, as specified in the README file. - * - * $Log: str.h,v $ - */ - -struct string { - char * str_ptr; /* pointer to malloced string */ - double str_nval; /* numeric value, if any */ - int str_len; /* allocated size */ - int str_cur; /* length of str_ptr as a C string */ - union { - STR *str_next; /* while free, link to next free str */ - } str_link; - char str_pok; /* state of str_ptr */ - char str_nok; /* state of str_nval */ -}; - -#define Nullstr Null(STR*) - -/* the following macro updates any magic values this str is associated with */ - -#define STABSET(x) (x->str_link.str_magic && stabset(x->str_link.str_magic,x)) - -EXT STR **tmps_list; -EXT long tmps_max INIT(-1); - -double str_2num ( STR *str ); -char * str_2ptr ( STR *str ); -char * str_append_till ( STR *str, char *from, int delim, char *keeplist ); -void str_cat ( STR *str, char *ptr ); -void str_chop ( STR *str, char *ptr ); -void str_dec ( STR *str ); -void str_free ( STR *str ); -char * str_gets ( STR *str, FILE *fp ); -void str_grow ( STR *str, int len ); -void str_inc ( STR *str ); -int str_len ( STR *str ); -STR * str_make ( char *s ); -STR * str_mortal ( STR *oldstr ); -void str_ncat ( STR *str, char *ptr, int len ); -STR * str_new ( int len ); -STR * str_nmake ( double n ); -void str_nset ( STR *str, char *ptr, int len ); -void str_numset ( STR *str, double num ); -void str_replace ( STR *str, STR *nstr ); -void str_scat ( STR *dstr, STR *sstr ); -void str_set ( STR *str, char *ptr ); -void str_sset ( STR *dstr, STR *sstr ); diff --git a/contrib/perl5/x2p/util.c b/contrib/perl5/x2p/util.c deleted file mode 100644 index ab24808..0000000 --- a/contrib/perl5/x2p/util.c +++ /dev/null @@ -1,221 +0,0 @@ -/* $RCSfile: util.c,v $$Revision: 4.1 $$Date: 92/08/07 18:29:29 $ - * - * Copyright (c) 1991-2001, Larry Wall - * - * You may distribute under the terms of either the GNU General Public - * License or the Artistic License, as specified in the README file. - * - * $Log: util.c,v $ - */ - -#include "EXTERN.h" -#include "a2p.h" -#include "INTERN.h" -#include "util.h" - -#include <stdarg.h> -#define FLUSH - -static char nomem[] = "Out of memory!\n"; - -/* paranoid version of malloc */ - - -Malloc_t -safemalloc(MEM_SIZE size) -{ - Malloc_t ptr; - - /* malloc(0) is NASTY on some systems */ - ptr = malloc(size ? size : 1); -#ifdef DEBUGGING - if (debug & 128) - fprintf(stderr,"0x%lx: (%05d) malloc %ld bytes\n",(unsigned long)ptr, - an++,(long)size); -#endif - if (ptr != Nullch) - return ptr; - else { - fputs(nomem,stdout) FLUSH; - exit(1); - } - /*NOTREACHED*/ - return 0; -} - -/* paranoid version of realloc */ - -Malloc_t -saferealloc(Malloc_t where, MEM_SIZE size) -{ - Malloc_t ptr; - - /* realloc(0) is NASTY on some systems */ - ptr = realloc(where, size ? size : 1); -#ifdef DEBUGGING - if (debug & 128) { - fprintf(stderr,"0x%lx: (%05d) rfree\n",(unsigned long)where,an++); - fprintf(stderr,"0x%lx: (%05d) realloc %ld bytes\n",(unsigned long)ptr,an++,(long)size); - } -#endif - if (ptr != Nullch) - return ptr; - else { - fputs(nomem,stdout) FLUSH; - exit(1); - } - /*NOTREACHED*/ - return 0; -} - -/* safe version of free */ - -Free_t -safefree(Malloc_t where) -{ -#ifdef DEBUGGING - if (debug & 128) - fprintf(stderr,"0x%lx: (%05d) free\n",(unsigned long)where,an++); -#endif - free(where); -} - -/* safe version of string copy */ - -char * -safecpy(char *to, register char *from, register int len) -{ - register char *dest = to; - - if (from != Nullch) - for (len--; len && (*dest++ = *from++); len--) ; - *dest = '\0'; - return to; -} - -/* copy a string up to some (non-backslashed) delimiter, if any */ - -char * -cpytill(register char *to, register char *from, register int delim) -{ - for (; *from; from++,to++) { - if (*from == '\\') { - if (from[1] == delim) - from++; - else if (from[1] == '\\') - *to++ = *from++; - } - else if (*from == delim) - break; - *to = *from; - } - *to = '\0'; - return from; -} - - -char * -cpy2(register char *to, register char *from, register int delim) -{ - for (; *from; from++,to++) { - if (*from == '\\') - *to++ = *from++; - else if (*from == '$') - *to++ = '\\'; - else if (*from == delim) - break; - *to = *from; - } - *to = '\0'; - return from; -} - -/* return ptr to little string in big string, NULL if not found */ - -char * -instr(char *big, char *little) -{ - register char *t, *s, *x; - - for (t = big; *t; t++) { - for (x=t,s=little; *s; x++,s++) { - if (!*x) - return Nullch; - if (*s != *x) - break; - } - if (!*s) - return t; - } - return Nullch; -} - -/* copy a string to a safe spot */ - -char * -savestr(char *str) -{ - register char *newaddr = (char *) safemalloc((MEM_SIZE)(strlen(str)+1)); - - (void)strcpy(newaddr,str); - return newaddr; -} - -/* grow a static string to at least a certain length */ - -void -growstr(char **strptr, int *curlen, int newlen) -{ - if (newlen > *curlen) { /* need more room? */ - if (*curlen) - *strptr = (char *) saferealloc(*strptr,(MEM_SIZE)newlen); - else - *strptr = (char *) safemalloc((MEM_SIZE)newlen); - *curlen = newlen; - } -} - -void -croak(char *pat,...) -{ -#if defined(HAS_VPRINTF) - va_list args; - - va_start(args, pat); - vfprintf(stderr,pat,args); -#else - fprintf(stderr,pat,a1,a2,a3,a4); -#endif - exit(1); -} - -void -fatal(char *pat,...) -{ -#if defined(HAS_VPRINTF) - va_list args; - - va_start(args, pat); - vfprintf(stderr,pat,args); -#else - fprintf(stderr,pat,a1,a2,a3,a4); -#endif - exit(1); -} - -#if defined(__APPLE_CC__) -__private_extern__ /* warn() conflicts with libc */ -#endif -void -warn(char *pat,...) -{ -#if defined(HAS_VPRINTF) - va_list args; - - va_start(args, pat); - vfprintf(stderr,pat,args); -#else - fprintf(stderr,pat,a1,a2,a3,a4); -#endif -} - diff --git a/contrib/perl5/x2p/util.h b/contrib/perl5/x2p/util.h deleted file mode 100644 index c5ebcec..0000000 --- a/contrib/perl5/x2p/util.h +++ /dev/null @@ -1,39 +0,0 @@ -/* $RCSfile: util.h,v $$Revision: 4.1 $$Date: 92/08/07 18:29:30 $ - * - * Copyright (c) 1991-2001, Larry Wall - * - * You may distribute under the terms of either the GNU General Public - * License or the Artistic License, as specified in the README file. - * - * $Log: util.h,v $ - */ - -/* is the string for makedir a directory name or a filename? */ - -#define fatal Myfatal - -#define MD_DIR 0 -#define MD_FILE 1 - -#ifdef SETUIDGID - int eaccess(); -#endif - -char *getwd(); -int makedir(); - -char * cpy2 ( char *to, char *from, int delim ); -char * cpytill ( char *to, char *from, int delim ); -void growstr ( char **strptr, int *curlen, int newlen ); -char * instr ( char *big, char *little ); -char * safecpy ( char *to, char *from, int len ); -char * savestr ( char *str ); -void croak ( char *pat, ... ); -void fatal ( char *pat, ... ); -void warn ( char *pat, ... ); -int prewalk ( int numit, int level, int node, int *numericptr ); - -Malloc_t safemalloc (MEM_SIZE nbytes); -Malloc_t safecalloc (MEM_SIZE elements, MEM_SIZE size); -Malloc_t saferealloc (Malloc_t where, MEM_SIZE nbytes); -Free_t safefree (Malloc_t where); diff --git a/contrib/perl5/x2p/walk.c b/contrib/perl5/x2p/walk.c deleted file mode 100644 index 59ac8a9..0000000 --- a/contrib/perl5/x2p/walk.c +++ /dev/null @@ -1,2066 +0,0 @@ -/* $RCSfile: walk.c,v $$Revision: 4.1 $$Date: 92/08/07 18:29:31 $ - * - * Copyright (c) 1991-2001, Larry Wall - * - * You may distribute under the terms of either the GNU General Public - * License or the Artistic License, as specified in the README file. - * - * $Log: walk.c,v $ - */ - -#include "EXTERN.h" -#include "a2p.h" -#include "util.h" - -bool exitval = FALSE; -bool realexit = FALSE; -bool saw_getline = FALSE; -bool subretnum = FALSE; -bool saw_FNR = FALSE; -bool saw_argv0 = FALSE; -bool saw_fh = FALSE; -int maxtmp = 0; -char *lparen; -char *rparen; -char *limit; -STR *subs; -STR *curargs = Nullstr; - -static void addsemi ( STR *str ); -static void emit_split ( STR *str, int level ); -static void fixtab ( STR *str, int lvl ); -static void numericize ( int node ); -static void tab ( STR *str, int lvl ); - -int prewalk ( int numit, int level, int node, int *numericptr ); -STR * walk ( int useval, int level, int node, int *numericptr, int minprec ); - - -STR * -walk(int useval, int level, register int node, int *numericptr, int minprec) - - - - - /* minimum precedence without parens */ -{ - register int len; - register STR *str; - register int type; - register int i; - register STR *tmpstr; - STR *tmp2str; - STR *tmp3str; - char *t; - char *d, *s; - int numarg; - int numeric = FALSE; - STR *fstr; - int prec = P_MAX; /* assume no parens needed */ - - if (!node) { - *numericptr = 0; - return str_make(""); - } - type = ops[node].ival; - len = type >> 8; - type &= 255; - switch (type) { - case OPROG: - arymax = 0; - if (namelist) { - while (isalpha(*namelist)) { - for (d = tokenbuf,s=namelist; - isalpha(*s) || isdigit(*s) || *s == '_'; - *d++ = *s++) ; - *d = '\0'; - while (*s && !isalpha(*s)) s++; - namelist = s; - nameary[++arymax] = savestr(tokenbuf); - } - } - if (maxfld < arymax) - maxfld = arymax; - opens = str_new(0); - subs = str_new(0); - str = walk(0,level,ops[node+1].ival,&numarg,P_MIN); - if (do_split && need_entire && !absmaxfld) - split_to_array = TRUE; - if (do_split && split_to_array) - set_array_base = TRUE; - if (set_array_base) { - str_cat(str,"$[ = 1;\t\t\t# set array base to 1\n"); - } - if (fswitch && !const_FS) - const_FS = fswitch; - if (saw_FS > 1 || saw_RS) - const_FS = 0; - if (saw_ORS && need_entire) - do_chop = TRUE; - if (fswitch) { - str_cat(str,"$FS = '"); - if (strchr("*+?.[]()|^$\\",fswitch)) - str_cat(str,"\\"); - sprintf(tokenbuf,"%c",fswitch); - str_cat(str,tokenbuf); - str_cat(str,"';\t\t# field separator from -F switch\n"); - } - else if (saw_FS && !const_FS) { - str_cat(str,"$FS = ' ';\t\t# set field separator\n"); - } - if (saw_OFS) { - str_cat(str,"$, = ' ';\t\t# set output field separator\n"); - } - if (saw_ORS) { - str_cat(str,"$\\ = \"\\n\";\t\t# set output record separator\n"); - } - if (saw_argv0) { - str_cat(str,"$ARGV0 = $0;\t\t# remember what we ran as\n"); - } - if (str->str_cur > 20) - str_cat(str,"\n"); - if (ops[node+2].ival) { - str_scat(str,fstr=walk(0,level,ops[node+2].ival,&numarg,P_MIN)); - str_free(fstr); - str_cat(str,"\n\n"); - } - fstr = walk(0,level+1,ops[node+3].ival,&numarg,P_MIN); - if (*fstr->str_ptr) { - if (saw_line_op) - str_cat(str,"line: "); - str_cat(str,"while (<>) {\n"); - tab(str,++level); - if (saw_FS && !const_FS) - do_chop = TRUE; - if (do_chop) { - str_cat(str,"chomp;\t# strip record separator\n"); - tab(str,level); - } - if (do_split) - emit_split(str,level); - str_scat(str,fstr); - str_free(fstr); - fixtab(str,--level); - str_cat(str,"}\n"); - if (saw_FNR) - str_cat(str,"continue {\n $FNRbase = $. if eof;\n}\n"); - } - else if (old_awk) - str_cat(str,"while (<>) { } # (no line actions)\n"); - if (ops[node+4].ival) { - realexit = TRUE; - str_cat(str,"\n"); - tab(str,level); - str_scat(str,fstr=walk(0,level,ops[node+4].ival,&numarg,P_MIN)); - str_free(fstr); - str_cat(str,"\n"); - } - if (exitval) - str_cat(str,"exit $ExitValue;\n"); - if (subs->str_ptr) { - str_cat(str,"\n"); - str_scat(str,subs); - } - if (saw_getline) { - for (len = 0; len < 4; len++) { - if (saw_getline & (1 << len)) { - sprintf(tokenbuf,"\nsub Getline%d {\n",len); - str_cat(str, tokenbuf); - if (len & 2) { - if (do_fancy_opens) - str_cat(str," &Pick('',@_);\n"); - else - str_cat(str," ($fh) = @_;\n"); - } - else { - if (saw_FNR) - str_cat(str," $FNRbase = $. if eof;\n"); - } - if (len & 1) - str_cat(str," local($_);\n"); - if (len & 2) - str_cat(str, - " if ($getline_ok = (($_ = <$fh>) ne ''))"); - else - str_cat(str, - " if ($getline_ok = (($_ = <>) ne ''))"); - str_cat(str, " {\n"); - level += 2; - tab(str,level); - i = 0; - if (do_chop) { - i++; - str_cat(str,"chomp;\t# strip record separator\n"); - tab(str,level); - } - if (do_split && !(len & 1)) { - i++; - emit_split(str,level); - } - if (!i) - str_cat(str,";\n"); - fixtab(str,--level); - str_cat(str,"}\n $_;\n}\n"); - --level; - } - } - } - if (do_fancy_opens) { - str_cat(str,"\n\ -sub Pick {\n\ - local($mode,$name,$pipe) = @_;\n\ - $fh = $name;\n\ - open($name,$mode.$name.$pipe) unless $opened{$name}++;\n\ -}\n\ -"); - } - break; - case OHUNKS: - str = walk(0,level,ops[node+1].ival,&numarg,P_MIN); - str_scat(str,fstr=walk(0,level,ops[node+2].ival,&numarg,P_MIN)); - str_free(fstr); - if (len == 3) { - str_scat(str,fstr=walk(0,level,ops[node+3].ival,&numarg,P_MIN)); - str_free(fstr); - } - else { - } - break; - case ORANGE: - prec = P_DOTDOT; - str = walk(1,level,ops[node+1].ival,&numarg,prec+1); - str_cat(str," .. "); - str_scat(str,fstr=walk(1,level,ops[node+2].ival,&numarg,prec+1)); - str_free(fstr); - break; - case OPAT: - goto def; - case OREGEX: - str = str_new(0); - str_set(str,"/"); - tmpstr=walk(0,level,ops[node+1].ival,&numarg,P_MIN); - /* translate \nnn to [\nnn] */ - for (s = tmpstr->str_ptr, d = tokenbuf; *s; s++, d++) { - if (*s == '\\' && isdigit(s[1]) && isdigit(s[2]) && isdigit(s[3])){ - *d++ = '['; - *d++ = *s++; - *d++ = *s++; - *d++ = *s++; - *d++ = *s; - *d = ']'; - } - else - *d = *s; - } - *d = '\0'; - for (d=tokenbuf; *d; d++) - *d += 128; - str_cat(str,tokenbuf); - str_free(tmpstr); - str_cat(str,"/"); - break; - case OHUNK: - if (len == 1) { - str = str_new(0); - str = walk(0,level,oper1(OPRINT,0),&numarg,P_MIN); - str_cat(str," if "); - str_scat(str,fstr=walk(0,level,ops[node+1].ival,&numarg,P_MIN)); - str_free(fstr); - str_cat(str,";"); - } - else { - tmpstr = walk(0,level,ops[node+1].ival,&numarg,P_MIN); - if (*tmpstr->str_ptr) { - str = str_new(0); - str_set(str,"if ("); - str_scat(str,tmpstr); - str_cat(str,") {\n"); - tab(str,++level); - str_scat(str,fstr=walk(0,level,ops[node+2].ival,&numarg,P_MIN)); - str_free(fstr); - fixtab(str,--level); - str_cat(str,"}\n"); - tab(str,level); - } - else { - str = walk(0,level,ops[node+2].ival,&numarg,P_MIN); - } - } - break; - case OPPAREN: - str = str_new(0); - str_set(str,"("); - str_scat(str,fstr=walk(useval != 0,level,ops[node+1].ival,&numarg,P_MIN)); - str_free(fstr); - str_cat(str,")"); - break; - case OPANDAND: - prec = P_ANDAND; - str = walk(1,level,ops[node+1].ival,&numarg,prec); - str_cat(str," && "); - str_scat(str,fstr=walk(1,level,ops[node+2].ival,&numarg,prec+1)); - str_free(fstr); - str_scat(str,fstr=walk(1,level,ops[node+3].ival,&numarg,prec+1)); - str_free(fstr); - break; - case OPOROR: - prec = P_OROR; - str = walk(1,level,ops[node+1].ival,&numarg,prec); - str_cat(str," || "); - str_scat(str,fstr=walk(1,level,ops[node+2].ival,&numarg,prec+1)); - str_free(fstr); - str_scat(str,fstr=walk(1,level,ops[node+3].ival,&numarg,prec+1)); - str_free(fstr); - break; - case OPNOT: - prec = P_UNARY; - str = str_new(0); - str_set(str,"!"); - str_scat(str,fstr=walk(1,level,ops[node+1].ival,&numarg,prec)); - str_free(fstr); - break; - case OCOND: - prec = P_COND; - str = walk(1,level,ops[node+1].ival,&numarg,prec); - str_cat(str," ? "); - str_scat(str,fstr=walk(1,level,ops[node+2].ival,&numarg,prec+1)); - str_free(fstr); - str_cat(str," : "); - str_scat(str,fstr=walk(1,level,ops[node+3].ival,&numarg,prec+1)); - str_free(fstr); - break; - case OCPAREN: - str = str_new(0); - str_set(str,"("); - str_scat(str,fstr=walk(useval != 0,level,ops[node+1].ival,&numarg,P_MIN)); - str_free(fstr); - numeric |= numarg; - str_cat(str,")"); - break; - case OCANDAND: - prec = P_ANDAND; - str = walk(1,level,ops[node+1].ival,&numarg,prec); - numeric = 1; - str_cat(str," && "); - str_scat(str,fstr=walk(1,level,ops[node+2].ival,&numarg,prec+1)); - str_free(fstr); - str_scat(str,fstr=walk(1,level,ops[node+3].ival,&numarg,prec+1)); - str_free(fstr); - break; - case OCOROR: - prec = P_OROR; - str = walk(1,level,ops[node+1].ival,&numarg,prec); - numeric = 1; - str_cat(str," || "); - str_scat(str,fstr=walk(1,level,ops[node+2].ival,&numarg,prec+1)); - str_free(fstr); - str_scat(str,fstr=walk(1,level,ops[node+3].ival,&numarg,prec+1)); - str_free(fstr); - break; - case OCNOT: - prec = P_UNARY; - str = str_new(0); - str_set(str,"!"); - str_scat(str,fstr=walk(1,level,ops[node+1].ival,&numarg,prec)); - str_free(fstr); - numeric = 1; - break; - case ORELOP: - prec = P_REL; - str = walk(1,level,ops[node+2].ival,&numarg,prec+1); - numeric |= numarg; - tmpstr = walk(0,level,ops[node+1].ival,&numarg,P_MIN); - tmp2str = walk(1,level,ops[node+3].ival,&numarg,prec+1); - numeric |= numarg; - if (!numeric || - (!numarg && (*tmp2str->str_ptr == '"' || *tmp2str->str_ptr == '\''))) { - t = tmpstr->str_ptr; - if (strEQ(t,"==")) - str_set(tmpstr,"eq"); - else if (strEQ(t,"!=")) - str_set(tmpstr,"ne"); - else if (strEQ(t,"<")) - str_set(tmpstr,"lt"); - else if (strEQ(t,"<=")) - str_set(tmpstr,"le"); - else if (strEQ(t,">")) - str_set(tmpstr,"gt"); - else if (strEQ(t,">=")) - str_set(tmpstr,"ge"); - if (!strchr(tmpstr->str_ptr,'\'') && !strchr(tmpstr->str_ptr,'"') && - !strchr(tmp2str->str_ptr,'\'') && !strchr(tmp2str->str_ptr,'"') ) - numeric |= 2; - } - if (numeric & 2) { - if (numeric & 1) /* numeric is very good guess */ - str_cat(str," "); - else - str_cat(str,"\377"); - numeric = 1; - } - else - str_cat(str," "); - str_scat(str,tmpstr); - str_free(tmpstr); - str_cat(str," "); - str_scat(str,tmp2str); - str_free(tmp2str); - numeric = 1; - break; - case ORPAREN: - str = str_new(0); - str_set(str,"("); - str_scat(str,fstr=walk(useval != 0,level,ops[node+1].ival,&numarg,P_MIN)); - str_free(fstr); - numeric |= numarg; - str_cat(str,")"); - break; - case OMATCHOP: - prec = P_MATCH; - str = walk(1,level,ops[node+2].ival,&numarg,prec+1); - str_cat(str," "); - tmpstr = walk(0,level,ops[node+1].ival,&numarg,P_MIN); - if (strEQ(tmpstr->str_ptr,"~")) - str_cat(str,"=~"); - else { - str_scat(str,tmpstr); - str_free(tmpstr); - } - str_cat(str," "); - str_scat(str,fstr=walk(1,level,ops[node+3].ival,&numarg,prec+1)); - str_free(fstr); - numeric = 1; - break; - case OMPAREN: - str = str_new(0); - str_set(str,"("); - str_scat(str, - fstr=walk(useval != 0,level,ops[node+1].ival,&numarg,P_MIN)); - str_free(fstr); - numeric |= numarg; - str_cat(str,")"); - break; - case OCONCAT: - prec = P_ADD; - type = ops[ops[node+1].ival].ival & 255; - str = walk(1,level,ops[node+1].ival,&numarg,prec+(type != OCONCAT)); - str_cat(str," . "); - type = ops[ops[node+2].ival].ival & 255; - str_scat(str, - fstr=walk(1,level,ops[node+2].ival,&numarg,prec+(type != OCONCAT))); - str_free(fstr); - break; - case OASSIGN: - prec = P_ASSIGN; - str = walk(0,level,ops[node+2].ival,&numarg,prec+1); - str_cat(str," "); - tmpstr = walk(0,level,ops[node+1].ival,&numarg,P_MIN); - str_scat(str,tmpstr); - if (str_len(tmpstr) > 1) - numeric = 1; - str_free(tmpstr); - str_cat(str," "); - str_scat(str,fstr=walk(1,level,ops[node+3].ival,&numarg,prec)); - str_free(fstr); - numeric |= numarg; - if (strEQ(str->str_ptr,"$/ = ''")) - str_set(str, "$/ = \"\\n\\n\""); - break; - case OADD: - prec = P_ADD; - str = walk(1,level,ops[node+1].ival,&numarg,prec); - str_cat(str," + "); - str_scat(str,fstr=walk(1,level,ops[node+2].ival,&numarg,prec+1)); - str_free(fstr); - numeric = 1; - break; - case OSUBTRACT: - prec = P_ADD; - str = walk(1,level,ops[node+1].ival,&numarg,prec); - str_cat(str," - "); - str_scat(str,fstr=walk(1,level,ops[node+2].ival,&numarg,prec+1)); - str_free(fstr); - numeric = 1; - break; - case OMULT: - prec = P_MUL; - str = walk(1,level,ops[node+1].ival,&numarg,prec); - str_cat(str," * "); - str_scat(str,fstr=walk(1,level,ops[node+2].ival,&numarg,prec+1)); - str_free(fstr); - numeric = 1; - break; - case ODIV: - prec = P_MUL; - str = walk(1,level,ops[node+1].ival,&numarg,prec); - str_cat(str," / "); - str_scat(str,fstr=walk(1,level,ops[node+2].ival,&numarg,prec+1)); - str_free(fstr); - numeric = 1; - break; - case OPOW: - prec = P_POW; - str = walk(1,level,ops[node+1].ival,&numarg,prec+1); - str_cat(str," ** "); - str_scat(str,fstr=walk(1,level,ops[node+2].ival,&numarg,prec)); - str_free(fstr); - numeric = 1; - break; - case OMOD: - prec = P_MUL; - str = walk(1,level,ops[node+1].ival,&numarg,prec); - str_cat(str," % "); - str_scat(str,fstr=walk(1,level,ops[node+2].ival,&numarg,prec+1)); - str_free(fstr); - numeric = 1; - break; - case OPOSTINCR: - prec = P_AUTO; - str = walk(1,level,ops[node+1].ival,&numarg,prec+1); - str_cat(str,"++"); - numeric = 1; - break; - case OPOSTDECR: - prec = P_AUTO; - str = walk(1,level,ops[node+1].ival,&numarg,prec+1); - str_cat(str,"--"); - numeric = 1; - break; - case OPREINCR: - prec = P_AUTO; - str = str_new(0); - str_set(str,"++"); - str_scat(str,fstr=walk(1,level,ops[node+1].ival,&numarg,prec+1)); - str_free(fstr); - numeric = 1; - break; - case OPREDECR: - prec = P_AUTO; - str = str_new(0); - str_set(str,"--"); - str_scat(str,fstr=walk(1,level,ops[node+1].ival,&numarg,prec+1)); - str_free(fstr); - numeric = 1; - break; - case OUMINUS: - prec = P_UNARY; - str = str_new(0); - str_set(str,"-"); - str_scat(str,fstr=walk(1,level,ops[node+1].ival,&numarg,prec)); - str_free(fstr); - numeric = 1; - break; - case OUPLUS: - numeric = 1; - goto def; - case OPAREN: - str = str_new(0); - str_set(str,"("); - str_scat(str, - fstr=walk(useval != 0,level,ops[node+1].ival,&numarg,P_MIN)); - str_free(fstr); - str_cat(str,")"); - numeric |= numarg; - break; - case OGETLINE: - str = str_new(0); - if (useval) - str_cat(str,"("); - if (len > 0) { - str_scat(str,fstr=walk(1,level,ops[node+1].ival,&numarg,P_MIN)); - if (!*fstr->str_ptr) { - str_cat(str,"$_"); - len = 2; /* a legal fiction */ - } - str_free(fstr); - } - else - str_cat(str,"$_"); - if (len > 1) { - tmpstr=walk(1,level,ops[node+3].ival,&numarg,P_MIN); - fstr=walk(1,level,ops[node+2].ival,&numarg,P_MIN); - if (!do_fancy_opens) { - t = tmpstr->str_ptr; - if (*t == '"' || *t == '\'') - t = cpytill(tokenbuf,t+1,*t); - else - fatal("Internal error: OGETLINE %s", t); - d = savestr(t); - s = savestr(tokenbuf); - for (t = tokenbuf; *t; t++) { - *t &= 127; - if (islower(*t)) - *t = toupper(*t); - if (!isalpha(*t) && !isdigit(*t)) - *t = '_'; - } - if (!strchr(tokenbuf,'_')) - strcpy(t,"_FH"); - tmp3str = hfetch(symtab,tokenbuf); - if (!tmp3str) { - do_opens = TRUE; - str_cat(opens,"open("); - str_cat(opens,tokenbuf); - str_cat(opens,", "); - d[1] = '\0'; - str_cat(opens,d); - str_cat(opens,tmpstr->str_ptr+1); - opens->str_cur--; - if (*fstr->str_ptr == '|') - str_cat(opens,"|"); - str_cat(opens,d); - if (*fstr->str_ptr == '|') - str_cat(opens,") || die 'Cannot pipe from \""); - else - str_cat(opens,") || die 'Cannot open file \""); - if (*d == '"') - str_cat(opens,"'.\""); - str_cat(opens,s); - if (*d == '"') - str_cat(opens,"\".'"); - str_cat(opens,"\".';\n"); - hstore(symtab,tokenbuf,str_make("x")); - } - safefree(s); - safefree(d); - str_set(tmpstr,"'"); - str_cat(tmpstr,tokenbuf); - str_cat(tmpstr,"'"); - } - if (*fstr->str_ptr == '|') - str_cat(tmpstr,", '|'"); - str_free(fstr); - } - else - tmpstr = str_make(""); - sprintf(tokenbuf," = &Getline%d(%s)",len,tmpstr->str_ptr); - str_cat(str,tokenbuf); - str_free(tmpstr); - if (useval) - str_cat(str,",$getline_ok)"); - saw_getline |= 1 << len; - break; - case OSPRINTF: - str = str_new(0); - str_set(str,"sprintf("); - str_scat(str,fstr=walk(1,level,ops[node+1].ival,&numarg,P_MIN)); - str_free(fstr); - str_cat(str,")"); - break; - case OSUBSTR: - str = str_new(0); - str_set(str,"substr("); - str_scat(str,fstr=walk(1,level,ops[node+1].ival,&numarg,P_COMMA+1)); - str_free(fstr); - str_cat(str,", "); - str_scat(str,fstr=walk(1,level,ops[node+2].ival,&numarg,P_COMMA+1)); - str_free(fstr); - str_cat(str,", "); - if (len == 3) { - str_scat(str,fstr=walk(1,level,ops[node+3].ival,&numarg,P_COMMA+1)); - str_free(fstr); - } - else - str_cat(str,"999999"); - str_cat(str,")"); - break; - case OSTRING: - str = str_new(0); - str_set(str,ops[node+1].cval); - break; - case OSPLIT: - str = str_new(0); - limit = ", 9999)"; - numeric = 1; - tmpstr = walk(1,level,ops[node+2].ival,&numarg,P_MIN); - if (useval) - str_set(str,"(@"); - else - str_set(str,"@"); - str_scat(str,tmpstr); - str_cat(str," = split("); - if (len == 3) { - fstr = walk(1,level,ops[node+3].ival,&numarg,P_COMMA+1); - if (str_len(fstr) == 3 && *fstr->str_ptr == '\'') { - i = fstr->str_ptr[1] & 127; - if (strchr("*+?.[]()|^$\\",i)) - sprintf(tokenbuf,"/\\%c/",i); - else if (i == ' ') - sprintf(tokenbuf,"' '"); - else - sprintf(tokenbuf,"/%c/",i); - str_cat(str,tokenbuf); - } - else - str_scat(str,fstr); - str_free(fstr); - } - else if (const_FS) { - sprintf(tokenbuf,"/[%c\\n]/",const_FS); - str_cat(str,tokenbuf); - } - else if (saw_FS) - str_cat(str,"$FS"); - else { - str_cat(str,"' '"); - limit = ")"; - } - str_cat(str,", "); - str_scat(str,fstr=walk(1,level,ops[node+1].ival,&numarg,P_COMMA+1)); - str_free(fstr); - str_cat(str,limit); - if (useval) { - str_cat(str,")"); - } - str_free(tmpstr); - break; - case OINDEX: - str = str_new(0); - str_set(str,"index("); - str_scat(str,fstr=walk(1,level,ops[node+1].ival,&numarg,P_COMMA+1)); - str_free(fstr); - str_cat(str,", "); - str_scat(str,fstr=walk(1,level,ops[node+2].ival,&numarg,P_COMMA+1)); - str_free(fstr); - str_cat(str,")"); - numeric = 1; - break; - case OMATCH: - str = str_new(0); - prec = P_ANDAND; - str_scat(str,fstr=walk(1,level,ops[node+1].ival,&numarg,P_MATCH+1)); - str_free(fstr); - str_cat(str," =~ "); - str_scat(str,fstr=walk(1,level,ops[node+2].ival,&numarg,P_MATCH+1)); - str_free(fstr); - str_cat(str," && ($RLENGTH = length($&), $RSTART = length($`)+1)"); - numeric = 1; - break; - case OUSERDEF: - str = str_new(0); - subretnum = FALSE; - fstr=walk(1,level-1,ops[node+2].ival,&numarg,P_MIN); - curargs = str_new(0); - str_sset(curargs,fstr); - str_cat(curargs,","); - tmp2str=walk(1,level,ops[node+5].ival,&numarg,P_MIN); - str_free(curargs); - curargs = Nullstr; - level--; - subretnum |= numarg; - s = Nullch; - t = tmp2str->str_ptr; - while (t = instr(t,"return ")) - s = t++; - if (s) { - i = 0; - for (t = s+7; *t; t++) { - if (*t == ';' || *t == '}') - i++; - } - if (i == 1) { - strcpy(s,s+7); - tmp2str->str_cur -= 7; - } - } - str_set(str,"\n"); - tab(str,level); - str_cat(str,"sub "); - str_scat(str,tmpstr=walk(1,level,ops[node+1].ival,&numarg,P_MIN)); - str_cat(str," {\n"); - tab(str,++level); - if (fstr->str_cur) { - str_cat(str,"local("); - str_scat(str,fstr); - str_cat(str,") = @_;"); - } - str_free(fstr); - str_scat(str,fstr=walk(1,level,ops[node+3].ival,&numarg,P_MIN)); - str_free(fstr); - fixtab(str,level); - str_scat(str,fstr=walk(1,level,ops[node+4].ival,&numarg,P_MIN)); - str_free(fstr); - fixtab(str,level); - str_scat(str,tmp2str); - str_free(tmp2str); - fixtab(str,--level); - str_cat(str,"}\n"); - tab(str,level); - str_scat(subs,str); - str_set(str,""); - str_cat(tmpstr,"("); - tmp2str = str_new(0); - if (subretnum) - str_set(tmp2str,"1"); - hstore(symtab,tmpstr->str_ptr,tmp2str); - str_free(tmpstr); - level++; - break; - case ORETURN: - str = str_new(0); - if (len > 0) { - str_cat(str,"return "); - str_scat(str,fstr=walk(1,level,ops[node+1].ival,&numarg,P_UNI+1)); - str_free(fstr); - if (numarg) - subretnum = TRUE; - } - else - str_cat(str,"return"); - break; - case OUSERFUN: - str = str_new(0); - str_set(str,"&"); - str_scat(str,fstr=walk(1,level,ops[node+1].ival,&numarg,P_MIN)); - str_free(fstr); - str_cat(str,"("); - tmpstr = hfetch(symtab,str->str_ptr+3); - if (tmpstr && tmpstr->str_ptr) - numeric |= atoi(tmpstr->str_ptr); - str_scat(str,fstr=walk(1,level,ops[node+2].ival,&numarg,P_MIN)); - str_free(fstr); - str_cat(str,")"); - break; - case OGSUB: - case OSUB: - if (type == OGSUB) - s = "g"; - else - s = ""; - str = str_new(0); - tmpstr = str_new(0); - i = 0; - if (len == 3) { - tmpstr = walk(1,level,ops[node+3].ival,&numarg,P_MATCH+1); - if (strNE(tmpstr->str_ptr,"$_")) { - str_cat(tmpstr, " =~ s"); - i++; - } - else - str_set(tmpstr, "s"); - } - else - str_set(tmpstr, "s"); - type = ops[ops[node+2].ival].ival; - len = type >> 8; - type &= 255; - tmp3str = str_new(0); - if (type == OSTR) { - tmp2str=walk(1,level,ops[ops[node+2].ival+1].ival,&numarg,P_MIN); - for (t = tmp2str->str_ptr, d=tokenbuf; *t; d++,t++) { - if (*t == '&') - *d++ = '$' + 128; - else if (*t == '$') - *d++ = '\\' + 128; - *d = *t + 128; - } - *d = '\0'; - str_set(tmp2str,tokenbuf); - } - else { - tmp2str=walk(1,level,ops[node+2].ival,&numarg,P_MIN); - str_set(tmp3str,"($s_ = '\"'.("); - str_scat(tmp3str,tmp2str); - str_cat(tmp3str,").'\"') =~ s/&/\\$&/g, "); - str_set(tmp2str,"eval $s_"); - s = (char*)(*s == 'g' ? "ge" : "e"); - i++; - } - type = ops[ops[node+1].ival].ival; - len = type >> 8; - type &= 255; - fstr=walk(1,level,ops[node+1].ival,&numarg,P_MIN); - if (type == OREGEX) { - if (useval && i) - str_cat(str,"("); - str_scat(str,tmp3str); - str_scat(str,tmpstr); - str_scat(str,fstr); - str_scat(str,tmp2str); - str_cat(str,"/"); - str_cat(str,s); - } - else if ((type == OFLD && !split_to_array) || (type == OVAR && len == 1)) { - if (useval && i) - str_cat(str,"("); - str_scat(str,tmp3str); - str_scat(str,tmpstr); - str_cat(str,"/"); - str_scat(str,fstr); - str_cat(str,"/"); - str_scat(str,tmp2str); - str_cat(str,"/"); - str_cat(str,s); - } - else { - i++; - if (useval) - str_cat(str,"("); - str_cat(str,"$s = "); - str_scat(str,fstr); - str_cat(str,", "); - str_scat(str,tmp3str); - str_scat(str,tmpstr); - str_cat(str,"/$s/"); - str_scat(str,tmp2str); - str_cat(str,"/"); - str_cat(str,s); - } - if (useval && i) - str_cat(str,")"); - str_free(fstr); - str_free(tmpstr); - str_free(tmp2str); - str_free(tmp3str); - numeric = 1; - break; - case ONUM: - str = walk(1,level,ops[node+1].ival,&numarg,P_MIN); - numeric = 1; - break; - case OSTR: - tmpstr = walk(1,level,ops[node+1].ival,&numarg,P_MIN); - s = "'"; - for (t = tmpstr->str_ptr, d=tokenbuf; *t; d++,t++) { - if (*t == '\'') - s = "\""; - else if (*t == '\\') { - s = "\""; - *d++ = *t++ + 128; - switch (*t) { - case '\\': case '"': case 'n': case 't': case '$': - break; - default: /* hide this from perl */ - *d++ = '\\' + 128; - } - } - *d = *t + 128; - } - *d = '\0'; - str = str_new(0); - str_set(str,s); - str_cat(str,tokenbuf); - str_free(tmpstr); - str_cat(str,s); - break; - case ODEFINED: - prec = P_UNI; - str = str_new(0); - str_set(str,"defined $"); - goto addvar; - case ODELETE: - str = str_new(0); - str_set(str,"delete $"); - goto addvar; - case OSTAR: - str = str_new(0); - str_set(str,"*"); - goto addvar; - case OVAR: - str = str_new(0); - str_set(str,"$"); - addvar: - str_scat(str,tmpstr=walk(1,level,ops[node+1].ival,&numarg,P_MIN)); - if (len == 1) { - tmp2str = hfetch(symtab,tmpstr->str_ptr); - if (tmp2str && atoi(tmp2str->str_ptr)) - numeric = 2; - if (strEQ(str->str_ptr,"$FNR")) { - numeric = 1; - saw_FNR++; - str_set(str,"($.-$FNRbase)"); - } - else if (strEQ(str->str_ptr,"$NR")) { - numeric = 1; - str_set(str,"$."); - } - else if (strEQ(str->str_ptr,"$NF")) { - numeric = 1; - str_set(str,"$#Fld"); - } - else if (strEQ(str->str_ptr,"$0")) - str_set(str,"$_"); - else if (strEQ(str->str_ptr,"$ARGC")) - str_set(str,"($#ARGV+1)"); - } - else { -#ifdef NOTDEF - if (curargs) { - sprintf(tokenbuf,"$%s,",tmpstr->str_ptr); - ??? if (instr(curargs->str_ptr,tokenbuf)) - str_cat(str,"\377"); /* can't translate yet */ - } -#endif - str_cat(tmpstr,"[]"); - tmp2str = hfetch(symtab,tmpstr->str_ptr); - if (tmp2str && atoi(tmp2str->str_ptr)) - str_cat(str,"["); - else - str_cat(str,"{"); - str_scat(str,fstr=walk(1,level,ops[node+2].ival,&numarg,P_MIN)); - str_free(fstr); - if (strEQ(str->str_ptr,"$ARGV[0")) { - str_set(str,"$ARGV0"); - saw_argv0++; - } - else { - if (tmp2str && atoi(tmp2str->str_ptr)) - strcpy(tokenbuf,"]"); - else - strcpy(tokenbuf,"}"); - *tokenbuf += 128; - str_cat(str,tokenbuf); - } - } - str_free(tmpstr); - break; - case OFLD: - str = str_new(0); - if (split_to_array) { - str_set(str,"$Fld"); - str_cat(str,"["); - str_scat(str,fstr=walk(1,level,ops[node+1].ival,&numarg,P_MIN)); - str_free(fstr); - str_cat(str,"]"); - } - else { - i = atoi(walk(1,level,ops[node+1].ival,&numarg,P_MIN)->str_ptr); - if (i <= arymax) - sprintf(tokenbuf,"$%s",nameary[i]); - else - sprintf(tokenbuf,"$Fld%d",i); - str_set(str,tokenbuf); - } - break; - case OVFLD: - str = str_new(0); - str_set(str,"$Fld["); - i = ops[node+1].ival; - if ((ops[i].ival & 255) == OPAREN) - i = ops[i+1].ival; - tmpstr=walk(1,level,i,&numarg,P_MIN); - str_scat(str,tmpstr); - str_free(tmpstr); - str_cat(str,"]"); - break; - case OJUNK: - goto def; - case OSNEWLINE: - str = str_new(2); - str_set(str,";\n"); - tab(str,level); - break; - case ONEWLINE: - str = str_new(1); - str_set(str,"\n"); - tab(str,level); - break; - case OSCOMMENT: - str = str_new(0); - str_set(str,";"); - tmpstr = walk(0,level,ops[node+1].ival,&numarg,P_MIN); - for (s = tmpstr->str_ptr; *s && *s != '\n'; s++) - *s += 128; - str_scat(str,tmpstr); - str_free(tmpstr); - tab(str,level); - break; - case OCOMMENT: - str = str_new(0); - tmpstr = walk(0,level,ops[node+1].ival,&numarg,P_MIN); - for (s = tmpstr->str_ptr; *s && *s != '\n'; s++) - *s += 128; - str_scat(str,tmpstr); - str_free(tmpstr); - tab(str,level); - break; - case OCOMMA: - prec = P_COMMA; - str = walk(1,level,ops[node+1].ival,&numarg,prec); - str_cat(str,", "); - str_scat(str,fstr=walk(1,level,ops[node+2].ival,&numarg,P_MIN)); - str_free(fstr); - str_scat(str,fstr=walk(1,level,ops[node+3].ival,&numarg,prec+1)); - str_free(fstr); - break; - case OSEMICOLON: - str = str_new(1); - str_set(str,";\n"); - tab(str,level); - break; - case OSTATES: - str = walk(0,level,ops[node+1].ival,&numarg,P_MIN); - str_scat(str,fstr=walk(0,level,ops[node+2].ival,&numarg,P_MIN)); - str_free(fstr); - break; - case OSTATE: - str = str_new(0); - if (len >= 1) { - str_scat(str,fstr=walk(0,level,ops[node+1].ival,&numarg,P_MIN)); - str_free(fstr); - if (len >= 2) { - tmpstr = walk(0,level,ops[node+2].ival,&numarg,P_MIN); - if (*tmpstr->str_ptr == ';') { - addsemi(str); - str_cat(str,tmpstr->str_ptr+1); - } - str_free(tmpstr); - } - } - break; - case OCLOSE: - str = str_make("close("); - tmpstr = walk(1,level,ops[node+1].ival,&numarg,P_MIN); - if (!do_fancy_opens) { - t = tmpstr->str_ptr; - if (*t == '"' || *t == '\'') - t = cpytill(tokenbuf,t+1,*t); - else - fatal("Internal error: OCLOSE %s",t); - s = savestr(tokenbuf); - for (t = tokenbuf; *t; t++) { - *t &= 127; - if (islower(*t)) - *t = toupper(*t); - if (!isalpha(*t) && !isdigit(*t)) - *t = '_'; - } - if (!strchr(tokenbuf,'_')) - strcpy(t,"_FH"); - str_free(tmpstr); - safefree(s); - str_set(str,"close "); - str_cat(str,tokenbuf); - } - else { - sprintf(tokenbuf,"delete $opened{%s} && close(%s)", - tmpstr->str_ptr, tmpstr->str_ptr); - str_free(tmpstr); - str_set(str,tokenbuf); - } - break; - case OPRINTF: - case OPRINT: - lparen = ""; /* set to parens if necessary */ - rparen = ""; - str = str_new(0); - if (len == 3) { /* output redirection */ - tmpstr = walk(1,level,ops[node+3].ival,&numarg,P_MIN); - tmp2str = walk(1,level,ops[node+2].ival,&numarg,P_MIN); - if (!do_fancy_opens) { - t = tmpstr->str_ptr; - if (*t == '"' || *t == '\'') - t = cpytill(tokenbuf,t+1,*t); - else - fatal("Internal error: OPRINT"); - d = savestr(t); - s = savestr(tokenbuf); - for (t = tokenbuf; *t; t++) { - *t &= 127; - if (islower(*t)) - *t = toupper(*t); - if (!isalpha(*t) && !isdigit(*t)) - *t = '_'; - } - if (!strchr(tokenbuf,'_')) - strcpy(t,"_FH"); - tmp3str = hfetch(symtab,tokenbuf); - if (!tmp3str) { - str_cat(opens,"open("); - str_cat(opens,tokenbuf); - str_cat(opens,", "); - d[1] = '\0'; - str_cat(opens,d); - str_scat(opens,tmp2str); - str_cat(opens,tmpstr->str_ptr+1); - if (*tmp2str->str_ptr == '|') - str_cat(opens,") || die 'Cannot pipe to \""); - else - str_cat(opens,") || die 'Cannot create file \""); - if (*d == '"') - str_cat(opens,"'.\""); - str_cat(opens,s); - if (*d == '"') - str_cat(opens,"\".'"); - str_cat(opens,"\".';\n"); - hstore(symtab,tokenbuf,str_make("x")); - } - str_free(tmpstr); - str_free(tmp2str); - safefree(s); - safefree(d); - } - else { - sprintf(tokenbuf,"&Pick('%s', %s) &&\n", - tmp2str->str_ptr, tmpstr->str_ptr); - str_cat(str,tokenbuf); - tab(str,level+1); - strcpy(tokenbuf,"$fh"); - str_free(tmpstr); - str_free(tmp2str); - lparen = "("; - rparen = ")"; - } - } - else - strcpy(tokenbuf,""); - str_cat(str,lparen); /* may be null */ - if (type == OPRINTF) - str_cat(str,"printf"); - else - str_cat(str,"print"); - saw_fh = 0; - if (len == 3 || do_fancy_opens) { - if (*tokenbuf) { - str_cat(str," "); - saw_fh = 1; - } - str_cat(str,tokenbuf); - } - tmpstr = walk(1+(type==OPRINT),level,ops[node+1].ival,&numarg,P_MIN); - if (!*tmpstr->str_ptr && lval_field) { - t = (char*)(saw_OFS ? "$," : "' '"); - if (split_to_array) { - sprintf(tokenbuf,"join(%s,@Fld)",t); - str_cat(tmpstr,tokenbuf); - } - else { - for (i = 1; i < maxfld; i++) { - if (i <= arymax) - sprintf(tokenbuf,"$%s, ",nameary[i]); - else - sprintf(tokenbuf,"$Fld%d, ",i); - str_cat(tmpstr,tokenbuf); - } - if (maxfld <= arymax) - sprintf(tokenbuf,"$%s",nameary[maxfld]); - else - sprintf(tokenbuf,"$Fld%d",maxfld); - str_cat(tmpstr,tokenbuf); - } - } - if (*tmpstr->str_ptr) { - str_cat(str," "); - if (!saw_fh && *tmpstr->str_ptr == '(') { - str_cat(str,"("); - str_scat(str,tmpstr); - str_cat(str,")"); - } - else - str_scat(str,tmpstr); - } - else { - str_cat(str," $_"); - } - str_cat(str,rparen); /* may be null */ - str_free(tmpstr); - break; - case ORAND: - str = str_make("rand(1)"); - break; - case OSRAND: - str = str_make("srand("); - goto maybe0; - case OATAN2: - str = str_make("atan2("); - goto maybe0; - case OSIN: - str = str_make("sin("); - goto maybe0; - case OCOS: - str = str_make("cos("); - goto maybe0; - case OSYSTEM: - str = str_make("system("); - goto maybe0; - case OLENGTH: - str = str_make("length("); - goto maybe0; - case OLOG: - str = str_make("log("); - goto maybe0; - case OEXP: - str = str_make("exp("); - goto maybe0; - case OSQRT: - str = str_make("sqrt("); - goto maybe0; - case OINT: - str = str_make("int("); - maybe0: - numeric = 1; - if (len > 0) - tmpstr = walk(1,level,ops[node+1].ival,&numarg,P_MIN); - else - tmpstr = str_new(0); - if (!tmpstr->str_ptr || !*tmpstr->str_ptr) { - if (lval_field) { - t = (char*)(saw_OFS ? "$," : "' '"); - if (split_to_array) { - sprintf(tokenbuf,"join(%s,@Fld)",t); - str_cat(tmpstr,tokenbuf); - } - else { - sprintf(tokenbuf,"join(%s, ",t); - str_cat(tmpstr,tokenbuf); - for (i = 1; i < maxfld; i++) { - if (i <= arymax) - sprintf(tokenbuf,"$%s,",nameary[i]); - else - sprintf(tokenbuf,"$Fld%d,",i); - str_cat(tmpstr,tokenbuf); - } - if (maxfld <= arymax) - sprintf(tokenbuf,"$%s)",nameary[maxfld]); - else - sprintf(tokenbuf,"$Fld%d)",maxfld); - str_cat(tmpstr,tokenbuf); - } - } - else - str_cat(tmpstr,"$_"); - } - if (strEQ(tmpstr->str_ptr,"$_")) { - if (type == OLENGTH && !do_chop) { - str = str_make("(length("); - str_cat(tmpstr,") - 1"); - } - } - str_scat(str,tmpstr); - str_free(tmpstr); - str_cat(str,")"); - break; - case OBREAK: - str = str_new(0); - str_set(str,"last"); - break; - case ONEXT: - str = str_new(0); - str_set(str,"next line"); - break; - case OEXIT: - str = str_new(0); - if (realexit) { - prec = P_UNI; - str_set(str,"exit"); - if (len == 1) { - str_cat(str," "); - exitval = TRUE; - str_scat(str, - fstr=walk(1,level,ops[node+1].ival,&numarg,prec+1)); - str_free(fstr); - } - } - else { - if (len == 1) { - str_set(str,"$ExitValue = "); - exitval = TRUE; - str_scat(str, - fstr=walk(1,level,ops[node+1].ival,&numarg,P_ASSIGN)); - str_free(fstr); - str_cat(str,"; "); - } - str_cat(str,"last line"); - } - break; - case OCONTINUE: - str = str_new(0); - str_set(str,"next"); - break; - case OREDIR: - goto def; - case OIF: - str = str_new(0); - str_set(str,"if ("); - str_scat(str,fstr=walk(1,level,ops[node+1].ival,&numarg,P_MIN)); - str_free(fstr); - str_cat(str,") "); - str_scat(str,fstr=walk(0,level,ops[node+2].ival,&numarg,P_MIN)); - str_free(fstr); - if (len == 3) { - i = ops[node+3].ival; - if (i) { - if ((ops[i].ival & 255) == OBLOCK) { - i = ops[i+1].ival; - if (i) { - if ((ops[i].ival & 255) != OIF) - i = 0; - } - } - else - i = 0; - } - if (i) { - str_cat(str,"els"); - str_scat(str,fstr=walk(0,level,i,&numarg,P_MIN)); - str_free(fstr); - } - else { - str_cat(str,"else "); - str_scat(str,fstr=walk(0,level,ops[node+3].ival,&numarg,P_MIN)); - str_free(fstr); - } - } - break; - case OWHILE: - str = str_new(0); - str_set(str,"while ("); - str_scat(str,fstr=walk(1,level,ops[node+1].ival,&numarg,P_MIN)); - str_free(fstr); - str_cat(str,") "); - str_scat(str,fstr=walk(0,level,ops[node+2].ival,&numarg,P_MIN)); - str_free(fstr); - break; - case ODO: - str = str_new(0); - str_set(str,"do "); - str_scat(str,fstr=walk(1,level,ops[node+1].ival,&numarg,P_MIN)); - str_free(fstr); - if (str->str_ptr[str->str_cur - 1] == '\n') - --str->str_cur; - str_cat(str," while ("); - str_scat(str,fstr=walk(0,level,ops[node+2].ival,&numarg,P_MIN)); - str_free(fstr); - str_cat(str,");"); - break; - case OFOR: - str = str_new(0); - str_set(str,"for ("); - str_scat(str,tmpstr=walk(1,level,ops[node+1].ival,&numarg,P_MIN)); - i = numarg; - if (i) { - t = s = tmpstr->str_ptr; - while (isalpha(*t) || isdigit(*t) || *t == '$' || *t == '_') - t++; - i = t - s; - if (i < 2) - i = 0; - } - str_cat(str,"; "); - fstr=walk(1,level,ops[node+2].ival,&numarg,P_MIN); - if (i && (t = strchr(fstr->str_ptr,0377))) { - if (strnEQ(fstr->str_ptr,s,i)) - *t = ' '; - } - str_scat(str,fstr); - str_free(fstr); - str_free(tmpstr); - str_cat(str,"; "); - str_scat(str,fstr=walk(1,level,ops[node+3].ival,&numarg,P_MIN)); - str_free(fstr); - str_cat(str,") "); - str_scat(str,fstr=walk(0,level,ops[node+4].ival,&numarg,P_MIN)); - str_free(fstr); - break; - case OFORIN: - tmpstr = walk(0,level,ops[node+1].ival,&numarg,P_MIN); - d = strchr(tmpstr->str_ptr,'$'); - if (!d) - fatal("Illegal for loop: %s",tmpstr->str_ptr); - s = strchr(d,'{'); - if (!s) - s = strchr(d,'['); - if (!s) - fatal("Illegal for loop: %s",d); - *s++ = '\0'; - for (t = s; i = *t; t++) { - i &= 127; - if (i == '}' || i == ']') - break; - } - if (*t) - *t = '\0'; - str = str_new(0); - str_set(str,d+1); - str_cat(str,"[]"); - tmp2str = hfetch(symtab,str->str_ptr); - if (tmp2str && atoi(tmp2str->str_ptr)) { - sprintf(tokenbuf, - "foreach %s ($[ .. $#%s) ", - s, - d+1); - } - else { - sprintf(tokenbuf, - "foreach %s (keys %%%s) ", - s, - d+1); - } - str_set(str,tokenbuf); - str_scat(str,fstr=walk(0,level,ops[node+2].ival,&numarg,P_MIN)); - str_free(fstr); - str_free(tmpstr); - break; - case OBLOCK: - str = str_new(0); - str_set(str,"{"); - if (len >= 2 && ops[node+2].ival) { - str_scat(str,fstr=walk(0,level,ops[node+2].ival,&numarg,P_MIN)); - str_free(fstr); - } - fixtab(str,++level); - str_scat(str,fstr=walk(0,level,ops[node+1].ival,&numarg,P_MIN)); - str_free(fstr); - addsemi(str); - fixtab(str,--level); - str_cat(str,"}\n"); - tab(str,level); - if (len >= 3) { - str_scat(str,fstr=walk(0,level,ops[node+3].ival,&numarg,P_MIN)); - str_free(fstr); - } - break; - default: - def: - if (len) { - if (len > 5) - fatal("Garbage length in walk"); - str = walk(0,level,ops[node+1].ival,&numarg,P_MIN); - for (i = 2; i<= len; i++) { - str_scat(str,fstr=walk(0,level,ops[node+i].ival,&numarg,P_MIN)); - str_free(fstr); - } - } - else { - str = Nullstr; - } - break; - } - if (!str) - str = str_new(0); - - if (useval && prec < minprec) { /* need parens? */ - fstr = str_new(str->str_cur+2); - str_nset(fstr,"(",1); - str_scat(fstr,str); - str_ncat(fstr,")",1); - str_free(str); - str = fstr; - } - - *numericptr = numeric; -#ifdef DEBUGGING - if (debug & 4) { - printf("%3d %5d %15s %d %4d ",level,node,opname[type],len,str->str_cur); - for (t = str->str_ptr; *t && t - str->str_ptr < 40; t++) - if (*t == '\n') - printf("\\n"); - else if (*t == '\t') - printf("\\t"); - else - putchar(*t); - putchar('\n'); - } -#endif - return str; -} - -static void -tab(register STR *str, register int lvl) -{ - while (lvl > 1) { - str_cat(str,"\t"); - lvl -= 2; - } - if (lvl) - str_cat(str," "); -} - -static void -fixtab(register STR *str, register int lvl) -{ - register char *s; - - /* strip trailing white space */ - - s = str->str_ptr+str->str_cur - 1; - while (s >= str->str_ptr && (*s == ' ' || *s == '\t' || *s == '\n')) - s--; - s[1] = '\0'; - str->str_cur = s + 1 - str->str_ptr; - if (s >= str->str_ptr && *s != '\n') - str_cat(str,"\n"); - - tab(str,lvl); -} - -static void -addsemi(register STR *str) -{ - register char *s; - - s = str->str_ptr+str->str_cur - 1; - while (s >= str->str_ptr && (*s == ' ' || *s == '\t' || *s == '\n')) - s--; - if (s >= str->str_ptr && *s != ';' && *s != '}') - str_cat(str,";"); -} - -static void -emit_split(register STR *str, int level) -{ - register int i; - - if (split_to_array) - str_cat(str,"@Fld"); - else { - str_cat(str,"("); - for (i = 1; i < maxfld; i++) { - if (i <= arymax) - sprintf(tokenbuf,"$%s,",nameary[i]); - else - sprintf(tokenbuf,"$Fld%d,",i); - str_cat(str,tokenbuf); - } - if (maxfld <= arymax) - sprintf(tokenbuf,"$%s)",nameary[maxfld]); - else - sprintf(tokenbuf,"$Fld%d)",maxfld); - str_cat(str,tokenbuf); - } - if (const_FS) { - sprintf(tokenbuf," = split(/[%c\\n]/, $_, 9999);\n",const_FS); - str_cat(str,tokenbuf); - } - else if (saw_FS) - str_cat(str," = split($FS, $_, 9999);\n"); - else - str_cat(str," = split(' ', $_, 9999);\n"); - tab(str,level); -} - -int -prewalk(int numit, int level, register int node, int *numericptr) -{ - register int len; - register int type; - register int i; - int numarg; - int numeric = FALSE; - STR *tmpstr; - STR *tmp2str; - - if (!node) { - *numericptr = 0; - return 0; - } - type = ops[node].ival; - len = type >> 8; - type &= 255; - switch (type) { - case OPROG: - prewalk(0,level,ops[node+1].ival,&numarg); - if (ops[node+2].ival) { - prewalk(0,level,ops[node+2].ival,&numarg); - } - ++level; - prewalk(0,level,ops[node+3].ival,&numarg); - --level; - if (ops[node+3].ival) { - prewalk(0,level,ops[node+4].ival,&numarg); - } - break; - case OHUNKS: - prewalk(0,level,ops[node+1].ival,&numarg); - prewalk(0,level,ops[node+2].ival,&numarg); - if (len == 3) { - prewalk(0,level,ops[node+3].ival,&numarg); - } - break; - case ORANGE: - prewalk(1,level,ops[node+1].ival,&numarg); - prewalk(1,level,ops[node+2].ival,&numarg); - break; - case OPAT: - goto def; - case OREGEX: - prewalk(0,level,ops[node+1].ival,&numarg); - break; - case OHUNK: - if (len == 1) { - prewalk(0,level,ops[node+1].ival,&numarg); - } - else { - i = prewalk(0,level,ops[node+1].ival,&numarg); - if (i) { - ++level; - prewalk(0,level,ops[node+2].ival,&numarg); - --level; - } - else { - prewalk(0,level,ops[node+2].ival,&numarg); - } - } - break; - case OPPAREN: - prewalk(0,level,ops[node+1].ival,&numarg); - break; - case OPANDAND: - prewalk(0,level,ops[node+1].ival,&numarg); - prewalk(0,level,ops[node+2].ival,&numarg); - break; - case OPOROR: - prewalk(0,level,ops[node+1].ival,&numarg); - prewalk(0,level,ops[node+2].ival,&numarg); - break; - case OPNOT: - prewalk(0,level,ops[node+1].ival,&numarg); - break; - case OCPAREN: - prewalk(0,level,ops[node+1].ival,&numarg); - numeric |= numarg; - break; - case OCANDAND: - prewalk(0,level,ops[node+1].ival,&numarg); - numeric = 1; - prewalk(0,level,ops[node+2].ival,&numarg); - break; - case OCOROR: - prewalk(0,level,ops[node+1].ival,&numarg); - numeric = 1; - prewalk(0,level,ops[node+2].ival,&numarg); - break; - case OCNOT: - prewalk(0,level,ops[node+1].ival,&numarg); - numeric = 1; - break; - case ORELOP: - prewalk(0,level,ops[node+2].ival,&numarg); - numeric |= numarg; - prewalk(0,level,ops[node+1].ival,&numarg); - prewalk(0,level,ops[node+3].ival,&numarg); - numeric |= numarg; - numeric = 1; - break; - case ORPAREN: - prewalk(0,level,ops[node+1].ival,&numarg); - numeric |= numarg; - break; - case OMATCHOP: - prewalk(0,level,ops[node+2].ival,&numarg); - prewalk(0,level,ops[node+1].ival,&numarg); - prewalk(0,level,ops[node+3].ival,&numarg); - numeric = 1; - break; - case OMPAREN: - prewalk(0,level,ops[node+1].ival,&numarg); - numeric |= numarg; - break; - case OCONCAT: - prewalk(0,level,ops[node+1].ival,&numarg); - prewalk(0,level,ops[node+2].ival,&numarg); - break; - case OASSIGN: - prewalk(0,level,ops[node+2].ival,&numarg); - prewalk(0,level,ops[node+1].ival,&numarg); - prewalk(0,level,ops[node+3].ival,&numarg); - if (numarg || strlen(ops[ops[node+1].ival+1].cval) > (Size_t)1) { - numericize(ops[node+2].ival); - if (!numarg) - numericize(ops[node+3].ival); - } - numeric |= numarg; - break; - case OADD: - prewalk(1,level,ops[node+1].ival,&numarg); - prewalk(1,level,ops[node+2].ival,&numarg); - numeric = 1; - break; - case OSUBTRACT: - prewalk(1,level,ops[node+1].ival,&numarg); - prewalk(1,level,ops[node+2].ival,&numarg); - numeric = 1; - break; - case OMULT: - prewalk(1,level,ops[node+1].ival,&numarg); - prewalk(1,level,ops[node+2].ival,&numarg); - numeric = 1; - break; - case ODIV: - prewalk(1,level,ops[node+1].ival,&numarg); - prewalk(1,level,ops[node+2].ival,&numarg); - numeric = 1; - break; - case OPOW: - prewalk(1,level,ops[node+1].ival,&numarg); - prewalk(1,level,ops[node+2].ival,&numarg); - numeric = 1; - break; - case OMOD: - prewalk(1,level,ops[node+1].ival,&numarg); - prewalk(1,level,ops[node+2].ival,&numarg); - numeric = 1; - break; - case OPOSTINCR: - prewalk(1,level,ops[node+1].ival,&numarg); - numeric = 1; - break; - case OPOSTDECR: - prewalk(1,level,ops[node+1].ival,&numarg); - numeric = 1; - break; - case OPREINCR: - prewalk(1,level,ops[node+1].ival,&numarg); - numeric = 1; - break; - case OPREDECR: - prewalk(1,level,ops[node+1].ival,&numarg); - numeric = 1; - break; - case OUMINUS: - prewalk(1,level,ops[node+1].ival,&numarg); - numeric = 1; - break; - case OUPLUS: - prewalk(1,level,ops[node+1].ival,&numarg); - numeric = 1; - break; - case OPAREN: - prewalk(0,level,ops[node+1].ival,&numarg); - numeric |= numarg; - break; - case OGETLINE: - break; - case OSPRINTF: - prewalk(0,level,ops[node+1].ival,&numarg); - break; - case OSUBSTR: - prewalk(0,level,ops[node+1].ival,&numarg); - prewalk(1,level,ops[node+2].ival,&numarg); - if (len == 3) { - prewalk(1,level,ops[node+3].ival,&numarg); - } - break; - case OSTRING: - break; - case OSPLIT: - numeric = 1; - prewalk(0,level,ops[node+2].ival,&numarg); - if (len == 3) - prewalk(0,level,ops[node+3].ival,&numarg); - prewalk(0,level,ops[node+1].ival,&numarg); - break; - case OINDEX: - prewalk(0,level,ops[node+1].ival,&numarg); - prewalk(0,level,ops[node+2].ival,&numarg); - numeric = 1; - break; - case OMATCH: - prewalk(0,level,ops[node+1].ival,&numarg); - prewalk(0,level,ops[node+2].ival,&numarg); - numeric = 1; - break; - case OUSERDEF: - subretnum = FALSE; - --level; - tmpstr = walk(0,level,ops[node+1].ival,&numarg,P_MIN); - ++level; - prewalk(0,level,ops[node+2].ival,&numarg); - prewalk(0,level,ops[node+4].ival,&numarg); - prewalk(0,level,ops[node+5].ival,&numarg); - --level; - str_cat(tmpstr,"("); - tmp2str = str_new(0); - if (subretnum || numarg) - str_set(tmp2str,"1"); - hstore(symtab,tmpstr->str_ptr,tmp2str); - str_free(tmpstr); - level++; - break; - case ORETURN: - if (len > 0) { - prewalk(0,level,ops[node+1].ival,&numarg); - if (numarg) - subretnum = TRUE; - } - break; - case OUSERFUN: - tmp2str = str_new(0); - str_scat(tmp2str,tmpstr=walk(1,level,ops[node+1].ival,&numarg,P_MIN)); - fixrargs(tmpstr->str_ptr,ops[node+2].ival,0); - str_free(tmpstr); - str_cat(tmp2str,"("); - tmpstr = hfetch(symtab,tmp2str->str_ptr); - if (tmpstr && tmpstr->str_ptr) - numeric |= atoi(tmpstr->str_ptr); - prewalk(0,level,ops[node+2].ival,&numarg); - str_free(tmp2str); - break; - case OGSUB: - case OSUB: - if (len >= 3) - prewalk(0,level,ops[node+3].ival,&numarg); - prewalk(0,level,ops[ops[node+2].ival+1].ival,&numarg); - prewalk(0,level,ops[node+1].ival,&numarg); - numeric = 1; - break; - case ONUM: - prewalk(0,level,ops[node+1].ival,&numarg); - numeric = 1; - break; - case OSTR: - prewalk(0,level,ops[node+1].ival,&numarg); - break; - case ODEFINED: - case ODELETE: - case OSTAR: - case OVAR: - prewalk(0,level,ops[node+1].ival,&numarg); - if (len == 1) { - if (numit) - numericize(node); - } - else { - prewalk(0,level,ops[node+2].ival,&numarg); - } - break; - case OFLD: - prewalk(0,level,ops[node+1].ival,&numarg); - break; - case OVFLD: - i = ops[node+1].ival; - prewalk(0,level,i,&numarg); - break; - case OJUNK: - goto def; - case OSNEWLINE: - break; - case ONEWLINE: - break; - case OSCOMMENT: - break; - case OCOMMENT: - break; - case OCOMMA: - prewalk(0,level,ops[node+1].ival,&numarg); - prewalk(0,level,ops[node+2].ival,&numarg); - prewalk(0,level,ops[node+3].ival,&numarg); - break; - case OSEMICOLON: - break; - case OSTATES: - prewalk(0,level,ops[node+1].ival,&numarg); - prewalk(0,level,ops[node+2].ival,&numarg); - break; - case OSTATE: - if (len >= 1) { - prewalk(0,level,ops[node+1].ival,&numarg); - if (len >= 2) { - prewalk(0,level,ops[node+2].ival,&numarg); - } - } - break; - case OCLOSE: - prewalk(0,level,ops[node+1].ival,&numarg); - break; - case OPRINTF: - case OPRINT: - if (len == 3) { /* output redirection */ - prewalk(0,level,ops[node+3].ival,&numarg); - prewalk(0,level,ops[node+2].ival,&numarg); - } - prewalk(0+(type==OPRINT),level,ops[node+1].ival,&numarg); - break; - case ORAND: - break; - case OSRAND: - goto maybe0; - case OATAN2: - goto maybe0; - case OSIN: - goto maybe0; - case OCOS: - goto maybe0; - case OSYSTEM: - goto maybe0; - case OLENGTH: - goto maybe0; - case OLOG: - goto maybe0; - case OEXP: - goto maybe0; - case OSQRT: - goto maybe0; - case OINT: - maybe0: - numeric = 1; - if (len > 0) - prewalk(type != OLENGTH && type != OSYSTEM, - level,ops[node+1].ival,&numarg); - break; - case OBREAK: - break; - case ONEXT: - break; - case OEXIT: - if (len == 1) { - prewalk(1,level,ops[node+1].ival,&numarg); - } - break; - case OCONTINUE: - break; - case OREDIR: - goto def; - case OIF: - prewalk(0,level,ops[node+1].ival,&numarg); - prewalk(0,level,ops[node+2].ival,&numarg); - if (len == 3) { - prewalk(0,level,ops[node+3].ival,&numarg); - } - break; - case OWHILE: - prewalk(0,level,ops[node+1].ival,&numarg); - prewalk(0,level,ops[node+2].ival,&numarg); - break; - case OFOR: - prewalk(0,level,ops[node+1].ival,&numarg); - prewalk(0,level,ops[node+2].ival,&numarg); - prewalk(0,level,ops[node+3].ival,&numarg); - prewalk(0,level,ops[node+4].ival,&numarg); - break; - case OFORIN: - prewalk(0,level,ops[node+2].ival,&numarg); - prewalk(0,level,ops[node+1].ival,&numarg); - break; - case OBLOCK: - if (len == 2) { - prewalk(0,level,ops[node+2].ival,&numarg); - } - ++level; - prewalk(0,level,ops[node+1].ival,&numarg); - --level; - break; - default: - def: - if (len) { - if (len > 5) - fatal("Garbage length in prewalk"); - prewalk(0,level,ops[node+1].ival,&numarg); - for (i = 2; i<= len; i++) { - prewalk(0,level,ops[node+i].ival,&numarg); - } - } - break; - } - *numericptr = numeric; - return 1; -} - -static void -numericize(register int node) -{ - register int len; - register int type; - STR *tmpstr; - STR *tmp2str; - int numarg; - - type = ops[node].ival; - len = type >> 8; - type &= 255; - if (type == OVAR && len == 1) { - tmpstr=walk(0,0,ops[node+1].ival,&numarg,P_MIN); - tmp2str = str_make("1"); - hstore(symtab,tmpstr->str_ptr,tmp2str); - } -} |