summaryrefslogtreecommitdiff
path: root/x2p
diff options
context:
space:
mode:
authorLarry Wall <lwall@netlabs.com>1995-03-12 22:32:14 -0800
committerLarry Wall <lwall@netlabs.com>1995-03-12 22:32:14 -0800
commit748a93069b3d16374a9859d1456065dd3ae11394 (patch)
tree308ca14de9933a313dceacce8be77db67d9368c7 /x2p
parentfec02dd38faf8f83471b031857d89cb76fea1ca0 (diff)
downloadperl-748a93069b3d16374a9859d1456065dd3ae11394.tar.gz
Perl 5.001perl-5.001
[See the Changes file for a list of changes]
Diffstat (limited to 'x2p')
-rwxr-xr-xx2p/Makefile.SH3
-rw-r--r--x2p/a2p.c56
-rw-r--r--x2p/a2py.c22
-rw-r--r--x2p/walk.c14
4 files changed, 60 insertions, 35 deletions
diff --git a/x2p/Makefile.SH b/x2p/Makefile.SH
index 52a44b5b59..393a335e0b 100755
--- a/x2p/Makefile.SH
+++ b/x2p/Makefile.SH
@@ -112,7 +112,7 @@ a2p.o: a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h handy.h ../config.h str.h has
$(CCCMD) $(LARGE) a2p.c
clean:
- rm -f a2p *.o
+ rm -f a2p *.o
realclean: clean
rm -f *.orig core $(addedbyconf) all malloc.c
@@ -139,6 +139,7 @@ shlist:
echo $(sh) | tr ' ' '\012' >.shlist
malloc.c: ../malloc.c
+ rm -f malloc.c
sed <../malloc.c >malloc.c \
-e 's/"perl.h"/"..\/perl.h"/' \
-e 's/my_exit/exit/'
diff --git a/x2p/a2p.c b/x2p/a2p.c
index 35948e21e7..c6d21e3e4d 100644
--- a/x2p/a2p.c
+++ b/x2p/a2p.c
@@ -1,13 +1,7 @@
#ifndef lint
-static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93";
+static char yysccsid[] = "@(#)yaccpar 1.8 (Berkeley) 01/20/91";
#endif
#define YYBYACC 1
-#define YYMAJOR 1
-#define YYMINOR 9
-#define yyclearin (yychar=(-1))
-#define yyerrok (yyerrflag=0)
-#define YYRECOVERING (yyerrflag!=0)
-#define YYPREFIX "yy"
#line 2 "a2p.y"
/* $RCSfile: a2p.y,v $$Revision: 4.1 $$Date: 92/08/07 18:29:12 $
*
@@ -26,7 +20,7 @@ int root;
int begins = Nullop;
int ends = Nullop;
-#line 30 "y.tab.c"
+#line 24 "y.tab.c"
#define BEGIN 257
#define END 258
#define REGEX 259
@@ -1920,9 +1914,12 @@ char *yyrule[] = {
#ifndef YYSTYPE
typedef int YYSTYPE;
#endif
+#define yyclearin (yychar=(-1))
+#define yyerrok (yyerrflag=0)
#ifdef YYSTACKSIZE
-#undef YYMAXDEPTH
+#ifndef YYMAXDEPTH
#define YYMAXDEPTH YYSTACKSIZE
+#endif
#else
#ifdef YYMAXDEPTH
#define YYSTACKSIZE YYMAXDEPTH
@@ -1944,9 +1941,8 @@ YYSTYPE yyvs[YYSTACKSIZE];
#define yystacksize YYSTACKSIZE
#line 396 "a2p.y"
#include "a2py.c"
-#line 1948 "y.tab.c"
+#line 1945 "y.tab.c"
#define YYABORT goto yyabort
-#define YYREJECT goto yyabort
#define YYACCEPT goto yyaccept
#define YYERROR goto yyerrlab
int
@@ -1984,8 +1980,8 @@ yyloop:
yys = 0;
if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
if (!yys) yys = "illegal-symbol";
- printf("%sdebug: state %d, reading %d (%s)\n",
- YYPREFIX, yystate, yychar, yys);
+ printf("yydebug: state %d, reading %d (%s)\n", yystate,
+ yychar, yys);
}
#endif
}
@@ -1994,8 +1990,8 @@ yyloop:
{
#if YYDEBUG
if (yydebug)
- printf("%sdebug: state %d, shifting to state %d\n",
- YYPREFIX, yystate, yytable[yyn]);
+ printf("yydebug: state %d, shifting to state %d\n",
+ yystate, yytable[yyn]);
#endif
if (yyssp >= yyss + yystacksize - 1)
{
@@ -2035,8 +2031,8 @@ yyinrecovery:
{
#if YYDEBUG
if (yydebug)
- printf("%sdebug: state %d, error recovery shifting\
- to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);
+ printf("yydebug: state %d, error recovery shifting\
+ to state %d\n", *yyssp, yytable[yyn]);
#endif
if (yyssp >= yyss + yystacksize - 1)
{
@@ -2050,8 +2046,8 @@ yyinrecovery:
{
#if YYDEBUG
if (yydebug)
- printf("%sdebug: error recovery discarding state %d\n",
- YYPREFIX, *yyssp);
+ printf("yydebug: error recovery discarding state %d\n",
+ *yyssp);
#endif
if (yyssp <= yyss) goto yyabort;
--yyssp;
@@ -2068,8 +2064,8 @@ yyinrecovery:
yys = 0;
if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
if (!yys) yys = "illegal-symbol";
- printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
- YYPREFIX, yystate, yychar, yys);
+ printf("yydebug: state %d, error recovery discards token %d (%s)\n",
+ yystate, yychar, yys);
}
#endif
yychar = (-1);
@@ -2078,8 +2074,8 @@ yyinrecovery:
yyreduce:
#if YYDEBUG
if (yydebug)
- printf("%sdebug: state %d, reducing by rule %d (%s)\n",
- YYPREFIX, yystate, yyn, yyrule[yyn]);
+ printf("yydebug: state %d, reducing by rule %d (%s)\n",
+ yystate, yyn, yyrule[yyn]);
#endif
yym = yylen[yyn];
yyval = yyvsp[1-yym];
@@ -2611,7 +2607,7 @@ case 137:
#line 392 "a2p.y"
{ yyval = oper3(OBLOCK,oper2(OJUNK,yyvsp[-3],yyvsp[-2]),Nullop,yyvsp[0]); }
break;
-#line 2615 "y.tab.c"
+#line 2611 "y.tab.c"
}
yyssp -= yym;
yystate = *yyssp;
@@ -2621,8 +2617,8 @@ break;
{
#if YYDEBUG
if (yydebug)
- printf("%sdebug: after reduction, shifting from state 0 to\
- state %d\n", YYPREFIX, YYFINAL);
+ printf("yydebug: after reduction, shifting from state 0 to\
+ state %d\n", YYFINAL);
#endif
yystate = YYFINAL;
*++yyssp = YYFINAL;
@@ -2636,8 +2632,8 @@ break;
yys = 0;
if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
if (!yys) yys = "illegal-symbol";
- printf("%sdebug: state %d, reading %d (%s)\n",
- YYPREFIX, YYFINAL, yychar, yys);
+ printf("yydebug: state %d, reading %d (%s)\n",
+ YYFINAL, yychar, yys);
}
#endif
}
@@ -2651,8 +2647,8 @@ break;
yystate = yydgoto[yym];
#if YYDEBUG
if (yydebug)
- printf("%sdebug: after reduction, shifting from state %d \
-to state %d\n", YYPREFIX, *yyssp, yystate);
+ printf("yydebug: after reduction, shifting from state %d \
+to state %d\n", *yyssp, yystate);
#endif
if (yyssp >= yyss + yystacksize - 1)
{
diff --git a/x2p/a2py.c b/x2p/a2py.c
index c08b06a723..54bdce0aad 100644
--- a/x2p/a2py.c
+++ b/x2p/a2py.c
@@ -17,6 +17,13 @@ char *filename;
char *myname;
int checkers = 0;
+
+int oper0();
+int oper1();
+int oper2();
+int oper3();
+int oper4();
+int oper5();
STR *walk();
#ifdef OS2
@@ -187,6 +194,7 @@ register char **env;
int idtype;
+int
yylex()
{
register char *s = bufptr;
@@ -871,8 +879,10 @@ register char *s;
return s;
}
+int
string(ptr,len)
char *ptr;
+int len;
{
int retval = mop;
@@ -887,6 +897,7 @@ char *ptr;
return retval;
}
+int
oper0(type)
int type;
{
@@ -900,6 +911,7 @@ int type;
return retval;
}
+int
oper1(type,arg1)
int type;
int arg1;
@@ -915,6 +927,7 @@ int arg1;
return retval;
}
+int
oper2(type,arg1,arg2)
int type;
int arg1;
@@ -932,6 +945,7 @@ int arg2;
return retval;
}
+int
oper3(type,arg1,arg2,arg3)
int type;
int arg1;
@@ -951,6 +965,7 @@ int arg3;
return retval;
}
+int
oper4(type,arg1,arg2,arg3,arg4)
int type;
int arg1;
@@ -972,6 +987,7 @@ int arg4;
return retval;
}
+int
oper5(type,arg1,arg2,arg3,arg4,arg5)
int type;
int arg1;
@@ -1025,6 +1041,7 @@ int branch;
}
}
+int
bl(arg,maybe)
int arg;
int maybe;
@@ -1165,6 +1182,7 @@ putone()
fputs(tokenbuf,stdout);
}
+int
numary(arg)
int arg;
{
@@ -1179,6 +1197,7 @@ int arg;
return arg;
}
+int
rememberargs(arg)
int arg;
{
@@ -1201,6 +1220,7 @@ int arg;
return arg;
}
+int
aryrefarg(arg)
int arg;
{
@@ -1215,6 +1235,7 @@ int arg;
return arg;
}
+int
fixfargs(name,arg,prevargs)
int name;
int arg;
@@ -1253,6 +1274,7 @@ int prevargs;
return numargs;
}
+int
fixrargs(name,arg,prevargs)
char *name;
int arg;
diff --git a/x2p/walk.c b/x2p/walk.c
index 0d651988fb..6f425a4845 100644
--- a/x2p/walk.c
+++ b/x2p/walk.c
@@ -12,6 +12,12 @@
#include "a2p.h"
#include "util.h"
+static void tab();
+static void fixtab();
+static void addsemi();
+static void emit_split();
+static void numericize();
+
bool exitval = FALSE;
bool realexit = FALSE;
bool saw_getline = FALSE;
@@ -1554,7 +1560,7 @@ sub Pick {\n\
return str;
}
-void
+static void
tab(str,lvl)
register STR *str;
register int lvl;
@@ -1567,7 +1573,7 @@ register int lvl;
str_cat(str," ");
}
-void
+static void
fixtab(str,lvl)
register STR *str;
register int lvl;
@@ -1587,7 +1593,7 @@ register int lvl;
tab(str,lvl);
}
-void
+static void
addsemi(str)
register STR *str;
{
@@ -2056,7 +2062,7 @@ int *numericptr;
return 1;
}
-void
+static void
numericize(node)
register int node;
{