diff --git a/Website/Installation/install.html b/Website/Installation/install.html new file mode 100644 index 000000000..eb3fa7fdd --- /dev/null +++ b/Website/Installation/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 16:52:13 CEST 2018 + diff --git a/Website/JavaTXExamples.zip b/Website/JavaTXExamples.zip new file mode 100644 index 000000000..db9eb324b 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 000000000..0253da16e --- /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 000000000..5d3c3efc7 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 000000000..22097efef 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 000000000..7bdb93cc8 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 000000000..4b4e91c70 --- /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 000000000..11801117b --- /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 000000000..1e8796556 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 000000000..3032caa3b 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 000000000..4c20ccbb3 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 000000000..65c7005fb 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 000000000..eb9a3cdf3 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 000000000..e008eeab3 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 000000000..e008eeab3 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 000000000..920cc9685 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 000000000..8a7877c63 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 000000000..1c3dd3381 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 000000000..850492679 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 000000000..73e82fee1 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 000000000..47e339516 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 000000000..263e40445 --- /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 000000000..57fc7727f 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 000000000..45e744cfb --- /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 000000000..c6f47149e 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 000000000..aefeb0bfc 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 fd2c30a4b..6489d5721 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;