-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstandard_types.bon
148 lines (126 loc) · 3.04 KB
/
standard_types.bon
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
system_chart STANDARD_TYPES
explanation "The standard types of the BON type checker"
cluster STANDARD_VALUE_TYPES
description "Standard value types that are defined by default."
cluster DATA_STRUCTURES
description "Standard data structures defined by default."
end
cluster_chart STANDARD_VALUE_TYPES
class BOOLEAN
description "A boolean type."
class CHARACTER
description "A character type."
class INTEGER
description "An integer type."
class REAL
description "A real type."
class STRING
description "A string type."
end
class_chart BOOLEAN
end
class_chart CHARACTER
end
class_chart INTEGER
inherit REAL
end
class_chart REAL
end
class_chart STRING
end
cluster_chart DATA_STRUCTURES
class ENUMERABLE
description "An enumerable type."
class CONTAINER
description "A type containing other elements."
class LIST
description "A list of elements."
class SET
description "A set of elements."
class TABLE
description "A table mapping from one type to another."
class ARRAY
description "An array of elements."
class TUPLE
description "A tuple of elements."
end
class_chart ENUMERABLE
end
class_chart CONTAINER
query
"How many elements do this container contain?"
end
class_chart LIST
inherit ENUMERABLE, CONTAINER
query
"Which element does this list have at position i?"
end
class_chart SET
inherit ENUMERABLE, CONTAINER
query
"What is one of the elements of this set?"
end
class_chart TABLE
query
"What are the keys of this table?",
"What are the values of this table?"
end
class_chart ARRAY
inherit ENUMERABLE, CONTAINER
query
"Which element does this array have at position i?"
end
class_chart TUPLE
end
static_diagram STANDARD_LIBRARIES
component
cluster STANDARD_VALUE_TYPES
component
class BOOLEAN
class CHARACTER
class INTEGER
inherit REAL
feature
as_real: REAL
end
class REAL
class STRING
end
cluster DATA_STRUCTURES
component
deferred class ENUMERABLE
deferred class CONTAINER[E]
feature
count: INTEGER
end
class LIST[E]
inherit
CONTAINER[E];
ENUMERABLE
feature
i_th: E
-> index: INTEGER
end
class SET[E]
inherit
CONTAINER[E];
ENUMERABLE
feature
any_item: E
end
class TABLE[K,V]
feature
keys: SET[K]
values: SET[V]
end
class ARRAY[E]
inherit
CONTAINER[E];
ENUMERABLE
feature
i_th: E
-> index: INTEGER
end
class TUPLE[G, H]
end
end