[Nice-commit] Nice/src/bossa/syntax NiceMethod.java,1.32,1.33 MethodDeclaration.java,1.55,1.56
Brought to you by:
bonniot
From: <bo...@us...> - 2004-03-05 16:38:41
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2891/src/bossa/syntax Modified Files: NiceMethod.java MethodDeclaration.java Log Message: Global constants and global variables are now initialized in a proper order when one depends on another, both directly and through the default implementation of a method. Index: NiceMethod.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/NiceMethod.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** NiceMethod.java 3 Mar 2004 12:37:52 -0000 1.32 --- NiceMethod.java 5 Mar 2004 16:24:26 -0000 1.33 *************** *** 360,363 **** --- 360,377 ---- implementation.innerTypecheck(); } + + protected gnu.expr.Expression computeCode() + { + // We need to store the result before compiling the implementation. + code = super.computeCode(); + + // Compile the implementation before returning. This is used to detect + // dependencies between global variables through default method + // implementations, so that the global variables can be initialized in + // the proper order. + implementation.getRefExp(); + + return code; + } } } Index: MethodDeclaration.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MethodDeclaration.java,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** MethodDeclaration.java 28 Feb 2004 14:23:43 -0000 1.55 --- MethodDeclaration.java 5 Mar 2004 16:24:26 -0000 1.56 *************** *** 427,431 **** public static final char methodListSeparator = ';'; ! private gnu.expr.Expression code; protected abstract gnu.expr.Expression computeCode(); --- 427,431 ---- public static final char methodListSeparator = ';'; ! gnu.expr.Expression code; protected abstract gnu.expr.Expression computeCode(); |