[kaffe] CVS kaffe-extras (kaz): kaffe-extras/patches/kjc-parser-ClassnameDotThis.diff:

Kaffe CVS Kaffe Mailing List <kaffe@kaffe.org>
Tue Dec 23 06:58:03 2003


PatchSet 23 
Date: 2003/12/23 14:57:47
Author: kaz
Branch: HEAD
Tag: (none) 
Log:
kaffe-extras/patches/kjc-parser-ClassnameDotThis.diff:
allow ClassName.this.super() for jExplicitConstructorInvocation[].

Members: 
	build.xml:1.12->1.13 
	patches/kjc-parser-ClassnameDotThis.diff:INITIAL->1.1 

Index: kaffe-extras/build.xml
diff -u kaffe-extras/build.xml:1.12 kaffe-extras/build.xml:1.13
--- kaffe-extras/build.xml:1.12	Tue Nov 25 22:45:49 2003
+++ kaffe-extras/build.xml	Tue Dec 23 14:57:47 2003
@@ -257,6 +257,9 @@
 	<patch patchfile="${patches_dir}/kjc-string-concat-to-null.diff"
 		strip="1"
 		dir="${kjcsuite_dir}"/>
+	<patch patchfile="${patches_dir}/kjc-parser-ClassnameDotThis.diff"
+		strip="1"
+		dir="${kjcsuite_dir}"/>
 	<touch file="${kjcsuite_unpacked_stamp}"/>
   </target>
 
===================================================================
Checking out kaffe-extras/patches/kjc-parser-ClassnameDotThis.diff
RCS:  /home/cvs/kaffe/kaffe-extras/patches/kjc-parser-ClassnameDotThis.diff,v
VERS: 1.1
***************
--- /dev/null	Sun Aug  4 19:57:58 2002
+++ kaffe-extras/patches/kjc-parser-ClassnameDotThis.diff	Tue Dec 23 14:57:49 2003
@@ -0,0 +1,54 @@
+--- kopi-2.1B/src/kjc/Kjc.g.orig	Tue Jul 16 03:53:32 2002
++++ kopi-2.1B/src/kjc/Kjc.g	Tue Dec 23 23:29:32 2003
+@@ -604,7 +604,7 @@
+     ( ( "this" |  "super") LPAREN ) =>
+     constructorCall = jExplicitConstructorInvocation[]
+   |
+-    (jPrimaryExpression[] DOT "super" LPAREN) =>
++    (jPrimaryExpression2[] DOT "super" LPAREN) =>
+     constructorCall = jExplicitConstructorInvocation[]
+   |
+     // nothing
+@@ -704,7 +704,7 @@
+      ("super") => "super"
+       { functorIsThis = false; }
+   |
+-    ( expr = jPrimaryExpression[] )? DOT "super"
++    ( expr = jPrimaryExpression2[] )? DOT "super"
+       { functorIsThis = false; }
+   )
+   LPAREN args = jArgList[] RPAREN
+@@ -1965,6 +1965,33 @@
+   ( LBRACK RBRACK { bounds++; } )*
+   DOT "class"
+     { self = new JClassExpression(buildTokenReference(), type, bounds); }
++;
++
++// the basic element of an expression used for jExplicitConstructorInvocation[]
++// jExplicitConstructorInvocation[] needs ClassName.this.super(),
++// but including this rule in jPrimaryExpression[] may considerably worsen
++// the performance. So another jPrimaryExpression[] is here.
++jPrimaryExpression2 []
++  returns [JExpression self = null]
++{
++  TokenReference	sourceRef = buildTokenReference();
++}
++:
++  (IDENT (DOT IDENT)* DOT "this") =>
++  (
++    ident1 : IDENT
++      { self = new JNameExpression(sourceRef, ident1.getText()); }
++    (
++      DOT
++      ident2 : IDENT
++        { self = new JNameExpression(sourceRef, self, ident2.getText()); }
++    )*
++    DOT
++    "this"
++      { self = new JThisExpression(sourceRef, self); }
++  )
++|
++  self = jPrimaryExpression[]
+ ;
+ 
+ jUnqualifiedNewExpression []