-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from xtuml/master
Update fork
- Loading branch information
Showing
29 changed files
with
304 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
domain EnumDefaultValue is | ||
|
||
public type Colour is enum ( black, white ); | ||
|
||
public type properties is structure | ||
foreground : Colour := black; | ||
background : Colour := Colour.white; | ||
end structure; | ||
|
||
end domain; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
domain EnumDefaultValue is | ||
object Screen; | ||
|
||
public type Colour is enum ( black, white ); | ||
|
||
public type properties is structure | ||
foreground : Colour := black; | ||
background : Colour := Colour.white; | ||
end structure; | ||
|
||
object Screen is | ||
id : preferred integer; | ||
foreground : Colour := black; | ||
background : Colour := Colour.white; | ||
end object; | ||
|
||
end domain; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
domain Colouring is | ||
public type PrimaryColour is enum (red, green, blue); | ||
public type RainbowColour is enum (red, orange, yellow, green, blue, indigo, violet); | ||
|
||
public service test(); | ||
end domain; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
domain Colouring is | ||
public type PrimaryColour is enum (red, green, blue); | ||
public type RainbowColour is enum (red, orange, yellow, green, blue, indigo, violet); | ||
|
||
public service test(); | ||
end domain; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
public service Colouring::test() is | ||
rainbow : RainbowColour; | ||
primary : PrimaryColour; | ||
name : string; | ||
begin | ||
|
||
rainbow := Colouring::RainbowColour.indigo; // Explicit domain and type scope. No ambiguity. | ||
rainbow := RainbowColour.indigo; // Explicit Type scope. No ambiguity. | ||
rainbow := Colouring::indigo; // Explicit domain scope. No ambiguity. | ||
rainbow := indigo; // No scope, No ambiguity. | ||
|
||
primary := Colouring::PrimaryColour.red; // Explicit domain and type scope. No ambiguity. | ||
primary := PrimaryColour.red; // Explicit Type scope. No ambiguity. | ||
primary := Colouring::red; // Explicit domain scope. Ambiguity resolved by examining the assigned to type. | ||
primary := red; // No scope. Ambiguity resolved by examining the assigned to type. | ||
|
||
name := Colouring::RainbowColour.indigo'image; // Explicit domain and type scope. No ambiguity. | ||
name := RainbowColour.indigo'image; // Explicit Type scope. No ambiguity. | ||
name := Colouring::indigo'image; // Explicit domain scope. No ambiguity. | ||
name := indigo'image; // No scope, No ambiguity. | ||
|
||
name := Colouring::PrimaryColour.red'image; // Explicit domain and type scope. No ambiguity. | ||
name := PrimaryColour.red'image; // Explicit Type scope. No ambiguity. | ||
|
||
// The lines commented out below would raise a semantic error, as the ambiguity cannot be resolved. | ||
// name := Colouring::red'image; // Explicit domain scope. ERROR - Ambiguous enumerator name. | ||
// name := red'image; // No scope. ERROR - Ambiguous enumerator name. | ||
|
||
end service; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
domain SvcFnOverload is | ||
public service foo() return boolean; | ||
public service foo(); | ||
|
||
public service test(); | ||
end domain; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
domain SvcFnOverload is | ||
public service foo() return boolean; | ||
public service foo(); | ||
|
||
public service test(); | ||
end domain; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
service SvcFnOverload::test() is | ||
result : boolean; | ||
begin | ||
foo(); // This is a 'domain service call' | ||
result := foo(); // This is a 'domain fn call' | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
domain FindExpression is | ||
|
||
public service test(); | ||
|
||
end domain; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
domain FindExpression is | ||
object Dog; | ||
object Person; | ||
|
||
public service test(); | ||
|
||
relationship R1 is | ||
Person conditionally owns many Dog, | ||
Dog conditionally is_owned_by one Person; | ||
|
||
object Person is | ||
name : preferred string; | ||
end object; | ||
|
||
object Dog is | ||
name : preferred string; | ||
owner : referential (R1.is_owned_by.Person.name) string; | ||
breed : string; | ||
end object; | ||
end domain; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
public service FindExpression::test() is | ||
d : set of instance of Dog; | ||
p : instance of Person; | ||
begin | ||
// p := find_one Person (name = "Fred"); | ||
d := p->R1(breed = "poodle"); | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
domain IntegerAssignment is | ||
public service test(); | ||
end domain; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
domain IntegerAssignment is | ||
public service test(); | ||
end domain; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
public service IntegerAssignment::test() is | ||
l : long_integer; | ||
i : integer; | ||
begin | ||
l := 0; | ||
i := 0; | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
domain SuperSubNavigate is | ||
|
||
public service test(); | ||
|
||
end domain; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
domain SuperSubNavigate is | ||
|
||
object Animal; | ||
object Dog; | ||
|
||
public service test(); | ||
|
||
relationship R1 is Animal is_a ( Dog ); | ||
|
||
object Animal is | ||
name : preferred string; | ||
end object; | ||
|
||
object Dog is | ||
name : preferred referential (R1.name) string; | ||
end object; | ||
|
||
end domain; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
public service SuperSubNavigate::test() is | ||
animal : instance of Animal; | ||
dog : instance of Dog; | ||
animals : set of instance of Animal; | ||
dogs : set of instance of Dog; | ||
begin | ||
animal := dog->R1; | ||
dog := animal->R1; | ||
animals := dogs->R1; | ||
dogs := animals->R1; | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
domain RecursiveStructure is | ||
public type Component; | ||
public type Device; | ||
|
||
public type Device is structure | ||
components: sequence of Component; | ||
end structure; | ||
|
||
public type Component is structure | ||
subDevices : sequence of Device; | ||
subComponents : sequence of Component; | ||
end structure; | ||
|
||
public service test(); | ||
|
||
end domain; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
domain RecursiveStructure is | ||
public type Component; | ||
public type Device; | ||
|
||
public type Device is structure | ||
components: sequence of Component; | ||
end structure; | ||
|
||
public type Component is structure | ||
subDevices : sequence of Device; | ||
subComponents : sequence of Component; | ||
end structure; | ||
|
||
public service test(); | ||
|
||
end domain; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
public service RecursiveStructure::test() is | ||
component : Component; | ||
device : Device; | ||
components : sequence of Component; | ||
devices : sequence of Device; | ||
begin | ||
components := component.subComponents; | ||
devices := component.subDevices; | ||
components := device.components; | ||
|
||
components := component.subComponents[0].subComponents; | ||
devices := device.components[0].subDevices; | ||
components := device.components[0].subComponents; | ||
|
||
component.subDevices := 1; | ||
end service; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
domain foo is | ||
|
||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
domain foo is | ||
service foo(); | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
service foo::foo() is | ||
i : integer; | ||
r : real; | ||
begin | ||
i := 255; | ||
i := 2#11111111; | ||
i := 8#377; | ||
i := 16#FF; | ||
i := 36#73; | ||
|
||
r := 10.25; | ||
r := 2#1010.01; | ||
r := 2#1.01001#+3; | ||
r := 16#a.4; | ||
r := 16#A4#-1; | ||
r := 36#A.9; | ||
r := 36#0.0A9#2; | ||
end; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
domain ScheduledEvents is | ||
|
||
public service test(); | ||
|
||
end domain; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
domain ScheduledEvents is | ||
object Test; | ||
|
||
public service test(); | ||
|
||
object Test is | ||
id : preferred unique integer; | ||
timerId : timer; | ||
|
||
state Exists(); | ||
event SomethingHappened(); | ||
|
||
transition is | ||
Non_Existent ( SomethingHappened => Cannot_Happen ); | ||
Exists ( SomethingHappened => Exists ); | ||
end transition; | ||
end object; | ||
end domain; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
public service ScheduledEvents::test() is | ||
obj : instance of Test; | ||
begin | ||
obj := create Test( Current_State => Exists ); | ||
|
||
// Christmas | ||
schedule obj.timerId generate Test.SomethingHappened() to obj at @2017-12-25@; | ||
|
||
// Noon every Wednesday | ||
schedule obj.timerId generate Test.SomethingHappened() to obj at @2017-04-19T12:00:00Z@ delta @PT24H@; | ||
|
||
// Same time tomorrow | ||
schedule obj.timerId generate Test.SomethingHappened() to obj delay @P1D@; | ||
|
||
// Every hour | ||
schedule obj.timerId generate Test.SomethingHappened() to obj delay @PT0S@ delta @PT1H@; | ||
end service; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
domain MultiValuedPragma is | ||
public service foo(); pragma ids ("one", "two", "three"); | ||
public service bar(); pragma id ("one"); pragma id ("two"); pragma id ("three"); | ||
end domain; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
domain MultiValuedPragma is | ||
public service foo(); pragma ids ("one", "two", "three"); | ||
public service bar(); pragma id ("one"); pragma id ("two"); pragma id ("three"); | ||
end domain; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters