Update of /cvsroot/nice/Nice/src/bossa/syntax
In directory sc8-pr-cvs1:/tmp/cvs-serv20832/F:/nice/src/bossa/syntax
Modified Files:
CustomConstructor.java
Log Message:
Codegeneration part for custom constructors.
Index: CustomConstructor.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/CustomConstructor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** CustomConstructor.java 13 Dec 2003 14:54:08 -0000 1.3
--- CustomConstructor.java 13 Dec 2003 17:52:01 -0000 1.4
***************
*** 16,19 ****
--- 16,22 ----
import java.util.*;
import mlsub.typing.*;
+ import gnu.expr.*;
+ import gnu.bytecode.ClassType;
+ import nice.tools.code.Gen;
/**
***************
*** 52,56 ****
protected gnu.expr.Expression computeCode()
{
! return gnu.expr.QuoteExp.nullExp;
}
--- 55,71 ----
protected gnu.expr.Expression computeCode()
{
! if (classe.definition.inInterfaceFile())
! {
! return new QuoteExp(classe.getClassExp().getClassType().getDeclaredMethod
! ("<init>", javaArgTypes()));
! }
!
! ConstructorExp lambda = Gen.createCustomConstructor
! ((ClassType) javaReturnType(), javaArgTypes(), parameters.getMonoSymbols());
!
! Gen.setMethodBody(lambda, body.generateCode());
! classe.getClassExp().addMethod(lambda);
!
! return lambda;
}
***************
*** 58,60 ****
--- 73,76 ----
Block body;
TypeConstructor classTC;
+ NiceClass classe;
}
|