Wiki

Ticket #275: java-jvm-7a.patch

File java-jvm-7a.patch, 4.5 KB (added by hopscc, 12 years ago)
  • Source/Cobra.Core/Java/mkjarAll

     
    88 
    99[ -d classes ] || mkdir classes 
    1010[ -d classes/cobra/lang ] && rm -rf classes/cobra/lang/* 
    11 EXCEPTIONS="AssertException.java InvariantException.java RequireException.java EnsureException.java NonNilCastException.java DynamicOperationException.java ExpectException.java CheckedExceptionWrapper.java" 
    12 javac -d classes SourceSite.java CobraImp.java CobraCore.java Delegate.java DelegateO.java Pair.java ${EXCEPTIONS} CobraDirectString.java 
     11 
     12source javaRtlSources 
     13javac -Xlint:unchecked -d classes ${RTL_SRCS} 
    1314[ $? == 0 ] || exit 
    1415 
    1516jar cvf ${CORE_RTL} -C classes . 
  • Source/Cobra.Core/Java/mkjar

     
    77 
    88[ -d classes ] || mkdir classes 
    99[ -d classes/cobra/lang ] && rm -rf classes/cobra/lang/* 
    10 EXCEPTIONS="AssertException.java InvariantException.java RequireException.java EnsureException.java NonNilCastException.java DynamicOperationException.java ExpectException.java CheckedExceptionWrapper.java" 
    11 javac -Xlint:unchecked -d classes SourceSite.java CobraImp.java CobraCore.java Delegate.java DelegateO.java BasePair.java Pair.java ${EXCEPTIONS} CobraDirectString.java 
     10 
     11source javaRtlSources 
     12javac -Xlint:unchecked -d classes ${RTL_SRCS} 
    1213[ $? == 0 ] || exit 
    1314 
    1415jar cvf ${CORE_RTL} -C classes . 
  • Source/Cobra.Core/Java/mkjarOnly

     
    77 
    88[ -d classes ] || mkdir classes 
    99[ -d classes/cobra/lang ] && rm -rf classes/cobra/lang/* 
    10 EXCEPTIONS="AssertException.java InvariantException.java RequireException.java EnsureException.java NonNilCastException.java DynamicOperationException.java ExpectException.java CheckedExceptionWrapper.java" 
    11 javac -Xlint:unchecked -d classes SourceSite.java CobraImp.java CobraCore.java Delegate.java DelegateO.java Pair.java ${EXCEPTIONS} CobraDirectString.java 
     10 
     11source javaRtlSources 
     12javac -Xlint:unchecked -d classes ${RTL_SRCS} 
    1213[ $? == 0 ] || exit 
     14 
    1315jar cvf ${CORE_RTL} -C classes . 
    1416[ $? == 0 ] || exit 
    1517cp ${CORE_RTL} ../.. 
  • Source/Cobra.Core/Java/BasePair.java

     
     1/*  
     2 *  BasePair.java 
     3 * 
     4 *  Abstract base class for simple pair class hierarchy to satisfy RT requirements for compiler 
     5 * used by Pair.java et al 
     6 */  
     7 
     8package cobra.core; 
     9import java.util.*; 
     10 
     11public abstract class BasePair  { 
     12 
     13    protected  int _compare(Comparable<Object> a, Comparable<Object> b) { 
     14          /* 
     15           * Gracefully handle comparisons that involve nil. 
     16           * A simple `a.compareTo(b)` does not work if `a` can be `nil`. 
     17           */  
     18    if (a == null) 
     19            if (b == null)  
     20                return 0; 
     21        else  
     22                return -1; 
     23    else if (b == null) 
     24        return 1; 
     25    else 
     26        return a.compareTo(b); 
     27    } 
     28 
     29    public int size() { 
     30            return 2; 
     31       } 
     32 
     33} 
  • Source/Cobra.Core/Java/javaRTLSources

     
     1# List of java Source files for the jvm cobra Runtime Library 
     2# sourced into the mkjar* build  scripts 
     3# The RTL sources are currently all java src code, eventually when compiler  
     4# is more mature will migrate some/most to cobra sources 
     5 
     6EXCEPTIONS="AssertException.java InvariantException.java  
     7  RequireException.java EnsureException.java NonNilCastException.java  
     8  DynamicOperationException.java ExpectException.java  
     9  CheckedExceptionWrapper.java" 
     10 
     11RTL_SRCS="SourceSite.java CobraImp.java CobraCore.java  
     12  Delegate.java DelegateO.java BasePair.java Pair.java  
     13  ${EXCEPTIONS} CobraDirectString.java"