Check in the source code

This commit is contained in:
dotneteer 2011-03-29 22:07:13 -07:00
parent 78edcc9beb
commit 9fcff1b8fb
319 changed files with 34393 additions and 8178 deletions

10
.hgignore Normal file
View file

@ -0,0 +1,10 @@
glob:bin
glob:Bin
glob:obj
glob:TestResults
glob:*.user
glob:*.patch
glob:*.hg
glob:*.sln.cache
glob:*.orig
glob:*.suo

View file

@ -0,0 +1,48 @@
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{244AF685-4E12-4893-89DA-939A2964C0FB}"
ProjectSection(SolutionItems) = preProject
License.txt = License.txt
EndProjectSection
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Parser", "Parser\Parser.vbproj", "{57A0B340-BDA4-4DE3-B449-52B8C51D84B8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VBScript", "VBScript\VBScript.csproj", "{0846368D-EA96-4AC4-81AF-E4F9B78CE60B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Asp", "asp\Asp.csproj", "{F076A2D0-5200-42D7-9AEA-9E1260EFB138}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AspWebApp", "AspWebApp\AspWebApp.csproj", "{24BF0EA3-2D82-4E85-B13D-EA9279F58812}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NerdDinnerAsp", "NerdDinnerAsp\NerdDinnerAsp.csproj", "{328C148C-DBEE-41A4-B1C7-104CBB216556}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{57A0B340-BDA4-4DE3-B449-52B8C51D84B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{57A0B340-BDA4-4DE3-B449-52B8C51D84B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{57A0B340-BDA4-4DE3-B449-52B8C51D84B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{57A0B340-BDA4-4DE3-B449-52B8C51D84B8}.Release|Any CPU.Build.0 = Release|Any CPU
{0846368D-EA96-4AC4-81AF-E4F9B78CE60B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0846368D-EA96-4AC4-81AF-E4F9B78CE60B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0846368D-EA96-4AC4-81AF-E4F9B78CE60B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0846368D-EA96-4AC4-81AF-E4F9B78CE60B}.Release|Any CPU.Build.0 = Release|Any CPU
{F076A2D0-5200-42D7-9AEA-9E1260EFB138}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F076A2D0-5200-42D7-9AEA-9E1260EFB138}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F076A2D0-5200-42D7-9AEA-9E1260EFB138}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F076A2D0-5200-42D7-9AEA-9E1260EFB138}.Release|Any CPU.Build.0 = Release|Any CPU
{24BF0EA3-2D82-4E85-B13D-EA9279F58812}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{24BF0EA3-2D82-4E85-B13D-EA9279F58812}.Debug|Any CPU.Build.0 = Debug|Any CPU
{24BF0EA3-2D82-4E85-B13D-EA9279F58812}.Release|Any CPU.ActiveCfg = Release|Any CPU
{24BF0EA3-2D82-4E85-B13D-EA9279F58812}.Release|Any CPU.Build.0 = Release|Any CPU
{328C148C-DBEE-41A4-B1C7-104CBB216556}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{328C148C-DBEE-41A4-B1C7-104CBB216556}.Debug|Any CPU.Build.0 = Debug|Any CPU
{328C148C-DBEE-41A4-B1C7-104CBB216556}.Release|Any CPU.ActiveCfg = Release|Any CPU
{328C148C-DBEE-41A4-B1C7-104CBB216556}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View file

@ -0,0 +1,42 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{244AF685-4E12-4893-89DA-939A2964C0FB}"
ProjectSection(SolutionItems) = preProject
License.txt = License.txt
EndProjectSection
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Parser.VS2010", "Parser\Parser.VS2010.vbproj", "{57A0B340-BDA4-4DE3-B449-52B8C51D84B8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VBScript.VS2010", "VBScript\VBScript.VS2010.csproj", "{0846368D-EA96-4AC4-81AF-E4F9B78CE60B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Asp.VS2010", "asp\Asp.VS2010.csproj", "{F076A2D0-5200-42D7-9AEA-9E1260EFB138}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AspWebApp.VS2010", "AspWebApp\AspWebApp.VS2010.csproj", "{24BF0EA3-2D82-4E85-B13D-EA9279F58812}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{57A0B340-BDA4-4DE3-B449-52B8C51D84B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{57A0B340-BDA4-4DE3-B449-52B8C51D84B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{57A0B340-BDA4-4DE3-B449-52B8C51D84B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{57A0B340-BDA4-4DE3-B449-52B8C51D84B8}.Release|Any CPU.Build.0 = Release|Any CPU
{0846368D-EA96-4AC4-81AF-E4F9B78CE60B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0846368D-EA96-4AC4-81AF-E4F9B78CE60B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0846368D-EA96-4AC4-81AF-E4F9B78CE60B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0846368D-EA96-4AC4-81AF-E4F9B78CE60B}.Release|Any CPU.Build.0 = Release|Any CPU
{F076A2D0-5200-42D7-9AEA-9E1260EFB138}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F076A2D0-5200-42D7-9AEA-9E1260EFB138}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F076A2D0-5200-42D7-9AEA-9E1260EFB138}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F076A2D0-5200-42D7-9AEA-9E1260EFB138}.Release|Any CPU.Build.0 = Release|Any CPU
{24BF0EA3-2D82-4E85-B13D-EA9279F58812}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{24BF0EA3-2D82-4E85-B13D-EA9279F58812}.Debug|Any CPU.Build.0 = Debug|Any CPU
{24BF0EA3-2D82-4E85-B13D-EA9279F58812}.Release|Any CPU.ActiveCfg = Release|Any CPU
{24BF0EA3-2D82-4E85-B13D-EA9279F58812}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View file

@ -0,0 +1,14 @@
ASP Classic Compiler
Copyright 2009-2011 Li Chen
THIRD-PARTY CREDITS AND COPYRIGHT NOTICES GO HERE
MvcContrib includes or is derivative of works distributed under the licenses listed below. The full text for most of the licenses listed below can be found in the LICENSE.txt file accompanying each work. The original copyright notices have been preserved within the respective files and or packages. Please refer to the specific files and/or packages for more detailed information about the authors, copyright notices, and licenses.
3rd Party Libraries
VBParser
-----------------
Website: http://www.panopticoncentral.net/archive/2006/03/27/11531.aspx
Copyright: (c) 2006 Paul Vick
License: Shared Source License

View 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.

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,24 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
Imports System.Reflection
Imports System.Runtime.InteropServices
<Assembly: AssemblyTitle("VBScript.NET Parser")>
<Assembly: AssemblyDescription("VBScript.NET Parser")>
<Assembly: AssemblyCompany("DLRSoft")>
<Assembly: AssemblyCopyright("Copyright (C) Microsoft Corporation 2005 and DLRSoft 2009")>
<Assembly: CLSCompliant(True)>
<Assembly: ComVisible(False)>
<Assembly: AssemblyVersion("1.0.0.0")>
<Assembly: AssemblyFileVersionAttribute("0.6.2.34834")>

View file

@ -0,0 +1,57 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' An external checksum for a file.
''' </summary>
Public NotInheritable Class ExternalChecksum
Private ReadOnly _Filename As String
Private ReadOnly _Guid As String
Private ReadOnly _Checksum As String
''' <summary>
''' The filename that the checksum is for.
''' </summary>
Public ReadOnly Property Filename() As String
Get
Return _Filename
End Get
End Property
''' <summary>
''' The guid of the file.
''' </summary>
Public ReadOnly Property Guid() As String
Get
Return _Guid
End Get
End Property
''' <summary>
''' The checksum for the file.
''' </summary>
Public ReadOnly Property Checksum() As String
Get
Return _Checksum
End Get
End Property
''' <summary>
''' Constructs a new external checksum.
''' </summary>
''' <param name="filename">The filename that the checksum is for.</param>
''' <param name="guid">The guid of the file.</param>
''' <param name="checksum">The checksum for the file.</param>
Public Sub New(ByVal filename As String, ByVal guid As String, ByVal checksum As String)
_Filename = filename
_Guid = guid
_Checksum = checksum
End Sub
End Class

View file

@ -0,0 +1,68 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A line mapping from a source span to an external file and line.
''' </summary>
Public NotInheritable Class ExternalLineMapping
Private ReadOnly _Start, _Finish As Location
Private ReadOnly _File As String
Private ReadOnly _Line As Long
''' <summary>
''' The start location of the mapping in the source.
''' </summary>
Public ReadOnly Property Start() As Location
Get
Return _Start
End Get
End Property
''' <summary>
''' The end location of the mapping in the source.
''' </summary>
Public ReadOnly Property Finish() As Location
Get
Return _Finish
End Get
End Property
''' <summary>
''' The external file the source maps to.
''' </summary>
Public ReadOnly Property File() As String
Get
Return _File
End Get
End Property
''' <summary>
''' The external line number the source maps to.
''' </summary>
Public ReadOnly Property Line() As Long
Get
Return _Line
End Get
End Property
''' <summary>
''' Constructs a new external line mapping.
''' </summary>
''' <param name="start">The start location in the source.</param>
''' <param name="finish">The end location in the source.</param>
''' <param name="file">The name of the external file.</param>
''' <param name="line">The line number in the external file.</param>
Public Sub New(ByVal start As Location, ByVal finish As Location, ByVal file As String, ByVal line As Long)
_Start = start
_Finish = finish
_File = file
_Line = line
End Sub
End Class

View file

@ -0,0 +1,24 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' The numeric base of an integer literal.
''' </summary>
Public Enum IntegerBase
''' <summary>Base 10.</summary>
[Decimal]
''' <summary>Base 8.</summary>
Octal
''' <summary>Base 16.</summary>
Hexadecimal
End Enum

View file

@ -0,0 +1,27 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' The version of the language you want.
''' </summary>
<Flags()> _
Public Enum LanguageVersion
None = &H0
''' <summary>Visual Basic 7.1</summary>
''' <remarks>Shipped in Visual Basic 2003</remarks>
VisualBasic71 = &H1
''' <summary>Visual Basic 8.0</summary>
''' <remarks>Shipped in Visual Basic 2005</remarks>
VisualBasic80 = &H2
All = &H3
End Enum

View file

@ -0,0 +1,48 @@
Shared Source License for VBParser
This license governs use of the accompanying software ('Software'), and your
use of the Software constitutes acceptance of this license.
You may use the Software for any commercial or noncommercial purpose,
including distributing derivative works.
In return, we simply require that you agree:
1. Not to remove any copyright or other notices from the Software.
2. That if you distribute the Software in source code form you do so only
under this license (i.e. you must include a complete copy of this license
with your distribution), and if you distribute the Software solely in
object form you only do so under a license that complies with this
license.
3. That the Software comes "as is", with no warranties. None whatsoever.
This means no express, implied or statutory warranty, including without
limitation, warranties of merchantability or fitness for a particular
purpose or any warranty of title or non-infringement. Also, you must pass
this disclaimer on whenever you distribute the Software or derivative
works.
4. That no contributor to the Software will be liable for any of those types
of damages known as indirect, special, consequential, or incidental
related to the Software or this license, to the maximum extent the law
permits, no matter what legal theory its based on. Also, you must pass
this limitation of liability on whenever you distribute the Software or
derivative works.
5. That if you sue anyone over patents that you think may apply to the
Software for a person's use of the Software, your license to the Software
ends automatically.
6. That the patent rights, if any, granted in this license only apply to the
Software, not to any derivative works you make.
7. That the Software is subject to U.S. export jurisdiction at the time it
is licensed to you, and it may be subject to additional export or import
laws in other places. You agree to comply with all such laws and
regulations that may apply to the Software after delivery of the software
to you.
8. That if you are an agency of the U.S. Government, (i) Software provided
pursuant to a solicitation issued on or after December 1, 1995, is
provided with the commercial license rights set forth in this license,
and (ii) Software provided pursuant to a solicitation issued prior to
December 1, 1995, is provided with “Restricted Rights” as set forth in
FAR, 48 C.F.R. 52.227-14 (June 1987) or DFAR, 48 C.F.R. 252.227-7013
(Oct 1988), as applicable.
9. That your rights under this License end automatically if you breach it in
any way.
10.That all rights not expressly granted to you in this license are reserved.

View file

@ -0,0 +1,160 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' Stores source code line and column information.
''' </summary>
Public Structure Location
Private ReadOnly _Index As Integer
Private ReadOnly _Line As Integer
Private ReadOnly _Column As Integer
''' <summary>
''' The index in the stream (0-based).
''' </summary>
Public ReadOnly Property Index() As Integer
Get
Return _Index
End Get
End Property
''' <summary>
''' The physical line number (1-based).
''' </summary>
Public ReadOnly Property Line() As Integer
Get
Return _Line
End Get
End Property
''' <summary>
''' The physical column number (1-based).
''' </summary>
Public ReadOnly Property Column() As Integer
Get
Return _Column
End Get
End Property
''' <summary>
''' Whether the location is a valid location.
''' </summary>
Public ReadOnly Property IsValid() As Boolean
Get
Return Line <> 0 AndAlso Column <> 0
End Get
End Property
''' <summary>
''' Constructs a new Location for a particular source location.
''' </summary>
''' <param name="index">The index in the stream (0-based).</param>
''' <param name="line">The physical line number (1-based).</param>
''' <param name="column">The physical column number (1-based).</param>
Public Sub New(ByVal index As Integer, ByVal line As Integer, ByVal column As Integer)
_Index = index
_Line = line
_Column = column
End Sub
''' <summary>
''' Compares two specified Location values to see if they are equal.
''' </summary>
''' <param name="left">One location to compare.</param>
''' <param name="right">The other location to compare.</param>
''' <returns>True if the locations are the same, False otherwise.</returns>
Public Shared Operator =(ByVal left As Location, ByVal right As Location) As Boolean
Return left.Index = right.Index
End Operator
''' <summary>
''' Compares two specified Location values to see if they are not equal.
''' </summary>
''' <param name="left">One location to compare.</param>
''' <param name="right">The other location to compare.</param>
''' <returns>True if the locations are not the same, False otherwise.</returns>
Public Shared Operator <>(ByVal left As Location, ByVal right As Location) As Boolean
Return left.Index <> right.Index
End Operator
''' <summary>
''' Compares two specified Location values to see if one is before the other.
''' </summary>
''' <param name="left">One location to compare.</param>
''' <param name="right">The other location to compare.</param>
''' <returns>True if the first location is before the other location, False otherwise.</returns>
Public Shared Operator <(ByVal left As Location, ByVal right As Location) As Boolean
Return left.Index < right.Index
End Operator
''' <summary>
''' Compares two specified Location values to see if one is after the other.
''' </summary>
''' <param name="left">One location to compare.</param>
''' <param name="right">The other location to compare.</param>
''' <returns>True if the first location is after the other location, False otherwise.</returns>
Public Shared Operator >(ByVal left As Location, ByVal right As Location) As Boolean
Return left.Index > right.Index
End Operator
''' <summary>
''' Compares two specified Location values to see if one is before or the same as the other.
''' </summary>
''' <param name="left">One location to compare.</param>
''' <param name="right">The other location to compare.</param>
''' <returns>True if the first location is before or the same as the other location, False otherwise.</returns>
Public Shared Operator <=(ByVal left As Location, ByVal right As Location) As Boolean
Return left.Index <= right.Index
End Operator
''' <summary>
''' Compares two specified Location values to see if one is after or the same as the other.
''' </summary>
''' <param name="left">One location to compare.</param>
''' <param name="right">The other location to compare.</param>
''' <returns>True if the first location is after or the same as the other location, False otherwise.</returns>
Public Shared Operator >=(ByVal left As Location, ByVal right As Location) As Boolean
Return left.Index >= right.Index
End Operator
''' <summary>
''' Compares two specified Location values.
''' </summary>
''' <param name="left">One location to compare.</param>
''' <param name="right">The other location to compare.</param>
''' <returns>0 if the locations are equal, -1 if the left one is less than the right one, 1 otherwise.</returns>
Public Shared Function Compare(ByVal left As Location, ByVal right As Location) As Integer
If left = right Then
Return 0
ElseIf left < right Then
Return -1
Else
Return 1
End If
End Function
Public Overrides Function ToString() As String
Return "(" & Me.Column & "," & Me.Line & ")"
End Function
Public Overrides Function Equals(ByVal obj As Object) As Boolean
If TypeOf obj Is Location Then
Return Me = DirectCast(obj, Location)
Else
Return False
End If
End Function
Public Overrides Function GetHashCode() As Integer
' Mask off the upper 32 bits of the index and use that as
' the hash code.
Return CInt(Index And &HFFFFFFFFL)
End Function
End Structure

View file

@ -0,0 +1,13 @@
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:2.0.50727.4005
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="Windows-1252"?>
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<MySubMain>false</MySubMain>
<SingleInstance>false</SingleInstance>
<ShutdownMode>0</ShutdownMode>
<EnableVisualStyles>true</EnableVisualStyles>
<AuthenticationMode>0</AuthenticationMode>
<ApplicationType>1</ApplicationType>
<EnableRTLMirroring>false</EnableRTLMirroring>
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
</MyApplicationData>

View file

@ -0,0 +1,453 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{57A0B340-BDA4-4DE3-B449-52B8C51D84B8}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon>
</ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>Dlrsoft.VBParser</AssemblyName>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
<AssemblyOriginatorKeyMode>None</AssemblyOriginatorKeyMode>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<OptionCompare>Binary</OptionCompare>
<OptionExplicit>On</OptionExplicit>
<OptionStrict>On</OptionStrict>
<RootNamespace>Dlrsoft.VBScript.Parser</RootNamespace>
<StartupObject>VBParser.(None)</StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>..\bin\Debug\</OutputPath>
<DocumentationFile>Dlrsoft.VBParser.xml</DocumentationFile>
<BaseAddress>285212672</BaseAddress>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>
</DefineConstants>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<DebugSymbols>true</DebugSymbols>
<Optimize>false</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>1</WarningLevel>
<NoWarn>42016,42017,42018,42019,42032</NoWarn>
<RunCodeAnalysis>false</RunCodeAnalysis>
<CodeAnalysisRules>
</CodeAnalysisRules>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>..\bin\Release40\</OutputPath>
<DocumentationFile>Dlrsoft.VBParser.xml</DocumentationFile>
<BaseAddress>285212672</BaseAddress>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>
</DefineConstants>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<DebugSymbols>false</DebugSymbols>
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>1</WarningLevel>
<NoWarn>42016,42017,42018,42019,42032</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System">
<Name>System</Name>
</Reference>
<Reference Include="System.XML" />
</ItemGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Collections.ObjectModel" />
<Import Include="System.Diagnostics" />
<Import Include="System.IO" />
<Import Include="System.Text" />
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="ExternalChecksum.vb" />
<Compile Include="ExternalLineMapping.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="IntegerBase.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Location.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
</Compile>
<Compile Include="Parser.vb" />
<Compile Include="Serializers\ErrorXmlSerializer.vb" />
<Compile Include="Serializers\TokenXmlSerializer.vb" />
<Compile Include="Serializers\TreeXmlSerializer.vb" />
<Compile Include="Tokens\UnsignedIntegerLiteralToken.vb" />
<Compile Include="Trees\Attributes\AttributeBlockCollection.vb" />
<Compile Include="Trees\Collections\TreeCollection.vb" />
<Compile Include="Trees\Declarations\AttributeDeclaration.vb" />
<Compile Include="Trees\Declarations\BlockDeclaration.vb" />
<Compile Include="Trees\Expressions\GenericQualifiedExpression.vb" />
<Compile Include="Trees\Expressions\GlobalExpression.vb" />
<Compile Include="Trees\Expressions\TryCastExpression.vb" />
<Compile Include="Trees\Files\ScriptBlock.vb" />
<Compile Include="Trees\Members\Charset.vb" />
<Compile Include="Trees\Members\AddHandlerAccessorDeclaration.vb" />
<Compile Include="Trees\Members\RemoveHandlerAccessorDeclaration.vb" />
<Compile Include="Trees\Members\RaiseEventAccessorDeclaration.vb" />
<Compile Include="Trees\Members\CustomEventDeclaration.vb" />
<Compile Include="Trees\Members\OperatorDeclaration.vb" />
<Compile Include="Trees\Names\SpecialNameTypes.vb" />
<Compile Include="Trees\Statements\ContinueStatement.vb" />
<Compile Include="Trees\Statements\UsingBlockStatement.vb" />
<Compile Include="Trees\Types\ClassDeclaration.vb" />
<Compile Include="Trees\Members\ConstructorDeclaration.vb" />
<Compile Include="Trees\Types\GenericBlockDeclaration.vb" />
<Compile Include="Trees\Declarations\Declaration.vb" />
<Compile Include="Trees\Declarations\DeclarationCollection.vb" />
<Compile Include="Trees\Types\DelegateDeclaration.vb" />
<Compile Include="Trees\Types\DelegateFunctionDeclaration.vb" />
<Compile Include="Trees\Types\DelegateSubDeclaration.vb" />
<Compile Include="Trees\Declarations\EmptyDeclaration.vb" />
<Compile Include="Trees\Declarations\EndBlockDeclaration.vb" />
<Compile Include="Trees\Types\EnumDeclaration.vb" />
<Compile Include="Trees\Members\EnumValueDeclaration.vb" />
<Compile Include="Trees\Members\EventDeclaration.vb" />
<Compile Include="Trees\Members\ExternalDeclaration.vb" />
<Compile Include="Trees\Members\ExternalFunctionDeclaration.vb" />
<Compile Include="Trees\Members\ExternalSubDeclaration.vb" />
<Compile Include="Trees\Members\FunctionDeclaration.vb" />
<Compile Include="Trees\Members\GetAccessorDeclaration.vb" />
<Compile Include="Trees\Types\ImplementsDeclaration.vb" />
<Compile Include="Trees\Files\ImportsDeclaration.vb" />
<Compile Include="Trees\Types\InheritsDeclaration.vb" />
<Compile Include="Trees\Types\InterfaceDeclaration.vb" />
<Compile Include="Trees\Members\MethodDeclaration.vb" />
<Compile Include="Trees\Declarations\ModifiedDeclaration.vb" />
<Compile Include="Trees\Types\ModuleDeclaration.vb" />
<Compile Include="Trees\Files\NamespaceDeclaration.vb" />
<Compile Include="Trees\Files\OptionDeclaration.vb" />
<Compile Include="Trees\Files\OptionType.vb" />
<Compile Include="Trees\Members\PropertyDeclaration.vb" />
<Compile Include="Trees\Members\SetAccessorDeclaration.vb" />
<Compile Include="Trees\Members\SignatureDeclaration.vb" />
<Compile Include="Trees\Types\StructureDeclaration.vb" />
<Compile Include="Trees\Members\SubDeclaration.vb" />
<Compile Include="Trees\Members\VariableListDeclaration.vb" />
<Compile Include="Trees\Expressions\AddressOfExpression.vb" />
<Compile Include="Trees\Expressions\BinaryOperatorExpression.vb" />
<Compile Include="Trees\Expressions\BooleanLiteralExpression.vb" />
<Compile Include="Trees\Expressions\CallOrIndexExpression.vb" />
<Compile Include="Trees\Expressions\CastTypeExpression.vb" />
<Compile Include="Trees\Expressions\CharacterLiteralExpression.vb" />
<Compile Include="Trees\Expressions\CTypeExpression.vb" />
<Compile Include="Trees\Expressions\DateLiteralExpression.vb" />
<Compile Include="Trees\Expressions\DecimalLiteralExpression.vb" />
<Compile Include="Trees\Expressions\DictionaryLookupExpression.vb" />
<Compile Include="Trees\Expressions\DirectCastExpression.vb" />
<Compile Include="Trees\Expressions\QualifiedExpression.vb" />
<Compile Include="Trees\Expressions\Expression.vb" />
<Compile Include="Trees\Expressions\ExpressionCollection.vb" />
<Compile Include="Trees\Expressions\FloatingPointLiteralExpression.vb" />
<Compile Include="Trees\Expressions\GetTypeExpression.vb" />
<Compile Include="Trees\Expressions\InstanceExpression.vb" />
<Compile Include="Trees\Expressions\InstanceType.vb" />
<Compile Include="Trees\Expressions\IntegerLiteralExpression.vb" />
<Compile Include="Trees\Expressions\IntrinsicCastExpression.vb" />
<Compile Include="Trees\Expressions\LiteralExpression.vb" />
<Compile Include="Trees\Expressions\NewAggregateExpression.vb" />
<Compile Include="Trees\Expressions\NewExpression.vb" />
<Compile Include="Trees\Expressions\NothingExpression.vb" />
<Compile Include="Trees\Expressions\OperatorType.vb" />
<Compile Include="Trees\Expressions\ParentheticalExpression.vb" />
<Compile Include="Trees\Expressions\SimpleNameExpression.vb" />
<Compile Include="Trees\Expressions\StringLiteralExpression.vb" />
<Compile Include="Trees\Expressions\TypeOfExpression.vb" />
<Compile Include="Trees\Expressions\TypeReferenceExpression.vb" />
<Compile Include="Trees\Expressions\UnaryExpression.vb" />
<Compile Include="Trees\Expressions\UnaryOperatorExpression.vb" />
<Compile Include="Trees\Files\File.vb" />
<Compile Include="Trees\Imports\AliasImport.vb" />
<Compile Include="Trees\Imports\Import.vb" />
<Compile Include="Trees\Imports\ImportCollection.vb" />
<Compile Include="Trees\Imports\NameImport.vb" />
<Compile Include="Trees\Initializers\AggregateInitializer.vb" />
<Compile Include="Trees\Initializers\ExpressionInitializer.vb" />
<Compile Include="Trees\Initializers\Initializer.vb" />
<Compile Include="Trees\Initializers\InitializerCollection.vb" />
<Compile Include="Trees\Modifiers\Modifier.vb" />
<Compile Include="Trees\Modifiers\ModifierCollection.vb" />
<Compile Include="Trees\Modifiers\ModifierTypes.vb" />
<Compile Include="Trees\Names\SpecialName.vb" />
<Compile Include="Trees\Names\Name.vb" />
<Compile Include="Trees\Names\NameCollection.vb" />
<Compile Include="Trees\Names\QualifiedName.vb" />
<Compile Include="Trees\Names\SimpleName.vb" />
<Compile Include="Trees\Names\VariableName.vb" />
<Compile Include="Trees\Names\VariableNameCollection.vb" />
<Compile Include="Trees\Parameters\Parameter.vb" />
<Compile Include="Trees\Parameters\ParameterCollection.vb" />
<Compile Include="Trees\Statements\AddHandlerStatement.vb" />
<Compile Include="Trees\Statements\AssignmentStatement.vb" />
<Compile Include="Trees\Statements\BlockStatement.vb" />
<Compile Include="Trees\Statements\CallStatement.vb" />
<Compile Include="Trees\Statements\CaseBlockStatement.vb" />
<Compile Include="Trees\Statements\CaseElseBlockStatement.vb" />
<Compile Include="Trees\Statements\CaseElseStatement.vb" />
<Compile Include="Trees\Statements\CaseStatement.vb" />
<Compile Include="Trees\Statements\CatchBlockStatement.vb" />
<Compile Include="Trees\Statements\CatchStatement.vb" />
<Compile Include="Trees\Statements\CompoundAssignmentStatement.vb" />
<Compile Include="Trees\Statements\DoBlockStatement.vb" />
<Compile Include="Trees\Statements\ElseBlockStatement.vb" />
<Compile Include="Trees\Statements\ElseIfBlockStatement.vb" />
<Compile Include="Trees\Statements\ElseIfStatement.vb" />
<Compile Include="Trees\Statements\ElseStatement.vb" />
<Compile Include="Trees\Statements\EmptyStatement.vb" />
<Compile Include="Trees\Statements\EndBlockStatement.vb" />
<Compile Include="Trees\Statements\EndStatement.vb" />
<Compile Include="Trees\Statements\EraseStatement.vb" />
<Compile Include="Trees\Statements\ErrorStatement.vb" />
<Compile Include="Trees\Statements\ExitStatement.vb" />
<Compile Include="Trees\Statements\ExpressionBlockStatement.vb" />
<Compile Include="Trees\Statements\ExpressionStatement.vb" />
<Compile Include="Trees\Statements\FinallyBlockStatement.vb" />
<Compile Include="Trees\Statements\FinallyStatement.vb" />
<Compile Include="Trees\Statements\ForBlockStatement.vb" />
<Compile Include="Trees\Statements\ForEachBlockStatement.vb" />
<Compile Include="Trees\Statements\GotoStatement.vb" />
<Compile Include="Trees\Statements\HandlerStatement.vb" />
<Compile Include="Trees\Statements\IfBlockStatement.vb" />
<Compile Include="Trees\Statements\LabelReferenceStatement.vb" />
<Compile Include="Trees\Statements\LabelStatement.vb" />
<Compile Include="Trees\Statements\LineIfStatement.vb" />
<Compile Include="Trees\Statements\LocalDeclarationStatement.vb" />
<Compile Include="Trees\Statements\LoopStatement.vb" />
<Compile Include="Trees\Statements\MidAssignmentStatement.vb" />
<Compile Include="Trees\Statements\NextStatement.vb" />
<Compile Include="Trees\Statements\OnErrorStatement.vb" />
<Compile Include="Trees\Statements\OnErrorType.vb" />
<Compile Include="Trees\Statements\RaiseEventStatement.vb" />
<Compile Include="Trees\Statements\ReDimStatement.vb" />
<Compile Include="Trees\Statements\RemoveHandlerStatement.vb" />
<Compile Include="Trees\Statements\ResumeStatement.vb" />
<Compile Include="Trees\Statements\ResumeType.vb" />
<Compile Include="Trees\Statements\ReturnStatement.vb" />
<Compile Include="Trees\Statements\SelectBlockStatement.vb" />
<Compile Include="Trees\Statements\Statement.vb" />
<Compile Include="Trees\Statements\StatementCollection.vb" />
<Compile Include="Trees\Statements\StopStatement.vb" />
<Compile Include="Trees\Statements\SyncLockBlockStatement.vb" />
<Compile Include="Trees\Statements\ThrowStatement.vb" />
<Compile Include="Trees\Statements\TryBlockStatement.vb" />
<Compile Include="Trees\Statements\WhileStatement.vb" />
<Compile Include="Trees\Statements\WithStatement.vb" />
<Compile Include="Trees\TypeParameters\TypeParameter.vb" />
<Compile Include="Trees\TypeNames\ArrayTypeName.vb" />
<Compile Include="Trees\TypeNames\ConstructedTypeName.vb" />
<Compile Include="Trees\TypeNames\IntrinsicTypeName.vb" />
<Compile Include="Trees\TypeNames\NamedTypeName.vb" />
<Compile Include="Trees\TypeNames\TypeName.vb" />
<Compile Include="Trees\TypeNames\TypeNameCollection.vb" />
<Compile Include="Trees\TypeNames\TypeArgumentCollection.vb" />
<Compile Include="Trees\TypeParameters\TypeConstraintCollection.vb" />
<Compile Include="Trees\TypeParameters\TypeParameterCollection.vb" />
<Compile Include="Trees\VariableDeclarators\VariableDeclarator.vb" />
<Compile Include="Trees\VariableDeclarators\VariableDeclaratorCollection.vb" />
<Compile Include="TypeCharacter.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Scanner.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="SourceRegion.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Span.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="SyntaxError.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="SyntaxErrorType.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tokens\CharacterLiteralToken.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tokens\CommentToken.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tokens\DateLiteralToken.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tokens\DecimalLiteralToken.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tokens\EndOfStreamToken.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tokens\ErrorToken.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tokens\FloatingPointLiteralToken.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tokens\IdentifierToken.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tokens\IntegerLiteralToken.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tokens\LineTerminatorToken.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tokens\PunctuatorToken.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tokens\StringLiteralToken.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tokens\Token.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tokens\TokenType.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\Arguments\Argument.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\Arguments\ArgumentCollection.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\Attributes\Attribute.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\Attributes\AttributeCollection.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\Attributes\AttributeTypes.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\BlockType.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\CaseClauses\CaseClause.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\CaseClauses\CaseClauseCollection.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\CaseClauses\ComparisonCaseClause.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\CaseClauses\RangeCaseClause.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\Collections\ColonDelimitedTreeCollection.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\Collections\CommaDelimitedTreeCollection.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\Comments\Comment.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\IntrinsicType.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\Tree.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\TreeType.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="LanguageVersion.vb" />
</ItemGroup>
<ItemGroup>
<None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
<Visible>False</Visible>
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
<Visible>False</Visible>
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.VisualBasic.PowerPacks.10.0">
<Visible>False</Visible>
<ProductName>Microsoft Visual Basic PowerPacks 10.0</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.Targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,447 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{57A0B340-BDA4-4DE3-B449-52B8C51D84B8}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon>
</ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>Dlrsoft.VBParser</AssemblyName>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
<AssemblyOriginatorKeyMode>None</AssemblyOriginatorKeyMode>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<OptionCompare>Binary</OptionCompare>
<OptionExplicit>On</OptionExplicit>
<OptionStrict>On</OptionStrict>
<RootNamespace>Dlrsoft.VBScript.Parser</RootNamespace>
<StartupObject>VBParser.(None)</StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>..\bin\Debug</OutputPath>
<DocumentationFile>Dlrsoft.VBParser.xml</DocumentationFile>
<BaseAddress>285212672</BaseAddress>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>
</DefineConstants>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<DebugSymbols>true</DebugSymbols>
<Optimize>false</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>1</WarningLevel>
<NoWarn>42016,42017,42018,42019,42032</NoWarn>
<RunCodeAnalysis>false</RunCodeAnalysis>
<CodeAnalysisRules>
</CodeAnalysisRules>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>..\bin\Release\</OutputPath>
<DocumentationFile>Dlrsoft.VBParser.xml</DocumentationFile>
<BaseAddress>285212672</BaseAddress>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>
</DefineConstants>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<DebugSymbols>false</DebugSymbols>
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>1</WarningLevel>
<NoWarn>42016,42017,42018,42019,42032</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System">
<Name>System</Name>
</Reference>
<Reference Include="System.XML" />
</ItemGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Collections.ObjectModel" />
<Import Include="System.Diagnostics" />
<Import Include="System.IO" />
<Import Include="System.Text" />
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="ExternalChecksum.vb" />
<Compile Include="ExternalLineMapping.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="IntegerBase.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Location.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
</Compile>
<Compile Include="Parser.vb" />
<Compile Include="Serializers\ErrorXmlSerializer.vb" />
<Compile Include="Serializers\TokenXmlSerializer.vb" />
<Compile Include="Serializers\TreeXmlSerializer.vb" />
<Compile Include="Tokens\UnsignedIntegerLiteralToken.vb" />
<Compile Include="Trees\Attributes\AttributeBlockCollection.vb" />
<Compile Include="Trees\Collections\TreeCollection.vb" />
<Compile Include="Trees\Declarations\AttributeDeclaration.vb" />
<Compile Include="Trees\Declarations\BlockDeclaration.vb" />
<Compile Include="Trees\Expressions\GenericQualifiedExpression.vb" />
<Compile Include="Trees\Expressions\GlobalExpression.vb" />
<Compile Include="Trees\Expressions\TryCastExpression.vb" />
<Compile Include="Trees\Files\ScriptBlock.vb" />
<Compile Include="Trees\Members\Charset.vb" />
<Compile Include="Trees\Members\AddHandlerAccessorDeclaration.vb" />
<Compile Include="Trees\Members\RemoveHandlerAccessorDeclaration.vb" />
<Compile Include="Trees\Members\RaiseEventAccessorDeclaration.vb" />
<Compile Include="Trees\Members\CustomEventDeclaration.vb" />
<Compile Include="Trees\Members\OperatorDeclaration.vb" />
<Compile Include="Trees\Names\SpecialNameTypes.vb" />
<Compile Include="Trees\Statements\ContinueStatement.vb" />
<Compile Include="Trees\Statements\UsingBlockStatement.vb" />
<Compile Include="Trees\Types\ClassDeclaration.vb" />
<Compile Include="Trees\Members\ConstructorDeclaration.vb" />
<Compile Include="Trees\Types\GenericBlockDeclaration.vb" />
<Compile Include="Trees\Declarations\Declaration.vb" />
<Compile Include="Trees\Declarations\DeclarationCollection.vb" />
<Compile Include="Trees\Types\DelegateDeclaration.vb" />
<Compile Include="Trees\Types\DelegateFunctionDeclaration.vb" />
<Compile Include="Trees\Types\DelegateSubDeclaration.vb" />
<Compile Include="Trees\Declarations\EmptyDeclaration.vb" />
<Compile Include="Trees\Declarations\EndBlockDeclaration.vb" />
<Compile Include="Trees\Types\EnumDeclaration.vb" />
<Compile Include="Trees\Members\EnumValueDeclaration.vb" />
<Compile Include="Trees\Members\EventDeclaration.vb" />
<Compile Include="Trees\Members\ExternalDeclaration.vb" />
<Compile Include="Trees\Members\ExternalFunctionDeclaration.vb" />
<Compile Include="Trees\Members\ExternalSubDeclaration.vb" />
<Compile Include="Trees\Members\FunctionDeclaration.vb" />
<Compile Include="Trees\Members\GetAccessorDeclaration.vb" />
<Compile Include="Trees\Types\ImplementsDeclaration.vb" />
<Compile Include="Trees\Files\ImportsDeclaration.vb" />
<Compile Include="Trees\Types\InheritsDeclaration.vb" />
<Compile Include="Trees\Types\InterfaceDeclaration.vb" />
<Compile Include="Trees\Members\MethodDeclaration.vb" />
<Compile Include="Trees\Declarations\ModifiedDeclaration.vb" />
<Compile Include="Trees\Types\ModuleDeclaration.vb" />
<Compile Include="Trees\Files\NamespaceDeclaration.vb" />
<Compile Include="Trees\Files\OptionDeclaration.vb" />
<Compile Include="Trees\Files\OptionType.vb" />
<Compile Include="Trees\Members\PropertyDeclaration.vb" />
<Compile Include="Trees\Members\SetAccessorDeclaration.vb" />
<Compile Include="Trees\Members\SignatureDeclaration.vb" />
<Compile Include="Trees\Types\StructureDeclaration.vb" />
<Compile Include="Trees\Members\SubDeclaration.vb" />
<Compile Include="Trees\Members\VariableListDeclaration.vb" />
<Compile Include="Trees\Expressions\AddressOfExpression.vb" />
<Compile Include="Trees\Expressions\BinaryOperatorExpression.vb" />
<Compile Include="Trees\Expressions\BooleanLiteralExpression.vb" />
<Compile Include="Trees\Expressions\CallOrIndexExpression.vb" />
<Compile Include="Trees\Expressions\CastTypeExpression.vb" />
<Compile Include="Trees\Expressions\CharacterLiteralExpression.vb" />
<Compile Include="Trees\Expressions\CTypeExpression.vb" />
<Compile Include="Trees\Expressions\DateLiteralExpression.vb" />
<Compile Include="Trees\Expressions\DecimalLiteralExpression.vb" />
<Compile Include="Trees\Expressions\DictionaryLookupExpression.vb" />
<Compile Include="Trees\Expressions\DirectCastExpression.vb" />
<Compile Include="Trees\Expressions\QualifiedExpression.vb" />
<Compile Include="Trees\Expressions\Expression.vb" />
<Compile Include="Trees\Expressions\ExpressionCollection.vb" />
<Compile Include="Trees\Expressions\FloatingPointLiteralExpression.vb" />
<Compile Include="Trees\Expressions\GetTypeExpression.vb" />
<Compile Include="Trees\Expressions\InstanceExpression.vb" />
<Compile Include="Trees\Expressions\InstanceType.vb" />
<Compile Include="Trees\Expressions\IntegerLiteralExpression.vb" />
<Compile Include="Trees\Expressions\IntrinsicCastExpression.vb" />
<Compile Include="Trees\Expressions\LiteralExpression.vb" />
<Compile Include="Trees\Expressions\NewAggregateExpression.vb" />
<Compile Include="Trees\Expressions\NewExpression.vb" />
<Compile Include="Trees\Expressions\NothingExpression.vb" />
<Compile Include="Trees\Expressions\OperatorType.vb" />
<Compile Include="Trees\Expressions\ParentheticalExpression.vb" />
<Compile Include="Trees\Expressions\SimpleNameExpression.vb" />
<Compile Include="Trees\Expressions\StringLiteralExpression.vb" />
<Compile Include="Trees\Expressions\TypeOfExpression.vb" />
<Compile Include="Trees\Expressions\TypeReferenceExpression.vb" />
<Compile Include="Trees\Expressions\UnaryExpression.vb" />
<Compile Include="Trees\Expressions\UnaryOperatorExpression.vb" />
<Compile Include="Trees\Files\File.vb" />
<Compile Include="Trees\Imports\AliasImport.vb" />
<Compile Include="Trees\Imports\Import.vb" />
<Compile Include="Trees\Imports\ImportCollection.vb" />
<Compile Include="Trees\Imports\NameImport.vb" />
<Compile Include="Trees\Initializers\AggregateInitializer.vb" />
<Compile Include="Trees\Initializers\ExpressionInitializer.vb" />
<Compile Include="Trees\Initializers\Initializer.vb" />
<Compile Include="Trees\Initializers\InitializerCollection.vb" />
<Compile Include="Trees\Modifiers\Modifier.vb" />
<Compile Include="Trees\Modifiers\ModifierCollection.vb" />
<Compile Include="Trees\Modifiers\ModifierTypes.vb" />
<Compile Include="Trees\Names\SpecialName.vb" />
<Compile Include="Trees\Names\Name.vb" />
<Compile Include="Trees\Names\NameCollection.vb" />
<Compile Include="Trees\Names\QualifiedName.vb" />
<Compile Include="Trees\Names\SimpleName.vb" />
<Compile Include="Trees\Names\VariableName.vb" />
<Compile Include="Trees\Names\VariableNameCollection.vb" />
<Compile Include="Trees\Parameters\Parameter.vb" />
<Compile Include="Trees\Parameters\ParameterCollection.vb" />
<Compile Include="Trees\Statements\AddHandlerStatement.vb" />
<Compile Include="Trees\Statements\AssignmentStatement.vb" />
<Compile Include="Trees\Statements\BlockStatement.vb" />
<Compile Include="Trees\Statements\CallStatement.vb" />
<Compile Include="Trees\Statements\CaseBlockStatement.vb" />
<Compile Include="Trees\Statements\CaseElseBlockStatement.vb" />
<Compile Include="Trees\Statements\CaseElseStatement.vb" />
<Compile Include="Trees\Statements\CaseStatement.vb" />
<Compile Include="Trees\Statements\CatchBlockStatement.vb" />
<Compile Include="Trees\Statements\CatchStatement.vb" />
<Compile Include="Trees\Statements\CompoundAssignmentStatement.vb" />
<Compile Include="Trees\Statements\DoBlockStatement.vb" />
<Compile Include="Trees\Statements\ElseBlockStatement.vb" />
<Compile Include="Trees\Statements\ElseIfBlockStatement.vb" />
<Compile Include="Trees\Statements\ElseIfStatement.vb" />
<Compile Include="Trees\Statements\ElseStatement.vb" />
<Compile Include="Trees\Statements\EmptyStatement.vb" />
<Compile Include="Trees\Statements\EndBlockStatement.vb" />
<Compile Include="Trees\Statements\EndStatement.vb" />
<Compile Include="Trees\Statements\EraseStatement.vb" />
<Compile Include="Trees\Statements\ErrorStatement.vb" />
<Compile Include="Trees\Statements\ExitStatement.vb" />
<Compile Include="Trees\Statements\ExpressionBlockStatement.vb" />
<Compile Include="Trees\Statements\ExpressionStatement.vb" />
<Compile Include="Trees\Statements\FinallyBlockStatement.vb" />
<Compile Include="Trees\Statements\FinallyStatement.vb" />
<Compile Include="Trees\Statements\ForBlockStatement.vb" />
<Compile Include="Trees\Statements\ForEachBlockStatement.vb" />
<Compile Include="Trees\Statements\GotoStatement.vb" />
<Compile Include="Trees\Statements\HandlerStatement.vb" />
<Compile Include="Trees\Statements\IfBlockStatement.vb" />
<Compile Include="Trees\Statements\LabelReferenceStatement.vb" />
<Compile Include="Trees\Statements\LabelStatement.vb" />
<Compile Include="Trees\Statements\LineIfStatement.vb" />
<Compile Include="Trees\Statements\LocalDeclarationStatement.vb" />
<Compile Include="Trees\Statements\LoopStatement.vb" />
<Compile Include="Trees\Statements\MidAssignmentStatement.vb" />
<Compile Include="Trees\Statements\NextStatement.vb" />
<Compile Include="Trees\Statements\OnErrorStatement.vb" />
<Compile Include="Trees\Statements\OnErrorType.vb" />
<Compile Include="Trees\Statements\RaiseEventStatement.vb" />
<Compile Include="Trees\Statements\ReDimStatement.vb" />
<Compile Include="Trees\Statements\RemoveHandlerStatement.vb" />
<Compile Include="Trees\Statements\ResumeStatement.vb" />
<Compile Include="Trees\Statements\ResumeType.vb" />
<Compile Include="Trees\Statements\ReturnStatement.vb" />
<Compile Include="Trees\Statements\SelectBlockStatement.vb" />
<Compile Include="Trees\Statements\Statement.vb" />
<Compile Include="Trees\Statements\StatementCollection.vb" />
<Compile Include="Trees\Statements\StopStatement.vb" />
<Compile Include="Trees\Statements\SyncLockBlockStatement.vb" />
<Compile Include="Trees\Statements\ThrowStatement.vb" />
<Compile Include="Trees\Statements\TryBlockStatement.vb" />
<Compile Include="Trees\Statements\WhileStatement.vb" />
<Compile Include="Trees\Statements\WithStatement.vb" />
<Compile Include="Trees\TypeParameters\TypeParameter.vb" />
<Compile Include="Trees\TypeNames\ArrayTypeName.vb" />
<Compile Include="Trees\TypeNames\ConstructedTypeName.vb" />
<Compile Include="Trees\TypeNames\IntrinsicTypeName.vb" />
<Compile Include="Trees\TypeNames\NamedTypeName.vb" />
<Compile Include="Trees\TypeNames\TypeName.vb" />
<Compile Include="Trees\TypeNames\TypeNameCollection.vb" />
<Compile Include="Trees\TypeNames\TypeArgumentCollection.vb" />
<Compile Include="Trees\TypeParameters\TypeConstraintCollection.vb" />
<Compile Include="Trees\TypeParameters\TypeParameterCollection.vb" />
<Compile Include="Trees\VariableDeclarators\VariableDeclarator.vb" />
<Compile Include="Trees\VariableDeclarators\VariableDeclaratorCollection.vb" />
<Compile Include="TypeCharacter.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Scanner.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="SourceRegion.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Span.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="SyntaxError.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="SyntaxErrorType.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tokens\CharacterLiteralToken.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tokens\CommentToken.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tokens\DateLiteralToken.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tokens\DecimalLiteralToken.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tokens\EndOfStreamToken.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tokens\ErrorToken.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tokens\FloatingPointLiteralToken.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tokens\IdentifierToken.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tokens\IntegerLiteralToken.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tokens\LineTerminatorToken.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tokens\PunctuatorToken.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tokens\StringLiteralToken.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tokens\Token.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Tokens\TokenType.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\Arguments\Argument.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\Arguments\ArgumentCollection.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\Attributes\Attribute.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\Attributes\AttributeCollection.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\Attributes\AttributeTypes.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\BlockType.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\CaseClauses\CaseClause.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\CaseClauses\CaseClauseCollection.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\CaseClauses\ComparisonCaseClause.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\CaseClauses\RangeCaseClause.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\Collections\ColonDelimitedTreeCollection.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\Collections\CommaDelimitedTreeCollection.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\Comments\Comment.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\IntrinsicType.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\Tree.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="Trees\TreeType.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="LanguageVersion.vb" />
</ItemGroup>
<ItemGroup>
<None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
<Visible>False</Visible>
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
<Visible>False</Visible>
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.Targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View file

@ -0,0 +1,305 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{FAE34487-11A6-4EE2-96BB-7F73C7611097}</ProjectGuid>
<ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>Dlrsoft.VBScript.Parser</RootNamespace>
<AssemblyName>Dlrsoft.VBParser</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<SilverlightApplication>false</SilverlightApplication>
<ValidateXaml>true</ValidateXaml>
<ThrowErrorsInValidation>true</ThrowErrorsInValidation>
<OptionExplicit>On</OptionExplicit>
<OptionCompare>Binary</OptionCompare>
<OptionStrict>Off</OptionStrict>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<MyType>Empty</MyType>
<OutputPath>..Bin\Silverlight Debug\</OutputPath>
<DocumentationFile>Dlrsoft.VBParser.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
<DefineConstants>SILVERLIGHT=1</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<Optimize>true</Optimize>
<OutputPath>..\Bin\Silverlight Release\</OutputPath>
<DocumentationFile>Dlrsoft.VBParser.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
<DefineConstants>SILVERLIGHT=1</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="System.Windows" />
<Reference Include="mscorlib" />
<Reference Include="system" />
<Reference Include="System.Core" />
<Reference Include="System.Net" />
<Reference Include="System.Xml" />
<Reference Include="System.Windows.Browser" />
</ItemGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Collections.ObjectModel" />
<Import Include="System.Diagnostics" />
<Import Include="System.IO" />
<Import Include="System.Text" />
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.vb" />
<Compile Include="ExternalChecksum.vb" />
<Compile Include="ExternalLineMapping.vb" />
<Compile Include="IntegerBase.vb" />
<Compile Include="LanguageVersion.vb" />
<Compile Include="Location.vb" />
<Compile Include="Parser.vb" />
<Compile Include="Scanner.vb" />
<Compile Include="Serializers\ErrorXmlSerializer.vb" />
<Compile Include="Serializers\TokenXmlSerializer.vb" />
<Compile Include="Serializers\TreeXmlSerializer.vb" />
<Compile Include="SourceRegion.vb" />
<Compile Include="Span.vb" />
<Compile Include="SyntaxError.vb" />
<Compile Include="SyntaxErrorType.vb" />
<Compile Include="Tokens\CharacterLiteralToken.vb" />
<Compile Include="Tokens\CommentToken.vb" />
<Compile Include="Tokens\DateLiteralToken.vb" />
<Compile Include="Tokens\DecimalLiteralToken.vb" />
<Compile Include="Tokens\EndOfStreamToken.vb" />
<Compile Include="Tokens\ErrorToken.vb" />
<Compile Include="Tokens\FloatingPointLiteralToken.vb" />
<Compile Include="Tokens\IdentifierToken.vb" />
<Compile Include="Tokens\IntegerLiteralToken.vb" />
<Compile Include="Tokens\LineTerminatorToken.vb" />
<Compile Include="Tokens\PunctuatorToken.vb" />
<Compile Include="Tokens\StringLiteralToken.vb" />
<Compile Include="Tokens\Token.vb" />
<Compile Include="Tokens\TokenType.vb" />
<Compile Include="Tokens\UnsignedIntegerLiteralToken.vb" />
<Compile Include="Trees\Arguments\Argument.vb" />
<Compile Include="Trees\Arguments\ArgumentCollection.vb" />
<Compile Include="Trees\Attributes\Attribute.vb" />
<Compile Include="Trees\Attributes\AttributeBlockCollection.vb" />
<Compile Include="Trees\Attributes\AttributeCollection.vb" />
<Compile Include="Trees\Attributes\AttributeTypes.vb" />
<Compile Include="Trees\BlockType.vb" />
<Compile Include="Trees\CaseClauses\CaseClause.vb" />
<Compile Include="Trees\CaseClauses\CaseClauseCollection.vb" />
<Compile Include="Trees\CaseClauses\ComparisonCaseClause.vb" />
<Compile Include="Trees\CaseClauses\RangeCaseClause.vb" />
<Compile Include="Trees\Collections\ColonDelimitedTreeCollection.vb" />
<Compile Include="Trees\Collections\CommaDelimitedTreeCollection.vb" />
<Compile Include="Trees\Collections\TreeCollection.vb" />
<Compile Include="Trees\Comments\Comment.vb" />
<Compile Include="Trees\Declarations\AttributeDeclaration.vb" />
<Compile Include="Trees\Declarations\BlockDeclaration.vb" />
<Compile Include="Trees\Declarations\Declaration.vb" />
<Compile Include="Trees\Declarations\DeclarationCollection.vb" />
<Compile Include="Trees\Declarations\EmptyDeclaration.vb" />
<Compile Include="Trees\Declarations\EndBlockDeclaration.vb" />
<Compile Include="Trees\Declarations\ModifiedDeclaration.vb" />
<Compile Include="Trees\Expressions\AddressOfExpression.vb" />
<Compile Include="Trees\Expressions\BinaryOperatorExpression.vb" />
<Compile Include="Trees\Expressions\BooleanLiteralExpression.vb" />
<Compile Include="Trees\Expressions\CallOrIndexExpression.vb" />
<Compile Include="Trees\Expressions\CastTypeExpression.vb" />
<Compile Include="Trees\Expressions\CharacterLiteralExpression.vb" />
<Compile Include="Trees\Expressions\CTypeExpression.vb" />
<Compile Include="Trees\Expressions\DateLiteralExpression.vb" />
<Compile Include="Trees\Expressions\DecimalLiteralExpression.vb" />
<Compile Include="Trees\Expressions\DictionaryLookupExpression.vb" />
<Compile Include="Trees\Expressions\DirectCastExpression.vb" />
<Compile Include="Trees\Expressions\Expression.vb" />
<Compile Include="Trees\Expressions\ExpressionCollection.vb" />
<Compile Include="Trees\Expressions\FloatingPointLiteralExpression.vb" />
<Compile Include="Trees\Expressions\GenericQualifiedExpression.vb" />
<Compile Include="Trees\Expressions\GetTypeExpression.vb" />
<Compile Include="Trees\Expressions\GlobalExpression.vb" />
<Compile Include="Trees\Expressions\InstanceExpression.vb" />
<Compile Include="Trees\Expressions\InstanceType.vb" />
<Compile Include="Trees\Expressions\IntegerLiteralExpression.vb" />
<Compile Include="Trees\Expressions\IntrinsicCastExpression.vb" />
<Compile Include="Trees\Expressions\LiteralExpression.vb" />
<Compile Include="Trees\Expressions\NewAggregateExpression.vb" />
<Compile Include="Trees\Expressions\NewExpression.vb" />
<Compile Include="Trees\Expressions\NothingExpression.vb" />
<Compile Include="Trees\Expressions\OperatorType.vb" />
<Compile Include="Trees\Expressions\ParentheticalExpression.vb" />
<Compile Include="Trees\Expressions\QualifiedExpression.vb" />
<Compile Include="Trees\Expressions\SimpleNameExpression.vb" />
<Compile Include="Trees\Expressions\StringLiteralExpression.vb" />
<Compile Include="Trees\Expressions\TryCastExpression.vb" />
<Compile Include="Trees\Expressions\TypeOfExpression.vb" />
<Compile Include="Trees\Expressions\TypeReferenceExpression.vb" />
<Compile Include="Trees\Expressions\UnaryExpression.vb" />
<Compile Include="Trees\Expressions\UnaryOperatorExpression.vb" />
<Compile Include="Trees\Files\File.vb" />
<Compile Include="Trees\Files\ImportsDeclaration.vb" />
<Compile Include="Trees\Files\NamespaceDeclaration.vb" />
<Compile Include="Trees\Files\OptionDeclaration.vb" />
<Compile Include="Trees\Files\OptionType.vb" />
<Compile Include="Trees\Files\ScriptBlock.vb" />
<Compile Include="Trees\Imports\AliasImport.vb" />
<Compile Include="Trees\Imports\Import.vb" />
<Compile Include="Trees\Imports\ImportCollection.vb" />
<Compile Include="Trees\Imports\NameImport.vb" />
<Compile Include="Trees\Initializers\AggregateInitializer.vb" />
<Compile Include="Trees\Initializers\ExpressionInitializer.vb" />
<Compile Include="Trees\Initializers\Initializer.vb" />
<Compile Include="Trees\Initializers\InitializerCollection.vb" />
<Compile Include="Trees\IntrinsicType.vb" />
<Compile Include="Trees\Members\AddHandlerAccessorDeclaration.vb" />
<Compile Include="Trees\Members\Charset.vb" />
<Compile Include="Trees\Members\ConstructorDeclaration.vb" />
<Compile Include="Trees\Members\CustomEventDeclaration.vb" />
<Compile Include="Trees\Members\EnumValueDeclaration.vb" />
<Compile Include="Trees\Members\EventDeclaration.vb" />
<Compile Include="Trees\Members\ExternalDeclaration.vb" />
<Compile Include="Trees\Members\ExternalFunctionDeclaration.vb" />
<Compile Include="Trees\Members\ExternalSubDeclaration.vb" />
<Compile Include="Trees\Members\FunctionDeclaration.vb" />
<Compile Include="Trees\Members\GetAccessorDeclaration.vb" />
<Compile Include="Trees\Members\MethodDeclaration.vb" />
<Compile Include="Trees\Members\OperatorDeclaration.vb" />
<Compile Include="Trees\Members\PropertyDeclaration.vb" />
<Compile Include="Trees\Members\RaiseEventAccessorDeclaration.vb" />
<Compile Include="Trees\Members\RemoveHandlerAccessorDeclaration.vb" />
<Compile Include="Trees\Members\SetAccessorDeclaration.vb" />
<Compile Include="Trees\Members\SignatureDeclaration.vb" />
<Compile Include="Trees\Members\SubDeclaration.vb" />
<Compile Include="Trees\Members\VariableListDeclaration.vb" />
<Compile Include="Trees\Modifiers\Modifier.vb" />
<Compile Include="Trees\Modifiers\ModifierCollection.vb" />
<Compile Include="Trees\Modifiers\ModifierTypes.vb" />
<Compile Include="Trees\Names\GlobalNamespaceName.vb" />
<Compile Include="Trees\Names\Name.vb" />
<Compile Include="Trees\Names\NameCollection.vb" />
<Compile Include="Trees\Names\QualifiedName.vb" />
<Compile Include="Trees\Names\SimpleName.vb" />
<Compile Include="Trees\Names\SpecialName.vb" />
<Compile Include="Trees\Names\SpecialNameTypes.vb" />
<Compile Include="Trees\Names\VariableName.vb" />
<Compile Include="Trees\Names\VariableNameCollection.vb" />
<Compile Include="Trees\Parameters\Parameter.vb" />
<Compile Include="Trees\Parameters\ParameterCollection.vb" />
<Compile Include="Trees\Statements\AddHandlerStatement.vb" />
<Compile Include="Trees\Statements\AssignmentStatement.vb" />
<Compile Include="Trees\Statements\BlockStatement.vb" />
<Compile Include="Trees\Statements\CallStatement.vb" />
<Compile Include="Trees\Statements\CaseBlockStatement.vb" />
<Compile Include="Trees\Statements\CaseElseBlockStatement.vb" />
<Compile Include="Trees\Statements\CaseElseStatement.vb" />
<Compile Include="Trees\Statements\CaseStatement.vb" />
<Compile Include="Trees\Statements\CatchBlockStatement.vb" />
<Compile Include="Trees\Statements\CatchStatement.vb" />
<Compile Include="Trees\Statements\CompoundAssignmentStatement.vb" />
<Compile Include="Trees\Statements\ContinueStatement.vb" />
<Compile Include="Trees\Statements\DoBlockStatement.vb" />
<Compile Include="Trees\Statements\ElseBlockStatement.vb" />
<Compile Include="Trees\Statements\ElseIfBlockStatement.vb" />
<Compile Include="Trees\Statements\ElseIfStatement.vb" />
<Compile Include="Trees\Statements\ElseStatement.vb" />
<Compile Include="Trees\Statements\EmptyStatement.vb" />
<Compile Include="Trees\Statements\EndBlockStatement.vb" />
<Compile Include="Trees\Statements\EndStatement.vb" />
<Compile Include="Trees\Statements\EraseStatement.vb" />
<Compile Include="Trees\Statements\ErrorStatement.vb" />
<Compile Include="Trees\Statements\ExitStatement.vb" />
<Compile Include="Trees\Statements\ExpressionBlockStatement.vb" />
<Compile Include="Trees\Statements\ExpressionStatement.vb" />
<Compile Include="Trees\Statements\FinallyBlockStatement.vb" />
<Compile Include="Trees\Statements\FinallyStatement.vb" />
<Compile Include="Trees\Statements\ForBlockStatement.vb" />
<Compile Include="Trees\Statements\ForEachBlockStatement.vb" />
<Compile Include="Trees\Statements\GotoStatement.vb" />
<Compile Include="Trees\Statements\HandlerStatement.vb" />
<Compile Include="Trees\Statements\IfBlockStatement.vb" />
<Compile Include="Trees\Statements\LabelReferenceStatement.vb" />
<Compile Include="Trees\Statements\LabelStatement.vb" />
<Compile Include="Trees\Statements\LineIfStatement.vb" />
<Compile Include="Trees\Statements\LocalDeclarationStatement.vb" />
<Compile Include="Trees\Statements\LoopStatement.vb" />
<Compile Include="Trees\Statements\MidAssignmentStatement.vb" />
<Compile Include="Trees\Statements\NextStatement.vb" />
<Compile Include="Trees\Statements\OnErrorStatement.vb" />
<Compile Include="Trees\Statements\OnErrorType.vb" />
<Compile Include="Trees\Statements\RaiseEventStatement.vb" />
<Compile Include="Trees\Statements\ReDimStatement.vb" />
<Compile Include="Trees\Statements\RemoveHandlerStatement.vb" />
<Compile Include="Trees\Statements\ResumeStatement.vb" />
<Compile Include="Trees\Statements\ResumeType.vb" />
<Compile Include="Trees\Statements\ReturnStatement.vb" />
<Compile Include="Trees\Statements\SelectBlockStatement.vb" />
<Compile Include="Trees\Statements\Statement.vb" />
<Compile Include="Trees\Statements\StatementCollection.vb" />
<Compile Include="Trees\Statements\StopStatement.vb" />
<Compile Include="Trees\Statements\SyncLockBlockStatement.vb" />
<Compile Include="Trees\Statements\ThrowStatement.vb" />
<Compile Include="Trees\Statements\TryBlockStatement.vb" />
<Compile Include="Trees\Statements\UsingBlockStatement.vb" />
<Compile Include="Trees\Statements\WhileStatement.vb" />
<Compile Include="Trees\Statements\WithStatement.vb" />
<Compile Include="Trees\Tree.vb" />
<Compile Include="Trees\TreeType.vb" />
<Compile Include="Trees\TypeNames\ArrayTypeName.vb" />
<Compile Include="Trees\TypeNames\ConstructedTypeName.vb" />
<Compile Include="Trees\TypeNames\IntrinsicTypeName.vb" />
<Compile Include="Trees\TypeNames\NamedTypeName.vb" />
<Compile Include="Trees\TypeNames\TypeArgumentCollection.vb" />
<Compile Include="Trees\TypeNames\TypeName.vb" />
<Compile Include="Trees\TypeNames\TypeNameCollection.vb" />
<Compile Include="Trees\TypeParameters\TypeConstraintCollection.vb" />
<Compile Include="Trees\TypeParameters\TypeParameter.vb" />
<Compile Include="Trees\TypeParameters\TypeParameterCollection.vb" />
<Compile Include="Trees\Types\ClassDeclaration.vb" />
<Compile Include="Trees\Types\DelegateDeclaration.vb" />
<Compile Include="Trees\Types\DelegateFunctionDeclaration.vb" />
<Compile Include="Trees\Types\DelegateSubDeclaration.vb" />
<Compile Include="Trees\Types\EnumDeclaration.vb" />
<Compile Include="Trees\Types\GenericBlockDeclaration.vb" />
<Compile Include="Trees\Types\ImplementsDeclaration.vb" />
<Compile Include="Trees\Types\InheritsDeclaration.vb" />
<Compile Include="Trees\Types\InterfaceDeclaration.vb" />
<Compile Include="Trees\Types\ModuleDeclaration.vb" />
<Compile Include="Trees\Types\StructureDeclaration.vb" />
<Compile Include="Trees\VariableDeclarators\VariableDeclarator.vb" />
<Compile Include="Trees\VariableDeclarators\VariableDeclaratorCollection.vb" />
<Compile Include="TypeCharacter.vb" />
</ItemGroup>
<ItemGroup>
<Folder Include="My Project\" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\v3.0\Microsoft.Silverlight.VisualBasic.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
<SilverlightProjectProperties />
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
</Project>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,40 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
Imports System.Xml
Public Class ErrorXmlSerializer
Private ReadOnly Writer As XmlWriter
Public Sub New(ByVal Writer As XmlWriter)
Me.Writer = Writer
End Sub
Private Sub Serialize(ByVal Span As Span)
Writer.WriteAttributeString("startLine", CStr(Span.Start.Line))
Writer.WriteAttributeString("startCol", CStr(Span.Start.Column))
Writer.WriteAttributeString("endLine", CStr(Span.Finish.Line))
Writer.WriteAttributeString("endCol", CStr(Span.Finish.Column))
End Sub
Public Sub Serialize(ByVal SyntaxError As SyntaxError)
Writer.WriteStartElement(SyntaxError.Type.ToString())
Serialize(SyntaxError.Span)
Writer.WriteString(SyntaxError.ToString())
Writer.WriteEndElement()
End Sub
Public Sub Serialize(ByVal SyntaxErrors As List(Of SyntaxError))
For Each SyntaxError As SyntaxError In SyntaxErrors
Serialize(SyntaxError)
Next
End Sub
End Class

View file

@ -0,0 +1,126 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
Imports System.Xml
Public Class TokenXmlSerializer
Private ReadOnly Writer As XmlWriter
Public Sub New(ByVal Writer As XmlWriter)
Me.Writer = Writer
End Sub
Private Sub Serialize(ByVal Span As Span)
Writer.WriteAttributeString("startLine", CStr(Span.Start.Line))
Writer.WriteAttributeString("startCol", CStr(Span.Start.Column))
Writer.WriteAttributeString("endLine", CStr(Span.Finish.Line))
Writer.WriteAttributeString("endCol", CStr(Span.Finish.Column))
End Sub
Private Sub Serialize(ByVal TypeCharacter As TypeCharacter)
If TypeCharacter <> TypeCharacter.None Then
Static TypeCharacterTable As Dictionary(Of TypeCharacter, String)
If TypeCharacterTable Is Nothing Then
Dim Table As Dictionary(Of TypeCharacter, String) = New Dictionary(Of TypeCharacter, String)()
' 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 TableTypeCharacter As TypeCharacter = TypeCharacter.StringSymbol
For Index As Integer = 0 To TypeCharacters.Length - 1
Table.Add(TableTypeCharacter, TypeCharacters(Index))
TableTypeCharacter = CType(TableTypeCharacter << 1, TypeCharacter)
Next
TypeCharacterTable = Table
End If
Writer.WriteAttributeString("typeChar", TypeCharacterTable(TypeCharacter))
End If
End Sub
Public Sub Serialize(ByVal Token As Token)
Writer.WriteStartElement(Token.Type.ToString())
Serialize(Token.Span)
Select Case Token.Type
Case TokenType.LexicalError
With CType(Token, ErrorToken)
Writer.WriteAttributeString("errorNumber", CStr(.SyntaxError.Type))
Writer.WriteString(.SyntaxError.ToString())
End With
Case TokenType.Comment
With CType(Token, CommentToken)
Writer.WriteAttributeString("isRem", CStr(.IsREM))
Writer.WriteString(.Comment)
End With
Case TokenType.Identifier
With CType(Token, IdentifierToken)
Writer.WriteAttributeString("escaped", CStr(.Escaped))
Serialize(.TypeCharacter)
Writer.WriteString(.Identifier)
End With
Case TokenType.StringLiteral
With CType(Token, StringLiteralToken)
Writer.WriteString(.Literal)
End With
Case TokenType.CharacterLiteral
With CType(Token, CharacterLiteralToken)
Writer.WriteString(.Literal)
End With
Case TokenType.DateLiteral
With CType(Token, DateLiteralToken)
Writer.WriteString(CStr(.Literal))
End With
Case TokenType.IntegerLiteral
With CType(Token, IntegerLiteralToken)
Writer.WriteAttributeString("base", .IntegerBase.ToString())
Serialize(.TypeCharacter)
Writer.WriteString(CStr(.Literal))
End With
Case TokenType.FloatingPointLiteral
With CType(Token, FloatingPointLiteralToken)
Serialize(.TypeCharacter)
Writer.WriteString(CStr(.Literal))
End With
Case TokenType.DecimalLiteral
With CType(Token, DecimalLiteralToken)
Serialize(.TypeCharacter)
Writer.WriteString(CStr(.Literal))
End With
Case TokenType.UnsignedIntegerLiteral
With CType(Token, UnsignedIntegerLiteralToken)
Serialize(.TypeCharacter)
Writer.WriteString(CStr(.Literal))
End With
Case Else
' Fall through
End Select
Writer.WriteEndElement()
End Sub
Public Sub Serialize(ByVal Tokens() As Token)
For Each Token As Token In Tokens
Serialize(Token)
Next
End Sub
End Class

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,56 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A region marked in the source code.
''' </summary>
Public NotInheritable Class SourceRegion
Private ReadOnly _Start, _Finish As Location
Private ReadOnly _Description As String
''' <summary>
''' The start location of the region.
''' </summary>
Public ReadOnly Property Start() As Location
Get
Return _Start
End Get
End Property
''' <summary>
''' The end location of the region.
''' </summary>
Public ReadOnly Property Finish() As Location
Get
Return _Finish
End Get
End Property
''' <summary>
''' The description of the region.
''' </summary>
Public ReadOnly Property Description() As String
Get
Return _Description
End Get
End Property
''' <summary>
''' Constructs a new source region.
''' </summary>
''' <param name="start">The start location of the region.</param>
''' <param name="finish">The end location 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)
_Start = start
_Finish = finish
_Description = description
End Sub
End Class

View file

@ -0,0 +1,91 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' Stores the location of a span of text.
''' </summary>
''' <remarks>The end location is exclusive.</remarks>
Public Structure Span
Private ReadOnly _Start As Location
Private ReadOnly _Finish As Location
''' <summary>
''' The start location of the span.
''' </summary>
Public ReadOnly Property Start() As Location
Get
Return _Start
End Get
End Property
''' <summary>
''' The end location of the span.
''' </summary>
Public ReadOnly Property Finish() As Location
Get
Return _Finish
End Get
End Property
''' <summary>
''' Whether the locations in the span are valid.
''' </summary>
Public ReadOnly Property IsValid() As Boolean
Get
Return Start.IsValid AndAlso Finish.IsValid
End Get
End Property
''' <summary>
''' Constructs a new span with a specific start and end location.
''' </summary>
''' <param name="start">The beginning of the span.</param>
''' <param name="finish">The end of the span.</param>
Public Sub New(ByVal start As Location, ByVal finish As Location)
_Start = Start
_Finish = Finish
End Sub
''' <summary>
''' Compares two specified Span values to see if they are equal.
''' </summary>
''' <param name="left">One span to compare.</param>
''' <param name="right">The other span to compare.</param>
''' <returns>True if the spans are the same, False otherwise.</returns>
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
End Operator
''' <summary>
''' Compares two specified Span values to see if they are not equal.
''' </summary>
''' <param name="left">One 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>
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
End Operator
Public Overrides Function ToString() As String
Return Start.ToString() & " - " & Finish.ToString()
End Function
Public Overrides Function Equals(ByVal obj As Object) As Boolean
If TypeOf obj Is Span Then
Return Me = DirectCast(obj, Span)
Else
Return False
End If
End Function
Public Overrides Function GetHashCode() As Integer
Return CInt((Start.Index Xor Finish.Index) And &HFFFFFFFFL)
End Function
End Structure

View file

@ -0,0 +1,236 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A syntax error.
''' </summary>
Public NotInheritable Class SyntaxError
Private ReadOnly _Type As SyntaxErrorType
Private ReadOnly _Span As Span
''' <summary>
''' The type of the syntax error.
''' </summary>
Public ReadOnly Property Type() As SyntaxErrorType
Get
Return _Type
End Get
End Property
''' <summary>
''' The location of the syntax error.
''' </summary>
Public ReadOnly Property Span() As Span
Get
Return _Span
End Get
End Property
''' <summary>
''' Constructs a new syntax error.
''' </summary>
''' <param name="type">The type 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)
Debug.Assert(System.Enum.IsDefined(GetType(SyntaxErrorType), type))
_Type = type
_Span = span
End Sub
Public Overrides Function ToString() As String
Static Messages() As String
If Messages Is Nothing Then
Dim Strings() As String
Strings = New String() { _
"", _
"Invalid escaped identifier.", _
"Invalid identifier.", _
"Cannot put a type character on a keyword.", _
"Invalid character.", _
"Invalid character literal.", _
"Invalid string literal.", _
"Invalid date literal.", _
"Invalid floating point literal.", _
"Invalid integer literal.", _
"Invalid decimal literal.", _
"Syntax error.", _
"Expected ','.", _
"Expected '('.", _
"Expected ')'.", _
"Expected '='.", _
"Expected 'As'.", _
"Expected '}'.", _
"Expected '.'.", _
"Expected '-'.", _
"Expected 'Is'.", _
"Expected '>'.", _
"Type expected.", _
"Expected identifier.", _
"Invalid use of keyword.", _
"Bounds can be specified only for the top-level array when initializing an array of arrays.", _
"Array bounds cannot appear in type specifiers.", _
"Expected expression.", _
"Comma, ')', or a valid expression continuation expected.", _
"Expected named argument.", _
"MyBase 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.", _
"Expected 'Next'.", _
"Expected 'Resume' or 'GoTo'.", _
"Expected 'Error'.", _
"Type character does not match declared data type String.", _
"Comma, '}', or a valid expression continuation expected.", _
"Expected one of 'Dim', 'Const', 'Public', 'Private', 'Protected', 'Friend', 'Shadows', 'ReadOnly' or 'Shared'.", _
"End of statement expected.", _
"'Do' must end with a matching 'Loop'.", _
"'While' must end with a matching 'End While'.", _
"'Select' must end with a matching 'End Select'.", _
"'SyncLock' must end with a matching 'End SyncLock'.", _
"'With' must end with a matching 'End With'.", _
"'If' must end with a matching 'End If'.", _
"'Try' must end with a matching 'End Try'.", _
"'Sub' must end with a matching 'End Sub'.", _
"'Function' must end with a matching 'End Function'.", _
"'Property' must end with a matching 'End Property'.", _
"'Get' must end with a matching 'End Get'.", _
"'Set' must end with a matching 'End Set'.", _
"'Class' must end with a matching 'End Class'.", _
"'Structure' must end with a matching 'End Structure'.", _
"'Module' must end with a matching 'End Module'.", _
"'Interface' must end with a matching 'End Interface'.", _
"'Enum' must end with a matching 'End Enum'.", _
"'Namespace' must end with a matching 'End Namespace'.", _
"'Loop' cannot have a condition if matching 'Do' has one.", _
"'Loop' must be preceded by a matching 'Do'.", _
"'Next' must be preceded by a matching 'For' or 'For Each'.", _
"'End While' must be preceded by a matching 'While'.", _
"'End Select' must be preceded by a matching 'Select'.", _
"'End SyncLock' must be preceded by a matching 'SyncLock'.", _
"'End If' must be preceded by a matching 'If'.", _
"'End Try' must be preceded by a matching 'Try'.", _
"'End With' must be preceded by a matching 'With'.", _
"'Catch' cannot appear outside a 'Try' statement.", _
"'Finally' cannot appear outside a 'Try' statement.", _
"'Catch' cannot appear after 'Finally' within a 'Try' statement.", _
"'Finally' can only appear once in a 'Try' statement.", _
"'Case' must be preceded by a matching 'Select'.", _
"'Case' cannot appear after 'Case Else' within a 'Select' statement.", _
"'Case Else' can only appear once in a 'Select' statement.", _
"'Case Else' must be preceded by a matching 'Select'.", _
"'End Sub' must be preceded by a matching 'Sub'.", _
"'End Function' must be preceded by a matching 'Function'.", _
"'End Property' must be preceded by a matching 'Property'.", _
"'End Get' must be preceded by a matching 'Get'.", _
"'End Set' must be preceded by a matching 'Set'.", _
"'End Class' must be preceded by a matching 'Class'.", _
"'End Structure' must be preceded by a matching 'Structure'.", _
"'End Module' must be preceded by a matching 'Module'.", _
"'End Interface' must be preceded by a matching 'Interface'.", _
"'End Enum' must be preceded by a matching 'Enum'.", _
"'End Namespace' must be preceded by a matching 'Namespace'.", _
"Statements and labels are not valid between 'Select Case' and first 'Case'.", _
"'ElseIf' cannot appear after 'Else' within an 'If' statement.", _
"'ElseIf' must be preceded by a matching 'If'.", _
"'Else' can only appear once in an 'If' statement.", _
"'Else' must be preceded by a matching 'If'.", _
"Statement cannot end a block outside of a line 'If' statement.", _
"Attribute of this type is not allowed here.", _
"Modifier cannot be specified twice.", _
"Modifier is not valid on this declaration type.", _
"Can only specify one of 'Dim', 'Static' or 'Const'.", _
"Events cannot have a return type.", _
"Comma or ')' expected.", _
"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.", _
"'End Sub' 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 Set' must be the first statement on a line.", _
"'Sub' or 'Function' expected.", _
"String constant expected.", _
"'Lib' expected.", _
"Declaration cannot appear within a Property declaration.", _
"Declaration cannot appear within a Class declaration.", _
"Declaration cannot appear within a Structure declaration.", _
"Declaration cannot appear within a Module declaration.", _
"Declaration cannot appear within an Interface declaration.", _
"Declaration cannot appear within an Enum declaration.", _
"Declaration cannot appear within a Namespace declaration.", _
"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 an Imports declaration.", _
"Specifiers and attributes are not valid on an Option declaration.", _
"Inherits' can only specify one class.", _
"'Inherits' statements must precede all declarations.", _
"'Implements' statements must follow any 'Inherits' statement and precede all declarations in a class.", _
"Enum must contain at least one member.", _
"'Option Explicit' 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' must be followed by 'Compare', 'Explicit', or 'Strict'.", _
"'Option' statements must precede any declarations or 'Imports' statements.", _
"'Imports' statements must precede any declarations.", _
"Assembly or Module attribute statements must precede any declarations in a file.", _
"'End' statement not valid.", _
"Expected relational operator.", _
"'If', 'ElseIf', 'Else', 'End If', or 'Const' expected.", _
"Expected integer literal.", _
"'#ExternalSource' statements cannot be nested.", _
"'ExternalSource', 'Region' or 'If' expected.", _
"'#End ExternalSource' must be preceded by a matching '#ExternalSource'.", _
"'#ExternalSource' must end with a matching '#End ExternalSource'.", _
"'#End Region' must be preceded by a matching '#Region'.", _
"'#Region' must end with a matching '#End Region'.", _
"'#Region' and '#End Region' statements are not valid within method bodies.", _
"Conversions to and from 'String' cannot occur in a conditional compilation expression.", _
"Conversion 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.", _
"'#If' must end with a matching '#End If'.", _
"'#End If' must be preceded by a matching '#If'.", _
"'#ElseIf' cannot appear after '#Else' within an '#If' statement.", _
"'#ElseIf' must be preceded by a matching '#If'.", _
"'#Else' can only appear once in an '#If' statement.", _
"'#Else' must be preceded by a matching '#If'.", _
"'Global' not allowed in this context; identifier expected.", _
"Modules cannot be generic.", _
"Expected 'Of'.", _
"Operator declaration must be one of: +, -, *, \, /, ^, &, Like, Mod, And, Or, Xor, Not, <<, >>, =, <>, <, <=, >, >=, CType, IsTrue, IsFalse.", _
"'Operator' must end with a matching 'End Operator'.", _
"'End Operator' must be preceded by a matching 'Operator'.", _
"'End Operator' must be the first statement on a line.", _
"Properties cannot be generic.", _
"Constructors cannot be generic.", _
"Operators cannot be generic.", _
"Global must be followed by a '.'.", _
"Continue must be followed by Do, For, or While.", _
"'Using' must end with a matching 'End Using'.", _
"Custom 'Event' must end with a matching 'End Event'.", _
"'AddHandler' must end with a matching 'End AddHandler'.", _
"'RemoveHandler' must end with a matching 'End RemoveHandler'.", _
"'RaiseEvent' must end with a matching 'End RaiseEvent'.", _
"'End Using' must be preceded by a matching 'Using'.", _
"'End Event' must be preceded by a matching custom 'Event'.", _
"'End AddHandler' must be preceded by a matching 'AddHandler'.", _
"'End RemoveHandler' must be preceded by a matching 'RemoveHandler'.", _
"'End RaiseEvent' must be preceded by a matching 'RaiseEvent'.", _
"'End AddHandler' 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." _
}
Messages = Strings
End If
Return "error " & Type & " " & Span.ToString() & ": " & Messages(Type)
End Function
End Class

View file

@ -0,0 +1,204 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' The type of a syntax error.
''' </summary>
Public Enum SyntaxErrorType
None
' Lexical errors
InvalidEscapedIdentifier
InvalidIdentifier
InvalidTypeCharacterOnKeyword
InvalidCharacter
InvalidCharacterLiteral
InvalidStringLiteral
InvalidDateLiteral
InvalidFloatingPointLiteral
InvalidIntegerLiteral
InvalidDecimalLiteral
' Syntax errors
SyntaxError
ExpectedComma
ExpectedLeftParenthesis
ExpectedRightParenthesis
ExpectedEquals
ExpectedAs
ExpectedRightCurlyBrace
ExpectedPeriod
ExpectedMinus
ExpectedIs
ExpectedGreaterThan
ExpectedType
ExpectedIdentifier
InvalidUseOfKeyword
NoConstituentArraySizes
NoExplicitArraySizes
ExpectedExpression
ArgumentSyntax
ExpectedNamedArgument
ExpectedPeriodAfterMyBase
ExpectedPeriodAfterMyClass
ExpectedExitKind
ExpectedNext
ExpectedResumeOrGoto
ExpectedError
MidTypeCharacter
InitializerSyntax
ExpectedModifier
ExpectedEndOfStatement
ExpectedLoop
ExpectedEndWhile
ExpectedEndSelect
ExpectedEndSyncLock
ExpectedEndWith
ExpectedEndIf
ExpectedEndTry
ExpectedEndSub
ExpectedEndFunction
ExpectedEndProperty
ExpectedEndGet
ExpectedEndSet
ExpectedEndClass
ExpectedEndStructure
ExpectedEndModule
ExpectedEndInterface
ExpectedEndEnum
ExpectedEndNamespace
LoopDoubleCondition
LoopWithoutDo
NextWithoutFor
EndWhileWithoutWhile
EndSelectWithoutSelect
EndSyncLockWithoutSyncLock
EndIfWithoutIf
EndTryWithoutTry
EndWithWithoutWith
CatchWithoutTry
FinallyWithoutTry
CatchAfterFinally
FinallyAfterFinally
CaseWithoutSelect
CaseAfterCaseElse
CaseElseAfterCaseElse
CaseElseWithoutSelect
EndSubWithoutSub
EndFunctionWithoutFunction
EndPropertyWithoutProperty
EndGetWithoutGet
EndSetWithoutSet
EndClassWithoutClass
EndStructureWithoutStructure
EndModuleWithoutModule
EndInterfaceWithoutInterface
EndEnumWithoutEnum
EndNamespaceWithoutNamespace
ExpectedCase
ElseIfAfterElse
ElseIfWithoutIf
ElseAfterElse
ElseWithoutIf
EndInLineIf
IncorrectAttributeType
DuplicateModifier
InvalidModifier
InvalidVariableModifiers
EventsCantBeFunctions
ParameterSyntax
MethodMustBeFirstStatementOnLine
MethodBodyNotAtLineStart
EndSubNotAtLineStart
EndFunctionNotAtLineStart
EndGetNotAtLineStart
EndSetNotAtLineStart
ExpectedSubOrFunction
ExpectedStringLiteral
ExpectedLib
InvalidInsideProperty
InvalidInsideClass
InvalidInsideStructure
InvalidInsideModule
InvalidInsideInterface
InvalidInsideEnum
InvalidInsideNamespace
SpecifiersInvalidOnTypeListDeclaration
SpecifiersInvalidOnNamespaceDeclaration
SpecifiersInvalidOnImportsDeclaration
SpecifiersInvalidOnOptionDeclaration
NoMultipleInheritance
InheritsMustBeFirst
ImplementsInWrongOrder
EmptyEnum
InvalidOptionExplicitType
InvalidOptionStrictType
InvalidOptionCompareType
InvalidOptionType
OptionStatementWrongOrder
ImportsStatementWrongOrder
AttributesStatementWrongOrder
UnrecognizedEnd
ExpectedRelationalOperator
InvalidPreprocessorStatement
ExpectedIntegerLiteral
NestedExternalSourceStatement
ExpectedEndKind
EndExternalSourceWithoutExternalSource
ExpectedEndExternalSource
EndRegionWithoutRegion
ExpectedEndRegion
RegionInsideMethod
' Conditional compilation errors
CantCastStringInCCExpression
InvalidCCCast
CCExpressionRequired
InvalidCCOperator
ExpectedCCEndIf
CCEndIfWithoutCCIf
CCElseIfAfterCCElse
CCElseIfWithoutCCIf
CCElseAfterCCElse
CCElseWithoutCCIf
' New errors in v8.0
InvalidUseOfGlobal
ModulesCantBeGeneric
ExpectedOf
InvalidOperator
ExpectedEndOperator
EndOperatorWithoutOperator
EndOperatorNotAtLineStart
PropertiesCantBeGeneric
ConstructorsCantBeGeneric
OperatorsCantBeGeneric
ExpectedPeriodAfterGlobal
ExpectedContinueKind
ExpectedEndUsing
ExpectedEndEvent
ExpectedEndAddHandler
ExpectedEndRemoveHandler
ExpectedEndRaiseEvent
EndUsingWithoutUsing
EndEventWithoutEvent
EndAddHandlerWithoutAddHandler
EndRemoveHandlerWithoutRemoveHandler
EndRaiseEventWithoutRaiseEvent
EndAddHandlerNotAtLineStart
EndRemoveHandlerNotAtLineStart
EndRaiseEventNotAtLineStart
'Analysis error
NameAlreadyUsed
VariableNotDeclared
NotImplemented
Unexpected
End Enum

View file

@ -0,0 +1,37 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A character literal.
''' </summary>
Public NotInheritable Class CharacterLiteralToken
Inherits Token
Private ReadOnly _Literal As Char
''' <summary>
''' The literal value.
''' </summary>
Public ReadOnly Property Literal() As Char
Get
Return _Literal
End Get
End Property
''' <summary>
''' Constructs a new character literal token.
''' </summary>
''' <param name="literal">The literal value.</param>
''' <param name="span">The location of the literal.</param>
Public Sub New(ByVal literal As Char, ByVal span As Span)
MyBase.New(TokenType.CharacterLiteral, span)
_Literal = Literal
End Sub
End Class

View file

@ -0,0 +1,54 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A comment token.
''' </summary>
Public NotInheritable Class CommentToken
Inherits Token
Private ReadOnly _IsREM As Boolean ' Was the comment preceded by a quote or by REM?
Private ReadOnly _Comment As String ' Comment can be Nothing
''' <summary>
''' Whether the comment was preceded by REM.
''' </summary>
Public ReadOnly Property IsREM() As Boolean
Get
Return _IsREM
End Get
End Property
''' <summary>
''' The text of the comment.
''' </summary>
Public ReadOnly Property Comment() As String
Get
Return _Comment
End Get
End Property
''' <summary>
''' Constructs a new comment token.
''' </summary>
''' <param name="comment">The comment value.</param>
''' <param name="isREM">Whether the comment was preceded by REM.</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)
MyBase.New(TokenType.Comment, span)
If comment Is Nothing Then
Throw New ArgumentNullException("comment")
End If
_IsREM = isREM
_Comment = comment
End Sub
End Class

View file

@ -0,0 +1,37 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A date/time literal.
''' </summary>
Public NotInheritable Class DateLiteralToken
Inherits Token
Private ReadOnly _Literal As Date
''' <summary>
''' The literal value.
''' </summary>
Public ReadOnly Property Literal() As Date
Get
Return _Literal
End Get
End Property
''' <summary>
''' Constructs a new date literal instance.
''' </summary>
''' <param name="literal">The literal value.</param>
''' <param name="span">The location of the literal.</param>
Public Sub New(ByVal literal As Date, ByVal span As Span)
MyBase.New(TokenType.DateLiteral, span)
_Literal = literal
End Sub
End Class

View file

@ -0,0 +1,55 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A decimal literal token.
''' </summary>
Public NotInheritable Class DecimalLiteralToken
Inherits Token
Private ReadOnly _Literal As Decimal
Private ReadOnly _TypeCharacter As TypeCharacter ' The type character after the literal, if any
''' <summary>
''' The literal value.
''' </summary>
Public ReadOnly Property Literal() As Decimal
Get
Return _Literal
End Get
End Property
''' <summary>
''' The type character of the literal.
''' </summary>
Public ReadOnly Property TypeCharacter() As TypeCharacter
Get
Return _TypeCharacter
End Get
End Property
''' <summary>
''' Constructs a new decimal literal token.
''' </summary>
''' <param name="literal">The literal value.</param>
''' <param name="typeCharacter">The literal's type character.</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)
MyBase.New(TokenType.DecimalLiteral, span)
If typeCharacter <> typeCharacter.None AndAlso typeCharacter <> typeCharacter.DecimalChar AndAlso _
typeCharacter <> typeCharacter.DecimalSymbol Then
Throw New ArgumentOutOfRangeException("typeCharacter")
End If
_Literal = literal
_TypeCharacter = typeCharacter
End Sub
End Class

View file

@ -0,0 +1,25 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A token representing the end of the file.
''' </summary>
Public NotInheritable Class EndOfStreamToken
Inherits Token
''' <summary>
''' Creates a new end-of-stream token.
''' </summary>
''' <param name="span">The location of the end of the stream.</param>
Public Sub New(ByVal span As Span)
MyBase.New(TokenType.EndOfStream, Span)
End Sub
End Class

View file

@ -0,0 +1,42 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A lexical error.
''' </summary>
Public NotInheritable Class ErrorToken
Inherits Token
Private ReadOnly _SyntaxError As SyntaxError
''' <summary>
''' The syntax error that represents the lexical error.
''' </summary>
Public ReadOnly Property SyntaxError() As SyntaxError
Get
Return _SyntaxError
End Get
End Property
''' <summary>
''' Creates a new lexical error token.
''' </summary>
''' <param name="errorType">The type of the error.</param>
''' <param name="span">The location of the error.</param>
Public Sub New(ByVal errorType As SyntaxErrorType, ByVal span As Span)
MyBase.New(TokenType.LexicalError, span)
If errorType < SyntaxErrorType.InvalidEscapedIdentifier OrElse errorType > SyntaxErrorType.InvalidDecimalLiteral Then
Throw New ArgumentOutOfRangeException("errorType")
End If
_SyntaxError = New SyntaxError(errorType, span)
End Sub
End Class

View file

@ -0,0 +1,56 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A floating point literal.
''' </summary>
Public NotInheritable Class FloatingPointLiteralToken
Inherits Token
Private ReadOnly _Literal As Double
Private ReadOnly _TypeCharacter As TypeCharacter ' The type character after the literal, if any
''' <summary>
''' The value of the literal.
''' </summary>
Public ReadOnly Property Literal() As Double
Get
Return _Literal
End Get
End Property
''' <summary>
''' The type character after the literal.
''' </summary>
Public ReadOnly Property TypeCharacter() As TypeCharacter
Get
Return _TypeCharacter
End Get
End Property
''' <summary>
''' Constructs a new floating point literal token.
''' </summary>
''' <param name="literal">The literal value.</param>
''' <param name="typeCharacter">The type character 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)
MyBase.New(TokenType.FloatingPointLiteral, span)
If typeCharacter <> typeCharacter.None AndAlso _
typeCharacter <> typeCharacter.SingleSymbol AndAlso typeCharacter <> typeCharacter.SingleChar AndAlso _
typeCharacter <> typeCharacter.DoubleSymbol AndAlso typeCharacter <> typeCharacter.DoubleChar Then
Throw New ArgumentOutOfRangeException("typeCharacter")
End If
_Literal = literal
_TypeCharacter = typeCharacter
End Sub
End Class

View file

@ -0,0 +1,313 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' An identifier.
''' </summary>
Public NotInheritable Class IdentifierToken
Inherits Token
Private Structure Keyword
Public ReadOnly Versions As LanguageVersion
Public ReadOnly ReservedVersions As LanguageVersion
Public ReadOnly TokenType As TokenType
Public Sub New(ByVal Versions As LanguageVersion, ByVal ReservedVersions As LanguageVersion, ByVal TokenType As TokenType)
Me.Versions = Versions
Me.ReservedVersions = ReservedVersions
Me.TokenType = TokenType
End Sub
End Structure
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)
table.Add(name, keyword)
table.Add(Scanner.MakeFullWidth(name), keyword)
End Sub
' 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
If KeywordTable Is Nothing Then
Dim Table As New Dictionary(Of String, Keyword)(StringComparer.InvariantCultureIgnoreCase)
' 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, "AddressOf", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.AddressOf))
AddKeyword(Table, "Alias", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Alias))
AddKeyword(Table, "And", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.And))
AddKeyword(Table, "AndAlso", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.AndAlso))
AddKeyword(Table, "Ansi", New Keyword(LanguageVersion.All, LanguageVersion.VisualBasic71, TokenType.Ansi))
AddKeyword(Table, "As", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.As))
AddKeyword(Table, "Assembly", New Keyword(LanguageVersion.All, LanguageVersion.VisualBasic71, TokenType.Assembly))
AddKeyword(Table, "Auto", New Keyword(LanguageVersion.All, LanguageVersion.VisualBasic71, TokenType.Auto))
AddKeyword(Table, "Binary", New Keyword(LanguageVersion.All, LanguageVersion.None, TokenType.Binary))
AddKeyword(Table, "Boolean", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Boolean))
AddKeyword(Table, "ByRef", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.ByRef))
AddKeyword(Table, "Byte", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Byte))
AddKeyword(Table, "ByVal", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.ByVal))
AddKeyword(Table, "Call", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Call))
AddKeyword(Table, "Case", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Case))
AddKeyword(Table, "Catch", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Catch))
'AddKeyword(Table, "CBool", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CBool))
'AddKeyword(Table, "CByte", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CByte))
'AddKeyword(Table, "CChar", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CChar))
'AddKeyword(Table, "CDate", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CDate))
'AddKeyword(Table, "CDbl", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CDbl))
'AddKeyword(Table, "CDec", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CDec))
AddKeyword(Table, "Char", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Char))
'AddKeyword(Table, "CInt", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CInt))
AddKeyword(Table, "Class", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Class))
'AddKeyword(Table, "CLng", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CLng))
'AddKeyword(Table, "CObj", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CObj))
AddKeyword(Table, "Compare", New Keyword(LanguageVersion.All, LanguageVersion.None, TokenType.Compare))
AddKeyword(Table, "Const", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Const))
AddKeyword(Table, "Continue", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.Continue))
'AddKeyword(Table, "CSByte", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.CSByte))
'AddKeyword(Table, "CShort", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CShort))
'AddKeyword(Table, "CSng", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CSng))
'AddKeyword(Table, "CStr", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CStr))
'AddKeyword(Table, "CType", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.CType))
'AddKeyword(Table, "CUInt", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.CUInt))
'AddKeyword(Table, "CULng", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.CULng))
'AddKeyword(Table, "CUShort", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.CUShort))
AddKeyword(Table, "Custom", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.None, TokenType.Custom))
AddKeyword(Table, "Date", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Date))
AddKeyword(Table, "Decimal", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Decimal))
AddKeyword(Table, "Declare", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Declare))
AddKeyword(Table, "Default", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Default))
AddKeyword(Table, "Delegate", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Delegate))
AddKeyword(Table, "Dim", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Dim))
AddKeyword(Table, "DirectCast", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.DirectCast))
AddKeyword(Table, "Do", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Do))
AddKeyword(Table, "Double", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Double))
AddKeyword(Table, "Each", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Each))
AddKeyword(Table, "Else", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Else))
AddKeyword(Table, "ElseIf", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.ElseIf))
AddKeyword(Table, "End", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.End))
AddKeyword(Table, "EndIf", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.EndIf))
AddKeyword(Table, "Enum", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Enum))
AddKeyword(Table, "Erase", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Erase))
AddKeyword(Table, "Error", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Error))
AddKeyword(Table, "Event", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Event))
AddKeyword(Table, "Exit", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Exit))
AddKeyword(Table, "Explicit", New Keyword(LanguageVersion.All, LanguageVersion.None, TokenType.Explicit))
AddKeyword(Table, "ExternalChecksum", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.None, TokenType.ExternalChecksum))
AddKeyword(Table, "ExternalSource", New Keyword(LanguageVersion.All, LanguageVersion.None, TokenType.ExternalSource))
AddKeyword(Table, "False", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.False))
AddKeyword(Table, "Finally", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Finally))
AddKeyword(Table, "For", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.For))
AddKeyword(Table, "Friend", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Friend))
AddKeyword(Table, "Function", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Function))
AddKeyword(Table, "Get", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Get))
AddKeyword(Table, "GetType", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.GetType))
AddKeyword(Table, "Global", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.Global))
AddKeyword(Table, "GoSub", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.GoSub))
AddKeyword(Table, "GoTo", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.GoTo))
AddKeyword(Table, "Handles", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Handles))
AddKeyword(Table, "If", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.If))
AddKeyword(Table, "Implements", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Implements))
AddKeyword(Table, "Imports", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Imports))
AddKeyword(Table, "In", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.In))
AddKeyword(Table, "Inherits", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Inherits))
AddKeyword(Table, "Integer", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Integer))
AddKeyword(Table, "Interface", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Interface))
AddKeyword(Table, "Is", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Is))
AddKeyword(Table, "IsFalse", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.None, TokenType.IsFalse))
AddKeyword(Table, "IsNot", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.IsNot))
AddKeyword(Table, "IsTrue", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.None, TokenType.IsTrue))
AddKeyword(Table, "Let", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Let))
AddKeyword(Table, "Lib", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Lib))
AddKeyword(Table, "Like", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Like))
AddKeyword(Table, "Long", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Long))
AddKeyword(Table, "Loop", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Loop))
AddKeyword(Table, "Me", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Me))
AddKeyword(Table, "Mid", New Keyword(LanguageVersion.All, LanguageVersion.None, TokenType.Mid))
AddKeyword(Table, "Mod", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Mod))
AddKeyword(Table, "Module", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Module))
AddKeyword(Table, "MustInherit", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.MustInherit))
AddKeyword(Table, "MustOverride", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.MustOverride))
AddKeyword(Table, "MyBase", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.MyBase))
AddKeyword(Table, "MyClass", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.MyClass))
AddKeyword(Table, "Namespace", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Namespace))
AddKeyword(Table, "Narrowing", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.Narrowing))
AddKeyword(Table, "New", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.New))
AddKeyword(Table, "Next", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Next))
AddKeyword(Table, "Not", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Not))
AddKeyword(Table, "Nothing", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Nothing))
AddKeyword(Table, "NotInheritable", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.NotInheritable))
AddKeyword(Table, "NotOverridable", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.NotOverridable))
AddKeyword(Table, "Object", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Object))
AddKeyword(Table, "Of", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.Of))
AddKeyword(Table, "Off", New Keyword(LanguageVersion.All, LanguageVersion.None, TokenType.Off))
AddKeyword(Table, "On", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.On))
AddKeyword(Table, "Operator", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.Operator))
AddKeyword(Table, "Option", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Option))
AddKeyword(Table, "Optional", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Optional))
AddKeyword(Table, "Or", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Or))
AddKeyword(Table, "OrElse", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.OrElse))
AddKeyword(Table, "Overloads", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Overloads))
AddKeyword(Table, "Overridable", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Overridable))
AddKeyword(Table, "Overrides", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Overrides))
AddKeyword(Table, "ParamArray", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.ParamArray))
AddKeyword(Table, "Partial", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.Partial))
AddKeyword(Table, "Preserve", New Keyword(LanguageVersion.All, LanguageVersion.VisualBasic71, TokenType.Preserve))
AddKeyword(Table, "Private", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Private))
AddKeyword(Table, "Property", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Property))
AddKeyword(Table, "Protected", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Protected))
AddKeyword(Table, "Public", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Public))
AddKeyword(Table, "RaiseEvent", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.RaiseEvent))
AddKeyword(Table, "ReadOnly", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.ReadOnly))
AddKeyword(Table, "ReDim", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.ReDim))
AddKeyword(Table, "Region", New Keyword(LanguageVersion.All, LanguageVersion.None, TokenType.Region))
AddKeyword(Table, "REM", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.[REM]))
AddKeyword(Table, "RemoveHandler", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.RemoveHandler))
AddKeyword(Table, "Resume", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Resume))
AddKeyword(Table, "Return", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Return))
AddKeyword(Table, "SByte", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.SByte))
AddKeyword(Table, "Select", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Select))
AddKeyword(Table, "Set", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Set))
AddKeyword(Table, "Shadows", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Shadows))
AddKeyword(Table, "Shared", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Shared))
AddKeyword(Table, "Short", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Short))
AddKeyword(Table, "Single", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Single))
AddKeyword(Table, "Static", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Static))
AddKeyword(Table, "Step", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Step))
AddKeyword(Table, "Stop", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Stop))
AddKeyword(Table, "Strict", New Keyword(LanguageVersion.All, LanguageVersion.None, TokenType.Strict))
AddKeyword(Table, "String", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.String))
AddKeyword(Table, "Structure", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Structure))
AddKeyword(Table, "Sub", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Sub))
AddKeyword(Table, "SyncLock", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.SyncLock))
AddKeyword(Table, "Text", New Keyword(LanguageVersion.All, LanguageVersion.None, TokenType.Text))
AddKeyword(Table, "Then", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Then))
AddKeyword(Table, "Throw", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Throw))
AddKeyword(Table, "To", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.To))
AddKeyword(Table, "True", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.True))
AddKeyword(Table, "Try", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Try))
AddKeyword(Table, "TryCast", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.TryCast))
AddKeyword(Table, "TypeOf", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.TypeOf))
AddKeyword(Table, "UInteger", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.UInteger))
AddKeyword(Table, "ULong", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.ULong))
AddKeyword(Table, "UShort", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.UShort))
AddKeyword(Table, "Using", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.Using))
AddKeyword(Table, "Unicode", New Keyword(LanguageVersion.All, LanguageVersion.VisualBasic71, TokenType.Unicode))
AddKeyword(Table, "Until", New Keyword(LanguageVersion.All, LanguageVersion.VisualBasic71, TokenType.Until))
AddKeyword(Table, "Variant", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Variant))
AddKeyword(Table, "Wend", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Wend))
AddKeyword(Table, "When", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.When))
AddKeyword(Table, "While", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.While))
AddKeyword(Table, "Widening", New Keyword(LanguageVersion.VisualBasic80, LanguageVersion.VisualBasic80, TokenType.Widening))
AddKeyword(Table, "With", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.With))
AddKeyword(Table, "WithEvents", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.WithEvents))
AddKeyword(Table, "WriteOnly", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.WriteOnly))
AddKeyword(Table, "Xor", New Keyword(LanguageVersion.All, LanguageVersion.All, TokenType.Xor))
KeywordTable = Table
End If
If KeywordTable.ContainsKey(s) Then
Dim Keyword As Keyword = KeywordTable(s)
If ((Keyword.Versions And Version) = Version) AndAlso _
(IncludeUnreserved OrElse ((Keyword.ReservedVersions And Version) = Version)) Then
Return Keyword.TokenType
End If
End If
Return TokenType.Identifier
End Function
''' <summary>
''' Determines if a token type is a keyword.
''' </summary>
''' <param name="type">The token type to check.</param>
''' <returns>True if the token type is a keyword, False otherwise.</returns>
Public Shared Function IsKeyword(ByVal type As TokenType) As Boolean
Return type >= TokenType.AddHandler AndAlso type <= TokenType.Xor
End Function
Public Overrides Function AsUnreservedKeyword() As TokenType
Return _UnreservedType
End Function
Private ReadOnly _Identifier As String
Private ReadOnly _UnreservedType As TokenType
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
''' <summary>
''' The identifier name.
''' </summary>
Public ReadOnly Property Identifier() As String
Get
Return _Identifier
End Get
End Property
''' <summary>
''' Whether the identifier is escaped.
''' </summary>
Public ReadOnly Property Escaped() As Boolean
Get
Return _Escaped
End Get
End Property
''' <summary>
''' The type character of the identifier.
''' </summary>
Public ReadOnly Property TypeCharacter() As TypeCharacter
Get
Return _TypeCharacter
End Get
End Property
''' <summary>
''' Constructs a new identifier token.
''' </summary>
''' <param name="type">The 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="escaped">Whether the identifier is escaped.</param>
''' <param name="typeCharacter">The type character 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)
MyBase.New(type, span)
If type <> TokenType.Identifier AndAlso Not IsKeyword(type) Then
Throw New ArgumentOutOfRangeException("type")
End If
If unreservedType <> TokenType.Identifier AndAlso Not IsKeyword(unreservedType) Then
Throw New ArgumentOutOfRangeException("unreservedType")
End If
If identifier Is Nothing OrElse identifier = "" Then
Throw New ArgumentException("Identifier cannot be empty.", "identifier")
End If
If typeCharacter <> typeCharacter.None AndAlso typeCharacter <> typeCharacter.DecimalSymbol AndAlso _
typeCharacter <> typeCharacter.DoubleSymbol AndAlso typeCharacter <> typeCharacter.IntegerSymbol AndAlso _
typeCharacter <> typeCharacter.LongSymbol AndAlso typeCharacter <> typeCharacter.SingleSymbol AndAlso _
typeCharacter <> typeCharacter.StringSymbol Then
Throw New ArgumentOutOfRangeException("typeCharacter")
End If
If typeCharacter <> typeCharacter.None AndAlso escaped Then
Throw New ArgumentException("Escaped identifiers cannot have type characters.")
End If
_UnreservedType = unreservedType
_Identifier = identifier
_Escaped = escaped
_TypeCharacter = typeCharacter
End Sub
End Class

View file

@ -0,0 +1,74 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' An integer literal.
''' </summary>
Public NotInheritable Class IntegerLiteralToken
Inherits Token
Private ReadOnly _Literal As Integer
Private ReadOnly _TypeCharacter As TypeCharacter ' The type character after the literal, if any
Private ReadOnly _IntegerBase As IntegerBase ' The base of the literal
''' <summary>
''' The value of the literal.
''' </summary>
Public ReadOnly Property Literal() As Integer
Get
Return _Literal
End Get
End Property
''' <summary>
''' The type character of the literal.
''' </summary>
Public ReadOnly Property TypeCharacter() As TypeCharacter
Get
Return _TypeCharacter
End Get
End Property
''' <summary>
''' The integer base of the literal.
''' </summary>
Public ReadOnly Property IntegerBase() As IntegerBase
Get
Return _IntegerBase
End Get
End Property
''' <summary>
''' Constructs a new integer literal.
''' </summary>
''' <param name="literal">The literal value.</param>
''' <param name="integerBase">The integer base of the literal.</param>
''' <param name="typeCharacter">The type character 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)
MyBase.New(TokenType.IntegerLiteral, span)
If integerBase < integerBase.Decimal OrElse integerBase > integerBase.Hexadecimal Then
Throw New ArgumentOutOfRangeException("integerBase")
End If
If typeCharacter <> typeCharacter.None AndAlso _
typeCharacter <> typeCharacter.IntegerSymbol AndAlso typeCharacter <> typeCharacter.IntegerChar AndAlso _
typeCharacter <> typeCharacter.ShortChar AndAlso _
typeCharacter <> typeCharacter.LongSymbol AndAlso typeCharacter <> typeCharacter.LongChar Then
Throw New ArgumentOutOfRangeException("typeCharacter")
End If
_Literal = literal
_IntegerBase = integerBase
_TypeCharacter = typeCharacter
End Sub
End Class

View file

@ -0,0 +1,24 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A line terminator.
''' </summary>
Public NotInheritable Class LineTerminatorToken
Inherits Token
''' <summary>
''' Create a new line terminator token.
''' </summary>
''' <param name="span">The location of the line terminator.</param>
Public Sub New(ByVal span As Span)
MyBase.New(TokenType.LineTerminator, span)
End Sub
End Class

View file

@ -0,0 +1,89 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A punctuation token.
''' </summary>
Public NotInheritable Class PunctuatorToken
Inherits Token
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)
table.Add(punctuator, type)
table.Add(Scanner.MakeFullWidth(punctuator), type)
End Sub
' Returns the token type of the string.
Friend Shared Function TokenTypeFromString(ByVal s As String) As TokenType
If PunctuatorTable Is Nothing Then
Dim Table As New Dictionary(Of String, TokenType)(StringComparer.InvariantCulture)
' NOTE: These have to be in the same order as the enum!
AddPunctuator(Table, "(", TokenType.LeftParenthesis)
AddPunctuator(Table, ")", TokenType.RightParenthesis)
AddPunctuator(Table, "{", TokenType.LeftCurlyBrace)
AddPunctuator(Table, "}", TokenType.RightCurlyBrace)
AddPunctuator(Table, "!", TokenType.Exclamation)
AddPunctuator(Table, "#", TokenType.Pound)
AddPunctuator(Table, ",", TokenType.Comma)
AddPunctuator(Table, ".", TokenType.Period)
AddPunctuator(Table, ":", TokenType.Colon)
AddPunctuator(Table, ":=", TokenType.ColonEquals)
AddPunctuator(Table, "&", TokenType.Ampersand)
AddPunctuator(Table, "&=", TokenType.AmpersandEquals)
AddPunctuator(Table, "*", TokenType.Star)
AddPunctuator(Table, "*=", TokenType.StarEquals)
AddPunctuator(Table, "+", TokenType.Plus)
AddPunctuator(Table, "+=", TokenType.PlusEquals)
AddPunctuator(Table, "-", TokenType.Minus)
AddPunctuator(Table, "-=", TokenType.MinusEquals)
AddPunctuator(Table, "/", TokenType.ForwardSlash)
AddPunctuator(Table, "/=", TokenType.ForwardSlashEquals)
AddPunctuator(Table, "\", TokenType.BackwardSlash)
AddPunctuator(Table, "\=", TokenType.BackwardSlashEquals)
AddPunctuator(Table, "^", TokenType.Caret)
AddPunctuator(Table, "^=", TokenType.CaretEquals)
AddPunctuator(Table, "<", TokenType.LessThan)
AddPunctuator(Table, "<=", TokenType.LessThanEquals)
AddPunctuator(Table, "=<", TokenType.LessThanEquals) 'lc VBScript allows the other way
AddPunctuator(Table, "=", TokenType.Equals)
AddPunctuator(Table, "<>", TokenType.NotEquals)
AddPunctuator(Table, ">", TokenType.GreaterThan)
AddPunctuator(Table, ">=", TokenType.GreaterThanEquals)
AddPunctuator(Table, "=>", TokenType.GreaterThanEquals) 'lc
AddPunctuator(Table, "<<", TokenType.LessThanLessThan)
AddPunctuator(Table, "<<=", TokenType.LessThanLessThanEquals)
AddPunctuator(Table, ">>", TokenType.GreaterThanGreaterThan)
AddPunctuator(Table, ">>=", TokenType.GreaterThanGreaterThanEquals)
PunctuatorTable = Table
End If
If Not PunctuatorTable.ContainsKey(s) Then
Return TokenType.None
Else
Return PunctuatorTable(s)
End If
End Function
''' <summary>
''' Constructs a new punctuator token.
''' </summary>
''' <param name="type">The punctuator token type.</param>
''' <param name="span">The location of the punctuator.</param>
Public Sub New(ByVal type As TokenType, ByVal span As Span)
MyBase.New(type, span)
If (type < TokenType.LeftParenthesis OrElse type > TokenType.GreaterThanGreaterThanEquals) Then
Throw New ArgumentOutOfRangeException("type")
End If
End Sub
End Class

View file

@ -0,0 +1,42 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A string literal.
''' </summary>
Public NotInheritable Class StringLiteralToken
Inherits Token
Private ReadOnly _Literal As String
''' <summary>
''' The value of the literal.
''' </summary>
Public ReadOnly Property Literal() As String
Get
Return _Literal
End Get
End Property
''' <summary>
''' Constructs a new string literal token.
''' </summary>
''' <param name="literal">The value of the literal.</param>
''' <param name="span">The location of the literal.</param>
Public Sub New(ByVal literal As String, ByVal span As Span)
MyBase.New(TokenType.StringLiteral, span)
If literal Is Nothing Then
Throw New ArgumentNullException("literal")
End If
_Literal = literal
End Sub
End Class

View file

@ -0,0 +1,49 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' The base class for all tokens. Contains line and column information as well as token type.
''' </summary>
Public MustInherit Class Token
Private ReadOnly _Type As TokenType
Private ReadOnly _Span As Span ' A span ends at the first character beyond the token
''' <summary>
''' The type of the token.
''' </summary>
Public ReadOnly Property Type() As TokenType
Get
Return _Type
End Get
End Property
''' <summary>
''' The span of the token in the source text.
''' </summary>
Public ReadOnly Property Span() As Span
Get
Return _Span
End Get
End Property
Protected Sub New(ByVal type As TokenType, ByVal span As Span)
Debug.Assert([Enum].IsDefined(GetType(TokenType), type))
_Type = type
_Span = span
End Sub
''' <summary>
''' Returns the unreserved keyword type of an identifier.
''' </summary>
''' <returns>The unreserved keyword type of an identifier, the token's type otherwise.</returns>
Public Overridable Function AsUnreservedKeyword() As TokenType
Return Type
End Function
End Class

View file

@ -0,0 +1,236 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' The type of a token.
''' </summary>
Public Enum TokenType
None
LexicalError
EndOfStream
LineTerminator
Comment
Identifier
StringLiteral
CharacterLiteral
DateLiteral
IntegerLiteral
UnsignedIntegerLiteral
FloatingPointLiteral
DecimalLiteral
[AddHandler]
[AddressOf]
[Alias]
[And]
[AndAlso]
[Ansi]
[As]
[Assembly]
[Auto]
Binary
[Boolean]
[ByRef]
[Byte]
[ByVal]
[Call]
[Case]
[Catch]
[CBool]
[CByte]
[CChar]
[CDate]
[CDec]
[CDbl]
[Char]
[CInt]
[Class]
[CLng]
[CObj]
Compare
[Const]
[Continue]
[CSByte]
[CShort]
[CSng]
[CStr]
[CType]
[CUInt]
[CULng]
[CUShort]
[Custom]
[Date]
[Decimal]
[Declare]
[Default]
[Delegate]
[Dim]
[DirectCast]
[Do]
[Double]
[Each]
[Else]
[ElseIf]
[End]
[EndIf]
[Enum]
[Erase]
[Error]
[Event]
[Exit]
Explicit
ExternalChecksum
ExternalSource
[False]
[Finally]
[For]
[Friend]
[Function]
[Get]
[GetType]
[Global]
[GoSub]
[GoTo]
[Handles]
[If]
[Implements]
[Imports]
[In]
[Inherits]
[Integer]
[Interface]
[Is]
IsTrue
[IsNot]
IsFalse
[Let]
[Lib]
[Like]
[Long]
[Loop]
[Me]
Mid
[Mod]
[Module]
[MustInherit]
[MustOverride]
[MyBase]
[MyClass]
[Namespace]
[Narrowing]
[New]
[Next]
[Not]
[Nothing]
[NotInheritable]
[NotOverridable]
[Object]
[Of]
Off
[On]
[Operator]
[Option]
[Optional]
[Or]
[OrElse]
[Overloads]
[Overridable]
[Overrides]
[ParamArray]
[Partial]
[Preserve]
[Private]
[Property]
[Protected]
[Public]
[RaiseEvent]
[ReadOnly]
[ReDim]
Region
[REM]
[RemoveHandler]
[Resume]
[Return]
[SByte]
[Select]
[Set]
[Shadows]
[Shared]
[Short]
[Single]
[Static]
[Step]
[Stop]
Strict
[String]
[Structure]
[Sub]
[SyncLock]
Text
[Then]
[Throw]
[To]
[True]
[Try]
[TryCast]
[TypeOf]
[UInteger]
[ULong]
[UShort]
[Using]
[Unicode]
[Until]
[Variant]
[Wend]
[When]
[While]
[Widening]
[With]
[WithEvents]
[WriteOnly]
[Xor]
LeftParenthesis ' (
RightParenthesis ' )
LeftCurlyBrace ' {
RightCurlyBrace ' }
Exclamation ' !
Pound ' #
Comma ' ,
Period ' .
Colon ' :
ColonEquals ' :=
Ampersand ' &
AmpersandEquals ' &=
Star ' *
StarEquals ' *=
Plus ' +
PlusEquals ' +=
Minus ' -
MinusEquals ' -=
ForwardSlash ' /
ForwardSlashEquals ' /=
BackwardSlash ' \
BackwardSlashEquals ' \=
Caret ' ^
CaretEquals ' ^=
LessThan ' <
LessThanEquals ' <=
Equals ' =
NotEquals ' <>
GreaterThan ' >
GreaterThanEquals ' >=
LessThanLessThan ' <<
LessThanLessThanEquals ' <<=
GreaterThanGreaterThan ' >>
GreaterThanGreaterThanEquals ' >>=
End Enum

View file

@ -0,0 +1,76 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' An integer literal.
''' </summary>
Public NotInheritable Class UnsignedIntegerLiteralToken
Inherits Token
Private ReadOnly _Literal As ULong
Private ReadOnly _TypeCharacter As TypeCharacter ' The type character after the literal, if any
Private ReadOnly _IntegerBase As IntegerBase ' The base of the literal
''' <summary>
''' The value of the literal.
''' </summary>
<CLSCompliant(False)> _
Public ReadOnly Property Literal() As ULong
Get
Return _Literal
End Get
End Property
''' <summary>
''' The type character of the literal.
''' </summary>
Public ReadOnly Property TypeCharacter() As TypeCharacter
Get
Return _TypeCharacter
End Get
End Property
''' <summary>
''' The integer base of the literal.
''' </summary>
Public ReadOnly Property IntegerBase() As IntegerBase
Get
Return _IntegerBase
End Get
End Property
''' <summary>
''' Constructs a new unsigned integer literal.
''' </summary>
''' <param name="literal">The literal value.</param>
''' <param name="integerBase">The integer base of the literal.</param>
''' <param name="typeCharacter">The type character of the literal.</param>
''' <param name="span">The location of the literal.</param>
<CLSCompliant(False)> _
Public Sub New(ByVal literal As ULong, ByVal integerBase As IntegerBase, ByVal typeCharacter As TypeCharacter, ByVal span As Span)
MyBase.New(TokenType.UnsignedIntegerLiteral, span)
If integerBase < integerBase.Decimal OrElse integerBase > integerBase.Hexadecimal Then
Throw New ArgumentOutOfRangeException("integerBase")
End If
If typeCharacter <> typeCharacter.None AndAlso _
typeCharacter <> typeCharacter.UnsignedIntegerChar AndAlso _
typeCharacter <> typeCharacter.UnsignedLongChar AndAlso _
typeCharacter <> typeCharacter.UnsignedShortChar Then
Throw New ArgumentOutOfRangeException("typeCharacter")
End If
_Literal = literal
_IntegerBase = integerBase
_TypeCharacter = typeCharacter
End Sub
End Class

View file

@ -0,0 +1,78 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for an argument to a call or index.
''' </summary>
Public NotInheritable Class Argument
Inherits Tree
Private ReadOnly _Name As SimpleName
Private ReadOnly _ColonEqualsLocation As Location
Private ReadOnly _Expression As Expression
''' <summary>
''' The name of the argument, if any.
''' </summary>
Public ReadOnly Property Name() As SimpleName
Get
Return _Name
End Get
End Property
''' <summary>
''' The location of the ':=', if any.
''' </summary>
Public ReadOnly Property ColonEqualsLocation() As Location
Get
Return _ColonEqualsLocation
End Get
End Property
''' <summary>
''' The argument, if any.
''' </summary>
Public ReadOnly Property Expression() As Expression
Get
Return _Expression
End Get
End Property
''' <summary>
''' Constructs a new parse tree for an argument.
''' </summary>
''' <param name="name">The name of the argument, if any.</param>
''' <param name="colonEqualsLocation">The location of the ':=', if any.</param>
''' <param name="expression">The expression, if any.</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)
MyBase.New(TreeType.Argument, span)
If expression Is Nothing Then
Throw New ArgumentNullException("expression")
End If
SetParent(name)
SetParent(expression)
_Name = name
_ColonEqualsLocation = colonEqualsLocation
_Expression = expression
End Sub
Private Sub New()
MyBase.New(TreeType.Argument, Nothing)
End Sub
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
AddChild(childList, Name)
AddChild(childList, Expression)
End Sub
End Class

View file

@ -0,0 +1,40 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A read-only collection of arguments.
''' </summary>
Public NotInheritable Class ArgumentCollection
Inherits CommaDelimitedTreeCollection(Of Argument)
Private ReadOnly _RightParenthesisLocation As Location
''' <summary>
''' The location of the ')'.
''' </summary>
Public ReadOnly Property RightParenthesisLocation() As Location
Get
Return _RightParenthesisLocation
End Get
End Property
''' <summary>
''' Constructs a new argument collection.
''' </summary>
''' <param name="arguments">The arguments 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="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)
MyBase.New(TreeType.ArgumentCollection, arguments, commaLocations, span)
_RightParenthesisLocation = rightParenthesisLocation
End Sub
End Class

View file

@ -0,0 +1,98 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for an attribute usage.
''' </summary>
Public NotInheritable Class Attribute
Inherits Tree
Private ReadOnly _AttributeType As AttributeTypes
Private ReadOnly _AttributeTypeLocation As Location
Private ReadOnly _ColonLocation As Location
Private ReadOnly _Name As Name
Private ReadOnly _Arguments As ArgumentCollection
''' <summary>
''' The target type of the attribute.
''' </summary>
Public ReadOnly Property AttributeType() As AttributeTypes
Get
Return _AttributeType
End Get
End Property
''' <summary>
''' The location of the attribute type, if any.
''' </summary>
Public ReadOnly Property AttributeTypeLocation() As Location
Get
Return _AttributeTypeLocation
End Get
End Property
''' <summary>
''' The location of the ':', if any.
''' </summary>
Public ReadOnly Property ColonLocation() As Location
Get
Return _ColonLocation
End Get
End Property
''' <summary>
''' The name of the attribute being applied.
''' </summary>
Public ReadOnly Property Name() As Name
Get
Return _Name
End Get
End Property
''' <summary>
''' The arguments to the attribute.
''' </summary>
Public ReadOnly Property Arguments() As ArgumentCollection
Get
Return _Arguments
End Get
End Property
''' <summary>
''' Constructs a new attribute parse tree.
''' </summary>
''' <param name="attributeType">The target type of the attribute.</param>
''' <param name="attributeTypeLocation">The location of the attribute type.</param>
''' <param name="colonLocation">The location of the ':'.</param>
''' <param name="name">The name of the attribute being applied.</param>
''' <param name="arguments">The arguments to the attribute.</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)
MyBase.New(TreeType.Attribute, span)
If name Is Nothing Then
Throw New ArgumentNullException("name")
End If
SetParent(name)
SetParent(arguments)
_AttributeType = attributeType
_AttributeTypeLocation = attributeTypeLocation
_ColonLocation = colonLocation
_Name = name
_Arguments = arguments
End Sub
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
AddChild(childList, Name)
AddChild(childList, Arguments)
End Sub
End Class

View file

@ -0,0 +1,29 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A read-only collection of attributes.
''' </summary>
Public NotInheritable Class AttributeBlockCollection
Inherits TreeCollection(Of AttributeCollection)
''' <summary>
''' Constructs a new collection of attribute blocks.
''' </summary>
''' <param name="attributeBlocks">The attribute blockss in the collection.</param>
''' <param name="span">The location of the parse tree.</param>
Public Sub New(ByVal attributeBlocks As IList(Of AttributeCollection), ByVal span As Span)
MyBase.New(TreeType.AttributeBlockCollection, attributeBlocks, span)
If attributeBlocks Is Nothing OrElse attributeBlocks.Count = 0 Then
Throw New ArgumentException("AttributeBlocksCollection cannot be empty.")
End If
End Sub
End Class

View file

@ -0,0 +1,44 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A read-only collection of attributes.
''' </summary>
Public NotInheritable Class AttributeCollection
Inherits CommaDelimitedTreeCollection(Of Attribute)
Private ReadOnly _RightBracketLocation As Location
''' <summary>
''' The location of the '}'.
''' </summary>
Public ReadOnly Property RightBracketLocation() As Location
Get
Return _RightBracketLocation
End Get
End Property
''' <summary>
''' Constructs a new collection of attributes.
''' </summary>
''' <param name="attributes">The attributes in the collection.</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="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)
MyBase.New(TreeType.AttributeCollection, attributes, commaLocations, span)
If attributes Is Nothing OrElse attributes.Count = 0 Then
Throw New ArgumentException("AttributeCollection cannot be empty.")
End If
_RightBracketLocation = rightBracketLocation
End Sub
End Class

View file

@ -0,0 +1,24 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' The type of an attribute usage.
''' </summary>
<Flags()> _
Public Enum AttributeTypes
''' <summary>Regular application.</summary>
Regular = &H1
''' <summary>Applied to the netmodule.</summary>
[Module] = &H2
''' <summary>Applied to the assembly.</summary>
Assembly = &H4
End Enum

View file

@ -0,0 +1,47 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' The type a block declaration.
''' </summary>
Public Enum BlockType
None
[Do]
[For]
[While]
[Select]
[If]
[Try]
[SyncLock]
[Using]
[With]
[Sub]
[Function]
[Operator]
[Event]
[AddHandler]
[RemoveHandler]
[RaiseEvent]
[Get]
[Set]
[Property]
[Class]
[Structure]
[Module]
[Interface]
[Enum]
[Namespace]
End Enum

View file

@ -0,0 +1,22 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for a case clause in a Select statement.
''' </summary>
Public MustInherit Class CaseClause
Inherits Tree
Protected Sub New(ByVal type As TreeType, ByVal span As Span)
MyBase.New(type, span)
Debug.Assert(type = TreeType.ComparisonCaseClause OrElse type = TreeType.RangeCaseClause)
End Sub
End Class

View file

@ -0,0 +1,30 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A collection of case clauses.
''' </summary>
Public NotInheritable Class CaseClauseCollection
Inherits CommaDelimitedTreeCollection(Of CaseClause)
''' <summary>
''' Constructs a new collection of case clauses.
''' </summary>
''' <param name="caseClauses">The case clauses in the collection.</param>
''' <param name="commaLocations">The locations of the commas in the list.</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)
MyBase.New(TreeType.CaseClauseCollection, caseClauses, commaLocations, span)
If caseClauses Is Nothing OrElse caseClauses.Count = 0 Then
Throw New ArgumentException("CaseClauseCollection cannot be empty.")
End If
End Sub
End Class

View file

@ -0,0 +1,88 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for a case clause that compares values.
''' </summary>
Public NotInheritable Class ComparisonCaseClause
Inherits CaseClause
Private ReadOnly _IsLocation As Location
Private ReadOnly _ComparisonOperator As OperatorType
Private ReadOnly _OperatorLocation As Location
Private ReadOnly _Operand As Expression
''' <summary>
''' The location of the 'Is', if any.
''' </summary>
Public ReadOnly Property IsLocation() As Location
Get
Return _IsLocation
End Get
End Property
''' <summary>
''' The comparison operator used in the case clause.
''' </summary>
Public ReadOnly Property ComparisonOperator() As OperatorType
Get
Return _ComparisonOperator
End Get
End Property
''' <summary>
''' The location of the comparison operator.
''' </summary>
Public ReadOnly Property OperatorLocation() As Location
Get
Return _OperatorLocation
End Get
End Property
''' <summary>
''' The operand of the case clause.
''' </summary>
Public ReadOnly Property Operand() As Expression
Get
Return _Operand
End Get
End Property
''' <summary>
''' Constructs a new parse tree for a comparison case clause.
''' </summary>
''' <param name="isLocation">The location of the 'Is', if any.</param>
''' <param name="comparisonOperator">The comparison operator used.</param>
''' <param name="operatorLocation">The location of the comparison operator.</param>
''' <param name="operand">The operand of the comparison.</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)
MyBase.New(TreeType.ComparisonCaseClause, span)
If operand Is Nothing Then
Throw New ArgumentNullException("operand")
End If
If comparisonOperator < OperatorType.Equals OrElse comparisonOperator > OperatorType.GreaterThanEquals Then
Throw New ArgumentOutOfRangeException("comparisonOperator")
End If
SetParent(operand)
_IsLocation = isLocation
_ComparisonOperator = comparisonOperator
_OperatorLocation = operatorLocation
_Operand = operand
End Sub
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
AddChild(childList, Operand)
End Sub
End Class

View file

@ -0,0 +1,48 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for a case clause that compares against a range of values.
''' </summary>
Public NotInheritable Class RangeCaseClause
Inherits CaseClause
Private ReadOnly _RangeExpression As Expression
''' <summary>
''' The range expression.
''' </summary>
Public ReadOnly Property RangeExpression() As Expression
Get
Return _RangeExpression
End Get
End Property
''' <summary>
''' Constructs a new range case clause parse tree.
''' </summary>
''' <param name="rangeExpression">The range expression.</param>
''' <param name="span">The location of the parse tree.</param>
Public Sub New(ByVal rangeExpression As Expression, ByVal span As Span)
MyBase.New(TreeType.RangeCaseClause, span)
If rangeExpression Is Nothing Then
Throw New ArgumentNullException("rangeExpression")
End If
SetParent(rangeExpression)
_RangeExpression = rangeExpression
End Sub
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
AddChild(childList, RangeExpression)
End Sub
End Class

View file

@ -0,0 +1,37 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A collection of trees that are colon delimited.
''' </summary>
Public MustInherit Class ColonDelimitedTreeCollection(Of T As Tree)
Inherits TreeCollection(Of T)
Private ReadOnly _ColonLocations As ReadOnlyCollection(Of Location)
''' <summary>
''' The locations of the colons in the collection.
''' </summary>
Public ReadOnly Property ColonLocations() As ReadOnlyCollection(Of Location)
Get
Return _ColonLocations
End Get
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)
MyBase.New(type, trees, span)
Debug.Assert(type = TreeType.StatementCollection OrElse type = TreeType.DeclarationCollection)
If colonLocations IsNot Nothing AndAlso colonLocations.Count > 0 Then
_ColonLocations = New ReadOnlyCollection(Of Location)(colonLocations)
End If
End Sub
End Class

View file

@ -0,0 +1,37 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A collection of trees that are delimited by commas.
''' </summary>
Public MustInherit Class CommaDelimitedTreeCollection(Of T As Tree)
Inherits TreeCollection(Of T)
Private ReadOnly _CommaLocations As ReadOnlyCollection(Of Location)
''' <summary>
''' The location of the commas in the list.
''' </summary>
Public ReadOnly Property CommaLocations() As ReadOnlyCollection(Of Location)
Get
Return _CommaLocations
End Get
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)
MyBase.New(type, trees, span)
Debug.Assert(type >= TreeType.ArgumentCollection AndAlso type <= TreeType.ImportCollection)
If commaLocations IsNot Nothing AndAlso commaLocations.Count > 0 Then
_CommaLocations = New ReadOnlyCollection(Of Location)(commaLocations)
End If
End Sub
End Class

View file

@ -0,0 +1,103 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A collection of a particular type of trees
''' </summary>
''' <typeparam name="T">The type of tree the collection contains.</typeparam>
Public MustInherit Class TreeCollection(Of T As Tree)
Inherits Tree
Implements IList(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)
MyBase.New(type, span)
Debug.Assert(type >= TreeType.ArgumentCollection AndAlso type <= TreeType.DeclarationCollection)
If trees Is Nothing Then
_Trees = New ReadOnlyCollection(Of T)(New List(Of T)())
Else
_Trees = New ReadOnlyCollection(Of T)(trees)
SetParents(trees)
End If
End Sub
Private Sub Add(ByVal item As T) Implements ICollection(Of T).Add
Throw New NotSupportedException()
End Sub
Private Sub Clear() Implements ICollection(Of T).Clear
Throw New NotSupportedException()
End Sub
Public Function Contains(ByVal item As T) As Boolean Implements ICollection(Of T).Contains
Return _Trees.Contains(item)
End Function
Public Sub CopyTo(ByVal array() As T, ByVal arrayIndex As Integer) Implements ICollection(Of T).CopyTo
_Trees.CopyTo(array, arrayIndex)
End Sub
Public ReadOnly Property Count() As Integer Implements ICollection(Of T).Count
Get
Return _Trees.Count
End Get
End Property
Private ReadOnly Property IsReadOnly() As Boolean Implements ICollection(Of T).IsReadOnly
Get
Return True
End Get
End Property
Private Function Remove(ByVal item As T) As Boolean Implements ICollection(Of T).Remove
Throw New NotSupportedException()
End Function
Public Function GetEnumerator() As IEnumerator(Of T) Implements IEnumerable(Of T).GetEnumerator
Return _Trees.GetEnumerator
End Function
Public Function IndexOf(ByVal item As T) As Integer Implements IList(Of T).IndexOf
Return _Trees.IndexOf(item)
End Function
Private Sub Insert(ByVal index As Integer, ByVal item As T) Implements IList(Of T).Insert
Throw New NotSupportedException()
End Sub
Public ReadOnly Property Item(ByVal index As Integer) As T
Get
Return _Trees.Item(index)
End Get
End Property
Private Property IListItem(ByVal index As Integer) As T Implements IList(Of T).Item
Get
Return _Trees.Item(index)
End Get
Set(ByVal value As T)
Throw New NotSupportedException()
End Set
End Property
Private Sub RemoveAt(ByVal index As Integer) Implements IList(Of T).RemoveAt
Throw New NotSupportedException()
End Sub
Private Function IEnumerableGetEnumerator() As IEnumerator Implements IEnumerable.GetEnumerator
Return _Trees.GetEnumerator()
End Function
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
AddChildren(childList, _Trees)
End Sub
End Class

View file

@ -0,0 +1,54 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for a comment.
''' </summary>
Public NotInheritable Class Comment
Inherits Tree
Private ReadOnly _Comment As String
Private ReadOnly _IsREM As Boolean
''' <summary>
''' The text of the comment.
''' </summary>
Public ReadOnly Property Comment() As String
Get
Return _Comment
End Get
End Property
''' <summary>
''' Whether the comment is a REM comment.
''' </summary>
Public ReadOnly Property IsREM() As Boolean
Get
Return _IsREM
End Get
End Property
''' <summary>
''' Constructs a new comment parse tree.
''' </summary>
''' <param name="comment">The text of the comment.</param>
''' <param name="isREM">Whether the comment is a REM comment.</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)
MyBase.New(TreeType.Comment, span)
If comment Is Nothing Then
Throw New ArgumentNullException("comment")
End If
_Comment = comment
_IsREM = isREM
End Sub
End Class

View file

@ -0,0 +1,49 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for an assembly-level or module-level attribute declaration.
''' </summary>
Public NotInheritable Class AttributeDeclaration
Inherits Declaration
Private ReadOnly _Attributes As AttributeBlockCollection
''' <summary>
''' The attributes.
''' </summary>
Public ReadOnly Property Attributes() As AttributeBlockCollection
Get
Return _Attributes
End Get
End Property
''' <summary>
''' Constructs a new parse tree for assembly-level or module-level attribute declarations.
''' </summary>
''' <param name="attributes">The attributes.</param>
''' <param name="span">The location of 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))
MyBase.New(TreeType.AttributeDeclaration, span, comments)
If attributes Is Nothing Then
Throw New ArgumentNullException("attributes")
End If
SetParent(attributes)
_Attributes = attributes
End Sub
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
AddChild(childList, Attributes)
End Sub
End Class

View file

@ -0,0 +1,86 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for a block declaration.
''' </summary>
Public MustInherit Class BlockDeclaration
Inherits ModifiedDeclaration
Private ReadOnly _KeywordLocation As Location
Private ReadOnly _Name As SimpleName
Private ReadOnly _Declarations As DeclarationCollection
Private ReadOnly _EndDeclaration As EndBlockDeclaration
''' <summary>
''' The location of the keyword.
''' </summary>
Public ReadOnly Property KeywordLocation() As Location
Get
Return _KeywordLocation
End Get
End Property
''' <summary>
''' The name of the declaration.
''' </summary>
Public ReadOnly Property Name() As SimpleName
Get
Return _Name
End Get
End Property
''' <summary>
''' The declarations in the block.
''' </summary>
Public ReadOnly Property Declarations() As DeclarationCollection
Get
Return _Declarations
End Get
End Property
''' <summary>
''' The End statement for the block.
''' </summary>
Public ReadOnly Property EndDeclaration() As EndBlockDeclaration
Get
Return _EndDeclaration
End Get
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))
MyBase.New(type, attributes, modifiers, span, comments)
Debug.Assert(type = TreeType.ClassDeclaration OrElse type = TreeType.ModuleDeclaration OrElse _
type = TreeType.InterfaceDeclaration OrElse type = TreeType.StructureDeclaration OrElse _
type = TreeType.EnumDeclaration)
If name Is Nothing Then
Throw New ArgumentNullException("name")
End If
SetParent(name)
SetParent(declarations)
SetParent(endDeclaration)
_KeywordLocation = keywordLocation
_Name = name
_Declarations = declarations
_EndDeclaration = endDeclaration
End Sub
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
MyBase.GetChildTrees(childList)
AddChild(childList, Name)
AddChild(childList, Declarations)
AddChild(childList, EndDeclaration)
End Sub
End Class

View file

@ -0,0 +1,44 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' 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
''' <summary>
''' A parse tree for a declaration.
''' </summary>
Public Class Declaration
Inherits Statement
''' <summary>
''' Creates a bad declaration.
''' </summary>
''' <param name="span">The location of the parse tree.</param>
''' <param name="comments">The comments for the parse tree.</param>
''' <returns>A bad declaration.</returns>
Public Shared Function GetBadDeclaration(ByVal span As Span, ByVal comments As IList(Of Comment)) As Declaration
Return New Declaration(span, comments)
End Function
Protected Sub New(ByVal type As TreeType, ByVal span As Span, ByVal comments As IList(Of Comment))
MyBase.New(type, span, comments)
Debug.Assert(type >= TreeType.EmptyDeclaration AndAlso type <= TreeType.DelegateFunctionDeclaration)
End Sub
Private Sub New(ByVal span As Span, ByVal comments As IList(Of Comment))
MyBase.New(TreeType.SyntaxError, span, comments)
End Sub
Public Overrides ReadOnly Property IsBad() As Boolean
Get
Return Type = TreeType.SyntaxError
End Get
End Property
End Class

View file

@ -0,0 +1,32 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A read-only collection of declarations.
''' </summary>
Public NotInheritable Class DeclarationCollection
Inherits ColonDelimitedTreeCollection(Of Declaration)
''' <summary>
''' Constructs a new collection of declarations.
''' </summary>
''' <param name="declarations">The declarations 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>
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)
' A declaration collection may need to hold just a colon.
If (declarations Is Nothing OrElse declarations.Count = 0) AndAlso _
(colonLocations Is Nothing OrElse colonLocations.Count = 0) Then
Throw New ArgumentException("DeclarationCollection cannot be empty.")
End If
End Sub
End Class

View file

@ -0,0 +1,25 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for an empty declaration.
''' </summary>
Public NotInheritable Class EmptyDeclaration
Inherits Declaration
''' <summary>
''' Constructs a new parse tree for an empty declaration.
''' </summary>
''' <param name="span">The location of 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))
MyBase.New(TreeType.EmptyDeclaration, span, comments)
End Sub
End Class

View file

@ -0,0 +1,71 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for an End declaration.
''' </summary>
Public NotInheritable Class EndBlockDeclaration
Inherits Declaration
Private ReadOnly _EndType As BlockType
Private ReadOnly _EndArgumentLocation As Location
''' <summary>
''' The type of block the declaration ends.
''' </summary>
Public ReadOnly Property EndType() As BlockType
Get
Return _EndType
End Get
End Property
''' <summary>
''' The location of the end block argument.
''' </summary>
Public ReadOnly Property EndArgumentLocation() As Location
Get
Return _EndArgumentLocation
End Get
End Property
''' <summary>
''' Creates a new parse tree for an End block declaration.
''' </summary>
''' <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="span">The location of 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))
MyBase.New(TreeType.EndBlockDeclaration, span, comments)
If endType < BlockType.Sub AndAlso endType > BlockType.Namespace Then
Throw New ArgumentOutOfRangeException("endType")
End If
_EndType = endType
_EndArgumentLocation = endArgumentLocation
End Sub
Friend Sub New(ByVal endBlockStatement As EndBlockStatement)
MyBase.New(TreeType.EndBlockDeclaration, endBlockStatement.Span, endBlockStatement.Comments)
' We only need to convert these types.
Select Case endBlockStatement.EndType
Case BlockType.Function, BlockType.Get, BlockType.Set, BlockType.Sub, BlockType.Operator, _
BlockType.AddHandler, BlockType.RemoveHandler, BlockType.RaiseEvent
_EndType = endBlockStatement.EndType
Case Else
Throw New ArgumentException("Invalid EndBlockStatement type.")
End Select
_EndArgumentLocation = endBlockStatement.EndArgumentLocation
End Sub
End Class

View file

@ -0,0 +1,52 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for a declaration with modifiers.
''' </summary>
Public MustInherit Class ModifiedDeclaration
Inherits Declaration
Private ReadOnly _Attributes As AttributeBlockCollection
Private ReadOnly _Modifiers As ModifierCollection
''' <summary>
''' The attributes on the declaration.
''' </summary>
Public ReadOnly Property Attributes() As AttributeBlockCollection
Get
Return _Attributes
End Get
End Property
''' <summary>
''' The modifiers on the declaration.
''' </summary>
Public ReadOnly Property Modifiers() As ModifierCollection
Get
Return _Modifiers
End Get
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))
MyBase.New(type, span, comments)
SetParent(attributes)
SetParent(modifiers)
_Attributes = attributes
_Modifiers = modifiers
End Sub
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
AddChild(childList, Attributes)
AddChild(childList, Modifiers)
End Sub
End Class

View file

@ -0,0 +1,25 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for an AddressOf expression.
''' </summary>
Public NotInheritable Class AddressOfExpression
Inherits UnaryExpression
''' <summary>
''' Constructs a new AddressOf expression parse tree.
''' </summary>
''' <param name="operand">The operand of AddressOf.</param>
''' <param name="span">The location of the parse tree.</param>
Public Sub New(ByVal operand As Expression, ByVal span As Span)
MyBase.New(TreeType.AddressOfExpression, operand, span)
End Sub
End Class

View file

@ -0,0 +1,100 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for a binary operator expression.
''' </summary>
Public NotInheritable Class BinaryOperatorExpression
Inherits Expression
Private ReadOnly _LeftOperand As Expression
Private ReadOnly _Operator As OperatorType
Private ReadOnly _OperatorLocation As Location
Private ReadOnly _RightOperand As Expression
''' <summary>
''' The left operand expression.
''' </summary>
Public ReadOnly Property LeftOperand() As Expression
Get
Return _LeftOperand
End Get
End Property
''' <summary>
''' The operator.
''' </summary>
Public ReadOnly Property [Operator]() As OperatorType
Get
Return _Operator
End Get
End Property
''' <summary>
''' The location of the operator.
''' </summary>
Public ReadOnly Property OperatorLocation() As Location
Get
Return _OperatorLocation
End Get
End Property
''' <summary>
''' The right operand expression.
''' </summary>
Public ReadOnly Property RightOperand() As Expression
Get
Return _RightOperand
End Get
End Property
''' <summary>
''' Constructs a new parse tree for a binary operation.
''' </summary>
''' <param name="leftOperand">The left operand expression.</param>
''' <param name="operator">The operator.</param>
''' <param name="operatorLocation">The location of the operator.</param>
''' <param name="rightOperand">The right operand expression.</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)
MyBase.New(TreeType.BinaryOperatorExpression, span)
If [operator] < OperatorType.Plus OrElse [operator] > OperatorType.GreaterThanEquals Then
Throw New ArgumentOutOfRangeException("operator")
End If
If leftOperand Is Nothing Then
Throw New ArgumentNullException("leftOperand")
End If
If rightOperand Is Nothing Then
Throw New ArgumentNullException("rightOperand")
End If
SetParent(leftOperand)
SetParent(rightOperand)
_LeftOperand = leftOperand
_Operator = [operator]
_OperatorLocation = operatorLocation
_RightOperand = rightOperand
End Sub
Public Overrides ReadOnly Property IsConstant() As Boolean
Get
Return LeftOperand.IsConstant AndAlso RightOperand.IsConstant
End Get
End Property
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
AddChild(childList, LeftOperand)
AddChild(childList, RightOperand)
End Sub
End Class

View file

@ -0,0 +1,43 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for a Boolean literal expression.
''' </summary>
Public NotInheritable Class BooleanLiteralExpression
Inherits LiteralExpression
Private ReadOnly _Literal As Boolean
''' <summary>
''' The literal value.
''' </summary>
Public ReadOnly Property Literal() As Boolean
Get
Return _Literal
End Get
End Property
'LC
Public Overrides ReadOnly Property Value() As Object
Get
Return _Literal
End Get
End Property
''' <summary>
''' Constructs a new parse tree for a Boolean literal expression.
''' </summary>
''' <param name="literal">The literal value.</param>
''' <param name="span">The location of the parse tree.</param>
Public Sub New(ByVal literal As Boolean, ByVal span As Span)
MyBase.New(TreeType.BooleanLiteralExpression, span)
_Literal = literal
End Sub
End Class

View file

@ -0,0 +1,29 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for a CType expression.
''' </summary>
Public NotInheritable Class CTypeExpression
Inherits CastTypeExpression
''' <summary>
''' Constructs a new parse tree for a CType expression.
''' </summary>
''' <param name="leftParenthesisLocation">The location of the '('.</param>
''' <param name="operand">The expression to be converted.</param>
''' <param name="commaLocation">The location of the ','.</param>
''' <param name="target">The target type of the conversion.</param>
''' <param name="rightParenthesisLocation">The location of the ')'.</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)
MyBase.New(TreeType.CTypeExpression, leftParenthesisLocation, operand, commaLocation, target, rightParenthesisLocation, span)
End Sub
End Class

View file

@ -0,0 +1,62 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for a call or index expression.
''' </summary>
Public NotInheritable Class CallOrIndexExpression
Inherits Expression
Private ReadOnly _TargetExpression As Expression
Private ReadOnly _Arguments As ArgumentCollection
''' <summary>
''' The target of the call or index.
''' </summary>
Public ReadOnly Property TargetExpression() As Expression
Get
Return _TargetExpression
End Get
End Property
''' <summary>
''' The arguments to the call or index.
''' </summary>
Public ReadOnly Property Arguments() As ArgumentCollection
Get
Return _Arguments
End Get
End Property
''' <summary>
''' Constructs a new parse tree for a call or index expression.
''' </summary>
''' <param name="targetExpression">The target of 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>
Public Sub New(ByVal targetExpression As Expression, ByVal arguments As ArgumentCollection, ByVal span As Span)
MyBase.New(TreeType.CallOrIndexExpression, span)
If targetExpression Is Nothing Then
Throw New ArgumentNullException("targetExpression")
End If
SetParent(targetExpression)
SetParent(arguments)
_TargetExpression = targetExpression
_Arguments = arguments
End Sub
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
AddChild(childList, TargetExpression)
AddChild(childList, Arguments)
End Sub
End Class

View file

@ -0,0 +1,79 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for a CType or DirectCast expression.
''' </summary>
Public MustInherit Class CastTypeExpression
Inherits UnaryExpression
Private ReadOnly _LeftParenthesisLocation As Location
Private ReadOnly _CommaLocation As Location
Private ReadOnly _Target As TypeName
Private ReadOnly _RightParenthesisLocation As Location
''' <summary>
''' The location of the '('.
''' </summary>
Public ReadOnly Property LeftParenthesisLocation() As Location
Get
Return _LeftParenthesisLocation
End Get
End Property
''' <summary>
''' The location of the ','.
''' </summary>
Public ReadOnly Property CommaLocation() As Location
Get
Return _CommaLocation
End Get
End Property
''' <summary>
''' The target type for the operand.
''' </summary>
Public ReadOnly Property Target() As TypeName
Get
Return _Target
End Get
End Property
''' <summary>
''' The location of the ')'.
''' </summary>
Public ReadOnly Property RightParenthesisLocation() As Location
Get
Return _RightParenthesisLocation
End Get
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)
MyBase.New(type, operand, span)
Debug.Assert(type = TreeType.CTypeExpression OrElse type = TreeType.DirectCastExpression OrElse type = TreeType.TryCastExpression)
If target Is Nothing Then
Throw New ArgumentNullException("target")
End If
SetParent(target)
_Target = target
_LeftParenthesisLocation = leftParenthesisLocation
_CommaLocation = commaLocation
_RightParenthesisLocation = rightParenthesisLocation
End Sub
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
MyBase.GetChildTrees(childList)
AddChild(childList, Target)
End Sub
End Class

View file

@ -0,0 +1,44 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for a character literal expression.
''' </summary>
Public NotInheritable Class CharacterLiteralExpression
Inherits LiteralExpression
Private ReadOnly _Literal As Char
''' <summary>
''' The literal value.
''' </summary>
Public ReadOnly Property Literal() As Char
Get
Return _Literal
End Get
End Property
'LC
Public Overrides ReadOnly Property Value() As Object
Get
Return _Literal
End Get
End Property
''' <summary>
''' Constructs a new parse tree for a character literal expression.
''' </summary>
''' <param name="literal">The literal value.</param>
''' <param name="span">The location of the parse tree.</param>
Public Sub New(ByVal literal As Char, ByVal span As Span)
MyBase.New(TreeType.CharacterLiteralExpression, span)
_Literal = literal
End Sub
End Class

View file

@ -0,0 +1,44 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for a date literal expression.
''' </summary>
Public NotInheritable Class DateLiteralExpression
Inherits LiteralExpression
Private ReadOnly _Literal As Date
''' <summary>
''' The literal value.
''' </summary>
Public ReadOnly Property Literal() As Date
Get
Return _Literal
End Get
End Property
'LC
Public Overrides ReadOnly Property Value() As Object
Get
Return _Literal
End Get
End Property
''' <summary>
''' Constructs a new parse tree for a date literal.
''' </summary>
''' <param name="literal">The literal value.</param>
''' <param name="span">The location of the parse tree.</param>
Public Sub New(ByVal literal As Date, ByVal span As Span)
MyBase.New(TreeType.DateLiteralExpression, span)
_Literal = literal
End Sub
End Class

View file

@ -0,0 +1,62 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for a decimal literal expression.
''' </summary>
Public NotInheritable Class DecimalLiteralExpression
Inherits LiteralExpression
Private ReadOnly _Literal As Decimal
Private ReadOnly _TypeCharacter As TypeCharacter
''' <summary>
''' The literal value.
''' </summary>
Public ReadOnly Property Literal() As Decimal
Get
Return _Literal
End Get
End Property
'LC
Public Overrides ReadOnly Property Value() As Object
Get
Return _Literal
End Get
End Property
''' <summary>
''' The type character on the literal value.
''' </summary>
Public ReadOnly Property TypeCharacter() As TypeCharacter
Get
Return _TypeCharacter
End Get
End Property
''' <summary>
''' Constructs a new parse tree for a floating point literal.
''' </summary>
''' <param name="literal">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>
Public Sub New(ByVal literal As Decimal, ByVal typeCharacter As TypeCharacter, ByVal span As Span)
MyBase.New(TreeType.DecimalLiteralExpression, span)
If typeCharacter <> typeCharacter.None AndAlso typeCharacter <> typeCharacter.DecimalChar AndAlso _
typeCharacter <> typeCharacter.DecimalSymbol Then
Throw New ArgumentOutOfRangeException("typeCharacter")
End If
_Literal = literal
_TypeCharacter = typeCharacter
End Sub
End Class

View file

@ -0,0 +1,74 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for a dictionary lookup expression.
''' </summary>
Public NotInheritable Class DictionaryLookupExpression
Inherits Expression
Private ReadOnly _Qualifier As Expression
Private ReadOnly _BangLocation As Location
Private ReadOnly _Name As SimpleName
''' <summary>
''' The dictionary expression.
''' </summary>
Public ReadOnly Property Qualifier() As Expression
Get
Return _Qualifier
End Get
End Property
''' <summary>
''' The location of the '!'.
''' </summary>
Public ReadOnly Property BangLocation() As Location
Get
Return _BangLocation
End Get
End Property
''' <summary>
''' The name to look up.
''' </summary>
Public ReadOnly Property Name() As SimpleName
Get
Return _Name
End Get
End Property
''' <summary>
''' Constructs a new parse tree for a dictionary lookup expression.
''' </summary>
''' <param name="qualifier">The dictionary expression.</param>
''' <param name="bangLocation">The location of the '!'.</param>
''' <param name="name">The name to look up..</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)
MyBase.New(TreeType.DictionaryLookupExpression, span)
If name Is Nothing Then
Throw New ArgumentNullException("name")
End If
SetParent(qualifier)
SetParent(name)
_Qualifier = qualifier
_BangLocation = bangLocation
_Name = name
End Sub
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
AddChild(childList, Qualifier)
AddChild(childList, Name)
End Sub
End Class

View file

@ -0,0 +1,29 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for a DirectCast expression.
''' </summary>
Public NotInheritable Class DirectCastExpression
Inherits CastTypeExpression
''' <summary>
''' Constructs a new parse tree for a DirectCast expression.
''' </summary>
''' <param name="leftParenthesisLocation">The location of the '('.</param>
''' <param name="operand">The expression to be converted.</param>
''' <param name="commaLocation">The location of the ','.</param>
''' <param name="target">The target type of the conversion.</param>
''' <param name="rightParenthesisLocation">The location of the ')'.</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)
MyBase.New(TreeType.DirectCastExpression, leftParenthesisLocation, operand, commaLocation, target, rightParenthesisLocation, span)
End Sub
End Class

View file

@ -0,0 +1,50 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for an expression.
''' </summary>
Public Class Expression
Inherits Tree
''' <summary>
''' Creates a bad expression.
''' </summary>
''' <param name="span">The location of the parse tree.</param>
''' <returns>A bad expression.</returns>
Public Shared Function GetBadExpression(ByVal span As Span) As Expression
Return New Expression(span)
End Function
''' <summary>
''' Whether the expression is constant or not.
''' </summary>
Public Overridable ReadOnly Property IsConstant() As Boolean
Get
Return False
End Get
End Property
Protected Sub New(ByVal type As TreeType, ByVal span As Span)
MyBase.New(type, span)
Debug.Assert(type >= TreeType.SimpleNameExpression AndAlso type <= TreeType.GetTypeExpression)
End Sub
Private Sub New(ByVal span As Span)
MyBase.New(TreeType.SyntaxError, span)
End Sub
Public Overrides ReadOnly Property IsBad() As Boolean
Get
Return Type = TreeType.SyntaxError
End Get
End Property
End Class

View file

@ -0,0 +1,31 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A read-only collection of expressions.
''' </summary>
Public NotInheritable Class ExpressionCollection
Inherits CommaDelimitedTreeCollection(Of Expression)
''' <summary>
''' Constructs a new collection of expressions.
''' </summary>
''' <param name="expressions">The expressions 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>
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)
If (expressions Is Nothing OrElse expressions.Count = 0) AndAlso _
(commaLocations Is Nothing OrElse commaLocations.Count = 0) Then
Throw New ArgumentException("ExpressionCollection cannot be empty.")
End If
End Sub
End Class

View file

@ -0,0 +1,63 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for a floating point literal.
''' </summary>
Public NotInheritable Class FloatingPointLiteralExpression
Inherits LiteralExpression
Private ReadOnly _Literal As Double
Private ReadOnly _TypeCharacter As TypeCharacter
''' <summary>
''' The literal value.
''' </summary>
Public ReadOnly Property Literal() As Double
Get
Return _Literal
End Get
End Property
'LC
Public Overrides ReadOnly Property Value() As Object
Get
Return _Literal
End Get
End Property
''' <summary>
''' The type character on the literal value.
''' </summary>
Public ReadOnly Property TypeCharacter() As TypeCharacter
Get
Return _TypeCharacter
End Get
End Property
''' <summary>
''' Constructs a new parse tree for a floating point literal.
''' </summary>
''' <param name="literal">The literal value.</param>
''' <param name="typeCharacter">The type character on the literal.</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)
MyBase.New(TreeType.FloatingPointLiteralExpression, span)
If typeCharacter <> typeCharacter.None AndAlso _
typeCharacter <> typeCharacter.SingleSymbol AndAlso typeCharacter <> typeCharacter.SingleChar AndAlso _
typeCharacter <> typeCharacter.DoubleSymbol AndAlso typeCharacter <> typeCharacter.DoubleChar Then
Throw New ArgumentOutOfRangeException("typeCharacter")
End If
_Literal = literal
_TypeCharacter = typeCharacter
End Sub
End Class

View file

@ -0,0 +1,66 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for a qualified name expression.
''' </summary>
Public NotInheritable Class GenericQualifiedExpression
Inherits Expression
Private ReadOnly _Base As Expression
Private ReadOnly _TypeArguments As TypeArgumentCollection
''' <summary>
''' The base expression.
''' </summary>
Public ReadOnly Property Base() As Expression
Get
Return _Base
End Get
End Property
''' <summary>
''' The qualifying type arguments.
''' </summary>
Public ReadOnly Property TypeArguments() As TypeArgumentCollection
Get
Return _TypeArguments
End Get
End Property
''' <summary>
''' Constructs a new parse tree for a generic qualified expression.
''' </summary>
''' <param name="base">The base expression.</param>
''' <param name="typeArguments">The qualifying type arguments.</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)
MyBase.New(TreeType.GenericQualifiedExpression, span)
If base Is Nothing Then
Throw New ArgumentNullException("base")
End If
If typeArguments Is Nothing Then
Throw New ArgumentNullException("typeArguments")
End If
SetParent(base)
SetParent(typeArguments)
_Base = base
_TypeArguments = typeArguments
End Sub
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
AddChild(childList, Base)
AddChild(childList, TypeArguments)
End Sub
End Class

View file

@ -0,0 +1,72 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for a GetType expression.
''' </summary>
Public NotInheritable Class GetTypeExpression
Inherits Expression
Private ReadOnly _LeftParenthesisLocation As Location
Private ReadOnly _Target As TypeName
Private ReadOnly _RightParenthesisLocation As Location
''' <summary>
''' The location of the '('.
''' </summary>
Public ReadOnly Property LeftParenthesisLocation() As Location
Get
Return _LeftParenthesisLocation
End Get
End Property
''' <summary>
''' The target type of the GetType expression.
''' </summary>
Public ReadOnly Property Target() As TypeName
Get
Return _Target
End Get
End Property
''' <summary>
''' The location of the ')'.
''' </summary>
Public ReadOnly Property RightParenthesisLocation() As Location
Get
Return _RightParenthesisLocation
End Get
End Property
''' <summary>
''' Constructs a new parse tree for a GetType expression.
''' </summary>
''' <param name="leftParenthesisLocation">The location of the '('.</param>
''' <param name="target">The target type of the GetType expression.</param>
''' <param name="rightParenthesisLocation">The location of the ')'.</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)
MyBase.New(TreeType.GetTypeExpression, span)
If target Is Nothing Then
Throw New ArgumentNullException("target")
End If
SetParent(target)
_LeftParenthesisLocation = leftParenthesisLocation
_Target = target
_RightParenthesisLocation = rightParenthesisLocation
End Sub
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
AddChild(childList, Target)
End Sub
End Class

View file

@ -0,0 +1,24 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for Nothing.
''' </summary>
Public NotInheritable Class GlobalExpression
Inherits Expression
''' <summary>
''' Constructs a new parse tree for Global.
''' </summary>
''' <param name="span">The location of the parse tree.</param>
Public Sub New(ByVal span As Span)
MyBase.New(TreeType.GlobalExpression, span)
End Sub
End Class

View file

@ -0,0 +1,42 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for Me, MyBase or MyClass.
''' </summary>
Public NotInheritable Class InstanceExpression
Inherits Expression
Private _InstanceType As InstanceType
''' <summary>
''' The type of the instance expression.
''' </summary>
Public ReadOnly Property InstanceType() As InstanceType
Get
Return _InstanceType
End Get
End Property
''' <summary>
''' Constructs a new parse tree for My, MyBase or MyClass.
''' </summary>
''' <param name="instanceType">The type of the instance expression.</param>
''' <param name="span">The location of the parse tree.</param>
Public Sub New(ByVal instanceType As InstanceType, ByVal span As Span)
MyBase.New(TreeType.InstanceExpression, span)
If instanceType < instanceType.Me OrElse instanceType > instanceType.MyBase Then
Throw New ArgumentOutOfRangeException("instanceType")
End If
_InstanceType = instanceType
End Sub
End Class

View file

@ -0,0 +1,18 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' The type of an instance expression.
''' </summary>
Public Enum InstanceType
[Me]
[MyClass]
[MyBase]
End Enum

View file

@ -0,0 +1,80 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for an integer literal.
''' </summary>
Public NotInheritable Class IntegerLiteralExpression
Inherits LiteralExpression
Private ReadOnly _Literal As Integer
Private ReadOnly _TypeCharacter As TypeCharacter
Private ReadOnly _IntegerBase As IntegerBase
''' <summary>
''' The literal value.
''' </summary>
Public ReadOnly Property Literal() As Integer
Get
Return _Literal
End Get
End Property
'LC
Public Overrides ReadOnly Property Value() As Object
Get
Return _Literal
End Get
End Property
''' <summary>
''' The type character on the literal.
''' </summary>
Public ReadOnly Property TypeCharacter() As TypeCharacter
Get
Return _TypeCharacter
End Get
End Property
''' <summary>
''' The integer base of the literal.
''' </summary>
Public ReadOnly Property IntegerBase() As IntegerBase
Get
Return _IntegerBase
End Get
End Property
''' <summary>
''' Constructs a new parse tree for an integer literal.
''' </summary>
''' <param name="literal">The literal value.</param>
''' <param name="integerBase">The integer base of the literal.</param>
''' <param name="typeCharacter">The type character on the literal.</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)
MyBase.New(TreeType.IntegerLiteralExpression, span)
If integerBase < integerBase.Decimal OrElse integerBase > integerBase.Hexadecimal Then
Throw New ArgumentOutOfRangeException("integerBase")
End If
If typeCharacter <> typeCharacter.None AndAlso _
typeCharacter <> typeCharacter.IntegerSymbol AndAlso typeCharacter <> typeCharacter.IntegerChar AndAlso _
typeCharacter <> typeCharacter.ShortChar AndAlso _
typeCharacter <> typeCharacter.LongSymbol AndAlso typeCharacter <> typeCharacter.LongChar Then
Throw New ArgumentOutOfRangeException("typeCharacter")
End If
_Literal = literal
_IntegerBase = integerBase
_TypeCharacter = typeCharacter
End Sub
End Class

View file

@ -0,0 +1,71 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for an intrinsic conversion expression.
''' </summary>
Public NotInheritable Class IntrinsicCastExpression
Inherits UnaryExpression
Private ReadOnly _IntrinsicType As IntrinsicType
Private ReadOnly _LeftParenthesisLocation As Location
Private ReadOnly _RightParenthesisLocation As Location
''' <summary>
''' The intrinsic type conversion.
''' </summary>
Public ReadOnly Property IntrinsicType() As IntrinsicType
Get
Return _IntrinsicType
End Get
End Property
''' <summary>
''' The location of the '('.
''' </summary>
Public ReadOnly Property LeftParenthesisLocation() As Location
Get
Return _LeftParenthesisLocation
End Get
End Property
''' <summary>
''' The location of the ')'.
''' </summary>
Public ReadOnly Property RightParenthesisLocation() As Location
Get
Return _RightParenthesisLocation
End Get
End Property
''' <summary>
''' Constructs a new parse tree for an intrinsic conversion expression.
''' </summary>
''' <param name="intrinsicType">The intrinsic type conversion.</param>
''' <param name="leftParenthesisLocation">The location of the '('.</param>
''' <param name="operand">The expression to convert.</param>
''' <param name="rightParenthesisLocation">The location of the ')'.</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)
MyBase.New(TreeType.IntrinsicCastExpression, operand, span)
If intrinsicType < intrinsicType.Boolean OrElse intrinsicType > intrinsicType.Object Then
Throw New ArgumentOutOfRangeException("intrinsicType")
End If
If operand Is Nothing Then
Throw New ArgumentNullException("operand")
End If
_IntrinsicType = intrinsicType
_LeftParenthesisLocation = leftParenthesisLocation
_RightParenthesisLocation = rightParenthesisLocation
End Sub
End Class

View file

@ -0,0 +1,31 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for a literal expression.
''' </summary>
Public MustInherit Class LiteralExpression
Inherits Expression
Public NotOverridable Overrides ReadOnly Property IsConstant() As Boolean
Get
Return True
End Get
End Property
'LC add property to get value
Public MustOverride ReadOnly Property Value() As Object
Protected Sub New(ByVal type As TreeType, ByVal span As Span)
MyBase.New(type, span)
Debug.Assert(type >= TreeType.StringLiteralExpression AndAlso type <= TreeType.BooleanLiteralExpression)
End Sub
End Class

View file

@ -0,0 +1,66 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for a New array expression.
''' </summary>
Public NotInheritable Class NewAggregateExpression
Inherits Expression
Private ReadOnly _Target As ArrayTypeName
Private ReadOnly _Initializer As AggregateInitializer
''' <summary>
''' The target array type to create.
''' </summary>
Public ReadOnly Property Target() As ArrayTypeName
Get
Return _Target
End Get
End Property
''' <summary>
''' The initializer for the array.
''' </summary>
Public ReadOnly Property Initializer() As AggregateInitializer
Get
Return _Initializer
End Get
End Property
''' <summary>
''' The constructor for a New array expression parse tree.
''' </summary>
''' <param name="target">The target array type to create.</param>
''' <param name="initializer">The initializer for the array.</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)
MyBase.New(TreeType.NewAggregateExpression, span)
If target Is Nothing Then
Throw New ArgumentNullException("target")
End If
If initializer Is Nothing Then
Throw New ArgumentNullException("initializer")
End If
SetParent(target)
SetParent(initializer)
_Target = target
_Initializer = initializer
End Sub
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
AddChild(childList, Target)
AddChild(childList, Initializer)
End Sub
End Class

View file

@ -0,0 +1,62 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for a New expression.
''' </summary>
Public NotInheritable Class NewExpression
Inherits Expression
Private ReadOnly _Target As TypeName
Private ReadOnly _Arguments As ArgumentCollection
''' <summary>
''' The target type to create.
''' </summary>
Public ReadOnly Property Target() As TypeName
Get
Return _Target
End Get
End Property
''' <summary>
''' The arguments to the constructor.
''' </summary>
Public ReadOnly Property Arguments() As ArgumentCollection
Get
Return _Arguments
End Get
End Property
''' <summary>
''' Constructs a new parse tree for a New expression.
''' </summary>
''' <param name="target">The target type to create.</param>
''' <param name="arguments">The arguments to the constructor.</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)
MyBase.New(TreeType.NewExpression, span)
If target Is Nothing Then
Throw New ArgumentNullException("target")
End If
SetParent(target)
SetParent(arguments)
_Target = target
_Arguments = arguments
End Sub
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
AddChild(childList, Target)
AddChild(childList, Arguments)
End Sub
End Class

View file

@ -0,0 +1,30 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for Nothing.
''' </summary>
Public NotInheritable Class NothingExpression
Inherits Expression
Public Overrides ReadOnly Property IsConstant() As Boolean
Get
Return True
End Get
End Property
''' <summary>
''' Constructs a new parse tree for Nothing.
''' </summary>
''' <param name="span">The location of the parse tree.</param>
Public Sub New(ByVal span As Span)
MyBase.New(TreeType.NothingExpression, span)
End Sub
End Class

View file

@ -0,0 +1,48 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' The type of a unary operator expression.
''' </summary>
Public Enum OperatorType
None
' Unary operators
UnaryPlus
Negate
[Not]
' Binary operators
Plus
Minus
Multiply
Divide
IntegralDivide
Concatenate
ShiftLeft
ShiftRight
Power
Modulus
[Or]
[OrElse]
[And]
[AndAlso]
[Xor]
[Like]
[Is]
[IsNot]
[To]
Equals
NotEquals
LessThan
LessThanEquals
GreaterThan
GreaterThanEquals
End Enum

View file

@ -0,0 +1,39 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for a parenthesized expression.
''' </summary>
Public NotInheritable Class ParentheticalExpression
Inherits UnaryExpression
Private ReadOnly _RightParenthesisLocation As Location
''' <summary>
''' The location of the ')'.
''' </summary>
Public ReadOnly Property RightParenthesisLocation() As Location
Get
Return _RightParenthesisLocation
End Get
End Property
''' <summary>
''' Constructs a new parenthesized expression parse tree.
''' </summary>
''' <param name="operand">The operand of the expression.</param>
''' <param name="rightParenthesisLocation">The location of the ')'.</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)
MyBase.New(TreeType.ParentheticalExpression, operand, span)
_RightParenthesisLocation = rightParenthesisLocation
End Sub
End Class

View file

@ -0,0 +1,74 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for a qualified name expression.
''' </summary>
Public NotInheritable Class QualifiedExpression
Inherits Expression
Private ReadOnly _Qualifier As Expression
Private ReadOnly _DotLocation As Location
Private ReadOnly _Name As SimpleName
''' <summary>
''' The expression qualifying the name.
''' </summary>
Public ReadOnly Property Qualifier() As Expression
Get
Return _Qualifier
End Get
End Property
''' <summary>
''' The location of the '.'.
''' </summary>
Public ReadOnly Property DotLocation() As Location
Get
Return _DotLocation
End Get
End Property
''' <summary>
''' The qualified name.
''' </summary>
Public ReadOnly Property Name() As SimpleName
Get
Return _Name
End Get
End Property
''' <summary>
''' Constructs a new parse tree for a qualified name expression.
''' </summary>
''' <param name="qualifier">The expression qualifying the name.</param>
''' <param name="dotLocation">The location of the '.'.</param>
''' <param name="name">The qualified name.</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)
MyBase.New(TreeType.QualifiedExpression, span)
If name Is Nothing Then
Throw New ArgumentNullException("name")
End If
SetParent(qualifier)
SetParent(name)
_Qualifier = qualifier
_DotLocation = dotLocation
_Name = name
End Sub
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
AddChild(childList, Qualifier)
AddChild(childList, Name)
End Sub
End Class

View file

@ -0,0 +1,48 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for a simple name expression.
''' </summary>
Public NotInheritable Class SimpleNameExpression
Inherits Expression
Private ReadOnly _Name As SimpleName
''' <summary>
''' The name.
''' </summary>
Public ReadOnly Property Name() As SimpleName
Get
Return _Name
End Get
End Property
''' <summary>
''' Constructs a new parse tree for a simple name expression.
''' </summary>
''' <param name="name">The name.</param>
''' <param name="span">The location of the parse tree.</param>
Public Sub New(ByVal name As SimpleName, ByVal span As Span)
MyBase.New(TreeType.SimpleNameExpression, span)
If name Is Nothing Then
Throw New ArgumentNullException("name")
End If
SetParent(name)
_Name = name
End Sub
Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree))
AddChild(childList, Name)
End Sub
End Class

View file

@ -0,0 +1,49 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for a string literal expression.
''' </summary>
Public NotInheritable Class StringLiteralExpression
Inherits LiteralExpression
Private ReadOnly _Literal As String
''' <summary>
''' The literal value.
''' </summary>
Public ReadOnly Property Literal() As String
Get
Return _Literal
End Get
End Property
'LC
Public Overrides ReadOnly Property Value() As Object
Get
Return _Literal
End Get
End Property
''' <summary>
''' Constructs a new string literal expression parse tree.
''' </summary>
''' <param name="literal">The literal value.</param>
''' <param name="span">The location of the parse tree.</param>
Public Sub New(ByVal literal As String, ByVal span As Span)
MyBase.New(TreeType.StringLiteralExpression, span)
If literal Is Nothing Then
Throw New ArgumentNullException("literal")
End If
_Literal = literal
End Sub
End Class

View file

@ -0,0 +1,29 @@
'
' Visual Basic .NET Parser
'
' Copyright (C) 2005, Microsoft Corporation. All rights reserved.
'
' 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
' MERCHANTIBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
''' <summary>
''' A parse tree for a CType expression.
''' </summary>
Public NotInheritable Class TryCastExpression
Inherits CastTypeExpression
''' <summary>
''' Constructs a new parse tree for a TryCast expression.
''' </summary>
''' <param name="leftParenthesisLocation">The location of the '('.</param>
''' <param name="operand">The expression to be converted.</param>
''' <param name="commaLocation">The location of the ','.</param>
''' <param name="target">The target type of the conversion.</param>
''' <param name="rightParenthesisLocation">The location of the ')'.</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)
MyBase.New(TreeType.TryCastExpression, leftParenthesisLocation, operand, commaLocation, target, rightParenthesisLocation, span)
End Sub
End Class

Some files were not shown because too many files have changed in this diff Show more