On 03/04/2013 02:26 PM, John Goodyear wrote:
 >
 > On 03/04/2013 12:40 PM, John Goodyear wrote:
 > >
 > >  > On 03/04/2013 11:35 AM, John Goodyear wrote:
 > >  > >
 > >  > >  > I tried to say in an earlier email that the make after the
 > > miniperl gets
 > >  > >  > linked is likely to fail spectacularly.  Instead of continuing
 > > the make
 > >  > >  > at this point, use the already-linked miniperl and do the Hello
 > > world
 > >  > > test:
 > >  > >  >
 > >  > >  > ./miniperl -le 'print "Hello World"'
 > >  > >  >
 > >  > >
 > >  > > This too, fails with ~643K lines of
 > >  > >
 > >  > >     Semicolon seems to be missing
 > >  > >
 > >  > > And then finally
 > >  > >
 > >  > >     Out of memory!
 > >  > >
 > >  >
 > >  >
 > >  > What happens if you add a semi-colon?
 > >  >
 > >  > ./miniperl -le 'print "Hello World";'
 > >  >
 > >
 > > No change.
 > >
 >
 > That's unfortunate. Take the attached file and replace the one on your
 > system with it, and run make again, and see what happens.
 > [attachment "l1_char_class_tab.h" deleted by John
Goodyear/Gaithersburg/IBM]

I addition to substituting the l1_char_class_tab.h that you provided, I
put a print statement into perly.c to display the yylex() return value

After that, I deleted miniperl and all of the object files and rebuilt
miniperl.

miniperl now terminates in a more reasonable manner...



/u/jgood/perlsrc/perl-3a3d7b8 >./miniperl -le 'print "Hello World"' >
output 2>&1
/u/jgood/perlsrc/perl-3a3d7b8 >cat output
syntax error at -e line 1, at EOF
Execution of -e aborted due to compilation errors.
JCG: yylex returns 301: 'ýè'
JCG: yylex returns 267: 'ðê'
JCG: yylex returns 94: ';'
JCG: yylex returns 0: ''


/u/jgood/perlsrc/perl-3a3d7b8 >./miniperl -le 'print "Hello World";' >
output 2>&1
/u/jgood/perlsrc/perl-3a3d7b8 >cat output
syntax error at -e line 1, near ""Hello World";"
Execution of -e aborted due to compilation errors.
JCG: yylex returns 301: 'ýè'
JCG: yylex returns 267: 'ðê'
JCG: yylex returns 94: ';'
JCG: yylex returns 94: ';'
JCG: yylex returns 0: ''


FYI:  Before replacing l1_char_class_tab.h,  this is the character that
was almost always output from my trace:

    JCG: yylex returns 264: 'ðñ'    ('ðñ' is represented as '\214\111'
    when the output is run through more)


I had another idea after I sent this. When I was going through and cleaning up EBCDIC handling, some things seemed so off-the-wall wrong that I wasn't sure if I just misunderstood, or if things had gotten so very far out-of-sync in the many years since we've tried EBCDIC. One of those places involved perly.y. Attached is a patch to try that reinstates what I removed. I presumed that the table that drives this would be recomputed in native character set terms. But I may be very wrong, not understanding this area of the code at all. Hopefully, I was wrong, and this will work.
>From ef3470822f27436a5919b55baa64e3c4d51a2ef5 Mon Sep 17 00:00:00 2001
From: Karl Williamson <[email protected]>
Date: Mon, 4 Mar 2013 19:16:31 -0700
Subject: [PATCH 88/88] XXX: perly.c: Reinstate some ebcdic code

This is an experiment to see if this fixes things
---
 perly.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/perly.c b/perly.c
index 5b2de73..d17f19b 100644
--- a/perly.c
+++ b/perly.c
@@ -340,6 +340,12 @@ Perl_yyparse (pTHX_ int gramtype)
 #else
 	parser->yychar = yylex();
 #endif
+
+#  ifdef EBCDIC
+	if (parser->yychar >= 0 && parser->yychar < 255) {
+	    parser->yychar = NATIVE_TO_ASCII(parser->yychar);
+	}
+#  endif
     }
 
     if (parser->yychar <= YYEOF) {
-- 
1.8.1.3

Reply via email to