-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDomain.vb
More file actions
executable file
·194 lines (167 loc) · 6.96 KB
/
Domain.vb
File metadata and controls
executable file
·194 lines (167 loc) · 6.96 KB
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
'' ''____________________________________________________________________
'' ''
'' '' © Copyright 2008, PYCCA, Incorporated All rights reserved.
'' ''____________________________________________________________________
'' ''
'' '' $RCSfile: Domain.vb,v $
'' ''
'' '' $Revision: 1.1 $
'' ''
'' '' $Date: 2008/09/24 21:09:08 $
'' ''
'' '' $Author: thomasb $
'' ''
'' '' $Source: Domain.vb,v $
'' ''
'' '' $Name: $
'' ''____________________________________________________________________
' ''Public Class Domain
' '' Private _oSourceOutput As RichTextBox
' '' Private _oRepository As EA.Repository
' '' Private _sPackageId As String
' '' Private _oProject As EA.Project
' '' Private _oPackage As EA.Package
' '' Private _ClassById As Collection
' '' Private _Triggers As Collection
' '' Private _States As Collection
' '' Private _InitialStates As Collection
' '' Private _FinalStates As Collection
' '' Private _IgnoreIndicatorStates As Collection
' '' Private _IsRealized As Boolean
' '' Public ReadOnly Property IgnoreIndicatorStates() As Collection
' '' Get
' '' Return _IgnoreIndicatorStates
' '' End Get
' '' End Property
' '' Public ReadOnly Property InitialStates() As Collection
' '' Get
' '' Return _InitialStates
' '' End Get
' '' End Property
' '' Public ReadOnly Property FinalStates() As Collection
' '' Get
' '' Return _FinalStates
' '' End Get
' '' End Property
' '' Public ReadOnly Property States() As Collection
' '' Get
' '' Return _States
' '' End Get
' '' End Property
' '' Public ReadOnly Property EAClass(ByVal iID As Integer) As EA.Element
' '' Get
' '' Dim oClass As EA.Element = Nothing
' '' If _ClassById.Contains(iID.ToString) Then
' '' oClass = _ClassById.Item(iID.ToString)
' '' Else
' '' MsgBox("Unknown class id: " & iID, MsgBoxStyle.Critical)
' '' End If
' '' Return oClass
' '' End Get
' '' End Property
' '' Public ReadOnly Property IsRealized() As Boolean
' '' Get
' '' Return _IsRealized
' '' End Get
' '' End Property
' '' Public Sub New(ByRef oPackage As EA.Package, ByRef oRepository As EA.Repository, ByRef oSourceOutput As RichTextBox)
' '' Try
' '' _oSourceOutput = oSourceOutput
' '' _oRepository = oRepository
' '' _oPackage = oPackage
' '' _sPackageId = _oPackage.PackageID
' '' _ClassById = New Collection
' '' _Triggers = New Collection
' '' _States = New Collection
' '' _InitialStates = New Collection
' '' _FinalStates = New Collection
' '' _IgnoreIndicatorStates = New Collection
' '' _IsRealized = (_oPackage.StereotypeEx.IndexOf("realized") > -1)
' '' If Not _IsRealized Then
' '' catalogElements()
' '' generateSource()
' '' End If
' '' Catch ex As Exception
' '' Dim oErrorHandler As New sjmErrorHandler(ex)
' '' End Try
' '' End Sub
' '' Private Sub catalogElements()
' '' Dim oElement As EA.Element
' '' Try
' '' For Each oElement In _oPackage.Elements
' '' Select Case oElement.MetaType
' '' Case "FinalState"
' '' _FinalStates.Add(oElement, oElement.ElementID)
' '' _States.Add(oElement, oElement.ElementID)
' '' Case "Pseudostate"
' '' Select Case oElement.Name
' '' Case "Initial"
' '' _InitialStates.Add(oElement, oElement.ElementID)
' '' Case Else
' '' _IgnoreIndicatorStates.Add(oElement, oElement.ElementID)
' '' _States.Add(oElement, oElement.ElementID)
' '' End Select
' '' Case "Trigger"
' '' Debug.WriteLine("Trigger: " & oElement.Name & " has parent: " & oElement.ParentID)
' '' _Triggers.Add(oElement, oElement.Name)
' '' Case "StateNode"
' '' _States.Add(oElement, oElement.ElementID)
' '' Case "Class"
' '' _ClassById.Add(oElement, oElement.ElementID)
' '' Case "State"
' '' _States.Add(oElement, oElement.ElementID)
' '' Case Else
' '' Debug.WriteLine(oElement.Name & " is an unhandled metatype " & oElement.MetaType)
' '' End Select
' '' Next
' '' Catch ex As Exception
' '' Dim oErrorHandler As New sjmErrorHandler(ex)
' '' End Try
' '' End Sub
' '' Private Sub generateSource()
' '' Dim oClassElement As EA.Element
' '' Dim oEAClass As EAClass
' '' Try
' '' With _oSourceOutput
' '' .AppendText("")
' '' .AppendText("domain " & _oPackage.Name)
' '' If _oPackage.Notes.Length > 0 Then
' '' .AppendText(" // " & _oPackage.Notes)
' '' End If
' '' .AppendText(vbCrLf)
' '' For Each oClassElement In _ClassById
' '' If _sPackageId = oClassElement.PackageID Then
' '' oEAClass = New EAClass(oClassElement, Me, _oSourceOutput)
' '' End If
' '' Next
' '' addProlog()
' '' addEpilog()
' '' .AppendText("end")
' '' End With
' '' Catch ex As Exception
' '' Dim oErrorHandler As New sjmErrorHandler(ex)
' '' End Try
' '' End Sub
' '' Private Sub addProlog()
' '' With _oSourceOutput
' '' .AppendText(vbCrLf)
' '' .AppendText(" implementation prolog" & vbCrLf)
' '' .AppendText(" {" & vbCrLf)
' '' .AppendText(" #include <stdio.h>" & vbCrLf)
' '' .AppendText(" }" & vbCrLf)
' '' End With
' '' End Sub
' '' Private Sub addEpilog()
' '' With _oSourceOutput
' '' .AppendText(vbCrLf)
' '' .AppendText(" implementation epilog " & vbCrLf)
' '' .AppendText(" {" & vbCrLf)
' '' .AppendText(" Int()" & vbCrLf)
' '' .AppendText(" main()" & vbCrLf)
' '' .AppendText(" {" & vbCrLf)
' '' .AppendText(" return 0 ;" & vbCrLf)
' '' .AppendText(" }" & vbCrLf)
' '' .AppendText(" }" & vbCrLf)
' '' End With
' '' End Sub
' ''End Class