We have discussed integrating the approach somewhat with the X10
compiler to avoid the need to mirror the compiler transformations.
This will involve propagating annotations into the generated Java
code.

Stay tuned.
        Igor

"Myoungkyu Song" <mks...@vt.edu> wrote on 10/28/2010 10:11:36 PM:

> >So for an X10 programmer to use this, what do they need?
> 
> An X10 programmer needs our separate tool: the PBSE translator and the
> code-generator (related to JUnit API).
> 
> 
> 
> >So they need a version of the compiler that includes some code from 
your
> group..?
> 
> We tested x10 sources under x10c-version-2.0.4, in order to generate the
> corresponding Java files.
> 
> 
> 
> >They need a separate tool which knows how to process .pbse files, and 
apply
> them to X10 source? 
> 
> Yes, they need a separate tool which is the PBSE translator which can be
> parameterized by PBSE to apply to Java source files generated from X10.
> 
> 
> 
> >If so, does your tool understand X10 AST structure/type structure etc.?
> 
> Rather than understanding X10 AST/Type directly, we used Java AST 
toolkit
> from Eclipse JDT. Since we managed X10-PBSE version and JAVA-PBSE one, 
when
> the X10 programmers write X10-PBSE version, our tool converts the PBSE 
into
> JAVA-PBSE version.
> 
> 
> 
> Best regards,
> 
> Myoungkyu Song
> 
> 
> 
> From: Vijay Saraswat [mailto:vi...@saraswat.org] 
> Sent: Thursday, October 28, 2010 9:42 PM
> To: Myoungkyu Song
> Cc: Eli Tilevich
> Subject: Re: [X10-users] JUnit ???
> 
> 
> 
> So for an X10 programmer to use this, what do they need?
> 
> So they need a version of the compiler that includes some code from your
> group..?
> 
> They need a separate tool which knows how to process .pbse files, and 
apply
> them to X10 source? (If so, des your tool understand X10 AST 
structure/type
> structure etc.)?
> 
> Also can you reply to the list?
> 
> 
> 
> On 10/28/2010 9:33 PM, Myoungkyu Song wrote: 
> 
> Hello, Vijay
> 
> 
> 
> I am not sure if our approach fits with what you tried to do, but let me
> explain our idea. Our approach consists of writing an X10 source
> (TestCompute.java) and PBSE metadata specifications (TestCompute.pbse &
> x10_to_java.pbse). It is necessary to declare your methods in the PBSE
> specification. Then, the generated Java source (TestCompute.java) from 
X10
> is annotated with JUnit annotation. Attached is the JUnit test driver 
class
> which can be generated automatically by our tool. And I added our 
submitted
> IPDPS and AOSD2010 papers which explain the details.
> 
> 
> 
> Best regards,
> 
> Myoungkyu Song
> 
> 
> 
> //---------------------------------------------------
> 
> // TestCompute.x10
> 
> //---------------------------------------------------
> 
> package compute;
> 
> import x10.io.Console;
> 
> 
> 
> public class TestCompute {
> 
>        public def testAQuadCompute() {
> 
>               var l:double = 0;
> 
>               var r:double = 100;
> 
>               var sum:double = 2.5005000000000417E7;
> 
>               val result = Compute.AQuad.computeArea(l, r);
> 
>               Console.OUT.println("AQuad Result: " + result);
> 
>               JUnitTestDriver.assertEquals(sum, result);
> 
>        }
> 
> 
> 
>        public def testSQuadCompute() {..}
> 
>        public def testFQuadCompute() {..}
> 
>        public def testDQuadCompute() {..}
> 
> }
> 
> //---------------------------------------------------
> 
> // TestCompute.pbse
> 
> //---------------------------------------------------
> 
> Metadata MyJUit<Package p>
> 
>        Class c in p
> 
>        Where(public class Test*)
> 
>               Method<c>
> 
> 
> 
> Metadata Method<Class c>
> 
>        Method m in c
> 
>        Where (public def test*)
> 
>               m...@test
> 
> 
> 
> MyJUnit<"compute">
> 
> //---------------------------------------------------
> 
> // x10_to_java.pbse
> 
> //---------------------------------------------------
> 
> MetaMetadata PBSEX10toJava<PBSE x10>
> 
>        where w in x10
> 
>               Class c in w
> 
>                      Where (public struct *)
> 
>                            Replace "struct" with "class"
> 
> 
> 
>               Field f in w
> 
>                      Where (private * ${temp1}:${temp2})
> 
>                            Switch ${temp1} and ${temp2}
> 
>                      Where (private * *:*)
> 
>                            Replace ":" with "\s"
> 
>                      Where (private val *:*)
> 
>                            Replace "val" with "final"
> 
>                      Where (private var *:*)
> 
>                            Remove "var"
> 
> 
> 
>               Method m in w
> 
>                      Where (* def *:${returntype})
> 
>                            Replace "def" with ${returntype}
> 
> //---------------------------------------------------
> 
> // TestCompute.java
> 
> //---------------------------------------------------
> 
> package compute;
> 
> import org.junit.Test;
> 
> 
> 
> public class TestCompute extends x10.core.Ref {
> 
>        public static final x10.rtt.RuntimeType<compute.TestCompute> _RTT
> = new 
x10.rtt.RuntimeType<compute.TestCompute>(compute.TestCompute.class,
> new x10.rtt.Type[] { x10.rtt.Types.runtimeType(java.lang.Object.class) 
});
> 
> 
> 
>        public x10.rtt.RuntimeType getRTT() {
> 
>               return _RTT;
> 
>        }
> 
> 
> 
>        @Test
> 
>        public void testAQuadCompute() {
> 
>               double l = ((double) (int) (((int) (0))));
> 
>               double r = ((double) (int) (((int) (100))));
> 
>               double sum = 2.5005000000000417E7;
> 
>               final double result =
> compute.Compute.AQuad.computeArea((double) (l), (double) (r));
> 
>               x10.io.Console.OUT.println((("AQuad Result: ") + 
(result)));
> 
>               compute.JUnitTestDriver.assertEquals((double) (sum), 
(double)
> (result));
> 
>        }
> 
> 
> 
>        @Test
> 
>        public void testSQuadCompute() { .. }
> 
> 
> 
>        @Test
> 
>        public void testFQuadCompute() { .. }
> 
> 
> 
>        @Test
> 
>        public void testDQuadCompute() { .. }
> 
> 
> 
>        public TestCompute() {
> 
>               super();
> 
>        }
> 
> }
-- 
Igor Peshansky  (note the spelling change!)
IBM T.J. Watson Research Center
X10: Parallel Productivity and Performance (http://x10-lang.org/)
XJ: No More Pain for XML's Gain (http://www.research.ibm.com/xj/)
"I hear and I forget.  I see and I remember.  I do and I understand" -- 
Xun Zi


------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to