Update of /cvsroot/nice/Nice/src/gnu/expr
In directory sc8-pr-cvs1:/tmp/cvs-serv26684/src/gnu/expr
Modified Files:
InitializeProc.java ConstructorExp.java
Log Message:
Classes now have default constructors build upon their parent's custom
constructors.
Index: InitializeProc.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/gnu/expr/InitializeProc.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** InitializeProc.java 15 Dec 2003 16:19:47 -0000 1.3
--- InitializeProc.java 22 Dec 2003 01:30:59 -0000 1.4
***************
*** 90,98 ****
// Add dummy arguments to match the bytecode constructor.
- if (method !=null)
- dummyArgs = method.dummyArgs;
if (method != null)
! for (int i = 0; i < dummyArgs; i++)
! code.emitPushInt(0);
code.emitInvokeSpecial(constructor);
--- 90,97 ----
// Add dummy arguments to match the bytecode constructor.
if (method != null)
! dummyArgs = method.dummyArgs;
! for (int i = 0; i < dummyArgs; i++)
! code.emitPushInt(0);
code.emitInvokeSpecial(constructor);
***************
*** 102,105 ****
--- 101,116 ----
{
return Type.void_type;
+ }
+
+ public String toString()
+ {
+ String res;
+ if (constructor != null)
+ res = constructor.toString();
+ else if (method != null)
+ res = method.toString();
+ else
+ res = "?";
+ return "Initialization: " + res;
}
Index: ConstructorExp.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/gnu/expr/ConstructorExp.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ConstructorExp.java 15 Dec 2003 02:40:16 -0000 1.6
--- ConstructorExp.java 22 Dec 2003 01:30:59 -0000 1.7
***************
*** 70,85 ****
// Make sure the signature is unique
! if (! primary)
{
! do
! {
! Type[] newArgs = new Type[args.length + 1];
! System.arraycopy(args, 0, newArgs, 0, args.length);
! newArgs[args.length] = Type.int_type;
! args = newArgs;
! dummyArgs++;
! addDeclaration("dummy");
! }
! while (ctype.getDeclaredMethod("<init>", args) != null);
}
--- 70,81 ----
// Make sure the signature is unique
! while (ctype.getDeclaredMethod("<init>", args) != null)
{
! Type[] newArgs = new Type[args.length + 1];
! System.arraycopy(args, 0, newArgs, 0, args.length);
! newArgs[args.length] = Type.int_type;
! args = newArgs;
! dummyArgs++;
! addDeclaration("dummy");
}
|