diff --git a/compiler/2014/CS_CodeGen.jrag b/compiler/2014/CS_CodeGen.jrag index e1da497f2601fa68727e527a94e6f90287e804df..69f50b6f98a488e197f9756b4420df0e5decdc4c 100644 --- a/compiler/2014/CS_CodeGen.jrag +++ b/compiler/2014/CS_CodeGen.jrag @@ -210,7 +210,7 @@ aspect CS_CodeGen { env.indent(); } env.println("using System;"); - env.println("using se.lth.control.labcomm;"); + env.println("using se.lth.control.labcomm2014;"); for (int i = 0; i < getNumDecl(); i++) { Decl d = getDecl(i); try { diff --git a/examples/robot/Program.cs b/examples/robot/Program.cs index 56cfb271d07a42885f8e5790b2eed23adebbc894..49a0a925070f3f1a2feca2b5bcb9356574019235 100644 --- a/examples/robot/Program.cs +++ b/examples/robot/Program.cs @@ -1,4 +1,4 @@ -using se.lth.control.labcomm; +using se.lth.control.labcomm2014; using System; using System.Collections.Generic; using System.Linq; diff --git a/examples/user_types/.gitignore b/examples/user_types/.gitignore index 30cd2538504300d26b4a1e42482cf823cfa9f4ae..711968fb67b7a45c107a2b3a0dcf57484f1f9c2f 100644 --- a/examples/user_types/.gitignore +++ b/examples/user_types/.gitignore @@ -1,5 +1,5 @@ gen -labcomm.dll +labcomm2014.dll ExampleDecoder.exe ExampleEncoder.exe encoded_data_c diff --git a/examples/user_types/ExampleDecoder.cs b/examples/user_types/ExampleDecoder.cs index 95b1fca4e2bf1d0adc4bad67823137b03980163c..77666728c6e59b68b105677090166e8749a2e6a2 100644 --- a/examples/user_types/ExampleDecoder.cs +++ b/examples/user_types/ExampleDecoder.cs @@ -1,87 +1,87 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.IO; -using se.lth.control.labcomm; - -namespace user_types -{ - class Decoder : twoLines.Handler, - twoInts.Handler, - theFirstInt.Handler, - theSecondInt.Handler, - doavoid.Handler, - intAndRef.Handler - { - DecoderChannel dec; - - public Decoder(Stream stream) - { - dec = new DecoderChannel(stream); - twoLines.register(dec, this); - twoInts.register(dec, this); - theFirstInt.register(dec, this); - theSecondInt.register(dec, this); - doavoid.register(dec, this); - intAndRef.register(dec, this); - doavoid.registerSampleRef(dec); - try - { - Console.WriteLine("Running decoder."); - dec.run(); - } - catch (EndOfStreamException) - { - Console.WriteLine("EOF reached"); - } - } - - private string genPoint(point p) - { - return "(" + p.x.val + ", " + p.y.val + ")"; - } - private String genLine(line l) - { - return "Line from " + genPoint(l.start) + " to " + genPoint(l.end); - } - public void handle(twoLines d) - { - Console.WriteLine("Got twoLines: "); - Console.WriteLine("Line l1: "+genLine(d.l1)); - Console.WriteLine("Line l2: " + genLine(d.l2)); - } - - public void handle(twoInts d) - { - Console.WriteLine("Got twoInts: "); - Console.WriteLine("a: "+d.a); - Console.WriteLine("b: "+d.b); - } - - void theFirstInt.Handler.handle(int d) - { - Console.WriteLine("Got theFirstInt: "+d); - } - - void theSecondInt.Handler.handle(int d) - { - Console.WriteLine("Got theSecondInt: "+d); - } - - void doavoid.Handler.handle() - { - Console.WriteLine("Got a void."); - } - - void intAndRef.Handler.handle(intAndRef d) - { - Console.WriteLine("Got intAndRef: "+d.x+" : "+d.reference); - } - - static void Main(string[] args) - { - new Decoder(new FileStream(args[0], FileMode.Open)); - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.IO; +using se.lth.control.labcomm2014; + +namespace user_types +{ + class Decoder : twoLines.Handler, + twoInts.Handler, + theFirstInt.Handler, + theSecondInt.Handler, + doavoid.Handler, + intAndRef.Handler + { + DecoderChannel dec; + + public Decoder(Stream stream) + { + dec = new DecoderChannel(stream); + twoLines.register(dec, this); + twoInts.register(dec, this); + theFirstInt.register(dec, this); + theSecondInt.register(dec, this); + doavoid.register(dec, this); + intAndRef.register(dec, this); + doavoid.registerSampleRef(dec); + try + { + Console.WriteLine("Running decoder."); + dec.run(); + } + catch (EndOfStreamException) + { + Console.WriteLine("EOF reached"); + } + } + + private string genPoint(point p) + { + return "(" + p.x.val + ", " + p.y.val + ")"; + } + private String genLine(line l) + { + return "Line from " + genPoint(l.start) + " to " + genPoint(l.end); + } + public void handle(twoLines d) + { + Console.WriteLine("Got twoLines: "); + Console.WriteLine("Line l1: "+genLine(d.l1)); + Console.WriteLine("Line l2: " + genLine(d.l2)); + } + + public void handle(twoInts d) + { + Console.WriteLine("Got twoInts: "); + Console.WriteLine("a: "+d.a); + Console.WriteLine("b: "+d.b); + } + + void theFirstInt.Handler.handle(int d) + { + Console.WriteLine("Got theFirstInt: "+d); + } + + void theSecondInt.Handler.handle(int d) + { + Console.WriteLine("Got theSecondInt: "+d); + } + + void doavoid.Handler.handle() + { + Console.WriteLine("Got a void."); + } + + void intAndRef.Handler.handle(intAndRef d) + { + Console.WriteLine("Got intAndRef: "+d.x+" : "+d.reference); + } + + static void Main(string[] args) + { + new Decoder(new FileStream(args[0], FileMode.Open)); + } + } +} diff --git a/examples/user_types/ExampleEncoder.cs b/examples/user_types/ExampleEncoder.cs index c2e2fa9dfa087345cb714441d90075270797c386..d9cfc77635896c4415588a4f0948df0fb938d3b7 100644 --- a/examples/user_types/ExampleEncoder.cs +++ b/examples/user_types/ExampleEncoder.cs @@ -1,85 +1,85 @@ -using System; -using System.IO; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using se.lth.control.labcomm; - -namespace user_types -{ - public class Encoder - { - private EncoderChannel enc; - public Encoder(Stream stream) - { - enc = new EncoderChannel(stream); - twoLines.register(enc); - } - - public void doEncode() - { - twoLines x = new twoLines(); - line l1 = new line(); - point p11 = new point(); - coord c11x = new coord(); - coord c11y = new coord(); - c11x.val = 11; - c11y.val = 99; - p11.x = c11x; - p11.y = c11y; - - l1.start = p11; - - point p12 = new point(); - coord c12x = new coord(); - coord c12y = new coord(); - c12x.val = 22; - c12y.val = 88; - p12.x = c12x; - p12.y = c12y; - - l1.end = p12; - - line l2 = new line(); - point p21 = new point(); - coord c21x = new coord(); - coord c21y = new coord(); - c21x.val = 17; - c21y.val = 42; - p21.x = c21x; - p21.y = c21y; - - l2.start = p21; - - point p22 = new point(); - coord c22x = new coord(); - coord c22y = new coord(); - c22x.val = 13; - c22y.val = 37; - p22.x = c22x; - p22.y = c22y; - - l2.end = p22; - - foo f = new foo(); - f.a = 10; - f.b = 20; - f.c = false; - - x.l1 = l1; - x.l2 = l2; - x.f = f; - - Console.WriteLine("Encoding theTwoLines"); - twoLines.encode(enc, x); - } - - static void Main(string[] args) - { - FileStream stream = new FileStream(args[0],FileMode.Create); - Encoder example = new Encoder(stream); - example.doEncode(); - stream.Close(); - } - } -} +using System; +using System.IO; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using se.lth.control.labcomm2014; + +namespace user_types +{ + public class Encoder + { + private EncoderChannel enc; + public Encoder(Stream stream) + { + enc = new EncoderChannel(stream); + twoLines.register(enc); + } + + public void doEncode() + { + twoLines x = new twoLines(); + line l1 = new line(); + point p11 = new point(); + coord c11x = new coord(); + coord c11y = new coord(); + c11x.val = 11; + c11y.val = 99; + p11.x = c11x; + p11.y = c11y; + + l1.start = p11; + + point p12 = new point(); + coord c12x = new coord(); + coord c12y = new coord(); + c12x.val = 22; + c12y.val = 88; + p12.x = c12x; + p12.y = c12y; + + l1.end = p12; + + line l2 = new line(); + point p21 = new point(); + coord c21x = new coord(); + coord c21y = new coord(); + c21x.val = 17; + c21y.val = 42; + p21.x = c21x; + p21.y = c21y; + + l2.start = p21; + + point p22 = new point(); + coord c22x = new coord(); + coord c22y = new coord(); + c22x.val = 13; + c22y.val = 37; + p22.x = c22x; + p22.y = c22y; + + l2.end = p22; + + foo f = new foo(); + f.a = 10; + f.b = 20; + f.c = false; + + x.l1 = l1; + x.l2 = l2; + x.f = f; + + Console.WriteLine("Encoding theTwoLines"); + twoLines.encode(enc, x); + } + + static void Main(string[] args) + { + FileStream stream = new FileStream(args[0],FileMode.Create); + Encoder example = new Encoder(stream); + example.doEncode(); + stream.Close(); + } + } +} diff --git a/examples/user_types/Makefile b/examples/user_types/Makefile index 7603ffd308aedc0b23d1399d0050c1a257f34c27..3edbeea1fa722f6a3e6d4b16fc9eb9818109297b 100644 --- a/examples/user_types/Makefile +++ b/examples/user_types/Makefile @@ -34,15 +34,15 @@ ${LCLJAR} : cleanbuild: clean build -labcomm.dll: - ln -sf ../../lib/csharp/labcomm.dll $@ +labcomm2014.dll: + ln -sf ../../lib/csharp/labcomm2014.dll $@ -ExampleEncoder.exe: ExampleEncoder.cs gen/test.cs labcomm.dll Makefile - mcs -out:$@ $(filter %.cs, $^) -lib:../../lib/csharp/ -r:labcomm +ExampleEncoder.exe: ExampleEncoder.cs gen/test.cs labcomm2014.dll Makefile + mcs -out:$@ $(filter %.cs, $^) -lib:../../lib/csharp/ -r:labcomm2014 chmod a+x $@ -ExampleDecoder.exe: ExampleDecoder.cs gen/test.cs labcomm.dll Makefile - mcs -out:$@ $(filter %.cs, $^) -lib:../../lib/csharp/ -r:labcomm +ExampleDecoder.exe: ExampleDecoder.cs gen/test.cs labcomm2014.dll Makefile + mcs -out:$@ $(filter %.cs, $^) -lib:../../lib/csharp/ -r:labcomm2014 chmod a+x $@ build : diff --git a/lib/csharp/.gitignore b/lib/csharp/.gitignore index 7252dda3fb2158fc919cd5132fa2aec35d82ef86..75dc324a513f08f46d387ada99191807a2060ec5 100644 --- a/lib/csharp/.gitignore +++ b/lib/csharp/.gitignore @@ -1 +1 @@ -labcomm.dll +labcomm2014.dll diff --git a/lib/csharp/Makefile b/lib/csharp/Makefile index 7dfb2de341bb094c32d1e1f63c06af0ed6aa7aaa..c689902e17402080d3f993ed7d9f00763c5967e1 100644 --- a/lib/csharp/Makefile +++ b/lib/csharp/Makefile @@ -11,9 +11,9 @@ MODULES=Constant\ SampleType .PHONY: all -all: labcomm.dll +all: labcomm2014.dll -labcomm.dll: $(MODULES:%=se/lth/control/labcomm/%.cs) Makefile +labcomm2014.dll: $(MODULES:%=se/lth/control/labcomm2014/%.cs) Makefile mcs -out:$@ -target:library $(filter %.cs, $^) .PHONY: test @@ -24,4 +24,4 @@ clean: .PHONY: distclean distclean: - rm -f labcomm.dll + rm -f labcomm2014.dll diff --git a/lib/csharp/se/lth/control/labcomm/Constant.cs b/lib/csharp/se/lth/control/labcomm2014/Constant.cs similarity index 96% rename from lib/csharp/se/lth/control/labcomm/Constant.cs rename to lib/csharp/se/lth/control/labcomm2014/Constant.cs index 37615448d0cec858190bbb16dd9a465677a8ccbb..19f18ad519e9bb5995ab65552cfc9cc7d08da3e5 100644 --- a/lib/csharp/se/lth/control/labcomm/Constant.cs +++ b/lib/csharp/se/lth/control/labcomm2014/Constant.cs @@ -1,4 +1,4 @@ -namespace se.lth.control.labcomm { +namespace se.lth.control.labcomm2014 { public class Constant { diff --git a/lib/csharp/se/lth/control/labcomm/Decoder.cs b/lib/csharp/se/lth/control/labcomm2014/Decoder.cs similarity index 91% rename from lib/csharp/se/lth/control/labcomm/Decoder.cs rename to lib/csharp/se/lth/control/labcomm2014/Decoder.cs index 4e8868fc7bc86949897b90911522c865bbc56887..ddc3b59f52fa9483332f5c358d00ee4a18d92dcf 100644 --- a/lib/csharp/se/lth/control/labcomm/Decoder.cs +++ b/lib/csharp/se/lth/control/labcomm2014/Decoder.cs @@ -1,6 +1,6 @@ using System; -namespace se.lth.control.labcomm { +namespace se.lth.control.labcomm2014 { public interface Decoder { diff --git a/lib/csharp/se/lth/control/labcomm/DecoderChannel.cs b/lib/csharp/se/lth/control/labcomm2014/DecoderChannel.cs similarity index 99% rename from lib/csharp/se/lth/control/labcomm/DecoderChannel.cs rename to lib/csharp/se/lth/control/labcomm2014/DecoderChannel.cs index 99e17fbac0f6065f3364c72dddfe1bce78808cb9..a56a6042af37e455eea0766e82901264714e93b3 100644 --- a/lib/csharp/se/lth/control/labcomm/DecoderChannel.cs +++ b/lib/csharp/se/lth/control/labcomm2014/DecoderChannel.cs @@ -1,4 +1,4 @@ -namespace se.lth.control.labcomm { +namespace se.lth.control.labcomm2014 { using System; using System.IO; diff --git a/lib/csharp/se/lth/control/labcomm/DecoderRegistry.cs b/lib/csharp/se/lth/control/labcomm2014/DecoderRegistry.cs similarity index 98% rename from lib/csharp/se/lth/control/labcomm/DecoderRegistry.cs rename to lib/csharp/se/lth/control/labcomm2014/DecoderRegistry.cs index 132e37b1849c965a51093fc403f277b1bc615394..bebcff26c7355a184b471234ca85f72043d0f493 100644 --- a/lib/csharp/se/lth/control/labcomm/DecoderRegistry.cs +++ b/lib/csharp/se/lth/control/labcomm2014/DecoderRegistry.cs @@ -1,4 +1,4 @@ -namespace se.lth.control.labcomm { +namespace se.lth.control.labcomm2014 { using System; using System.Collections.Generic; diff --git a/lib/csharp/se/lth/control/labcomm/Encoder.cs b/lib/csharp/se/lth/control/labcomm2014/Encoder.cs similarity index 93% rename from lib/csharp/se/lth/control/labcomm/Encoder.cs rename to lib/csharp/se/lth/control/labcomm2014/Encoder.cs index 1deb1b7ee9d28e52c952eb78aaef1c7fe7cf3db7..4aac7b3ac949019684b969d462cf8d93b0b4c4e7 100644 --- a/lib/csharp/se/lth/control/labcomm/Encoder.cs +++ b/lib/csharp/se/lth/control/labcomm2014/Encoder.cs @@ -1,4 +1,4 @@ -namespace se.lth.control.labcomm { +namespace se.lth.control.labcomm2014 { using System; diff --git a/lib/csharp/se/lth/control/labcomm/EncoderChannel.cs b/lib/csharp/se/lth/control/labcomm2014/EncoderChannel.cs similarity index 98% rename from lib/csharp/se/lth/control/labcomm/EncoderChannel.cs rename to lib/csharp/se/lth/control/labcomm2014/EncoderChannel.cs index 2f3da1cc99cc0c1abe24fa991fc31d73eb4fef96..20536e4d79c192deba72cd20958554eb51a93939 100644 --- a/lib/csharp/se/lth/control/labcomm/EncoderChannel.cs +++ b/lib/csharp/se/lth/control/labcomm2014/EncoderChannel.cs @@ -1,4 +1,4 @@ -namespace se.lth.control.labcomm { +namespace se.lth.control.labcomm2014 { using System; using System.IO; diff --git a/lib/csharp/se/lth/control/labcomm/EncoderRegistry.cs b/lib/csharp/se/lth/control/labcomm2014/EncoderRegistry.cs similarity index 96% rename from lib/csharp/se/lth/control/labcomm/EncoderRegistry.cs rename to lib/csharp/se/lth/control/labcomm2014/EncoderRegistry.cs index 9c40028567ac2d3df3080e6d2fd88d7e796a6d4f..6c299296cf98aa5e63ff07feb6a712cb55e3a526 100644 --- a/lib/csharp/se/lth/control/labcomm/EncoderRegistry.cs +++ b/lib/csharp/se/lth/control/labcomm2014/EncoderRegistry.cs @@ -1,4 +1,4 @@ -namespace se.lth.control.labcomm { +namespace se.lth.control.labcomm2014 { using System; using System.Collections.Generic; diff --git a/lib/csharp/se/lth/control/labcomm/Sample.cs b/lib/csharp/se/lth/control/labcomm2014/Sample.cs similarity index 66% rename from lib/csharp/se/lth/control/labcomm/Sample.cs rename to lib/csharp/se/lth/control/labcomm2014/Sample.cs index c9ea7fde821102bea58948af6e7fb188abd8caf2..5162c9325b9cb61a48ff4553004fd378e166c081 100644 --- a/lib/csharp/se/lth/control/labcomm/Sample.cs +++ b/lib/csharp/se/lth/control/labcomm2014/Sample.cs @@ -1,4 +1,4 @@ -namespace se.lth.control.labcomm { +namespace se.lth.control.labcomm2014 { public interface Sample { diff --git a/lib/csharp/se/lth/control/labcomm/SampleDispatcher.cs b/lib/csharp/se/lth/control/labcomm2014/SampleDispatcher.cs similarity index 85% rename from lib/csharp/se/lth/control/labcomm/SampleDispatcher.cs rename to lib/csharp/se/lth/control/labcomm2014/SampleDispatcher.cs index 23d39ed510ac07653c753e201f452788a97a901f..b7104d1c28c98e4607858fd6e7958fd5a7022122 100644 --- a/lib/csharp/se/lth/control/labcomm/SampleDispatcher.cs +++ b/lib/csharp/se/lth/control/labcomm2014/SampleDispatcher.cs @@ -1,4 +1,4 @@ -namespace se.lth.control.labcomm { +namespace se.lth.control.labcomm2014 { using System; diff --git a/lib/csharp/se/lth/control/labcomm/SampleHandler.cs b/lib/csharp/se/lth/control/labcomm2014/SampleHandler.cs similarity index 51% rename from lib/csharp/se/lth/control/labcomm/SampleHandler.cs rename to lib/csharp/se/lth/control/labcomm2014/SampleHandler.cs index d30cd2623c954dcb22917225d46ed79a4d6dc3f3..fa6e9a35b8ebfb0f309823591b485ddc3af5bc51 100644 --- a/lib/csharp/se/lth/control/labcomm/SampleHandler.cs +++ b/lib/csharp/se/lth/control/labcomm2014/SampleHandler.cs @@ -1,4 +1,4 @@ -namespace se.lth.control.labcomm { +namespace se.lth.control.labcomm2014 { public interface SampleHandler { } diff --git a/lib/csharp/se/lth/control/labcomm/SampleType.cs b/lib/csharp/se/lth/control/labcomm2014/SampleType.cs similarity index 100% rename from lib/csharp/se/lth/control/labcomm/SampleType.cs rename to lib/csharp/se/lth/control/labcomm2014/SampleType.cs diff --git a/test/Makefile b/test/Makefile index 106810bafe9053807a2f59f8a46212d13853afad..57e86848bb81fc751e43fe167f58f168a81bb62b 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,5 +1,5 @@ TESTS=basic simple nested ref -LABCOMM_JAR=../compiler/labcomm_compiler.jar +LABCOMM_JAR=../compiler/labcomm2014_compiler.jar LABCOMM=java -jar $(LABCOMM_JAR) include ../lib/c/os_compat.mk @@ -78,13 +78,13 @@ gen/%/cs_relay.cs: gen/%/typeinfo relay_gen_cs.py Makefile ./relay_gen_cs.py $< > $@ .PRECIOUS: gen/%/labcomm.dll -gen/%/labcomm.dll: - ln -s ../../../lib/csharp/labcomm.dll $@ +gen/%/labcomm2014.dll: + ln -s ../../../lib/csharp/labcomm2014.dll $@ .PRECIOUS: gen/%/cs_relay.exe gen/%/cs_relay.exe: gen/%/cs_relay.cs gen/%/cs_code.cs \ - gen/%/labcomm.dll Makefile - mcs -out:$@ $(filter %.cs, $^) -lib:../lib/csharp/ -r:labcomm + gen/%/labcomm2014.dll Makefile + mcs -out:$@ $(filter %.cs, $^) -lib:../lib/csharp/ -r:labcomm2014 # Java relay test rules .PRECIOUS: gen/%/java_code diff --git a/test/relay_gen_cs.py b/test/relay_gen_cs.py index 8cd90431bd9cf4eee5bc747f613651f3c6999cbe..e5698aa06fbf0714fc8c6c1c9a561510fb7d076e 100755 --- a/test/relay_gen_cs.py +++ b/test/relay_gen_cs.py @@ -30,7 +30,7 @@ if __name__ == '__main__': result.extend(split_match('^[^|]*\|(.*)$', """ |using System; |using System.IO; - |using se.lth.control.labcomm; + |using se.lth.control.labcomm2014; | |public class cs_relay : """))