[kaffe] CVS kaffe-extras (guilhem): Fixed initializers in KJC. Circular definitions of fields is now supported.
Kaffe CVS
cvs-commits at kaffe.org
Sat Feb 14 10:49:02 PST 2004
PatchSet 28
Date: 2004/02/14 18:48:56
Author: guilhem
Branch: HEAD
Tag: (none)
Log:
Fixed initializers in KJC. Circular definitions of fields is now supported.
Added a patch for ant-1.6.0 to compile.
Members:
bootstrap-kaffe+ant.sh:1.5->1.6
patches/ant-kaffe-1.1.3.diff:INITIAL->1.1
patches/kjc-initializers.diff:1.1->1.2
Index: kaffe-extras/bootstrap-kaffe+ant.sh
diff -u kaffe-extras/bootstrap-kaffe+ant.sh:1.5 kaffe-extras/bootstrap-kaffe+ant.sh:1.6
--- kaffe-extras/bootstrap-kaffe+ant.sh:1.5 Fri Jan 30 08:12:46 2004
+++ kaffe-extras/bootstrap-kaffe+ant.sh Sat Feb 14 18:48:56 2004
@@ -6,7 +6,7 @@
TOPDIR=$(cd `dirname $0`; pwd)
PREFIX=$TOPDIR/install
-KAFFE=kaffe-1.1.2
+KAFFE=kaffe-1.1.3
ANT=apache-ant-1.5.4
export TOPDIR PREFIX KAFFE ANT
===================================================================
Checking out kaffe-extras/patches/ant-kaffe-1.1.3.diff
RCS: /home/cvs/kaffe/kaffe-extras/patches/ant-kaffe-1.1.3.diff,v
VERS: 1.1
***************
--- /dev/null Sun Aug 4 19:57:58 2002
+++ kaffe-extras/patches/ant-kaffe-1.1.3.diff Sat Feb 14 18:48:58 2004
@@ -0,0 +1,130 @@
+diff -ur apache-ant-1.6.0/bootstrap.sh apache-ant-1.6.0.new/bootstrap.sh
+--- apache-ant-1.6.0/bootstrap.sh 2003-12-18 21:16:06.000000000 +0100
++++ apache-ant-1.6.0.new/bootstrap.sh 2004-02-14 14:04:14.000000000 +0100
+@@ -115,13 +115,111 @@
+
+ echo ... Compiling Ant Classes
+
+-"${JAVAC}" $BOOTJAVAC_OPTS -d ${CLASSDIR} ${TOOLS}/bzip2/*.java ${TOOLS}/tar/*.java ${TOOLS}/zip/*.java \
++"${JAVAC}" $BOOTJAVAC_OPTS -d ${CLASSDIR} ${TOOLS}/bzip2/*.java ${TOOLS}/tar/*.java ${TOOLS}/zip/*.java ${TOOLS}/mail/*.java \
+ ${TOOLS}/ant/util/regexp/RegexpMatcher.java \
+ ${TOOLS}/ant/util/regexp/RegexpMatcherFactory.java \
+ ${TOOLS}/ant/types/*.java \
+ ${TOOLS}/ant/*.java ${TOOLS}/ant/taskdefs/*.java \
+ ${TOOLS}/ant/taskdefs/compilers/*.java \
+- ${TOOLS}/ant/taskdefs/condition/*.java
++ ${TOOLS}/ant/taskdefs/condition/*.java \
++ ${TOOLS}/ant/filters/util/ChainReaderHelper.java \
++ ${TOOLS}/ant/filters/BaseFilterReader.java \
++ ${TOOLS}/ant/filters/ChainableReader.java \
++ ${TOOLS}/ant/launch/Locator.java \
++ ${TOOLS}/ant/util/ResourceUtils.java \
++ ${TOOLS}/ant/util/JavaEnvUtils.java \
++ ${TOOLS}/ant/util/FileNameMapper.java \
++ ${TOOLS}/ant/util/MergingMapper.java \
++ ${TOOLS}/ant/util/IdentityMapper.java \
++ ${TOOLS}/ant/util/GlobPatternMapper.java \
++ ${TOOLS}/ant/util/SourceFileScanner.java \
++ ${TOOLS}/ant/taskdefs/email/EmailTask.java \
++ ${TOOLS}/ant/taskdefs/email/Mailer.java \
++ ${TOOLS}/ant/taskdefs/email/PlainMailer.java \
++ ${TOOLS}/ant/util/facade/ImplementationSpecificArgument.java \
++ ${TOOLS}/ant/util/facade/FacadeTaskHelper.java \
++ ${TOOLS}/ant/taskdefs/rmic/RmicAdapterFactory.java \
++ ${TOOLS}/ant/taskdefs/rmic/RmicAdapter.java \
++ ${TOOLS}/ant/taskdefs/rmic/DefaultRmicAdapter.java \
++ ${TOOLS}/ant/taskdefs/rmic/SunRmic.java \
++ ${TOOLS}/ant/taskdefs/rmic/KaffeRmic.java \
++ ${TOOLS}/ant/taskdefs/rmic/WLRmic.java \
++ ${TOOLS}/ant/util/StringUtils.java \
++ ${TOOLS}/ant/util/TeeOutputStream.java \
++ ${TOOLS}/ant/util/LazyFileOutputStream.java \
++ ${TOOLS}/ant/types/selectors/SelectorContainer.java \
++ ${TOOLS}/ant/types/selectors/modifiedselector/ModifiedSelector.java \
++ ${TOOLS}/ant/types/selectors/BaseExtendSelector.java \
++ ${TOOLS}/ant/types/selectors/modifiedselector/PropertiesfileCache.java \
++ ${TOOLS}/ant/types/selectors/modifiedselector/DigestAlgorithm.java \
++ ${TOOLS}/ant/types/selectors/modifiedselector/EqualComparator.java \
++ ${TOOLS}/ant/util/JAXPUtils.java \
++ ${TOOLS}/ant/types/selectors/BaseSelectorContainer.java \
++ ${TOOLS}/ant/helper/AntXMLContext.java \
++ ${TOOLS}/ant/helper/ProjectHelperImpl.java \
++ ${TOOLS}/ant/types/selectors/BaseSelector.java \
++ ${TOOLS}/ant/types/selectors/ExtendFileSelector.java \
++ ${TOOLS}/ant/types/selectors/FileSelector.java \
++ ${TOOLS}/ant/types/selectors/TypeSelector.java \
++ ${TOOLS}/ant/types/selectors/SizeSelector.java \
++ ${TOOLS}/ant/types/selectors/SelectSelector.java \
++ ${TOOLS}/ant/types/selectors/PresentSelector.java \
++ ${TOOLS}/ant/types/selectors/MappingSelector.java \
++ ${TOOLS}/ant/types/selectors/OrSelector.java \
++ ${TOOLS}/ant/types/selectors/NotSelector.java \
++ ${TOOLS}/ant/types/selectors/NoneSelector.java \
++ ${TOOLS}/ant/types/selectors/MajoritySelector.java \
++ ${TOOLS}/ant/types/selectors/FilenameSelector.java \
++ ${TOOLS}/ant/types/selectors/ExtendSelector.java \
++ ${TOOLS}/ant/types/selectors/DifferentSelector.java \
++ ${TOOLS}/ant/types/selectors/DepthSelector.java \
++ ${TOOLS}/ant/types/selectors/DependSelector.java \
++ ${TOOLS}/ant/types/selectors/DateSelector.java \
++ ${TOOLS}/ant/types/selectors/ContainsSelector.java \
++ ${TOOLS}/ant/types/selectors/ContainsRegexpSelector.java \
++ ${TOOLS}/ant/util/regexp/Regexp.java \
++ ${TOOLS}/ant/types/selectors/AndSelector.java \
++ ${TOOLS}/ant/util/CollectionUtils.java \
++ ${TOOLS}/ant/input/MultipleChoiceInputRequest.java \
++ ${TOOLS}/ant/input/InputRequest.java \
++ ${TOOLS}/ant/types/selectors/SelectorUtils.java \
++ ${TOOLS}/ant/util/TimeoutObserver.java \
++ ${TOOLS}/ant/taskdefs/email/Message.java \
++ ${TOOLS}/ant/types/selectors/modifiedselector/Algorithm.java \
++ ${TOOLS}/ant/types/selectors/modifiedselector/Cache.java \
++ ${TOOLS}/ant/util/Watchdog.java \
++ ${TOOLS}/ant/util/ClasspathUtils.java \
++ ${TOOLS}/ant/filters/ClassConstants.java \
++ ${TOOLS}/ant/filters/EscapeUnicode.java \
++ ${TOOLS}/ant/filters/ExpandProperties.java \
++ ${TOOLS}/ant/filters/HeadFilter.java \
++ ${TOOLS}/ant/filters/LineContains.java \
++ ${TOOLS}/ant/filters/LineContainsRegExp.java \
++ ${TOOLS}/ant/filters/PrefixLines.java \
++ ${TOOLS}/ant/filters/ReplaceTokens.java \
++ ${TOOLS}/ant/filters/StripJavaComments.java \
++ ${TOOLS}/ant/filters/StripLineBreaks.java \
++ ${TOOLS}/ant/filters/StripLineComments.java \
++ ${TOOLS}/ant/filters/TabsToSpaces.java \
++ ${TOOLS}/ant/filters/BaseParamFilterReader.java \
++ ${TOOLS}/ant/filters/TailFilter.java \
++ ${TOOLS}/ant/util/Tokenizer.java \
++ ${TOOLS}/ant/util/LineTokenizer.java \
++ ${TOOLS}/ant/filters/TokenFilter.java \
++ ${TOOLS}/ant/util/regexp/RegexpFactory.java \
++ ${TOOLS}/ant/util/DateUtils.java \
++ ${TOOLS}/ant/types/selectors/SelectorScanner.java \
++ ${TOOLS}/ant/launch/AntMain.java \
++ ${TOOLS}/ant/util/LoaderUtils.java \
++ ${TOOLS}/ant/util/KeepAliveInputStream.java \
++ ${TOOLS}/ant/input/DefaultInputHandler.java \
++ ${TOOLS}/ant/taskdefs/email/EmailAddress.java \
++ ${TOOLS}/ant/input/InputHandler.java \
++ ${TOOLS}/ant/util/DOMElementWriter.java \
++ ${TOOLS}/ant/util/FlatFileNameMapper.java \
++ ${TOOLS}/ant/helper/ProjectHelper2.java \
++ ${TOOLS}/ant/util/FileUtils.java \
++ ${TOOLS}/ant/taskdefs/optional/Test.java
+ ret=$?
+ if [ $ret != 0 ]; then
+ echo ... Failed compiling Ant classes !
+Only in apache-ant-1.6.0.new/: bootstrap.sh~
+diff -ur apache-ant-1.6.0/build.sh apache-ant-1.6.0.new/build.sh
+--- apache-ant-1.6.0/build.sh 2003-12-18 21:16:06.000000000 +0100
++++ apache-ant-1.6.0.new/build.sh 2004-01-29 19:29:02.000000000 +0100
+@@ -24,7 +24,7 @@
+ export ANT_HOME
+
+ if test ! -f bootstrap/lib/ant.jar -o ! -x bootstrap/bin/ant -o ! -x bootstrap/bin/antRun ; then
+- /bin/sh ./bootstrap.sh
++ /bin/sh ./bootstrap.sh -Dbuild.compiler=kjc
+ fi
+
+ if test ! -f bootstrap/lib/ant.jar -o ! -x bootstrap/bin/ant -o ! -x bootstrap/bin/antRun ; then
Index: kaffe-extras/patches/kjc-initializers.diff
diff -u kaffe-extras/patches/kjc-initializers.diff:1.1 kaffe-extras/patches/kjc-initializers.diff:1.2
--- kaffe-extras/patches/kjc-initializers.diff:1.1 Thu Jan 29 20:32:16 2004
+++ kaffe-extras/patches/kjc-initializers.diff Sat Feb 14 18:48:57 2004
@@ -1,6 +1,6 @@
-diff -N -x Kjc.java -x '*~' -ur kjc-suite-2.1B/src/kjc/CBinaryField.java kjc-suite-2.1B.new/src/kjc/CBinaryField.java
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/CBinaryField.java kjc-suite-2.1B.new/src/kjc/CBinaryField.java
--- kjc-suite-2.1B/src/kjc/CBinaryField.java 2002-07-15 20:53:31.000000000 +0200
-+++ kjc-suite-2.1B.new/src/kjc/CBinaryField.java 2004-01-28 21:26:17.000000000 +0100
++++ kjc-suite-2.1B.new/src/kjc/CBinaryField.java 2004-02-13 21:23:15.000000000 +0100
@@ -59,6 +59,7 @@
setValue(createLiteral(factory, getType(), value));
}
@@ -9,9 +9,9 @@
}
public void checkTypes(CBinaryTypeContext context) throws UnpositionedError {
-diff -N -x Kjc.java -x '*~' -ur kjc-suite-2.1B/src/kjc/CBodyContext.java kjc-suite-2.1B.new/src/kjc/CBodyContext.java
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/CBodyContext.java kjc-suite-2.1B.new/src/kjc/CBodyContext.java
--- kjc-suite-2.1B/src/kjc/CBodyContext.java 2002-07-15 20:53:32.000000000 +0200
-+++ kjc-suite-2.1B.new/src/kjc/CBodyContext.java 2004-01-28 07:50:30.000000000 +0100
++++ kjc-suite-2.1B.new/src/kjc/CBodyContext.java 2004-02-13 21:23:15.000000000 +0100
@@ -55,6 +55,7 @@
flowState = parent.flowState;
variableInfo = new CVariableInfo(parent.getVariableInfo());
@@ -67,9 +67,9 @@
+
private Hashtable throwables;
}
-diff -N -x Kjc.java -x '*~' -ur kjc-suite-2.1B/src/kjc/CTryContext.java kjc-suite-2.1B.new/src/kjc/CTryContext.java
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/CTryContext.java kjc-suite-2.1B.new/src/kjc/CTryContext.java
--- kjc-suite-2.1B/src/kjc/CTryContext.java 2002-07-15 20:53:32.000000000 +0200
-+++ kjc-suite-2.1B.new/src/kjc/CTryContext.java 2004-01-28 20:49:14.000000000 +0100
++++ kjc-suite-2.1B.new/src/kjc/CTryContext.java 2004-02-13 21:23:15.000000000 +0100
@@ -59,6 +59,13 @@
public void close(TokenReference ref) {
}
@@ -84,9 +84,9 @@
// ----------------------------------------------------------------------
// ACCESSORS
// ----------------------------------------------------------------------
-diff -N -x Kjc.java -x '*~' -ur kjc-suite-2.1B/src/kjc/CVariableExtInfo.java kjc-suite-2.1B.new/src/kjc/CVariableExtInfo.java
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/CVariableExtInfo.java kjc-suite-2.1B.new/src/kjc/CVariableExtInfo.java
--- kjc-suite-2.1B/src/kjc/CVariableExtInfo.java 1970-01-01 01:00:00.000000000 +0100
-+++ kjc-suite-2.1B.new/src/kjc/CVariableExtInfo.java 2004-01-29 19:16:12.000000000 +0100
++++ kjc-suite-2.1B.new/src/kjc/CVariableExtInfo.java 2004-02-13 21:23:15.000000000 +0100
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2004 Kaffe.org's developers
@@ -153,9 +153,9 @@
+ public static final int EXIST = 0x01;
+ public static final int ANALYSED = 0x02;
+}
-diff -N -x Kjc.java -x '*~' -ur kjc-suite-2.1B/src/kjc/JAddExpression.java kjc-suite-2.1B.new/src/kjc/JAddExpression.java
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JAddExpression.java kjc-suite-2.1B.new/src/kjc/JAddExpression.java
--- kjc-suite-2.1B/src/kjc/JAddExpression.java 2002-07-15 20:53:32.000000000 +0200
-+++ kjc-suite-2.1B.new/src/kjc/JAddExpression.java 2004-01-29 19:02:51.000000000 +0100
++++ kjc-suite-2.1B.new/src/kjc/JAddExpression.java 2004-02-13 21:23:15.000000000 +0100
@@ -81,6 +81,8 @@
left = left.analyse(context);
@@ -183,9 +183,22 @@
if (left.isConstant() && right.isConstant()) {
if (type.equals(stringType)) {
-diff -N -x Kjc.java -x '*~' -ur kjc-suite-2.1B/src/kjc/JBinaryExpression.java kjc-suite-2.1B.new/src/kjc/JBinaryExpression.java
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JAssignmentExpression.java kjc-suite-2.1B.new/src/kjc/JAssignmentExpression.java
+--- kjc-suite-2.1B/src/kjc/JAssignmentExpression.java 2002-07-15 20:53:32.000000000 +0200
++++ kjc-suite-2.1B.new/src/kjc/JAssignmentExpression.java 2004-02-14 13:43:24.000000000 +0100
+@@ -99,6 +99,9 @@
+ context.getEnvironment(),
+ false,
+ false));
++ // Here, we expect it to be true in any case. But we never know.
++ fully_analysed = right.isFullyAnalysed() && left.isFullyAnalysed();
++
+ if (right instanceof JTypeNameExpression) {
+ check(context, false, KjcMessages.VAR_UNKNOWN, ((JTypeNameExpression)right).getQualifiedName());
+ }
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JBinaryExpression.java kjc-suite-2.1B.new/src/kjc/JBinaryExpression.java
--- kjc-suite-2.1B/src/kjc/JBinaryExpression.java 2002-07-15 20:53:32.000000000 +0200
-+++ kjc-suite-2.1B.new/src/kjc/JBinaryExpression.java 2004-01-27 21:11:36.000000000 +0100
++++ kjc-suite-2.1B.new/src/kjc/JBinaryExpression.java 2004-02-13 21:58:46.000000000 +0100
@@ -46,6 +46,7 @@
super(where);
this.left = left;
@@ -194,27 +207,72 @@
}
// ----------------------------------------------------------------------
-@@ -113,6 +114,11 @@
- code.plantJumpInstruction(cond ? opc_ifne : opc_ifeq, label);
+@@ -59,6 +60,20 @@
+ return type;
}
++ /**
++ * @return true is the expression has been completely initialized.
++ */
+ public boolean isFullyAnalysed() {
-+// return fully_analysed;
-+ return left.isFullyAnalysed() && right.isFullyAnalysed();
++ return fully_analysed;
++ }
++
++ /**
++ * @return true if the expression depends on the specified field.
++ */
++ public boolean dependsOnField(CField field) {
++ return left.dependsOnField(field) || right.dependsOnField(field);
+ }
+
// ----------------------------------------------------------------------
- // DATA MEMBERS
+ // CODE GENERATION
// ----------------------------------------------------------------------
-@@ -120,4 +126,5 @@
+@@ -120,4 +135,5 @@
protected CType type;
protected JExpression left;
protected JExpression right;
+ protected boolean fully_analysed;
}
-diff -N -x Kjc.java -x '*~' -ur kjc-suite-2.1B/src/kjc/JClassDeclaration.java kjc-suite-2.1B.new/src/kjc/JClassDeclaration.java
---- kjc-suite-2.1B/src/kjc/JClassDeclaration.java 2004-01-29 19:10:43.000000000 +0100
-+++ kjc-suite-2.1B.new/src/kjc/JClassDeclaration.java 2004-01-27 21:41:02.000000000 +0100
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JBitwiseComplementExpression.java kjc-suite-2.1B.new/src/kjc/JBitwiseComplementExpression.java
+--- kjc-suite-2.1B/src/kjc/JBitwiseComplementExpression.java 2002-07-15 20:53:32.000000000 +0200
++++ kjc-suite-2.1B.new/src/kjc/JBitwiseComplementExpression.java 2004-02-13 21:52:07.000000000 +0100
+@@ -62,7 +62,11 @@
+
+ expr = expr.analyse(context);
+ check(context, expr.getType(factory).isOrdinal(), KjcMessages.UNARY_BADTYPE_BNOT, expr.getType(factory));
++
+ type = CNumericType.unaryPromote(context, expr.getType(factory));
++ if (!expr.isFullyAnalysed())
++ return this;
++
+ expr = expr.convertType(context, type);
+
+ if (expr.isConstant()) {
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JBitwiseExpression.java kjc-suite-2.1B.new/src/kjc/JBitwiseExpression.java
+--- kjc-suite-2.1B/src/kjc/JBitwiseExpression.java 2002-07-15 20:53:32.000000000 +0200
++++ kjc-suite-2.1B.new/src/kjc/JBitwiseExpression.java 2004-02-14 13:25:49.000000000 +0100
+@@ -67,6 +67,7 @@
+
+ left = left.analyse(context);
+ right = right.analyse(context);
++ fully_analysed = left.isFullyAnalysed() && right.isFullyAnalysed();
+
+ try {
+ type = computeType(context, left.getType(factory), right.getType(factory));
+@@ -74,6 +75,9 @@
+ throw e.addPosition(getTokenReference());
+ }
+
++ if (!fully_analysed)
++ return this;
++
+ left = left.convertType(context, type);
+ right = right.convertType(context, type);
+
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JClassDeclaration.java kjc-suite-2.1B.new/src/kjc/JClassDeclaration.java
+--- kjc-suite-2.1B/src/kjc/JClassDeclaration.java 2004-02-14 13:55:21.000000000 +0100
++++ kjc-suite-2.1B.new/src/kjc/JClassDeclaration.java 2004-02-13 21:23:15.000000000 +0100
@@ -378,7 +378,7 @@
* Check that initializers are correct
* @exception PositionedError an error with reference to the source file
@@ -261,9 +319,9 @@
}
/**
-diff -N -x Kjc.java -x '*~' -ur kjc-suite-2.1B/src/kjc/JCompilationUnit.java kjc-suite-2.1B.new/src/kjc/JCompilationUnit.java
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JCompilationUnit.java kjc-suite-2.1B.new/src/kjc/JCompilationUnit.java
--- kjc-suite-2.1B/src/kjc/JCompilationUnit.java 2002-07-15 20:53:32.000000000 +0200
-+++ kjc-suite-2.1B.new/src/kjc/JCompilationUnit.java 2004-01-27 21:01:23.000000000 +0100
++++ kjc-suite-2.1B.new/src/kjc/JCompilationUnit.java 2004-02-13 21:23:15.000000000 +0100
@@ -220,12 +220,14 @@
* @return true iff sub tree is correct enought to check code
* @exception PositionedError an error with reference to the source file
@@ -281,9 +339,63 @@
}
// ----------------------------------------------------------------------
-diff -N -x Kjc.java -x '*~' -ur kjc-suite-2.1B/src/kjc/JDivideExpression.java kjc-suite-2.1B.new/src/kjc/JDivideExpression.java
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JCompoundAssignmentExpression.java kjc-suite-2.1B.new/src/kjc/JCompoundAssignmentExpression.java
+--- kjc-suite-2.1B/src/kjc/JCompoundAssignmentExpression.java 2004-02-14 13:55:21.000000000 +0100
++++ kjc-suite-2.1B.new/src/kjc/JCompoundAssignmentExpression.java 2004-02-14 13:44:03.000000000 +0100
+@@ -127,6 +127,8 @@
+ check(context, false, KjcMessages.VAR_UNKNOWN, ((JTypeNameExpression)right).getQualifiedName());
+ }
+
++ fully_analysed = left.isFullyAnalysed() && right.isFullyAnalysed();
++
+ // JLS 15.26.2 Compound Assignment Operators :
+ // All compound assignment operators require both operands to be of
+ // primitive type, except for +=, which allows the right-hand operand to be
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JConditionalAndExpression.java kjc-suite-2.1B.new/src/kjc/JConditionalAndExpression.java
+--- kjc-suite-2.1B/src/kjc/JConditionalAndExpression.java 2002-07-15 20:53:32.000000000 +0200
++++ kjc-suite-2.1B.new/src/kjc/JConditionalAndExpression.java 2004-02-13 21:45:29.000000000 +0100
+@@ -61,6 +61,7 @@
+
+ left = left.analyse(context);
+ right = right.analyse(context);
++ fully_analysed = left.isFullyAnalysed() && right.isFullyAnalysed();
+
+ CType leftType = left.getType(factory);
+ CType rightType = right.getType(factory);
+@@ -72,6 +73,9 @@
+
+ type = booleanType;
+
++ if (!fully_analysed)
++ return this;
++
+ // JLS 15.28: Constant Expression ?
+ if (left.isConstant() && right.isConstant()) {
+ return new JBooleanLiteral(getTokenReference(), left.booleanValue() && right.booleanValue());
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JConditionalOrExpression.java kjc-suite-2.1B.new/src/kjc/JConditionalOrExpression.java
+--- kjc-suite-2.1B/src/kjc/JConditionalOrExpression.java 2002-07-15 20:53:32.000000000 +0200
++++ kjc-suite-2.1B.new/src/kjc/JConditionalOrExpression.java 2004-02-13 21:45:39.000000000 +0100
+@@ -61,6 +61,7 @@
+
+ left = left.analyse(context);
+ right = right.analyse(context);
++ fully_analysed = left.isFullyAnalysed() && right.isFullyAnalysed();
+
+ CType leftType = left.getType(factory);
+ CType rightType = right.getType(factory);
+@@ -72,6 +73,9 @@
+
+ type = primBoolean;
+
++ if (!fully_analysed)
++ return this;
++
+ // JLS 15.28: Constant Expression ?
+ if (left.isConstant() && right.isConstant()) {
+ return new JBooleanLiteral(getTokenReference(), left.booleanValue() || right.booleanValue());
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JDivideExpression.java kjc-suite-2.1B.new/src/kjc/JDivideExpression.java
--- kjc-suite-2.1B/src/kjc/JDivideExpression.java 2002-07-15 20:53:32.000000000 +0200
-+++ kjc-suite-2.1B.new/src/kjc/JDivideExpression.java 2004-01-25 19:43:29.000000000 +0100
++++ kjc-suite-2.1B.new/src/kjc/JDivideExpression.java 2004-02-13 21:23:15.000000000 +0100
@@ -63,6 +63,7 @@
left = left.analyse(context);
@@ -292,36 +404,102 @@
try {
type = computeType(context, left.getType(factory), right.getType(factory));
-diff -N -x Kjc.java -x '*~' -ur kjc-suite-2.1B/src/kjc/JExpression.java kjc-suite-2.1B.new/src/kjc/JExpression.java
+@@ -70,6 +71,9 @@
+ throw e.addPosition(getTokenReference());
+ }
+
++ if (!fully_analysed)
++ return this;
++
+ if (type.isOrdinal() && right.isConstant() && ((JLiteral)right).isDefault()) {
+ context.reportTrouble(new CWarning(getTokenReference(), KjcMessages.DIVIDE_BY_ZERO_INT));
+ }
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JEqualityExpression.java kjc-suite-2.1B.new/src/kjc/JEqualityExpression.java
+--- kjc-suite-2.1B/src/kjc/JEqualityExpression.java 2002-07-15 20:53:32.000000000 +0200
++++ kjc-suite-2.1B.new/src/kjc/JEqualityExpression.java 2004-02-13 21:47:23.000000000 +0100
+@@ -82,8 +82,15 @@
+ public JExpression analyse(CExpressionContext context) throws PositionedError {
+ left = left.analyse(context);
+ right = right.analyse(context);
++ fully_analysed = left.isFullyAnalysed() && right.isFullyAnalysed();
+
+ TypeFactory factory = context.getTypeFactory();
++
++ type = factory.getPrimitiveType(TypeFactory.PRM_BOOLEAN);
++
++ if (!fully_analysed)
++ return this;
++
+ CType leftType = left.getType(factory);
+ CType rightType = right.getType(factory);
+ CType booleanType = factory.getPrimitiveType(TypeFactory.PRM_BOOLEAN);
+@@ -117,8 +124,6 @@
+ }
+ }
+
+- type = factory.getPrimitiveType(TypeFactory.PRM_BOOLEAN);
+-
+ if (left.isConstant() && right.isConstant()) {
+ return constantFolding(factory);
+ } else {
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JExpression.java kjc-suite-2.1B.new/src/kjc/JExpression.java
--- kjc-suite-2.1B/src/kjc/JExpression.java 2002-07-15 20:53:32.000000000 +0200
-+++ kjc-suite-2.1B.new/src/kjc/JExpression.java 2004-01-25 19:39:20.000000000 +0100
-@@ -53,6 +53,14 @@
++++ kjc-suite-2.1B.new/src/kjc/JExpression.java 2004-02-13 21:23:15.000000000 +0100
+@@ -53,6 +53,21 @@
public abstract CType getType(TypeFactory factory);
/**
+ * Tests whether the expression is fully analysed or if they are any pending
-+ * expressions to reanalyse.
++ * expressions to reanalyse (useful for static initializers).
+ */
+ public boolean isFullyAnalysed() {
+ return true;
+ }
+
+ /**
++ * Tests whether the expression depends on the specified field.
++ */
++ public boolean dependsOnField(CField field) {
++ return false;
++ }
++
++ /**
* Tests whether this expression denotes a compile-time constant (JLS 15.28).
*
* @return true iff this expression is constant
-diff -N -x Kjc.java -x '*~' -ur kjc-suite-2.1B/src/kjc/JFieldAccessExpression.java kjc-suite-2.1B.new/src/kjc/JFieldAccessExpression.java
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JFieldAccessExpression.java kjc-suite-2.1B.new/src/kjc/JFieldAccessExpression.java
--- kjc-suite-2.1B/src/kjc/JFieldAccessExpression.java 2002-07-15 20:53:33.000000000 +0200
-+++ kjc-suite-2.1B.new/src/kjc/JFieldAccessExpression.java 2004-01-29 19:03:06.000000000 +0100
-@@ -119,7 +119,6 @@
++++ kjc-suite-2.1B.new/src/kjc/JFieldAccessExpression.java 2004-02-14 13:29:25.000000000 +0100
+@@ -107,6 +107,12 @@
+ return type;
+ }
+
++ public boolean dependsOnField(CField field) {
++ return this.field == field ||
++ (this.field.getValue() != null &&
++ this.field.getValue().dependsOnField(field));
++ }
++
+ /**
+ * Tests whether this expression denotes a compile-time constant (JLS 15.28).
+ *
+@@ -119,10 +125,14 @@
// are constant expressions
// - Qualified names of the form TypeName . Identifier that refer to
// final variables whose initializers are constant expressions
--
++ if (field.getValue() == null)
++ return false;
+
++ if (field.getValue().dependsOnField(field))
++ return false;
++
return constantPrefix
&& field.isFinal()
- && field.getValue() != null
-@@ -184,6 +183,10 @@
+- && field.getValue() != null
+ && field.getValue().isConstant();
+ }
+
+@@ -184,6 +194,10 @@
return field;
}
@@ -332,15 +510,7 @@
/**
* Returns the literal value of this field.
*/
-@@ -206,6 +209,7 @@
- buffer.append(field);
- }
- buffer.append("]");
-+ buffer.append(" cprefix="+constantPrefix + " field.isFinal="+field.isFinal() + " field.value="+field.getValue());
- return buffer.toString();
- }
-
-@@ -275,6 +279,9 @@
+@@ -275,6 +289,9 @@
type = field.getType();
@@ -350,12 +520,20 @@
if (isConstant()) {
// FIX Type!!
return field.getValue();
-diff -N -x Kjc.java -x '*~' -ur kjc-suite-2.1B/src/kjc/JFieldDeclaration.java kjc-suite-2.1B.new/src/kjc/JFieldDeclaration.java
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JFieldDeclaration.java kjc-suite-2.1B.new/src/kjc/JFieldDeclaration.java
--- kjc-suite-2.1B/src/kjc/JFieldDeclaration.java 2002-07-15 20:53:32.000000000 +0200
-+++ kjc-suite-2.1B.new/src/kjc/JFieldDeclaration.java 2004-01-28 07:50:58.000000000 +0100
-@@ -178,6 +178,12 @@
++++ kjc-suite-2.1B.new/src/kjc/JFieldDeclaration.java 2004-02-14 13:29:37.000000000 +0100
+@@ -177,7 +177,20 @@
+ public void analyse(CBodyContext context) throws PositionedError {
TypeFactory factory = context.getTypeFactory();
++ // This is special case where a crazy programmer made this variable
++ // depends on itself. Sun is gen
++ if (variable.getValue() != null &&
++ variable.getValue().dependsOnField(getField())) {
++ ((CSourceField)getField()).setFullyDeclared(true);
++ }
++
variable.analyse(context);
+ if (!variable.isDefinitionAnalysed())
+ {
@@ -366,7 +544,7 @@
// JLS 8.1.2 : Inner classes may inherit static members that
// are not compile-time constants even though they may not declare
// them. Inner classes may not declare static members, unless
-@@ -211,6 +217,8 @@
+@@ -211,6 +224,8 @@
}
}
@@ -375,9 +553,9 @@
if (hasInitializer()) {
context.setFieldInfo(((CSourceField)getField()).getPosition(), CVariableInfo.INITIALIZED);
}
-diff -N -x Kjc.java -x '*~' -ur kjc-suite-2.1B/src/kjc/JInitializerDeclaration.java kjc-suite-2.1B.new/src/kjc/JInitializerDeclaration.java
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JInitializerDeclaration.java kjc-suite-2.1B.new/src/kjc/JInitializerDeclaration.java
--- kjc-suite-2.1B/src/kjc/JInitializerDeclaration.java 2002-07-15 20:53:32.000000000 +0200
-+++ kjc-suite-2.1B.new/src/kjc/JInitializerDeclaration.java 2004-01-28 17:49:16.000000000 +0100
++++ kjc-suite-2.1B.new/src/kjc/JInitializerDeclaration.java 2004-02-13 21:23:15.000000000 +0100
@@ -22,6 +22,7 @@
import at.dms.compiler.PositionedError;
@@ -422,9 +600,9 @@
}
// ----------------------------------------------------------------------
-diff -N -x Kjc.java -x '*~' -ur kjc-suite-2.1B/src/kjc/JInterfaceDeclaration.java kjc-suite-2.1B.new/src/kjc/JInterfaceDeclaration.java
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JInterfaceDeclaration.java kjc-suite-2.1B.new/src/kjc/JInterfaceDeclaration.java
--- kjc-suite-2.1B/src/kjc/JInterfaceDeclaration.java 2002-07-15 20:53:32.000000000 +0200
-+++ kjc-suite-2.1B.new/src/kjc/JInterfaceDeclaration.java 2004-01-27 21:11:27.000000000 +0100
++++ kjc-suite-2.1B.new/src/kjc/JInterfaceDeclaration.java 2004-02-13 21:23:15.000000000 +0100
@@ -158,19 +158,20 @@
* Check that initializers are correct
* @exception PositionedError an error with reference to the source file
@@ -450,9 +628,20 @@
}
/**
-diff -N -x Kjc.java -x '*~' -ur kjc-suite-2.1B/src/kjc/JMinusExpression.java kjc-suite-2.1B.new/src/kjc/JMinusExpression.java
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JLogicalComplementExpression.java kjc-suite-2.1B.new/src/kjc/JLogicalComplementExpression.java
+--- kjc-suite-2.1B/src/kjc/JLogicalComplementExpression.java 2002-07-15 20:53:32.000000000 +0200
++++ kjc-suite-2.1B.new/src/kjc/JLogicalComplementExpression.java 2004-02-13 21:51:38.000000000 +0100
+@@ -63,6 +63,7 @@
+ expr = expr.analyse(context);
+ check(context, expr.getType(factory) == booleanType, KjcMessages.UNARY_BADTYPE_LNOT, expr.getType(factory));
+ type = booleanType;
++
+ if (expr.isConstant()) {
+ return new JBooleanLiteral(getTokenReference(), !expr.booleanValue());
+ } else {
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JMinusExpression.java kjc-suite-2.1B.new/src/kjc/JMinusExpression.java
--- kjc-suite-2.1B/src/kjc/JMinusExpression.java 2002-07-15 20:53:32.000000000 +0200
-+++ kjc-suite-2.1B.new/src/kjc/JMinusExpression.java 2004-01-25 19:42:30.000000000 +0100
++++ kjc-suite-2.1B.new/src/kjc/JMinusExpression.java 2004-02-13 21:23:15.000000000 +0100
@@ -62,6 +62,7 @@
left = left.analyse(context);
@@ -461,9 +650,40 @@
try {
type = computeType(context, left.getType(factory), right.getType(factory));
-diff -N -x Kjc.java -x '*~' -ur kjc-suite-2.1B/src/kjc/JMultExpression.java kjc-suite-2.1B.new/src/kjc/JMultExpression.java
+@@ -69,6 +70,9 @@
+ throw e.addPosition(getTokenReference());
+ }
+
++ if (!fully_analysed)
++ return this;
++
+ left = left.convertType(context, type);
+ right = right.convertType(context, type);
+
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JModuloExpression.java kjc-suite-2.1B.new/src/kjc/JModuloExpression.java
+--- kjc-suite-2.1B/src/kjc/JModuloExpression.java 2002-07-15 20:53:32.000000000 +0200
++++ kjc-suite-2.1B.new/src/kjc/JModuloExpression.java 2004-02-13 21:23:15.000000000 +0100
+@@ -63,6 +63,7 @@
+
+ left = left.analyse(context);
+ right = right.analyse(context);
++ fully_analysed = left.isFullyAnalysed() && right.isFullyAnalysed();
+
+ try {
+ type = computeType(context, left.getType(factory), right.getType(factory));
+@@ -70,6 +71,9 @@
+ throw e.addPosition(getTokenReference());
+ }
+
++ if (!fully_analysed)
++ return this;
++
+ left = left.convertType(context, type);
+ right = right.convertType(context, type);
+
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JMultExpression.java kjc-suite-2.1B.new/src/kjc/JMultExpression.java
--- kjc-suite-2.1B/src/kjc/JMultExpression.java 2002-07-15 20:53:32.000000000 +0200
-+++ kjc-suite-2.1B.new/src/kjc/JMultExpression.java 2004-01-25 19:43:00.000000000 +0100
++++ kjc-suite-2.1B.new/src/kjc/JMultExpression.java 2004-02-13 21:23:15.000000000 +0100
@@ -63,6 +63,7 @@
left = left.analyse(context);
@@ -472,9 +692,40 @@
try {
type = computeType(context, left.getType(factory), right.getType(factory));
-diff -N -x Kjc.java -x '*~' -ur kjc-suite-2.1B/src/kjc/JReturnStatement.java kjc-suite-2.1B.new/src/kjc/JReturnStatement.java
+@@ -70,6 +71,9 @@
+ throw e.addPosition(getTokenReference());
+ }
+
++ if (!fully_analysed)
++ return this;
++
+ left = left.convertType(context, type);
+ right = right.convertType(context, type);
+
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JRelationalExpression.java kjc-suite-2.1B.new/src/kjc/JRelationalExpression.java
+--- kjc-suite-2.1B/src/kjc/JRelationalExpression.java 2002-07-15 20:53:32.000000000 +0200
++++ kjc-suite-2.1B.new/src/kjc/JRelationalExpression.java 2004-02-13 21:47:37.000000000 +0100
+@@ -66,6 +66,7 @@
+
+ left = left.analyse(context);
+ right = right.analyse(context);
++ fully_analysed = left.isFullyAnalysed() && right.isFullyAnalysed();
+
+ check(context,
+ left.getType(factory).isNumeric() && right.getType(factory).isNumeric(),
+@@ -73,6 +74,9 @@
+
+ type = context.getTypeFactory().getPrimitiveType(TypeFactory.PRM_BOOLEAN);
+
++ if (!fully_analysed)
++ return this;
++
+ CType promoted = CNumericType.binaryPromote(context, left.getType(factory), right.getType(factory));
+ left = left.convertType(context, promoted);
+ right = right.convertType(context, promoted);
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JReturnStatement.java kjc-suite-2.1B.new/src/kjc/JReturnStatement.java
--- kjc-suite-2.1B/src/kjc/JReturnStatement.java 2002-07-15 20:53:33.000000000 +0200
-+++ kjc-suite-2.1B.new/src/kjc/JReturnStatement.java 2004-01-27 20:34:05.000000000 +0100
++++ kjc-suite-2.1B.new/src/kjc/JReturnStatement.java 2004-02-13 21:23:15.000000000 +0100
@@ -88,7 +88,8 @@
check(context,
expr.isAssignableTo(expressionContext, returnType),
@@ -485,9 +736,30 @@
} else {
check(context, returnType.getTypeID() == TID_VOID, KjcMessages.RETURN_EMPTY_NONVOID);
}
-diff -N -x Kjc.java -x '*~' -ur kjc-suite-2.1B/src/kjc/JTryCatchStatement.java kjc-suite-2.1B.new/src/kjc/JTryCatchStatement.java
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JShiftExpression.java kjc-suite-2.1B.new/src/kjc/JShiftExpression.java
+--- kjc-suite-2.1B/src/kjc/JShiftExpression.java 2002-07-15 20:53:32.000000000 +0200
++++ kjc-suite-2.1B.new/src/kjc/JShiftExpression.java 2004-02-14 13:25:36.000000000 +0100
+@@ -67,6 +67,7 @@
+
+ left = left.analyse(context);
+ right = right.analyse(context);
++ fully_analysed = left.isFullyAnalysed() && right.isFullyAnalysed();
+
+ try {
+ type = computeType(context, left.getType(factory), right.getType(factory));
+@@ -74,6 +75,9 @@
+ throw e.addPosition(getTokenReference());
+ }
+
++ if (!fully_analysed)
++ return this;
++
+ left = left.convertType(context, type);
+ right = right.convertType(context, context.getTypeFactory().getPrimitiveType(TypeFactory.PRM_INT));
+
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JTryCatchStatement.java kjc-suite-2.1B.new/src/kjc/JTryCatchStatement.java
--- kjc-suite-2.1B/src/kjc/JTryCatchStatement.java 2002-07-15 20:53:32.000000000 +0200
-+++ kjc-suite-2.1B.new/src/kjc/JTryCatchStatement.java 2004-01-28 20:48:05.000000000 +0100
++++ kjc-suite-2.1B.new/src/kjc/JTryCatchStatement.java 2004-02-13 21:23:15.000000000 +0100
@@ -21,6 +21,7 @@
package at.dms.kjc;
@@ -516,9 +788,9 @@
+ private Hashtable saveThrowables;
+ private boolean analysed;
}
-diff -N -x Kjc.java -x '*~' -ur kjc-suite-2.1B/src/kjc/JTypeDeclaration.java kjc-suite-2.1B.new/src/kjc/JTypeDeclaration.java
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JTypeDeclaration.java kjc-suite-2.1B.new/src/kjc/JTypeDeclaration.java
--- kjc-suite-2.1B/src/kjc/JTypeDeclaration.java 2002-07-15 20:53:33.000000000 +0200
-+++ kjc-suite-2.1B.new/src/kjc/JTypeDeclaration.java 2004-01-27 20:58:22.000000000 +0100
++++ kjc-suite-2.1B.new/src/kjc/JTypeDeclaration.java 2004-02-13 21:23:15.000000000 +0100
@@ -340,7 +340,7 @@
*
* @exception PositionedError Error catched as soon as possible
@@ -536,10 +808,10 @@
}
// ----------------------------------------------------------------------
-diff -N -x Kjc.java -x '*~' -ur kjc-suite-2.1B/src/kjc/JUnaryExpression.java kjc-suite-2.1B.new/src/kjc/JUnaryExpression.java
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JUnaryExpression.java kjc-suite-2.1B.new/src/kjc/JUnaryExpression.java
--- kjc-suite-2.1B/src/kjc/JUnaryExpression.java 2002-07-15 20:53:32.000000000 +0200
-+++ kjc-suite-2.1B.new/src/kjc/JUnaryExpression.java 2004-01-25 19:44:49.000000000 +0100
-@@ -53,6 +53,10 @@
++++ kjc-suite-2.1B.new/src/kjc/JUnaryExpression.java 2004-02-13 21:23:15.000000000 +0100
+@@ -53,6 +53,14 @@
return type;
}
@@ -547,12 +819,16 @@
+ return expr.isFullyAnalysed();
+ }
+
++ public boolean dependsOnField(CField field) {
++ return expr.dependsOnField(field);
++ }
++
// ----------------------------------------------------------------------
// DATA MEMBERS
// ----------------------------------------------------------------------
-diff -N -x Kjc.java -x '*~' -ur kjc-suite-2.1B/src/kjc/JUnaryMinusExpression.java kjc-suite-2.1B.new/src/kjc/JUnaryMinusExpression.java
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JUnaryMinusExpression.java kjc-suite-2.1B.new/src/kjc/JUnaryMinusExpression.java
--- kjc-suite-2.1B/src/kjc/JUnaryMinusExpression.java 2002-07-15 20:53:32.000000000 +0200
-+++ kjc-suite-2.1B.new/src/kjc/JUnaryMinusExpression.java 2004-01-25 20:10:41.000000000 +0100
++++ kjc-suite-2.1B.new/src/kjc/JUnaryMinusExpression.java 2004-02-13 21:51:10.000000000 +0100
@@ -49,7 +49,8 @@
// ----------------------------------------------------------------------
// SEMANTIC ANALYSIS
@@ -563,32 +839,34 @@
/**
* Analyses the expression (semantically).
* @param context the analysis context
-@@ -68,7 +69,8 @@
+@@ -68,6 +69,9 @@
expr = expr.analyse(context);
check(context, expr.getType(factory).isNumeric(), KjcMessages.UNARY_BADTYPE_PM, expr.getType(factory));
type = CNumericType.unaryPromote(context, expr.getType(factory));
-- expr = expr.convertType(context, type);
-+ if (expr.isFullyAnalysed())
-+ expr = expr.convertType(context, type);
++ if (!expr.isFullyAnalysed())
++ return this;
++
+ expr = expr.convertType(context, type);
if (expr.isConstant()) {
- switch (type.getTypeID()) {
-diff -N -x Kjc.java -x '*~' -ur kjc-suite-2.1B/src/kjc/JUnaryPlusExpression.java kjc-suite-2.1B.new/src/kjc/JUnaryPlusExpression.java
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JUnaryPlusExpression.java kjc-suite-2.1B.new/src/kjc/JUnaryPlusExpression.java
--- kjc-suite-2.1B/src/kjc/JUnaryPlusExpression.java 2002-07-15 20:53:32.000000000 +0200
-+++ kjc-suite-2.1B.new/src/kjc/JUnaryPlusExpression.java 2004-01-25 20:10:35.000000000 +0100
-@@ -61,7 +61,8 @@
++++ kjc-suite-2.1B.new/src/kjc/JUnaryPlusExpression.java 2004-02-13 21:51:26.000000000 +0100
+@@ -61,8 +61,10 @@
expr = expr.analyse(context);
check(context, expr.getType(factory).isNumeric(), KjcMessages.UNARY_BADTYPE_PM, expr.getType(factory));
type = CNumericType.unaryPromote(context, expr.getType(factory));
- expr = expr.convertType(context, type);
-+ if (expr.isFullyAnalysed())
-+ expr = expr.convertType(context, type);
++ if (!expr.isFullyAnalysed())
++ return this;
++ expr = expr.convertType(context, type);
return expr;
}
-diff -N -x Kjc.java -x '*~' -ur kjc-suite-2.1B/src/kjc/JVariableDefinition.java kjc-suite-2.1B.new/src/kjc/JVariableDefinition.java
+
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/JVariableDefinition.java kjc-suite-2.1B.new/src/kjc/JVariableDefinition.java
--- kjc-suite-2.1B/src/kjc/JVariableDefinition.java 2002-07-15 20:53:32.000000000 +0200
-+++ kjc-suite-2.1B.new/src/kjc/JVariableDefinition.java 2004-01-28 17:52:20.000000000 +0100
++++ kjc-suite-2.1B.new/src/kjc/JVariableDefinition.java 2004-02-13 21:23:15.000000000 +0100
@@ -142,8 +142,17 @@
check(context,
expr.isAssignableTo(context, type),
@@ -616,27 +894,9 @@
+
+ protected boolean analysed_definition;
}
-diff -N -x Kjc.java -x '*~' -ur kjc-suite-2.1B/src/kjc/KjcScanner.java kjc-suite-2.1B.new/src/kjc/KjcScanner.java
---- kjc-suite-2.1B/src/kjc/KjcScanner.java 2004-01-29 19:10:58.000000000 +0100
-+++ kjc-suite-2.1B.new/src/kjc/KjcScanner.java 2004-01-28 20:56:26.000000000 +0100
-@@ -1,4 +1,4 @@
--/* The following code was generated by JFlex 1.3.2 on 29-Jan-04 7:10:57 PM */
-+/* The following code was generated by JFlex 1.3.2 on 28-Jan-04 8:56:25 PM */
-
- /*
- * Copyright (C) 1990-2001 DMS Decision Management Systems Ges.m.b.H.
-@@ -37,7 +37,7 @@
- /**
- * This class is a scanner generated by
- * <a href="http://www.jflex.de/">JFlex</a> 1.3.2
-- * on 29-Jan-04 7:10:57 PM from the specification file
-+ * on 28-Jan-04 8:56:25 PM from the specification file
- * <tt>file:/mnt/external2/guilhem_ext2/PROJECTS/kaffe-extras/build/kjc-suite-2.1B/src/kjc/Kjc.flex</tt>
- */
- public class KjcScanner extends at.dms.compiler.tools.antlr.extra.Scanner implements KjcTokenTypes {
-diff -N -x Kjc.java -x '*~' -ur kjc-suite-2.1B/src/kjc/Main.java kjc-suite-2.1B.new/src/kjc/Main.java
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/Main.java kjc-suite-2.1B.new/src/kjc/Main.java
--- kjc-suite-2.1B/src/kjc/Main.java 2002-07-15 20:53:32.000000000 +0200
-+++ kjc-suite-2.1B.new/src/kjc/Main.java 2004-01-27 21:08:46.000000000 +0100
++++ kjc-suite-2.1B.new/src/kjc/Main.java 2004-02-13 21:23:15.000000000 +0100
@@ -171,13 +171,18 @@
return false;
}
@@ -677,9 +937,9 @@
}
}
-diff -N -x Kjc.java -x '*~' -ur kjc-suite-2.1B/src/kjc/Makefile kjc-suite-2.1B.new/src/kjc/Makefile
---- kjc-suite-2.1B/src/kjc/Makefile 2004-01-29 19:10:43.000000000 +0100
-+++ kjc-suite-2.1B.new/src/kjc/Makefile 2004-01-27 21:03:26.000000000 +0100
+diff -N -ur -x KjcParser.java -x KjcScanner.java -x '*~' kjc-suite-2.1B/src/kjc/Makefile kjc-suite-2.1B.new/src/kjc/Makefile
+--- kjc-suite-2.1B/src/kjc/Makefile 2004-02-14 13:55:21.000000000 +0100
++++ kjc-suite-2.1B.new/src/kjc/Makefile 2004-02-13 21:23:15.000000000 +0100
@@ -54,7 +54,8 @@
CSourceMethod CStdType \
CSwitchBodyContext CSwitchGroupContext \
More information about the kaffe
mailing list