/
TypeBlockSyntax.vb
356 lines (281 loc) · 12.9 KB
/
TypeBlockSyntax.vb
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
' Licensed to the .NET Foundation under one or more agreements.
' The .NET Foundation licenses this file to you under the MIT license.
' See the LICENSE file in the project root for more information.
Imports System.ComponentModel
Imports Microsoft.CodeAnalysis.Text
Imports Microsoft.CodeAnalysis.VisualBasic.Symbols
Imports Microsoft.CodeAnalysis.VisualBasic.Syntax
Namespace Microsoft.CodeAnalysis.VisualBasic.Syntax
Partial Public Class TypeBlockSyntax
''' <summary>
''' The statement that begins the block declaration.
''' </summary>
Public MustOverride ReadOnly Property BlockStatement As TypeStatementSyntax
''' <summary>
''' The statement that ends the block declaration.
''' </summary>
Public MustOverride ReadOnly Property EndBlockStatement As EndBlockStatementSyntax
''' <summary>
''' Returns a copy of this <see cref="TypeBlockSyntax"/> with the <see cref="BlockStatement"/> property changed to the
''' specified value. Returns this instance if the specified value is the same as the current value.
''' </summary>
Public MustOverride Function WithBlockStatement(blockStatement As TypeStatementSyntax) As TypeBlockSyntax
''' <summary>
''' Returns a copy of this <see cref="TypeBlockSyntax"/> with the <see cref="EndBlockStatement"/> property changed to the
''' specified value. Returns this instance if the specified value is the same as the current value.
''' </summary>
Public MustOverride Function WithEndBlockStatement(endBlockStatement As EndBlockStatementSyntax) As TypeBlockSyntax
<EditorBrowsable(EditorBrowsableState.Never)>
<Obsolete("This member is obsolete. Use BlockStatement or a more specific property (e.g. ClassStatement) instead.", True)>
Public ReadOnly Property Begin As TypeStatementSyntax
Get
Return BlockStatement
End Get
End Property
<EditorBrowsable(EditorBrowsableState.Never)>
<Obsolete("This member is obsolete. Use WithBlockStatement or a more specific property (e.g. WithClassStatement) instead.", True)>
Public Function WithBegin(begin As TypeStatementSyntax) As TypeBlockSyntax
Return WithBlockStatement(begin)
End Function
<EditorBrowsable(EditorBrowsableState.Never)>
<Obsolete("This member is obsolete. Use EndBlockStatement or a more specific property (e.g. EndClassStatement) instead.", True)>
Public ReadOnly Property [End] As EndBlockStatementSyntax
Get
Return EndBlockStatement
End Get
End Property
<EditorBrowsable(EditorBrowsableState.Never)>
<Obsolete("This member is obsolete. Use WithEndBlockStatement or a more specific property (e.g. WithEndClassStatement) instead.", True)>
Public Function WithEnd([end] As EndBlockStatementSyntax) As TypeBlockSyntax
Return WithEndBlockStatement([end])
End Function
End Class
Partial Public Class ClassBlockSyntax
Public Overrides ReadOnly Property BlockStatement As TypeStatementSyntax
Get
Return ClassStatement
End Get
End Property
Public Overrides ReadOnly Property EndBlockStatement As EndBlockStatementSyntax
Get
Return EndClassStatement
End Get
End Property
Public Overrides Function WithBlockStatement(blockStatement As TypeStatementSyntax) As TypeBlockSyntax
Return WithClassStatement(DirectCast(blockStatement, ClassStatementSyntax))
End Function
Public Overrides Function WithEndBlockStatement(endBlockStatement As EndBlockStatementSyntax) As TypeBlockSyntax
Return WithEndClassStatement(endBlockStatement)
End Function
<EditorBrowsable(EditorBrowsableState.Never)>
<Obsolete("This member is obsolete.", True)>
Public Shadows ReadOnly Property Begin As ClassStatementSyntax
Get
Return ClassStatement
End Get
End Property
<EditorBrowsable(EditorBrowsableState.Never)>
<Obsolete("This member is obsolete.", True)>
Public Shadows ReadOnly Property [End] As EndBlockStatementSyntax
Get
Return EndClassStatement
End Get
End Property
<EditorBrowsable(EditorBrowsableState.Never)>
<Obsolete("This member is obsolete.", True)>
Public Shadows Function WithBegin(begin As ClassStatementSyntax) As ClassBlockSyntax
Return WithClassStatement(begin)
End Function
<EditorBrowsable(EditorBrowsableState.Never)>
<Obsolete("This member is obsolete.", True)>
Public Shadows Function WithEnd([end] As EndBlockStatementSyntax) As ClassBlockSyntax
Return WithEndClassStatement([end])
End Function
End Class
Partial Public Class StructureBlockSyntax
Public Overrides ReadOnly Property BlockStatement As TypeStatementSyntax
Get
Return StructureStatement
End Get
End Property
Public Overrides ReadOnly Property EndBlockStatement As EndBlockStatementSyntax
Get
Return EndStructureStatement
End Get
End Property
Public Overrides Function WithBlockStatement(blockStatement As TypeStatementSyntax) As TypeBlockSyntax
Return WithStructureStatement(DirectCast(blockStatement, StructureStatementSyntax))
End Function
Public Overrides Function WithEndBlockStatement(endBlockStatement As EndBlockStatementSyntax) As TypeBlockSyntax
Return WithEndStructureStatement(endBlockStatement)
End Function
<EditorBrowsable(EditorBrowsableState.Never)>
<Obsolete("This member is obsolete.", True)>
Public Shadows ReadOnly Property Begin As StructureStatementSyntax
Get
Return StructureStatement
End Get
End Property
<EditorBrowsable(EditorBrowsableState.Never)>
<Obsolete("This member is obsolete.", True)>
Public Shadows ReadOnly Property [End] As EndBlockStatementSyntax
Get
Return EndStructureStatement
End Get
End Property
<EditorBrowsable(EditorBrowsableState.Never)>
<Obsolete("This member is obsolete.", True)>
Public Shadows Function WithBegin(begin As StructureStatementSyntax) As StructureBlockSyntax
Return WithStructureStatement(begin)
End Function
<EditorBrowsable(EditorBrowsableState.Never)>
<Obsolete("This member is obsolete.", True)>
Public Shadows Function WithEnd([end] As EndBlockStatementSyntax) As StructureBlockSyntax
Return WithEndStructureStatement([end])
End Function
End Class
Partial Public Class InterfaceBlockSyntax
Public Overrides ReadOnly Property BlockStatement As TypeStatementSyntax
Get
Return InterfaceStatement
End Get
End Property
Public Overrides ReadOnly Property EndBlockStatement As EndBlockStatementSyntax
Get
Return EndInterfaceStatement
End Get
End Property
Public Overrides Function WithBlockStatement(blockStatement As TypeStatementSyntax) As TypeBlockSyntax
Return WithInterfaceStatement(DirectCast(blockStatement, InterfaceStatementSyntax))
End Function
Public Overrides Function WithEndBlockStatement(endBlockStatement As EndBlockStatementSyntax) As TypeBlockSyntax
Return WithEndInterfaceStatement(endBlockStatement)
End Function
<EditorBrowsable(EditorBrowsableState.Never)>
<Obsolete("This member is obsolete.", True)>
Public Shadows ReadOnly Property Begin As InterfaceStatementSyntax
Get
Return InterfaceStatement
End Get
End Property
<EditorBrowsable(EditorBrowsableState.Never)>
<Obsolete("This member is obsolete.", True)>
Public Shadows ReadOnly Property [End] As EndBlockStatementSyntax
Get
Return EndInterfaceStatement
End Get
End Property
<EditorBrowsable(EditorBrowsableState.Never)>
<Obsolete("This member is obsolete.", True)>
Public Shadows Function WithBegin(begin As InterfaceStatementSyntax) As InterfaceBlockSyntax
Return WithInterfaceStatement(begin)
End Function
<EditorBrowsable(EditorBrowsableState.Never)>
<Obsolete("This member is obsolete.", True)>
Public Shadows Function WithEnd([end] As EndBlockStatementSyntax) As InterfaceBlockSyntax
Return WithEndInterfaceStatement([end])
End Function
End Class
Partial Public Class ModuleBlockSyntax
Public Overrides ReadOnly Property BlockStatement As TypeStatementSyntax
Get
Return ModuleStatement
End Get
End Property
Public Overrides ReadOnly Property EndBlockStatement As EndBlockStatementSyntax
Get
Return EndModuleStatement
End Get
End Property
Public Overrides Function WithBlockStatement(blockStatement As TypeStatementSyntax) As TypeBlockSyntax
Return WithModuleStatement(DirectCast(blockStatement, ModuleStatementSyntax))
End Function
Public Overrides Function WithEndBlockStatement(endBlockStatement As EndBlockStatementSyntax) As TypeBlockSyntax
Return WithEndModuleStatement(endBlockStatement)
End Function
<EditorBrowsable(EditorBrowsableState.Never)>
<Obsolete("This member is obsolete.", True)>
Public Shadows ReadOnly Property Begin As ModuleStatementSyntax
Get
Return ModuleStatement
End Get
End Property
<EditorBrowsable(EditorBrowsableState.Never)>
<Obsolete("This member is obsolete.", True)>
Public Shadows ReadOnly Property [End] As EndBlockStatementSyntax
Get
Return EndModuleStatement
End Get
End Property
<EditorBrowsable(EditorBrowsableState.Never)>
<Obsolete("This member is obsolete.", True)>
Public Shadows Function WithBegin(begin As ModuleStatementSyntax) As ModuleBlockSyntax
Return WithModuleStatement(begin)
End Function
<EditorBrowsable(EditorBrowsableState.Never)>
<Obsolete("This member is obsolete.", True)>
Public Shadows Function WithEnd([end] As EndBlockStatementSyntax) As ModuleBlockSyntax
Return WithEndModuleStatement([end])
End Function
End Class
End Namespace
Namespace Microsoft.CodeAnalysis.VisualBasic.Syntax.InternalSyntax
Partial Friend Class TypeBlockSyntax
''' <summary>
''' The statement that begins the block declaration.
''' </summary>
Public MustOverride ReadOnly Property BlockStatement As TypeStatementSyntax
''' <summary>
''' The statement that ends the block declaration.
''' </summary>
Public MustOverride ReadOnly Property EndBlockStatement As EndBlockStatementSyntax
End Class
Partial Friend Class ClassBlockSyntax
Public Overrides ReadOnly Property BlockStatement As TypeStatementSyntax
Get
Return ClassStatement
End Get
End Property
Public Overrides ReadOnly Property EndBlockStatement As EndBlockStatementSyntax
Get
Return EndClassStatement
End Get
End Property
End Class
Partial Friend Class StructureBlockSyntax
Public Overrides ReadOnly Property BlockStatement As TypeStatementSyntax
Get
Return StructureStatement
End Get
End Property
Public Overrides ReadOnly Property EndBlockStatement As EndBlockStatementSyntax
Get
Return EndStructureStatement
End Get
End Property
End Class
Partial Friend Class InterfaceBlockSyntax
Public Overrides ReadOnly Property BlockStatement As TypeStatementSyntax
Get
Return InterfaceStatement
End Get
End Property
Public Overrides ReadOnly Property EndBlockStatement As EndBlockStatementSyntax
Get
Return EndInterfaceStatement
End Get
End Property
End Class
Partial Friend Class ModuleBlockSyntax
Public Overrides ReadOnly Property BlockStatement As TypeStatementSyntax
Get
Return ModuleStatement
End Get
End Property
Public Overrides ReadOnly Property EndBlockStatement As EndBlockStatementSyntax
Get
Return EndModuleStatement
End Get
End Property
End Class
End Namespace