From: <ta...@us...> - 2008-11-07 19:30:31
|
Revision: 6689 http://x10.svn.sourceforge.net/x10/?rev=6689&view=rev Author: tardieu Date: 2008-11-07 19:30:28 +0000 (Fri, 07 Nov 2008) Log Message: ----------- fixed statics (XTENLANG-14) Modified Paths: -------------- trunk/x10.compiler.p3/data/Main.xcd trunk/x10.dist/bin/x10.in Modified: trunk/x10.compiler.p3/data/Main.xcd =================================================================== --- trunk/x10.compiler.p3/data/Main.xcd 2008-11-07 19:01:28 UTC (rev 6688) +++ trunk/x10.compiler.p3/data/Main.xcd 2008-11-07 19:30:28 UTC (rev 6689) @@ -1,23 +1,34 @@ // SYNOPSIS: main(#0) #1 -public static void main(final java.lang.String[] args) { +public static class Activity extends x10.runtime.Activity { + private final String[] args; - // create places; start native runtime; start main x10 thread - x10.runtime.impl.java.Runtime.start(x10.lang.Place.FIRST_PLACE, new java.lang.Runnable() { - public void run() { + public Activity(String[] args) { + this.args = args; + } - // start XRX in main x10 thread - x10.runtime.Runtime.start(new x10.runtime.Activity() { - public void runX10Task() { - - // run main - main(x10.core.RailFactory.<java.lang.String>makeRailFromJavaArray(args)); - } - }); - } - }); + public void runX10Task() { + main(x10.core.RailFactory.<java.lang.String>makeRailFromJavaArray(args)); + } } +public static class Main { + public static void main(final java.lang.String[] args) { + // main java thread + + // create places; start native runtime; start main x10 thread + x10.runtime.impl.java.Runtime.start(x10.lang.Place.FIRST_PLACE, new Runnable() { + + public void run() { + // main x10 thread + + // start xrx; execute main activity + x10.runtime.Runtime.start(new Activity(args)); + } + }); + } +} + // the original app-main method public static void main(#0) { #1 Modified: trunk/x10.dist/bin/x10.in =================================================================== --- trunk/x10.dist/bin/x10.in 2008-11-07 19:01:28 UTC (rev 6688) +++ trunk/x10.dist/bin/x10.in 2008-11-07 19:30:28 UTC (rev 6689) @@ -27,8 +27,8 @@ -dev) dev="true";; -J*) java_args="${java_args} '${1##-J}'";; -*) java_args="${java_args} -Dx10.${1##-}";; - *.x10) args="$args ${1%%.x10}";; - *) args="$args $*"; break;; + *.x10) args="$args '${1%%.x10}\$Main'";; + *) args="$args '$1\$Main'"; shift; args="$args $*"; break;; esac shift done This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |