diff --git a/Website/JavaTXExamples.zip b/Website/JavaTXExamples.zip new file mode 100644 index 00000000..db9eb324 Binary files /dev/null and b/Website/JavaTXExamples.zip differ diff --git a/Website/index.html b/Website/index.html new file mode 100644 index 00000000..0253da16 --- /dev/null +++ b/Website/index.html @@ -0,0 +1,88 @@ + + +Java-TX Plugin +
+

Java-TX Plugin

+
+

Content

+ + +
+

Introduction

+Java-TX (Java Type eXtended) is an extension of Java in which a global type inference algorithm and real function types are added. Since the end of the nineties features from functional program- ming languages have been transferred to Java. Parametric polymorphism extended by wildcards, called generics, were transfered to Java 5.0. Higher-order functions and lambda expression were introduced in Java 8. Java 8 uses functional interfaces as target types of lambda expressions in contrast to real function types as in functional programming languages. +The powerful feature type inference from functional programming languages is incorporated into Java, as into other object-oriented +languages, i.e. only in a restricted way called local type inference. Local type inference allows certain type annotations to be omitted. For instance, it is often not necessary to specify the type of a variable. Type parameters of classes in the new-statement can be left out. Return types of methods can often also be omitted. Local type inference is at its most pronounced in Scala. In Java 10 an extention of local type inference is introduced, where types of local variables can be replaced by the keyword var and inferred automatically during the compilation. In contrast to global type inference, local type inference allows types of recursive methods and lambda expressions not to be omitted.
+The Java-TX project contributes to the design of object-oriented languages by developing global type inference algorithms for Java-like languages. + +

First Example

+The class Id has the method id. The type annotations are omitted. +
+ +
 
+  class Id {
+      id(x) {
+          return x;
+      }
+  } 
+ 
+The type inference algorithm inferrs the types, such that Id can be applied: +
+    new Id().id(1);
+
+    new Id().id("hallo");
+
+ +

More complex example

+
+  import java.lang.Integer;
+  import java.lang.Double; 
+  import java.lang.String; 
+
+
+  class OL {
+     m(x) { return x + x; }
+	
+  }
+    
+         
+  class OLMain {
+     main(x) { 
+	var ol;
+	ol = new OL(); 
+	return ol.m(x); 
+     }  
+  }
+
+The type inference mechanism considers only imported types. Therefore Integer Double, and String are imported. +
+As the operator + is overloaded by all numeric types and String the methods m in the class OL and main in the class OLMain, respectively, gets all these types. The generated classfile demonstrates this: +
+> javap OL.class 
+Compiled from "OL.jav"
+class OL {
+  public OL();
+  public java.lang.Integer m(java.lang.Integer);
+  public java.lang.Double m(java.lang.Double);
+}
+
+> javap OLMain.class 
+Compiled from "OLMain.jav"
+class OLMain {
+  public OLMain();
+  public java.lang.Integer main(java.lang.Integer);
+  public java.lang.Double main(java.lang.Double);
+}
+
+ + +
+
+Last modified: Fri Jun 1 16:43:55 CEST 2018 + diff --git a/Website/install/Restart.png b/Website/install/Restart.png new file mode 100644 index 00000000..5d3c3efc Binary files /dev/null and b/Website/install/Restart.png differ diff --git a/Website/install/availableSoftware1.png b/Website/install/availableSoftware1.png new file mode 100644 index 00000000..22097efe Binary files /dev/null and b/Website/install/availableSoftware1.png differ diff --git a/Website/install/availableSoftware2.png b/Website/install/availableSoftware2.png new file mode 100644 index 00000000..7bdb93cc Binary files /dev/null and b/Website/install/availableSoftware2.png differ diff --git a/Website/install/instal.html b/Website/install/instal.html new file mode 100644 index 00000000..4b4e91c7 --- /dev/null +++ b/Website/install/instal.html @@ -0,0 +1,40 @@ + + +Install Java-TX Plugin + + + +

Install Java-TX Plugin

+
    +
  1. Select "Install New Software ..."
    + + +
  2. +
  3. Add ...
    + +
  4. +
  5. Insert address
    + +
  6. +
  7. Select installation
    + +
  8. +
  9. Installation details
    + +
  10. +
  11. Accept license agreement
    + +
  12. +
  13. Install anyway
    + +
  14. +
  15. Restart
    + +
  16. +
+ + +
+
+Last modified: Fri Jun 1 11:57:15 CEST 2018 + diff --git a/Website/install/install.html b/Website/install/install.html new file mode 100644 index 00000000..11801117 --- /dev/null +++ b/Website/install/install.html @@ -0,0 +1,40 @@ + + +Install Java-TX Plugin + + + +

Install Java-TX Plugin

+
    +
  1. Select "Install New Software ..."
    + + +
  2. +
  3. Add ...
    + +
  4. +
  5. Insert address
    + +
  6. +
  7. Select installation
    + +
  8. +
  9. Installation details
    + +
  10. +
  11. Accept license agreement
    + +
  12. +
  13. Install anyway
    + +
  14. +
  15. Restart
    + +
  16. +
+ + +
+
+Last modified: Fri Jun 1 12:05:43 CEST 2018 + diff --git a/Website/install/installAnyway.png b/Website/install/installAnyway.png new file mode 100644 index 00000000..1e879655 Binary files /dev/null and b/Website/install/installAnyway.png differ diff --git a/Website/install/installationDetails.png b/Website/install/installationDetails.png new file mode 100644 index 00000000..3032caa3 Binary files /dev/null and b/Website/install/installationDetails.png differ diff --git a/Website/install/licenseAgreement.png b/Website/install/licenseAgreement.png new file mode 100644 index 00000000..4c20ccbb Binary files /dev/null and b/Website/install/licenseAgreement.png differ diff --git a/Website/install/newsoftware.png b/Website/install/newsoftware.png new file mode 100644 index 00000000..65c7005f Binary files /dev/null and b/Website/install/newsoftware.png differ diff --git a/Website/install/selectInstallation.png b/Website/install/selectInstallation.png new file mode 100644 index 00000000..eb9a3cdf Binary files /dev/null and b/Website/install/selectInstallation.png differ diff --git a/Website/newJavaTXProject/addLibrary2.png b/Website/newJavaTXProject/addLibrary2.png new file mode 100644 index 00000000..e008eeab Binary files /dev/null and b/Website/newJavaTXProject/addLibrary2.png differ diff --git a/Website/newJavaTXProject/buildPath1.png b/Website/newJavaTXProject/buildPath1.png new file mode 100644 index 00000000..e008eeab Binary files /dev/null and b/Website/newJavaTXProject/buildPath1.png differ diff --git a/Website/newJavaTXProject/buildPath2.png b/Website/newJavaTXProject/buildPath2.png new file mode 100644 index 00000000..920cc968 Binary files /dev/null and b/Website/newJavaTXProject/buildPath2.png differ diff --git a/Website/newJavaTXProject/buildPath3.png b/Website/newJavaTXProject/buildPath3.png new file mode 100644 index 00000000..8a7877c6 Binary files /dev/null and b/Website/newJavaTXProject/buildPath3.png differ diff --git a/Website/newJavaTXProject/buildPath4.png b/Website/newJavaTXProject/buildPath4.png new file mode 100644 index 00000000..1c3dd338 Binary files /dev/null and b/Website/newJavaTXProject/buildPath4.png differ diff --git a/Website/newJavaTXProject/newJavFile.png b/Website/newJavaTXProject/newJavFile.png new file mode 100644 index 00000000..85049267 Binary files /dev/null and b/Website/newJavaTXProject/newJavFile.png differ diff --git a/Website/newJavaTXProject/newJavFolder1.png b/Website/newJavaTXProject/newJavFolder1.png new file mode 100644 index 00000000..73e82fee Binary files /dev/null and b/Website/newJavaTXProject/newJavFolder1.png differ diff --git a/Website/newJavaTXProject/newJavFolder2.png b/Website/newJavaTXProject/newJavFolder2.png new file mode 100644 index 00000000..47e33951 Binary files /dev/null and b/Website/newJavaTXProject/newJavFolder2.png differ diff --git a/Website/newJavaTXProject/newJavaTXProject.html b/Website/newJavaTXProject/newJavaTXProject.html new file mode 100644 index 00000000..263e4044 --- /dev/null +++ b/Website/newJavaTXProject/newJavaTXProject.html @@ -0,0 +1,34 @@ + + + + +

New Java-TX project in eclipse

+
    +
  1. New -> Java Project
    + +
  2. +
    +
  3. Generate a jav-File folder
    +

    + +
  4. +
    +
  5. Add jav-File folder as library
    + At the moment no package system is implemented, Therefore the compiled class files are in the jav-File folder. This has to be added as library:
    +

    +

    +

    +
    + + +
  6. +
+ +

+ + + +
+
+Last modified: Fri Jun 1 16:50:02 CEST 2018 + diff --git a/Website/newJavaTXProject/newJavaTXProject.png b/Website/newJavaTXProject/newJavaTXProject.png new file mode 100644 index 00000000..57fc7727 Binary files /dev/null and b/Website/newJavaTXProject/newJavaTXProject.png differ diff --git a/Website/usePlugin/usePlugin.html b/Website/usePlugin/usePlugin.html new file mode 100644 index 00000000..45e744cf --- /dev/null +++ b/Website/usePlugin/usePlugin.html @@ -0,0 +1,24 @@ + + +Using the plugin + +

Using the plugin

+
    +
  1. Overview
    + +
  2. +
    +
  3. Select types
    + If the method is overloaded the user can select types in the outline the right mouse button:

    +
    +
  4. +
+ +

+ + + +
+
+Last modified: Fri Jun 1 16:51:28 CEST 2018 + diff --git a/Website/usePlugin/usePlugin1.png b/Website/usePlugin/usePlugin1.png new file mode 100644 index 00000000..c6f47149 Binary files /dev/null and b/Website/usePlugin/usePlugin1.png differ diff --git a/Website/usePlugin/usePlugin2.png b/Website/usePlugin/usePlugin2.png new file mode 100644 index 00000000..aefeb0bf Binary files /dev/null and b/Website/usePlugin/usePlugin2.png differ diff --git a/test/bytecode/javFiles/OL.jav b/test/bytecode/javFiles/OL.jav index fd2c30a4..6489d572 100644 --- a/test/bytecode/javFiles/OL.jav +++ b/test/bytecode/javFiles/OL.jav @@ -1,18 +1,16 @@ import java.lang.Integer; -import java.lang.Double; +import java.lang.Double; +import java.lang.String; -class OL { +class OL { - m(java.lang.Double x) { return x + x; } + m(x) { return x + x; } - //m(x) { return x || x; } - - - } - +} + -class Main { +class OLMain { main(x) { var ol;