summaryrefslogtreecommitdiff
path: root/tutorial/examples/order2
diff options
context:
space:
mode:
Diffstat (limited to 'tutorial/examples/order2')
-rw-r--r--tutorial/examples/order2/Printer.java46
-rw-r--r--tutorial/examples/order2/Printer.oj33
-rw-r--r--tutorial/examples/order2/Test.java34
-rw-r--r--tutorial/examples/order2/Test.oj11
4 files changed, 124 insertions, 0 deletions
diff --git a/tutorial/examples/order2/Printer.java b/tutorial/examples/order2/Printer.java
new file mode 100644
index 0000000..5e2994d
--- /dev/null
+++ b/tutorial/examples/order2/Printer.java
@@ -0,0 +1,46 @@
+/*
+ * This code was generated by ojc.
+ */
+/*
+ * Printer.java
+ *
+ */
+package examples.order2;
+
+
+import openjava.mop.*;
+
+
+public class Printer extends openjava.mop.OJClass
+{
+
+ public void translateDefinition()
+ {
+ openjava.mop.OJClass base = getSuperclass();
+ System.out.println( "I'm " + getName() + "." );
+ System.out.println( getName() + " finished." );
+ }
+
+ public void translateDefinition0()
+ {
+ openjava.mop.OJClass base = getSuperclass();
+ System.out.println( "I'm " + getName() + "." + " " + "After You, " + base.getName() + "." );
+ try {
+ waitTranslation( base );
+ } catch ( java.lang.Exception e ) {
+ System.err.println( e.toString() );
+ }
+ System.out.println( getName() + " finished." );
+ }
+
+ public Printer( openjava.mop.Environment oj_param0, openjava.mop.OJClass oj_param1, openjava.ptree.ClassDeclaration oj_param2 )
+ {
+ super( oj_param0, oj_param1, oj_param2 );
+ }
+
+ public Printer( java.lang.Class oj_param0, openjava.mop.MetaInfo oj_param1 )
+ {
+ super( oj_param0, oj_param1 );
+ }
+
+}
diff --git a/tutorial/examples/order2/Printer.oj b/tutorial/examples/order2/Printer.oj
new file mode 100644
index 0000000..2bb433e
--- /dev/null
+++ b/tutorial/examples/order2/Printer.oj
@@ -0,0 +1,33 @@
+/*
+ * Printer.java
+ *
+ */
+package examples.order2;
+
+
+import openjava.mop.*;
+
+
+public class Printer instantiates Metaclass extends OJClass
+{
+ public void translateDefinition() {
+ OJClass base = getSuperclass();
+ System.out.println("I'm " + getName() + ".");
+
+ System.out.println(getName() + " finished.");
+ }
+
+ public void translateDefinition0() {
+ OJClass base = getSuperclass();
+ System.out.println( "I'm " + getName() + "." + " " +
+ "After You, " + base.getName() + "." );
+
+ try {
+ waitTranslation( base );
+ } catch ( Exception e ) {
+ System.err.println( e.toString() );
+ }
+
+ System.out.println( getName() + " finished." );
+ }
+}
diff --git a/tutorial/examples/order2/Test.java b/tutorial/examples/order2/Test.java
new file mode 100644
index 0000000..81cb268
--- /dev/null
+++ b/tutorial/examples/order2/Test.java
@@ -0,0 +1,34 @@
+/*
+ * This code was generated by ojc.
+ */
+package examples.order2;
+
+
+public class Test extends examples.order2.E
+{
+}
+
+
+class B extends examples.order2.A
+{
+}
+
+
+class E extends examples.order2.D
+{
+}
+
+
+class C extends examples.order2.B
+{
+}
+
+
+class D extends examples.order2.C
+{
+}
+
+
+class A extends java.lang.Object
+{
+}
diff --git a/tutorial/examples/order2/Test.oj b/tutorial/examples/order2/Test.oj
new file mode 100644
index 0000000..0d3284a
--- /dev/null
+++ b/tutorial/examples/order2/Test.oj
@@ -0,0 +1,11 @@
+package examples.order2;
+
+public class Test instantiates Printer extends E
+{
+}
+
+class B instantiates Printer extends A {}
+class E instantiates Printer extends D {}
+class C instantiates Printer extends B {}
+class D instantiates Printer extends C {}
+class A extends Object {}