Migrated documents from aspclassiccompiler.codeplex.com
This commit is contained in:
parent
fe02219dac
commit
dbb36a62da
324 changed files with 75166 additions and 74841 deletions
71
License.txt
Normal file
71
License.txt
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
http://www.codeplex.com/ASPClassicCompiler/license
|
||||||
|
|
||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License.
|
||||||
|
|
||||||
|
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License.
|
||||||
|
|
||||||
|
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution.
|
||||||
|
|
||||||
|
You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
||||||
|
|
||||||
|
1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
2. You must cause any modified files to carry prominent notices stating that You changed the files; and
|
||||||
|
|
||||||
|
3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
||||||
|
|
||||||
|
4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions.
|
||||||
|
|
||||||
|
Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks.
|
||||||
|
|
||||||
|
This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability.
|
||||||
|
|
||||||
|
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability.
|
||||||
|
|
||||||
|
While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
|
@ -1,126 +1,126 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
Imports System.Xml
|
Imports System.Xml
|
||||||
|
|
||||||
Public Class TokenXmlSerializer
|
Public Class TokenXmlSerializer
|
||||||
Private ReadOnly Writer As XmlWriter
|
Private ReadOnly Writer As XmlWriter
|
||||||
|
|
||||||
Public Sub New(ByVal Writer As XmlWriter)
|
Public Sub New(ByVal Writer As XmlWriter)
|
||||||
Me.Writer = Writer
|
Me.Writer = Writer
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub Serialize(ByVal Span As Span)
|
Private Sub Serialize(ByVal Span As Span)
|
||||||
Writer.WriteAttributeString("startLine", CStr(Span.Start.Line))
|
Writer.WriteAttributeString("startLine", CStr(Span.Start.Line))
|
||||||
Writer.WriteAttributeString("startCol", CStr(Span.Start.Column))
|
Writer.WriteAttributeString("startCol", CStr(Span.Start.Column))
|
||||||
Writer.WriteAttributeString("endLine", CStr(Span.Finish.Line))
|
Writer.WriteAttributeString("endLine", CStr(Span.Finish.Line))
|
||||||
Writer.WriteAttributeString("endCol", CStr(Span.Finish.Column))
|
Writer.WriteAttributeString("endCol", CStr(Span.Finish.Column))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub Serialize(ByVal TypeCharacter As TypeCharacter)
|
Private Sub Serialize(ByVal TypeCharacter As TypeCharacter)
|
||||||
If TypeCharacter <> TypeCharacter.None Then
|
If TypeCharacter <> TypeCharacter.None Then
|
||||||
Static TypeCharacterTable As Dictionary(Of TypeCharacter, String)
|
Static TypeCharacterTable As Dictionary(Of TypeCharacter, String)
|
||||||
|
|
||||||
If TypeCharacterTable Is Nothing Then
|
If TypeCharacterTable Is Nothing Then
|
||||||
Dim Table As Dictionary(Of TypeCharacter, String) = New Dictionary(Of TypeCharacter, String)()
|
Dim Table As Dictionary(Of TypeCharacter, String) = New Dictionary(Of TypeCharacter, String)()
|
||||||
' NOTE: These have to be in the same order as the enum!
|
' NOTE: These have to be in the same order as the enum!
|
||||||
Dim TypeCharacters() As String = {"$", "%", "&", "S", "I", "L", "!", "#", "@", "F", "R", "D", "US", "UI", "UL"}
|
Dim TypeCharacters() As String = {"$", "%", "&", "S", "I", "L", "!", "#", "@", "F", "R", "D", "US", "UI", "UL"}
|
||||||
Dim TableTypeCharacter As TypeCharacter = TypeCharacter.StringSymbol
|
Dim TableTypeCharacter As TypeCharacter = TypeCharacter.StringSymbol
|
||||||
|
|
||||||
For Index As Integer = 0 To TypeCharacters.Length - 1
|
For Index As Integer = 0 To TypeCharacters.Length - 1
|
||||||
Table.Add(TableTypeCharacter, TypeCharacters(Index))
|
Table.Add(TableTypeCharacter, TypeCharacters(Index))
|
||||||
TableTypeCharacter = CType(TableTypeCharacter << 1, TypeCharacter)
|
TableTypeCharacter = CType(TableTypeCharacter << 1, TypeCharacter)
|
||||||
Next
|
Next
|
||||||
|
|
||||||
TypeCharacterTable = Table
|
TypeCharacterTable = Table
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Writer.WriteAttributeString("typeChar", TypeCharacterTable(TypeCharacter))
|
Writer.WriteAttributeString("typeChar", TypeCharacterTable(TypeCharacter))
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Sub Serialize(ByVal Token As Token)
|
Public Sub Serialize(ByVal Token As Token)
|
||||||
Writer.WriteStartElement(Token.Type.ToString())
|
Writer.WriteStartElement(Token.Type.ToString())
|
||||||
Serialize(Token.Span)
|
Serialize(Token.Span)
|
||||||
|
|
||||||
Select Case Token.Type
|
Select Case Token.Type
|
||||||
Case TokenType.LexicalError
|
Case TokenType.LexicalError
|
||||||
With CType(Token, ErrorToken)
|
With CType(Token, ErrorToken)
|
||||||
Writer.WriteAttributeString("errorNumber", CStr(.SyntaxError.Type))
|
Writer.WriteAttributeString("errorNumber", CStr(.SyntaxError.Type))
|
||||||
Writer.WriteString(.SyntaxError.ToString())
|
Writer.WriteString(.SyntaxError.ToString())
|
||||||
End With
|
End With
|
||||||
|
|
||||||
Case TokenType.Comment
|
Case TokenType.Comment
|
||||||
With CType(Token, CommentToken)
|
With CType(Token, CommentToken)
|
||||||
Writer.WriteAttributeString("isRem", CStr(.IsREM))
|
Writer.WriteAttributeString("isRem", CStr(.IsREM))
|
||||||
Writer.WriteString(.Comment)
|
Writer.WriteString(.Comment)
|
||||||
End With
|
End With
|
||||||
|
|
||||||
Case TokenType.Identifier
|
Case TokenType.Identifier
|
||||||
With CType(Token, IdentifierToken)
|
With CType(Token, IdentifierToken)
|
||||||
Writer.WriteAttributeString("escaped", CStr(.Escaped))
|
Writer.WriteAttributeString("escaped", CStr(.Escaped))
|
||||||
Serialize(.TypeCharacter)
|
Serialize(.TypeCharacter)
|
||||||
Writer.WriteString(.Identifier)
|
Writer.WriteString(.Identifier)
|
||||||
End With
|
End With
|
||||||
|
|
||||||
Case TokenType.StringLiteral
|
Case TokenType.StringLiteral
|
||||||
With CType(Token, StringLiteralToken)
|
With CType(Token, StringLiteralToken)
|
||||||
Writer.WriteString(.Literal)
|
Writer.WriteString(.Literal)
|
||||||
End With
|
End With
|
||||||
|
|
||||||
Case TokenType.CharacterLiteral
|
Case TokenType.CharacterLiteral
|
||||||
With CType(Token, CharacterLiteralToken)
|
With CType(Token, CharacterLiteralToken)
|
||||||
Writer.WriteString(.Literal)
|
Writer.WriteString(.Literal)
|
||||||
End With
|
End With
|
||||||
|
|
||||||
Case TokenType.DateLiteral
|
Case TokenType.DateLiteral
|
||||||
With CType(Token, DateLiteralToken)
|
With CType(Token, DateLiteralToken)
|
||||||
Writer.WriteString(CStr(.Literal))
|
Writer.WriteString(CStr(.Literal))
|
||||||
End With
|
End With
|
||||||
|
|
||||||
Case TokenType.IntegerLiteral
|
Case TokenType.IntegerLiteral
|
||||||
With CType(Token, IntegerLiteralToken)
|
With CType(Token, IntegerLiteralToken)
|
||||||
Writer.WriteAttributeString("base", .IntegerBase.ToString())
|
Writer.WriteAttributeString("base", .IntegerBase.ToString())
|
||||||
Serialize(.TypeCharacter)
|
Serialize(.TypeCharacter)
|
||||||
Writer.WriteString(CStr(.Literal))
|
Writer.WriteString(CStr(.Literal))
|
||||||
End With
|
End With
|
||||||
|
|
||||||
Case TokenType.FloatingPointLiteral
|
Case TokenType.FloatingPointLiteral
|
||||||
With CType(Token, FloatingPointLiteralToken)
|
With CType(Token, FloatingPointLiteralToken)
|
||||||
Serialize(.TypeCharacter)
|
Serialize(.TypeCharacter)
|
||||||
Writer.WriteString(CStr(.Literal))
|
Writer.WriteString(CStr(.Literal))
|
||||||
End With
|
End With
|
||||||
|
|
||||||
Case TokenType.DecimalLiteral
|
Case TokenType.DecimalLiteral
|
||||||
With CType(Token, DecimalLiteralToken)
|
With CType(Token, DecimalLiteralToken)
|
||||||
Serialize(.TypeCharacter)
|
Serialize(.TypeCharacter)
|
||||||
Writer.WriteString(CStr(.Literal))
|
Writer.WriteString(CStr(.Literal))
|
||||||
End With
|
End With
|
||||||
|
|
||||||
Case TokenType.UnsignedIntegerLiteral
|
Case TokenType.UnsignedIntegerLiteral
|
||||||
With CType(Token, UnsignedIntegerLiteralToken)
|
With CType(Token, UnsignedIntegerLiteralToken)
|
||||||
Serialize(.TypeCharacter)
|
Serialize(.TypeCharacter)
|
||||||
Writer.WriteString(CStr(.Literal))
|
Writer.WriteString(CStr(.Literal))
|
||||||
End With
|
End With
|
||||||
|
|
||||||
Case Else
|
Case Else
|
||||||
' Fall through
|
' Fall through
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
Writer.WriteEndElement()
|
Writer.WriteEndElement()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Sub Serialize(ByVal Tokens() As Token)
|
Public Sub Serialize(ByVal Tokens() As Token)
|
||||||
For Each Token As Token In Tokens
|
For Each Token As Token In Tokens
|
||||||
Serialize(Token)
|
Serialize(Token)
|
||||||
Next
|
Next
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,56 +1,56 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A region marked in the source code.
|
''' A region marked in the source code.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class SourceRegion
|
Public NotInheritable Class SourceRegion
|
||||||
Private ReadOnly _Start, _Finish As Location
|
Private ReadOnly _Start, _Finish As Location
|
||||||
Private ReadOnly _Description As String
|
Private ReadOnly _Description As String
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The start location of the region.
|
''' The start location of the region.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Start() As Location
|
Public ReadOnly Property Start() As Location
|
||||||
Get
|
Get
|
||||||
Return _Start
|
Return _Start
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The end location of the region.
|
''' The end location of the region.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Finish() As Location
|
Public ReadOnly Property Finish() As Location
|
||||||
Get
|
Get
|
||||||
Return _Finish
|
Return _Finish
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The description of the region.
|
''' The description of the region.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Description() As String
|
Public ReadOnly Property Description() As String
|
||||||
Get
|
Get
|
||||||
Return _Description
|
Return _Description
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new source region.
|
''' Constructs a new source region.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="start">The start location of the region.</param>
|
''' <param name="start">The start location of the region.</param>
|
||||||
''' <param name="finish">The end location of the region.</param>
|
''' <param name="finish">The end location of the region.</param>
|
||||||
''' <param name="description">The description of the region.</param>
|
''' <param name="description">The description of the region.</param>
|
||||||
Public Sub New(ByVal start As Location, ByVal finish As Location, ByVal description As String)
|
Public Sub New(ByVal start As Location, ByVal finish As Location, ByVal description As String)
|
||||||
_Start = start
|
_Start = start
|
||||||
_Finish = finish
|
_Finish = finish
|
||||||
_Description = description
|
_Description = description
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
|
@ -1,91 +1,91 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Stores the location of a span of text.
|
''' Stores the location of a span of text.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <remarks>The end location is exclusive.</remarks>
|
''' <remarks>The end location is exclusive.</remarks>
|
||||||
Public Structure Span
|
Public Structure Span
|
||||||
Private ReadOnly _Start As Location
|
Private ReadOnly _Start As Location
|
||||||
Private ReadOnly _Finish As Location
|
Private ReadOnly _Finish As Location
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The start location of the span.
|
''' The start location of the span.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Start() As Location
|
Public ReadOnly Property Start() As Location
|
||||||
Get
|
Get
|
||||||
Return _Start
|
Return _Start
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The end location of the span.
|
''' The end location of the span.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Finish() As Location
|
Public ReadOnly Property Finish() As Location
|
||||||
Get
|
Get
|
||||||
Return _Finish
|
Return _Finish
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Whether the locations in the span are valid.
|
''' Whether the locations in the span are valid.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property IsValid() As Boolean
|
Public ReadOnly Property IsValid() As Boolean
|
||||||
Get
|
Get
|
||||||
Return Start.IsValid AndAlso Finish.IsValid
|
Return Start.IsValid AndAlso Finish.IsValid
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new span with a specific start and end location.
|
''' Constructs a new span with a specific start and end location.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="start">The beginning of the span.</param>
|
''' <param name="start">The beginning of the span.</param>
|
||||||
''' <param name="finish">The end of the span.</param>
|
''' <param name="finish">The end of the span.</param>
|
||||||
Public Sub New(ByVal start As Location, ByVal finish As Location)
|
Public Sub New(ByVal start As Location, ByVal finish As Location)
|
||||||
_Start = Start
|
_Start = Start
|
||||||
_Finish = Finish
|
_Finish = Finish
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Compares two specified Span values to see if they are equal.
|
''' Compares two specified Span values to see if they are equal.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="left">One span to compare.</param>
|
''' <param name="left">One span to compare.</param>
|
||||||
''' <param name="right">The other span to compare.</param>
|
''' <param name="right">The other span to compare.</param>
|
||||||
''' <returns>True if the spans are the same, False otherwise.</returns>
|
''' <returns>True if the spans are the same, False otherwise.</returns>
|
||||||
Public Shared Operator =(ByVal left As Span, ByVal right As Span) As Boolean
|
Public Shared Operator =(ByVal left As Span, ByVal right As Span) As Boolean
|
||||||
Return left.Start.Index = right.Start.Index AndAlso left.Finish.Index = right.Finish.Index
|
Return left.Start.Index = right.Start.Index AndAlso left.Finish.Index = right.Finish.Index
|
||||||
End Operator
|
End Operator
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Compares two specified Span values to see if they are not equal.
|
''' Compares two specified Span values to see if they are not equal.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="left">One span to compare.</param>
|
''' <param name="left">One span to compare.</param>
|
||||||
''' <param name="right">The other span to compare.</param>
|
''' <param name="right">The other span to compare.</param>
|
||||||
''' <returns>True if the spans are not the same, False otherwise.</returns>
|
''' <returns>True if the spans are not the same, False otherwise.</returns>
|
||||||
Public Shared Operator <>(ByVal left As Span, ByVal right As Span) As Boolean
|
Public Shared Operator <>(ByVal left As Span, ByVal right As Span) As Boolean
|
||||||
Return left.Start.Index <> right.Start.Index OrElse left.Finish.Index <> right.Finish.Index
|
Return left.Start.Index <> right.Start.Index OrElse left.Finish.Index <> right.Finish.Index
|
||||||
End Operator
|
End Operator
|
||||||
|
|
||||||
Public Overrides Function ToString() As String
|
Public Overrides Function ToString() As String
|
||||||
Return Start.ToString() & " - " & Finish.ToString()
|
Return Start.ToString() & " - " & Finish.ToString()
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Overrides Function Equals(ByVal obj As Object) As Boolean
|
Public Overrides Function Equals(ByVal obj As Object) As Boolean
|
||||||
If TypeOf obj Is Span Then
|
If TypeOf obj Is Span Then
|
||||||
Return Me = DirectCast(obj, Span)
|
Return Me = DirectCast(obj, Span)
|
||||||
Else
|
Else
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Overrides Function GetHashCode() As Integer
|
Public Overrides Function GetHashCode() As Integer
|
||||||
Return CInt((Start.Index Xor Finish.Index) And &HFFFFFFFFL)
|
Return CInt((Start.Index Xor Finish.Index) And &HFFFFFFFFL)
|
||||||
End Function
|
End Function
|
||||||
End Structure
|
End Structure
|
|
@ -1,236 +1,236 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A syntax error.
|
''' A syntax error.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class SyntaxError
|
Public NotInheritable Class SyntaxError
|
||||||
Private ReadOnly _Type As SyntaxErrorType
|
Private ReadOnly _Type As SyntaxErrorType
|
||||||
Private ReadOnly _Span As Span
|
Private ReadOnly _Span As Span
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The type of the syntax error.
|
''' The type of the syntax error.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Type() As SyntaxErrorType
|
Public ReadOnly Property Type() As SyntaxErrorType
|
||||||
Get
|
Get
|
||||||
Return _Type
|
Return _Type
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the syntax error.
|
''' The location of the syntax error.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Span() As Span
|
Public ReadOnly Property Span() As Span
|
||||||
Get
|
Get
|
||||||
Return _Span
|
Return _Span
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new syntax error.
|
''' Constructs a new syntax error.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="type">The type of the syntax error.</param>
|
''' <param name="type">The type of the syntax error.</param>
|
||||||
''' <param name="span">The location of the syntax error.</param>
|
''' <param name="span">The location of the syntax error.</param>
|
||||||
Public Sub New(ByVal type As SyntaxErrorType, ByVal span As Span)
|
Public Sub New(ByVal type As SyntaxErrorType, ByVal span As Span)
|
||||||
Debug.Assert(System.Enum.IsDefined(GetType(SyntaxErrorType), type))
|
Debug.Assert(System.Enum.IsDefined(GetType(SyntaxErrorType), type))
|
||||||
_Type = type
|
_Type = type
|
||||||
_Span = span
|
_Span = span
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Overrides Function ToString() As String
|
Public Overrides Function ToString() As String
|
||||||
Static Messages() As String
|
Static Messages() As String
|
||||||
|
|
||||||
If Messages Is Nothing Then
|
If Messages Is Nothing Then
|
||||||
Dim Strings() As String
|
Dim Strings() As String
|
||||||
|
|
||||||
Strings = New String() { _
|
Strings = New String() { _
|
||||||
"", _
|
"", _
|
||||||
"Invalid escaped identifier.", _
|
"Invalid escaped identifier.", _
|
||||||
"Invalid identifier.", _
|
"Invalid identifier.", _
|
||||||
"Cannot put a type character on a keyword.", _
|
"Cannot put a type character on a keyword.", _
|
||||||
"Invalid character.", _
|
"Invalid character.", _
|
||||||
"Invalid character literal.", _
|
"Invalid character literal.", _
|
||||||
"Invalid string literal.", _
|
"Invalid string literal.", _
|
||||||
"Invalid date literal.", _
|
"Invalid date literal.", _
|
||||||
"Invalid floating point literal.", _
|
"Invalid floating point literal.", _
|
||||||
"Invalid integer literal.", _
|
"Invalid integer literal.", _
|
||||||
"Invalid decimal literal.", _
|
"Invalid decimal literal.", _
|
||||||
"Syntax error.", _
|
"Syntax error.", _
|
||||||
"Expected ','.", _
|
"Expected ','.", _
|
||||||
"Expected '('.", _
|
"Expected '('.", _
|
||||||
"Expected ')'.", _
|
"Expected ')'.", _
|
||||||
"Expected '='.", _
|
"Expected '='.", _
|
||||||
"Expected 'As'.", _
|
"Expected 'As'.", _
|
||||||
"Expected '}'.", _
|
"Expected '}'.", _
|
||||||
"Expected '.'.", _
|
"Expected '.'.", _
|
||||||
"Expected '-'.", _
|
"Expected '-'.", _
|
||||||
"Expected 'Is'.", _
|
"Expected 'Is'.", _
|
||||||
"Expected '>'.", _
|
"Expected '>'.", _
|
||||||
"Type expected.", _
|
"Type expected.", _
|
||||||
"Expected identifier.", _
|
"Expected identifier.", _
|
||||||
"Invalid use of keyword.", _
|
"Invalid use of keyword.", _
|
||||||
"Bounds can be specified only for the top-level array when initializing an array of arrays.", _
|
"Bounds can be specified only for the top-level array when initializing an array of arrays.", _
|
||||||
"Array bounds cannot appear in type specifiers.", _
|
"Array bounds cannot appear in type specifiers.", _
|
||||||
"Expected expression.", _
|
"Expected expression.", _
|
||||||
"Comma, ')', or a valid expression continuation expected.", _
|
"Comma, ')', or a valid expression continuation expected.", _
|
||||||
"Expected named argument.", _
|
"Expected named argument.", _
|
||||||
"MyBase must be followed by a '.'.", _
|
"MyBase must be followed by a '.'.", _
|
||||||
"MyClass must be followed by a '.'.", _
|
"MyClass must be followed by a '.'.", _
|
||||||
"Exit must be followed by Do, For, While, Select, Sub, Function, Property or Try.", _
|
"Exit must be followed by Do, For, While, Select, Sub, Function, Property or Try.", _
|
||||||
"Expected 'Next'.", _
|
"Expected 'Next'.", _
|
||||||
"Expected 'Resume' or 'GoTo'.", _
|
"Expected 'Resume' or 'GoTo'.", _
|
||||||
"Expected 'Error'.", _
|
"Expected 'Error'.", _
|
||||||
"Type character does not match declared data type String.", _
|
"Type character does not match declared data type String.", _
|
||||||
"Comma, '}', or a valid expression continuation expected.", _
|
"Comma, '}', or a valid expression continuation expected.", _
|
||||||
"Expected one of 'Dim', 'Const', 'Public', 'Private', 'Protected', 'Friend', 'Shadows', 'ReadOnly' or 'Shared'.", _
|
"Expected one of 'Dim', 'Const', 'Public', 'Private', 'Protected', 'Friend', 'Shadows', 'ReadOnly' or 'Shared'.", _
|
||||||
"End of statement expected.", _
|
"End of statement expected.", _
|
||||||
"'Do' must end with a matching 'Loop'.", _
|
"'Do' must end with a matching 'Loop'.", _
|
||||||
"'While' must end with a matching 'End While'.", _
|
"'While' must end with a matching 'End While'.", _
|
||||||
"'Select' must end with a matching 'End Select'.", _
|
"'Select' must end with a matching 'End Select'.", _
|
||||||
"'SyncLock' must end with a matching 'End SyncLock'.", _
|
"'SyncLock' must end with a matching 'End SyncLock'.", _
|
||||||
"'With' must end with a matching 'End With'.", _
|
"'With' must end with a matching 'End With'.", _
|
||||||
"'If' must end with a matching 'End If'.", _
|
"'If' must end with a matching 'End If'.", _
|
||||||
"'Try' must end with a matching 'End Try'.", _
|
"'Try' must end with a matching 'End Try'.", _
|
||||||
"'Sub' must end with a matching 'End Sub'.", _
|
"'Sub' must end with a matching 'End Sub'.", _
|
||||||
"'Function' must end with a matching 'End Function'.", _
|
"'Function' must end with a matching 'End Function'.", _
|
||||||
"'Property' must end with a matching 'End Property'.", _
|
"'Property' must end with a matching 'End Property'.", _
|
||||||
"'Get' must end with a matching 'End Get'.", _
|
"'Get' must end with a matching 'End Get'.", _
|
||||||
"'Set' must end with a matching 'End Set'.", _
|
"'Set' must end with a matching 'End Set'.", _
|
||||||
"'Class' must end with a matching 'End Class'.", _
|
"'Class' must end with a matching 'End Class'.", _
|
||||||
"'Structure' must end with a matching 'End Structure'.", _
|
"'Structure' must end with a matching 'End Structure'.", _
|
||||||
"'Module' must end with a matching 'End Module'.", _
|
"'Module' must end with a matching 'End Module'.", _
|
||||||
"'Interface' must end with a matching 'End Interface'.", _
|
"'Interface' must end with a matching 'End Interface'.", _
|
||||||
"'Enum' must end with a matching 'End Enum'.", _
|
"'Enum' must end with a matching 'End Enum'.", _
|
||||||
"'Namespace' must end with a matching 'End Namespace'.", _
|
"'Namespace' must end with a matching 'End Namespace'.", _
|
||||||
"'Loop' cannot have a condition if matching 'Do' has one.", _
|
"'Loop' cannot have a condition if matching 'Do' has one.", _
|
||||||
"'Loop' must be preceded by a matching 'Do'.", _
|
"'Loop' must be preceded by a matching 'Do'.", _
|
||||||
"'Next' must be preceded by a matching 'For' or 'For Each'.", _
|
"'Next' must be preceded by a matching 'For' or 'For Each'.", _
|
||||||
"'End While' must be preceded by a matching 'While'.", _
|
"'End While' must be preceded by a matching 'While'.", _
|
||||||
"'End Select' must be preceded by a matching 'Select'.", _
|
"'End Select' must be preceded by a matching 'Select'.", _
|
||||||
"'End SyncLock' must be preceded by a matching 'SyncLock'.", _
|
"'End SyncLock' must be preceded by a matching 'SyncLock'.", _
|
||||||
"'End If' must be preceded by a matching 'If'.", _
|
"'End If' must be preceded by a matching 'If'.", _
|
||||||
"'End Try' must be preceded by a matching 'Try'.", _
|
"'End Try' must be preceded by a matching 'Try'.", _
|
||||||
"'End With' must be preceded by a matching 'With'.", _
|
"'End With' must be preceded by a matching 'With'.", _
|
||||||
"'Catch' cannot appear outside a 'Try' statement.", _
|
"'Catch' cannot appear outside a 'Try' statement.", _
|
||||||
"'Finally' cannot appear outside a 'Try' statement.", _
|
"'Finally' cannot appear outside a 'Try' statement.", _
|
||||||
"'Catch' cannot appear after 'Finally' within a 'Try' statement.", _
|
"'Catch' cannot appear after 'Finally' within a 'Try' statement.", _
|
||||||
"'Finally' can only appear once in a 'Try' statement.", _
|
"'Finally' can only appear once in a 'Try' statement.", _
|
||||||
"'Case' must be preceded by a matching 'Select'.", _
|
"'Case' must be preceded by a matching 'Select'.", _
|
||||||
"'Case' cannot appear after 'Case Else' within a 'Select' statement.", _
|
"'Case' cannot appear after 'Case Else' within a 'Select' statement.", _
|
||||||
"'Case Else' can only appear once in a 'Select' statement.", _
|
"'Case Else' can only appear once in a 'Select' statement.", _
|
||||||
"'Case Else' must be preceded by a matching 'Select'.", _
|
"'Case Else' must be preceded by a matching 'Select'.", _
|
||||||
"'End Sub' must be preceded by a matching 'Sub'.", _
|
"'End Sub' must be preceded by a matching 'Sub'.", _
|
||||||
"'End Function' must be preceded by a matching 'Function'.", _
|
"'End Function' must be preceded by a matching 'Function'.", _
|
||||||
"'End Property' must be preceded by a matching 'Property'.", _
|
"'End Property' must be preceded by a matching 'Property'.", _
|
||||||
"'End Get' must be preceded by a matching 'Get'.", _
|
"'End Get' must be preceded by a matching 'Get'.", _
|
||||||
"'End Set' must be preceded by a matching 'Set'.", _
|
"'End Set' must be preceded by a matching 'Set'.", _
|
||||||
"'End Class' must be preceded by a matching 'Class'.", _
|
"'End Class' must be preceded by a matching 'Class'.", _
|
||||||
"'End Structure' must be preceded by a matching 'Structure'.", _
|
"'End Structure' must be preceded by a matching 'Structure'.", _
|
||||||
"'End Module' must be preceded by a matching 'Module'.", _
|
"'End Module' must be preceded by a matching 'Module'.", _
|
||||||
"'End Interface' must be preceded by a matching 'Interface'.", _
|
"'End Interface' must be preceded by a matching 'Interface'.", _
|
||||||
"'End Enum' must be preceded by a matching 'Enum'.", _
|
"'End Enum' must be preceded by a matching 'Enum'.", _
|
||||||
"'End Namespace' must be preceded by a matching 'Namespace'.", _
|
"'End Namespace' must be preceded by a matching 'Namespace'.", _
|
||||||
"Statements and labels are not valid between 'Select Case' and first 'Case'.", _
|
"Statements and labels are not valid between 'Select Case' and first 'Case'.", _
|
||||||
"'ElseIf' cannot appear after 'Else' within an 'If' statement.", _
|
"'ElseIf' cannot appear after 'Else' within an 'If' statement.", _
|
||||||
"'ElseIf' must be preceded by a matching 'If'.", _
|
"'ElseIf' must be preceded by a matching 'If'.", _
|
||||||
"'Else' can only appear once in an 'If' statement.", _
|
"'Else' can only appear once in an 'If' statement.", _
|
||||||
"'Else' must be preceded by a matching 'If'.", _
|
"'Else' must be preceded by a matching 'If'.", _
|
||||||
"Statement cannot end a block outside of a line 'If' statement.", _
|
"Statement cannot end a block outside of a line 'If' statement.", _
|
||||||
"Attribute of this type is not allowed here.", _
|
"Attribute of this type is not allowed here.", _
|
||||||
"Modifier cannot be specified twice.", _
|
"Modifier cannot be specified twice.", _
|
||||||
"Modifier is not valid on this declaration type.", _
|
"Modifier is not valid on this declaration type.", _
|
||||||
"Can only specify one of 'Dim', 'Static' or 'Const'.", _
|
"Can only specify one of 'Dim', 'Static' or 'Const'.", _
|
||||||
"Events cannot have a return type.", _
|
"Events cannot have a return type.", _
|
||||||
"Comma or ')' expected.", _
|
"Comma or ')' expected.", _
|
||||||
"Method declaration statements must be the first statement on a logical line.", _
|
"Method declaration statements must be the first statement on a logical line.", _
|
||||||
"First statement of a method body cannot be on the same line as the method declaration.", _
|
"First statement of a method body cannot be on the same line as the method declaration.", _
|
||||||
"'End Sub' must be the first statement on a line.", _
|
"'End Sub' must be the first statement on a line.", _
|
||||||
"'End Function' must be the first statement on a line.", _
|
"'End Function' must be the first statement on a line.", _
|
||||||
"'End Get' must be the first statement on a line.", _
|
"'End Get' must be the first statement on a line.", _
|
||||||
"'End Set' must be the first statement on a line.", _
|
"'End Set' must be the first statement on a line.", _
|
||||||
"'Sub' or 'Function' expected.", _
|
"'Sub' or 'Function' expected.", _
|
||||||
"String constant expected.", _
|
"String constant expected.", _
|
||||||
"'Lib' expected.", _
|
"'Lib' expected.", _
|
||||||
"Declaration cannot appear within a Property declaration.", _
|
"Declaration cannot appear within a Property declaration.", _
|
||||||
"Declaration cannot appear within a Class declaration.", _
|
"Declaration cannot appear within a Class declaration.", _
|
||||||
"Declaration cannot appear within a Structure declaration.", _
|
"Declaration cannot appear within a Structure declaration.", _
|
||||||
"Declaration cannot appear within a Module declaration.", _
|
"Declaration cannot appear within a Module declaration.", _
|
||||||
"Declaration cannot appear within an Interface declaration.", _
|
"Declaration cannot appear within an Interface declaration.", _
|
||||||
"Declaration cannot appear within an Enum declaration.", _
|
"Declaration cannot appear within an Enum declaration.", _
|
||||||
"Declaration cannot appear within a Namespace declaration.", _
|
"Declaration cannot appear within a Namespace declaration.", _
|
||||||
"Specifiers and attributes are not valid on this statement.", _
|
"Specifiers and attributes are not valid on this statement.", _
|
||||||
"Specifiers and attributes are not valid on a Namespace declaration.", _
|
"Specifiers and attributes are not valid on a Namespace declaration.", _
|
||||||
"Specifiers and attributes are not valid on an Imports declaration.", _
|
"Specifiers and attributes are not valid on an Imports declaration.", _
|
||||||
"Specifiers and attributes are not valid on an Option declaration.", _
|
"Specifiers and attributes are not valid on an Option declaration.", _
|
||||||
"Inherits' can only specify one class.", _
|
"Inherits' can only specify one class.", _
|
||||||
"'Inherits' statements must precede all declarations.", _
|
"'Inherits' statements must precede all declarations.", _
|
||||||
"'Implements' statements must follow any 'Inherits' statement and precede all declarations in a class.", _
|
"'Implements' statements must follow any 'Inherits' statement and precede all declarations in a class.", _
|
||||||
"Enum must contain at least one member.", _
|
"Enum must contain at least one member.", _
|
||||||
"'Option Explicit' can be followed only by 'On' or 'Off'.", _
|
"'Option Explicit' can be followed only by 'On' or 'Off'.", _
|
||||||
"'Option Strict' can be followed only by 'On' or 'Off'.", _
|
"'Option Strict' can be followed only by 'On' or 'Off'.", _
|
||||||
"'Option Compare' must be followed by 'Text' or 'Binary'.", _
|
"'Option Compare' must be followed by 'Text' or 'Binary'.", _
|
||||||
"'Option' must be followed by 'Compare', 'Explicit', or 'Strict'.", _
|
"'Option' must be followed by 'Compare', 'Explicit', or 'Strict'.", _
|
||||||
"'Option' statements must precede any declarations or 'Imports' statements.", _
|
"'Option' statements must precede any declarations or 'Imports' statements.", _
|
||||||
"'Imports' statements must precede any declarations.", _
|
"'Imports' statements must precede any declarations.", _
|
||||||
"Assembly or Module attribute statements must precede any declarations in a file.", _
|
"Assembly or Module attribute statements must precede any declarations in a file.", _
|
||||||
"'End' statement not valid.", _
|
"'End' statement not valid.", _
|
||||||
"Expected relational operator.", _
|
"Expected relational operator.", _
|
||||||
"'If', 'ElseIf', 'Else', 'End If', or 'Const' expected.", _
|
"'If', 'ElseIf', 'Else', 'End If', or 'Const' expected.", _
|
||||||
"Expected integer literal.", _
|
"Expected integer literal.", _
|
||||||
"'#ExternalSource' statements cannot be nested.", _
|
"'#ExternalSource' statements cannot be nested.", _
|
||||||
"'ExternalSource', 'Region' or 'If' expected.", _
|
"'ExternalSource', 'Region' or 'If' expected.", _
|
||||||
"'#End ExternalSource' must be preceded by a matching '#ExternalSource'.", _
|
"'#End ExternalSource' must be preceded by a matching '#ExternalSource'.", _
|
||||||
"'#ExternalSource' must end with a matching '#End ExternalSource'.", _
|
"'#ExternalSource' must end with a matching '#End ExternalSource'.", _
|
||||||
"'#End Region' must be preceded by a matching '#Region'.", _
|
"'#End Region' must be preceded by a matching '#Region'.", _
|
||||||
"'#Region' must end with a matching '#End Region'.", _
|
"'#Region' must end with a matching '#End Region'.", _
|
||||||
"'#Region' and '#End Region' statements are not valid within method bodies.", _
|
"'#Region' and '#End Region' statements are not valid within method bodies.", _
|
||||||
"Conversions to and from 'String' cannot occur in a conditional compilation expression.", _
|
"Conversions to and from 'String' cannot occur in a conditional compilation expression.", _
|
||||||
"Conversion is not valid in a conditional compilation expression.", _
|
"Conversion is not valid in a conditional compilation expression.", _
|
||||||
"Expression is not valid in a conditional compilation expression.", _
|
"Expression is not valid in a conditional compilation expression.", _
|
||||||
"Operator is not valid for these types in a conditional compilation expression.", _
|
"Operator is not valid for these types in a conditional compilation expression.", _
|
||||||
"'#If' must end with a matching '#End If'.", _
|
"'#If' must end with a matching '#End If'.", _
|
||||||
"'#End If' must be preceded by a matching '#If'.", _
|
"'#End If' must be preceded by a matching '#If'.", _
|
||||||
"'#ElseIf' cannot appear after '#Else' within an '#If' statement.", _
|
"'#ElseIf' cannot appear after '#Else' within an '#If' statement.", _
|
||||||
"'#ElseIf' must be preceded by a matching '#If'.", _
|
"'#ElseIf' must be preceded by a matching '#If'.", _
|
||||||
"'#Else' can only appear once in an '#If' statement.", _
|
"'#Else' can only appear once in an '#If' statement.", _
|
||||||
"'#Else' must be preceded by a matching '#If'.", _
|
"'#Else' must be preceded by a matching '#If'.", _
|
||||||
"'Global' not allowed in this context; identifier expected.", _
|
"'Global' not allowed in this context; identifier expected.", _
|
||||||
"Modules cannot be generic.", _
|
"Modules cannot be generic.", _
|
||||||
"Expected 'Of'.", _
|
"Expected 'Of'.", _
|
||||||
"Operator declaration must be one of: +, -, *, \, /, ^, &, Like, Mod, And, Or, Xor, Not, <<, >>, =, <>, <, <=, >, >=, CType, IsTrue, IsFalse.", _
|
"Operator declaration must be one of: +, -, *, \, /, ^, &, Like, Mod, And, Or, Xor, Not, <<, >>, =, <>, <, <=, >, >=, CType, IsTrue, IsFalse.", _
|
||||||
"'Operator' must end with a matching 'End Operator'.", _
|
"'Operator' must end with a matching 'End Operator'.", _
|
||||||
"'End Operator' must be preceded by a matching 'Operator'.", _
|
"'End Operator' must be preceded by a matching 'Operator'.", _
|
||||||
"'End Operator' must be the first statement on a line.", _
|
"'End Operator' must be the first statement on a line.", _
|
||||||
"Properties cannot be generic.", _
|
"Properties cannot be generic.", _
|
||||||
"Constructors cannot be generic.", _
|
"Constructors cannot be generic.", _
|
||||||
"Operators cannot be generic.", _
|
"Operators cannot be generic.", _
|
||||||
"Global must be followed by a '.'.", _
|
"Global must be followed by a '.'.", _
|
||||||
"Continue must be followed by Do, For, or While.", _
|
"Continue must be followed by Do, For, or While.", _
|
||||||
"'Using' must end with a matching 'End Using'.", _
|
"'Using' must end with a matching 'End Using'.", _
|
||||||
"Custom 'Event' must end with a matching 'End Event'.", _
|
"Custom 'Event' must end with a matching 'End Event'.", _
|
||||||
"'AddHandler' must end with a matching 'End AddHandler'.", _
|
"'AddHandler' must end with a matching 'End AddHandler'.", _
|
||||||
"'RemoveHandler' must end with a matching 'End RemoveHandler'.", _
|
"'RemoveHandler' must end with a matching 'End RemoveHandler'.", _
|
||||||
"'RaiseEvent' must end with a matching 'End RaiseEvent'.", _
|
"'RaiseEvent' must end with a matching 'End RaiseEvent'.", _
|
||||||
"'End Using' must be preceded by a matching 'Using'.", _
|
"'End Using' must be preceded by a matching 'Using'.", _
|
||||||
"'End Event' must be preceded by a matching custom 'Event'.", _
|
"'End Event' must be preceded by a matching custom 'Event'.", _
|
||||||
"'End AddHandler' must be preceded by a matching 'AddHandler'.", _
|
"'End AddHandler' must be preceded by a matching 'AddHandler'.", _
|
||||||
"'End RemoveHandler' must be preceded by a matching 'RemoveHandler'.", _
|
"'End RemoveHandler' must be preceded by a matching 'RemoveHandler'.", _
|
||||||
"'End RaiseEvent' must be preceded by a matching 'RaiseEvent'.", _
|
"'End RaiseEvent' must be preceded by a matching 'RaiseEvent'.", _
|
||||||
"'End AddHandler' must be the first statement on a line.", _
|
"'End AddHandler' must be the first statement on a line.", _
|
||||||
"'End RemoveHandler' must be the first statement on a line.", _
|
"'End RemoveHandler' must be the first statement on a line.", _
|
||||||
"'End RaiseEvent' must be the first statement on a line." _
|
"'End RaiseEvent' must be the first statement on a line." _
|
||||||
}
|
}
|
||||||
|
|
||||||
Messages = Strings
|
Messages = Strings
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Return "error " & Type & " " & Span.ToString() & ": " & Messages(Type)
|
Return "error " & Type & " " & Span.ToString() & ": " & Messages(Type)
|
||||||
End Function
|
End Function
|
||||||
End Class
|
End Class
|
||||||
|
|
|
@ -1,204 +1,204 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The type of a syntax error.
|
''' The type of a syntax error.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public Enum SyntaxErrorType
|
Public Enum SyntaxErrorType
|
||||||
None
|
None
|
||||||
|
|
||||||
' Lexical errors
|
' Lexical errors
|
||||||
InvalidEscapedIdentifier
|
InvalidEscapedIdentifier
|
||||||
InvalidIdentifier
|
InvalidIdentifier
|
||||||
InvalidTypeCharacterOnKeyword
|
InvalidTypeCharacterOnKeyword
|
||||||
InvalidCharacter
|
InvalidCharacter
|
||||||
InvalidCharacterLiteral
|
InvalidCharacterLiteral
|
||||||
InvalidStringLiteral
|
InvalidStringLiteral
|
||||||
InvalidDateLiteral
|
InvalidDateLiteral
|
||||||
InvalidFloatingPointLiteral
|
InvalidFloatingPointLiteral
|
||||||
InvalidIntegerLiteral
|
InvalidIntegerLiteral
|
||||||
InvalidDecimalLiteral
|
InvalidDecimalLiteral
|
||||||
|
|
||||||
' Syntax errors
|
' Syntax errors
|
||||||
SyntaxError
|
SyntaxError
|
||||||
ExpectedComma
|
ExpectedComma
|
||||||
ExpectedLeftParenthesis
|
ExpectedLeftParenthesis
|
||||||
ExpectedRightParenthesis
|
ExpectedRightParenthesis
|
||||||
ExpectedEquals
|
ExpectedEquals
|
||||||
ExpectedAs
|
ExpectedAs
|
||||||
ExpectedRightCurlyBrace
|
ExpectedRightCurlyBrace
|
||||||
ExpectedPeriod
|
ExpectedPeriod
|
||||||
ExpectedMinus
|
ExpectedMinus
|
||||||
ExpectedIs
|
ExpectedIs
|
||||||
ExpectedGreaterThan
|
ExpectedGreaterThan
|
||||||
ExpectedType
|
ExpectedType
|
||||||
ExpectedIdentifier
|
ExpectedIdentifier
|
||||||
InvalidUseOfKeyword
|
InvalidUseOfKeyword
|
||||||
NoConstituentArraySizes
|
NoConstituentArraySizes
|
||||||
NoExplicitArraySizes
|
NoExplicitArraySizes
|
||||||
ExpectedExpression
|
ExpectedExpression
|
||||||
ArgumentSyntax
|
ArgumentSyntax
|
||||||
ExpectedNamedArgument
|
ExpectedNamedArgument
|
||||||
ExpectedPeriodAfterMyBase
|
ExpectedPeriodAfterMyBase
|
||||||
ExpectedPeriodAfterMyClass
|
ExpectedPeriodAfterMyClass
|
||||||
ExpectedExitKind
|
ExpectedExitKind
|
||||||
ExpectedNext
|
ExpectedNext
|
||||||
ExpectedResumeOrGoto
|
ExpectedResumeOrGoto
|
||||||
ExpectedError
|
ExpectedError
|
||||||
MidTypeCharacter
|
MidTypeCharacter
|
||||||
InitializerSyntax
|
InitializerSyntax
|
||||||
ExpectedModifier
|
ExpectedModifier
|
||||||
ExpectedEndOfStatement
|
ExpectedEndOfStatement
|
||||||
ExpectedLoop
|
ExpectedLoop
|
||||||
ExpectedEndWhile
|
ExpectedEndWhile
|
||||||
ExpectedEndSelect
|
ExpectedEndSelect
|
||||||
ExpectedEndSyncLock
|
ExpectedEndSyncLock
|
||||||
ExpectedEndWith
|
ExpectedEndWith
|
||||||
ExpectedEndIf
|
ExpectedEndIf
|
||||||
ExpectedEndTry
|
ExpectedEndTry
|
||||||
ExpectedEndSub
|
ExpectedEndSub
|
||||||
ExpectedEndFunction
|
ExpectedEndFunction
|
||||||
ExpectedEndProperty
|
ExpectedEndProperty
|
||||||
ExpectedEndGet
|
ExpectedEndGet
|
||||||
ExpectedEndSet
|
ExpectedEndSet
|
||||||
ExpectedEndClass
|
ExpectedEndClass
|
||||||
ExpectedEndStructure
|
ExpectedEndStructure
|
||||||
ExpectedEndModule
|
ExpectedEndModule
|
||||||
ExpectedEndInterface
|
ExpectedEndInterface
|
||||||
ExpectedEndEnum
|
ExpectedEndEnum
|
||||||
ExpectedEndNamespace
|
ExpectedEndNamespace
|
||||||
LoopDoubleCondition
|
LoopDoubleCondition
|
||||||
LoopWithoutDo
|
LoopWithoutDo
|
||||||
NextWithoutFor
|
NextWithoutFor
|
||||||
EndWhileWithoutWhile
|
EndWhileWithoutWhile
|
||||||
EndSelectWithoutSelect
|
EndSelectWithoutSelect
|
||||||
EndSyncLockWithoutSyncLock
|
EndSyncLockWithoutSyncLock
|
||||||
EndIfWithoutIf
|
EndIfWithoutIf
|
||||||
EndTryWithoutTry
|
EndTryWithoutTry
|
||||||
EndWithWithoutWith
|
EndWithWithoutWith
|
||||||
CatchWithoutTry
|
CatchWithoutTry
|
||||||
FinallyWithoutTry
|
FinallyWithoutTry
|
||||||
CatchAfterFinally
|
CatchAfterFinally
|
||||||
FinallyAfterFinally
|
FinallyAfterFinally
|
||||||
CaseWithoutSelect
|
CaseWithoutSelect
|
||||||
CaseAfterCaseElse
|
CaseAfterCaseElse
|
||||||
CaseElseAfterCaseElse
|
CaseElseAfterCaseElse
|
||||||
CaseElseWithoutSelect
|
CaseElseWithoutSelect
|
||||||
EndSubWithoutSub
|
EndSubWithoutSub
|
||||||
EndFunctionWithoutFunction
|
EndFunctionWithoutFunction
|
||||||
EndPropertyWithoutProperty
|
EndPropertyWithoutProperty
|
||||||
EndGetWithoutGet
|
EndGetWithoutGet
|
||||||
EndSetWithoutSet
|
EndSetWithoutSet
|
||||||
EndClassWithoutClass
|
EndClassWithoutClass
|
||||||
EndStructureWithoutStructure
|
EndStructureWithoutStructure
|
||||||
EndModuleWithoutModule
|
EndModuleWithoutModule
|
||||||
EndInterfaceWithoutInterface
|
EndInterfaceWithoutInterface
|
||||||
EndEnumWithoutEnum
|
EndEnumWithoutEnum
|
||||||
EndNamespaceWithoutNamespace
|
EndNamespaceWithoutNamespace
|
||||||
ExpectedCase
|
ExpectedCase
|
||||||
ElseIfAfterElse
|
ElseIfAfterElse
|
||||||
ElseIfWithoutIf
|
ElseIfWithoutIf
|
||||||
ElseAfterElse
|
ElseAfterElse
|
||||||
ElseWithoutIf
|
ElseWithoutIf
|
||||||
EndInLineIf
|
EndInLineIf
|
||||||
IncorrectAttributeType
|
IncorrectAttributeType
|
||||||
DuplicateModifier
|
DuplicateModifier
|
||||||
InvalidModifier
|
InvalidModifier
|
||||||
InvalidVariableModifiers
|
InvalidVariableModifiers
|
||||||
EventsCantBeFunctions
|
EventsCantBeFunctions
|
||||||
ParameterSyntax
|
ParameterSyntax
|
||||||
MethodMustBeFirstStatementOnLine
|
MethodMustBeFirstStatementOnLine
|
||||||
MethodBodyNotAtLineStart
|
MethodBodyNotAtLineStart
|
||||||
EndSubNotAtLineStart
|
EndSubNotAtLineStart
|
||||||
EndFunctionNotAtLineStart
|
EndFunctionNotAtLineStart
|
||||||
EndGetNotAtLineStart
|
EndGetNotAtLineStart
|
||||||
EndSetNotAtLineStart
|
EndSetNotAtLineStart
|
||||||
ExpectedSubOrFunction
|
ExpectedSubOrFunction
|
||||||
ExpectedStringLiteral
|
ExpectedStringLiteral
|
||||||
ExpectedLib
|
ExpectedLib
|
||||||
InvalidInsideProperty
|
InvalidInsideProperty
|
||||||
InvalidInsideClass
|
InvalidInsideClass
|
||||||
InvalidInsideStructure
|
InvalidInsideStructure
|
||||||
InvalidInsideModule
|
InvalidInsideModule
|
||||||
InvalidInsideInterface
|
InvalidInsideInterface
|
||||||
InvalidInsideEnum
|
InvalidInsideEnum
|
||||||
InvalidInsideNamespace
|
InvalidInsideNamespace
|
||||||
SpecifiersInvalidOnTypeListDeclaration
|
SpecifiersInvalidOnTypeListDeclaration
|
||||||
SpecifiersInvalidOnNamespaceDeclaration
|
SpecifiersInvalidOnNamespaceDeclaration
|
||||||
SpecifiersInvalidOnImportsDeclaration
|
SpecifiersInvalidOnImportsDeclaration
|
||||||
SpecifiersInvalidOnOptionDeclaration
|
SpecifiersInvalidOnOptionDeclaration
|
||||||
NoMultipleInheritance
|
NoMultipleInheritance
|
||||||
InheritsMustBeFirst
|
InheritsMustBeFirst
|
||||||
ImplementsInWrongOrder
|
ImplementsInWrongOrder
|
||||||
EmptyEnum
|
EmptyEnum
|
||||||
InvalidOptionExplicitType
|
InvalidOptionExplicitType
|
||||||
InvalidOptionStrictType
|
InvalidOptionStrictType
|
||||||
InvalidOptionCompareType
|
InvalidOptionCompareType
|
||||||
InvalidOptionType
|
InvalidOptionType
|
||||||
OptionStatementWrongOrder
|
OptionStatementWrongOrder
|
||||||
ImportsStatementWrongOrder
|
ImportsStatementWrongOrder
|
||||||
AttributesStatementWrongOrder
|
AttributesStatementWrongOrder
|
||||||
UnrecognizedEnd
|
UnrecognizedEnd
|
||||||
ExpectedRelationalOperator
|
ExpectedRelationalOperator
|
||||||
InvalidPreprocessorStatement
|
InvalidPreprocessorStatement
|
||||||
ExpectedIntegerLiteral
|
ExpectedIntegerLiteral
|
||||||
NestedExternalSourceStatement
|
NestedExternalSourceStatement
|
||||||
ExpectedEndKind
|
ExpectedEndKind
|
||||||
EndExternalSourceWithoutExternalSource
|
EndExternalSourceWithoutExternalSource
|
||||||
ExpectedEndExternalSource
|
ExpectedEndExternalSource
|
||||||
EndRegionWithoutRegion
|
EndRegionWithoutRegion
|
||||||
ExpectedEndRegion
|
ExpectedEndRegion
|
||||||
RegionInsideMethod
|
RegionInsideMethod
|
||||||
|
|
||||||
' Conditional compilation errors
|
' Conditional compilation errors
|
||||||
CantCastStringInCCExpression
|
CantCastStringInCCExpression
|
||||||
InvalidCCCast
|
InvalidCCCast
|
||||||
CCExpressionRequired
|
CCExpressionRequired
|
||||||
InvalidCCOperator
|
InvalidCCOperator
|
||||||
ExpectedCCEndIf
|
ExpectedCCEndIf
|
||||||
CCEndIfWithoutCCIf
|
CCEndIfWithoutCCIf
|
||||||
CCElseIfAfterCCElse
|
CCElseIfAfterCCElse
|
||||||
CCElseIfWithoutCCIf
|
CCElseIfWithoutCCIf
|
||||||
CCElseAfterCCElse
|
CCElseAfterCCElse
|
||||||
CCElseWithoutCCIf
|
CCElseWithoutCCIf
|
||||||
|
|
||||||
' New errors in v8.0
|
' New errors in v8.0
|
||||||
InvalidUseOfGlobal
|
InvalidUseOfGlobal
|
||||||
ModulesCantBeGeneric
|
ModulesCantBeGeneric
|
||||||
ExpectedOf
|
ExpectedOf
|
||||||
InvalidOperator
|
InvalidOperator
|
||||||
ExpectedEndOperator
|
ExpectedEndOperator
|
||||||
EndOperatorWithoutOperator
|
EndOperatorWithoutOperator
|
||||||
EndOperatorNotAtLineStart
|
EndOperatorNotAtLineStart
|
||||||
PropertiesCantBeGeneric
|
PropertiesCantBeGeneric
|
||||||
ConstructorsCantBeGeneric
|
ConstructorsCantBeGeneric
|
||||||
OperatorsCantBeGeneric
|
OperatorsCantBeGeneric
|
||||||
ExpectedPeriodAfterGlobal
|
ExpectedPeriodAfterGlobal
|
||||||
ExpectedContinueKind
|
ExpectedContinueKind
|
||||||
ExpectedEndUsing
|
ExpectedEndUsing
|
||||||
ExpectedEndEvent
|
ExpectedEndEvent
|
||||||
ExpectedEndAddHandler
|
ExpectedEndAddHandler
|
||||||
ExpectedEndRemoveHandler
|
ExpectedEndRemoveHandler
|
||||||
ExpectedEndRaiseEvent
|
ExpectedEndRaiseEvent
|
||||||
EndUsingWithoutUsing
|
EndUsingWithoutUsing
|
||||||
EndEventWithoutEvent
|
EndEventWithoutEvent
|
||||||
EndAddHandlerWithoutAddHandler
|
EndAddHandlerWithoutAddHandler
|
||||||
EndRemoveHandlerWithoutRemoveHandler
|
EndRemoveHandlerWithoutRemoveHandler
|
||||||
EndRaiseEventWithoutRaiseEvent
|
EndRaiseEventWithoutRaiseEvent
|
||||||
EndAddHandlerNotAtLineStart
|
EndAddHandlerNotAtLineStart
|
||||||
EndRemoveHandlerNotAtLineStart
|
EndRemoveHandlerNotAtLineStart
|
||||||
EndRaiseEventNotAtLineStart
|
EndRaiseEventNotAtLineStart
|
||||||
|
|
||||||
'Analysis error
|
'Analysis error
|
||||||
NameAlreadyUsed
|
NameAlreadyUsed
|
||||||
VariableNotDeclared
|
VariableNotDeclared
|
||||||
NotImplemented
|
NotImplemented
|
||||||
Unexpected
|
Unexpected
|
||||||
End Enum
|
End Enum
|
|
@ -1,37 +1,37 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A character literal.
|
''' A character literal.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class CharacterLiteralToken
|
Public NotInheritable Class CharacterLiteralToken
|
||||||
Inherits Token
|
Inherits Token
|
||||||
|
|
||||||
Private ReadOnly _Literal As Char
|
Private ReadOnly _Literal As Char
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The literal value.
|
''' The literal value.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Literal() As Char
|
Public ReadOnly Property Literal() As Char
|
||||||
Get
|
Get
|
||||||
Return _Literal
|
Return _Literal
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new character literal token.
|
''' Constructs a new character literal token.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="literal">The literal value.</param>
|
''' <param name="literal">The literal value.</param>
|
||||||
''' <param name="span">The location of the literal.</param>
|
''' <param name="span">The location of the literal.</param>
|
||||||
Public Sub New(ByVal literal As Char, ByVal span As Span)
|
Public Sub New(ByVal literal As Char, ByVal span As Span)
|
||||||
MyBase.New(TokenType.CharacterLiteral, span)
|
MyBase.New(TokenType.CharacterLiteral, span)
|
||||||
_Literal = Literal
|
_Literal = Literal
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,54 +1,54 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A comment token.
|
''' A comment token.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class CommentToken
|
Public NotInheritable Class CommentToken
|
||||||
Inherits Token
|
Inherits Token
|
||||||
|
|
||||||
Private ReadOnly _IsREM As Boolean ' Was the comment preceded by a quote or by REM?
|
Private ReadOnly _IsREM As Boolean ' Was the comment preceded by a quote or by REM?
|
||||||
Private ReadOnly _Comment As String ' Comment can be Nothing
|
Private ReadOnly _Comment As String ' Comment can be Nothing
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Whether the comment was preceded by REM.
|
''' Whether the comment was preceded by REM.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property IsREM() As Boolean
|
Public ReadOnly Property IsREM() As Boolean
|
||||||
Get
|
Get
|
||||||
Return _IsREM
|
Return _IsREM
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The text of the comment.
|
''' The text of the comment.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Comment() As String
|
Public ReadOnly Property Comment() As String
|
||||||
Get
|
Get
|
||||||
Return _Comment
|
Return _Comment
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new comment token.
|
''' Constructs a new comment token.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="comment">The comment value.</param>
|
''' <param name="comment">The comment value.</param>
|
||||||
''' <param name="isREM">Whether the comment was preceded by REM.</param>
|
''' <param name="isREM">Whether the comment was preceded by REM.</param>
|
||||||
''' <param name="span">The location of the comment.</param>
|
''' <param name="span">The location of the comment.</param>
|
||||||
Public Sub New(ByVal comment As String, ByVal isREM As Boolean, ByVal span As Span)
|
Public Sub New(ByVal comment As String, ByVal isREM As Boolean, ByVal span As Span)
|
||||||
MyBase.New(TokenType.Comment, span)
|
MyBase.New(TokenType.Comment, span)
|
||||||
|
|
||||||
If comment Is Nothing Then
|
If comment Is Nothing Then
|
||||||
Throw New ArgumentNullException("comment")
|
Throw New ArgumentNullException("comment")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
_IsREM = isREM
|
_IsREM = isREM
|
||||||
_Comment = comment
|
_Comment = comment
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,37 +1,37 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A date/time literal.
|
''' A date/time literal.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class DateLiteralToken
|
Public NotInheritable Class DateLiteralToken
|
||||||
Inherits Token
|
Inherits Token
|
||||||
|
|
||||||
Private ReadOnly _Literal As Date
|
Private ReadOnly _Literal As Date
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The literal value.
|
''' The literal value.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Literal() As Date
|
Public ReadOnly Property Literal() As Date
|
||||||
Get
|
Get
|
||||||
Return _Literal
|
Return _Literal
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new date literal instance.
|
''' Constructs a new date literal instance.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="literal">The literal value.</param>
|
''' <param name="literal">The literal value.</param>
|
||||||
''' <param name="span">The location of the literal.</param>
|
''' <param name="span">The location of the literal.</param>
|
||||||
Public Sub New(ByVal literal As Date, ByVal span As Span)
|
Public Sub New(ByVal literal As Date, ByVal span As Span)
|
||||||
MyBase.New(TokenType.DateLiteral, span)
|
MyBase.New(TokenType.DateLiteral, span)
|
||||||
_Literal = literal
|
_Literal = literal
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,55 +1,55 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A decimal literal token.
|
''' A decimal literal token.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class DecimalLiteralToken
|
Public NotInheritable Class DecimalLiteralToken
|
||||||
Inherits Token
|
Inherits Token
|
||||||
|
|
||||||
Private ReadOnly _Literal As Decimal
|
Private ReadOnly _Literal As Decimal
|
||||||
Private ReadOnly _TypeCharacter As TypeCharacter ' The type character after the literal, if any
|
Private ReadOnly _TypeCharacter As TypeCharacter ' The type character after the literal, if any
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The literal value.
|
''' The literal value.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Literal() As Decimal
|
Public ReadOnly Property Literal() As Decimal
|
||||||
Get
|
Get
|
||||||
Return _Literal
|
Return _Literal
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The type character of the literal.
|
''' The type character of the literal.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property TypeCharacter() As TypeCharacter
|
Public ReadOnly Property TypeCharacter() As TypeCharacter
|
||||||
Get
|
Get
|
||||||
Return _TypeCharacter
|
Return _TypeCharacter
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new decimal literal token.
|
''' Constructs a new decimal literal token.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="literal">The literal value.</param>
|
''' <param name="literal">The literal value.</param>
|
||||||
''' <param name="typeCharacter">The literal's type character.</param>
|
''' <param name="typeCharacter">The literal's type character.</param>
|
||||||
''' <param name="span">The location of the literal.</param>
|
''' <param name="span">The location of the literal.</param>
|
||||||
Public Sub New(ByVal literal As Decimal, ByVal typeCharacter As TypeCharacter, ByVal span As Span)
|
Public Sub New(ByVal literal As Decimal, ByVal typeCharacter As TypeCharacter, ByVal span As Span)
|
||||||
MyBase.New(TokenType.DecimalLiteral, span)
|
MyBase.New(TokenType.DecimalLiteral, span)
|
||||||
|
|
||||||
If typeCharacter <> typeCharacter.None AndAlso typeCharacter <> typeCharacter.DecimalChar AndAlso _
|
If typeCharacter <> typeCharacter.None AndAlso typeCharacter <> typeCharacter.DecimalChar AndAlso _
|
||||||
typeCharacter <> typeCharacter.DecimalSymbol Then
|
typeCharacter <> typeCharacter.DecimalSymbol Then
|
||||||
Throw New ArgumentOutOfRangeException("typeCharacter")
|
Throw New ArgumentOutOfRangeException("typeCharacter")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
_Literal = literal
|
_Literal = literal
|
||||||
_TypeCharacter = typeCharacter
|
_TypeCharacter = typeCharacter
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
|
@ -1,25 +1,25 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A token representing the end of the file.
|
''' A token representing the end of the file.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class EndOfStreamToken
|
Public NotInheritable Class EndOfStreamToken
|
||||||
Inherits Token
|
Inherits Token
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Creates a new end-of-stream token.
|
''' Creates a new end-of-stream token.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="span">The location of the end of the stream.</param>
|
''' <param name="span">The location of the end of the stream.</param>
|
||||||
Public Sub New(ByVal span As Span)
|
Public Sub New(ByVal span As Span)
|
||||||
MyBase.New(TokenType.EndOfStream, Span)
|
MyBase.New(TokenType.EndOfStream, Span)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|
|
@ -1,42 +1,42 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A lexical error.
|
''' A lexical error.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class ErrorToken
|
Public NotInheritable Class ErrorToken
|
||||||
Inherits Token
|
Inherits Token
|
||||||
|
|
||||||
Private ReadOnly _SyntaxError As SyntaxError
|
Private ReadOnly _SyntaxError As SyntaxError
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The syntax error that represents the lexical error.
|
''' The syntax error that represents the lexical error.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property SyntaxError() As SyntaxError
|
Public ReadOnly Property SyntaxError() As SyntaxError
|
||||||
Get
|
Get
|
||||||
Return _SyntaxError
|
Return _SyntaxError
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Creates a new lexical error token.
|
''' Creates a new lexical error token.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="errorType">The type of the error.</param>
|
''' <param name="errorType">The type of the error.</param>
|
||||||
''' <param name="span">The location of the error.</param>
|
''' <param name="span">The location of the error.</param>
|
||||||
Public Sub New(ByVal errorType As SyntaxErrorType, ByVal span As Span)
|
Public Sub New(ByVal errorType As SyntaxErrorType, ByVal span As Span)
|
||||||
MyBase.New(TokenType.LexicalError, span)
|
MyBase.New(TokenType.LexicalError, span)
|
||||||
|
|
||||||
If errorType < SyntaxErrorType.InvalidEscapedIdentifier OrElse errorType > SyntaxErrorType.InvalidDecimalLiteral Then
|
If errorType < SyntaxErrorType.InvalidEscapedIdentifier OrElse errorType > SyntaxErrorType.InvalidDecimalLiteral Then
|
||||||
Throw New ArgumentOutOfRangeException("errorType")
|
Throw New ArgumentOutOfRangeException("errorType")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
_SyntaxError = New SyntaxError(errorType, span)
|
_SyntaxError = New SyntaxError(errorType, span)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,56 +1,56 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A floating point literal.
|
''' A floating point literal.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class FloatingPointLiteralToken
|
Public NotInheritable Class FloatingPointLiteralToken
|
||||||
Inherits Token
|
Inherits Token
|
||||||
|
|
||||||
Private ReadOnly _Literal As Double
|
Private ReadOnly _Literal As Double
|
||||||
Private ReadOnly _TypeCharacter As TypeCharacter ' The type character after the literal, if any
|
Private ReadOnly _TypeCharacter As TypeCharacter ' The type character after the literal, if any
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The value of the literal.
|
''' The value of the literal.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Literal() As Double
|
Public ReadOnly Property Literal() As Double
|
||||||
Get
|
Get
|
||||||
Return _Literal
|
Return _Literal
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The type character after the literal.
|
''' The type character after the literal.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property TypeCharacter() As TypeCharacter
|
Public ReadOnly Property TypeCharacter() As TypeCharacter
|
||||||
Get
|
Get
|
||||||
Return _TypeCharacter
|
Return _TypeCharacter
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new floating point literal token.
|
''' Constructs a new floating point literal token.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="literal">The literal value.</param>
|
''' <param name="literal">The literal value.</param>
|
||||||
''' <param name="typeCharacter">The type character of the literal.</param>
|
''' <param name="typeCharacter">The type character of the literal.</param>
|
||||||
''' <param name="span">The location of the literal.</param>
|
''' <param name="span">The location of the literal.</param>
|
||||||
Public Sub New(ByVal literal As Double, ByVal typeCharacter As TypeCharacter, ByVal span As Span)
|
Public Sub New(ByVal literal As Double, ByVal typeCharacter As TypeCharacter, ByVal span As Span)
|
||||||
MyBase.New(TokenType.FloatingPointLiteral, span)
|
MyBase.New(TokenType.FloatingPointLiteral, span)
|
||||||
|
|
||||||
If typeCharacter <> typeCharacter.None AndAlso _
|
If typeCharacter <> typeCharacter.None AndAlso _
|
||||||
typeCharacter <> typeCharacter.SingleSymbol AndAlso typeCharacter <> typeCharacter.SingleChar AndAlso _
|
typeCharacter <> typeCharacter.SingleSymbol AndAlso typeCharacter <> typeCharacter.SingleChar AndAlso _
|
||||||
typeCharacter <> typeCharacter.DoubleSymbol AndAlso typeCharacter <> typeCharacter.DoubleChar Then
|
typeCharacter <> typeCharacter.DoubleSymbol AndAlso typeCharacter <> typeCharacter.DoubleChar Then
|
||||||
Throw New ArgumentOutOfRangeException("typeCharacter")
|
Throw New ArgumentOutOfRangeException("typeCharacter")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
_Literal = literal
|
_Literal = literal
|
||||||
_TypeCharacter = typeCharacter
|
_TypeCharacter = typeCharacter
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,313 +1,313 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' An identifier.
|
''' An identifier.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class IdentifierToken
|
Public NotInheritable Class IdentifierToken
|
||||||
Inherits Token
|
Inherits Token
|
||||||
|
|
||||||
Private Structure Keyword
|
Private Structure Keyword
|
||||||
Public ReadOnly Versions As LanguageVersion
|
Public ReadOnly Versions As LanguageVersion
|
||||||
Public ReadOnly ReservedVersions As LanguageVersion
|
Public ReadOnly ReservedVersions As LanguageVersion
|
||||||
Public ReadOnly TokenType As TokenType
|
Public ReadOnly TokenType As TokenType
|
||||||
|
|
||||||
Public Sub New(ByVal Versions As LanguageVersion, ByVal ReservedVersions As LanguageVersion, ByVal TokenType As TokenType)
|
Public Sub New(ByVal Versions As LanguageVersion, ByVal ReservedVersions As LanguageVersion, ByVal TokenType As TokenType)
|
||||||
Me.Versions = Versions
|
Me.Versions = Versions
|
||||||
Me.ReservedVersions = ReservedVersions
|
Me.ReservedVersions = ReservedVersions
|
||||||
Me.TokenType = TokenType
|
Me.TokenType = TokenType
|
||||||
End Sub
|
End Sub
|
||||||
End Structure
|
End Structure
|
||||||
|
|
||||||
Private Shared KeywordTable As Dictionary(Of String, Keyword)
|
Private Shared KeywordTable As Dictionary(Of String, Keyword)
|
||||||
|
|
||||||
Private Shared Sub AddKeyword(ByVal table As Dictionary(Of String, Keyword), ByVal name As String, ByVal keyword As Keyword)
|
Private Shared Sub AddKeyword(ByVal table As Dictionary(Of String, Keyword), ByVal name As String, ByVal keyword As Keyword)
|
||||||
table.Add(name, keyword)
|
table.Add(name, keyword)
|
||||||
table.Add(Scanner.MakeFullWidth(name), keyword)
|
table.Add(Scanner.MakeFullWidth(name), keyword)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
' Returns the token type of the string.
|
' Returns the token type of the string.
|
||||||
Friend Shared Function TokenTypeFromString(ByVal s As String, ByVal Version As LanguageVersion, ByVal IncludeUnreserved As Boolean) As TokenType
|
Friend Shared Function TokenTypeFromString(ByVal s As String, ByVal Version As LanguageVersion, ByVal IncludeUnreserved As Boolean) As TokenType
|
||||||
If KeywordTable Is Nothing Then
|
If KeywordTable Is Nothing Then
|
||||||
Dim Table As New Dictionary(Of String, Keyword)(StringComparer.InvariantCultureIgnoreCase)
|
Dim Table As New Dictionary(Of String, Keyword)(StringComparer.InvariantCultureIgnoreCase)
|
||||||
|
|
||||||
' NOTE: These have to be in the same order as the enum!
|
' NOTE: These have to be in the same order as the enum!
|
||||||
AddKeyword(Table, "AddHandler", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.AddHandler))
|
AddKeyword(Table, "AddHandler", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.AddHandler))
|
||||||
AddKeyword(Table, "AddressOf", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.AddressOf))
|
AddKeyword(Table, "AddressOf", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.AddressOf))
|
||||||
AddKeyword(Table, "Alias", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Alias))
|
AddKeyword(Table, "Alias", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Alias))
|
||||||
AddKeyword(Table, "And", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.And))
|
AddKeyword(Table, "And", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.And))
|
||||||
AddKeyword(Table, "AndAlso", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.AndAlso))
|
AddKeyword(Table, "AndAlso", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.AndAlso))
|
||||||
AddKeyword(Table, "Ansi", New Keyword(LanguageVersion.All, LanguageVersion.VisualBasic71, TokenType.Ansi))
|
AddKeyword(Table, "Ansi", New Keyword(LanguageVersion.All, LanguageVersion.VisualBasic71, TokenType.Ansi))
|
||||||
AddKeyword(Table, "As", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.As))
|
AddKeyword(Table, "As", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.As))
|
||||||
AddKeyword(Table, "Assembly", New Keyword(LanguageVersion.All, LanguageVersion.VisualBasic71, TokenType.Assembly))
|
AddKeyword(Table, "Assembly", New Keyword(LanguageVersion.All, LanguageVersion.VisualBasic71, TokenType.Assembly))
|
||||||
AddKeyword(Table, "Auto", New Keyword(LanguageVersion.All, LanguageVersion.VisualBasic71, TokenType.Auto))
|
AddKeyword(Table, "Auto", New Keyword(LanguageVersion.All, LanguageVersion.VisualBasic71, TokenType.Auto))
|
||||||
AddKeyword(Table, "Binary", New Keyword(LanguageVersion.All, LanguageVersion.None, TokenType.Binary))
|
AddKeyword(Table, "Binary", New Keyword(LanguageVersion.All, LanguageVersion.None, TokenType.Binary))
|
||||||
AddKeyword(Table, "Boolean", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Boolean))
|
AddKeyword(Table, "Boolean", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Boolean))
|
||||||
AddKeyword(Table, "ByRef", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.ByRef))
|
AddKeyword(Table, "ByRef", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.ByRef))
|
||||||
AddKeyword(Table, "Byte", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Byte))
|
AddKeyword(Table, "Byte", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Byte))
|
||||||
AddKeyword(Table, "ByVal", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.ByVal))
|
AddKeyword(Table, "ByVal", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.ByVal))
|
||||||
AddKeyword(Table, "Call", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Call))
|
AddKeyword(Table, "Call", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Call))
|
||||||
AddKeyword(Table, "Case", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Case))
|
AddKeyword(Table, "Case", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Case))
|
||||||
AddKeyword(Table, "Catch", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Catch))
|
AddKeyword(Table, "Catch", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Catch))
|
||||||
'AddKeyword(Table, "CBool", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CBool))
|
'AddKeyword(Table, "CBool", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CBool))
|
||||||
'AddKeyword(Table, "CByte", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CByte))
|
'AddKeyword(Table, "CByte", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CByte))
|
||||||
'AddKeyword(Table, "CChar", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CChar))
|
'AddKeyword(Table, "CChar", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CChar))
|
||||||
'AddKeyword(Table, "CDate", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CDate))
|
'AddKeyword(Table, "CDate", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CDate))
|
||||||
'AddKeyword(Table, "CDbl", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CDbl))
|
'AddKeyword(Table, "CDbl", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CDbl))
|
||||||
'AddKeyword(Table, "CDec", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CDec))
|
'AddKeyword(Table, "CDec", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CDec))
|
||||||
AddKeyword(Table, "Char", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Char))
|
AddKeyword(Table, "Char", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Char))
|
||||||
'AddKeyword(Table, "CInt", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CInt))
|
'AddKeyword(Table, "CInt", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CInt))
|
||||||
AddKeyword(Table, "Class", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Class))
|
AddKeyword(Table, "Class", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Class))
|
||||||
'AddKeyword(Table, "CLng", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CLng))
|
'AddKeyword(Table, "CLng", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CLng))
|
||||||
'AddKeyword(Table, "CObj", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CObj))
|
'AddKeyword(Table, "CObj", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CObj))
|
||||||
AddKeyword(Table, "Compare", New Keyword(LanguageVersion.All, LanguageVersion.None, TokenType.Compare))
|
AddKeyword(Table, "Compare", New Keyword(LanguageVersion.All, LanguageVersion.None, TokenType.Compare))
|
||||||
AddKeyword(Table, "Const", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Const))
|
AddKeyword(Table, "Const", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Const))
|
||||||
AddKeyword(Table, "Continue", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.Continue))
|
AddKeyword(Table, "Continue", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.Continue))
|
||||||
'AddKeyword(Table, "CSByte", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.CSByte))
|
'AddKeyword(Table, "CSByte", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.CSByte))
|
||||||
'AddKeyword(Table, "CShort", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CShort))
|
'AddKeyword(Table, "CShort", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CShort))
|
||||||
'AddKeyword(Table, "CSng", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CSng))
|
'AddKeyword(Table, "CSng", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CSng))
|
||||||
'AddKeyword(Table, "CStr", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CStr))
|
'AddKeyword(Table, "CStr", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CStr))
|
||||||
'AddKeyword(Table, "CType", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CType))
|
'AddKeyword(Table, "CType", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CType))
|
||||||
'AddKeyword(Table, "CUInt", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.CUInt))
|
'AddKeyword(Table, "CUInt", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.CUInt))
|
||||||
'AddKeyword(Table, "CULng", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.CULng))
|
'AddKeyword(Table, "CULng", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.CULng))
|
||||||
'AddKeyword(Table, "CUShort", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.CUShort))
|
'AddKeyword(Table, "CUShort", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.CUShort))
|
||||||
AddKeyword(Table, "Custom", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.None, TokenType.Custom))
|
AddKeyword(Table, "Custom", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.None, TokenType.Custom))
|
||||||
AddKeyword(Table, "Date", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Date))
|
AddKeyword(Table, "Date", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Date))
|
||||||
AddKeyword(Table, "Decimal", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Decimal))
|
AddKeyword(Table, "Decimal", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Decimal))
|
||||||
AddKeyword(Table, "Declare", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Declare))
|
AddKeyword(Table, "Declare", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Declare))
|
||||||
AddKeyword(Table, "Default", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Default))
|
AddKeyword(Table, "Default", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Default))
|
||||||
AddKeyword(Table, "Delegate", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Delegate))
|
AddKeyword(Table, "Delegate", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Delegate))
|
||||||
AddKeyword(Table, "Dim", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Dim))
|
AddKeyword(Table, "Dim", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Dim))
|
||||||
AddKeyword(Table, "DirectCast", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.DirectCast))
|
AddKeyword(Table, "DirectCast", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.DirectCast))
|
||||||
AddKeyword(Table, "Do", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Do))
|
AddKeyword(Table, "Do", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Do))
|
||||||
AddKeyword(Table, "Double", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Double))
|
AddKeyword(Table, "Double", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Double))
|
||||||
AddKeyword(Table, "Each", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Each))
|
AddKeyword(Table, "Each", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Each))
|
||||||
AddKeyword(Table, "Else", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Else))
|
AddKeyword(Table, "Else", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Else))
|
||||||
AddKeyword(Table, "ElseIf", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.ElseIf))
|
AddKeyword(Table, "ElseIf", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.ElseIf))
|
||||||
AddKeyword(Table, "End", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.End))
|
AddKeyword(Table, "End", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.End))
|
||||||
AddKeyword(Table, "EndIf", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.EndIf))
|
AddKeyword(Table, "EndIf", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.EndIf))
|
||||||
AddKeyword(Table, "Enum", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Enum))
|
AddKeyword(Table, "Enum", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Enum))
|
||||||
AddKeyword(Table, "Erase", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Erase))
|
AddKeyword(Table, "Erase", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Erase))
|
||||||
AddKeyword(Table, "Error", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Error))
|
AddKeyword(Table, "Error", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Error))
|
||||||
AddKeyword(Table, "Event", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Event))
|
AddKeyword(Table, "Event", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Event))
|
||||||
AddKeyword(Table, "Exit", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Exit))
|
AddKeyword(Table, "Exit", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Exit))
|
||||||
AddKeyword(Table, "Explicit", New Keyword(LanguageVersion.All, LanguageVersion.None, TokenType.Explicit))
|
AddKeyword(Table, "Explicit", New Keyword(LanguageVersion.All, LanguageVersion.None, TokenType.Explicit))
|
||||||
AddKeyword(Table, "ExternalChecksum", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.None, TokenType.ExternalChecksum))
|
AddKeyword(Table, "ExternalChecksum", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.None, TokenType.ExternalChecksum))
|
||||||
AddKeyword(Table, "ExternalSource", New Keyword(LanguageVersion.All, LanguageVersion.None, TokenType.ExternalSource))
|
AddKeyword(Table, "ExternalSource", New Keyword(LanguageVersion.All, LanguageVersion.None, TokenType.ExternalSource))
|
||||||
AddKeyword(Table, "False", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.False))
|
AddKeyword(Table, "False", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.False))
|
||||||
AddKeyword(Table, "Finally", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Finally))
|
AddKeyword(Table, "Finally", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Finally))
|
||||||
AddKeyword(Table, "For", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.For))
|
AddKeyword(Table, "For", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.For))
|
||||||
AddKeyword(Table, "Friend", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Friend))
|
AddKeyword(Table, "Friend", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Friend))
|
||||||
AddKeyword(Table, "Function", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Function))
|
AddKeyword(Table, "Function", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Function))
|
||||||
AddKeyword(Table, "Get", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Get))
|
AddKeyword(Table, "Get", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Get))
|
||||||
AddKeyword(Table, "GetType", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.GetType))
|
AddKeyword(Table, "GetType", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.GetType))
|
||||||
AddKeyword(Table, "Global", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.Global))
|
AddKeyword(Table, "Global", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.Global))
|
||||||
AddKeyword(Table, "GoSub", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.GoSub))
|
AddKeyword(Table, "GoSub", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.GoSub))
|
||||||
AddKeyword(Table, "GoTo", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.GoTo))
|
AddKeyword(Table, "GoTo", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.GoTo))
|
||||||
AddKeyword(Table, "Handles", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Handles))
|
AddKeyword(Table, "Handles", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Handles))
|
||||||
AddKeyword(Table, "If", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.If))
|
AddKeyword(Table, "If", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.If))
|
||||||
AddKeyword(Table, "Implements", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Implements))
|
AddKeyword(Table, "Implements", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Implements))
|
||||||
AddKeyword(Table, "Imports", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Imports))
|
AddKeyword(Table, "Imports", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Imports))
|
||||||
AddKeyword(Table, "In", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.In))
|
AddKeyword(Table, "In", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.In))
|
||||||
AddKeyword(Table, "Inherits", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Inherits))
|
AddKeyword(Table, "Inherits", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Inherits))
|
||||||
AddKeyword(Table, "Integer", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Integer))
|
AddKeyword(Table, "Integer", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Integer))
|
||||||
AddKeyword(Table, "Interface", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Interface))
|
AddKeyword(Table, "Interface", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Interface))
|
||||||
AddKeyword(Table, "Is", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Is))
|
AddKeyword(Table, "Is", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Is))
|
||||||
AddKeyword(Table, "IsFalse", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.None, TokenType.IsFalse))
|
AddKeyword(Table, "IsFalse", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.None, TokenType.IsFalse))
|
||||||
AddKeyword(Table, "IsNot", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.IsNot))
|
AddKeyword(Table, "IsNot", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.IsNot))
|
||||||
AddKeyword(Table, "IsTrue", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.None, TokenType.IsTrue))
|
AddKeyword(Table, "IsTrue", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.None, TokenType.IsTrue))
|
||||||
AddKeyword(Table, "Let", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Let))
|
AddKeyword(Table, "Let", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Let))
|
||||||
AddKeyword(Table, "Lib", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Lib))
|
AddKeyword(Table, "Lib", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Lib))
|
||||||
AddKeyword(Table, "Like", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Like))
|
AddKeyword(Table, "Like", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Like))
|
||||||
AddKeyword(Table, "Long", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Long))
|
AddKeyword(Table, "Long", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Long))
|
||||||
AddKeyword(Table, "Loop", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Loop))
|
AddKeyword(Table, "Loop", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Loop))
|
||||||
AddKeyword(Table, "Me", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Me))
|
AddKeyword(Table, "Me", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Me))
|
||||||
AddKeyword(Table, "Mid", New Keyword(LanguageVersion.All, LanguageVersion.None, TokenType.Mid))
|
AddKeyword(Table, "Mid", New Keyword(LanguageVersion.All, LanguageVersion.None, TokenType.Mid))
|
||||||
AddKeyword(Table, "Mod", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Mod))
|
AddKeyword(Table, "Mod", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Mod))
|
||||||
AddKeyword(Table, "Module", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Module))
|
AddKeyword(Table, "Module", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Module))
|
||||||
AddKeyword(Table, "MustInherit", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.MustInherit))
|
AddKeyword(Table, "MustInherit", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.MustInherit))
|
||||||
AddKeyword(Table, "MustOverride", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.MustOverride))
|
AddKeyword(Table, "MustOverride", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.MustOverride))
|
||||||
AddKeyword(Table, "MyBase", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.MyBase))
|
AddKeyword(Table, "MyBase", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.MyBase))
|
||||||
AddKeyword(Table, "MyClass", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.MyClass))
|
AddKeyword(Table, "MyClass", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.MyClass))
|
||||||
AddKeyword(Table, "Namespace", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Namespace))
|
AddKeyword(Table, "Namespace", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Namespace))
|
||||||
AddKeyword(Table, "Narrowing", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.Narrowing))
|
AddKeyword(Table, "Narrowing", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.Narrowing))
|
||||||
AddKeyword(Table, "New", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.New))
|
AddKeyword(Table, "New", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.New))
|
||||||
AddKeyword(Table, "Next", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Next))
|
AddKeyword(Table, "Next", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Next))
|
||||||
AddKeyword(Table, "Not", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Not))
|
AddKeyword(Table, "Not", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Not))
|
||||||
AddKeyword(Table, "Nothing", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Nothing))
|
AddKeyword(Table, "Nothing", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Nothing))
|
||||||
AddKeyword(Table, "NotInheritable", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.NotInheritable))
|
AddKeyword(Table, "NotInheritable", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.NotInheritable))
|
||||||
AddKeyword(Table, "NotOverridable", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.NotOverridable))
|
AddKeyword(Table, "NotOverridable", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.NotOverridable))
|
||||||
AddKeyword(Table, "Object", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Object))
|
AddKeyword(Table, "Object", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Object))
|
||||||
AddKeyword(Table, "Of", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.Of))
|
AddKeyword(Table, "Of", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.Of))
|
||||||
AddKeyword(Table, "Off", New Keyword(LanguageVersion.All, LanguageVersion.None, TokenType.Off))
|
AddKeyword(Table, "Off", New Keyword(LanguageVersion.All, LanguageVersion.None, TokenType.Off))
|
||||||
AddKeyword(Table, "On", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.On))
|
AddKeyword(Table, "On", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.On))
|
||||||
AddKeyword(Table, "Operator", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.Operator))
|
AddKeyword(Table, "Operator", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.Operator))
|
||||||
AddKeyword(Table, "Option", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Option))
|
AddKeyword(Table, "Option", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Option))
|
||||||
AddKeyword(Table, "Optional", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Optional))
|
AddKeyword(Table, "Optional", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Optional))
|
||||||
AddKeyword(Table, "Or", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Or))
|
AddKeyword(Table, "Or", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Or))
|
||||||
AddKeyword(Table, "OrElse", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.OrElse))
|
AddKeyword(Table, "OrElse", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.OrElse))
|
||||||
AddKeyword(Table, "Overloads", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Overloads))
|
AddKeyword(Table, "Overloads", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Overloads))
|
||||||
AddKeyword(Table, "Overridable", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Overridable))
|
AddKeyword(Table, "Overridable", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Overridable))
|
||||||
AddKeyword(Table, "Overrides", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Overrides))
|
AddKeyword(Table, "Overrides", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Overrides))
|
||||||
AddKeyword(Table, "ParamArray", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.ParamArray))
|
AddKeyword(Table, "ParamArray", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.ParamArray))
|
||||||
AddKeyword(Table, "Partial", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.Partial))
|
AddKeyword(Table, "Partial", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.Partial))
|
||||||
AddKeyword(Table, "Preserve", New Keyword(LanguageVersion.All, LanguageVersion.VisualBasic71, TokenType.Preserve))
|
AddKeyword(Table, "Preserve", New Keyword(LanguageVersion.All, LanguageVersion.VisualBasic71, TokenType.Preserve))
|
||||||
AddKeyword(Table, "Private", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Private))
|
AddKeyword(Table, "Private", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Private))
|
||||||
AddKeyword(Table, "Property", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Property))
|
AddKeyword(Table, "Property", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Property))
|
||||||
AddKeyword(Table, "Protected", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Protected))
|
AddKeyword(Table, "Protected", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Protected))
|
||||||
AddKeyword(Table, "Public", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Public))
|
AddKeyword(Table, "Public", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Public))
|
||||||
AddKeyword(Table, "RaiseEvent", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.RaiseEvent))
|
AddKeyword(Table, "RaiseEvent", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.RaiseEvent))
|
||||||
AddKeyword(Table, "ReadOnly", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.ReadOnly))
|
AddKeyword(Table, "ReadOnly", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.ReadOnly))
|
||||||
AddKeyword(Table, "ReDim", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.ReDim))
|
AddKeyword(Table, "ReDim", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.ReDim))
|
||||||
AddKeyword(Table, "Region", New Keyword(LanguageVersion.All, LanguageVersion.None, TokenType.Region))
|
AddKeyword(Table, "Region", New Keyword(LanguageVersion.All, LanguageVersion.None, TokenType.Region))
|
||||||
AddKeyword(Table, "REM", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.[REM]))
|
AddKeyword(Table, "REM", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.[REM]))
|
||||||
AddKeyword(Table, "RemoveHandler", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.RemoveHandler))
|
AddKeyword(Table, "RemoveHandler", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.RemoveHandler))
|
||||||
AddKeyword(Table, "Resume", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Resume))
|
AddKeyword(Table, "Resume", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Resume))
|
||||||
AddKeyword(Table, "Return", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Return))
|
AddKeyword(Table, "Return", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Return))
|
||||||
AddKeyword(Table, "SByte", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.SByte))
|
AddKeyword(Table, "SByte", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.SByte))
|
||||||
AddKeyword(Table, "Select", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Select))
|
AddKeyword(Table, "Select", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Select))
|
||||||
AddKeyword(Table, "Set", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Set))
|
AddKeyword(Table, "Set", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Set))
|
||||||
AddKeyword(Table, "Shadows", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Shadows))
|
AddKeyword(Table, "Shadows", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Shadows))
|
||||||
AddKeyword(Table, "Shared", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Shared))
|
AddKeyword(Table, "Shared", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Shared))
|
||||||
AddKeyword(Table, "Short", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Short))
|
AddKeyword(Table, "Short", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Short))
|
||||||
AddKeyword(Table, "Single", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Single))
|
AddKeyword(Table, "Single", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Single))
|
||||||
AddKeyword(Table, "Static", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Static))
|
AddKeyword(Table, "Static", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Static))
|
||||||
AddKeyword(Table, "Step", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Step))
|
AddKeyword(Table, "Step", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Step))
|
||||||
AddKeyword(Table, "Stop", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Stop))
|
AddKeyword(Table, "Stop", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Stop))
|
||||||
AddKeyword(Table, "Strict", New Keyword(LanguageVersion.All, LanguageVersion.None, TokenType.Strict))
|
AddKeyword(Table, "Strict", New Keyword(LanguageVersion.All, LanguageVersion.None, TokenType.Strict))
|
||||||
AddKeyword(Table, "String", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.String))
|
AddKeyword(Table, "String", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.String))
|
||||||
AddKeyword(Table, "Structure", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Structure))
|
AddKeyword(Table, "Structure", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Structure))
|
||||||
AddKeyword(Table, "Sub", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Sub))
|
AddKeyword(Table, "Sub", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Sub))
|
||||||
AddKeyword(Table, "SyncLock", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.SyncLock))
|
AddKeyword(Table, "SyncLock", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.SyncLock))
|
||||||
AddKeyword(Table, "Text", New Keyword(LanguageVersion.All, LanguageVersion.None, TokenType.Text))
|
AddKeyword(Table, "Text", New Keyword(LanguageVersion.All, LanguageVersion.None, TokenType.Text))
|
||||||
AddKeyword(Table, "Then", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Then))
|
AddKeyword(Table, "Then", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Then))
|
||||||
AddKeyword(Table, "Throw", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Throw))
|
AddKeyword(Table, "Throw", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Throw))
|
||||||
AddKeyword(Table, "To", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.To))
|
AddKeyword(Table, "To", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.To))
|
||||||
AddKeyword(Table, "True", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.True))
|
AddKeyword(Table, "True", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.True))
|
||||||
AddKeyword(Table, "Try", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Try))
|
AddKeyword(Table, "Try", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Try))
|
||||||
AddKeyword(Table, "TryCast", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.TryCast))
|
AddKeyword(Table, "TryCast", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.TryCast))
|
||||||
AddKeyword(Table, "TypeOf", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.TypeOf))
|
AddKeyword(Table, "TypeOf", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.TypeOf))
|
||||||
AddKeyword(Table, "UInteger", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.UInteger))
|
AddKeyword(Table, "UInteger", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.UInteger))
|
||||||
AddKeyword(Table, "ULong", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.ULong))
|
AddKeyword(Table, "ULong", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.ULong))
|
||||||
AddKeyword(Table, "UShort", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.UShort))
|
AddKeyword(Table, "UShort", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.UShort))
|
||||||
AddKeyword(Table, "Using", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.Using))
|
AddKeyword(Table, "Using", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.Using))
|
||||||
AddKeyword(Table, "Unicode", New Keyword(LanguageVersion.All, LanguageVersion.VisualBasic71, TokenType.Unicode))
|
AddKeyword(Table, "Unicode", New Keyword(LanguageVersion.All, LanguageVersion.VisualBasic71, TokenType.Unicode))
|
||||||
AddKeyword(Table, "Until", New Keyword(LanguageVersion.All, LanguageVersion.VisualBasic71, TokenType.Until))
|
AddKeyword(Table, "Until", New Keyword(LanguageVersion.All, LanguageVersion.VisualBasic71, TokenType.Until))
|
||||||
AddKeyword(Table, "Variant", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Variant))
|
AddKeyword(Table, "Variant", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Variant))
|
||||||
AddKeyword(Table, "Wend", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Wend))
|
AddKeyword(Table, "Wend", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Wend))
|
||||||
AddKeyword(Table, "When", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.When))
|
AddKeyword(Table, "When", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.When))
|
||||||
AddKeyword(Table, "While", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.While))
|
AddKeyword(Table, "While", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.While))
|
||||||
AddKeyword(Table, "Widening", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.Widening))
|
AddKeyword(Table, "Widening", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.Widening))
|
||||||
AddKeyword(Table, "With", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.With))
|
AddKeyword(Table, "With", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.With))
|
||||||
AddKeyword(Table, "WithEvents", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.WithEvents))
|
AddKeyword(Table, "WithEvents", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.WithEvents))
|
||||||
AddKeyword(Table, "WriteOnly", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.WriteOnly))
|
AddKeyword(Table, "WriteOnly", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.WriteOnly))
|
||||||
AddKeyword(Table, "Xor", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Xor))
|
AddKeyword(Table, "Xor", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Xor))
|
||||||
|
|
||||||
KeywordTable = Table
|
KeywordTable = Table
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If KeywordTable.ContainsKey(s) Then
|
If KeywordTable.ContainsKey(s) Then
|
||||||
Dim Keyword As Keyword = KeywordTable(s)
|
Dim Keyword As Keyword = KeywordTable(s)
|
||||||
|
|
||||||
If ((Keyword.Versions And Version) = Version) AndAlso _
|
If ((Keyword.Versions And Version) = Version) AndAlso _
|
||||||
(IncludeUnreserved OrElse ((Keyword.ReservedVersions And Version) = Version)) Then
|
(IncludeUnreserved OrElse ((Keyword.ReservedVersions And Version) = Version)) Then
|
||||||
Return Keyword.TokenType
|
Return Keyword.TokenType
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Return TokenType.Identifier
|
Return TokenType.Identifier
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Determines if a token type is a keyword.
|
''' Determines if a token type is a keyword.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="type">The token type to check.</param>
|
''' <param name="type">The token type to check.</param>
|
||||||
''' <returns>True if the token type is a keyword, False otherwise.</returns>
|
''' <returns>True if the token type is a keyword, False otherwise.</returns>
|
||||||
Public Shared Function IsKeyword(ByVal type As TokenType) As Boolean
|
Public Shared Function IsKeyword(ByVal type As TokenType) As Boolean
|
||||||
Return type >= TokenType.AddHandler AndAlso type <= TokenType.Xor
|
Return type >= TokenType.AddHandler AndAlso type <= TokenType.Xor
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Overrides Function AsUnreservedKeyword() As TokenType
|
Public Overrides Function AsUnreservedKeyword() As TokenType
|
||||||
Return _UnreservedType
|
Return _UnreservedType
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private ReadOnly _Identifier As String
|
Private ReadOnly _Identifier As String
|
||||||
Private ReadOnly _UnreservedType As TokenType
|
Private ReadOnly _UnreservedType As TokenType
|
||||||
Private ReadOnly _Escaped As Boolean ' Whether the identifier was escaped (i.e. [a])
|
Private ReadOnly _Escaped As Boolean ' Whether the identifier was escaped (i.e. [a])
|
||||||
Private ReadOnly _TypeCharacter As TypeCharacter ' The type character that followed, if any
|
Private ReadOnly _TypeCharacter As TypeCharacter ' The type character that followed, if any
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The identifier name.
|
''' The identifier name.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Identifier() As String
|
Public ReadOnly Property Identifier() As String
|
||||||
Get
|
Get
|
||||||
Return _Identifier
|
Return _Identifier
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Whether the identifier is escaped.
|
''' Whether the identifier is escaped.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Escaped() As Boolean
|
Public ReadOnly Property Escaped() As Boolean
|
||||||
Get
|
Get
|
||||||
Return _Escaped
|
Return _Escaped
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The type character of the identifier.
|
''' The type character of the identifier.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property TypeCharacter() As TypeCharacter
|
Public ReadOnly Property TypeCharacter() As TypeCharacter
|
||||||
Get
|
Get
|
||||||
Return _TypeCharacter
|
Return _TypeCharacter
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new identifier token.
|
''' Constructs a new identifier token.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="type">The token type of the identifier.</param>
|
''' <param name="type">The token type of the identifier.</param>
|
||||||
''' <param name="unreservedType">The unreserved token type of the identifier.</param>
|
''' <param name="unreservedType">The unreserved token type of the identifier.</param>
|
||||||
''' <param name="identifier">The text of the identifier</param>
|
''' <param name="identifier">The text of the identifier</param>
|
||||||
''' <param name="escaped">Whether the identifier is escaped.</param>
|
''' <param name="escaped">Whether the identifier is escaped.</param>
|
||||||
''' <param name="typeCharacter">The type character of the identifier.</param>
|
''' <param name="typeCharacter">The type character of the identifier.</param>
|
||||||
''' <param name="span">The location of the identifier.</param>
|
''' <param name="span">The location of the identifier.</param>
|
||||||
Public Sub New(ByVal type As TokenType, ByVal unreservedType As TokenType, ByVal identifier As String, ByVal escaped As Boolean, ByVal typeCharacter As TypeCharacter, ByVal span As Span)
|
Public Sub New(ByVal type As TokenType, ByVal unreservedType As TokenType, ByVal identifier As String, ByVal escaped As Boolean, ByVal typeCharacter As TypeCharacter, ByVal span As Span)
|
||||||
MyBase.New(type, span)
|
MyBase.New(type, span)
|
||||||
|
|
||||||
If type <> TokenType.Identifier AndAlso Not IsKeyword(type) Then
|
If type <> TokenType.Identifier AndAlso Not IsKeyword(type) Then
|
||||||
Throw New ArgumentOutOfRangeException("type")
|
Throw New ArgumentOutOfRangeException("type")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If unreservedType <> TokenType.Identifier AndAlso Not IsKeyword(unreservedType) Then
|
If unreservedType <> TokenType.Identifier AndAlso Not IsKeyword(unreservedType) Then
|
||||||
Throw New ArgumentOutOfRangeException("unreservedType")
|
Throw New ArgumentOutOfRangeException("unreservedType")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If identifier Is Nothing OrElse identifier = "" Then
|
If identifier Is Nothing OrElse identifier = "" Then
|
||||||
Throw New ArgumentException("Identifier cannot be empty.", "identifier")
|
Throw New ArgumentException("Identifier cannot be empty.", "identifier")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If typeCharacter <> typeCharacter.None AndAlso typeCharacter <> typeCharacter.DecimalSymbol AndAlso _
|
If typeCharacter <> typeCharacter.None AndAlso typeCharacter <> typeCharacter.DecimalSymbol AndAlso _
|
||||||
typeCharacter <> typeCharacter.DoubleSymbol AndAlso typeCharacter <> typeCharacter.IntegerSymbol AndAlso _
|
typeCharacter <> typeCharacter.DoubleSymbol AndAlso typeCharacter <> typeCharacter.IntegerSymbol AndAlso _
|
||||||
typeCharacter <> typeCharacter.LongSymbol AndAlso typeCharacter <> typeCharacter.SingleSymbol AndAlso _
|
typeCharacter <> typeCharacter.LongSymbol AndAlso typeCharacter <> typeCharacter.SingleSymbol AndAlso _
|
||||||
typeCharacter <> typeCharacter.StringSymbol Then
|
typeCharacter <> typeCharacter.StringSymbol Then
|
||||||
Throw New ArgumentOutOfRangeException("typeCharacter")
|
Throw New ArgumentOutOfRangeException("typeCharacter")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If typeCharacter <> typeCharacter.None AndAlso escaped Then
|
If typeCharacter <> typeCharacter.None AndAlso escaped Then
|
||||||
Throw New ArgumentException("Escaped identifiers cannot have type characters.")
|
Throw New ArgumentException("Escaped identifiers cannot have type characters.")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
_UnreservedType = unreservedType
|
_UnreservedType = unreservedType
|
||||||
_Identifier = identifier
|
_Identifier = identifier
|
||||||
_Escaped = escaped
|
_Escaped = escaped
|
||||||
_TypeCharacter = typeCharacter
|
_TypeCharacter = typeCharacter
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,74 +1,74 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' An integer literal.
|
''' An integer literal.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class IntegerLiteralToken
|
Public NotInheritable Class IntegerLiteralToken
|
||||||
Inherits Token
|
Inherits Token
|
||||||
|
|
||||||
Private ReadOnly _Literal As Integer
|
Private ReadOnly _Literal As Integer
|
||||||
Private ReadOnly _TypeCharacter As TypeCharacter ' The type character after the literal, if any
|
Private ReadOnly _TypeCharacter As TypeCharacter ' The type character after the literal, if any
|
||||||
Private ReadOnly _IntegerBase As IntegerBase ' The base of the literal
|
Private ReadOnly _IntegerBase As IntegerBase ' The base of the literal
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The value of the literal.
|
''' The value of the literal.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Literal() As Integer
|
Public ReadOnly Property Literal() As Integer
|
||||||
Get
|
Get
|
||||||
Return _Literal
|
Return _Literal
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The type character of the literal.
|
''' The type character of the literal.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property TypeCharacter() As TypeCharacter
|
Public ReadOnly Property TypeCharacter() As TypeCharacter
|
||||||
Get
|
Get
|
||||||
Return _TypeCharacter
|
Return _TypeCharacter
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The integer base of the literal.
|
''' The integer base of the literal.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property IntegerBase() As IntegerBase
|
Public ReadOnly Property IntegerBase() As IntegerBase
|
||||||
Get
|
Get
|
||||||
Return _IntegerBase
|
Return _IntegerBase
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new integer literal.
|
''' Constructs a new integer literal.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="literal">The literal value.</param>
|
''' <param name="literal">The literal value.</param>
|
||||||
''' <param name="integerBase">The integer base of the literal.</param>
|
''' <param name="integerBase">The integer base of the literal.</param>
|
||||||
''' <param name="typeCharacter">The type character of the literal.</param>
|
''' <param name="typeCharacter">The type character of the literal.</param>
|
||||||
''' <param name="span">The location of the literal.</param>
|
''' <param name="span">The location of the literal.</param>
|
||||||
Public Sub New(ByVal literal As Integer, ByVal integerBase As IntegerBase, ByVal typeCharacter As TypeCharacter, ByVal span As Span)
|
Public Sub New(ByVal literal As Integer, ByVal integerBase As IntegerBase, ByVal typeCharacter As TypeCharacter, ByVal span As Span)
|
||||||
MyBase.New(TokenType.IntegerLiteral, span)
|
MyBase.New(TokenType.IntegerLiteral, span)
|
||||||
|
|
||||||
If integerBase < integerBase.Decimal OrElse integerBase > integerBase.Hexadecimal Then
|
If integerBase < integerBase.Decimal OrElse integerBase > integerBase.Hexadecimal Then
|
||||||
Throw New ArgumentOutOfRangeException("integerBase")
|
Throw New ArgumentOutOfRangeException("integerBase")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If typeCharacter <> typeCharacter.None AndAlso _
|
If typeCharacter <> typeCharacter.None AndAlso _
|
||||||
typeCharacter <> typeCharacter.IntegerSymbol AndAlso typeCharacter <> typeCharacter.IntegerChar AndAlso _
|
typeCharacter <> typeCharacter.IntegerSymbol AndAlso typeCharacter <> typeCharacter.IntegerChar AndAlso _
|
||||||
typeCharacter <> typeCharacter.ShortChar AndAlso _
|
typeCharacter <> typeCharacter.ShortChar AndAlso _
|
||||||
typeCharacter <> typeCharacter.LongSymbol AndAlso typeCharacter <> typeCharacter.LongChar Then
|
typeCharacter <> typeCharacter.LongSymbol AndAlso typeCharacter <> typeCharacter.LongChar Then
|
||||||
Throw New ArgumentOutOfRangeException("typeCharacter")
|
Throw New ArgumentOutOfRangeException("typeCharacter")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
_Literal = literal
|
_Literal = literal
|
||||||
_IntegerBase = integerBase
|
_IntegerBase = integerBase
|
||||||
_TypeCharacter = typeCharacter
|
_TypeCharacter = typeCharacter
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A line terminator.
|
''' A line terminator.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class LineTerminatorToken
|
Public NotInheritable Class LineTerminatorToken
|
||||||
Inherits Token
|
Inherits Token
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Create a new line terminator token.
|
''' Create a new line terminator token.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="span">The location of the line terminator.</param>
|
''' <param name="span">The location of the line terminator.</param>
|
||||||
Public Sub New(ByVal span As Span)
|
Public Sub New(ByVal span As Span)
|
||||||
MyBase.New(TokenType.LineTerminator, span)
|
MyBase.New(TokenType.LineTerminator, span)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,89 +1,89 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A punctuation token.
|
''' A punctuation token.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class PunctuatorToken
|
Public NotInheritable Class PunctuatorToken
|
||||||
Inherits Token
|
Inherits Token
|
||||||
|
|
||||||
Private Shared PunctuatorTable As Dictionary(Of String, TokenType)
|
Private Shared PunctuatorTable As Dictionary(Of String, TokenType)
|
||||||
|
|
||||||
Private Shared Sub AddPunctuator(ByVal table As Dictionary(Of String, TokenType), ByVal punctuator As String, ByVal type As TokenType)
|
Private Shared Sub AddPunctuator(ByVal table As Dictionary(Of String, TokenType), ByVal punctuator As String, ByVal type As TokenType)
|
||||||
table.Add(punctuator, type)
|
table.Add(punctuator, type)
|
||||||
table.Add(Scanner.MakeFullWidth(punctuator), type)
|
table.Add(Scanner.MakeFullWidth(punctuator), type)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
' Returns the token type of the string.
|
' Returns the token type of the string.
|
||||||
Friend Shared Function TokenTypeFromString(ByVal s As String) As TokenType
|
Friend Shared Function TokenTypeFromString(ByVal s As String) As TokenType
|
||||||
If PunctuatorTable Is Nothing Then
|
If PunctuatorTable Is Nothing Then
|
||||||
Dim Table As New Dictionary(Of String, TokenType)(StringComparer.InvariantCulture)
|
Dim Table As New Dictionary(Of String, TokenType)(StringComparer.InvariantCulture)
|
||||||
|
|
||||||
' NOTE: These have to be in the same order as the enum!
|
' NOTE: These have to be in the same order as the enum!
|
||||||
AddPunctuator(Table, "(", TokenType.LeftParenthesis)
|
AddPunctuator(Table, "(", TokenType.LeftParenthesis)
|
||||||
AddPunctuator(Table, ")", TokenType.RightParenthesis)
|
AddPunctuator(Table, ")", TokenType.RightParenthesis)
|
||||||
AddPunctuator(Table, "{", TokenType.LeftCurlyBrace)
|
AddPunctuator(Table, "{", TokenType.LeftCurlyBrace)
|
||||||
AddPunctuator(Table, "}", TokenType.RightCurlyBrace)
|
AddPunctuator(Table, "}", TokenType.RightCurlyBrace)
|
||||||
AddPunctuator(Table, "!", TokenType.Exclamation)
|
AddPunctuator(Table, "!", TokenType.Exclamation)
|
||||||
AddPunctuator(Table, "#", TokenType.Pound)
|
AddPunctuator(Table, "#", TokenType.Pound)
|
||||||
AddPunctuator(Table, ",", TokenType.Comma)
|
AddPunctuator(Table, ",", TokenType.Comma)
|
||||||
AddPunctuator(Table, ".", TokenType.Period)
|
AddPunctuator(Table, ".", TokenType.Period)
|
||||||
AddPunctuator(Table, ":", TokenType.Colon)
|
AddPunctuator(Table, ":", TokenType.Colon)
|
||||||
AddPunctuator(Table, ":=", TokenType.ColonEquals)
|
AddPunctuator(Table, ":=", TokenType.ColonEquals)
|
||||||
AddPunctuator(Table, "&", TokenType.Ampersand)
|
AddPunctuator(Table, "&", TokenType.Ampersand)
|
||||||
AddPunctuator(Table, "&=", TokenType.AmpersandEquals)
|
AddPunctuator(Table, "&=", TokenType.AmpersandEquals)
|
||||||
AddPunctuator(Table, "*", TokenType.Star)
|
AddPunctuator(Table, "*", TokenType.Star)
|
||||||
AddPunctuator(Table, "*=", TokenType.StarEquals)
|
AddPunctuator(Table, "*=", TokenType.StarEquals)
|
||||||
AddPunctuator(Table, "+", TokenType.Plus)
|
AddPunctuator(Table, "+", TokenType.Plus)
|
||||||
AddPunctuator(Table, "+=", TokenType.PlusEquals)
|
AddPunctuator(Table, "+=", TokenType.PlusEquals)
|
||||||
AddPunctuator(Table, "-", TokenType.Minus)
|
AddPunctuator(Table, "-", TokenType.Minus)
|
||||||
AddPunctuator(Table, "-=", TokenType.MinusEquals)
|
AddPunctuator(Table, "-=", TokenType.MinusEquals)
|
||||||
AddPunctuator(Table, "/", TokenType.ForwardSlash)
|
AddPunctuator(Table, "/", TokenType.ForwardSlash)
|
||||||
AddPunctuator(Table, "/=", TokenType.ForwardSlashEquals)
|
AddPunctuator(Table, "/=", TokenType.ForwardSlashEquals)
|
||||||
AddPunctuator(Table, "\", TokenType.BackwardSlash)
|
AddPunctuator(Table, "\", TokenType.BackwardSlash)
|
||||||
AddPunctuator(Table, "\=", TokenType.BackwardSlashEquals)
|
AddPunctuator(Table, "\=", TokenType.BackwardSlashEquals)
|
||||||
AddPunctuator(Table, "^", TokenType.Caret)
|
AddPunctuator(Table, "^", TokenType.Caret)
|
||||||
AddPunctuator(Table, "^=", TokenType.CaretEquals)
|
AddPunctuator(Table, "^=", TokenType.CaretEquals)
|
||||||
AddPunctuator(Table, "<", TokenType.LessThan)
|
AddPunctuator(Table, "<", TokenType.LessThan)
|
||||||
AddPunctuator(Table, "<=", TokenType.LessThanEquals)
|
AddPunctuator(Table, "<=", TokenType.LessThanEquals)
|
||||||
AddPunctuator(Table, "=<", TokenType.LessThanEquals) 'lc VBScript allows the other way
|
AddPunctuator(Table, "=<", TokenType.LessThanEquals) 'lc VBScript allows the other way
|
||||||
AddPunctuator(Table, "=", TokenType.Equals)
|
AddPunctuator(Table, "=", TokenType.Equals)
|
||||||
AddPunctuator(Table, "<>", TokenType.NotEquals)
|
AddPunctuator(Table, "<>", TokenType.NotEquals)
|
||||||
AddPunctuator(Table, ">", TokenType.GreaterThan)
|
AddPunctuator(Table, ">", TokenType.GreaterThan)
|
||||||
AddPunctuator(Table, ">=", TokenType.GreaterThanEquals)
|
AddPunctuator(Table, ">=", TokenType.GreaterThanEquals)
|
||||||
AddPunctuator(Table, "=>", TokenType.GreaterThanEquals) 'lc
|
AddPunctuator(Table, "=>", TokenType.GreaterThanEquals) 'lc
|
||||||
AddPunctuator(Table, "<<", TokenType.LessThanLessThan)
|
AddPunctuator(Table, "<<", TokenType.LessThanLessThan)
|
||||||
AddPunctuator(Table, "<<=", TokenType.LessThanLessThanEquals)
|
AddPunctuator(Table, "<<=", TokenType.LessThanLessThanEquals)
|
||||||
AddPunctuator(Table, ">>", TokenType.GreaterThanGreaterThan)
|
AddPunctuator(Table, ">>", TokenType.GreaterThanGreaterThan)
|
||||||
AddPunctuator(Table, ">>=", TokenType.GreaterThanGreaterThanEquals)
|
AddPunctuator(Table, ">>=", TokenType.GreaterThanGreaterThanEquals)
|
||||||
|
|
||||||
PunctuatorTable = Table
|
PunctuatorTable = Table
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not PunctuatorTable.ContainsKey(s) Then
|
If Not PunctuatorTable.ContainsKey(s) Then
|
||||||
Return TokenType.None
|
Return TokenType.None
|
||||||
Else
|
Else
|
||||||
Return PunctuatorTable(s)
|
Return PunctuatorTable(s)
|
||||||
End If
|
End If
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new punctuator token.
|
''' Constructs a new punctuator token.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="type">The punctuator token type.</param>
|
''' <param name="type">The punctuator token type.</param>
|
||||||
''' <param name="span">The location of the punctuator.</param>
|
''' <param name="span">The location of the punctuator.</param>
|
||||||
Public Sub New(ByVal type As TokenType, ByVal span As Span)
|
Public Sub New(ByVal type As TokenType, ByVal span As Span)
|
||||||
MyBase.New(type, span)
|
MyBase.New(type, span)
|
||||||
|
|
||||||
If (type < TokenType.LeftParenthesis OrElse type > TokenType.GreaterThanGreaterThanEquals) Then
|
If (type < TokenType.LeftParenthesis OrElse type > TokenType.GreaterThanGreaterThanEquals) Then
|
||||||
Throw New ArgumentOutOfRangeException("type")
|
Throw New ArgumentOutOfRangeException("type")
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,42 +1,42 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A string literal.
|
''' A string literal.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class StringLiteralToken
|
Public NotInheritable Class StringLiteralToken
|
||||||
Inherits Token
|
Inherits Token
|
||||||
|
|
||||||
Private ReadOnly _Literal As String
|
Private ReadOnly _Literal As String
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The value of the literal.
|
''' The value of the literal.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Literal() As String
|
Public ReadOnly Property Literal() As String
|
||||||
Get
|
Get
|
||||||
Return _Literal
|
Return _Literal
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new string literal token.
|
''' Constructs a new string literal token.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="literal">The value of the literal.</param>
|
''' <param name="literal">The value of the literal.</param>
|
||||||
''' <param name="span">The location of the literal.</param>
|
''' <param name="span">The location of the literal.</param>
|
||||||
Public Sub New(ByVal literal As String, ByVal span As Span)
|
Public Sub New(ByVal literal As String, ByVal span As Span)
|
||||||
MyBase.New(TokenType.StringLiteral, span)
|
MyBase.New(TokenType.StringLiteral, span)
|
||||||
|
|
||||||
If literal Is Nothing Then
|
If literal Is Nothing Then
|
||||||
Throw New ArgumentNullException("literal")
|
Throw New ArgumentNullException("literal")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
_Literal = literal
|
_Literal = literal
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,49 +1,49 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The base class for all tokens. Contains line and column information as well as token type.
|
''' The base class for all tokens. Contains line and column information as well as token type.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public MustInherit Class Token
|
Public MustInherit Class Token
|
||||||
Private ReadOnly _Type As TokenType
|
Private ReadOnly _Type As TokenType
|
||||||
Private ReadOnly _Span As Span ' A span ends at the first character beyond the token
|
Private ReadOnly _Span As Span ' A span ends at the first character beyond the token
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The type of the token.
|
''' The type of the token.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Type() As TokenType
|
Public ReadOnly Property Type() As TokenType
|
||||||
Get
|
Get
|
||||||
Return _Type
|
Return _Type
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The span of the token in the source text.
|
''' The span of the token in the source text.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Span() As Span
|
Public ReadOnly Property Span() As Span
|
||||||
Get
|
Get
|
||||||
Return _Span
|
Return _Span
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Protected Sub New(ByVal type As TokenType, ByVal span As Span)
|
Protected Sub New(ByVal type As TokenType, ByVal span As Span)
|
||||||
Debug.Assert([Enum].IsDefined(GetType(TokenType), type))
|
Debug.Assert([Enum].IsDefined(GetType(TokenType), type))
|
||||||
_Type = type
|
_Type = type
|
||||||
_Span = span
|
_Span = span
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Returns the unreserved keyword type of an identifier.
|
''' Returns the unreserved keyword type of an identifier.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <returns>The unreserved keyword type of an identifier, the token's type otherwise.</returns>
|
''' <returns>The unreserved keyword type of an identifier, the token's type otherwise.</returns>
|
||||||
Public Overridable Function AsUnreservedKeyword() As TokenType
|
Public Overridable Function AsUnreservedKeyword() As TokenType
|
||||||
Return Type
|
Return Type
|
||||||
End Function
|
End Function
|
||||||
End Class
|
End Class
|
|
@ -1,236 +1,236 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The type of a token.
|
''' The type of a token.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public Enum TokenType
|
Public Enum TokenType
|
||||||
None
|
None
|
||||||
|
|
||||||
LexicalError
|
LexicalError
|
||||||
EndOfStream
|
EndOfStream
|
||||||
LineTerminator
|
LineTerminator
|
||||||
Comment
|
Comment
|
||||||
Identifier
|
Identifier
|
||||||
|
|
||||||
StringLiteral
|
StringLiteral
|
||||||
CharacterLiteral
|
CharacterLiteral
|
||||||
DateLiteral
|
DateLiteral
|
||||||
IntegerLiteral
|
IntegerLiteral
|
||||||
UnsignedIntegerLiteral
|
UnsignedIntegerLiteral
|
||||||
FloatingPointLiteral
|
FloatingPointLiteral
|
||||||
DecimalLiteral
|
DecimalLiteral
|
||||||
|
|
||||||
[AddHandler]
|
[AddHandler]
|
||||||
[AddressOf]
|
[AddressOf]
|
||||||
[Alias]
|
[Alias]
|
||||||
[And]
|
[And]
|
||||||
[AndAlso]
|
[AndAlso]
|
||||||
[Ansi]
|
[Ansi]
|
||||||
[As]
|
[As]
|
||||||
[Assembly]
|
[Assembly]
|
||||||
[Auto]
|
[Auto]
|
||||||
Binary
|
Binary
|
||||||
[Boolean]
|
[Boolean]
|
||||||
[ByRef]
|
[ByRef]
|
||||||
[Byte]
|
[Byte]
|
||||||
[ByVal]
|
[ByVal]
|
||||||
[Call]
|
[Call]
|
||||||
[Case]
|
[Case]
|
||||||
[Catch]
|
[Catch]
|
||||||
[CBool]
|
[CBool]
|
||||||
[CByte]
|
[CByte]
|
||||||
[CChar]
|
[CChar]
|
||||||
[CDate]
|
[CDate]
|
||||||
[CDec]
|
[CDec]
|
||||||
[CDbl]
|
[CDbl]
|
||||||
[Char]
|
[Char]
|
||||||
[CInt]
|
[CInt]
|
||||||
[Class]
|
[Class]
|
||||||
[CLng]
|
[CLng]
|
||||||
[CObj]
|
[CObj]
|
||||||
Compare
|
Compare
|
||||||
[Const]
|
[Const]
|
||||||
[Continue]
|
[Continue]
|
||||||
[CSByte]
|
[CSByte]
|
||||||
[CShort]
|
[CShort]
|
||||||
[CSng]
|
[CSng]
|
||||||
[CStr]
|
[CStr]
|
||||||
[CType]
|
[CType]
|
||||||
[CUInt]
|
[CUInt]
|
||||||
[CULng]
|
[CULng]
|
||||||
[CUShort]
|
[CUShort]
|
||||||
[Custom]
|
[Custom]
|
||||||
[Date]
|
[Date]
|
||||||
[Decimal]
|
[Decimal]
|
||||||
[Declare]
|
[Declare]
|
||||||
[Default]
|
[Default]
|
||||||
[Delegate]
|
[Delegate]
|
||||||
[Dim]
|
[Dim]
|
||||||
[DirectCast]
|
[DirectCast]
|
||||||
[Do]
|
[Do]
|
||||||
[Double]
|
[Double]
|
||||||
[Each]
|
[Each]
|
||||||
[Else]
|
[Else]
|
||||||
[ElseIf]
|
[ElseIf]
|
||||||
[End]
|
[End]
|
||||||
[EndIf]
|
[EndIf]
|
||||||
[Enum]
|
[Enum]
|
||||||
[Erase]
|
[Erase]
|
||||||
[Error]
|
[Error]
|
||||||
[Event]
|
[Event]
|
||||||
[Exit]
|
[Exit]
|
||||||
Explicit
|
Explicit
|
||||||
ExternalChecksum
|
ExternalChecksum
|
||||||
ExternalSource
|
ExternalSource
|
||||||
[False]
|
[False]
|
||||||
[Finally]
|
[Finally]
|
||||||
[For]
|
[For]
|
||||||
[Friend]
|
[Friend]
|
||||||
[Function]
|
[Function]
|
||||||
[Get]
|
[Get]
|
||||||
[GetType]
|
[GetType]
|
||||||
[Global]
|
[Global]
|
||||||
[GoSub]
|
[GoSub]
|
||||||
[GoTo]
|
[GoTo]
|
||||||
[Handles]
|
[Handles]
|
||||||
[If]
|
[If]
|
||||||
[Implements]
|
[Implements]
|
||||||
[Imports]
|
[Imports]
|
||||||
[In]
|
[In]
|
||||||
[Inherits]
|
[Inherits]
|
||||||
[Integer]
|
[Integer]
|
||||||
[Interface]
|
[Interface]
|
||||||
[Is]
|
[Is]
|
||||||
IsTrue
|
IsTrue
|
||||||
[IsNot]
|
[IsNot]
|
||||||
IsFalse
|
IsFalse
|
||||||
[Let]
|
[Let]
|
||||||
[Lib]
|
[Lib]
|
||||||
[Like]
|
[Like]
|
||||||
[Long]
|
[Long]
|
||||||
[Loop]
|
[Loop]
|
||||||
[Me]
|
[Me]
|
||||||
Mid
|
Mid
|
||||||
[Mod]
|
[Mod]
|
||||||
[Module]
|
[Module]
|
||||||
[MustInherit]
|
[MustInherit]
|
||||||
[MustOverride]
|
[MustOverride]
|
||||||
[MyBase]
|
[MyBase]
|
||||||
[MyClass]
|
[MyClass]
|
||||||
[Namespace]
|
[Namespace]
|
||||||
[Narrowing]
|
[Narrowing]
|
||||||
[New]
|
[New]
|
||||||
[Next]
|
[Next]
|
||||||
[Not]
|
[Not]
|
||||||
[Nothing]
|
[Nothing]
|
||||||
[NotInheritable]
|
[NotInheritable]
|
||||||
[NotOverridable]
|
[NotOverridable]
|
||||||
[Object]
|
[Object]
|
||||||
[Of]
|
[Of]
|
||||||
Off
|
Off
|
||||||
[On]
|
[On]
|
||||||
[Operator]
|
[Operator]
|
||||||
[Option]
|
[Option]
|
||||||
[Optional]
|
[Optional]
|
||||||
[Or]
|
[Or]
|
||||||
[OrElse]
|
[OrElse]
|
||||||
[Overloads]
|
[Overloads]
|
||||||
[Overridable]
|
[Overridable]
|
||||||
[Overrides]
|
[Overrides]
|
||||||
[ParamArray]
|
[ParamArray]
|
||||||
[Partial]
|
[Partial]
|
||||||
[Preserve]
|
[Preserve]
|
||||||
[Private]
|
[Private]
|
||||||
[Property]
|
[Property]
|
||||||
[Protected]
|
[Protected]
|
||||||
[Public]
|
[Public]
|
||||||
[RaiseEvent]
|
[RaiseEvent]
|
||||||
[ReadOnly]
|
[ReadOnly]
|
||||||
[ReDim]
|
[ReDim]
|
||||||
Region
|
Region
|
||||||
[REM]
|
[REM]
|
||||||
[RemoveHandler]
|
[RemoveHandler]
|
||||||
[Resume]
|
[Resume]
|
||||||
[Return]
|
[Return]
|
||||||
[SByte]
|
[SByte]
|
||||||
[Select]
|
[Select]
|
||||||
[Set]
|
[Set]
|
||||||
[Shadows]
|
[Shadows]
|
||||||
[Shared]
|
[Shared]
|
||||||
[Short]
|
[Short]
|
||||||
[Single]
|
[Single]
|
||||||
[Static]
|
[Static]
|
||||||
[Step]
|
[Step]
|
||||||
[Stop]
|
[Stop]
|
||||||
Strict
|
Strict
|
||||||
[String]
|
[String]
|
||||||
[Structure]
|
[Structure]
|
||||||
[Sub]
|
[Sub]
|
||||||
[SyncLock]
|
[SyncLock]
|
||||||
Text
|
Text
|
||||||
[Then]
|
[Then]
|
||||||
[Throw]
|
[Throw]
|
||||||
[To]
|
[To]
|
||||||
[True]
|
[True]
|
||||||
[Try]
|
[Try]
|
||||||
[TryCast]
|
[TryCast]
|
||||||
[TypeOf]
|
[TypeOf]
|
||||||
[UInteger]
|
[UInteger]
|
||||||
[ULong]
|
[ULong]
|
||||||
[UShort]
|
[UShort]
|
||||||
[Using]
|
[Using]
|
||||||
[Unicode]
|
[Unicode]
|
||||||
[Until]
|
[Until]
|
||||||
[Variant]
|
[Variant]
|
||||||
[Wend]
|
[Wend]
|
||||||
[When]
|
[When]
|
||||||
[While]
|
[While]
|
||||||
[Widening]
|
[Widening]
|
||||||
[With]
|
[With]
|
||||||
[WithEvents]
|
[WithEvents]
|
||||||
[WriteOnly]
|
[WriteOnly]
|
||||||
[Xor]
|
[Xor]
|
||||||
|
|
||||||
LeftParenthesis ' (
|
LeftParenthesis ' (
|
||||||
RightParenthesis ' )
|
RightParenthesis ' )
|
||||||
LeftCurlyBrace ' {
|
LeftCurlyBrace ' {
|
||||||
RightCurlyBrace ' }
|
RightCurlyBrace ' }
|
||||||
Exclamation ' !
|
Exclamation ' !
|
||||||
Pound ' #
|
Pound ' #
|
||||||
Comma ' ,
|
Comma ' ,
|
||||||
Period ' .
|
Period ' .
|
||||||
Colon ' :
|
Colon ' :
|
||||||
ColonEquals ' :=
|
ColonEquals ' :=
|
||||||
Ampersand ' &
|
Ampersand ' &
|
||||||
AmpersandEquals ' &=
|
AmpersandEquals ' &=
|
||||||
Star ' *
|
Star ' *
|
||||||
StarEquals ' *=
|
StarEquals ' *=
|
||||||
Plus ' +
|
Plus ' +
|
||||||
PlusEquals ' +=
|
PlusEquals ' +=
|
||||||
Minus ' -
|
Minus ' -
|
||||||
MinusEquals ' -=
|
MinusEquals ' -=
|
||||||
ForwardSlash ' /
|
ForwardSlash ' /
|
||||||
ForwardSlashEquals ' /=
|
ForwardSlashEquals ' /=
|
||||||
BackwardSlash ' \
|
BackwardSlash ' \
|
||||||
BackwardSlashEquals ' \=
|
BackwardSlashEquals ' \=
|
||||||
Caret ' ^
|
Caret ' ^
|
||||||
CaretEquals ' ^=
|
CaretEquals ' ^=
|
||||||
LessThan ' <
|
LessThan ' <
|
||||||
LessThanEquals ' <=
|
LessThanEquals ' <=
|
||||||
Equals ' =
|
Equals ' =
|
||||||
NotEquals ' <>
|
NotEquals ' <>
|
||||||
GreaterThan ' >
|
GreaterThan ' >
|
||||||
GreaterThanEquals ' >=
|
GreaterThanEquals ' >=
|
||||||
LessThanLessThan ' <<
|
LessThanLessThan ' <<
|
||||||
LessThanLessThanEquals ' <<=
|
LessThanLessThanEquals ' <<=
|
||||||
GreaterThanGreaterThan ' >>
|
GreaterThanGreaterThan ' >>
|
||||||
GreaterThanGreaterThanEquals ' >>=
|
GreaterThanGreaterThanEquals ' >>=
|
||||||
End Enum
|
End Enum
|
|
@ -1,76 +1,76 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' An integer literal.
|
''' An integer literal.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class UnsignedIntegerLiteralToken
|
Public NotInheritable Class UnsignedIntegerLiteralToken
|
||||||
Inherits Token
|
Inherits Token
|
||||||
|
|
||||||
Private ReadOnly _Literal As ULong
|
Private ReadOnly _Literal As ULong
|
||||||
Private ReadOnly _TypeCharacter As TypeCharacter ' The type character after the literal, if any
|
Private ReadOnly _TypeCharacter As TypeCharacter ' The type character after the literal, if any
|
||||||
Private ReadOnly _IntegerBase As IntegerBase ' The base of the literal
|
Private ReadOnly _IntegerBase As IntegerBase ' The base of the literal
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The value of the literal.
|
''' The value of the literal.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
<CLSCompliant(False)> _
|
<CLSCompliant(False)> _
|
||||||
Public ReadOnly Property Literal() As ULong
|
Public ReadOnly Property Literal() As ULong
|
||||||
Get
|
Get
|
||||||
Return _Literal
|
Return _Literal
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The type character of the literal.
|
''' The type character of the literal.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property TypeCharacter() As TypeCharacter
|
Public ReadOnly Property TypeCharacter() As TypeCharacter
|
||||||
Get
|
Get
|
||||||
Return _TypeCharacter
|
Return _TypeCharacter
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The integer base of the literal.
|
''' The integer base of the literal.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property IntegerBase() As IntegerBase
|
Public ReadOnly Property IntegerBase() As IntegerBase
|
||||||
Get
|
Get
|
||||||
Return _IntegerBase
|
Return _IntegerBase
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new unsigned integer literal.
|
''' Constructs a new unsigned integer literal.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="literal">The literal value.</param>
|
''' <param name="literal">The literal value.</param>
|
||||||
''' <param name="integerBase">The integer base of the literal.</param>
|
''' <param name="integerBase">The integer base of the literal.</param>
|
||||||
''' <param name="typeCharacter">The type character of the literal.</param>
|
''' <param name="typeCharacter">The type character of the literal.</param>
|
||||||
''' <param name="span">The location of the literal.</param>
|
''' <param name="span">The location of the literal.</param>
|
||||||
<CLSCompliant(False)> _
|
<CLSCompliant(False)> _
|
||||||
Public Sub New(ByVal literal As ULong, ByVal integerBase As IntegerBase, ByVal typeCharacter As TypeCharacter, ByVal span As Span)
|
Public Sub New(ByVal literal As ULong, ByVal integerBase As IntegerBase, ByVal typeCharacter As TypeCharacter, ByVal span As Span)
|
||||||
MyBase.New(TokenType.UnsignedIntegerLiteral, span)
|
MyBase.New(TokenType.UnsignedIntegerLiteral, span)
|
||||||
|
|
||||||
If integerBase < integerBase.Decimal OrElse integerBase > integerBase.Hexadecimal Then
|
If integerBase < integerBase.Decimal OrElse integerBase > integerBase.Hexadecimal Then
|
||||||
Throw New ArgumentOutOfRangeException("integerBase")
|
Throw New ArgumentOutOfRangeException("integerBase")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If typeCharacter <> typeCharacter.None AndAlso _
|
If typeCharacter <> typeCharacter.None AndAlso _
|
||||||
typeCharacter <> typeCharacter.UnsignedIntegerChar AndAlso _
|
typeCharacter <> typeCharacter.UnsignedIntegerChar AndAlso _
|
||||||
typeCharacter <> typeCharacter.UnsignedLongChar AndAlso _
|
typeCharacter <> typeCharacter.UnsignedLongChar AndAlso _
|
||||||
typeCharacter <> typeCharacter.UnsignedShortChar Then
|
typeCharacter <> typeCharacter.UnsignedShortChar Then
|
||||||
Throw New ArgumentOutOfRangeException("typeCharacter")
|
Throw New ArgumentOutOfRangeException("typeCharacter")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
_Literal = literal
|
_Literal = literal
|
||||||
_IntegerBase = integerBase
|
_IntegerBase = integerBase
|
||||||
_TypeCharacter = typeCharacter
|
_TypeCharacter = typeCharacter
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|
|
@ -1,78 +1,78 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for an argument to a call or index.
|
''' A parse tree for an argument to a call or index.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class Argument
|
Public NotInheritable Class Argument
|
||||||
Inherits Tree
|
Inherits Tree
|
||||||
|
|
||||||
Private ReadOnly _Name As SimpleName
|
Private ReadOnly _Name As SimpleName
|
||||||
Private ReadOnly _ColonEqualsLocation As Location
|
Private ReadOnly _ColonEqualsLocation As Location
|
||||||
Private ReadOnly _Expression As Expression
|
Private ReadOnly _Expression As Expression
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The name of the argument, if any.
|
''' The name of the argument, if any.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Name() As SimpleName
|
Public ReadOnly Property Name() As SimpleName
|
||||||
Get
|
Get
|
||||||
Return _Name
|
Return _Name
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the ':=', if any.
|
''' The location of the ':=', if any.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property ColonEqualsLocation() As Location
|
Public ReadOnly Property ColonEqualsLocation() As Location
|
||||||
Get
|
Get
|
||||||
Return _ColonEqualsLocation
|
Return _ColonEqualsLocation
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The argument, if any.
|
''' The argument, if any.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Expression() As Expression
|
Public ReadOnly Property Expression() As Expression
|
||||||
Get
|
Get
|
||||||
Return _Expression
|
Return _Expression
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for an argument.
|
''' Constructs a new parse tree for an argument.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="name">The name of the argument, if any.</param>
|
''' <param name="name">The name of the argument, if any.</param>
|
||||||
''' <param name="colonEqualsLocation">The location of the ':=', if any.</param>
|
''' <param name="colonEqualsLocation">The location of the ':=', if any.</param>
|
||||||
''' <param name="expression">The expression, if any.</param>
|
''' <param name="expression">The expression, if any.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal name As SimpleName, ByVal colonEqualsLocation As Location, ByVal expression As Expression, ByVal span As Span)
|
Public Sub New(ByVal name As SimpleName, ByVal colonEqualsLocation As Location, ByVal expression As Expression, ByVal span As Span)
|
||||||
MyBase.New(TreeType.Argument, span)
|
MyBase.New(TreeType.Argument, span)
|
||||||
|
|
||||||
If expression Is Nothing Then
|
If expression Is Nothing Then
|
||||||
Throw New ArgumentNullException("expression")
|
Throw New ArgumentNullException("expression")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
SetParent(name)
|
SetParent(name)
|
||||||
SetParent(expression)
|
SetParent(expression)
|
||||||
|
|
||||||
_Name = name
|
_Name = name
|
||||||
_ColonEqualsLocation = colonEqualsLocation
|
_ColonEqualsLocation = colonEqualsLocation
|
||||||
_Expression = expression
|
_Expression = expression
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub New()
|
Private Sub New()
|
||||||
MyBase.New(TreeType.Argument, Nothing)
|
MyBase.New(TreeType.Argument, Nothing)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
AddChild(childList, Name)
|
AddChild(childList, Name)
|
||||||
AddChild(childList, Expression)
|
AddChild(childList, Expression)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,40 +1,40 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A read-only collection of arguments.
|
''' A read-only collection of arguments.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class ArgumentCollection
|
Public NotInheritable Class ArgumentCollection
|
||||||
Inherits CommaDelimitedTreeCollection(Of Argument)
|
Inherits CommaDelimitedTreeCollection(Of Argument)
|
||||||
|
|
||||||
Private ReadOnly _RightParenthesisLocation As Location
|
Private ReadOnly _RightParenthesisLocation As Location
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the ')'.
|
''' The location of the ')'.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property RightParenthesisLocation() As Location
|
Public ReadOnly Property RightParenthesisLocation() As Location
|
||||||
Get
|
Get
|
||||||
Return _RightParenthesisLocation
|
Return _RightParenthesisLocation
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new argument collection.
|
''' Constructs a new argument collection.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="arguments">The arguments in the collection.</param>
|
''' <param name="arguments">The arguments in the collection.</param>
|
||||||
''' <param name="commaLocations">The location of the commas in the collection.</param>
|
''' <param name="commaLocations">The location of the commas in the collection.</param>
|
||||||
''' <param name="rightParenthesisLocation">The location of the ')'.</param>
|
''' <param name="rightParenthesisLocation">The location of the ')'.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal arguments As IList(Of Argument), ByVal commaLocations As IList(Of Location), ByVal rightParenthesisLocation As Location, ByVal span As Span)
|
Public Sub New(ByVal arguments As IList(Of Argument), ByVal commaLocations As IList(Of Location), ByVal rightParenthesisLocation As Location, ByVal span As Span)
|
||||||
MyBase.New(TreeType.ArgumentCollection, arguments, commaLocations, span)
|
MyBase.New(TreeType.ArgumentCollection, arguments, commaLocations, span)
|
||||||
|
|
||||||
_RightParenthesisLocation = rightParenthesisLocation
|
_RightParenthesisLocation = rightParenthesisLocation
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,98 +1,98 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for an attribute usage.
|
''' A parse tree for an attribute usage.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class Attribute
|
Public NotInheritable Class Attribute
|
||||||
Inherits Tree
|
Inherits Tree
|
||||||
|
|
||||||
Private ReadOnly _AttributeType As AttributeTypes
|
Private ReadOnly _AttributeType As AttributeTypes
|
||||||
Private ReadOnly _AttributeTypeLocation As Location
|
Private ReadOnly _AttributeTypeLocation As Location
|
||||||
Private ReadOnly _ColonLocation As Location
|
Private ReadOnly _ColonLocation As Location
|
||||||
Private ReadOnly _Name As Name
|
Private ReadOnly _Name As Name
|
||||||
Private ReadOnly _Arguments As ArgumentCollection
|
Private ReadOnly _Arguments As ArgumentCollection
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The target type of the attribute.
|
''' The target type of the attribute.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property AttributeType() As AttributeTypes
|
Public ReadOnly Property AttributeType() As AttributeTypes
|
||||||
Get
|
Get
|
||||||
Return _AttributeType
|
Return _AttributeType
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the attribute type, if any.
|
''' The location of the attribute type, if any.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property AttributeTypeLocation() As Location
|
Public ReadOnly Property AttributeTypeLocation() As Location
|
||||||
Get
|
Get
|
||||||
Return _AttributeTypeLocation
|
Return _AttributeTypeLocation
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the ':', if any.
|
''' The location of the ':', if any.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property ColonLocation() As Location
|
Public ReadOnly Property ColonLocation() As Location
|
||||||
Get
|
Get
|
||||||
Return _ColonLocation
|
Return _ColonLocation
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The name of the attribute being applied.
|
''' The name of the attribute being applied.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Name() As Name
|
Public ReadOnly Property Name() As Name
|
||||||
Get
|
Get
|
||||||
Return _Name
|
Return _Name
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The arguments to the attribute.
|
''' The arguments to the attribute.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Arguments() As ArgumentCollection
|
Public ReadOnly Property Arguments() As ArgumentCollection
|
||||||
Get
|
Get
|
||||||
Return _Arguments
|
Return _Arguments
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new attribute parse tree.
|
''' Constructs a new attribute parse tree.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="attributeType">The target type of the attribute.</param>
|
''' <param name="attributeType">The target type of the attribute.</param>
|
||||||
''' <param name="attributeTypeLocation">The location of the attribute type.</param>
|
''' <param name="attributeTypeLocation">The location of the attribute type.</param>
|
||||||
''' <param name="colonLocation">The location of the ':'.</param>
|
''' <param name="colonLocation">The location of the ':'.</param>
|
||||||
''' <param name="name">The name of the attribute being applied.</param>
|
''' <param name="name">The name of the attribute being applied.</param>
|
||||||
''' <param name="arguments">The arguments to the attribute.</param>
|
''' <param name="arguments">The arguments to the attribute.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal attributeType As AttributeTypes, ByVal attributeTypeLocation As Location, ByVal colonLocation As Location, ByVal name As Name, ByVal arguments As ArgumentCollection, ByVal span As Span)
|
Public Sub New(ByVal attributeType As AttributeTypes, ByVal attributeTypeLocation As Location, ByVal colonLocation As Location, ByVal name As Name, ByVal arguments As ArgumentCollection, ByVal span As Span)
|
||||||
MyBase.New(TreeType.Attribute, span)
|
MyBase.New(TreeType.Attribute, span)
|
||||||
|
|
||||||
If name Is Nothing Then
|
If name Is Nothing Then
|
||||||
Throw New ArgumentNullException("name")
|
Throw New ArgumentNullException("name")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
SetParent(name)
|
SetParent(name)
|
||||||
SetParent(arguments)
|
SetParent(arguments)
|
||||||
|
|
||||||
_AttributeType = attributeType
|
_AttributeType = attributeType
|
||||||
_AttributeTypeLocation = attributeTypeLocation
|
_AttributeTypeLocation = attributeTypeLocation
|
||||||
_ColonLocation = colonLocation
|
_ColonLocation = colonLocation
|
||||||
_Name = name
|
_Name = name
|
||||||
_Arguments = arguments
|
_Arguments = arguments
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
AddChild(childList, Name)
|
AddChild(childList, Name)
|
||||||
AddChild(childList, Arguments)
|
AddChild(childList, Arguments)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
|
@ -1,29 +1,29 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A read-only collection of attributes.
|
''' A read-only collection of attributes.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class AttributeBlockCollection
|
Public NotInheritable Class AttributeBlockCollection
|
||||||
Inherits TreeCollection(Of AttributeCollection)
|
Inherits TreeCollection(Of AttributeCollection)
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new collection of attribute blocks.
|
''' Constructs a new collection of attribute blocks.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="attributeBlocks">The attribute blockss in the collection.</param>
|
''' <param name="attributeBlocks">The attribute blockss in the collection.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal attributeBlocks As IList(Of AttributeCollection), ByVal span As Span)
|
Public Sub New(ByVal attributeBlocks As IList(Of AttributeCollection), ByVal span As Span)
|
||||||
MyBase.New(TreeType.AttributeBlockCollection, attributeBlocks, span)
|
MyBase.New(TreeType.AttributeBlockCollection, attributeBlocks, span)
|
||||||
|
|
||||||
If attributeBlocks Is Nothing OrElse attributeBlocks.Count = 0 Then
|
If attributeBlocks Is Nothing OrElse attributeBlocks.Count = 0 Then
|
||||||
Throw New ArgumentException("AttributeBlocksCollection cannot be empty.")
|
Throw New ArgumentException("AttributeBlocksCollection cannot be empty.")
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
|
@ -1,44 +1,44 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A read-only collection of attributes.
|
''' A read-only collection of attributes.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class AttributeCollection
|
Public NotInheritable Class AttributeCollection
|
||||||
Inherits CommaDelimitedTreeCollection(Of Attribute)
|
Inherits CommaDelimitedTreeCollection(Of Attribute)
|
||||||
|
|
||||||
Private ReadOnly _RightBracketLocation As Location
|
Private ReadOnly _RightBracketLocation As Location
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the '}'.
|
''' The location of the '}'.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property RightBracketLocation() As Location
|
Public ReadOnly Property RightBracketLocation() As Location
|
||||||
Get
|
Get
|
||||||
Return _RightBracketLocation
|
Return _RightBracketLocation
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new collection of attributes.
|
''' Constructs a new collection of attributes.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="attributes">The attributes in the collection.</param>
|
''' <param name="attributes">The attributes in the collection.</param>
|
||||||
''' <param name="commaLocations">The location of the commas in the list.</param>
|
''' <param name="commaLocations">The location of the commas in the list.</param>
|
||||||
''' <param name="rightBracketLocation">The location of the right bracket.</param>
|
''' <param name="rightBracketLocation">The location of the right bracket.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal attributes As IList(Of Attribute), ByVal commaLocations As IList(Of Location), ByVal rightBracketLocation As Location, ByVal span As Span)
|
Public Sub New(ByVal attributes As IList(Of Attribute), ByVal commaLocations As IList(Of Location), ByVal rightBracketLocation As Location, ByVal span As Span)
|
||||||
MyBase.New(TreeType.AttributeCollection, attributes, commaLocations, span)
|
MyBase.New(TreeType.AttributeCollection, attributes, commaLocations, span)
|
||||||
|
|
||||||
If attributes Is Nothing OrElse attributes.Count = 0 Then
|
If attributes Is Nothing OrElse attributes.Count = 0 Then
|
||||||
Throw New ArgumentException("AttributeCollection cannot be empty.")
|
Throw New ArgumentException("AttributeCollection cannot be empty.")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
_RightBracketLocation = rightBracketLocation
|
_RightBracketLocation = rightBracketLocation
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The type of an attribute usage.
|
''' The type of an attribute usage.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
<Flags()> _
|
<Flags()> _
|
||||||
Public Enum AttributeTypes
|
Public Enum AttributeTypes
|
||||||
''' <summary>Regular application.</summary>
|
''' <summary>Regular application.</summary>
|
||||||
Regular = &H1
|
Regular = &H1
|
||||||
|
|
||||||
''' <summary>Applied to the netmodule.</summary>
|
''' <summary>Applied to the netmodule.</summary>
|
||||||
[Module] = &H2
|
[Module] = &H2
|
||||||
|
|
||||||
''' <summary>Applied to the assembly.</summary>
|
''' <summary>Applied to the assembly.</summary>
|
||||||
Assembly = &H4
|
Assembly = &H4
|
||||||
End Enum
|
End Enum
|
|
@ -1,47 +1,47 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The type a block declaration.
|
''' The type a block declaration.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public Enum BlockType
|
Public Enum BlockType
|
||||||
None
|
None
|
||||||
|
|
||||||
[Do]
|
[Do]
|
||||||
[For]
|
[For]
|
||||||
|
|
||||||
[While]
|
[While]
|
||||||
[Select]
|
[Select]
|
||||||
[If]
|
[If]
|
||||||
[Try]
|
[Try]
|
||||||
[SyncLock]
|
[SyncLock]
|
||||||
[Using]
|
[Using]
|
||||||
[With]
|
[With]
|
||||||
|
|
||||||
[Sub]
|
[Sub]
|
||||||
[Function]
|
[Function]
|
||||||
[Operator]
|
[Operator]
|
||||||
|
|
||||||
[Event]
|
[Event]
|
||||||
[AddHandler]
|
[AddHandler]
|
||||||
[RemoveHandler]
|
[RemoveHandler]
|
||||||
[RaiseEvent]
|
[RaiseEvent]
|
||||||
|
|
||||||
[Get]
|
[Get]
|
||||||
[Set]
|
[Set]
|
||||||
[Property]
|
[Property]
|
||||||
|
|
||||||
[Class]
|
[Class]
|
||||||
[Structure]
|
[Structure]
|
||||||
[Module]
|
[Module]
|
||||||
[Interface]
|
[Interface]
|
||||||
[Enum]
|
[Enum]
|
||||||
[Namespace]
|
[Namespace]
|
||||||
End Enum
|
End Enum
|
|
@ -1,22 +1,22 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a case clause in a Select statement.
|
''' A parse tree for a case clause in a Select statement.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public MustInherit Class CaseClause
|
Public MustInherit Class CaseClause
|
||||||
Inherits Tree
|
Inherits Tree
|
||||||
|
|
||||||
Protected Sub New(ByVal type As TreeType, ByVal span As Span)
|
Protected Sub New(ByVal type As TreeType, ByVal span As Span)
|
||||||
MyBase.New(type, span)
|
MyBase.New(type, span)
|
||||||
|
|
||||||
Debug.Assert(type = TreeType.ComparisonCaseClause OrElse type = TreeType.RangeCaseClause)
|
Debug.Assert(type = TreeType.ComparisonCaseClause OrElse type = TreeType.RangeCaseClause)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
|
@ -1,30 +1,30 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A collection of case clauses.
|
''' A collection of case clauses.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class CaseClauseCollection
|
Public NotInheritable Class CaseClauseCollection
|
||||||
Inherits CommaDelimitedTreeCollection(Of CaseClause)
|
Inherits CommaDelimitedTreeCollection(Of CaseClause)
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new collection of case clauses.
|
''' Constructs a new collection of case clauses.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="caseClauses">The case clauses in the collection.</param>
|
''' <param name="caseClauses">The case clauses in the collection.</param>
|
||||||
''' <param name="commaLocations">The locations of the commas in the list.</param>
|
''' <param name="commaLocations">The locations of the commas in the list.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal caseClauses As IList(Of CaseClause), ByVal commaLocations As IList(Of Location), ByVal span As Span)
|
Public Sub New(ByVal caseClauses As IList(Of CaseClause), ByVal commaLocations As IList(Of Location), ByVal span As Span)
|
||||||
MyBase.New(TreeType.CaseClauseCollection, caseClauses, commaLocations, span)
|
MyBase.New(TreeType.CaseClauseCollection, caseClauses, commaLocations, span)
|
||||||
|
|
||||||
If caseClauses Is Nothing OrElse caseClauses.Count = 0 Then
|
If caseClauses Is Nothing OrElse caseClauses.Count = 0 Then
|
||||||
Throw New ArgumentException("CaseClauseCollection cannot be empty.")
|
Throw New ArgumentException("CaseClauseCollection cannot be empty.")
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,88 +1,88 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a case clause that compares values.
|
''' A parse tree for a case clause that compares values.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class ComparisonCaseClause
|
Public NotInheritable Class ComparisonCaseClause
|
||||||
Inherits CaseClause
|
Inherits CaseClause
|
||||||
|
|
||||||
Private ReadOnly _IsLocation As Location
|
Private ReadOnly _IsLocation As Location
|
||||||
Private ReadOnly _ComparisonOperator As OperatorType
|
Private ReadOnly _ComparisonOperator As OperatorType
|
||||||
Private ReadOnly _OperatorLocation As Location
|
Private ReadOnly _OperatorLocation As Location
|
||||||
Private ReadOnly _Operand As Expression
|
Private ReadOnly _Operand As Expression
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the 'Is', if any.
|
''' The location of the 'Is', if any.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property IsLocation() As Location
|
Public ReadOnly Property IsLocation() As Location
|
||||||
Get
|
Get
|
||||||
Return _IsLocation
|
Return _IsLocation
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The comparison operator used in the case clause.
|
''' The comparison operator used in the case clause.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property ComparisonOperator() As OperatorType
|
Public ReadOnly Property ComparisonOperator() As OperatorType
|
||||||
Get
|
Get
|
||||||
Return _ComparisonOperator
|
Return _ComparisonOperator
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the comparison operator.
|
''' The location of the comparison operator.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property OperatorLocation() As Location
|
Public ReadOnly Property OperatorLocation() As Location
|
||||||
Get
|
Get
|
||||||
Return _OperatorLocation
|
Return _OperatorLocation
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The operand of the case clause.
|
''' The operand of the case clause.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Operand() As Expression
|
Public ReadOnly Property Operand() As Expression
|
||||||
Get
|
Get
|
||||||
Return _Operand
|
Return _Operand
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for a comparison case clause.
|
''' Constructs a new parse tree for a comparison case clause.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="isLocation">The location of the 'Is', if any.</param>
|
''' <param name="isLocation">The location of the 'Is', if any.</param>
|
||||||
''' <param name="comparisonOperator">The comparison operator used.</param>
|
''' <param name="comparisonOperator">The comparison operator used.</param>
|
||||||
''' <param name="operatorLocation">The location of the comparison operator.</param>
|
''' <param name="operatorLocation">The location of the comparison operator.</param>
|
||||||
''' <param name="operand">The operand of the comparison.</param>
|
''' <param name="operand">The operand of the comparison.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal isLocation As Location, ByVal comparisonOperator As OperatorType, ByVal operatorLocation As Location, ByVal operand As Expression, ByVal span As Span)
|
Public Sub New(ByVal isLocation As Location, ByVal comparisonOperator As OperatorType, ByVal operatorLocation As Location, ByVal operand As Expression, ByVal span As Span)
|
||||||
MyBase.New(TreeType.ComparisonCaseClause, span)
|
MyBase.New(TreeType.ComparisonCaseClause, span)
|
||||||
|
|
||||||
If operand Is Nothing Then
|
If operand Is Nothing Then
|
||||||
Throw New ArgumentNullException("operand")
|
Throw New ArgumentNullException("operand")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If comparisonOperator < OperatorType.Equals OrElse comparisonOperator > OperatorType.GreaterThanEquals Then
|
If comparisonOperator < OperatorType.Equals OrElse comparisonOperator > OperatorType.GreaterThanEquals Then
|
||||||
Throw New ArgumentOutOfRangeException("comparisonOperator")
|
Throw New ArgumentOutOfRangeException("comparisonOperator")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
SetParent(operand)
|
SetParent(operand)
|
||||||
|
|
||||||
_IsLocation = isLocation
|
_IsLocation = isLocation
|
||||||
_ComparisonOperator = comparisonOperator
|
_ComparisonOperator = comparisonOperator
|
||||||
_OperatorLocation = operatorLocation
|
_OperatorLocation = operatorLocation
|
||||||
_Operand = operand
|
_Operand = operand
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
AddChild(childList, Operand)
|
AddChild(childList, Operand)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,48 +1,48 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a case clause that compares against a range of values.
|
''' A parse tree for a case clause that compares against a range of values.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class RangeCaseClause
|
Public NotInheritable Class RangeCaseClause
|
||||||
Inherits CaseClause
|
Inherits CaseClause
|
||||||
|
|
||||||
Private ReadOnly _RangeExpression As Expression
|
Private ReadOnly _RangeExpression As Expression
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The range expression.
|
''' The range expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property RangeExpression() As Expression
|
Public ReadOnly Property RangeExpression() As Expression
|
||||||
Get
|
Get
|
||||||
Return _RangeExpression
|
Return _RangeExpression
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new range case clause parse tree.
|
''' Constructs a new range case clause parse tree.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="rangeExpression">The range expression.</param>
|
''' <param name="rangeExpression">The range expression.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal rangeExpression As Expression, ByVal span As Span)
|
Public Sub New(ByVal rangeExpression As Expression, ByVal span As Span)
|
||||||
MyBase.New(TreeType.RangeCaseClause, span)
|
MyBase.New(TreeType.RangeCaseClause, span)
|
||||||
|
|
||||||
If rangeExpression Is Nothing Then
|
If rangeExpression Is Nothing Then
|
||||||
Throw New ArgumentNullException("rangeExpression")
|
Throw New ArgumentNullException("rangeExpression")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
SetParent(rangeExpression)
|
SetParent(rangeExpression)
|
||||||
|
|
||||||
_RangeExpression = rangeExpression
|
_RangeExpression = rangeExpression
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
AddChild(childList, RangeExpression)
|
AddChild(childList, RangeExpression)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,37 +1,37 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A collection of trees that are colon delimited.
|
''' A collection of trees that are colon delimited.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public MustInherit Class ColonDelimitedTreeCollection(Of T As Tree)
|
Public MustInherit Class ColonDelimitedTreeCollection(Of T As Tree)
|
||||||
Inherits TreeCollection(Of T)
|
Inherits TreeCollection(Of T)
|
||||||
|
|
||||||
Private ReadOnly _ColonLocations As ReadOnlyCollection(Of Location)
|
Private ReadOnly _ColonLocations As ReadOnlyCollection(Of Location)
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The locations of the colons in the collection.
|
''' The locations of the colons in the collection.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property ColonLocations() As ReadOnlyCollection(Of Location)
|
Public ReadOnly Property ColonLocations() As ReadOnlyCollection(Of Location)
|
||||||
Get
|
Get
|
||||||
Return _ColonLocations
|
Return _ColonLocations
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Protected Sub New(ByVal type As TreeType, ByVal trees As IList(Of T), ByVal colonLocations As IList(Of Location), ByVal span As Span)
|
Protected Sub New(ByVal type As TreeType, ByVal trees As IList(Of T), ByVal colonLocations As IList(Of Location), ByVal span As Span)
|
||||||
MyBase.New(type, trees, span)
|
MyBase.New(type, trees, span)
|
||||||
|
|
||||||
Debug.Assert(type = TreeType.StatementCollection OrElse type = TreeType.DeclarationCollection)
|
Debug.Assert(type = TreeType.StatementCollection OrElse type = TreeType.DeclarationCollection)
|
||||||
|
|
||||||
If colonLocations IsNot Nothing AndAlso colonLocations.Count > 0 Then
|
If colonLocations IsNot Nothing AndAlso colonLocations.Count > 0 Then
|
||||||
_ColonLocations = New ReadOnlyCollection(Of Location)(colonLocations)
|
_ColonLocations = New ReadOnlyCollection(Of Location)(colonLocations)
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
|
@ -1,37 +1,37 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A collection of trees that are delimited by commas.
|
''' A collection of trees that are delimited by commas.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public MustInherit Class CommaDelimitedTreeCollection(Of T As Tree)
|
Public MustInherit Class CommaDelimitedTreeCollection(Of T As Tree)
|
||||||
Inherits TreeCollection(Of T)
|
Inherits TreeCollection(Of T)
|
||||||
|
|
||||||
Private ReadOnly _CommaLocations As ReadOnlyCollection(Of Location)
|
Private ReadOnly _CommaLocations As ReadOnlyCollection(Of Location)
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the commas in the list.
|
''' The location of the commas in the list.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property CommaLocations() As ReadOnlyCollection(Of Location)
|
Public ReadOnly Property CommaLocations() As ReadOnlyCollection(Of Location)
|
||||||
Get
|
Get
|
||||||
Return _CommaLocations
|
Return _CommaLocations
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Protected Sub New(ByVal type As TreeType, ByVal trees As IList(Of T), ByVal commaLocations As IList(Of Location), ByVal span As Span)
|
Protected Sub New(ByVal type As TreeType, ByVal trees As IList(Of T), ByVal commaLocations As IList(Of Location), ByVal span As Span)
|
||||||
MyBase.New(type, trees, span)
|
MyBase.New(type, trees, span)
|
||||||
|
|
||||||
Debug.Assert(type >= TreeType.ArgumentCollection AndAlso type <= TreeType.ImportCollection)
|
Debug.Assert(type >= TreeType.ArgumentCollection AndAlso type <= TreeType.ImportCollection)
|
||||||
|
|
||||||
If commaLocations IsNot Nothing AndAlso commaLocations.Count > 0 Then
|
If commaLocations IsNot Nothing AndAlso commaLocations.Count > 0 Then
|
||||||
_CommaLocations = New ReadOnlyCollection(Of Location)(commaLocations)
|
_CommaLocations = New ReadOnlyCollection(Of Location)(commaLocations)
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
|
@ -1,103 +1,103 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A collection of a particular type of trees
|
''' A collection of a particular type of trees
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <typeparam name="T">The type of tree the collection contains.</typeparam>
|
''' <typeparam name="T">The type of tree the collection contains.</typeparam>
|
||||||
Public MustInherit Class TreeCollection(Of T As Tree)
|
Public MustInherit Class TreeCollection(Of T As Tree)
|
||||||
Inherits Tree
|
Inherits Tree
|
||||||
Implements IList(Of T)
|
Implements IList(Of T)
|
||||||
|
|
||||||
Private _Trees As ReadOnlyCollection(Of T)
|
Private _Trees As ReadOnlyCollection(Of T)
|
||||||
|
|
||||||
Protected Sub New(ByVal type As TreeType, ByVal trees As IList(Of T), ByVal span As Span)
|
Protected Sub New(ByVal type As TreeType, ByVal trees As IList(Of T), ByVal span As Span)
|
||||||
MyBase.New(type, span)
|
MyBase.New(type, span)
|
||||||
Debug.Assert(type >= TreeType.ArgumentCollection AndAlso type <= TreeType.DeclarationCollection)
|
Debug.Assert(type >= TreeType.ArgumentCollection AndAlso type <= TreeType.DeclarationCollection)
|
||||||
|
|
||||||
If trees Is Nothing Then
|
If trees Is Nothing Then
|
||||||
_Trees = New ReadOnlyCollection(Of T)(New List(Of T)())
|
_Trees = New ReadOnlyCollection(Of T)(New List(Of T)())
|
||||||
Else
|
Else
|
||||||
_Trees = New ReadOnlyCollection(Of T)(trees)
|
_Trees = New ReadOnlyCollection(Of T)(trees)
|
||||||
SetParents(trees)
|
SetParents(trees)
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub Add(ByVal item As T) Implements ICollection(Of T).Add
|
Private Sub Add(ByVal item As T) Implements ICollection(Of T).Add
|
||||||
Throw New NotSupportedException()
|
Throw New NotSupportedException()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub Clear() Implements ICollection(Of T).Clear
|
Private Sub Clear() Implements ICollection(Of T).Clear
|
||||||
Throw New NotSupportedException()
|
Throw New NotSupportedException()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Function Contains(ByVal item As T) As Boolean Implements ICollection(Of T).Contains
|
Public Function Contains(ByVal item As T) As Boolean Implements ICollection(Of T).Contains
|
||||||
Return _Trees.Contains(item)
|
Return _Trees.Contains(item)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Sub CopyTo(ByVal array() As T, ByVal arrayIndex As Integer) Implements ICollection(Of T).CopyTo
|
Public Sub CopyTo(ByVal array() As T, ByVal arrayIndex As Integer) Implements ICollection(Of T).CopyTo
|
||||||
_Trees.CopyTo(array, arrayIndex)
|
_Trees.CopyTo(array, arrayIndex)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public ReadOnly Property Count() As Integer Implements ICollection(Of T).Count
|
Public ReadOnly Property Count() As Integer Implements ICollection(Of T).Count
|
||||||
Get
|
Get
|
||||||
Return _Trees.Count
|
Return _Trees.Count
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Private ReadOnly Property IsReadOnly() As Boolean Implements ICollection(Of T).IsReadOnly
|
Private ReadOnly Property IsReadOnly() As Boolean Implements ICollection(Of T).IsReadOnly
|
||||||
Get
|
Get
|
||||||
Return True
|
Return True
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Private Function Remove(ByVal item As T) As Boolean Implements ICollection(Of T).Remove
|
Private Function Remove(ByVal item As T) As Boolean Implements ICollection(Of T).Remove
|
||||||
Throw New NotSupportedException()
|
Throw New NotSupportedException()
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function GetEnumerator() As IEnumerator(Of T) Implements IEnumerable(Of T).GetEnumerator
|
Public Function GetEnumerator() As IEnumerator(Of T) Implements IEnumerable(Of T).GetEnumerator
|
||||||
Return _Trees.GetEnumerator
|
Return _Trees.GetEnumerator
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function IndexOf(ByVal item As T) As Integer Implements IList(Of T).IndexOf
|
Public Function IndexOf(ByVal item As T) As Integer Implements IList(Of T).IndexOf
|
||||||
Return _Trees.IndexOf(item)
|
Return _Trees.IndexOf(item)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Sub Insert(ByVal index As Integer, ByVal item As T) Implements IList(Of T).Insert
|
Private Sub Insert(ByVal index As Integer, ByVal item As T) Implements IList(Of T).Insert
|
||||||
Throw New NotSupportedException()
|
Throw New NotSupportedException()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public ReadOnly Property Item(ByVal index As Integer) As T
|
Public ReadOnly Property Item(ByVal index As Integer) As T
|
||||||
Get
|
Get
|
||||||
Return _Trees.Item(index)
|
Return _Trees.Item(index)
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Private Property IListItem(ByVal index As Integer) As T Implements IList(Of T).Item
|
Private Property IListItem(ByVal index As Integer) As T Implements IList(Of T).Item
|
||||||
Get
|
Get
|
||||||
Return _Trees.Item(index)
|
Return _Trees.Item(index)
|
||||||
End Get
|
End Get
|
||||||
Set(ByVal value As T)
|
Set(ByVal value As T)
|
||||||
Throw New NotSupportedException()
|
Throw New NotSupportedException()
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Private Sub RemoveAt(ByVal index As Integer) Implements IList(Of T).RemoveAt
|
Private Sub RemoveAt(ByVal index As Integer) Implements IList(Of T).RemoveAt
|
||||||
Throw New NotSupportedException()
|
Throw New NotSupportedException()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function IEnumerableGetEnumerator() As IEnumerator Implements IEnumerable.GetEnumerator
|
Private Function IEnumerableGetEnumerator() As IEnumerator Implements IEnumerable.GetEnumerator
|
||||||
Return _Trees.GetEnumerator()
|
Return _Trees.GetEnumerator()
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
AddChildren(childList, _Trees)
|
AddChildren(childList, _Trees)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
|
@ -1,54 +1,54 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a comment.
|
''' A parse tree for a comment.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class Comment
|
Public NotInheritable Class Comment
|
||||||
Inherits Tree
|
Inherits Tree
|
||||||
|
|
||||||
Private ReadOnly _Comment As String
|
Private ReadOnly _Comment As String
|
||||||
Private ReadOnly _IsREM As Boolean
|
Private ReadOnly _IsREM As Boolean
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The text of the comment.
|
''' The text of the comment.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Comment() As String
|
Public ReadOnly Property Comment() As String
|
||||||
Get
|
Get
|
||||||
Return _Comment
|
Return _Comment
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Whether the comment is a REM comment.
|
''' Whether the comment is a REM comment.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property IsREM() As Boolean
|
Public ReadOnly Property IsREM() As Boolean
|
||||||
Get
|
Get
|
||||||
Return _IsREM
|
Return _IsREM
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new comment parse tree.
|
''' Constructs a new comment parse tree.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="comment">The text of the comment.</param>
|
''' <param name="comment">The text of the comment.</param>
|
||||||
''' <param name="isREM">Whether the comment is a REM comment.</param>
|
''' <param name="isREM">Whether the comment is a REM comment.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal comment As String, ByVal isREM As Boolean, ByVal span As Span)
|
Public Sub New(ByVal comment As String, ByVal isREM As Boolean, ByVal span As Span)
|
||||||
MyBase.New(TreeType.Comment, span)
|
MyBase.New(TreeType.Comment, span)
|
||||||
|
|
||||||
If comment Is Nothing Then
|
If comment Is Nothing Then
|
||||||
Throw New ArgumentNullException("comment")
|
Throw New ArgumentNullException("comment")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
_Comment = comment
|
_Comment = comment
|
||||||
_IsREM = isREM
|
_IsREM = isREM
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,49 +1,49 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for an assembly-level or module-level attribute declaration.
|
''' A parse tree for an assembly-level or module-level attribute declaration.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class AttributeDeclaration
|
Public NotInheritable Class AttributeDeclaration
|
||||||
Inherits Declaration
|
Inherits Declaration
|
||||||
|
|
||||||
Private ReadOnly _Attributes As AttributeBlockCollection
|
Private ReadOnly _Attributes As AttributeBlockCollection
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The attributes.
|
''' The attributes.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Attributes() As AttributeBlockCollection
|
Public ReadOnly Property Attributes() As AttributeBlockCollection
|
||||||
Get
|
Get
|
||||||
Return _Attributes
|
Return _Attributes
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for assembly-level or module-level attribute declarations.
|
''' Constructs a new parse tree for assembly-level or module-level attribute declarations.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="attributes">The attributes.</param>
|
''' <param name="attributes">The attributes.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
''' <param name="comments">The comments for the parse tree.</param>
|
''' <param name="comments">The comments for the parse tree.</param>
|
||||||
Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal span As Span, ByVal comments As IList(Of Comment))
|
Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal span As Span, ByVal comments As IList(Of Comment))
|
||||||
MyBase.New(TreeType.AttributeDeclaration, span, comments)
|
MyBase.New(TreeType.AttributeDeclaration, span, comments)
|
||||||
|
|
||||||
If attributes Is Nothing Then
|
If attributes Is Nothing Then
|
||||||
Throw New ArgumentNullException("attributes")
|
Throw New ArgumentNullException("attributes")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
SetParent(attributes)
|
SetParent(attributes)
|
||||||
|
|
||||||
_Attributes = attributes
|
_Attributes = attributes
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
AddChild(childList, Attributes)
|
AddChild(childList, Attributes)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,86 +1,86 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a block declaration.
|
''' A parse tree for a block declaration.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public MustInherit Class BlockDeclaration
|
Public MustInherit Class BlockDeclaration
|
||||||
Inherits ModifiedDeclaration
|
Inherits ModifiedDeclaration
|
||||||
|
|
||||||
Private ReadOnly _KeywordLocation As Location
|
Private ReadOnly _KeywordLocation As Location
|
||||||
Private ReadOnly _Name As SimpleName
|
Private ReadOnly _Name As SimpleName
|
||||||
Private ReadOnly _Declarations As DeclarationCollection
|
Private ReadOnly _Declarations As DeclarationCollection
|
||||||
Private ReadOnly _EndDeclaration As EndBlockDeclaration
|
Private ReadOnly _EndDeclaration As EndBlockDeclaration
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the keyword.
|
''' The location of the keyword.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property KeywordLocation() As Location
|
Public ReadOnly Property KeywordLocation() As Location
|
||||||
Get
|
Get
|
||||||
Return _KeywordLocation
|
Return _KeywordLocation
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The name of the declaration.
|
''' The name of the declaration.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Name() As SimpleName
|
Public ReadOnly Property Name() As SimpleName
|
||||||
Get
|
Get
|
||||||
Return _Name
|
Return _Name
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The declarations in the block.
|
''' The declarations in the block.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Declarations() As DeclarationCollection
|
Public ReadOnly Property Declarations() As DeclarationCollection
|
||||||
Get
|
Get
|
||||||
Return _Declarations
|
Return _Declarations
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The End statement for the block.
|
''' The End statement for the block.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property EndDeclaration() As EndBlockDeclaration
|
Public ReadOnly Property EndDeclaration() As EndBlockDeclaration
|
||||||
Get
|
Get
|
||||||
Return _EndDeclaration
|
Return _EndDeclaration
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Protected Sub New(ByVal type As TreeType, ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection, ByVal keywordLocation As Location, ByVal name As SimpleName, ByVal declarations As DeclarationCollection, ByVal endDeclaration As EndBlockDeclaration, ByVal span As Span, ByVal comments As IList(Of Comment))
|
Protected Sub New(ByVal type As TreeType, ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection, ByVal keywordLocation As Location, ByVal name As SimpleName, ByVal declarations As DeclarationCollection, ByVal endDeclaration As EndBlockDeclaration, ByVal span As Span, ByVal comments As IList(Of Comment))
|
||||||
MyBase.New(type, attributes, modifiers, span, comments)
|
MyBase.New(type, attributes, modifiers, span, comments)
|
||||||
|
|
||||||
Debug.Assert(type = TreeType.ClassDeclaration OrElse type = TreeType.ModuleDeclaration OrElse _
|
Debug.Assert(type = TreeType.ClassDeclaration OrElse type = TreeType.ModuleDeclaration OrElse _
|
||||||
type = TreeType.InterfaceDeclaration OrElse type = TreeType.StructureDeclaration OrElse _
|
type = TreeType.InterfaceDeclaration OrElse type = TreeType.StructureDeclaration OrElse _
|
||||||
type = TreeType.EnumDeclaration)
|
type = TreeType.EnumDeclaration)
|
||||||
|
|
||||||
If name Is Nothing Then
|
If name Is Nothing Then
|
||||||
Throw New ArgumentNullException("name")
|
Throw New ArgumentNullException("name")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
SetParent(name)
|
SetParent(name)
|
||||||
SetParent(declarations)
|
SetParent(declarations)
|
||||||
SetParent(endDeclaration)
|
SetParent(endDeclaration)
|
||||||
|
|
||||||
_KeywordLocation = keywordLocation
|
_KeywordLocation = keywordLocation
|
||||||
_Name = name
|
_Name = name
|
||||||
_Declarations = declarations
|
_Declarations = declarations
|
||||||
_EndDeclaration = endDeclaration
|
_EndDeclaration = endDeclaration
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
MyBase.GetChildTrees(childList)
|
MyBase.GetChildTrees(childList)
|
||||||
|
|
||||||
AddChild(childList, Name)
|
AddChild(childList, Name)
|
||||||
AddChild(childList, Declarations)
|
AddChild(childList, Declarations)
|
||||||
AddChild(childList, EndDeclaration)
|
AddChild(childList, EndDeclaration)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,44 +1,44 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
'LC Changed Declaration to Inherits from Statement instead of tree so that we can add declaration to statement collection
|
'LC Changed Declaration to Inherits from Statement instead of tree so that we can add declaration to statement collection
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a declaration.
|
''' A parse tree for a declaration.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public Class Declaration
|
Public Class Declaration
|
||||||
Inherits Statement
|
Inherits Statement
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Creates a bad declaration.
|
''' Creates a bad declaration.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
''' <param name="comments">The comments for the parse tree.</param>
|
''' <param name="comments">The comments for the parse tree.</param>
|
||||||
''' <returns>A bad declaration.</returns>
|
''' <returns>A bad declaration.</returns>
|
||||||
Public Shared Function GetBadDeclaration(ByVal span As Span, ByVal comments As IList(Of Comment)) As Declaration
|
Public Shared Function GetBadDeclaration(ByVal span As Span, ByVal comments As IList(Of Comment)) As Declaration
|
||||||
Return New Declaration(span, comments)
|
Return New Declaration(span, comments)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Protected Sub New(ByVal type As TreeType, ByVal span As Span, ByVal comments As IList(Of Comment))
|
Protected Sub New(ByVal type As TreeType, ByVal span As Span, ByVal comments As IList(Of Comment))
|
||||||
MyBase.New(type, span, comments)
|
MyBase.New(type, span, comments)
|
||||||
|
|
||||||
Debug.Assert(type >= TreeType.EmptyDeclaration AndAlso type <= TreeType.DelegateFunctionDeclaration)
|
Debug.Assert(type >= TreeType.EmptyDeclaration AndAlso type <= TreeType.DelegateFunctionDeclaration)
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub New(ByVal span As Span, ByVal comments As IList(Of Comment))
|
Private Sub New(ByVal span As Span, ByVal comments As IList(Of Comment))
|
||||||
MyBase.New(TreeType.SyntaxError, span, comments)
|
MyBase.New(TreeType.SyntaxError, span, comments)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Overrides ReadOnly Property IsBad() As Boolean
|
Public Overrides ReadOnly Property IsBad() As Boolean
|
||||||
Get
|
Get
|
||||||
Return Type = TreeType.SyntaxError
|
Return Type = TreeType.SyntaxError
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
End Class
|
End Class
|
|
@ -1,32 +1,32 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A read-only collection of declarations.
|
''' A read-only collection of declarations.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class DeclarationCollection
|
Public NotInheritable Class DeclarationCollection
|
||||||
Inherits ColonDelimitedTreeCollection(Of Declaration)
|
Inherits ColonDelimitedTreeCollection(Of Declaration)
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new collection of declarations.
|
''' Constructs a new collection of declarations.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="declarations">The declarations in the collection.</param>
|
''' <param name="declarations">The declarations in the collection.</param>
|
||||||
''' <param name="colonLocations">The locations of the colons in the collection.</param>
|
''' <param name="colonLocations">The locations of the colons in the collection.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal declarations As IList(Of Declaration), ByVal colonLocations As IList(Of Location), ByVal span As Span)
|
Public Sub New(ByVal declarations As IList(Of Declaration), ByVal colonLocations As IList(Of Location), ByVal span As Span)
|
||||||
MyBase.New(TreeType.DeclarationCollection, declarations, colonLocations, span)
|
MyBase.New(TreeType.DeclarationCollection, declarations, colonLocations, span)
|
||||||
|
|
||||||
' A declaration collection may need to hold just a colon.
|
' A declaration collection may need to hold just a colon.
|
||||||
If (declarations Is Nothing OrElse declarations.Count = 0) AndAlso _
|
If (declarations Is Nothing OrElse declarations.Count = 0) AndAlso _
|
||||||
(colonLocations Is Nothing OrElse colonLocations.Count = 0) Then
|
(colonLocations Is Nothing OrElse colonLocations.Count = 0) Then
|
||||||
Throw New ArgumentException("DeclarationCollection cannot be empty.")
|
Throw New ArgumentException("DeclarationCollection cannot be empty.")
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,25 +1,25 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for an empty declaration.
|
''' A parse tree for an empty declaration.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class EmptyDeclaration
|
Public NotInheritable Class EmptyDeclaration
|
||||||
Inherits Declaration
|
Inherits Declaration
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for an empty declaration.
|
''' Constructs a new parse tree for an empty declaration.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
''' <param name="comments">The comments for the parse tree.</param>
|
''' <param name="comments">The comments for the parse tree.</param>
|
||||||
Public Sub New(ByVal span As Span, ByVal comments As IList(Of Comment))
|
Public Sub New(ByVal span As Span, ByVal comments As IList(Of Comment))
|
||||||
MyBase.New(TreeType.EmptyDeclaration, span, comments)
|
MyBase.New(TreeType.EmptyDeclaration, span, comments)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,71 +1,71 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for an End declaration.
|
''' A parse tree for an End declaration.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class EndBlockDeclaration
|
Public NotInheritable Class EndBlockDeclaration
|
||||||
Inherits Declaration
|
Inherits Declaration
|
||||||
|
|
||||||
Private ReadOnly _EndType As BlockType
|
Private ReadOnly _EndType As BlockType
|
||||||
Private ReadOnly _EndArgumentLocation As Location
|
Private ReadOnly _EndArgumentLocation As Location
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The type of block the declaration ends.
|
''' The type of block the declaration ends.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property EndType() As BlockType
|
Public ReadOnly Property EndType() As BlockType
|
||||||
Get
|
Get
|
||||||
Return _EndType
|
Return _EndType
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the end block argument.
|
''' The location of the end block argument.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property EndArgumentLocation() As Location
|
Public ReadOnly Property EndArgumentLocation() As Location
|
||||||
Get
|
Get
|
||||||
Return _EndArgumentLocation
|
Return _EndArgumentLocation
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Creates a new parse tree for an End block declaration.
|
''' Creates a new parse tree for an End block declaration.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="endType">The type of the block the statement ends.</param>
|
''' <param name="endType">The type of the block the statement ends.</param>
|
||||||
''' <param name="endArgumentLocation">The location of the end block argument.</param>
|
''' <param name="endArgumentLocation">The location of the end block argument.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
''' <param name="comments">The comments for the parse tree.</param>
|
''' <param name="comments">The comments for the parse tree.</param>
|
||||||
Public Sub New(ByVal endType As BlockType, ByVal endArgumentLocation As Location, ByVal span As Span, ByVal comments As IList(Of Comment))
|
Public Sub New(ByVal endType As BlockType, ByVal endArgumentLocation As Location, ByVal span As Span, ByVal comments As IList(Of Comment))
|
||||||
MyBase.New(TreeType.EndBlockDeclaration, span, comments)
|
MyBase.New(TreeType.EndBlockDeclaration, span, comments)
|
||||||
|
|
||||||
If endType < BlockType.Sub AndAlso endType > BlockType.Namespace Then
|
If endType < BlockType.Sub AndAlso endType > BlockType.Namespace Then
|
||||||
Throw New ArgumentOutOfRangeException("endType")
|
Throw New ArgumentOutOfRangeException("endType")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
_EndType = endType
|
_EndType = endType
|
||||||
_EndArgumentLocation = endArgumentLocation
|
_EndArgumentLocation = endArgumentLocation
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Sub New(ByVal endBlockStatement As EndBlockStatement)
|
Friend Sub New(ByVal endBlockStatement As EndBlockStatement)
|
||||||
MyBase.New(TreeType.EndBlockDeclaration, endBlockStatement.Span, endBlockStatement.Comments)
|
MyBase.New(TreeType.EndBlockDeclaration, endBlockStatement.Span, endBlockStatement.Comments)
|
||||||
|
|
||||||
' We only need to convert these types.
|
' We only need to convert these types.
|
||||||
Select Case endBlockStatement.EndType
|
Select Case endBlockStatement.EndType
|
||||||
Case BlockType.Function, BlockType.Get, BlockType.Set, BlockType.Sub, BlockType.Operator, _
|
Case BlockType.Function, BlockType.Get, BlockType.Set, BlockType.Sub, BlockType.Operator, _
|
||||||
BlockType.AddHandler, BlockType.RemoveHandler, BlockType.RaiseEvent
|
BlockType.AddHandler, BlockType.RemoveHandler, BlockType.RaiseEvent
|
||||||
_EndType = endBlockStatement.EndType
|
_EndType = endBlockStatement.EndType
|
||||||
|
|
||||||
Case Else
|
Case Else
|
||||||
Throw New ArgumentException("Invalid EndBlockStatement type.")
|
Throw New ArgumentException("Invalid EndBlockStatement type.")
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
_EndArgumentLocation = endBlockStatement.EndArgumentLocation
|
_EndArgumentLocation = endBlockStatement.EndArgumentLocation
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,52 +1,52 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a declaration with modifiers.
|
''' A parse tree for a declaration with modifiers.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public MustInherit Class ModifiedDeclaration
|
Public MustInherit Class ModifiedDeclaration
|
||||||
Inherits Declaration
|
Inherits Declaration
|
||||||
|
|
||||||
Private ReadOnly _Attributes As AttributeBlockCollection
|
Private ReadOnly _Attributes As AttributeBlockCollection
|
||||||
Private ReadOnly _Modifiers As ModifierCollection
|
Private ReadOnly _Modifiers As ModifierCollection
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The attributes on the declaration.
|
''' The attributes on the declaration.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Attributes() As AttributeBlockCollection
|
Public ReadOnly Property Attributes() As AttributeBlockCollection
|
||||||
Get
|
Get
|
||||||
Return _Attributes
|
Return _Attributes
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The modifiers on the declaration.
|
''' The modifiers on the declaration.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Modifiers() As ModifierCollection
|
Public ReadOnly Property Modifiers() As ModifierCollection
|
||||||
Get
|
Get
|
||||||
Return _Modifiers
|
Return _Modifiers
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Protected Sub New(ByVal type As TreeType, ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection, ByVal span As Span, ByVal comments As IList(Of Comment))
|
Protected Sub New(ByVal type As TreeType, ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection, ByVal span As Span, ByVal comments As IList(Of Comment))
|
||||||
MyBase.New(type, span, comments)
|
MyBase.New(type, span, comments)
|
||||||
|
|
||||||
SetParent(attributes)
|
SetParent(attributes)
|
||||||
SetParent(modifiers)
|
SetParent(modifiers)
|
||||||
|
|
||||||
_Attributes = attributes
|
_Attributes = attributes
|
||||||
_Modifiers = modifiers
|
_Modifiers = modifiers
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
AddChild(childList, Attributes)
|
AddChild(childList, Attributes)
|
||||||
AddChild(childList, Modifiers)
|
AddChild(childList, Modifiers)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,25 +1,25 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for an AddressOf expression.
|
''' A parse tree for an AddressOf expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class AddressOfExpression
|
Public NotInheritable Class AddressOfExpression
|
||||||
Inherits UnaryExpression
|
Inherits UnaryExpression
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new AddressOf expression parse tree.
|
''' Constructs a new AddressOf expression parse tree.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="operand">The operand of AddressOf.</param>
|
''' <param name="operand">The operand of AddressOf.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal operand As Expression, ByVal span As Span)
|
Public Sub New(ByVal operand As Expression, ByVal span As Span)
|
||||||
MyBase.New(TreeType.AddressOfExpression, operand, span)
|
MyBase.New(TreeType.AddressOfExpression, operand, span)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,100 +1,100 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a binary operator expression.
|
''' A parse tree for a binary operator expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class BinaryOperatorExpression
|
Public NotInheritable Class BinaryOperatorExpression
|
||||||
Inherits Expression
|
Inherits Expression
|
||||||
|
|
||||||
Private ReadOnly _LeftOperand As Expression
|
Private ReadOnly _LeftOperand As Expression
|
||||||
Private ReadOnly _Operator As OperatorType
|
Private ReadOnly _Operator As OperatorType
|
||||||
Private ReadOnly _OperatorLocation As Location
|
Private ReadOnly _OperatorLocation As Location
|
||||||
Private ReadOnly _RightOperand As Expression
|
Private ReadOnly _RightOperand As Expression
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The left operand expression.
|
''' The left operand expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property LeftOperand() As Expression
|
Public ReadOnly Property LeftOperand() As Expression
|
||||||
Get
|
Get
|
||||||
Return _LeftOperand
|
Return _LeftOperand
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The operator.
|
''' The operator.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property [Operator]() As OperatorType
|
Public ReadOnly Property [Operator]() As OperatorType
|
||||||
Get
|
Get
|
||||||
Return _Operator
|
Return _Operator
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the operator.
|
''' The location of the operator.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property OperatorLocation() As Location
|
Public ReadOnly Property OperatorLocation() As Location
|
||||||
Get
|
Get
|
||||||
Return _OperatorLocation
|
Return _OperatorLocation
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The right operand expression.
|
''' The right operand expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property RightOperand() As Expression
|
Public ReadOnly Property RightOperand() As Expression
|
||||||
Get
|
Get
|
||||||
Return _RightOperand
|
Return _RightOperand
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for a binary operation.
|
''' Constructs a new parse tree for a binary operation.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="leftOperand">The left operand expression.</param>
|
''' <param name="leftOperand">The left operand expression.</param>
|
||||||
''' <param name="operator">The operator.</param>
|
''' <param name="operator">The operator.</param>
|
||||||
''' <param name="operatorLocation">The location of the operator.</param>
|
''' <param name="operatorLocation">The location of the operator.</param>
|
||||||
''' <param name="rightOperand">The right operand expression.</param>
|
''' <param name="rightOperand">The right operand expression.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal leftOperand As Expression, ByVal [operator] As OperatorType, ByVal operatorLocation As Location, ByVal rightOperand As Expression, ByVal span As Span)
|
Public Sub New(ByVal leftOperand As Expression, ByVal [operator] As OperatorType, ByVal operatorLocation As Location, ByVal rightOperand As Expression, ByVal span As Span)
|
||||||
MyBase.New(TreeType.BinaryOperatorExpression, span)
|
MyBase.New(TreeType.BinaryOperatorExpression, span)
|
||||||
|
|
||||||
If [operator] < OperatorType.Plus OrElse [operator] > OperatorType.GreaterThanEquals Then
|
If [operator] < OperatorType.Plus OrElse [operator] > OperatorType.GreaterThanEquals Then
|
||||||
Throw New ArgumentOutOfRangeException("operator")
|
Throw New ArgumentOutOfRangeException("operator")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If leftOperand Is Nothing Then
|
If leftOperand Is Nothing Then
|
||||||
Throw New ArgumentNullException("leftOperand")
|
Throw New ArgumentNullException("leftOperand")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If rightOperand Is Nothing Then
|
If rightOperand Is Nothing Then
|
||||||
Throw New ArgumentNullException("rightOperand")
|
Throw New ArgumentNullException("rightOperand")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
SetParent(leftOperand)
|
SetParent(leftOperand)
|
||||||
SetParent(rightOperand)
|
SetParent(rightOperand)
|
||||||
|
|
||||||
_LeftOperand = leftOperand
|
_LeftOperand = leftOperand
|
||||||
_Operator = [operator]
|
_Operator = [operator]
|
||||||
_OperatorLocation = operatorLocation
|
_OperatorLocation = operatorLocation
|
||||||
_RightOperand = rightOperand
|
_RightOperand = rightOperand
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Overrides ReadOnly Property IsConstant() As Boolean
|
Public Overrides ReadOnly Property IsConstant() As Boolean
|
||||||
Get
|
Get
|
||||||
Return LeftOperand.IsConstant AndAlso RightOperand.IsConstant
|
Return LeftOperand.IsConstant AndAlso RightOperand.IsConstant
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
AddChild(childList, LeftOperand)
|
AddChild(childList, LeftOperand)
|
||||||
AddChild(childList, RightOperand)
|
AddChild(childList, RightOperand)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,43 +1,43 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a Boolean literal expression.
|
''' A parse tree for a Boolean literal expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class BooleanLiteralExpression
|
Public NotInheritable Class BooleanLiteralExpression
|
||||||
Inherits LiteralExpression
|
Inherits LiteralExpression
|
||||||
|
|
||||||
Private ReadOnly _Literal As Boolean
|
Private ReadOnly _Literal As Boolean
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The literal value.
|
''' The literal value.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Literal() As Boolean
|
Public ReadOnly Property Literal() As Boolean
|
||||||
Get
|
Get
|
||||||
Return _Literal
|
Return _Literal
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
'LC
|
'LC
|
||||||
Public Overrides ReadOnly Property Value() As Object
|
Public Overrides ReadOnly Property Value() As Object
|
||||||
Get
|
Get
|
||||||
Return _Literal
|
Return _Literal
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for a Boolean literal expression.
|
''' Constructs a new parse tree for a Boolean literal expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="literal">The literal value.</param>
|
''' <param name="literal">The literal value.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal literal As Boolean, ByVal span As Span)
|
Public Sub New(ByVal literal As Boolean, ByVal span As Span)
|
||||||
MyBase.New(TreeType.BooleanLiteralExpression, span)
|
MyBase.New(TreeType.BooleanLiteralExpression, span)
|
||||||
_Literal = literal
|
_Literal = literal
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,29 +1,29 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a CType expression.
|
''' A parse tree for a CType expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class CTypeExpression
|
Public NotInheritable Class CTypeExpression
|
||||||
Inherits CastTypeExpression
|
Inherits CastTypeExpression
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for a CType expression.
|
''' Constructs a new parse tree for a CType expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="leftParenthesisLocation">The location of the '('.</param>
|
''' <param name="leftParenthesisLocation">The location of the '('.</param>
|
||||||
''' <param name="operand">The expression to be converted.</param>
|
''' <param name="operand">The expression to be converted.</param>
|
||||||
''' <param name="commaLocation">The location of the ','.</param>
|
''' <param name="commaLocation">The location of the ','.</param>
|
||||||
''' <param name="target">The target type of the conversion.</param>
|
''' <param name="target">The target type of the conversion.</param>
|
||||||
''' <param name="rightParenthesisLocation">The location of the ')'.</param>
|
''' <param name="rightParenthesisLocation">The location of the ')'.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal leftParenthesisLocation As Location, ByVal operand As Expression, ByVal commaLocation As Location, ByVal target As TypeName, ByVal rightParenthesisLocation As Location, ByVal span As Span)
|
Public Sub New(ByVal leftParenthesisLocation As Location, ByVal operand As Expression, ByVal commaLocation As Location, ByVal target As TypeName, ByVal rightParenthesisLocation As Location, ByVal span As Span)
|
||||||
MyBase.New(TreeType.CTypeExpression, leftParenthesisLocation, operand, commaLocation, target, rightParenthesisLocation, span)
|
MyBase.New(TreeType.CTypeExpression, leftParenthesisLocation, operand, commaLocation, target, rightParenthesisLocation, span)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,62 +1,62 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a call or index expression.
|
''' A parse tree for a call or index expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class CallOrIndexExpression
|
Public NotInheritable Class CallOrIndexExpression
|
||||||
Inherits Expression
|
Inherits Expression
|
||||||
|
|
||||||
Private ReadOnly _TargetExpression As Expression
|
Private ReadOnly _TargetExpression As Expression
|
||||||
Private ReadOnly _Arguments As ArgumentCollection
|
Private ReadOnly _Arguments As ArgumentCollection
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The target of the call or index.
|
''' The target of the call or index.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property TargetExpression() As Expression
|
Public ReadOnly Property TargetExpression() As Expression
|
||||||
Get
|
Get
|
||||||
Return _TargetExpression
|
Return _TargetExpression
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The arguments to the call or index.
|
''' The arguments to the call or index.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Arguments() As ArgumentCollection
|
Public ReadOnly Property Arguments() As ArgumentCollection
|
||||||
Get
|
Get
|
||||||
Return _Arguments
|
Return _Arguments
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for a call or index expression.
|
''' Constructs a new parse tree for a call or index expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="targetExpression">The target of the call or index.</param>
|
''' <param name="targetExpression">The target of the call or index.</param>
|
||||||
''' <param name="arguments">The arguments to the call or index.</param>
|
''' <param name="arguments">The arguments to the call or index.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal targetExpression As Expression, ByVal arguments As ArgumentCollection, ByVal span As Span)
|
Public Sub New(ByVal targetExpression As Expression, ByVal arguments As ArgumentCollection, ByVal span As Span)
|
||||||
MyBase.New(TreeType.CallOrIndexExpression, span)
|
MyBase.New(TreeType.CallOrIndexExpression, span)
|
||||||
|
|
||||||
If targetExpression Is Nothing Then
|
If targetExpression Is Nothing Then
|
||||||
Throw New ArgumentNullException("targetExpression")
|
Throw New ArgumentNullException("targetExpression")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
SetParent(targetExpression)
|
SetParent(targetExpression)
|
||||||
SetParent(arguments)
|
SetParent(arguments)
|
||||||
|
|
||||||
_TargetExpression = targetExpression
|
_TargetExpression = targetExpression
|
||||||
_Arguments = arguments
|
_Arguments = arguments
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
AddChild(childList, TargetExpression)
|
AddChild(childList, TargetExpression)
|
||||||
AddChild(childList, Arguments)
|
AddChild(childList, Arguments)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,79 +1,79 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a CType or DirectCast expression.
|
''' A parse tree for a CType or DirectCast expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public MustInherit Class CastTypeExpression
|
Public MustInherit Class CastTypeExpression
|
||||||
Inherits UnaryExpression
|
Inherits UnaryExpression
|
||||||
|
|
||||||
Private ReadOnly _LeftParenthesisLocation As Location
|
Private ReadOnly _LeftParenthesisLocation As Location
|
||||||
Private ReadOnly _CommaLocation As Location
|
Private ReadOnly _CommaLocation As Location
|
||||||
Private ReadOnly _Target As TypeName
|
Private ReadOnly _Target As TypeName
|
||||||
Private ReadOnly _RightParenthesisLocation As Location
|
Private ReadOnly _RightParenthesisLocation As Location
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the '('.
|
''' The location of the '('.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property LeftParenthesisLocation() As Location
|
Public ReadOnly Property LeftParenthesisLocation() As Location
|
||||||
Get
|
Get
|
||||||
Return _LeftParenthesisLocation
|
Return _LeftParenthesisLocation
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the ','.
|
''' The location of the ','.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property CommaLocation() As Location
|
Public ReadOnly Property CommaLocation() As Location
|
||||||
Get
|
Get
|
||||||
Return _CommaLocation
|
Return _CommaLocation
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The target type for the operand.
|
''' The target type for the operand.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Target() As TypeName
|
Public ReadOnly Property Target() As TypeName
|
||||||
Get
|
Get
|
||||||
Return _Target
|
Return _Target
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the ')'.
|
''' The location of the ')'.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property RightParenthesisLocation() As Location
|
Public ReadOnly Property RightParenthesisLocation() As Location
|
||||||
Get
|
Get
|
||||||
Return _RightParenthesisLocation
|
Return _RightParenthesisLocation
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Protected Sub New(ByVal type As TreeType, ByVal leftParenthesisLocation As Location, ByVal operand As Expression, ByVal commaLocation As Location, ByVal target As TypeName, ByVal rightParenthesisLocation As Location, ByVal span As Span)
|
Protected Sub New(ByVal type As TreeType, ByVal leftParenthesisLocation As Location, ByVal operand As Expression, ByVal commaLocation As Location, ByVal target As TypeName, ByVal rightParenthesisLocation As Location, ByVal span As Span)
|
||||||
MyBase.New(type, operand, span)
|
MyBase.New(type, operand, span)
|
||||||
|
|
||||||
Debug.Assert(type = TreeType.CTypeExpression OrElse type = TreeType.DirectCastExpression OrElse type = TreeType.TryCastExpression)
|
Debug.Assert(type = TreeType.CTypeExpression OrElse type = TreeType.DirectCastExpression OrElse type = TreeType.TryCastExpression)
|
||||||
|
|
||||||
If target Is Nothing Then
|
If target Is Nothing Then
|
||||||
Throw New ArgumentNullException("target")
|
Throw New ArgumentNullException("target")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
SetParent(target)
|
SetParent(target)
|
||||||
|
|
||||||
_Target = target
|
_Target = target
|
||||||
_LeftParenthesisLocation = leftParenthesisLocation
|
_LeftParenthesisLocation = leftParenthesisLocation
|
||||||
_CommaLocation = commaLocation
|
_CommaLocation = commaLocation
|
||||||
_RightParenthesisLocation = rightParenthesisLocation
|
_RightParenthesisLocation = rightParenthesisLocation
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
MyBase.GetChildTrees(childList)
|
MyBase.GetChildTrees(childList)
|
||||||
AddChild(childList, Target)
|
AddChild(childList, Target)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,44 +1,44 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a character literal expression.
|
''' A parse tree for a character literal expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class CharacterLiteralExpression
|
Public NotInheritable Class CharacterLiteralExpression
|
||||||
Inherits LiteralExpression
|
Inherits LiteralExpression
|
||||||
|
|
||||||
Private ReadOnly _Literal As Char
|
Private ReadOnly _Literal As Char
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The literal value.
|
''' The literal value.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Literal() As Char
|
Public ReadOnly Property Literal() As Char
|
||||||
Get
|
Get
|
||||||
Return _Literal
|
Return _Literal
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
'LC
|
'LC
|
||||||
Public Overrides ReadOnly Property Value() As Object
|
Public Overrides ReadOnly Property Value() As Object
|
||||||
Get
|
Get
|
||||||
Return _Literal
|
Return _Literal
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for a character literal expression.
|
''' Constructs a new parse tree for a character literal expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="literal">The literal value.</param>
|
''' <param name="literal">The literal value.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal literal As Char, ByVal span As Span)
|
Public Sub New(ByVal literal As Char, ByVal span As Span)
|
||||||
MyBase.New(TreeType.CharacterLiteralExpression, span)
|
MyBase.New(TreeType.CharacterLiteralExpression, span)
|
||||||
_Literal = literal
|
_Literal = literal
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,44 +1,44 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a date literal expression.
|
''' A parse tree for a date literal expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class DateLiteralExpression
|
Public NotInheritable Class DateLiteralExpression
|
||||||
Inherits LiteralExpression
|
Inherits LiteralExpression
|
||||||
|
|
||||||
Private ReadOnly _Literal As Date
|
Private ReadOnly _Literal As Date
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The literal value.
|
''' The literal value.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Literal() As Date
|
Public ReadOnly Property Literal() As Date
|
||||||
Get
|
Get
|
||||||
Return _Literal
|
Return _Literal
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
'LC
|
'LC
|
||||||
Public Overrides ReadOnly Property Value() As Object
|
Public Overrides ReadOnly Property Value() As Object
|
||||||
Get
|
Get
|
||||||
Return _Literal
|
Return _Literal
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for a date literal.
|
''' Constructs a new parse tree for a date literal.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="literal">The literal value.</param>
|
''' <param name="literal">The literal value.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal literal As Date, ByVal span As Span)
|
Public Sub New(ByVal literal As Date, ByVal span As Span)
|
||||||
MyBase.New(TreeType.DateLiteralExpression, span)
|
MyBase.New(TreeType.DateLiteralExpression, span)
|
||||||
_Literal = literal
|
_Literal = literal
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,62 +1,62 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a decimal literal expression.
|
''' A parse tree for a decimal literal expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class DecimalLiteralExpression
|
Public NotInheritable Class DecimalLiteralExpression
|
||||||
Inherits LiteralExpression
|
Inherits LiteralExpression
|
||||||
|
|
||||||
Private ReadOnly _Literal As Decimal
|
Private ReadOnly _Literal As Decimal
|
||||||
Private ReadOnly _TypeCharacter As TypeCharacter
|
Private ReadOnly _TypeCharacter As TypeCharacter
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The literal value.
|
''' The literal value.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Literal() As Decimal
|
Public ReadOnly Property Literal() As Decimal
|
||||||
Get
|
Get
|
||||||
Return _Literal
|
Return _Literal
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
'LC
|
'LC
|
||||||
Public Overrides ReadOnly Property Value() As Object
|
Public Overrides ReadOnly Property Value() As Object
|
||||||
Get
|
Get
|
||||||
Return _Literal
|
Return _Literal
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The type character on the literal value.
|
''' The type character on the literal value.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property TypeCharacter() As TypeCharacter
|
Public ReadOnly Property TypeCharacter() As TypeCharacter
|
||||||
Get
|
Get
|
||||||
Return _TypeCharacter
|
Return _TypeCharacter
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for a floating point literal.
|
''' Constructs a new parse tree for a floating point literal.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="literal">The literal value.</param>
|
''' <param name="literal">The literal value.</param>
|
||||||
''' <param name="typeCharacter">The type character on the literal value.</param>
|
''' <param name="typeCharacter">The type character on the literal value.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal literal As Decimal, ByVal typeCharacter As TypeCharacter, ByVal span As Span)
|
Public Sub New(ByVal literal As Decimal, ByVal typeCharacter As TypeCharacter, ByVal span As Span)
|
||||||
MyBase.New(TreeType.DecimalLiteralExpression, span)
|
MyBase.New(TreeType.DecimalLiteralExpression, span)
|
||||||
|
|
||||||
If typeCharacter <> typeCharacter.None AndAlso typeCharacter <> typeCharacter.DecimalChar AndAlso _
|
If typeCharacter <> typeCharacter.None AndAlso typeCharacter <> typeCharacter.DecimalChar AndAlso _
|
||||||
typeCharacter <> typeCharacter.DecimalSymbol Then
|
typeCharacter <> typeCharacter.DecimalSymbol Then
|
||||||
Throw New ArgumentOutOfRangeException("typeCharacter")
|
Throw New ArgumentOutOfRangeException("typeCharacter")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
_Literal = literal
|
_Literal = literal
|
||||||
_TypeCharacter = typeCharacter
|
_TypeCharacter = typeCharacter
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,74 +1,74 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a dictionary lookup expression.
|
''' A parse tree for a dictionary lookup expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class DictionaryLookupExpression
|
Public NotInheritable Class DictionaryLookupExpression
|
||||||
Inherits Expression
|
Inherits Expression
|
||||||
|
|
||||||
Private ReadOnly _Qualifier As Expression
|
Private ReadOnly _Qualifier As Expression
|
||||||
Private ReadOnly _BangLocation As Location
|
Private ReadOnly _BangLocation As Location
|
||||||
Private ReadOnly _Name As SimpleName
|
Private ReadOnly _Name As SimpleName
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The dictionary expression.
|
''' The dictionary expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Qualifier() As Expression
|
Public ReadOnly Property Qualifier() As Expression
|
||||||
Get
|
Get
|
||||||
Return _Qualifier
|
Return _Qualifier
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the '!'.
|
''' The location of the '!'.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property BangLocation() As Location
|
Public ReadOnly Property BangLocation() As Location
|
||||||
Get
|
Get
|
||||||
Return _BangLocation
|
Return _BangLocation
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The name to look up.
|
''' The name to look up.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Name() As SimpleName
|
Public ReadOnly Property Name() As SimpleName
|
||||||
Get
|
Get
|
||||||
Return _Name
|
Return _Name
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for a dictionary lookup expression.
|
''' Constructs a new parse tree for a dictionary lookup expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="qualifier">The dictionary expression.</param>
|
''' <param name="qualifier">The dictionary expression.</param>
|
||||||
''' <param name="bangLocation">The location of the '!'.</param>
|
''' <param name="bangLocation">The location of the '!'.</param>
|
||||||
''' <param name="name">The name to look up..</param>
|
''' <param name="name">The name to look up..</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal qualifier As Expression, ByVal bangLocation As Location, ByVal name As SimpleName, ByVal span As Span)
|
Public Sub New(ByVal qualifier As Expression, ByVal bangLocation As Location, ByVal name As SimpleName, ByVal span As Span)
|
||||||
MyBase.New(TreeType.DictionaryLookupExpression, span)
|
MyBase.New(TreeType.DictionaryLookupExpression, span)
|
||||||
|
|
||||||
If name Is Nothing Then
|
If name Is Nothing Then
|
||||||
Throw New ArgumentNullException("name")
|
Throw New ArgumentNullException("name")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
SetParent(qualifier)
|
SetParent(qualifier)
|
||||||
SetParent(name)
|
SetParent(name)
|
||||||
|
|
||||||
_Qualifier = qualifier
|
_Qualifier = qualifier
|
||||||
_BangLocation = bangLocation
|
_BangLocation = bangLocation
|
||||||
_Name = name
|
_Name = name
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
AddChild(childList, Qualifier)
|
AddChild(childList, Qualifier)
|
||||||
AddChild(childList, Name)
|
AddChild(childList, Name)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,29 +1,29 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a DirectCast expression.
|
''' A parse tree for a DirectCast expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class DirectCastExpression
|
Public NotInheritable Class DirectCastExpression
|
||||||
Inherits CastTypeExpression
|
Inherits CastTypeExpression
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for a DirectCast expression.
|
''' Constructs a new parse tree for a DirectCast expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="leftParenthesisLocation">The location of the '('.</param>
|
''' <param name="leftParenthesisLocation">The location of the '('.</param>
|
||||||
''' <param name="operand">The expression to be converted.</param>
|
''' <param name="operand">The expression to be converted.</param>
|
||||||
''' <param name="commaLocation">The location of the ','.</param>
|
''' <param name="commaLocation">The location of the ','.</param>
|
||||||
''' <param name="target">The target type of the conversion.</param>
|
''' <param name="target">The target type of the conversion.</param>
|
||||||
''' <param name="rightParenthesisLocation">The location of the ')'.</param>
|
''' <param name="rightParenthesisLocation">The location of the ')'.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal leftParenthesisLocation As Location, ByVal operand As Expression, ByVal commaLocation As Location, ByVal target As TypeName, ByVal rightParenthesisLocation As Location, ByVal span As Span)
|
Public Sub New(ByVal leftParenthesisLocation As Location, ByVal operand As Expression, ByVal commaLocation As Location, ByVal target As TypeName, ByVal rightParenthesisLocation As Location, ByVal span As Span)
|
||||||
MyBase.New(TreeType.DirectCastExpression, leftParenthesisLocation, operand, commaLocation, target, rightParenthesisLocation, span)
|
MyBase.New(TreeType.DirectCastExpression, leftParenthesisLocation, operand, commaLocation, target, rightParenthesisLocation, span)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,50 +1,50 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for an expression.
|
''' A parse tree for an expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public Class Expression
|
Public Class Expression
|
||||||
Inherits Tree
|
Inherits Tree
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Creates a bad expression.
|
''' Creates a bad expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
''' <returns>A bad expression.</returns>
|
''' <returns>A bad expression.</returns>
|
||||||
Public Shared Function GetBadExpression(ByVal span As Span) As Expression
|
Public Shared Function GetBadExpression(ByVal span As Span) As Expression
|
||||||
Return New Expression(span)
|
Return New Expression(span)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Whether the expression is constant or not.
|
''' Whether the expression is constant or not.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public Overridable ReadOnly Property IsConstant() As Boolean
|
Public Overridable ReadOnly Property IsConstant() As Boolean
|
||||||
Get
|
Get
|
||||||
Return False
|
Return False
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Protected Sub New(ByVal type As TreeType, ByVal span As Span)
|
Protected Sub New(ByVal type As TreeType, ByVal span As Span)
|
||||||
MyBase.New(type, span)
|
MyBase.New(type, span)
|
||||||
|
|
||||||
Debug.Assert(type >= TreeType.SimpleNameExpression AndAlso type <= TreeType.GetTypeExpression)
|
Debug.Assert(type >= TreeType.SimpleNameExpression AndAlso type <= TreeType.GetTypeExpression)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub New(ByVal span As Span)
|
Private Sub New(ByVal span As Span)
|
||||||
MyBase.New(TreeType.SyntaxError, span)
|
MyBase.New(TreeType.SyntaxError, span)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Overrides ReadOnly Property IsBad() As Boolean
|
Public Overrides ReadOnly Property IsBad() As Boolean
|
||||||
Get
|
Get
|
||||||
Return Type = TreeType.SyntaxError
|
Return Type = TreeType.SyntaxError
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
End Class
|
End Class
|
|
@ -1,31 +1,31 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A read-only collection of expressions.
|
''' A read-only collection of expressions.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class ExpressionCollection
|
Public NotInheritable Class ExpressionCollection
|
||||||
Inherits CommaDelimitedTreeCollection(Of Expression)
|
Inherits CommaDelimitedTreeCollection(Of Expression)
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new collection of expressions.
|
''' Constructs a new collection of expressions.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="expressions">The expressions in the collection.</param>
|
''' <param name="expressions">The expressions in the collection.</param>
|
||||||
''' <param name="commaLocations">The locations of the commas in the collection.</param>
|
''' <param name="commaLocations">The locations of the commas in the collection.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal expressions As IList(Of Expression), ByVal commaLocations As IList(Of Location), ByVal span As Span)
|
Public Sub New(ByVal expressions As IList(Of Expression), ByVal commaLocations As IList(Of Location), ByVal span As Span)
|
||||||
MyBase.New(TreeType.ExpressionCollection, expressions, commaLocations, span)
|
MyBase.New(TreeType.ExpressionCollection, expressions, commaLocations, span)
|
||||||
|
|
||||||
If (expressions Is Nothing OrElse expressions.Count = 0) AndAlso _
|
If (expressions Is Nothing OrElse expressions.Count = 0) AndAlso _
|
||||||
(commaLocations Is Nothing OrElse commaLocations.Count = 0) Then
|
(commaLocations Is Nothing OrElse commaLocations.Count = 0) Then
|
||||||
Throw New ArgumentException("ExpressionCollection cannot be empty.")
|
Throw New ArgumentException("ExpressionCollection cannot be empty.")
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,63 +1,63 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a floating point literal.
|
''' A parse tree for a floating point literal.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class FloatingPointLiteralExpression
|
Public NotInheritable Class FloatingPointLiteralExpression
|
||||||
Inherits LiteralExpression
|
Inherits LiteralExpression
|
||||||
|
|
||||||
Private ReadOnly _Literal As Double
|
Private ReadOnly _Literal As Double
|
||||||
Private ReadOnly _TypeCharacter As TypeCharacter
|
Private ReadOnly _TypeCharacter As TypeCharacter
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The literal value.
|
''' The literal value.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Literal() As Double
|
Public ReadOnly Property Literal() As Double
|
||||||
Get
|
Get
|
||||||
Return _Literal
|
Return _Literal
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
'LC
|
'LC
|
||||||
Public Overrides ReadOnly Property Value() As Object
|
Public Overrides ReadOnly Property Value() As Object
|
||||||
Get
|
Get
|
||||||
Return _Literal
|
Return _Literal
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The type character on the literal value.
|
''' The type character on the literal value.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property TypeCharacter() As TypeCharacter
|
Public ReadOnly Property TypeCharacter() As TypeCharacter
|
||||||
Get
|
Get
|
||||||
Return _TypeCharacter
|
Return _TypeCharacter
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for a floating point literal.
|
''' Constructs a new parse tree for a floating point literal.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="literal">The literal value.</param>
|
''' <param name="literal">The literal value.</param>
|
||||||
''' <param name="typeCharacter">The type character on the literal.</param>
|
''' <param name="typeCharacter">The type character on the literal.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal literal As Double, ByVal typeCharacter As TypeCharacter, ByVal span As Span)
|
Public Sub New(ByVal literal As Double, ByVal typeCharacter As TypeCharacter, ByVal span As Span)
|
||||||
MyBase.New(TreeType.FloatingPointLiteralExpression, span)
|
MyBase.New(TreeType.FloatingPointLiteralExpression, span)
|
||||||
|
|
||||||
If typeCharacter <> typeCharacter.None AndAlso _
|
If typeCharacter <> typeCharacter.None AndAlso _
|
||||||
typeCharacter <> typeCharacter.SingleSymbol AndAlso typeCharacter <> typeCharacter.SingleChar AndAlso _
|
typeCharacter <> typeCharacter.SingleSymbol AndAlso typeCharacter <> typeCharacter.SingleChar AndAlso _
|
||||||
typeCharacter <> typeCharacter.DoubleSymbol AndAlso typeCharacter <> typeCharacter.DoubleChar Then
|
typeCharacter <> typeCharacter.DoubleSymbol AndAlso typeCharacter <> typeCharacter.DoubleChar Then
|
||||||
Throw New ArgumentOutOfRangeException("typeCharacter")
|
Throw New ArgumentOutOfRangeException("typeCharacter")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
_Literal = literal
|
_Literal = literal
|
||||||
_TypeCharacter = typeCharacter
|
_TypeCharacter = typeCharacter
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,66 +1,66 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a qualified name expression.
|
''' A parse tree for a qualified name expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class GenericQualifiedExpression
|
Public NotInheritable Class GenericQualifiedExpression
|
||||||
Inherits Expression
|
Inherits Expression
|
||||||
|
|
||||||
Private ReadOnly _Base As Expression
|
Private ReadOnly _Base As Expression
|
||||||
Private ReadOnly _TypeArguments As TypeArgumentCollection
|
Private ReadOnly _TypeArguments As TypeArgumentCollection
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The base expression.
|
''' The base expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Base() As Expression
|
Public ReadOnly Property Base() As Expression
|
||||||
Get
|
Get
|
||||||
Return _Base
|
Return _Base
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The qualifying type arguments.
|
''' The qualifying type arguments.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property TypeArguments() As TypeArgumentCollection
|
Public ReadOnly Property TypeArguments() As TypeArgumentCollection
|
||||||
Get
|
Get
|
||||||
Return _TypeArguments
|
Return _TypeArguments
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for a generic qualified expression.
|
''' Constructs a new parse tree for a generic qualified expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="base">The base expression.</param>
|
''' <param name="base">The base expression.</param>
|
||||||
''' <param name="typeArguments">The qualifying type arguments.</param>
|
''' <param name="typeArguments">The qualifying type arguments.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal base As Expression, ByVal typeArguments As TypeArgumentCollection, ByVal span As Span)
|
Public Sub New(ByVal base As Expression, ByVal typeArguments As TypeArgumentCollection, ByVal span As Span)
|
||||||
MyBase.New(TreeType.GenericQualifiedExpression, span)
|
MyBase.New(TreeType.GenericQualifiedExpression, span)
|
||||||
|
|
||||||
If base Is Nothing Then
|
If base Is Nothing Then
|
||||||
Throw New ArgumentNullException("base")
|
Throw New ArgumentNullException("base")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If typeArguments Is Nothing Then
|
If typeArguments Is Nothing Then
|
||||||
Throw New ArgumentNullException("typeArguments")
|
Throw New ArgumentNullException("typeArguments")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
SetParent(base)
|
SetParent(base)
|
||||||
SetParent(typeArguments)
|
SetParent(typeArguments)
|
||||||
|
|
||||||
_Base = base
|
_Base = base
|
||||||
_TypeArguments = typeArguments
|
_TypeArguments = typeArguments
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
AddChild(childList, Base)
|
AddChild(childList, Base)
|
||||||
AddChild(childList, TypeArguments)
|
AddChild(childList, TypeArguments)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,72 +1,72 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a GetType expression.
|
''' A parse tree for a GetType expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class GetTypeExpression
|
Public NotInheritable Class GetTypeExpression
|
||||||
Inherits Expression
|
Inherits Expression
|
||||||
|
|
||||||
Private ReadOnly _LeftParenthesisLocation As Location
|
Private ReadOnly _LeftParenthesisLocation As Location
|
||||||
Private ReadOnly _Target As TypeName
|
Private ReadOnly _Target As TypeName
|
||||||
Private ReadOnly _RightParenthesisLocation As Location
|
Private ReadOnly _RightParenthesisLocation As Location
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the '('.
|
''' The location of the '('.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property LeftParenthesisLocation() As Location
|
Public ReadOnly Property LeftParenthesisLocation() As Location
|
||||||
Get
|
Get
|
||||||
Return _LeftParenthesisLocation
|
Return _LeftParenthesisLocation
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The target type of the GetType expression.
|
''' The target type of the GetType expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Target() As TypeName
|
Public ReadOnly Property Target() As TypeName
|
||||||
Get
|
Get
|
||||||
Return _Target
|
Return _Target
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the ')'.
|
''' The location of the ')'.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property RightParenthesisLocation() As Location
|
Public ReadOnly Property RightParenthesisLocation() As Location
|
||||||
Get
|
Get
|
||||||
Return _RightParenthesisLocation
|
Return _RightParenthesisLocation
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for a GetType expression.
|
''' Constructs a new parse tree for a GetType expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="leftParenthesisLocation">The location of the '('.</param>
|
''' <param name="leftParenthesisLocation">The location of the '('.</param>
|
||||||
''' <param name="target">The target type of the GetType expression.</param>
|
''' <param name="target">The target type of the GetType expression.</param>
|
||||||
''' <param name="rightParenthesisLocation">The location of the ')'.</param>
|
''' <param name="rightParenthesisLocation">The location of the ')'.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal leftParenthesisLocation As Location, ByVal target As TypeName, ByVal rightParenthesisLocation As Location, ByVal span As Span)
|
Public Sub New(ByVal leftParenthesisLocation As Location, ByVal target As TypeName, ByVal rightParenthesisLocation As Location, ByVal span As Span)
|
||||||
MyBase.New(TreeType.GetTypeExpression, span)
|
MyBase.New(TreeType.GetTypeExpression, span)
|
||||||
|
|
||||||
If target Is Nothing Then
|
If target Is Nothing Then
|
||||||
Throw New ArgumentNullException("target")
|
Throw New ArgumentNullException("target")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
SetParent(target)
|
SetParent(target)
|
||||||
|
|
||||||
_LeftParenthesisLocation = leftParenthesisLocation
|
_LeftParenthesisLocation = leftParenthesisLocation
|
||||||
_Target = target
|
_Target = target
|
||||||
_RightParenthesisLocation = rightParenthesisLocation
|
_RightParenthesisLocation = rightParenthesisLocation
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
AddChild(childList, Target)
|
AddChild(childList, Target)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,24 +1,24 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for Nothing.
|
''' A parse tree for Nothing.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class GlobalExpression
|
Public NotInheritable Class GlobalExpression
|
||||||
Inherits Expression
|
Inherits Expression
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for Global.
|
''' Constructs a new parse tree for Global.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal span As Span)
|
Public Sub New(ByVal span As Span)
|
||||||
MyBase.New(TreeType.GlobalExpression, span)
|
MyBase.New(TreeType.GlobalExpression, span)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,42 +1,42 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for Me, MyBase or MyClass.
|
''' A parse tree for Me, MyBase or MyClass.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class InstanceExpression
|
Public NotInheritable Class InstanceExpression
|
||||||
Inherits Expression
|
Inherits Expression
|
||||||
|
|
||||||
Private _InstanceType As InstanceType
|
Private _InstanceType As InstanceType
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The type of the instance expression.
|
''' The type of the instance expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property InstanceType() As InstanceType
|
Public ReadOnly Property InstanceType() As InstanceType
|
||||||
Get
|
Get
|
||||||
Return _InstanceType
|
Return _InstanceType
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for My, MyBase or MyClass.
|
''' Constructs a new parse tree for My, MyBase or MyClass.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="instanceType">The type of the instance expression.</param>
|
''' <param name="instanceType">The type of the instance expression.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal instanceType As InstanceType, ByVal span As Span)
|
Public Sub New(ByVal instanceType As InstanceType, ByVal span As Span)
|
||||||
MyBase.New(TreeType.InstanceExpression, span)
|
MyBase.New(TreeType.InstanceExpression, span)
|
||||||
|
|
||||||
If instanceType < instanceType.Me OrElse instanceType > instanceType.MyBase Then
|
If instanceType < instanceType.Me OrElse instanceType > instanceType.MyBase Then
|
||||||
Throw New ArgumentOutOfRangeException("instanceType")
|
Throw New ArgumentOutOfRangeException("instanceType")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
_InstanceType = instanceType
|
_InstanceType = instanceType
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,18 +1,18 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The type of an instance expression.
|
''' The type of an instance expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public Enum InstanceType
|
Public Enum InstanceType
|
||||||
[Me]
|
[Me]
|
||||||
[MyClass]
|
[MyClass]
|
||||||
[MyBase]
|
[MyBase]
|
||||||
End Enum
|
End Enum
|
||||||
|
|
|
@ -1,80 +1,80 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for an integer literal.
|
''' A parse tree for an integer literal.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class IntegerLiteralExpression
|
Public NotInheritable Class IntegerLiteralExpression
|
||||||
Inherits LiteralExpression
|
Inherits LiteralExpression
|
||||||
|
|
||||||
Private ReadOnly _Literal As Integer
|
Private ReadOnly _Literal As Integer
|
||||||
Private ReadOnly _TypeCharacter As TypeCharacter
|
Private ReadOnly _TypeCharacter As TypeCharacter
|
||||||
Private ReadOnly _IntegerBase As IntegerBase
|
Private ReadOnly _IntegerBase As IntegerBase
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The literal value.
|
''' The literal value.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Literal() As Integer
|
Public ReadOnly Property Literal() As Integer
|
||||||
Get
|
Get
|
||||||
Return _Literal
|
Return _Literal
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
'LC
|
'LC
|
||||||
Public Overrides ReadOnly Property Value() As Object
|
Public Overrides ReadOnly Property Value() As Object
|
||||||
Get
|
Get
|
||||||
Return _Literal
|
Return _Literal
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The type character on the literal.
|
''' The type character on the literal.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property TypeCharacter() As TypeCharacter
|
Public ReadOnly Property TypeCharacter() As TypeCharacter
|
||||||
Get
|
Get
|
||||||
Return _TypeCharacter
|
Return _TypeCharacter
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The integer base of the literal.
|
''' The integer base of the literal.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property IntegerBase() As IntegerBase
|
Public ReadOnly Property IntegerBase() As IntegerBase
|
||||||
Get
|
Get
|
||||||
Return _IntegerBase
|
Return _IntegerBase
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for an integer literal.
|
''' Constructs a new parse tree for an integer literal.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="literal">The literal value.</param>
|
''' <param name="literal">The literal value.</param>
|
||||||
''' <param name="integerBase">The integer base of the literal.</param>
|
''' <param name="integerBase">The integer base of the literal.</param>
|
||||||
''' <param name="typeCharacter">The type character on the literal.</param>
|
''' <param name="typeCharacter">The type character on the literal.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal literal As Integer, ByVal integerBase As IntegerBase, ByVal typeCharacter As TypeCharacter, ByVal span As Span)
|
Public Sub New(ByVal literal As Integer, ByVal integerBase As IntegerBase, ByVal typeCharacter As TypeCharacter, ByVal span As Span)
|
||||||
MyBase.New(TreeType.IntegerLiteralExpression, span)
|
MyBase.New(TreeType.IntegerLiteralExpression, span)
|
||||||
|
|
||||||
If integerBase < integerBase.Decimal OrElse integerBase > integerBase.Hexadecimal Then
|
If integerBase < integerBase.Decimal OrElse integerBase > integerBase.Hexadecimal Then
|
||||||
Throw New ArgumentOutOfRangeException("integerBase")
|
Throw New ArgumentOutOfRangeException("integerBase")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If typeCharacter <> typeCharacter.None AndAlso _
|
If typeCharacter <> typeCharacter.None AndAlso _
|
||||||
typeCharacter <> typeCharacter.IntegerSymbol AndAlso typeCharacter <> typeCharacter.IntegerChar AndAlso _
|
typeCharacter <> typeCharacter.IntegerSymbol AndAlso typeCharacter <> typeCharacter.IntegerChar AndAlso _
|
||||||
typeCharacter <> typeCharacter.ShortChar AndAlso _
|
typeCharacter <> typeCharacter.ShortChar AndAlso _
|
||||||
typeCharacter <> typeCharacter.LongSymbol AndAlso typeCharacter <> typeCharacter.LongChar Then
|
typeCharacter <> typeCharacter.LongSymbol AndAlso typeCharacter <> typeCharacter.LongChar Then
|
||||||
Throw New ArgumentOutOfRangeException("typeCharacter")
|
Throw New ArgumentOutOfRangeException("typeCharacter")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
_Literal = literal
|
_Literal = literal
|
||||||
_IntegerBase = integerBase
|
_IntegerBase = integerBase
|
||||||
_TypeCharacter = typeCharacter
|
_TypeCharacter = typeCharacter
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,71 +1,71 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for an intrinsic conversion expression.
|
''' A parse tree for an intrinsic conversion expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class IntrinsicCastExpression
|
Public NotInheritable Class IntrinsicCastExpression
|
||||||
Inherits UnaryExpression
|
Inherits UnaryExpression
|
||||||
|
|
||||||
Private ReadOnly _IntrinsicType As IntrinsicType
|
Private ReadOnly _IntrinsicType As IntrinsicType
|
||||||
Private ReadOnly _LeftParenthesisLocation As Location
|
Private ReadOnly _LeftParenthesisLocation As Location
|
||||||
Private ReadOnly _RightParenthesisLocation As Location
|
Private ReadOnly _RightParenthesisLocation As Location
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The intrinsic type conversion.
|
''' The intrinsic type conversion.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property IntrinsicType() As IntrinsicType
|
Public ReadOnly Property IntrinsicType() As IntrinsicType
|
||||||
Get
|
Get
|
||||||
Return _IntrinsicType
|
Return _IntrinsicType
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the '('.
|
''' The location of the '('.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property LeftParenthesisLocation() As Location
|
Public ReadOnly Property LeftParenthesisLocation() As Location
|
||||||
Get
|
Get
|
||||||
Return _LeftParenthesisLocation
|
Return _LeftParenthesisLocation
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the ')'.
|
''' The location of the ')'.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property RightParenthesisLocation() As Location
|
Public ReadOnly Property RightParenthesisLocation() As Location
|
||||||
Get
|
Get
|
||||||
Return _RightParenthesisLocation
|
Return _RightParenthesisLocation
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for an intrinsic conversion expression.
|
''' Constructs a new parse tree for an intrinsic conversion expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="intrinsicType">The intrinsic type conversion.</param>
|
''' <param name="intrinsicType">The intrinsic type conversion.</param>
|
||||||
''' <param name="leftParenthesisLocation">The location of the '('.</param>
|
''' <param name="leftParenthesisLocation">The location of the '('.</param>
|
||||||
''' <param name="operand">The expression to convert.</param>
|
''' <param name="operand">The expression to convert.</param>
|
||||||
''' <param name="rightParenthesisLocation">The location of the ')'.</param>
|
''' <param name="rightParenthesisLocation">The location of the ')'.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal intrinsicType As IntrinsicType, ByVal leftParenthesisLocation As Location, ByVal operand As Expression, ByVal rightParenthesisLocation As Location, ByVal span As Span)
|
Public Sub New(ByVal intrinsicType As IntrinsicType, ByVal leftParenthesisLocation As Location, ByVal operand As Expression, ByVal rightParenthesisLocation As Location, ByVal span As Span)
|
||||||
MyBase.New(TreeType.IntrinsicCastExpression, operand, span)
|
MyBase.New(TreeType.IntrinsicCastExpression, operand, span)
|
||||||
|
|
||||||
If intrinsicType < intrinsicType.Boolean OrElse intrinsicType > intrinsicType.Object Then
|
If intrinsicType < intrinsicType.Boolean OrElse intrinsicType > intrinsicType.Object Then
|
||||||
Throw New ArgumentOutOfRangeException("intrinsicType")
|
Throw New ArgumentOutOfRangeException("intrinsicType")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If operand Is Nothing Then
|
If operand Is Nothing Then
|
||||||
Throw New ArgumentNullException("operand")
|
Throw New ArgumentNullException("operand")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
_IntrinsicType = intrinsicType
|
_IntrinsicType = intrinsicType
|
||||||
_LeftParenthesisLocation = leftParenthesisLocation
|
_LeftParenthesisLocation = leftParenthesisLocation
|
||||||
_RightParenthesisLocation = rightParenthesisLocation
|
_RightParenthesisLocation = rightParenthesisLocation
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,31 +1,31 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a literal expression.
|
''' A parse tree for a literal expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public MustInherit Class LiteralExpression
|
Public MustInherit Class LiteralExpression
|
||||||
Inherits Expression
|
Inherits Expression
|
||||||
|
|
||||||
Public NotOverridable Overrides ReadOnly Property IsConstant() As Boolean
|
Public NotOverridable Overrides ReadOnly Property IsConstant() As Boolean
|
||||||
Get
|
Get
|
||||||
Return True
|
Return True
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
'LC add property to get value
|
'LC add property to get value
|
||||||
Public MustOverride ReadOnly Property Value() As Object
|
Public MustOverride ReadOnly Property Value() As Object
|
||||||
|
|
||||||
Protected Sub New(ByVal type As TreeType, ByVal span As Span)
|
Protected Sub New(ByVal type As TreeType, ByVal span As Span)
|
||||||
MyBase.New(type, span)
|
MyBase.New(type, span)
|
||||||
|
|
||||||
Debug.Assert(type >= TreeType.StringLiteralExpression AndAlso type <= TreeType.BooleanLiteralExpression)
|
Debug.Assert(type >= TreeType.StringLiteralExpression AndAlso type <= TreeType.BooleanLiteralExpression)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,66 +1,66 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a New array expression.
|
''' A parse tree for a New array expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class NewAggregateExpression
|
Public NotInheritable Class NewAggregateExpression
|
||||||
Inherits Expression
|
Inherits Expression
|
||||||
|
|
||||||
Private ReadOnly _Target As ArrayTypeName
|
Private ReadOnly _Target As ArrayTypeName
|
||||||
Private ReadOnly _Initializer As AggregateInitializer
|
Private ReadOnly _Initializer As AggregateInitializer
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The target array type to create.
|
''' The target array type to create.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Target() As ArrayTypeName
|
Public ReadOnly Property Target() As ArrayTypeName
|
||||||
Get
|
Get
|
||||||
Return _Target
|
Return _Target
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The initializer for the array.
|
''' The initializer for the array.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Initializer() As AggregateInitializer
|
Public ReadOnly Property Initializer() As AggregateInitializer
|
||||||
Get
|
Get
|
||||||
Return _Initializer
|
Return _Initializer
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The constructor for a New array expression parse tree.
|
''' The constructor for a New array expression parse tree.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="target">The target array type to create.</param>
|
''' <param name="target">The target array type to create.</param>
|
||||||
''' <param name="initializer">The initializer for the array.</param>
|
''' <param name="initializer">The initializer for the array.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal target As ArrayTypeName, ByVal initializer As AggregateInitializer, ByVal span As Span)
|
Public Sub New(ByVal target As ArrayTypeName, ByVal initializer As AggregateInitializer, ByVal span As Span)
|
||||||
MyBase.New(TreeType.NewAggregateExpression, span)
|
MyBase.New(TreeType.NewAggregateExpression, span)
|
||||||
|
|
||||||
If target Is Nothing Then
|
If target Is Nothing Then
|
||||||
Throw New ArgumentNullException("target")
|
Throw New ArgumentNullException("target")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If initializer Is Nothing Then
|
If initializer Is Nothing Then
|
||||||
Throw New ArgumentNullException("initializer")
|
Throw New ArgumentNullException("initializer")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
SetParent(target)
|
SetParent(target)
|
||||||
SetParent(initializer)
|
SetParent(initializer)
|
||||||
|
|
||||||
_Target = target
|
_Target = target
|
||||||
_Initializer = initializer
|
_Initializer = initializer
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
AddChild(childList, Target)
|
AddChild(childList, Target)
|
||||||
AddChild(childList, Initializer)
|
AddChild(childList, Initializer)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,62 +1,62 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a New expression.
|
''' A parse tree for a New expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class NewExpression
|
Public NotInheritable Class NewExpression
|
||||||
Inherits Expression
|
Inherits Expression
|
||||||
|
|
||||||
Private ReadOnly _Target As TypeName
|
Private ReadOnly _Target As TypeName
|
||||||
Private ReadOnly _Arguments As ArgumentCollection
|
Private ReadOnly _Arguments As ArgumentCollection
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The target type to create.
|
''' The target type to create.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Target() As TypeName
|
Public ReadOnly Property Target() As TypeName
|
||||||
Get
|
Get
|
||||||
Return _Target
|
Return _Target
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The arguments to the constructor.
|
''' The arguments to the constructor.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Arguments() As ArgumentCollection
|
Public ReadOnly Property Arguments() As ArgumentCollection
|
||||||
Get
|
Get
|
||||||
Return _Arguments
|
Return _Arguments
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for a New expression.
|
''' Constructs a new parse tree for a New expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="target">The target type to create.</param>
|
''' <param name="target">The target type to create.</param>
|
||||||
''' <param name="arguments">The arguments to the constructor.</param>
|
''' <param name="arguments">The arguments to the constructor.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal target As TypeName, ByVal arguments As ArgumentCollection, ByVal span As Span)
|
Public Sub New(ByVal target As TypeName, ByVal arguments As ArgumentCollection, ByVal span As Span)
|
||||||
MyBase.New(TreeType.NewExpression, span)
|
MyBase.New(TreeType.NewExpression, span)
|
||||||
|
|
||||||
If target Is Nothing Then
|
If target Is Nothing Then
|
||||||
Throw New ArgumentNullException("target")
|
Throw New ArgumentNullException("target")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
SetParent(target)
|
SetParent(target)
|
||||||
SetParent(arguments)
|
SetParent(arguments)
|
||||||
|
|
||||||
_Target = target
|
_Target = target
|
||||||
_Arguments = arguments
|
_Arguments = arguments
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
AddChild(childList, Target)
|
AddChild(childList, Target)
|
||||||
AddChild(childList, Arguments)
|
AddChild(childList, Arguments)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,30 +1,30 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for Nothing.
|
''' A parse tree for Nothing.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class NothingExpression
|
Public NotInheritable Class NothingExpression
|
||||||
Inherits Expression
|
Inherits Expression
|
||||||
|
|
||||||
Public Overrides ReadOnly Property IsConstant() As Boolean
|
Public Overrides ReadOnly Property IsConstant() As Boolean
|
||||||
Get
|
Get
|
||||||
Return True
|
Return True
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for Nothing.
|
''' Constructs a new parse tree for Nothing.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal span As Span)
|
Public Sub New(ByVal span As Span)
|
||||||
MyBase.New(TreeType.NothingExpression, span)
|
MyBase.New(TreeType.NothingExpression, span)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,48 +1,48 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The type of a unary operator expression.
|
''' The type of a unary operator expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public Enum OperatorType
|
Public Enum OperatorType
|
||||||
None
|
None
|
||||||
|
|
||||||
' Unary operators
|
' Unary operators
|
||||||
UnaryPlus
|
UnaryPlus
|
||||||
Negate
|
Negate
|
||||||
[Not]
|
[Not]
|
||||||
|
|
||||||
' Binary operators
|
' Binary operators
|
||||||
Plus
|
Plus
|
||||||
Minus
|
Minus
|
||||||
Multiply
|
Multiply
|
||||||
Divide
|
Divide
|
||||||
IntegralDivide
|
IntegralDivide
|
||||||
Concatenate
|
Concatenate
|
||||||
ShiftLeft
|
ShiftLeft
|
||||||
ShiftRight
|
ShiftRight
|
||||||
Power
|
Power
|
||||||
Modulus
|
Modulus
|
||||||
[Or]
|
[Or]
|
||||||
[OrElse]
|
[OrElse]
|
||||||
[And]
|
[And]
|
||||||
[AndAlso]
|
[AndAlso]
|
||||||
[Xor]
|
[Xor]
|
||||||
[Like]
|
[Like]
|
||||||
[Is]
|
[Is]
|
||||||
[IsNot]
|
[IsNot]
|
||||||
[To]
|
[To]
|
||||||
Equals
|
Equals
|
||||||
NotEquals
|
NotEquals
|
||||||
LessThan
|
LessThan
|
||||||
LessThanEquals
|
LessThanEquals
|
||||||
GreaterThan
|
GreaterThan
|
||||||
GreaterThanEquals
|
GreaterThanEquals
|
||||||
End Enum
|
End Enum
|
||||||
|
|
|
@ -1,39 +1,39 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a parenthesized expression.
|
''' A parse tree for a parenthesized expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class ParentheticalExpression
|
Public NotInheritable Class ParentheticalExpression
|
||||||
Inherits UnaryExpression
|
Inherits UnaryExpression
|
||||||
|
|
||||||
Private ReadOnly _RightParenthesisLocation As Location
|
Private ReadOnly _RightParenthesisLocation As Location
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the ')'.
|
''' The location of the ')'.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property RightParenthesisLocation() As Location
|
Public ReadOnly Property RightParenthesisLocation() As Location
|
||||||
Get
|
Get
|
||||||
Return _RightParenthesisLocation
|
Return _RightParenthesisLocation
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parenthesized expression parse tree.
|
''' Constructs a new parenthesized expression parse tree.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="operand">The operand of the expression.</param>
|
''' <param name="operand">The operand of the expression.</param>
|
||||||
''' <param name="rightParenthesisLocation">The location of the ')'.</param>
|
''' <param name="rightParenthesisLocation">The location of the ')'.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal operand As Expression, ByVal rightParenthesisLocation As Location, ByVal span As Span)
|
Public Sub New(ByVal operand As Expression, ByVal rightParenthesisLocation As Location, ByVal span As Span)
|
||||||
MyBase.New(TreeType.ParentheticalExpression, operand, span)
|
MyBase.New(TreeType.ParentheticalExpression, operand, span)
|
||||||
|
|
||||||
_RightParenthesisLocation = rightParenthesisLocation
|
_RightParenthesisLocation = rightParenthesisLocation
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,74 +1,74 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a qualified name expression.
|
''' A parse tree for a qualified name expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class QualifiedExpression
|
Public NotInheritable Class QualifiedExpression
|
||||||
Inherits Expression
|
Inherits Expression
|
||||||
|
|
||||||
Private ReadOnly _Qualifier As Expression
|
Private ReadOnly _Qualifier As Expression
|
||||||
Private ReadOnly _DotLocation As Location
|
Private ReadOnly _DotLocation As Location
|
||||||
Private ReadOnly _Name As SimpleName
|
Private ReadOnly _Name As SimpleName
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The expression qualifying the name.
|
''' The expression qualifying the name.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Qualifier() As Expression
|
Public ReadOnly Property Qualifier() As Expression
|
||||||
Get
|
Get
|
||||||
Return _Qualifier
|
Return _Qualifier
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the '.'.
|
''' The location of the '.'.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property DotLocation() As Location
|
Public ReadOnly Property DotLocation() As Location
|
||||||
Get
|
Get
|
||||||
Return _DotLocation
|
Return _DotLocation
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The qualified name.
|
''' The qualified name.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Name() As SimpleName
|
Public ReadOnly Property Name() As SimpleName
|
||||||
Get
|
Get
|
||||||
Return _Name
|
Return _Name
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for a qualified name expression.
|
''' Constructs a new parse tree for a qualified name expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="qualifier">The expression qualifying the name.</param>
|
''' <param name="qualifier">The expression qualifying the name.</param>
|
||||||
''' <param name="dotLocation">The location of the '.'.</param>
|
''' <param name="dotLocation">The location of the '.'.</param>
|
||||||
''' <param name="name">The qualified name.</param>
|
''' <param name="name">The qualified name.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal qualifier As Expression, ByVal dotLocation As Location, ByVal name As SimpleName, ByVal span As Span)
|
Public Sub New(ByVal qualifier As Expression, ByVal dotLocation As Location, ByVal name As SimpleName, ByVal span As Span)
|
||||||
MyBase.New(TreeType.QualifiedExpression, span)
|
MyBase.New(TreeType.QualifiedExpression, span)
|
||||||
|
|
||||||
If name Is Nothing Then
|
If name Is Nothing Then
|
||||||
Throw New ArgumentNullException("name")
|
Throw New ArgumentNullException("name")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
SetParent(qualifier)
|
SetParent(qualifier)
|
||||||
SetParent(name)
|
SetParent(name)
|
||||||
|
|
||||||
_Qualifier = qualifier
|
_Qualifier = qualifier
|
||||||
_DotLocation = dotLocation
|
_DotLocation = dotLocation
|
||||||
_Name = name
|
_Name = name
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
AddChild(childList, Qualifier)
|
AddChild(childList, Qualifier)
|
||||||
AddChild(childList, Name)
|
AddChild(childList, Name)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,48 +1,48 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a simple name expression.
|
''' A parse tree for a simple name expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class SimpleNameExpression
|
Public NotInheritable Class SimpleNameExpression
|
||||||
Inherits Expression
|
Inherits Expression
|
||||||
|
|
||||||
Private ReadOnly _Name As SimpleName
|
Private ReadOnly _Name As SimpleName
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The name.
|
''' The name.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Name() As SimpleName
|
Public ReadOnly Property Name() As SimpleName
|
||||||
Get
|
Get
|
||||||
Return _Name
|
Return _Name
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for a simple name expression.
|
''' Constructs a new parse tree for a simple name expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="name">The name.</param>
|
''' <param name="name">The name.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal name As SimpleName, ByVal span As Span)
|
Public Sub New(ByVal name As SimpleName, ByVal span As Span)
|
||||||
MyBase.New(TreeType.SimpleNameExpression, span)
|
MyBase.New(TreeType.SimpleNameExpression, span)
|
||||||
|
|
||||||
If name Is Nothing Then
|
If name Is Nothing Then
|
||||||
Throw New ArgumentNullException("name")
|
Throw New ArgumentNullException("name")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
SetParent(name)
|
SetParent(name)
|
||||||
|
|
||||||
_Name = name
|
_Name = name
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
AddChild(childList, Name)
|
AddChild(childList, Name)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,49 +1,49 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a string literal expression.
|
''' A parse tree for a string literal expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class StringLiteralExpression
|
Public NotInheritable Class StringLiteralExpression
|
||||||
Inherits LiteralExpression
|
Inherits LiteralExpression
|
||||||
|
|
||||||
Private ReadOnly _Literal As String
|
Private ReadOnly _Literal As String
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The literal value.
|
''' The literal value.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Literal() As String
|
Public ReadOnly Property Literal() As String
|
||||||
Get
|
Get
|
||||||
Return _Literal
|
Return _Literal
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
'LC
|
'LC
|
||||||
Public Overrides ReadOnly Property Value() As Object
|
Public Overrides ReadOnly Property Value() As Object
|
||||||
Get
|
Get
|
||||||
Return _Literal
|
Return _Literal
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new string literal expression parse tree.
|
''' Constructs a new string literal expression parse tree.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="literal">The literal value.</param>
|
''' <param name="literal">The literal value.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal literal As String, ByVal span As Span)
|
Public Sub New(ByVal literal As String, ByVal span As Span)
|
||||||
MyBase.New(TreeType.StringLiteralExpression, span)
|
MyBase.New(TreeType.StringLiteralExpression, span)
|
||||||
|
|
||||||
If literal Is Nothing Then
|
If literal Is Nothing Then
|
||||||
Throw New ArgumentNullException("literal")
|
Throw New ArgumentNullException("literal")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
_Literal = literal
|
_Literal = literal
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,29 +1,29 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a CType expression.
|
''' A parse tree for a CType expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class TryCastExpression
|
Public NotInheritable Class TryCastExpression
|
||||||
Inherits CastTypeExpression
|
Inherits CastTypeExpression
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for a TryCast expression.
|
''' Constructs a new parse tree for a TryCast expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="leftParenthesisLocation">The location of the '('.</param>
|
''' <param name="leftParenthesisLocation">The location of the '('.</param>
|
||||||
''' <param name="operand">The expression to be converted.</param>
|
''' <param name="operand">The expression to be converted.</param>
|
||||||
''' <param name="commaLocation">The location of the ','.</param>
|
''' <param name="commaLocation">The location of the ','.</param>
|
||||||
''' <param name="target">The target type of the conversion.</param>
|
''' <param name="target">The target type of the conversion.</param>
|
||||||
''' <param name="rightParenthesisLocation">The location of the ')'.</param>
|
''' <param name="rightParenthesisLocation">The location of the ')'.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal leftParenthesisLocation As Location, ByVal operand As Expression, ByVal commaLocation As Location, ByVal target As TypeName, ByVal rightParenthesisLocation As Location, ByVal span As Span)
|
Public Sub New(ByVal leftParenthesisLocation As Location, ByVal operand As Expression, ByVal commaLocation As Location, ByVal target As TypeName, ByVal rightParenthesisLocation As Location, ByVal span As Span)
|
||||||
MyBase.New(TreeType.TryCastExpression, leftParenthesisLocation, operand, commaLocation, target, rightParenthesisLocation, span)
|
MyBase.New(TreeType.TryCastExpression, leftParenthesisLocation, operand, commaLocation, target, rightParenthesisLocation, span)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,62 +1,62 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a TypeOf ... Is expression.
|
''' A parse tree for a TypeOf ... Is expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class TypeOfExpression
|
Public NotInheritable Class TypeOfExpression
|
||||||
Inherits UnaryExpression
|
Inherits UnaryExpression
|
||||||
|
|
||||||
Private ReadOnly _IsLocation As Location
|
Private ReadOnly _IsLocation As Location
|
||||||
Private ReadOnly _Target As TypeName
|
Private ReadOnly _Target As TypeName
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the 'Is'.
|
''' The location of the 'Is'.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property IsLocation() As Location
|
Public ReadOnly Property IsLocation() As Location
|
||||||
Get
|
Get
|
||||||
Return _IsLocation
|
Return _IsLocation
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The target type for the operand.
|
''' The target type for the operand.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Target() As TypeName
|
Public ReadOnly Property Target() As TypeName
|
||||||
Get
|
Get
|
||||||
Return _Target
|
Return _Target
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for a TypeOf ... Is expression.
|
''' Constructs a new parse tree for a TypeOf ... Is expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="operand">The target value.</param>
|
''' <param name="operand">The target value.</param>
|
||||||
''' <param name="isLocation">The location of the 'Is'.</param>
|
''' <param name="isLocation">The location of the 'Is'.</param>
|
||||||
''' <param name="target">The target type to check against.</param>
|
''' <param name="target">The target type to check against.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal operand As Expression, ByVal isLocation As Location, ByVal target As TypeName, ByVal span As Span)
|
Public Sub New(ByVal operand As Expression, ByVal isLocation As Location, ByVal target As TypeName, ByVal span As Span)
|
||||||
MyBase.New(TreeType.TypeOfExpression, operand, span)
|
MyBase.New(TreeType.TypeOfExpression, operand, span)
|
||||||
|
|
||||||
If target Is Nothing Then
|
If target Is Nothing Then
|
||||||
Throw New ArgumentNullException("target")
|
Throw New ArgumentNullException("target")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
SetParent(target)
|
SetParent(target)
|
||||||
|
|
||||||
_Target = target
|
_Target = target
|
||||||
_IsLocation = isLocation
|
_IsLocation = isLocation
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
MyBase.GetChildTrees(childList)
|
MyBase.GetChildTrees(childList)
|
||||||
AddChild(childList, Target)
|
AddChild(childList, Target)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,47 +1,47 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for an expression that refers to a type.
|
''' A parse tree for an expression that refers to a type.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class TypeReferenceExpression
|
Public NotInheritable Class TypeReferenceExpression
|
||||||
Inherits Expression
|
Inherits Expression
|
||||||
|
|
||||||
Private ReadOnly _TypeName As TypeName
|
Private ReadOnly _TypeName As TypeName
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The name of the type being referred to.
|
''' The name of the type being referred to.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property TypeName() As TypeName
|
Public ReadOnly Property TypeName() As TypeName
|
||||||
Get
|
Get
|
||||||
Return _TypeName
|
Return _TypeName
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for a type reference.
|
''' Constructs a new parse tree for a type reference.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="typeName">The name of the type being referred to.</param>
|
''' <param name="typeName">The name of the type being referred to.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal typeName As TypeName, ByVal span As Span)
|
Public Sub New(ByVal typeName As TypeName, ByVal span As Span)
|
||||||
MyBase.New(TreeType.TypeReferenceExpression, span)
|
MyBase.New(TreeType.TypeReferenceExpression, span)
|
||||||
|
|
||||||
If typeName Is Nothing Then
|
If typeName Is Nothing Then
|
||||||
Throw New ArgumentNullException("typeName")
|
Throw New ArgumentNullException("typeName")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
SetParent(typeName)
|
SetParent(typeName)
|
||||||
_TypeName = typeName
|
_TypeName = typeName
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
AddChild(childList, TypeName)
|
AddChild(childList, TypeName)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,54 +1,54 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for an expression that has an operand.
|
''' A parse tree for an expression that has an operand.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public MustInherit Class UnaryExpression
|
Public MustInherit Class UnaryExpression
|
||||||
Inherits Expression
|
Inherits Expression
|
||||||
|
|
||||||
Private ReadOnly _Operand As Expression
|
Private ReadOnly _Operand As Expression
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The operand of the expression.
|
''' The operand of the expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Operand() As Expression
|
Public ReadOnly Property Operand() As Expression
|
||||||
Get
|
Get
|
||||||
Return _Operand
|
Return _Operand
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Protected Sub New(ByVal type As TreeType, ByVal operand As Expression, ByVal span As Span)
|
Protected Sub New(ByVal type As TreeType, ByVal operand As Expression, ByVal span As Span)
|
||||||
MyBase.New(type, span)
|
MyBase.New(type, span)
|
||||||
|
|
||||||
Debug.Assert(type = TreeType.ParentheticalExpression OrElse _
|
Debug.Assert(type = TreeType.ParentheticalExpression OrElse _
|
||||||
type = TreeType.TypeOfExpression OrElse _
|
type = TreeType.TypeOfExpression OrElse _
|
||||||
(type = TreeType.CTypeExpression OrElse type = TreeType.DirectCastExpression OrElse type = TreeType.TryCastExpression) OrElse _
|
(type = TreeType.CTypeExpression OrElse type = TreeType.DirectCastExpression OrElse type = TreeType.TryCastExpression) OrElse _
|
||||||
type = TreeType.IntrinsicCastExpression OrElse _
|
type = TreeType.IntrinsicCastExpression OrElse _
|
||||||
(type >= TreeType.UnaryOperatorExpression AndAlso type <= TreeType.AddressOfExpression))
|
(type >= TreeType.UnaryOperatorExpression AndAlso type <= TreeType.AddressOfExpression))
|
||||||
|
|
||||||
If operand Is Nothing Then
|
If operand Is Nothing Then
|
||||||
Throw New ArgumentNullException("operand")
|
Throw New ArgumentNullException("operand")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
SetParent(operand)
|
SetParent(operand)
|
||||||
_Operand = operand
|
_Operand = operand
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Overrides ReadOnly Property IsConstant() As Boolean
|
Public Overrides ReadOnly Property IsConstant() As Boolean
|
||||||
Get
|
Get
|
||||||
Return Operand.IsConstant
|
Return Operand.IsConstant
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
AddChild(childList, Operand)
|
AddChild(childList, Operand)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,43 +1,43 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for an unary operator expression.
|
''' A parse tree for an unary operator expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class UnaryOperatorExpression
|
Public NotInheritable Class UnaryOperatorExpression
|
||||||
Inherits UnaryExpression
|
Inherits UnaryExpression
|
||||||
|
|
||||||
Private _Operator As OperatorType
|
Private _Operator As OperatorType
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The operator.
|
''' The operator.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property [Operator]() As OperatorType
|
Public ReadOnly Property [Operator]() As OperatorType
|
||||||
Get
|
Get
|
||||||
Return _Operator
|
Return _Operator
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new unary operator expression parse tree.
|
''' Constructs a new unary operator expression parse tree.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="operator">The type of the unary operator.</param>
|
''' <param name="operator">The type of the unary operator.</param>
|
||||||
''' <param name="operand">The operand of the operator.</param>
|
''' <param name="operand">The operand of the operator.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal [operator] As OperatorType, ByVal operand As Expression, ByVal span As Span)
|
Public Sub New(ByVal [operator] As OperatorType, ByVal operand As Expression, ByVal span As Span)
|
||||||
MyBase.New(TreeType.UnaryOperatorExpression, operand, span)
|
MyBase.New(TreeType.UnaryOperatorExpression, operand, span)
|
||||||
|
|
||||||
If [operator] < OperatorType.UnaryPlus OrElse [operator] > OperatorType.Not Then
|
If [operator] < OperatorType.UnaryPlus OrElse [operator] > OperatorType.Not Then
|
||||||
Throw New ArgumentOutOfRangeException("operator")
|
Throw New ArgumentOutOfRangeException("operator")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
_Operator = [operator]
|
_Operator = [operator]
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,44 +1,44 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for an entire file.
|
''' A parse tree for an entire file.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class File
|
Public NotInheritable Class File
|
||||||
Inherits Tree
|
Inherits Tree
|
||||||
|
|
||||||
Private ReadOnly _Declarations As DeclarationCollection
|
Private ReadOnly _Declarations As DeclarationCollection
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The declarations in the file.
|
''' The declarations in the file.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Declarations() As DeclarationCollection
|
Public ReadOnly Property Declarations() As DeclarationCollection
|
||||||
Get
|
Get
|
||||||
Return _Declarations
|
Return _Declarations
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new file parse tree.
|
''' Constructs a new file parse tree.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="declarations">The declarations in the file.</param>
|
''' <param name="declarations">The declarations in the file.</param>
|
||||||
''' <param name="span">The location of the tree.</param>
|
''' <param name="span">The location of the tree.</param>
|
||||||
Public Sub New(ByVal declarations As DeclarationCollection, ByVal span As Span)
|
Public Sub New(ByVal declarations As DeclarationCollection, ByVal span As Span)
|
||||||
MyBase.New(TreeType.File, span)
|
MyBase.New(TreeType.File, span)
|
||||||
|
|
||||||
SetParent(declarations)
|
SetParent(declarations)
|
||||||
|
|
||||||
_Declarations = declarations
|
_Declarations = declarations
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
AddChild(childList, Declarations)
|
AddChild(childList, Declarations)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,51 +1,51 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for an Imports declaration.
|
''' A parse tree for an Imports declaration.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class ImportsDeclaration
|
Public NotInheritable Class ImportsDeclaration
|
||||||
Inherits Declaration
|
Inherits Declaration
|
||||||
|
|
||||||
Private ReadOnly _ImportMembers As ImportCollection
|
Private ReadOnly _ImportMembers As ImportCollection
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The members imported.
|
''' The members imported.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property ImportMembers() As ImportCollection
|
Public ReadOnly Property ImportMembers() As ImportCollection
|
||||||
Get
|
Get
|
||||||
Return _ImportMembers
|
Return _ImportMembers
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a parse tree for an Imports declaration.
|
''' Constructs a parse tree for an Imports declaration.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="importMembers">The members imported.</param>
|
''' <param name="importMembers">The members imported.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
''' <param name="comments">The comments for the parse tree.</param>
|
''' <param name="comments">The comments for the parse tree.</param>
|
||||||
Public Sub New(ByVal importMembers As ImportCollection, ByVal span As Span, ByVal comments As IList(Of Comment))
|
Public Sub New(ByVal importMembers As ImportCollection, ByVal span As Span, ByVal comments As IList(Of Comment))
|
||||||
MyBase.New(TreeType.ImportsDeclaration, span, comments)
|
MyBase.New(TreeType.ImportsDeclaration, span, comments)
|
||||||
|
|
||||||
If importMembers Is Nothing Then
|
If importMembers Is Nothing Then
|
||||||
Throw New ArgumentNullException("importMembers")
|
Throw New ArgumentNullException("importMembers")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
SetParent(importMembers)
|
SetParent(importMembers)
|
||||||
|
|
||||||
_ImportMembers = importMembers
|
_ImportMembers = importMembers
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
MyBase.GetChildTrees(childList)
|
MyBase.GetChildTrees(childList)
|
||||||
|
|
||||||
AddChild(childList, ImportMembers)
|
AddChild(childList, ImportMembers)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,93 +1,93 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a namespace declaration.
|
''' A parse tree for a namespace declaration.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class NamespaceDeclaration
|
Public NotInheritable Class NamespaceDeclaration
|
||||||
Inherits ModifiedDeclaration
|
Inherits ModifiedDeclaration
|
||||||
|
|
||||||
Private ReadOnly _NamespaceLocation As Location
|
Private ReadOnly _NamespaceLocation As Location
|
||||||
Private ReadOnly _Name As Name
|
Private ReadOnly _Name As Name
|
||||||
Private ReadOnly _Declarations As DeclarationCollection
|
Private ReadOnly _Declarations As DeclarationCollection
|
||||||
Private ReadOnly _EndDeclaration As EndBlockDeclaration
|
Private ReadOnly _EndDeclaration As EndBlockDeclaration
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of 'Namespace'.
|
''' The location of 'Namespace'.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property NamespaceLocation() As Location
|
Public ReadOnly Property NamespaceLocation() As Location
|
||||||
Get
|
Get
|
||||||
Return _NamespaceLocation
|
Return _NamespaceLocation
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The name of the namespace.
|
''' The name of the namespace.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Name() As Name
|
Public ReadOnly Property Name() As Name
|
||||||
Get
|
Get
|
||||||
Return _Name
|
Return _Name
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The declarations in the namespace.
|
''' The declarations in the namespace.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Declarations() As DeclarationCollection
|
Public ReadOnly Property Declarations() As DeclarationCollection
|
||||||
Get
|
Get
|
||||||
Return _Declarations
|
Return _Declarations
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The End Namespace declaration, if any.
|
''' The End Namespace declaration, if any.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property EndDeclaration() As EndBlockDeclaration
|
Public ReadOnly Property EndDeclaration() As EndBlockDeclaration
|
||||||
Get
|
Get
|
||||||
Return _EndDeclaration
|
Return _EndDeclaration
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a parse tree for a namespace declaration.
|
''' Constructs a parse tree for a namespace declaration.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="attributes">The attributes on the declaration.</param>
|
''' <param name="attributes">The attributes on the declaration.</param>
|
||||||
''' <param name="modifiers">The modifiers on the declaration.</param>
|
''' <param name="modifiers">The modifiers on the declaration.</param>
|
||||||
''' <param name="namespaceLocation">The location of 'Namespace'.</param>
|
''' <param name="namespaceLocation">The location of 'Namespace'.</param>
|
||||||
''' <param name="name">The name of the namespace.</param>
|
''' <param name="name">The name of the namespace.</param>
|
||||||
''' <param name="declarations">The declarations in the namespace.</param>
|
''' <param name="declarations">The declarations in the namespace.</param>
|
||||||
''' <param name="endDeclaration">The End Namespace statement, if any.</param>
|
''' <param name="endDeclaration">The End Namespace statement, if any.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
''' <param name="comments">The comments for the parse tree.</param>
|
''' <param name="comments">The comments for the parse tree.</param>
|
||||||
Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection, ByVal namespaceLocation As Location, ByVal name As Name, ByVal declarations As DeclarationCollection, ByVal endDeclaration As EndBlockDeclaration, ByVal span As Span, ByVal comments As IList(Of Comment))
|
Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection, ByVal namespaceLocation As Location, ByVal name As Name, ByVal declarations As DeclarationCollection, ByVal endDeclaration As EndBlockDeclaration, ByVal span As Span, ByVal comments As IList(Of Comment))
|
||||||
MyBase.New(TreeType.NamespaceDeclaration, attributes, modifiers, span, comments)
|
MyBase.New(TreeType.NamespaceDeclaration, attributes, modifiers, span, comments)
|
||||||
|
|
||||||
If name Is Nothing Then
|
If name Is Nothing Then
|
||||||
Throw New ArgumentNullException("name")
|
Throw New ArgumentNullException("name")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
SetParent(name)
|
SetParent(name)
|
||||||
SetParent(declarations)
|
SetParent(declarations)
|
||||||
SetParent(endDeclaration)
|
SetParent(endDeclaration)
|
||||||
|
|
||||||
_NamespaceLocation = namespaceLocation
|
_NamespaceLocation = namespaceLocation
|
||||||
_Name = name
|
_Name = name
|
||||||
_Declarations = declarations
|
_Declarations = declarations
|
||||||
_EndDeclaration = endDeclaration
|
_EndDeclaration = endDeclaration
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
MyBase.GetChildTrees(childList)
|
MyBase.GetChildTrees(childList)
|
||||||
|
|
||||||
AddChild(childList, Name)
|
AddChild(childList, Name)
|
||||||
AddChild(childList, Declarations)
|
AddChild(childList, Declarations)
|
||||||
AddChild(childList, EndDeclaration)
|
AddChild(childList, EndDeclaration)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,67 +1,67 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for an Option declaration.
|
''' A parse tree for an Option declaration.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class OptionDeclaration
|
Public NotInheritable Class OptionDeclaration
|
||||||
Inherits Declaration
|
Inherits Declaration
|
||||||
|
|
||||||
Private ReadOnly _OptionType As OptionType
|
Private ReadOnly _OptionType As OptionType
|
||||||
Private ReadOnly _OptionTypeLocation As Location
|
Private ReadOnly _OptionTypeLocation As Location
|
||||||
Private ReadOnly _OptionArgumentLocation As Location
|
Private ReadOnly _OptionArgumentLocation As Location
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The type of Option statement.
|
''' The type of Option statement.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property OptionType() As OptionType
|
Public ReadOnly Property OptionType() As OptionType
|
||||||
Get
|
Get
|
||||||
Return _OptionType
|
Return _OptionType
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the Option type (e.g. "Strict"), if any.
|
''' The location of the Option type (e.g. "Strict"), if any.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property OptionTypeLocation() As Location
|
Public ReadOnly Property OptionTypeLocation() As Location
|
||||||
Get
|
Get
|
||||||
Return _OptionTypeLocation
|
Return _OptionTypeLocation
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the Option argument (e.g. "On"), if any.
|
''' The location of the Option argument (e.g. "On"), if any.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property OptionArgumentLocation() As Location
|
Public ReadOnly Property OptionArgumentLocation() As Location
|
||||||
Get
|
Get
|
||||||
Return _OptionArgumentLocation
|
Return _OptionArgumentLocation
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for an Option declaration.
|
''' Constructs a new parse tree for an Option declaration.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="optionType">The type of the Option declaration.</param>
|
''' <param name="optionType">The type of the Option declaration.</param>
|
||||||
''' <param name="optionTypeLocation">The location of the Option type, if any.</param>
|
''' <param name="optionTypeLocation">The location of the Option type, if any.</param>
|
||||||
''' <param name="optionArgumentLocation">The location of the Option argument, if any.</param>
|
''' <param name="optionArgumentLocation">The location of the Option argument, if any.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
''' <param name="comments">The comments for the parse tree.</param>
|
''' <param name="comments">The comments for the parse tree.</param>
|
||||||
Public Sub New(ByVal optionType As OptionType, ByVal optionTypeLocation As Location, ByVal optionArgumentLocation As Location, ByVal span As Span, ByVal comments As IList(Of Comment))
|
Public Sub New(ByVal optionType As OptionType, ByVal optionTypeLocation As Location, ByVal optionArgumentLocation As Location, ByVal span As Span, ByVal comments As IList(Of Comment))
|
||||||
MyBase.New(TreeType.OptionDeclaration, span, comments)
|
MyBase.New(TreeType.OptionDeclaration, span, comments)
|
||||||
|
|
||||||
If optionType < optionType.SyntaxError OrElse optionType > optionType.CompareText Then
|
If optionType < optionType.SyntaxError OrElse optionType > optionType.CompareText Then
|
||||||
Throw New ArgumentOutOfRangeException("optionType")
|
Throw New ArgumentOutOfRangeException("optionType")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
_OptionType = optionType
|
_OptionType = optionType
|
||||||
_OptionTypeLocation = optionTypeLocation
|
_OptionTypeLocation = optionTypeLocation
|
||||||
_OptionArgumentLocation = optionArgumentLocation
|
_OptionArgumentLocation = optionArgumentLocation
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,24 +1,24 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The type of an Option declaration.
|
''' The type of an Option declaration.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public Enum OptionType
|
Public Enum OptionType
|
||||||
SyntaxError
|
SyntaxError
|
||||||
Explicit
|
Explicit
|
||||||
ExplicitOn
|
ExplicitOn
|
||||||
ExplicitOff
|
ExplicitOff
|
||||||
Strict
|
Strict
|
||||||
StrictOn
|
StrictOn
|
||||||
StrictOff
|
StrictOff
|
||||||
CompareBinary
|
CompareBinary
|
||||||
CompareText
|
CompareText
|
||||||
End Enum
|
End Enum
|
||||||
|
|
|
@ -1,32 +1,32 @@
|
||||||
'LC Represent a script file
|
'LC Represent a script file
|
||||||
Public Class ScriptBlock
|
Public Class ScriptBlock
|
||||||
Inherits Tree
|
Inherits Tree
|
||||||
|
|
||||||
Private ReadOnly _statements As StatementCollection
|
Private ReadOnly _statements As StatementCollection
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The declarations in the file.
|
''' The declarations in the file.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Statements() As StatementCollection
|
Public ReadOnly Property Statements() As StatementCollection
|
||||||
Get
|
Get
|
||||||
Return _statements
|
Return _statements
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new file parse tree.
|
''' Constructs a new file parse tree.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="statements">The statements in the file.</param>
|
''' <param name="statements">The statements in the file.</param>
|
||||||
''' <param name="span">The location of the tree.</param>
|
''' <param name="span">The location of the tree.</param>
|
||||||
Public Sub New(ByVal statements As StatementCollection, ByVal span As Span)
|
Public Sub New(ByVal statements As StatementCollection, ByVal span As Span)
|
||||||
MyBase.New(TreeType.ScriptBlock, span)
|
MyBase.New(TreeType.ScriptBlock, span)
|
||||||
|
|
||||||
SetParent(statements)
|
SetParent(statements)
|
||||||
|
|
||||||
_statements = statements
|
_statements = statements
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
AddChild(childList, _statements)
|
AddChild(childList, _statements)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
|
@ -1,79 +1,79 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for an Imports statement that aliases a type or namespace.
|
''' A parse tree for an Imports statement that aliases a type or namespace.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class AliasImport
|
Public NotInheritable Class AliasImport
|
||||||
Inherits Import
|
Inherits Import
|
||||||
|
|
||||||
Private ReadOnly _Name As SimpleName
|
Private ReadOnly _Name As SimpleName
|
||||||
Private ReadOnly _EqualsLocation As Location
|
Private ReadOnly _EqualsLocation As Location
|
||||||
Private ReadOnly _AliasedTypeName As TypeName
|
Private ReadOnly _AliasedTypeName As TypeName
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The alias name.
|
''' The alias name.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Name() As SimpleName
|
Public ReadOnly Property Name() As SimpleName
|
||||||
Get
|
Get
|
||||||
Return _Name
|
Return _Name
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the '='.
|
''' The location of the '='.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property EqualsLocation() As Location
|
Public ReadOnly Property EqualsLocation() As Location
|
||||||
Get
|
Get
|
||||||
Return _EqualsLocation
|
Return _EqualsLocation
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The name being aliased.
|
''' The name being aliased.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property AliasedTypeName() As TypeName
|
Public ReadOnly Property AliasedTypeName() As TypeName
|
||||||
Get
|
Get
|
||||||
Return _AliasedTypeName
|
Return _AliasedTypeName
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new aliased import parse tree.
|
''' Constructs a new aliased import parse tree.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="name">The name of the alias.</param>
|
''' <param name="name">The name of the alias.</param>
|
||||||
''' <param name="equalsLocation">The location of the '='.</param>
|
''' <param name="equalsLocation">The location of the '='.</param>
|
||||||
''' <param name="aliasedTypeName">The name being aliased.</param>
|
''' <param name="aliasedTypeName">The name being aliased.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal name As SimpleName, ByVal equalsLocation As Location, ByVal aliasedTypeName As TypeName, ByVal span As Span)
|
Public Sub New(ByVal name As SimpleName, ByVal equalsLocation As Location, ByVal aliasedTypeName As TypeName, ByVal span As Span)
|
||||||
MyBase.New(TreeType.AliasImport, span)
|
MyBase.New(TreeType.AliasImport, span)
|
||||||
|
|
||||||
If aliasedTypeName Is Nothing Then
|
If aliasedTypeName Is Nothing Then
|
||||||
Throw New ArgumentNullException("aliasedTypeName")
|
Throw New ArgumentNullException("aliasedTypeName")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If name Is Nothing Then
|
If name Is Nothing Then
|
||||||
Throw New ArgumentNullException("name")
|
Throw New ArgumentNullException("name")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
SetParent(name)
|
SetParent(name)
|
||||||
SetParent(aliasedTypeName)
|
SetParent(aliasedTypeName)
|
||||||
|
|
||||||
_Name = name
|
_Name = name
|
||||||
_EqualsLocation = equalsLocation
|
_EqualsLocation = equalsLocation
|
||||||
_AliasedTypeName = aliasedTypeName
|
_AliasedTypeName = aliasedTypeName
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
MyBase.GetChildTrees(childList)
|
MyBase.GetChildTrees(childList)
|
||||||
|
|
||||||
AddChild(childList, AliasedTypeName)
|
AddChild(childList, AliasedTypeName)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,22 +1,22 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for an Imports statement.
|
''' A parse tree for an Imports statement.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public MustInherit Class Import
|
Public MustInherit Class Import
|
||||||
Inherits Tree
|
Inherits Tree
|
||||||
|
|
||||||
Protected Sub New(ByVal type As TreeType, ByVal span As Span)
|
Protected Sub New(ByVal type As TreeType, ByVal span As Span)
|
||||||
MyBase.New(type, span)
|
MyBase.New(type, span)
|
||||||
|
|
||||||
Debug.Assert(type = TreeType.AliasImport OrElse type = TreeType.NameImport)
|
Debug.Assert(type = TreeType.AliasImport OrElse type = TreeType.NameImport)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,31 +1,31 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A read-only collection of imports.
|
''' A read-only collection of imports.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class ImportCollection
|
Public NotInheritable Class ImportCollection
|
||||||
Inherits CommaDelimitedTreeCollection(Of Import)
|
Inherits CommaDelimitedTreeCollection(Of Import)
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a collection of imports.
|
''' Constructs a collection of imports.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="importMembers">The imports in the collection.</param>
|
''' <param name="importMembers">The imports in the collection.</param>
|
||||||
''' <param name="commaLocations">The location of the commas.</param>
|
''' <param name="commaLocations">The location of the commas.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal importMembers As IList(Of Import), ByVal commaLocations As IList(Of Location), ByVal span As Span)
|
Public Sub New(ByVal importMembers As IList(Of Import), ByVal commaLocations As IList(Of Location), ByVal span As Span)
|
||||||
MyBase.New(TreeType.ImportCollection, importMembers, commaLocations, span)
|
MyBase.New(TreeType.ImportCollection, importMembers, commaLocations, span)
|
||||||
|
|
||||||
If importMembers Is Nothing OrElse importMembers.Count = 0 Then
|
If importMembers Is Nothing OrElse importMembers.Count = 0 Then
|
||||||
Throw New ArgumentException("ImportCollection cannot be empty.")
|
Throw New ArgumentException("ImportCollection cannot be empty.")
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|
|
@ -1,48 +1,48 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for an Imports statement for a name.
|
''' A parse tree for an Imports statement for a name.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class NameImport
|
Public NotInheritable Class NameImport
|
||||||
Inherits Import
|
Inherits Import
|
||||||
|
|
||||||
Private ReadOnly _TypeName As TypeName
|
Private ReadOnly _TypeName As TypeName
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The imported name.
|
''' The imported name.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property TypeName() As TypeName
|
Public ReadOnly Property TypeName() As TypeName
|
||||||
Get
|
Get
|
||||||
Return _TypeName
|
Return _TypeName
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new name import parse tree.
|
''' Constructs a new name import parse tree.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="typeName">The name to import.</param>
|
''' <param name="typeName">The name to import.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal typeName As TypeName, ByVal span As Span)
|
Public Sub New(ByVal typeName As TypeName, ByVal span As Span)
|
||||||
MyBase.New(TreeType.NameImport, span)
|
MyBase.New(TreeType.NameImport, span)
|
||||||
|
|
||||||
If typeName Is Nothing Then
|
If typeName Is Nothing Then
|
||||||
Throw New ArgumentNullException("typeName")
|
Throw New ArgumentNullException("typeName")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
SetParent(typeName)
|
SetParent(typeName)
|
||||||
|
|
||||||
_TypeName = typeName
|
_TypeName = typeName
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
AddChild(childList, TypeName)
|
AddChild(childList, TypeName)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
|
@ -1,47 +1,47 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for an aggregate initializer.
|
''' A parse tree for an aggregate initializer.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class AggregateInitializer
|
Public NotInheritable Class AggregateInitializer
|
||||||
Inherits Initializer
|
Inherits Initializer
|
||||||
|
|
||||||
Private ReadOnly _Elements As InitializerCollection
|
Private ReadOnly _Elements As InitializerCollection
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The elements of the aggregate initializer.
|
''' The elements of the aggregate initializer.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Elements() As InitializerCollection
|
Public ReadOnly Property Elements() As InitializerCollection
|
||||||
Get
|
Get
|
||||||
Return _Elements
|
Return _Elements
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new aggregate initializer parse tree.
|
''' Constructs a new aggregate initializer parse tree.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="elements">The elements of the aggregate initializer.</param>
|
''' <param name="elements">The elements of the aggregate initializer.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal elements As InitializerCollection, ByVal span As Span)
|
Public Sub New(ByVal elements As InitializerCollection, ByVal span As Span)
|
||||||
MyBase.New(TreeType.AggregateInitializer, span)
|
MyBase.New(TreeType.AggregateInitializer, span)
|
||||||
|
|
||||||
If elements Is Nothing Then
|
If elements Is Nothing Then
|
||||||
Throw New ArgumentNullException("elements")
|
Throw New ArgumentNullException("elements")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
SetParent(elements)
|
SetParent(elements)
|
||||||
_Elements = elements
|
_Elements = elements
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
AddChild(childList, Elements)
|
AddChild(childList, Elements)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,48 +1,48 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for an expression initializer.
|
''' A parse tree for an expression initializer.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class ExpressionInitializer
|
Public NotInheritable Class ExpressionInitializer
|
||||||
Inherits Initializer
|
Inherits Initializer
|
||||||
|
|
||||||
Private ReadOnly _Expression As Expression
|
Private ReadOnly _Expression As Expression
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The expression.
|
''' The expression.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Expression() As Expression
|
Public ReadOnly Property Expression() As Expression
|
||||||
Get
|
Get
|
||||||
Return _Expression
|
Return _Expression
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new expression initializer parse tree.
|
''' Constructs a new expression initializer parse tree.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="expression">The expression.</param>
|
''' <param name="expression">The expression.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal expression As Expression, ByVal span As Span)
|
Public Sub New(ByVal expression As Expression, ByVal span As Span)
|
||||||
MyBase.New(TreeType.ExpressionInitializer, span)
|
MyBase.New(TreeType.ExpressionInitializer, span)
|
||||||
|
|
||||||
If expression Is Nothing Then
|
If expression Is Nothing Then
|
||||||
Throw New ArgumentNullException("expression")
|
Throw New ArgumentNullException("expression")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
SetParent(expression)
|
SetParent(expression)
|
||||||
|
|
||||||
_Expression = expression
|
_Expression = expression
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
AddChild(childList, Expression)
|
AddChild(childList, Expression)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,22 +1,22 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for an initializer.
|
''' A parse tree for an initializer.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public MustInherit Class Initializer
|
Public MustInherit Class Initializer
|
||||||
Inherits Tree
|
Inherits Tree
|
||||||
|
|
||||||
Protected Sub New(ByVal type As TreeType, ByVal span As Span)
|
Protected Sub New(ByVal type As TreeType, ByVal span As Span)
|
||||||
MyBase.New(type, span)
|
MyBase.New(type, span)
|
||||||
|
|
||||||
Debug.Assert(type = TreeType.ExpressionInitializer OrElse type = TreeType.AggregateInitializer)
|
Debug.Assert(type = TreeType.ExpressionInitializer OrElse type = TreeType.AggregateInitializer)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,38 +1,38 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A read-only collection of initializers.
|
''' A read-only collection of initializers.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class InitializerCollection
|
Public NotInheritable Class InitializerCollection
|
||||||
Inherits CommaDelimitedTreeCollection(Of Initializer)
|
Inherits CommaDelimitedTreeCollection(Of Initializer)
|
||||||
Private ReadOnly _RightCurlyBraceLocation As Location
|
Private ReadOnly _RightCurlyBraceLocation As Location
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the '}'.
|
''' The location of the '}'.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property RightCurlyBraceLocation() As Location
|
Public ReadOnly Property RightCurlyBraceLocation() As Location
|
||||||
Get
|
Get
|
||||||
Return _RightCurlyBraceLocation
|
Return _RightCurlyBraceLocation
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new initializer collection.
|
''' Constructs a new initializer collection.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="initializers">The initializers in the collection.</param>
|
''' <param name="initializers">The initializers in the collection.</param>
|
||||||
''' <param name="commaLocations">The locations of the commas in the collection.</param>
|
''' <param name="commaLocations">The locations of the commas in the collection.</param>
|
||||||
''' <param name="rightCurlyBraceLocation">The location of the '}'.</param>
|
''' <param name="rightCurlyBraceLocation">The location of the '}'.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
Public Sub New(ByVal initializers As IList(Of Initializer), ByVal commaLocations As IList(Of Location), ByVal rightCurlyBraceLocation As Location, ByVal span As Span)
|
Public Sub New(ByVal initializers As IList(Of Initializer), ByVal commaLocations As IList(Of Location), ByVal rightCurlyBraceLocation As Location, ByVal span As Span)
|
||||||
MyBase.New(TreeType.InitializerCollection, initializers, commaLocations, span)
|
MyBase.New(TreeType.InitializerCollection, initializers, commaLocations, span)
|
||||||
|
|
||||||
_RightCurlyBraceLocation = rightCurlyBraceLocation
|
_RightCurlyBraceLocation = rightCurlyBraceLocation
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,31 +1,31 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The type of an intrinsic type name.
|
''' The type of an intrinsic type name.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public Enum IntrinsicType
|
Public Enum IntrinsicType
|
||||||
[Boolean]
|
[Boolean]
|
||||||
[SByte]
|
[SByte]
|
||||||
[Byte]
|
[Byte]
|
||||||
[Short]
|
[Short]
|
||||||
[UShort]
|
[UShort]
|
||||||
[Integer]
|
[Integer]
|
||||||
[UInteger]
|
[UInteger]
|
||||||
[Long]
|
[Long]
|
||||||
[ULong]
|
[ULong]
|
||||||
[Decimal]
|
[Decimal]
|
||||||
[Single]
|
[Single]
|
||||||
[Double]
|
[Double]
|
||||||
[Date]
|
[Date]
|
||||||
[Char]
|
[Char]
|
||||||
[String]
|
[String]
|
||||||
[Object]
|
[Object]
|
||||||
End Enum
|
End Enum
|
||||||
|
|
|
@ -1,88 +1,88 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a AddHandler property accessor.
|
''' A parse tree for a AddHandler property accessor.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class AddHandlerAccessorDeclaration
|
Public NotInheritable Class AddHandlerAccessorDeclaration
|
||||||
Inherits ModifiedDeclaration
|
Inherits ModifiedDeclaration
|
||||||
|
|
||||||
Private ReadOnly _AddHandlerLocation As Location
|
Private ReadOnly _AddHandlerLocation As Location
|
||||||
Private ReadOnly _Parameters As ParameterCollection
|
Private ReadOnly _Parameters As ParameterCollection
|
||||||
Private ReadOnly _Statements As StatementCollection
|
Private ReadOnly _Statements As StatementCollection
|
||||||
Private ReadOnly _EndStatement As EndBlockDeclaration
|
Private ReadOnly _EndStatement As EndBlockDeclaration
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the 'AddHandler'.
|
''' The location of the 'AddHandler'.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property AddHandlerLocation() As Location
|
Public ReadOnly Property AddHandlerLocation() As Location
|
||||||
Get
|
Get
|
||||||
Return _AddHandlerLocation
|
Return _AddHandlerLocation
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The accessor's parameters.
|
''' The accessor's parameters.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Parameters() As ParameterCollection
|
Public ReadOnly Property Parameters() As ParameterCollection
|
||||||
Get
|
Get
|
||||||
Return _Parameters
|
Return _Parameters
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The statements in the accessor.
|
''' The statements in the accessor.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Statements() As StatementCollection
|
Public ReadOnly Property Statements() As StatementCollection
|
||||||
Get
|
Get
|
||||||
Return _Statements
|
Return _Statements
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The End declaration for the accessor.
|
''' The End declaration for the accessor.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property EndStatement() As EndBlockDeclaration
|
Public ReadOnly Property EndStatement() As EndBlockDeclaration
|
||||||
Get
|
Get
|
||||||
Return _EndStatement
|
Return _EndStatement
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for a property accessor.
|
''' Constructs a new parse tree for a property accessor.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="attributes">The attributes for the parse tree.</param>
|
''' <param name="attributes">The attributes for the parse tree.</param>
|
||||||
''' <param name="addHandlerLocation">The location of the 'AddHandler'.</param>
|
''' <param name="addHandlerLocation">The location of the 'AddHandler'.</param>
|
||||||
''' <param name="parameters">The parameters of the declaration.</param>
|
''' <param name="parameters">The parameters of the declaration.</param>
|
||||||
''' <param name="statements">The statements in the declaration.</param>
|
''' <param name="statements">The statements in the declaration.</param>
|
||||||
''' <param name="endStatement">The end block declaration, if any.</param>
|
''' <param name="endStatement">The end block declaration, if any.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
''' <param name="comments">The comments for the parse tree.</param>
|
''' <param name="comments">The comments for the parse tree.</param>
|
||||||
Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal addHandlerLocation As Location, ByVal parameters As ParameterCollection, ByVal statements As StatementCollection, ByVal endStatement As EndBlockDeclaration, ByVal span As Span, ByVal comments As IList(Of Comment))
|
Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal addHandlerLocation As Location, ByVal parameters As ParameterCollection, ByVal statements As StatementCollection, ByVal endStatement As EndBlockDeclaration, ByVal span As Span, ByVal comments As IList(Of Comment))
|
||||||
MyBase.New(TreeType.AddHandlerAccessorDeclaration, attributes, Nothing, span, comments)
|
MyBase.New(TreeType.AddHandlerAccessorDeclaration, attributes, Nothing, span, comments)
|
||||||
|
|
||||||
SetParent(parameters)
|
SetParent(parameters)
|
||||||
SetParent(statements)
|
SetParent(statements)
|
||||||
SetParent(endStatement)
|
SetParent(endStatement)
|
||||||
|
|
||||||
_Parameters = parameters
|
_Parameters = parameters
|
||||||
_AddHandlerLocation = addHandlerLocation
|
_AddHandlerLocation = addHandlerLocation
|
||||||
_Statements = statements
|
_Statements = statements
|
||||||
_EndStatement = endStatement
|
_EndStatement = endStatement
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
MyBase.GetChildTrees(childList)
|
MyBase.GetChildTrees(childList)
|
||||||
|
|
||||||
AddChild(childList, Parameters)
|
AddChild(childList, Parameters)
|
||||||
AddChild(childList, Statements)
|
AddChild(childList, Statements)
|
||||||
AddChild(childList, EndStatement)
|
AddChild(childList, EndStatement)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,18 +1,18 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The character set of a Declare statement.
|
''' The character set of a Declare statement.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public Enum Charset
|
Public Enum Charset
|
||||||
Ansi
|
Ansi
|
||||||
Unicode
|
Unicode
|
||||||
Auto
|
Auto
|
||||||
End Enum
|
End Enum
|
|
@ -1,32 +1,32 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a constructor declaration.
|
''' A parse tree for a constructor declaration.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class ConstructorDeclaration
|
Public NotInheritable Class ConstructorDeclaration
|
||||||
Inherits MethodDeclaration
|
Inherits MethodDeclaration
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Creates a new parse tree for a constructor declaration.
|
''' Creates a new parse tree for a constructor declaration.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="attributes">The attributes for the parse tree.</param>
|
''' <param name="attributes">The attributes for the parse tree.</param>
|
||||||
''' <param name="modifiers">The modifiers for the parse tree.</param>
|
''' <param name="modifiers">The modifiers for the parse tree.</param>
|
||||||
''' <param name="keywordLocation">The location of the keyword.</param>
|
''' <param name="keywordLocation">The location of the keyword.</param>
|
||||||
''' <param name="name">The name of the declaration.</param>
|
''' <param name="name">The name of the declaration.</param>
|
||||||
''' <param name="parameters">The parameters of the declaration.</param>
|
''' <param name="parameters">The parameters of the declaration.</param>
|
||||||
''' <param name="statements">The statements in the declaration.</param>
|
''' <param name="statements">The statements in the declaration.</param>
|
||||||
''' <param name="endDeclaration">The end block declaration, if any.</param>
|
''' <param name="endDeclaration">The end block declaration, if any.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
''' <param name="comments">The comments for the parse tree.</param>
|
''' <param name="comments">The comments for the parse tree.</param>
|
||||||
Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection, ByVal keywordLocation As Location, ByVal name As SimpleName, ByVal parameters As ParameterCollection, ByVal statements As StatementCollection, ByVal endDeclaration As EndBlockDeclaration, ByVal span As Span, ByVal comments As IList(Of Comment))
|
Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection, ByVal keywordLocation As Location, ByVal name As SimpleName, ByVal parameters As ParameterCollection, ByVal statements As StatementCollection, ByVal endDeclaration As EndBlockDeclaration, ByVal span As Span, ByVal comments As IList(Of Comment))
|
||||||
MyBase.New(TreeType.ConstructorDeclaration, attributes, modifiers, keywordLocation, name, Nothing, parameters, Nothing, Nothing, Nothing, Nothing, Nothing, statements, endDeclaration, span, comments)
|
MyBase.New(TreeType.ConstructorDeclaration, attributes, modifiers, keywordLocation, name, Nothing, parameters, Nothing, Nothing, Nothing, Nothing, Nothing, statements, endDeclaration, span, comments)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,92 +1,92 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for a custom event declaration.
|
''' A parse tree for a custom event declaration.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class CustomEventDeclaration
|
Public NotInheritable Class CustomEventDeclaration
|
||||||
Inherits SignatureDeclaration
|
Inherits SignatureDeclaration
|
||||||
|
|
||||||
Private ReadOnly _CustomLocation As Location
|
Private ReadOnly _CustomLocation As Location
|
||||||
Private ReadOnly _ImplementsList As NameCollection
|
Private ReadOnly _ImplementsList As NameCollection
|
||||||
Private ReadOnly _Accessors As DeclarationCollection
|
Private ReadOnly _Accessors As DeclarationCollection
|
||||||
Private ReadOnly _EndDeclaration As EndBlockDeclaration
|
Private ReadOnly _EndDeclaration As EndBlockDeclaration
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the 'Custom' keyword.
|
''' The location of the 'Custom' keyword.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property CustomLocation() As Location
|
Public ReadOnly Property CustomLocation() As Location
|
||||||
Get
|
Get
|
||||||
Return _CustomLocation
|
Return _CustomLocation
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The list of implemented members.
|
''' The list of implemented members.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property ImplementsList() As NameCollection
|
Public ReadOnly Property ImplementsList() As NameCollection
|
||||||
Get
|
Get
|
||||||
Return _ImplementsList
|
Return _ImplementsList
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The event accessors.
|
''' The event accessors.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Accessors() As DeclarationCollection
|
Public ReadOnly Property Accessors() As DeclarationCollection
|
||||||
Get
|
Get
|
||||||
Return _Accessors
|
Return _Accessors
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The End Event declaration, if any.
|
''' The End Event declaration, if any.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property EndDeclaration() As EndBlockDeclaration
|
Public ReadOnly Property EndDeclaration() As EndBlockDeclaration
|
||||||
Get
|
Get
|
||||||
Return _EndDeclaration
|
Return _EndDeclaration
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for a custom property declaration.
|
''' Constructs a new parse tree for a custom property declaration.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="attributes">The attributes on the declaration.</param>
|
''' <param name="attributes">The attributes on the declaration.</param>
|
||||||
''' <param name="modifiers">The modifiers on the declaration.</param>
|
''' <param name="modifiers">The modifiers on the declaration.</param>
|
||||||
''' <param name="customLocation">The location of the 'Custom' keyword.</param>
|
''' <param name="customLocation">The location of the 'Custom' keyword.</param>
|
||||||
''' <param name="keywordLocation">The location of the keyword.</param>
|
''' <param name="keywordLocation">The location of the keyword.</param>
|
||||||
''' <param name="name">The name of the custom event.</param>
|
''' <param name="name">The name of the custom event.</param>
|
||||||
''' <param name="asLocation">The location of the 'As', if any.</param>
|
''' <param name="asLocation">The location of the 'As', if any.</param>
|
||||||
''' <param name="resultType">The result type, if any.</param>
|
''' <param name="resultType">The result type, if any.</param>
|
||||||
''' <param name="implementsList">The implements list.</param>
|
''' <param name="implementsList">The implements list.</param>
|
||||||
''' <param name="accessors">The custom event accessors.</param>
|
''' <param name="accessors">The custom event accessors.</param>
|
||||||
''' <param name="endDeclaration">The End Event declaration, if any.</param>
|
''' <param name="endDeclaration">The End Event declaration, if any.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
''' <param name="comments">The comments for the parse tree.</param>
|
''' <param name="comments">The comments for the parse tree.</param>
|
||||||
Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection, ByVal customLocation As Location, ByVal keywordLocation As Location, ByVal name As SimpleName, ByVal asLocation As Location, ByVal resultType As TypeName, ByVal implementsList As NameCollection, ByVal accessors As DeclarationCollection, ByVal endDeclaration As EndBlockDeclaration, ByVal span As Span, ByVal comments As IList(Of Comment))
|
Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection, ByVal customLocation As Location, ByVal keywordLocation As Location, ByVal name As SimpleName, ByVal asLocation As Location, ByVal resultType As TypeName, ByVal implementsList As NameCollection, ByVal accessors As DeclarationCollection, ByVal endDeclaration As EndBlockDeclaration, ByVal span As Span, ByVal comments As IList(Of Comment))
|
||||||
MyBase.New(TreeType.CustomEventDeclaration, attributes, modifiers, keywordLocation, name, Nothing, Nothing, asLocation, Nothing, resultType, span, comments)
|
MyBase.New(TreeType.CustomEventDeclaration, attributes, modifiers, keywordLocation, name, Nothing, Nothing, asLocation, Nothing, resultType, span, comments)
|
||||||
|
|
||||||
SetParent(accessors)
|
SetParent(accessors)
|
||||||
SetParent(endDeclaration)
|
SetParent(endDeclaration)
|
||||||
SetParent(implementsList)
|
SetParent(implementsList)
|
||||||
|
|
||||||
_CustomLocation = customLocation
|
_CustomLocation = customLocation
|
||||||
_ImplementsList = implementsList
|
_ImplementsList = implementsList
|
||||||
_Accessors = accessors
|
_Accessors = accessors
|
||||||
_EndDeclaration = endDeclaration
|
_EndDeclaration = endDeclaration
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
MyBase.GetChildTrees(childList)
|
MyBase.GetChildTrees(childList)
|
||||||
AddChild(childList, ImplementsList)
|
AddChild(childList, ImplementsList)
|
||||||
AddChild(childList, Accessors)
|
AddChild(childList, Accessors)
|
||||||
AddChild(childList, EndDeclaration)
|
AddChild(childList, EndDeclaration)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,78 +1,78 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for an enumerated value declaration.
|
''' A parse tree for an enumerated value declaration.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class EnumValueDeclaration
|
Public NotInheritable Class EnumValueDeclaration
|
||||||
Inherits ModifiedDeclaration
|
Inherits ModifiedDeclaration
|
||||||
|
|
||||||
Private ReadOnly _Name As Name
|
Private ReadOnly _Name As Name
|
||||||
Private ReadOnly _EqualsLocation As Location
|
Private ReadOnly _EqualsLocation As Location
|
||||||
Private ReadOnly _Expression As Expression
|
Private ReadOnly _Expression As Expression
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The name of the enumerated value.
|
''' The name of the enumerated value.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Name() As Name
|
Public ReadOnly Property Name() As Name
|
||||||
Get
|
Get
|
||||||
Return _Name
|
Return _Name
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The location of the '=', if any.
|
''' The location of the '=', if any.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property EqualsLocation() As Location
|
Public ReadOnly Property EqualsLocation() As Location
|
||||||
Get
|
Get
|
||||||
Return _EqualsLocation
|
Return _EqualsLocation
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The enumerated value, if any.
|
''' The enumerated value, if any.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property Expression() As Expression
|
Public ReadOnly Property Expression() As Expression
|
||||||
Get
|
Get
|
||||||
Return _Expression
|
Return _Expression
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a new parse tree for an enumerated value.
|
''' Constructs a new parse tree for an enumerated value.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="attributes">The attributes on the declaration.</param>
|
''' <param name="attributes">The attributes on the declaration.</param>
|
||||||
''' <param name="name">The name of the declaration.</param>
|
''' <param name="name">The name of the declaration.</param>
|
||||||
''' <param name="equalsLocation">The location of the '=', if any.</param>
|
''' <param name="equalsLocation">The location of the '=', if any.</param>
|
||||||
''' <param name="expression">The enumerated value, if any.</param>
|
''' <param name="expression">The enumerated value, if any.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
''' <param name="comments">The comments for the parse tree.</param>
|
''' <param name="comments">The comments for the parse tree.</param>
|
||||||
Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal name As Name, ByVal equalsLocation As Location, ByVal expression As Expression, ByVal span As Span, ByVal comments As IList(Of Comment))
|
Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal name As Name, ByVal equalsLocation As Location, ByVal expression As Expression, ByVal span As Span, ByVal comments As IList(Of Comment))
|
||||||
MyBase.New(TreeType.EnumValueDeclaration, attributes, Nothing, span, comments)
|
MyBase.New(TreeType.EnumValueDeclaration, attributes, Nothing, span, comments)
|
||||||
|
|
||||||
If name Is Nothing Then
|
If name Is Nothing Then
|
||||||
Throw New ArgumentNullException("name")
|
Throw New ArgumentNullException("name")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
SetParent(name)
|
SetParent(name)
|
||||||
SetParent(expression)
|
SetParent(expression)
|
||||||
|
|
||||||
_Name = name
|
_Name = name
|
||||||
_EqualsLocation = equalsLocation
|
_EqualsLocation = equalsLocation
|
||||||
_Expression = expression
|
_Expression = expression
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
MyBase.GetChildTrees(childList)
|
MyBase.GetChildTrees(childList)
|
||||||
|
|
||||||
AddChild(childList, Name)
|
AddChild(childList, Name)
|
||||||
AddChild(childList, Expression)
|
AddChild(childList, Expression)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -1,53 +1,53 @@
|
||||||
'
|
'
|
||||||
' Visual Basic .NET Parser
|
' Visual Basic .NET Parser
|
||||||
'
|
'
|
||||||
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
|
||||||
'
|
'
|
||||||
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
||||||
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
'
|
'
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' A parse tree for an event declaration.
|
''' A parse tree for an event declaration.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public NotInheritable Class EventDeclaration
|
Public NotInheritable Class EventDeclaration
|
||||||
Inherits SignatureDeclaration
|
Inherits SignatureDeclaration
|
||||||
|
|
||||||
Private ReadOnly _ImplementsList As NameCollection
|
Private ReadOnly _ImplementsList As NameCollection
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The list of implemented members.
|
''' The list of implemented members.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property ImplementsList() As NameCollection
|
Public ReadOnly Property ImplementsList() As NameCollection
|
||||||
Get
|
Get
|
||||||
Return _ImplementsList
|
Return _ImplementsList
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Constructs a parse tree for an event declaration.
|
''' Constructs a parse tree for an event declaration.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="attributes">The attributes for the parse tree.</param>
|
''' <param name="attributes">The attributes for the parse tree.</param>
|
||||||
''' <param name="modifiers">The modifiers for the parse tree.</param>
|
''' <param name="modifiers">The modifiers for the parse tree.</param>
|
||||||
''' <param name="keywordLocation">The location of the keyword.</param>
|
''' <param name="keywordLocation">The location of the keyword.</param>
|
||||||
''' <param name="name">The name of the declaration.</param>
|
''' <param name="name">The name of the declaration.</param>
|
||||||
''' <param name="parameters">The parameters of the declaration.</param>
|
''' <param name="parameters">The parameters of the declaration.</param>
|
||||||
''' <param name="asLocation">The location of the 'As', if any.</param>
|
''' <param name="asLocation">The location of the 'As', if any.</param>
|
||||||
''' <param name="resultTypeAttributes">The attributes on the result type, if any.</param>
|
''' <param name="resultTypeAttributes">The attributes on the result type, if any.</param>
|
||||||
''' <param name="resultType">The result type, if any.</param>
|
''' <param name="resultType">The result type, if any.</param>
|
||||||
''' <param name="implementsList">The list of implemented members.</param>
|
''' <param name="implementsList">The list of implemented members.</param>
|
||||||
''' <param name="span">The location of the parse tree.</param>
|
''' <param name="span">The location of the parse tree.</param>
|
||||||
''' <param name="comments">The comments for the parse tree.</param>
|
''' <param name="comments">The comments for the parse tree.</param>
|
||||||
Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection, ByVal keywordLocation As Location, ByVal name As SimpleName, ByVal parameters As ParameterCollection, ByVal asLocation As Location, ByVal resultTypeAttributes As AttributeBlockCollection, ByVal resultType As TypeName, ByVal implementsList As NameCollection, ByVal span As Span, ByVal comments As IList(Of Comment))
|
Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection, ByVal keywordLocation As Location, ByVal name As SimpleName, ByVal parameters As ParameterCollection, ByVal asLocation As Location, ByVal resultTypeAttributes As AttributeBlockCollection, ByVal resultType As TypeName, ByVal implementsList As NameCollection, ByVal span As Span, ByVal comments As IList(Of Comment))
|
||||||
MyBase.New(TreeType.EventDeclaration, attributes, modifiers, keywordLocation, name, Nothing, parameters, asLocation, resultTypeAttributes, resultType, span, comments)
|
MyBase.New(TreeType.EventDeclaration, attributes, modifiers, keywordLocation, name, Nothing, parameters, asLocation, resultTypeAttributes, resultType, span, comments)
|
||||||
|
|
||||||
SetParent(implementsList)
|
SetParent(implementsList)
|
||||||
_ImplementsList = implementsList
|
_ImplementsList = implementsList
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
|
||||||
MyBase.GetChildTrees(childList)
|
MyBase.GetChildTrees(childList)
|
||||||
AddChild(childList, ImplementsList)
|
AddChild(childList, ImplementsList)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue