Generating Software from Specifications WS 2013/14 - Assignment 7
Published: Dec 5, 2013 -- Turn in until Dec 11, at 12h, 2012
What to turn in: see Assignment 1
Exercise 19 (Get up to date)
Get up to date with the solutions of the previous exercises.
Exercise 20 (Design a little language)
Specify a little domain-specific language and implement it up to and including the semantic analysis phase. The language is used to compose streams from declared components. Here is an initial example:
source: a 10, b 5; sink: x 20, y 5; connector: k 7, h 9, f 15, g 3; a -> f -> x; b -> h -> h -> k -> y; b -> x;
A Streams program consists of a sequence of definitions followed by a sequence of streams. Each definition introduces entities of one of three kinds: sources, sinks, and connectors. Each entity is bound to a name, and is defined to have a certain capacity given by a non-negative number. The names of the entities have to be pairwise different.
A stream in the second part of the program consists of a source and a sink, connected by a sequence of connectors. The source shall run on its full capacity. Hence, the capacity of the sink and of any connector in that stream must be at least as great as the capacity of the source of that stream.
Here is an erroneous program:
source: a 10, b 5; sink: x 20, y 5, z 1; /* z is multiply defined */ connector: k 7, h 9, f 15, g 3; connector: z 5; /* z is multiply defined */ a -> q -> x; /* q is undefined */ d -> h -> x; /* d is undefined */ a -> k -> x; /* k has too little capacity */ a -> y; /* y has too little capacity */ y -> x; /* y must be a source */ b -> h -> a; /* a must be a sink */
Specify a structuring phase and a semantic analysis which
checks all required restrictions.
blatt7/Streams
contains a file Streams.fw
which provides a structure and explanations for your solution.
Test your implementation.
Exercise 21 (Work on your project)
Make sure that you have a suitable plan for your DSL project. Update your project requirements as described in Exercise 18 of the previous Assignment, and turn it in.
Do not forget to take notes on what you did, what you learned, and which problems you encountered, and turn them in.Generiert mit Camelot | Probleme mit Camelot? | Geändert am: 11.12.2013