From bd0c3e82eba666d0110edb70246a8d58ca9cb7e9 Mon Sep 17 00:00:00 2001 From: K4r4c Date: Tue, 13 Jun 2017 18:33:39 +0200 Subject: [PATCH] set static public ports shared by all components in generated code --- reo-compiler/src/main/resources/Java.stg | 36 ++++++++---------------- 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/reo-compiler/src/main/resources/Java.stg b/reo-compiler/src/main/resources/Java.stg index 94ef1f87..a6282cdd 100644 --- a/reo-compiler/src/main/resources/Java.stg +++ b/reo-compiler/src/main/resources/Java.stg @@ -3,22 +3,16 @@ main(S) ::= << * Generated from by Reo 1.0. */ -import java.util.List; -import java.util.ArrayList; import nl.cwi.reo.runtime.*; public class { + + public static void main(String[] args) { - - List\> list = new ArrayList\<>(); - - - - - - + + @@ -40,16 +34,11 @@ package(p) ::= << >> newPort(p) ::= << -Port\<\> = new PortWaitNotify\<\>(); +public static Port\<\> = new PortWaitNotify\<\>(); >> -newComponentAtomic(c) ::= << -Component = new (}; separator=", ">); ->> - -newComponentProtocol(c) ::= << -);}; separator="\n"> -Component = new (list); +newComponent(c) ::= << +Component = new (); >> newThread(c) ::= << @@ -67,7 +56,6 @@ join(c) ::= << component(c) ::= << private static class implements Component { - @@ -143,16 +131,16 @@ memorycell(c) ::= << >> constructor(c) ::= << + + -public (\> }; separator=", ">) { +public () { .setConsumer(this);setProducer(this);}; separator="\n"> - = ;}; separator="\n"> activate(); } -public (List\> list) { - ).setProducer(this);setConsumer(this);}; separator="\n"> - = list.get();}; separator="\n"> +public () { + .setProducer(this);setConsumer(this);}; separator="\n"> activate(); }