From 9fcff1b8fba00f346033d0972d93b7f7c03814bb Mon Sep 17 00:00:00 2001 From: dotneteer Date: Tue, 29 Mar 2011 22:07:13 -0700 Subject: [PATCH] Check in the source code --- .hgignore | 10 + aspclassiccompiler/ASPClassicCompiler.sln | 48 + .../ASPClassicCompiler.vs2010.sln | 42 + .../AspWebApp/bin/AspWebApp.dll | Bin 4096 -> 0 bytes .../AspWebApp/bin/AspWebApp.pdb | Bin 7680 -> 0 bytes aspclassiccompiler/Credits.txt | 14 + aspclassiccompiler/License.txt | 71 + .../NerdDinnerAsp/bin/NerdDinner.dll | Bin 36352 -> 0 bytes .../NerdDinnerAsp/bin/NerdDinner.pdb | Bin 79360 -> 0 bytes .../NerdDinnerAsp/bin/System.Web.Mvc.dll | Bin 186176 -> 0 bytes .../NerdDinnerAsp/bin/System.Web.Mvc.xml | 8178 ----------------- aspclassiccompiler/Parser/AssemblyInfo.vb | 24 + aspclassiccompiler/Parser/ExternalChecksum.vb | 57 + .../Parser/ExternalLineMapping.vb | 68 + aspclassiccompiler/Parser/IntegerBase.vb | 24 + aspclassiccompiler/Parser/LanguageVersion.vb | 27 + aspclassiccompiler/Parser/License.txt | 48 + aspclassiccompiler/Parser/Location.vb | 160 + .../Parser/My Project/Application.Designer.vb | 13 + .../Parser/My Project/Application.myapp | 11 + .../Parser/Parser.VS2010.vbproj | 453 + aspclassiccompiler/Parser/Parser.vb | 6861 ++++++++++++++ aspclassiccompiler/Parser/Parser.vbproj | 447 + aspclassiccompiler/Parser/SLVBParser.vbproj | 305 + aspclassiccompiler/Parser/Scanner.vb | 1361 +++ .../Parser/Serializers/ErrorXmlSerializer.vb | 40 + .../Parser/Serializers/TokenXmlSerializer.vb | 126 + .../Parser/Serializers/TreeXmlSerializer.vb | 1403 +++ aspclassiccompiler/Parser/SourceRegion.vb | 56 + aspclassiccompiler/Parser/Span.vb | 91 + aspclassiccompiler/Parser/SyntaxError.vb | 236 + aspclassiccompiler/Parser/SyntaxErrorType.vb | 204 + .../Parser/Tokens/CharacterLiteralToken.vb | 37 + .../Parser/Tokens/CommentToken.vb | 54 + .../Parser/Tokens/DateLiteralToken.vb | 37 + .../Parser/Tokens/DecimalLiteralToken.vb | 55 + .../Parser/Tokens/EndOfStreamToken.vb | 25 + .../Parser/Tokens/ErrorToken.vb | 42 + .../Tokens/FloatingPointLiteralToken.vb | 56 + .../Parser/Tokens/IdentifierToken.vb | 313 + .../Parser/Tokens/IntegerLiteralToken.vb | 74 + .../Parser/Tokens/LineTerminatorToken.vb | 24 + .../Parser/Tokens/PunctuatorToken.vb | 89 + .../Parser/Tokens/StringLiteralToken.vb | 42 + aspclassiccompiler/Parser/Tokens/Token.vb | 49 + aspclassiccompiler/Parser/Tokens/TokenType.vb | 236 + .../Tokens/UnsignedIntegerLiteralToken.vb | 76 + .../Parser/Trees/Arguments/Argument.vb | 78 + .../Trees/Arguments/ArgumentCollection.vb | 40 + .../Parser/Trees/Attributes/Attribute.vb | 98 + .../Attributes/AttributeBlockCollection.vb | 29 + .../Trees/Attributes/AttributeCollection.vb | 44 + .../Parser/Trees/Attributes/AttributeTypes.vb | 24 + aspclassiccompiler/Parser/Trees/BlockType.vb | 47 + .../Parser/Trees/CaseClauses/CaseClause.vb | 22 + .../Trees/CaseClauses/CaseClauseCollection.vb | 30 + .../Trees/CaseClauses/ComparisonCaseClause.vb | 88 + .../Trees/CaseClauses/RangeCaseClause.vb | 48 + .../ColonDelimitedTreeCollection.vb | 37 + .../CommaDelimitedTreeCollection.vb | 37 + .../Trees/Collections/TreeCollection.vb | 103 + .../Parser/Trees/Comments/Comment.vb | 54 + .../Declarations/AttributeDeclaration.vb | 49 + .../Trees/Declarations/BlockDeclaration.vb | 86 + .../Parser/Trees/Declarations/Declaration.vb | 44 + .../Declarations/DeclarationCollection.vb | 32 + .../Trees/Declarations/EmptyDeclaration.vb | 25 + .../Trees/Declarations/EndBlockDeclaration.vb | 71 + .../Trees/Declarations/ModifiedDeclaration.vb | 52 + .../Trees/Expressions/AddressOfExpression.vb | 25 + .../Expressions/BinaryOperatorExpression.vb | 100 + .../Expressions/BooleanLiteralExpression.vb | 43 + .../Trees/Expressions/CTypeExpression.vb | 29 + .../Expressions/CallOrIndexExpression.vb | 62 + .../Trees/Expressions/CastTypeExpression.vb | 79 + .../Expressions/CharacterLiteralExpression.vb | 44 + .../Expressions/DateLiteralExpression.vb | 44 + .../Expressions/DecimalLiteralExpression.vb | 62 + .../Expressions/DictionaryLookupExpression.vb | 74 + .../Trees/Expressions/DirectCastExpression.vb | 29 + .../Parser/Trees/Expressions/Expression.vb | 50 + .../Trees/Expressions/ExpressionCollection.vb | 31 + .../FloatingPointLiteralExpression.vb | 63 + .../Expressions/GenericQualifiedExpression.vb | 66 + .../Trees/Expressions/GetTypeExpression.vb | 72 + .../Trees/Expressions/GlobalExpression.vb | 24 + .../Trees/Expressions/InstanceExpression.vb | 42 + .../Parser/Trees/Expressions/InstanceType.vb | 18 + .../Expressions/IntegerLiteralExpression.vb | 80 + .../Expressions/IntrinsicCastExpression.vb | 71 + .../Trees/Expressions/LiteralExpression.vb | 31 + .../Expressions/NewAggregateExpression.vb | 66 + .../Parser/Trees/Expressions/NewExpression.vb | 62 + .../Trees/Expressions/NothingExpression.vb | 30 + .../Parser/Trees/Expressions/OperatorType.vb | 48 + .../Expressions/ParentheticalExpression.vb | 39 + .../Trees/Expressions/QualifiedExpression.vb | 74 + .../Trees/Expressions/SimpleNameExpression.vb | 48 + .../Expressions/StringLiteralExpression.vb | 49 + .../Trees/Expressions/TryCastExpression.vb | 29 + .../Trees/Expressions/TypeOfExpression.vb | 62 + .../Expressions/TypeReferenceExpression.vb | 47 + .../Trees/Expressions/UnaryExpression.vb | 54 + .../Expressions/UnaryOperatorExpression.vb | 43 + aspclassiccompiler/Parser/Trees/Files/File.vb | 44 + .../Parser/Trees/Files/ImportsDeclaration.vb | 51 + .../Trees/Files/NamespaceDeclaration.vb | 93 + .../Parser/Trees/Files/OptionDeclaration.vb | 67 + .../Parser/Trees/Files/OptionType.vb | 24 + .../Parser/Trees/Files/ScriptBlock.vb | 32 + .../Parser/Trees/Imports/AliasImport.vb | 79 + .../Parser/Trees/Imports/Import.vb | 22 + .../Parser/Trees/Imports/ImportCollection.vb | 31 + .../Parser/Trees/Imports/NameImport.vb | 48 + .../Initializers/AggregateInitializer.vb | 47 + .../Initializers/ExpressionInitializer.vb | 48 + .../Parser/Trees/Initializers/Initializer.vb | 22 + .../Initializers/InitializerCollection.vb | 38 + .../Parser/Trees/IntrinsicType.vb | 31 + .../Members/AddHandlerAccessorDeclaration.vb | 88 + .../Parser/Trees/Members/Charset.vb | 18 + .../Trees/Members/ConstructorDeclaration.vb | 32 + .../Trees/Members/CustomEventDeclaration.vb | 92 + .../Trees/Members/EnumValueDeclaration.vb | 78 + .../Parser/Trees/Members/EventDeclaration.vb | 53 + .../Trees/Members/ExternalDeclaration.vb | 108 + .../Members/ExternalFunctionDeclaration.vb | 40 + .../Trees/Members/ExternalSubDeclaration.vb | 37 + .../Trees/Members/FunctionDeclaration.vb | 38 + .../Trees/Members/GetAccessorDeclaration.vb | 75 + .../Parser/Trees/Members/MethodDeclaration.vb | 83 + .../Trees/Members/OperatorDeclaration.vb | 48 + .../Trees/Members/PropertyDeclaration.vb | 82 + .../Members/RaiseEventAccessorDeclaration.vb | 88 + .../RemoveHandlerAccessorDeclaration.vb | 88 + .../Trees/Members/SetAccessorDeclaration.vb | 89 + .../Trees/Members/SignatureDeclaration.vb | 114 + .../Parser/Trees/Members/SubDeclaration.vb | 35 + .../Trees/Members/VariableListDeclaration.vb | 52 + .../Parser/Trees/Modifiers/Modifier.vb | 44 + .../Trees/Modifiers/ModifierCollection.vb | 44 + .../Parser/Trees/Modifiers/ModifierTypes.vb | 44 + .../Parser/Trees/Names/GlobalNamespaceName.vb | 24 + aspclassiccompiler/Parser/Trees/Names/Name.vb | 22 + .../Parser/Trees/Names/NameCollection.vb | 29 + .../Parser/Trees/Names/QualifiedName.vb | 78 + .../Parser/Trees/Names/SimpleName.vb | 96 + .../Parser/Trees/Names/SpecialName.vb | 26 + .../Parser/Trees/Names/SpecialNameTypes.vb | 18 + .../Parser/Trees/Names/VariableName.vb | 65 + .../Trees/Names/VariableNameCollection.vb | 29 + .../Parser/Trees/Parameters/Parameter.vb | 128 + .../Trees/Parameters/ParameterCollection.vb | 40 + .../Trees/Statements/AddHandlerStatement.vb | 28 + .../Trees/Statements/AssignmentStatement.vb | 100 + .../Parser/Trees/Statements/BlockStatement.vb | 38 + .../Parser/Trees/Statements/CallStatement.vb | 75 + .../Trees/Statements/CaseBlockStatement.vb | 50 + .../Statements/CaseElseBlockStatement.vb | 50 + .../Trees/Statements/CaseElseStatement.vb | 39 + .../Parser/Trees/Statements/CaseStatement.vb | 48 + .../Trees/Statements/CatchBlockStatement.vb | 50 + .../Parser/Trees/Statements/CatchStatement.vb | 97 + .../Statements/CompoundAssignmentStatement.vb | 95 + .../Trees/Statements/ContinueStatement.vb | 59 + .../Trees/Statements/DoBlockStatement.vb | 85 + .../Trees/Statements/ElseBlockStatement.vb | 50 + .../Trees/Statements/ElseIfBlockStatement.vb | 50 + .../Trees/Statements/ElseIfStatement.vb | 60 + .../Parser/Trees/Statements/ElseStatement.vb | 25 + .../Parser/Trees/Statements/EmptyStatement.vb | 25 + .../Trees/Statements/EndBlockStatement.vb | 55 + .../Parser/Trees/Statements/EndStatement.vb | 25 + .../Parser/Trees/Statements/EraseStatement.vb | 48 + .../Parser/Trees/Statements/ErrorStatement.vb | 26 + .../Parser/Trees/Statements/ExitStatement.vb | 60 + .../Statements/ExpressionBlockStatement.vb | 58 + .../Trees/Statements/ExpressionStatement.vb | 47 + .../Trees/Statements/FinallyBlockStatement.vb | 50 + .../Trees/Statements/FinallyStatement.vb | 25 + .../Trees/Statements/ForBlockStatement.vb | 157 + .../Trees/Statements/ForEachBlockStatement.vb | 117 + .../Parser/Trees/Statements/GotoStatement.vb | 27 + .../Trees/Statements/HandlerStatement.vb | 73 + .../Trees/Statements/IfBlockStatement.vb | 105 + .../Statements/LabelReferenceStatement.vb | 52 + .../Parser/Trees/Statements/LabelStatement.vb | 27 + .../Trees/Statements/LineIfStatement.vb | 101 + .../Statements/LocalDeclarationStatement.vb | 67 + .../Parser/Trees/Statements/LoopStatement.vb | 69 + .../Statements/MidAssignmentStatement.vb | 170 + .../Parser/Trees/Statements/NextStatement.vb | 44 + .../Trees/Statements/OnErrorStatement.vb | 99 + .../Parser/Trees/Statements/OnErrorType.vb | 20 + .../Trees/Statements/RaiseEventStatement.vb | 63 + .../Parser/Trees/Statements/ReDimStatement.vb | 69 + .../Statements/RemoveHandlerStatement.vb | 28 + .../Trees/Statements/ResumeStatement.vb | 63 + .../Parser/Trees/Statements/ResumeType.vb | 18 + .../Trees/Statements/ReturnStatement.vb | 26 + .../Trees/Statements/SelectBlockStatement.vb | 103 + .../Parser/Trees/Statements/Statement.vb | 38 + .../Trees/Statements/StatementCollection.vb | 31 + .../Parser/Trees/Statements/StopStatement.vb | 25 + .../Statements/SyncLockBlockStatement.vb | 28 + .../Parser/Trees/Statements/ThrowStatement.vb | 26 + .../Trees/Statements/TryBlockStatement.vb | 75 + .../Trees/Statements/UsingBlockStatement.vb | 64 + .../Parser/Trees/Statements/WhileStatement.vb | 28 + .../Parser/Trees/Statements/WithStatement.vb | 28 + aspclassiccompiler/Parser/Trees/Tree.vb | 112 + aspclassiccompiler/Parser/Trees/TreeType.vb | 200 + .../Parser/Trees/TypeNames/ArrayTypeName.vb | 77 + .../Trees/TypeNames/ConstructedTypeName.vb | 48 + .../Trees/TypeNames/IntrinsicTypeName.vb | 42 + .../Parser/Trees/TypeNames/NamedTypeName.vb | 67 + .../Trees/TypeNames/TypeArgumentCollection.vb | 52 + .../Parser/Trees/TypeNames/TypeName.vb | 22 + .../Trees/TypeNames/TypeNameCollection.vb | 30 + .../TypeConstraintCollection.vb | 40 + .../Trees/TypeParameters/TypeParameter.vb | 74 + .../TypeParameters/TypeParameterCollection.vb | 52 + .../Parser/Trees/Types/ClassDeclaration.vb | 32 + .../Parser/Trees/Types/DelegateDeclaration.vb | 39 + .../Types/DelegateFunctionDeclaration.vb | 39 + .../Trees/Types/DelegateSubDeclaration.vb | 32 + .../Parser/Trees/Types/EnumDeclaration.vb | 65 + .../Trees/Types/GenericBlockDeclaration.vb | 42 + .../Trees/Types/ImplementsDeclaration.vb | 51 + .../Parser/Trees/Types/InheritsDeclaration.vb | 51 + .../Trees/Types/InterfaceDeclaration.vb | 32 + .../Parser/Trees/Types/ModuleDeclaration.vb | 31 + .../Trees/Types/StructureDeclaration.vb | 32 + .../VariableDeclarators/VariableDeclarator.vb | 126 + .../VariableDeclaratorCollection.vb | 30 + aspclassiccompiler/Parser/TypeCharacter.vb | 69 + .../Binders/VBScriptBinaryOperationBinder.cs | 183 + .../Binders/VBScriptCreateInstanceBinder.cs | 88 + .../Binders/VBScriptGetIndexBinder.cs | 67 + .../Binders/VBScriptGetMemberBinder.cs | 72 + .../VBScript/Binders/VBScriptInvokeBinder.cs | 81 + .../Binders/VBScriptInvokeMemberBinder.cs | 215 + .../Binders/VBScriptSetIndexBinder.cs | 80 + .../Binders/VBScriptSetMemberBinder.cs | 96 + .../Binders/VBScriptUnaryOperationBinder.cs | 83 + .../VBScriptUnaryOperationBinder.cs.bak | 43 + .../VBScript/Compiler/AnalysisScope.cs | 295 + .../VBScript/Compiler/DocSpan.cs | 19 + .../VBScript/Compiler/ISourceMapper.cs | 12 + aspclassiccompiler/VBScript/Compiler/Set.cs | 88 + .../VBScript/Compiler/SourceUtil.cs | 179 + .../VBScript/Compiler/VBScriptAnalyzer.cs | 136 + .../Compiler/VBScriptCompilerException.cs | 21 + .../VBScript/Compiler/VBScriptGenerator.cs | 1844 ++++ .../Compiler/VBScriptSourceCodeReader.cs | 24 + .../VBScript/Compiler/VBScriptSourceMapper.cs | 66 + .../Compiler/VBScriptStringContentProvider.cs | 27 + .../VBScript/Compiler/VBScriptSyntaxError.cs | 23 + .../VBScript/Properties/AssemblyInfo.cs | 36 + .../VBScript/Runtime/BuiltInConstants.cs | 95 + .../VBScript/Runtime/BuiltInFunctions.cs | 1270 +++ .../VBScript/Runtime/DynamicObjectHelpers.cs | 118 + .../VBScript/Runtime/ErrObject.cs | 84 + .../VBScript/Runtime/HelperFunctions.cs | 667 ++ aspclassiccompiler/VBScript/Runtime/ITrace.cs | 19 + .../VBScript/Runtime/InvokeMemberBinderKey.cs | 50 + .../VBScript/Runtime/RuntimeHelpers.cs | 683 ++ .../VBScript/Runtime/StringExtensionsClass.cs | 25 + .../VBScript/Runtime/TraceHelper.cs | 49 + .../VBScript/Runtime/TypeModel.cs | 42 + .../VBScript/Runtime/TypeModelMetaObject.cs | 197 + .../VBScript/Runtime/VBScriptDlrScope.cs | 42 + .../Runtime/VBScriptRuntimeException.cs | 50 + .../Runtime/VBScriptTraceCallbackListener.cs | 46 + aspclassiccompiler/VBScript/SLVBScript.csproj | 120 + .../VBScript/VBScript.VS2010.csproj | 148 + aspclassiccompiler/VBScript/VBScript.cs | 465 + aspclassiccompiler/VBScript/VBScript.csproj | 115 + .../VBScript/hosting/VBScriptCode.cs | 59 + .../VBScript/hosting/VBScriptContext.cs | 93 + aspclassiccompiler/VBScriptSilverlight.sln | 26 + aspclassiccompiler/asp/Asp.VS2010.csproj | 144 + aspclassiccompiler/asp/Asp.csproj | 118 + aspclassiccompiler/asp/AspHandler.cs | 124 + .../asp/AspHandlerConfiguration.cs | 28 + aspclassiccompiler/asp/AspHelper.cs | 47 + aspclassiccompiler/asp/AspHost.cs | 107 + .../asp/AspHostConfiguration.cs | 14 + aspclassiccompiler/asp/AspPageDom.cs | 208 + .../asp/BuiltInObjects/AspApplication.cs | 69 + .../asp/BuiltInObjects/AspCookie.cs | 125 + .../asp/BuiltInObjects/AspCookieCollection.cs | 66 + .../asp/BuiltInObjects/AspError.cs | 83 + .../asp/BuiltInObjects/AspForm.cs | 81 + .../asp/BuiltInObjects/AspFormValue.cs | 47 + .../BuiltInObjects/AspNameValueCollection.cs | 86 + .../asp/BuiltInObjects/AspObjectContext.cs | 18 + .../asp/BuiltInObjects/AspReadCookie.cs | 74 + .../asp/BuiltInObjects/AspRequest.cs | 82 + .../asp/BuiltInObjects/AspResponse.cs | 169 + .../asp/BuiltInObjects/AspServer.cs | 89 + .../asp/BuiltInObjects/AspSession.cs | 70 + .../AspStaticObjectsVariantDictionary.cs | 65 + .../asp/BuiltInObjects/AspStringList.cs | 43 + .../BuiltInObjects/AspVariantDictionary.cs | 78 + .../asp/BuiltInObjects/AspWriteCookie.cs | 60 + aspclassiccompiler/asp/CompiledPage.cs | 43 + aspclassiccompiler/asp/Mvc/AspView.cs | 128 + aspclassiccompiler/asp/Mvc/AspViewEngine.cs | 38 + .../asp/Mvc/RouteValueExtensions.cs | 27 + .../asp/Properties/AssemblyInfo.cs | 36 + .../library/35/Microsoft.Dynamic.dll | Bin 0 -> 956248 bytes .../library/35/Microsoft.Scripting.Core.dll | Bin 0 -> 403288 bytes .../35/Microsoft.Scripting.Debugging.dll | Bin 0 -> 58200 bytes ...Microsoft.Scripting.ExtensionAttribute.dll | Bin 0 -> 11096 bytes .../library/35/Microsoft.Scripting.dll | Bin 0 -> 178008 bytes .../library/40/Microsoft.Dynamic.dll | Bin 0 -> 952152 bytes .../40/Microsoft.Scripting.Debugging.dll | Bin 0 -> 58712 bytes .../library/40/Microsoft.Scripting.dll | Bin 0 -> 166744 bytes 319 files changed, 34393 insertions(+), 8178 deletions(-) create mode 100644 .hgignore create mode 100644 aspclassiccompiler/ASPClassicCompiler.sln create mode 100644 aspclassiccompiler/ASPClassicCompiler.vs2010.sln delete mode 100644 aspclassiccompiler/AspWebApp/bin/AspWebApp.dll delete mode 100644 aspclassiccompiler/AspWebApp/bin/AspWebApp.pdb create mode 100644 aspclassiccompiler/Credits.txt create mode 100644 aspclassiccompiler/License.txt delete mode 100644 aspclassiccompiler/NerdDinnerAsp/bin/NerdDinner.dll delete mode 100644 aspclassiccompiler/NerdDinnerAsp/bin/NerdDinner.pdb delete mode 100644 aspclassiccompiler/NerdDinnerAsp/bin/System.Web.Mvc.dll delete mode 100644 aspclassiccompiler/NerdDinnerAsp/bin/System.Web.Mvc.xml create mode 100644 aspclassiccompiler/Parser/AssemblyInfo.vb create mode 100644 aspclassiccompiler/Parser/ExternalChecksum.vb create mode 100644 aspclassiccompiler/Parser/ExternalLineMapping.vb create mode 100644 aspclassiccompiler/Parser/IntegerBase.vb create mode 100644 aspclassiccompiler/Parser/LanguageVersion.vb create mode 100644 aspclassiccompiler/Parser/License.txt create mode 100644 aspclassiccompiler/Parser/Location.vb create mode 100644 aspclassiccompiler/Parser/My Project/Application.Designer.vb create mode 100644 aspclassiccompiler/Parser/My Project/Application.myapp create mode 100644 aspclassiccompiler/Parser/Parser.VS2010.vbproj create mode 100644 aspclassiccompiler/Parser/Parser.vb create mode 100644 aspclassiccompiler/Parser/Parser.vbproj create mode 100644 aspclassiccompiler/Parser/SLVBParser.vbproj create mode 100644 aspclassiccompiler/Parser/Scanner.vb create mode 100644 aspclassiccompiler/Parser/Serializers/ErrorXmlSerializer.vb create mode 100644 aspclassiccompiler/Parser/Serializers/TokenXmlSerializer.vb create mode 100644 aspclassiccompiler/Parser/Serializers/TreeXmlSerializer.vb create mode 100644 aspclassiccompiler/Parser/SourceRegion.vb create mode 100644 aspclassiccompiler/Parser/Span.vb create mode 100644 aspclassiccompiler/Parser/SyntaxError.vb create mode 100644 aspclassiccompiler/Parser/SyntaxErrorType.vb create mode 100644 aspclassiccompiler/Parser/Tokens/CharacterLiteralToken.vb create mode 100644 aspclassiccompiler/Parser/Tokens/CommentToken.vb create mode 100644 aspclassiccompiler/Parser/Tokens/DateLiteralToken.vb create mode 100644 aspclassiccompiler/Parser/Tokens/DecimalLiteralToken.vb create mode 100644 aspclassiccompiler/Parser/Tokens/EndOfStreamToken.vb create mode 100644 aspclassiccompiler/Parser/Tokens/ErrorToken.vb create mode 100644 aspclassiccompiler/Parser/Tokens/FloatingPointLiteralToken.vb create mode 100644 aspclassiccompiler/Parser/Tokens/IdentifierToken.vb create mode 100644 aspclassiccompiler/Parser/Tokens/IntegerLiteralToken.vb create mode 100644 aspclassiccompiler/Parser/Tokens/LineTerminatorToken.vb create mode 100644 aspclassiccompiler/Parser/Tokens/PunctuatorToken.vb create mode 100644 aspclassiccompiler/Parser/Tokens/StringLiteralToken.vb create mode 100644 aspclassiccompiler/Parser/Tokens/Token.vb create mode 100644 aspclassiccompiler/Parser/Tokens/TokenType.vb create mode 100644 aspclassiccompiler/Parser/Tokens/UnsignedIntegerLiteralToken.vb create mode 100644 aspclassiccompiler/Parser/Trees/Arguments/Argument.vb create mode 100644 aspclassiccompiler/Parser/Trees/Arguments/ArgumentCollection.vb create mode 100644 aspclassiccompiler/Parser/Trees/Attributes/Attribute.vb create mode 100644 aspclassiccompiler/Parser/Trees/Attributes/AttributeBlockCollection.vb create mode 100644 aspclassiccompiler/Parser/Trees/Attributes/AttributeCollection.vb create mode 100644 aspclassiccompiler/Parser/Trees/Attributes/AttributeTypes.vb create mode 100644 aspclassiccompiler/Parser/Trees/BlockType.vb create mode 100644 aspclassiccompiler/Parser/Trees/CaseClauses/CaseClause.vb create mode 100644 aspclassiccompiler/Parser/Trees/CaseClauses/CaseClauseCollection.vb create mode 100644 aspclassiccompiler/Parser/Trees/CaseClauses/ComparisonCaseClause.vb create mode 100644 aspclassiccompiler/Parser/Trees/CaseClauses/RangeCaseClause.vb create mode 100644 aspclassiccompiler/Parser/Trees/Collections/ColonDelimitedTreeCollection.vb create mode 100644 aspclassiccompiler/Parser/Trees/Collections/CommaDelimitedTreeCollection.vb create mode 100644 aspclassiccompiler/Parser/Trees/Collections/TreeCollection.vb create mode 100644 aspclassiccompiler/Parser/Trees/Comments/Comment.vb create mode 100644 aspclassiccompiler/Parser/Trees/Declarations/AttributeDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Declarations/BlockDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Declarations/Declaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Declarations/DeclarationCollection.vb create mode 100644 aspclassiccompiler/Parser/Trees/Declarations/EmptyDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Declarations/EndBlockDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Declarations/ModifiedDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/AddressOfExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/BinaryOperatorExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/BooleanLiteralExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/CTypeExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/CallOrIndexExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/CastTypeExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/CharacterLiteralExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/DateLiteralExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/DecimalLiteralExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/DictionaryLookupExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/DirectCastExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/Expression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/ExpressionCollection.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/FloatingPointLiteralExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/GenericQualifiedExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/GetTypeExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/GlobalExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/InstanceExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/InstanceType.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/IntegerLiteralExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/IntrinsicCastExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/LiteralExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/NewAggregateExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/NewExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/NothingExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/OperatorType.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/ParentheticalExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/QualifiedExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/SimpleNameExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/StringLiteralExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/TryCastExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/TypeOfExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/TypeReferenceExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/UnaryExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Expressions/UnaryOperatorExpression.vb create mode 100644 aspclassiccompiler/Parser/Trees/Files/File.vb create mode 100644 aspclassiccompiler/Parser/Trees/Files/ImportsDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Files/NamespaceDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Files/OptionDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Files/OptionType.vb create mode 100644 aspclassiccompiler/Parser/Trees/Files/ScriptBlock.vb create mode 100644 aspclassiccompiler/Parser/Trees/Imports/AliasImport.vb create mode 100644 aspclassiccompiler/Parser/Trees/Imports/Import.vb create mode 100644 aspclassiccompiler/Parser/Trees/Imports/ImportCollection.vb create mode 100644 aspclassiccompiler/Parser/Trees/Imports/NameImport.vb create mode 100644 aspclassiccompiler/Parser/Trees/Initializers/AggregateInitializer.vb create mode 100644 aspclassiccompiler/Parser/Trees/Initializers/ExpressionInitializer.vb create mode 100644 aspclassiccompiler/Parser/Trees/Initializers/Initializer.vb create mode 100644 aspclassiccompiler/Parser/Trees/Initializers/InitializerCollection.vb create mode 100644 aspclassiccompiler/Parser/Trees/IntrinsicType.vb create mode 100644 aspclassiccompiler/Parser/Trees/Members/AddHandlerAccessorDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Members/Charset.vb create mode 100644 aspclassiccompiler/Parser/Trees/Members/ConstructorDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Members/CustomEventDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Members/EnumValueDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Members/EventDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Members/ExternalDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Members/ExternalFunctionDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Members/ExternalSubDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Members/FunctionDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Members/GetAccessorDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Members/MethodDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Members/OperatorDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Members/PropertyDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Members/RaiseEventAccessorDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Members/RemoveHandlerAccessorDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Members/SetAccessorDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Members/SignatureDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Members/SubDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Members/VariableListDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Modifiers/Modifier.vb create mode 100644 aspclassiccompiler/Parser/Trees/Modifiers/ModifierCollection.vb create mode 100644 aspclassiccompiler/Parser/Trees/Modifiers/ModifierTypes.vb create mode 100644 aspclassiccompiler/Parser/Trees/Names/GlobalNamespaceName.vb create mode 100644 aspclassiccompiler/Parser/Trees/Names/Name.vb create mode 100644 aspclassiccompiler/Parser/Trees/Names/NameCollection.vb create mode 100644 aspclassiccompiler/Parser/Trees/Names/QualifiedName.vb create mode 100644 aspclassiccompiler/Parser/Trees/Names/SimpleName.vb create mode 100644 aspclassiccompiler/Parser/Trees/Names/SpecialName.vb create mode 100644 aspclassiccompiler/Parser/Trees/Names/SpecialNameTypes.vb create mode 100644 aspclassiccompiler/Parser/Trees/Names/VariableName.vb create mode 100644 aspclassiccompiler/Parser/Trees/Names/VariableNameCollection.vb create mode 100644 aspclassiccompiler/Parser/Trees/Parameters/Parameter.vb create mode 100644 aspclassiccompiler/Parser/Trees/Parameters/ParameterCollection.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/AddHandlerStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/AssignmentStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/BlockStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/CallStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/CaseBlockStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/CaseElseBlockStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/CaseElseStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/CaseStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/CatchBlockStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/CatchStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/CompoundAssignmentStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/ContinueStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/DoBlockStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/ElseBlockStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/ElseIfBlockStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/ElseIfStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/ElseStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/EmptyStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/EndBlockStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/EndStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/EraseStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/ErrorStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/ExitStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/ExpressionBlockStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/ExpressionStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/FinallyBlockStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/FinallyStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/ForBlockStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/ForEachBlockStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/GotoStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/HandlerStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/IfBlockStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/LabelReferenceStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/LabelStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/LineIfStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/LocalDeclarationStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/LoopStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/MidAssignmentStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/NextStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/OnErrorStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/OnErrorType.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/RaiseEventStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/ReDimStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/RemoveHandlerStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/ResumeStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/ResumeType.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/ReturnStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/SelectBlockStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/Statement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/StatementCollection.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/StopStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/SyncLockBlockStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/ThrowStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/TryBlockStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/UsingBlockStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/WhileStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Statements/WithStatement.vb create mode 100644 aspclassiccompiler/Parser/Trees/Tree.vb create mode 100644 aspclassiccompiler/Parser/Trees/TreeType.vb create mode 100644 aspclassiccompiler/Parser/Trees/TypeNames/ArrayTypeName.vb create mode 100644 aspclassiccompiler/Parser/Trees/TypeNames/ConstructedTypeName.vb create mode 100644 aspclassiccompiler/Parser/Trees/TypeNames/IntrinsicTypeName.vb create mode 100644 aspclassiccompiler/Parser/Trees/TypeNames/NamedTypeName.vb create mode 100644 aspclassiccompiler/Parser/Trees/TypeNames/TypeArgumentCollection.vb create mode 100644 aspclassiccompiler/Parser/Trees/TypeNames/TypeName.vb create mode 100644 aspclassiccompiler/Parser/Trees/TypeNames/TypeNameCollection.vb create mode 100644 aspclassiccompiler/Parser/Trees/TypeParameters/TypeConstraintCollection.vb create mode 100644 aspclassiccompiler/Parser/Trees/TypeParameters/TypeParameter.vb create mode 100644 aspclassiccompiler/Parser/Trees/TypeParameters/TypeParameterCollection.vb create mode 100644 aspclassiccompiler/Parser/Trees/Types/ClassDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Types/DelegateDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Types/DelegateFunctionDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Types/DelegateSubDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Types/EnumDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Types/GenericBlockDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Types/ImplementsDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Types/InheritsDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Types/InterfaceDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Types/ModuleDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/Types/StructureDeclaration.vb create mode 100644 aspclassiccompiler/Parser/Trees/VariableDeclarators/VariableDeclarator.vb create mode 100644 aspclassiccompiler/Parser/Trees/VariableDeclarators/VariableDeclaratorCollection.vb create mode 100644 aspclassiccompiler/Parser/TypeCharacter.vb create mode 100644 aspclassiccompiler/VBScript/Binders/VBScriptBinaryOperationBinder.cs create mode 100644 aspclassiccompiler/VBScript/Binders/VBScriptCreateInstanceBinder.cs create mode 100644 aspclassiccompiler/VBScript/Binders/VBScriptGetIndexBinder.cs create mode 100644 aspclassiccompiler/VBScript/Binders/VBScriptGetMemberBinder.cs create mode 100644 aspclassiccompiler/VBScript/Binders/VBScriptInvokeBinder.cs create mode 100644 aspclassiccompiler/VBScript/Binders/VBScriptInvokeMemberBinder.cs create mode 100644 aspclassiccompiler/VBScript/Binders/VBScriptSetIndexBinder.cs create mode 100644 aspclassiccompiler/VBScript/Binders/VBScriptSetMemberBinder.cs create mode 100644 aspclassiccompiler/VBScript/Binders/VBScriptUnaryOperationBinder.cs create mode 100644 aspclassiccompiler/VBScript/Binders/VBScriptUnaryOperationBinder.cs.bak create mode 100644 aspclassiccompiler/VBScript/Compiler/AnalysisScope.cs create mode 100644 aspclassiccompiler/VBScript/Compiler/DocSpan.cs create mode 100644 aspclassiccompiler/VBScript/Compiler/ISourceMapper.cs create mode 100644 aspclassiccompiler/VBScript/Compiler/Set.cs create mode 100644 aspclassiccompiler/VBScript/Compiler/SourceUtil.cs create mode 100644 aspclassiccompiler/VBScript/Compiler/VBScriptAnalyzer.cs create mode 100644 aspclassiccompiler/VBScript/Compiler/VBScriptCompilerException.cs create mode 100644 aspclassiccompiler/VBScript/Compiler/VBScriptGenerator.cs create mode 100644 aspclassiccompiler/VBScript/Compiler/VBScriptSourceCodeReader.cs create mode 100644 aspclassiccompiler/VBScript/Compiler/VBScriptSourceMapper.cs create mode 100644 aspclassiccompiler/VBScript/Compiler/VBScriptStringContentProvider.cs create mode 100644 aspclassiccompiler/VBScript/Compiler/VBScriptSyntaxError.cs create mode 100644 aspclassiccompiler/VBScript/Properties/AssemblyInfo.cs create mode 100644 aspclassiccompiler/VBScript/Runtime/BuiltInConstants.cs create mode 100644 aspclassiccompiler/VBScript/Runtime/BuiltInFunctions.cs create mode 100644 aspclassiccompiler/VBScript/Runtime/DynamicObjectHelpers.cs create mode 100644 aspclassiccompiler/VBScript/Runtime/ErrObject.cs create mode 100644 aspclassiccompiler/VBScript/Runtime/HelperFunctions.cs create mode 100644 aspclassiccompiler/VBScript/Runtime/ITrace.cs create mode 100644 aspclassiccompiler/VBScript/Runtime/InvokeMemberBinderKey.cs create mode 100644 aspclassiccompiler/VBScript/Runtime/RuntimeHelpers.cs create mode 100644 aspclassiccompiler/VBScript/Runtime/StringExtensionsClass.cs create mode 100644 aspclassiccompiler/VBScript/Runtime/TraceHelper.cs create mode 100644 aspclassiccompiler/VBScript/Runtime/TypeModel.cs create mode 100644 aspclassiccompiler/VBScript/Runtime/TypeModelMetaObject.cs create mode 100644 aspclassiccompiler/VBScript/Runtime/VBScriptDlrScope.cs create mode 100644 aspclassiccompiler/VBScript/Runtime/VBScriptRuntimeException.cs create mode 100644 aspclassiccompiler/VBScript/Runtime/VBScriptTraceCallbackListener.cs create mode 100644 aspclassiccompiler/VBScript/SLVBScript.csproj create mode 100644 aspclassiccompiler/VBScript/VBScript.VS2010.csproj create mode 100644 aspclassiccompiler/VBScript/VBScript.cs create mode 100644 aspclassiccompiler/VBScript/VBScript.csproj create mode 100644 aspclassiccompiler/VBScript/hosting/VBScriptCode.cs create mode 100644 aspclassiccompiler/VBScript/hosting/VBScriptContext.cs create mode 100644 aspclassiccompiler/VBScriptSilverlight.sln create mode 100644 aspclassiccompiler/asp/Asp.VS2010.csproj create mode 100644 aspclassiccompiler/asp/Asp.csproj create mode 100644 aspclassiccompiler/asp/AspHandler.cs create mode 100644 aspclassiccompiler/asp/AspHandlerConfiguration.cs create mode 100644 aspclassiccompiler/asp/AspHelper.cs create mode 100644 aspclassiccompiler/asp/AspHost.cs create mode 100644 aspclassiccompiler/asp/AspHostConfiguration.cs create mode 100644 aspclassiccompiler/asp/AspPageDom.cs create mode 100644 aspclassiccompiler/asp/BuiltInObjects/AspApplication.cs create mode 100644 aspclassiccompiler/asp/BuiltInObjects/AspCookie.cs create mode 100644 aspclassiccompiler/asp/BuiltInObjects/AspCookieCollection.cs create mode 100644 aspclassiccompiler/asp/BuiltInObjects/AspError.cs create mode 100644 aspclassiccompiler/asp/BuiltInObjects/AspForm.cs create mode 100644 aspclassiccompiler/asp/BuiltInObjects/AspFormValue.cs create mode 100644 aspclassiccompiler/asp/BuiltInObjects/AspNameValueCollection.cs create mode 100644 aspclassiccompiler/asp/BuiltInObjects/AspObjectContext.cs create mode 100644 aspclassiccompiler/asp/BuiltInObjects/AspReadCookie.cs create mode 100644 aspclassiccompiler/asp/BuiltInObjects/AspRequest.cs create mode 100644 aspclassiccompiler/asp/BuiltInObjects/AspResponse.cs create mode 100644 aspclassiccompiler/asp/BuiltInObjects/AspServer.cs create mode 100644 aspclassiccompiler/asp/BuiltInObjects/AspSession.cs create mode 100644 aspclassiccompiler/asp/BuiltInObjects/AspStaticObjectsVariantDictionary.cs create mode 100644 aspclassiccompiler/asp/BuiltInObjects/AspStringList.cs create mode 100644 aspclassiccompiler/asp/BuiltInObjects/AspVariantDictionary.cs create mode 100644 aspclassiccompiler/asp/BuiltInObjects/AspWriteCookie.cs create mode 100644 aspclassiccompiler/asp/CompiledPage.cs create mode 100644 aspclassiccompiler/asp/Mvc/AspView.cs create mode 100644 aspclassiccompiler/asp/Mvc/AspViewEngine.cs create mode 100644 aspclassiccompiler/asp/Mvc/RouteValueExtensions.cs create mode 100644 aspclassiccompiler/asp/Properties/AssemblyInfo.cs create mode 100644 aspclassiccompiler/library/35/Microsoft.Dynamic.dll create mode 100644 aspclassiccompiler/library/35/Microsoft.Scripting.Core.dll create mode 100644 aspclassiccompiler/library/35/Microsoft.Scripting.Debugging.dll create mode 100644 aspclassiccompiler/library/35/Microsoft.Scripting.ExtensionAttribute.dll create mode 100644 aspclassiccompiler/library/35/Microsoft.Scripting.dll create mode 100644 aspclassiccompiler/library/40/Microsoft.Dynamic.dll create mode 100644 aspclassiccompiler/library/40/Microsoft.Scripting.Debugging.dll create mode 100644 aspclassiccompiler/library/40/Microsoft.Scripting.dll diff --git a/.hgignore b/.hgignore new file mode 100644 index 0000000..26720bf --- /dev/null +++ b/.hgignore @@ -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 diff --git a/aspclassiccompiler/ASPClassicCompiler.sln b/aspclassiccompiler/ASPClassicCompiler.sln new file mode 100644 index 0000000..1ef74bc --- /dev/null +++ b/aspclassiccompiler/ASPClassicCompiler.sln @@ -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 diff --git a/aspclassiccompiler/ASPClassicCompiler.vs2010.sln b/aspclassiccompiler/ASPClassicCompiler.vs2010.sln new file mode 100644 index 0000000..f4eea4e --- /dev/null +++ b/aspclassiccompiler/ASPClassicCompiler.vs2010.sln @@ -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 diff --git a/aspclassiccompiler/AspWebApp/bin/AspWebApp.dll b/aspclassiccompiler/AspWebApp/bin/AspWebApp.dll deleted file mode 100644 index 83e387b91abf7ff72824ed0abd4440bcfe0a06b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmeHKO>7%Q6n>Mxray68QL3gz?S`a?3bJxy=f@C%<2X%I(j>&L+agQtu03(KUGJ`D z*CC;Rf>e-@IB@Hg3x~o1kPwtgaDXH9#sN6>z!3=vajFpIn_2%RX%9$973z!Un>TOf zy?O7=&QH#~@;3V zU^tE&XeQT0#nCKBOD|-!vRmYOPtUG_s_DgPqB+)1Gxw?=Z21;M)5{k4HL205SQL3q_*nKjuAn98hb<&~+8=XW<3jYPAGN)6lsx5t49oD1z zNOWv?Od9JX8@K`E{cjTehI#;g_GbcNIVE3?*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!uOR4l708++7hJ|z>Lg1L@2C_jh%L&B5 f`htN2h(TtIf}t4#JVVpjqpltefzc44LI?l=GRj&e diff --git a/aspclassiccompiler/Credits.txt b/aspclassiccompiler/Credits.txt new file mode 100644 index 0000000..fbcb5d7 --- /dev/null +++ b/aspclassiccompiler/Credits.txt @@ -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 + diff --git a/aspclassiccompiler/License.txt b/aspclassiccompiler/License.txt new file mode 100644 index 0000000..4e1edda --- /dev/null +++ b/aspclassiccompiler/License.txt @@ -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. \ No newline at end of file diff --git a/aspclassiccompiler/NerdDinnerAsp/bin/NerdDinner.dll b/aspclassiccompiler/NerdDinnerAsp/bin/NerdDinner.dll deleted file mode 100644 index 3c9ffc23cc56ed9c4a20ae13f98074b174a48645..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36352 zcmeHw3wT@AmF_x6Ps@^G$?sR9kdP>jZ5)TZAb~h>NK6vj#7-a~;K-Jeh}b%gBquRR zz~+&bmNyJcDQyFVX=$eqTA;x2EEGzo+@_feEz^E9w6s&`yWBqLv~d5m_Bqm#?NDa! zop0{f?<&zcdp-8rd#}Cr+K+RNym8x&`4DrICN{fS6=Bo#@fBJEv0ks%|VXbuE?vrX0AYlt>z z4qATo>*rdfogjT?vF0T@0*YHvQ}^N;!S^YAxpom;bX9Mpr2c#*(uB?_2d%uCs6_tf zuO`X@_(Y(0Jtv+bin1XleoheiK|6X6QQbt|d*Klxv>^BK0$-QIh?=vB16kl%)KJ>O zZAE+Rp9s;8=5!`K0HW0GDI~a~K8UaFvl0erPA3Kp2y$KN1iq~6T6}Gvl|-v-s3g1D zuJ~}>baK(JR}g)1r&v+w|4}eqKUhlSYdA%B9F_zKWfnmaAe37KNq|sc5hUSgancU6 zU_Dw1p6-lR@x>Lb=8GeW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C0J2O-r@bPODGW)FoTjH8$5??k(0gG$vEi z*5~VxHm_^34v9{puFl=OBtKR4$ws~=n5t^A{k}%_`&2}ZMR#J{*j$%vOjTvrWc5wm zj0mAYmZWEVvtE^ePigt=j3g)L2U& zZ9uB7+@ub#r~8vCc{2W)Rk$TGsmDJc9!;H|B)nAI?*NWyQjlaxn6GbKhwQfLp;wfhzC= z;Dca0xDosv_!!Bt=j(ER+pU@N!=ybox7s~ubmt^?PDZQurQDmV@FneLUq W#|U;?_k#9?>MMc15_prB!2buqw?@JM diff --git a/aspclassiccompiler/NerdDinnerAsp/bin/System.Web.Mvc.dll b/aspclassiccompiler/NerdDinnerAsp/bin/System.Web.Mvc.dll deleted file mode 100644 index fb8836398efb4393066fe5b2097c3e58c2f25ceb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 186176 zcmcG%37niowfFzb)7?*ZKeHsAne=1|9>D|Ri~;>ojP^u z)T#A3@tju%xgZGg{CoWIAov)r{tmU@|M_PV(PPU#F&2EN{Ph(d8#>|ZD^7prrS0X< zX}L>U7hJyl=@(pag}ZY3g%>SvZMb6jrB^IJ^5iEizuZ0JqSd3L@vbTAQ;rIP6NYlZ z{+r%$Y*yOCLAYXgs1yVr34;Jfe+PdT|8hJJ;|6~?-~4z*xBfCWSWaz#Ke8f6y$-!5 z2;Lu4$Uy3Xbd6(9~(?~Xb>E_x^>aB9SKFNXf|A* z*&*HG7Tx!=TzutEw1q(-czrk&eE;5|plnbGcq9n+SrG)MEDwTBDeQl8_C4UX0W*6E`c=Z}2%haSD>#PdGz{#zdS z+N}$pbMUM8ynojlzHw{$w%0s%^N~+|^$8p9dEV*wUVi8ge(~EUZJk|l=~FuIz3cw{ zesa^)`agd0_3u1$_nkg?)y7X0-+J^N-(B{mKfCg|mCe5md zElT0jSw;n^Rnj0%F2qE&4^nF|Mqb?~7P%PZ^ z0P_H#BYA*%GO>EBCm6T&(C6H);FaJ>tPr&*L73!E0#WVB38@aXQ$WYW~!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IQPA@!M4Y3x4raE@2{>- zx$25@e>w5s7jM^%cy-IBzJu?d`_Og0&hDT*D?aGaxkuvDr+oC6qh7tD=&0XLnN~Qj z-Ry18`97N+zir5t^xJaI`0LMo-d&Ov^HgxnaZ|t8{I@F;+V#0f&B~bAbkEo&r=7BQ z^80&+-f~*pJYTP+M~;hq_!rwLMF&s6v*z zyr*7V_2m7XzI$7%jX^ zaGI{!_0zna!pKJX;zJRq4NMl|zi3}OnDd3O+~KUu9gsiZlvYf3*OK|&axPlEb#=ep z{g!`l&**~R`@P#j&yz*`r? - - - System.Web.Mvc - - - - - Represents a set of data that persists only from one request to the next. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The info. - The context. - - - - Loads the specified controller context. - - The controller context. - The temp data provider. - - - - Saves the specified controller context. - - The controller context. - The temp data provider. - - - - Adds an element with the provided key and value to the . - - The object to use as the key of the element to add. - The object to use as the value of the element to add. - - is null. - - - An element with the same key already exists in the . - - - The is read-only. - - - - - Removes all items from the . - - - The is read-only. - - - - - Determines whether the contains an element with the specified key. - - The key to locate in the . - - true if the contains an element with the key; otherwise, false. - - - is null. - - - - - Determines whether the specified value contains value. - - The value. - - true if the specified value contains value; otherwise, false. - - - - - Gets the enumerator. - - The enumerator. - - - - Populates a with the data needed to serialize the target object. - - The to populate with data. - The destination (see ) for this serialization. - - The caller does not have the required permission. - - - - - Removes the element with the specified key from the . - - The key of the element to remove. - - true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the original . - - - is null. - - - The is read-only. - - - - - Gets the value associated with the specified key. - - The key whose value to get. - When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the parameter. This parameter is passed uninitialized. - - true if the object that implements contains an element with the specified key; otherwise, false. - - - is null. - - - - - Returns an enumerator that iterates through the collection. - - - A that can be used to iterate through the collection. - - - - - Copies to the given array at the specified index location. - - The array. - The index. - - - - Adds the specified key value pair. - - The key value pair. - - - - Determines whether [contains] [the specified key value pair]. - - The key value pair. - - true if [contains] [the specified key value pair]; otherwise, false. - - - - - Removes the specified key value pair. - - The key value pair. - - - - - Returns an enumerator that iterates through a collection. - - - An object that can be used to iterate through the collection. - - - - - Populates a with the data needed to serialize the target object. - - The to populate with data. - The destination (see ) for this serialization. - - The caller does not have the required permission. - - - - - Gets the number of elements contained in the . - - - - The number of elements contained in the . - - - - - Gets an containing the keys of the . - - - - An containing the keys of the object that implements . - - - - - Gets an containing the values in the . - - - - An containing the values in the object that implements . - - - - - Gets or sets the with the specified key. - - - - - - Gets an containing the keys of the . - - - - An containing the keys of the object that implements . - - - - - Gets an containing the values in the . - - - - An containing the values in the object that implements . - - - - - Gets a value indicating whether the is read-only. - - - true if the is read-only; otherwise, false. - - - - - Defines the methods required for a controller. - - - - - Executes the specified request context. - - The request context. - - - - Represents support for rendering HTML in AJAX scenarios within a view. - - - - - Initializes a new instance of the class. - - The view context. - The view data container. - - - - Initializes a new instance of the class. - - The view context. - The view data container. - The route collection. - - - - Gets the collection of routes. - - The route collection. - - - - Gets the current . - - The view context. - - - - Gets the current . - - The view data. - - - - Gets the current . - - The view data container. - - - - Binds a model to a posted file. - - - - - Defines the methods required for a model binder. - - - - - Binds the model to a value. - - The controller context. - The binding context. - The bounded value. - - - - Binds the model. - - The controller context. - The binding context. - The bound value. - - - - Attribute that represents the name of an action method. - - - - - Attribute that affects the selection of an action method. - - - - - Determines whether the action name is valid within specified controller context. - - The controller context. - The name of the action. - The method info. - - true if the action name is valid within specified controller context; otherwise, false. - - - - - Initializes a new instance of the class. - - The name. - - - - Determines whether the action name is valid within specified controller context. - - The controller context. - The name of the action. - The method info. - - true if the action name is valid within specified controller context; otherwise, false. - - - - - Gets the name of the action. - - The name. - - - - Attribute used to provide details on how model binding to a parameter should occur. - - - - - Determines whether [is property allowed] [the specified property name]. - - Name of the property. - - true if [is property allowed] [the specified property name]; otherwise, false. - - - - - A comma delimited block list of property names for which binding is not allowed. - - The exclude list. - - - - A comma delimited allow list of property names for which binding is allowed. - - The include list. - - - - Gets or sets the prefix to use when binding to an action argument or model property. - - The prefix. - - - - Class used to send JavaScript content to the response. - - - - - Encapsulates the result of an action method and is used to perform a - framework-level operation on the action method's behalf. - - - - - Enables processing of the result of an action method by a custom type that inherits from . - - The context within which the result is executed. - - - - Enables processing of the result of an action method by a custom type that inherits from . - - The context within which the result is executed. - - - - Gets or sets the script. - - The script. - - - - Provides the context for the ActionExecuting method of an . - - - - - Encapsulates information about an HTTP request that matches a defined Route and Controller. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The controller context. - - - - Initializes a new instance of the class. - - The HTTP context. - The route data. - The controller. - - - - Initializes a new instance of the class. - - The request context. - The controller. - - - - Gets or sets the controller. - - The controller. - - - - Gets or sets the HTTP context. - - The HTTP context. - - - - Gets or sets the request context. - - The request context. - - - - Gets or sets the route data. - - The route data. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The controller context. - The action descriptor. - The action parameters. - - - - Gets or sets the action descriptor. - - The action descriptor. - - - - Gets or sets the action parameters. - - The action parameters. - - - - Gets or sets the result. - - The result. - - - - Base class used to supply the model to the view and then render the view to the response. - - - - - When called by the action invoker, renders the view to the response. - - The context within which the result is executed. - - - - When overridden, returns the used to render the view. - - The context. - The view engine. - - - - Gets or sets the for this result. - - The temp data. - - - - Gets or sets the that is rendered to the response. - - The view. - - - - Gets or sets the view data for this result. - - The view data. - - - - Gets or sets the view engines () associated with this result. - - The view engine collection. - - - - Gets or sets the name of the view to be rendered. - - The name of the view. - - - - Represents the information needed to build a strongly typed view page. - - The type of the model. - - - - Represents the information needed to build a view page. - - - - - Defines the methods required for a view data dictionary. - - - - - Gets or sets the view data. - - The view data. - - - - Instantiates and initializes the Ajax, Html, and Url properties. - - - - - Raises the event at the beginning of page initialization. - - An that contains the event data. - - - - Initializes the object and calls on the child controls of the to render. - - The that receives the page content. - - - - Renders the view page to the response. - - The view context. - - - - Sets the view data. - - The view data. - - - - Returns an containing methods useful for AJAX scenarios. - - The ajax. - - - - Returns an containing methods useful for rendering HTML elements. - - The HTML. - - - - Gets or sets the master location. - - The master location. - - - - Convenience property used to access the Model property of the - - The model. - - - - Gets the temp data. - - The temp data. - - - - Gets or sets the URL. - - The URL. - - - - Gets or sets the view context. - - The view context. - - - - Gets or sets the view data. - - The view data. - - - - Gets the writer. - - The writer. - - - - Instantiates and initializes the Ajax, Html, and Url properties. - - - - - Sets the view data. - - The view data. - - - - Returns an containing methods useful for AJAX scenarios. - - The ajax. - - - - Returns an containing methods useful for rendering HTML elements. - - The HTML. - - - - Convenience property used to access the Model property of the - - The model. - - - - Gets or sets the view data. - - The view data. - - - - Creates an object that implement the IHttpHandler interface and gives it the request context. - - - - - Gets the HTTP handler. - - The request context. - The HTTP handler. - - - - Gets the HTTP handler. - - The request context. - The HTTP handler. - - - - Defines the methods required for a view engine. - - - - - Finds the partial view. - - The controller context. - Partial name of the view. - if set to true [use cache]. - The partial view. - - - - Finds the view. - - The controller context. - Name of the view. - Name of the master. - if set to true [use cache]. - The page view. - - - - Releases the view. - - The controller context. - The view. - - - - Represents a list of items that allows more than one item to be selected. - - - - - Initializes a new instance of the class. - - The items. - - - - Initializes a new instance of the class. - - The items. - The selected values. - - - - Initializes a new instance of the class. - - The items. - The data value field. - The data text field. - - - - Initializes a new instance of the class. - - The items. - The data value field. - The data text field. - The selected values. - - - - Returns an enumerator that iterates through the collection. - - - A that can be used to iterate through the collection. - - - - - Returns an enumerator that iterates through a collection. - - - An object that can be used to iterate through the collection. - - - - - Gets the data text field. - - The data text field. - - - - Gets the data value field. - - The data value field. - - - - Gets the items. - - The items. - - - - Gets the selected values. - - The selected values. - - - - Represents support for HTML in an application. - - - - - Writes an opening form tag to the response while returning a - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. - - The HTML helper. - - An instance. - - - - - Writes an opening form tag to the response while returning a - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. - - The HTML helper. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - - An instance. - - - - - Writes an opening form tag to the response while returning a - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. - - The HTML helper. - An object containing the parameters for a route. - - An instance. - - - - - Writes an opening form tag to the response while returning a - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. - - The HTML helper. - The name of the action. - The name of the controller. - - An instance. - - - - - Writes an opening form tag to the response while returning a - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. - - The HTML helper. - The name of the action. - The name of the controller. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - - An instance. - - - - - Writes an opening form tag to the response while returning a - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. - - The HTML helper. - The name of the action. - The name of the controller. - An object containing the parameters for a route. - - An instance. - - - - - Writes an opening form tag to the response while returning a - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. - - The HTML helper. - The name of the action. - The name of the controller. - The HTTP method for the form post, either Get or Post. - - An instance. - - - - - Writes an opening form tag to the response while returning a - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. - - The HTML helper. - The name of the action. - The name of the controller. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - The HTTP method for the form post, either Get or Post. - - An instance. - - - - - Writes an opening form tag to the response while returning a - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. - - The HTML helper. - The name of the action. - The name of the controller. - An object containing the parameters for a route. - The HTTP method for the form post, either Get or Post. - - An instance. - - - - - Writes an opening form tag to the response while returning a - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. - - The HTML helper. - The name of the action. - The name of the controller. - The HTTP method for the form post, either Get or Post. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - - An instance. - - - - - Writes an opening form tag to the response while returning a - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. - - The HTML helper. - The name of the action. - The name of the controller. - The HTTP method for the form post, either Get or Post. - An object containing the HTML attributes for the element. - - An instance. - - - - - Writes an opening form tag to the response while returning a - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. - - The HTML helper. - The name of the action. - The name of the controller. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - The HTTP method for the form post, either Get or Post. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - - An instance. - - - - - Writes an opening form tag to the response while returning a - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. - - The HTML helper. - The name of the action. - The name of the controller. - An object containing the parameters for a route. - The HTTP method for the form post, either Get or Post. - An object containing the HTML attributes for the element. - - An instance. - - - - - Writes an opening form tag to the response while returning a - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. - - The HTML helper. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - - An instance. - - - - - Writes an opening form tag to the response while returning a - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. - - The HTML helper. - An object containing the parameters for a route. - - An instance. - - - - - Writes an opening form tag to the response while returning a - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. - - The HTML helper. - The name of the route to use to obtain the form post URL. - - An instance. - - - - - Writes an opening form tag to the response while returning a - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. - - The HTML helper. - The name of the route to use to obtain the form post URL. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - - An instance. - - - - - Writes an opening form tag to the response while returning a - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. - - The HTML helper. - The name of the route to use to obtain the form post URL. - An object containing the parameters for a route. - - An instance. - - - - - Writes an opening form tag to the response while returning a - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. - - The HTML helper. - The name of the route to use to obtain the form post URL. - The HTTP method for the form post, either Get or Post. - - An instance. - - - - - Writes an opening form tag to the response while returning a - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. - - The HTML helper. - The name of the route to use to obtain the form post URL. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - The HTTP method for the form post, either Get or Post. - - An instance. - - - - - Writes an opening form tag to the response while returning a - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. - - The HTML helper. - The name of the route to use to obtain the form post URL. - An object containing the parameters for a route. - The HTTP method for the form post, either Get or Post. - - An instance. - - - - - Writes an opening form tag to the response while returning a - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. - - The HTML helper. - The name of the route to use to obtain the form post URL. - The HTTP method for the form post, either Get or Post. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - - An instance. - - - - - Writes an opening form tag to the response while returning a - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. - - The HTML helper. - The name of the route to use to obtain the form post URL. - The HTTP method for the form post, either Get or Post. - An object containing the HTML attributes for the element. - - An instance. - - - - - Writes an opening form tag to the response while returning a - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. - - The HTML helper. - The name of the route to use to obtain the form post URL. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - The HTTP method for the form post, either Get or Post. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - - An instance. - - - - - Writes an opening form tag to the response while returning a - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. - - The HTML helper. - The name of the route to use to obtain the form post URL. - An object containing the parameters for a route. - The HTTP method for the form post, either Get or Post. - An object containing the HTML attributes for the element. - - An instance. - - - - - Renders the closing form tag to the response. This provides an alternative way to end the form - to using a using block with and . - - The HTML helper. - - - - Represents support for rendering HTML controls in a strongly typed view. - - The type of the model. - - - - Represents support for rendering HTML controls in a view. - - - - - Name of a CSS input validation error. - - - - - Name of a CSS field validation error. - - - - - Name of the CSS validation error summary. - - - - - Initializes a new instance of the class. - - The view context. - The view data container. - - - - Initializes a new instance of the class. - - The view context. - The view data container. - The route collection. - - - - Returns the anti-forgery token. - - The anti-forgery token. - - - - Returns the anti-forgery token given the salt value. - - The salt. - The anti-forgery token. - - - - Returns the anti-forgery token given the salt value. - - The salt. - The cookie domain. - The cookie path. - The anti-forgery token. - - - - Encodes the specified attribute string. - - The value. - The encoded value. - - - - Encodes the specified attribute object. - - The value. - The encoded string. - - - - Encodes the specified value. - - The value. - The encoded string. - - - - Encodes the specified value. - - The value. - The encoded string. - - - - Evaluates the string. - - The key. - The evaluated string. - - - - Evaluates the boolean value. - - The key. - The evaluated boolean value. - - - - Generates the link. - - The request context. - The route collection. - The link text. - Name of the route. - The name of the action. - Name of the controller. - The route values. - The HTML attributes. - The link. - - - - Generates the link. - - The request context. - The route collection. - The link text. - Name of the route. - The name of the action. - Name of the controller. - The protocol. - Name of the host. - The fragment. - The route values. - The HTML attributes. - The link. - - - - Returns an anchor tag containing the virtual path for the specified route values. - - The request context. - The collection of routes. - The inner text of the anchor tag. - The name of the route used to return a virtual path. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. - - - - - Returns an anchor tag containing the URL for the specified route values. - - The request context. - The collection of routes. - The inner text of the anchor tag. - The name of the route used to return a virtual path. - The protocol for the URL such as "http" or "https". - The host name for the URL. - The URL fragment name (also known as anchor name). - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. - - - - - Gets the form method string. - - The method. - The form method string. - - - - Gets the input type string. - - Type of the input. - The input type string. - - - - Gets or sets the id attribute dot replacement. - - The id attribute dot replacement. - - - - Gets the route collection. - - The route collection. - - - - Gets the view context. - - The view context. - - - - Gets the view data. - - The view data. - - - - Gets the view data container. - - The view data container. - - - - Initializes a new instance of the class. - - The view context. - The view data container. - - - - Initializes a new instance of the class. - - The view context. - The view data container. - The route collection. - - - - Gets the view data. - - The view data. - - - - Responsible for selecting an action method to be executed. - - - - - Initializes a new instance of the class. - - Type of the controller. - - - - Finds the action method. - - The controller context. - The name of the action. - A reference to the action method information. - - - - Gets the type of the controller. - - The type of the controller. - - - - Gets the aliased methods. - - The aliased methods. - - - - Gets the non aliased methods. - - The non aliased methods. - - - - Collection of view engines available to the application. - - - - - Gets the engines. - - The engines. - - - - Defines the methods required for a controller factory. - - - - - Creates the controller. - - The request context. - Name of the controller. - The controller. - - - - Releases the controller. - - The controller. - - - - Container used for passing strongly typed data between a controller and a view. - - The type of the model. - - - - Container used for passing data between a controller and a view. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The model. - - - - Initializes a new instance of the class. - - The dictionary. - - - - Adds an item to the . - - The object to add to the . - - The is read-only. - - - - - Adds an element with the provided key and value to the . - - The object to use as the key of the element to add. - The object to use as the value of the element to add. - - is null. - - - An element with the same key already exists in the . - - - The is read-only. - - - - - Removes all items from the . - - - The is read-only. - - - - - Determines whether the contains a specific value. - - The object to locate in the . - - true if is found in the ; otherwise, false. - - - - - Determines whether the contains an element with the specified key. - - The key to locate in the . - - true if the contains an element with the key; otherwise, false. - - - is null. - - - - - Copies the elements of the to an , starting at a particular index. - - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in at which copying begins. - - is null. - - - is less than 0. - - - is multidimensional. - -or- - is equal to or greater than the length of . - -or- - The number of elements in the source is greater than the available space from to the end of the destination . - -or- - Type cannot be cast automatically to the type of the destination . - - - - - Evaluates the specified expression. - - The expression. - The evaluation. - - - - Evaluates the specified expression. - - The expression. - The format. - The evaluation. - - - - Returns an enumerator that iterates through the collection. - - - A that can be used to iterate through the collection. - - - - - Removes the first occurrence of a specific object from the . - - The object to remove from the . - - true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . - - - The is read-only. - - - - - Removes the element with the specified key from the . - - The key of the element to remove. - - true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the original . - - - is null. - - - The is read-only. - - - - - Sets the model. - - The value. - This method will execute before the derived type's instance constructor executes. Derived types must be aware of this and should plan accordingly. For example, the logic in SetModel() should be simple enough so as not to depend on the "this" pointer referencing a fully constructed object. - - - - Gets the value associated with the specified key. - - The key whose value to get. - When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the parameter. This parameter is passed uninitialized. - - true if the object that implements contains an element with the specified key; otherwise, false. - - - is null. - - - - - Returns an enumerator that iterates through a collection. - - - An object that can be used to iterate through the collection. - - - - - Gets the number of elements contained in the . - - - - The number of elements contained in the . - - - - - Gets a value indicating whether the is read-only. - - - true if the is read-only; otherwise, false. - - - - - Gets an containing the keys of the . - - - - An containing the keys of the object that implements . - - - - - Gets or sets the model. - - The model. - - - - Gets the state of the model. - - The state of the model. - - - - Gets or sets the with the specified key. - - - - - - Gets an containing the values in the . - - - - An containing the values in the object that implements . - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The model. - - - - Initializes a new instance of the class. - - The view data dictionary. - - - - Sets the model. - - The value. - This method will execute before the derived type's instance constructor executes. Derived types must be aware of this and should plan accordingly. For example, the logic in SetModel() should be simple enough so as not to depend on the "this" pointer referencing a fully constructed object. - - - - Gets or sets the model. - - The model. - - - - Encapsulates information about the available action filters. - - - - - Gets the action filters. - - The action filters. - - - - Gets the authorization filters. - - The authorization filters. - - - - Gets the exception filters. - - The exception filters. - - - - Gets the result filters. - - The result filters. - - - - Represents an item in a dropdown list. - - - - - Gets or sets a value indicating whether this is selected. - - true if selected; otherwise, false. - - - - Gets or sets the text. - - The text. - - - - Gets or sets the value. - - The value. - - - - Encapsulates information that describes a controller, such as its name, type, and actions. - - - - - Finds the action. - - The controller context. - The name of the action. - The information about the action. - - - - Gets the canonical actions. - - A list of action descriptors for the controller. - - - - Returns an array of all of the custom attributes defined on this member, excluding named attributes, or an empty array if there are no custom attributes. - - When true, look up the hierarchy chain for the inherited custom attribute. - - An array of Objects representing custom attributes, or an empty array. - - - The custom attribute type cannot be loaded. - - - There is more than one attribute of type defined on this member. - - - - - Returns an array of custom attributes defined on this member, identified by type, or an empty array if there are no custom attributes of that type. - - The type of the custom attributes. - When true, look up the hierarchy chain for the inherited custom attribute. - - An array of Objects representing custom attributes, or an empty array. - - - The custom attribute type cannot be loaded. - - - There is more than one attribute of type defined on this member. - - - - - Indicates whether one or more instance of is defined on this member. - - The type of the custom attributes. - When true, look up the hierarchy chain for the inherited custom attribute. - - true if the is defined on this member; false otherwise. - - - - - Gets the name of the controller. - - The name of the controller. - - - - Gets the type of the controller. - - The type of the controller. - - - - Represents the base class for all MVC controllers. - - - - - Executes the specified request context. - - The request context. - - - - Executes the core. - - - - - Initializes the specified request context. - - The request context. - - - - Executes the specified request context. - - The request context. - - - - Gets or sets the controller context. - - The controller context. - - - - Gets or sets the temporary data. - - The temporary data. - - - - Gets or sets a value indicating whether the request is valid. - - true if the request is valid; otherwise, false. - - - - Gets or sets the value provider. - - The value provider. - - - - Gets or sets the view data. - - The view data. - - - - Caches a sequence of action method selections. - - - - - Gets the selector. - - Type of the controller. - A reference to the action method selector. - - - - Attribute that affects the selection of an action method. - - - - - Determines whether [is valid for request] [the specified controller context]. - - The controller context. - The method info. - - true if [is valid for request] [the specified controller context]; otherwise, false. - - - - - Defines the methods required for a result filter. - - - - - Called before an action result executes. - - The filter context. - - - - Called after an action result executes. - - The filter context. - - - - Provides a concreate implementation of a model binder. - - - - - Binds the model. - - The controller context. - The binding context. - The bound object. - - - - Binds the property. - - The controller context. - The binding context. - The property descriptor. - - - - Creates the model. - - The controller context. - The binding context. - Type of the model. - The model. - - - - Creates the name of the sub-index. - - The prefix. - The index. - The name of the sub-index. - - - - Creates the name of the sub-property. - - The prefix. - Name of the property. - The name of the sub-property. - - - - Gets the model properties. - - The controller context. - The binding context. - A collection of property descriptors. - - - - Called when the model is updated. - - The controller context. - The binding context. - - - - Called when the model is updating. - - The controller context. - The binding context. - true is the model is updating; otherwise, false. - - - - Called when [property validated]. - - The controller context. - The binding context. - The property descriptor. - The value. - - - - Called when the property is validating. - - The controller context. - The binding context. - The property descriptor. - The value. - true if the property is validating; otherwise, false. - - - - Sets the property. - - The controller context. - The binding context. - The property descriptor. - The value. - - - - Gets or sets the model binders. - - The model binders. - - - - The name of the resource class used to localize validation messages. - - - - - Sends binary content to the response via a . - - - - - Base class used to send binary content to the response. - - - - - Initializes a new instance of the class. - - Type of the content. - - - - Enables processing of the result of an action method by a custom type that inherits from . - - The context within which the result is executed. - - - - Writes the file. - - The response. - - - - The content type to use for the response. - - The type of the content. - - - - If specified, sets the content-disposition header so that a file download dialog box appears in the browser with the specified file name. - - The name of the file download. - - - - Initializes a new instance of - - The stream to send to the response. - The content type to use for the response. - - - - Writes the file. - - The response. - - - - Gets the stream that will be sent to the response. - - The file stream. - - - - Sends binary content to the response. - - - - - Initializes a new instance of with the specified file contents and content type. - - The byte array to send to the response. - The content type to use for the response. - - - - Writes the file. - - The response. - - - - The binary content to send to the response. - - The file contents. - - - - Class used to send JSON content to the response. - - - - - Enables processing of the result of an action method by a custom type that inherits from . - - The context within which the result is executed. - - - - Gets or sets the content encoding. - - The content encoding. - - - - Gets or sets the type of the content. - - The type of the content. - - - - Gets or sets the data. - - The data. - - - - Represents the base class for all action filter attributes. - - - - - Base class for action filter attributes. - - - - - Gets or sets the order. - - The order. - - - - Defines methods used in an action filter. - - - - - Called before the action method executes]. - - The filter context. - - - - Called after the action method executes. - - The filter context. - - - - Called before the action method executes. - - The filter context. - - - - Called after the action method executes. - - The filter context. - - - - Called before the action result executes. - - The filter context. - - - - Called after the action result executes. - - The filter context. - - - - Attribute use for handling an exception thrown by an action method. - - - - - Defines the methods required for an exception filter. - - - - - Called when an exception occurs. - - The filter context. - - - - Called when an exception occurs. - - The filter context. - - - - Gets or sets the type of the exception. - - The type of the exception. - - - - Gets or sets the master view. - - The master view. - - - - Gets or sets the page view. - - The page view. - - - - Represents the state of an attempt to bind a posted form to an action method including validation information. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the values copied - from the the specified ModelStateDictionary. - - The dictionary. - - - - Adds an item to the . - - The object to add to the . - - The is read-only. - - - - - Adds an element with the provided key and value to the . - - The object to use as the key of the element to add. - The object to use as the value of the element to add. - - is null. - - - An element with the same key already exists in the . - - - The is read-only. - - - - - Adds the specified to the errors collection for the - associated with the specified key. - - The key. - The exception. - - - - Adds the specified error message to the errors collection for the - associated with the specified key. - - The key. - The error message. - - - - Removes all items from the . - - - The is read-only. - - - - - Determines whether the contains a specific value. - - The object to locate in the . - - true if is found in the ; otherwise, false. - - - - - Determines whether this dictionary contains the specified key. - - The key to locate in the dictionary. - - - - - Copies the elements of the to an , starting at a particular index. - - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in at which copying begins. - - is null. - - - is less than 0. - - - is multidimensional. - -or- - is equal to or greater than the length of . - -or- - The number of elements in the source is greater than the available space from to the end of the destination . - -or- - Type cannot be cast automatically to the type of the destination . - - - - - Returns an enumerator that iterates through the collection. - - - A that can be used to iterate through the collection. - - - - - Gets the model state for key. - - The key. - The model state. - - - - Returns true if there are any associated or prefixed with the specified key. - - The key. - - true if [is valid field] [the specified key]; otherwise, false. - - - - - Copies the values from the specified into this - dictionary, overwriting existing values in cases where the keys are the same. - - The dictionary. - - - - Removes the first occurrence of a specific object from the . - - The object to remove from the . - - true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . - - - The is read-only. - - - - - Removes the element with the specified key from the . - - The key of the element to remove. - - true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the original . - - - is null. - - - The is read-only. - - - - - Sets the value for the specified key using the specified - - The key. - The value. - - - - Gets the value associated with the specified key. - - The key whose value to get. - When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the parameter. This parameter is passed uninitialized. - - true if the object that implements contains an element with the specified key; otherwise, false. - - - is null. - - - - - Returns an enumerator that iterates through a collection. - - - An object that can be used to iterate through the collection. - - - - - Gets the number of key/value pairs that are in the collection. - - - - The number of elements contained in the . - - - - - Gets a value indicating whether the is read-only. - - - true if the is read-only; otherwise, false. - - - - - Returns true if there are no errors, otherwise false. - - true if this instance is valid; otherwise, false. - - - - Gets a collection that contains the keys in the dictionary. - - - - An containing the keys of the object that implements . - - - - - Gets or sets the value that is associated with the specified key. - - - The model state. - - - - Gets a collection that contains the values in the dictionary. - - - - An containing the values in the object that implements . - - - - - Attribute that invokes a custom model binder. - - - - - Gets the model binder. - - A reference to the interface of the model binder. - - - - Contains information that describes a reflected action method parameter. - - - - - Contains information that describe a parameter. - - - - - Returns an array of all of the custom attributes defined on this member, excluding named attributes, or an empty array if there are no custom attributes. - - When true, look up the hierarchy chain for the inherited custom attribute. - - An array of Objects representing custom attributes, or an empty array. - - - The custom attribute type cannot be loaded. - - - There is more than one attribute of type defined on this member. - - - - - Returns an array of custom attributes defined on this member, identified by type, or an empty array if there are no custom attributes of that type. - - The type of the custom attributes. - When true, look up the hierarchy chain for the inherited custom attribute. - - An array of Objects representing custom attributes, or an empty array. - - - The custom attribute type cannot be loaded. - - - There is more than one attribute of type defined on this member. - - - - - Indicates whether one or more instance of is defined on this member. - - The type of the custom attributes. - When true, look up the hierarchy chain for the inherited custom attribute. - - true if the is defined on this member; false otherwise. - - - - - Gets the action descriptor. - - The action descriptor. - - - - Gets the binding information. - - The binding infomation. - - - - Gets the name of the parameter. - - The name of the parameter. - - - - Gets the type of the parameter. - - The type of the parameter. - - - - Provides information used when binding to an action method argument or a model property. - - - - - Gets the model binder. - - The model binder.; - - - - Gets the exclude. - - The exclude. - - - - Gets the include. - - The include. - - - - Gets the prefix. - - The prefix. - - - - Initializes a new instance of the class. - - The parameter info. - The action descriptor. - - - - Returns an array of all of the custom attributes defined on this member, excluding named attributes, or an empty array if there are no custom attributes. - - When true, look up the hierarchy chain for the inherited custom attribute. - - An array of Objects representing custom attributes, or an empty array. - - - The custom attribute type cannot be loaded. - - - There is more than one attribute of type defined on this member. - - - - - Returns an array of custom attributes defined on this member, identified by type, or an empty array if there are no custom attributes of that type. - - The type of the custom attributes. - When true, look up the hierarchy chain for the inherited custom attribute. - - An array of Objects representing custom attributes, or an empty array. - - - The custom attribute type cannot be loaded. - - - There is more than one attribute of type defined on this member. - - - - - Indicates whether one or more instance of is defined on this member. - - The type of the custom attributes. - When true, look up the hierarchy chain for the inherited custom attribute. - - true if the is defined on this member; false otherwise. - - - - - Gets the action descriptor. - - The action descriptor. - - - - Gets the binding information. - - The binding infomation. - - - - Gets the parameter info. - - The parameter info. - - - - Gets the name of the parameter. - - The name of the parameter. - - - - Gets the type of the parameter. - - The type of the parameter. - - - - When applied to an action method, specifies which HTTP verbs the method will respond to. - - - - - Initializes a new instance of the class. - - The verbs. - - - - Initializes a new instance of the class. - - The verbs. - - - - Determines whether the given method information is valid for the specified controller context. - - The controller context. - The method info. - - true if the given method information is valid; otherwise, false. - - - - - Gets the list of HTTP verbs the action method will respond to. - - - - - Attribute used to detect someone trying to tamper with a server request. - - When an action method or controller is marked with this attribute, each round trip to the server is validated based on this token. - - - - Defines the methods required for an authorization filter. - - - - - Called when authorization is required. - - The filter context. - - - - Called when authorization is required. - - The filter context. - - - - Gets or sets the salt. - - The salt. - - - - Represents a view engine for rendering a Web Forms page in MVC. - - - - - Abstract base class implementation of the interface. - - You can use this class as a starting point for building your own view engine that relies on the class to access view files. - - - - Initializes a new instance of the class. - - - - - Creates the cache key. - - The prefix. - The name. - Name of the controller. - The cache key. - - - - Creates the partial view. - - The controller context. - The partial path. - - - - - Creates the view. - - The controller context. - The view path. - The master path. - - - - - Files the exists. - - The controller context. - The virtual path. - - - - - Finds the partial view. - - The controller context. - Partial name of the view. - if set to true [use cache]. - The partial view. - - - - Finds the view. - - The controller context. - Name of the view. - Name of the master. - if set to true [use cache]. - The page view. - - - - Releases the view. - - The controller context. - The view. - - - - Gets or sets the master location formats. - - The master location formats. - - - - Gets or sets the partial view location formats. - - The partial view location formats. - - - - Gets or sets the view location cache. - - The view location cache. - - - - Gets or sets the view location formats. - - The view location formats. - - - - Gets or sets the virtual path provider. - - The virtual path provider. - - - - Initializes a new instance of the class. - - - - - Creates the partial view. - - The controller context. - The partial path. - The partial view. - - - - Creates the view. - - The controller context. - The view path. - The master path. - The view. - - - - Determines if a file at the given location exists for the specified controller context. - - The controller context. - The virtual path. - true if the file exists; otherwise, false. - - - - Represents the information needed to build a Web Forms page in MVC. - - - - - Defines the methods required for a view. - - - - - Renders the specified view context. - - The view context. - The writer. - - - - Initializes a new instance of the class. - - The view path. - - - - Initializes a new instance of the class. - - The view path. - The master path. - - - - Renders the specified view context. - - The view context. - The writer. - - - - Gets the master path. - - The master path. - - - - Gets the view path. - - The view path. - - - - Represents the controller factory that registered by default. - - This class provides a convenient base class for those who simply want to tweak controller creation. This class call Dispose on any controller that implements the IDisposable interface. - - - - Creates the controller. - - The request context. - Name of the controller. - A reference to the controller. - - - - Gets the controller instance. - - Type of the controller. - A reference to the controller. - - - - Gets the type of the controller. - - Name of the controller. - The type of the controller. - - - - Releases the controller. - - The controller. - - - - Gets or sets the request context. - - The request context. - - - - Base class used to send a partial view to the response. - - - - - When overridden, returns the used to render the view. - - The controller context. - The view engine result. - - - - Verifies and processes an HTTP request. - - - - - Verifies and processes an HTTP request. - - The HTTP handler. - The HTTP context. - - - - A collection of instances representing - errors when model binding. - - - - - Adds an to the - - The exception. - - - - Adds an error message to the - - The error message. - - - - Represents an HTTP anti-forgery exception. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that holds the contextual information about the source or destination. - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - The message. - The inner exception. - - - - Class used to render a view using an returned by a . - - - - - Searches the registered view engines and returns the used to render the view. - - - - - - - The name of the master view (such as a master page or template) to use when rendering the view. - - The name of the master view. - - - - Provides session state data to the current object. - - - - - Defines the contract for temp data providers which store data viewed on the next request. - - - - - Loads the temporary data. - - The controller context. - The temporary data. - - - - Saves the temporary data. - - The controller context. - The values. - - - - Loads the temporary data. - - The controller context. - The temporary data. - - - - Saves the temporary data. - - The controller context. - The values. - - - - Represents an HTML form. - - - - - Initializes a new instance of the class. - - The HTTP response. - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Releases unmanaged and - optionally - managed resources. - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Ends the form. - - - - - Contains information that describes a reflected controller. - - - - - Initializes a new instance of the class. - - Type of the controller. - - - - Finds the action. - - The controller context. - The name of the action. - The information about the action. - - - - Gets all action methods from selector. - - The action method information. - - - - Gets the canonical actions. - - - A list of action descriptors for the controller. - - - - - Returns an array of all of the custom attributes defined on this member, excluding named attributes, or an empty array if there are no custom attributes. - - When true, look up the hierarchy chain for the inherited custom attribute. - - An array of Objects representing custom attributes, or an empty array. - - - The custom attribute type cannot be loaded. - - - There is more than one attribute of type defined on this member. - - - - - Returns an array of custom attributes defined on this member, identified by type, or an empty array if there are no custom attributes of that type. - - The type of the custom attributes. - When true, look up the hierarchy chain for the inherited custom attribute. - - An array of Objects representing custom attributes, or an empty array. - - - The custom attribute type cannot be loaded. - - - There is more than one attribute of type defined on this member. - - - - - Indicates whether one or more instance of is defined on this member. - - The type of the custom attributes. - When true, look up the hierarchy chain for the inherited custom attribute. - - true if the is defined on this member; false otherwise. - - - - - Gets the type of the controller. - - The type of the controller. - - - - Represents the type of a view. - - - - - Gets or sets the name of the type. - - The name of the type. - - - - Provides the context for the ActionExecuted method of an . - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The controller context. - The action descriptor. - if set to true [canceled]. - The exception. - - - - Gets or sets the action descriptor. - - The action descriptor. - - - - Gets or sets a value indicating whether this is canceled. - - true if canceled; otherwise, false. - - - - Gets or sets the exception. - - The exception. - - - - Gets or sets a value indicating whether [exception handled]. - - true if [exception handled]; otherwise, false. - - - - Gets or sets the result. - - The result. - - - - Represents a result that doesn't do anything, like a controller action returning null. - - - This follows a pattern known as the Null Object pattern. - - - - - Does nothing per the Null Object pattern. - - - - - - - - - - - Returns a that renders the supplied content to the response. - - The content to write to the response. - The that renders the supplied content to the response. - - - - Returns a that renders the supplied content to the response. - - The content to write to the response. - The content type. - The that renders the supplied content to the response. - - - - Returns a which renders the supplied content to the response. - - The content to write to the response. - The content type. - The content encoding. - The a which renders the supplied content to the response. - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Releases unmanaged and - optionally - managed resources. - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Executes the core. - - - - - Returns a which writes the fileContents to the response. - - The binary content to send to the response. - The content type. - The which writes the fileContents to the response. - - - - Returns a which writes the fileContents to the response. - - The binary content to send to the response. - The content type. - If specified, sets the content-disposition header so that a file download dialog box appears in the browser with the specified file name. - The which writes the fileContents to the response. - - - - Returns a which writes the fileStream to the response. - - The stream to send to the response. - The content type. - The which writes the fileStream to the response. - - - - Returns a which writes the fileStream to the response. - - The stream to send to the response. - The content type. - If specified, sets the content-disposition header so that a file download dialog box appears in the browser with the specified file name. - The which writes the fileStream to the response. - - - - Returns a which writes the file to the response. - - The path to the file to send to the response. - The content type. - The which writes the file to the response. - - - - Returns a which writes the file to the response. - - The path to the file to send to the response. - The content type. - If specified, sets the content-disposition header so that a file download dialog box appears in the browser with the specified file name. - The which writes the file to the response. - - - - Method called whenever a request matches this controller, but not an action of this controller. - - The name of the attempted action. - - - - Returns a which writes a script to the response. - which is then executed on the client. - - The JavaScript code to run on the client. - The which writes a script to the response. - - - - Returns a which serializes the specified object to - JSON and writes the JSON to the response. - - The object which is serialized to JSON and sent to the response. - The which serializes the specified object to - JSON and writes the JSON to the response. - - - - Returns a which serializes the specified object to - JSON and writes the JSON to the response. - - The object which is serialized to JSON and sent to the response. - The content type. - The which serializes the specified object to - JSON and writes the JSON to the response. - - - - Returns a which serializes the specified object to - JSON and writes the JSON to the response. - - The object which is serialized to JSON and sent to the response. - The content type. - The content encoding. - - - - - Initializes the controller. - - The request context. - - - - Method called before the action method is invoked. - - Contains information about the current request and action. - - - - Method called after the action method is invoked. - - Contains information about the current request and action. - - - - Method called when authorization occurs. - - Contains information about the current request and action. - - - - Method called when an unhandled exception occurs in the action. - - Contains information about the current request and action. - - - - Method called after the action result returned by an action method is executed. - - Contains information about the current request and action result. - - - - Method called before the action result returned by an action method is executed. - - Contains information about the current request and action result. - - - - Returns a that renders a partial view to the response. - - - - - - Returns a that renders a partial view to the response. - - The model rendered by the partial view. - - - - Returns a that renders a partial view to the response. - - The name of the partial view. - - - - Returns a that renders a partial view to the response. - - The name of the partial view. - The model rendered by the partial view. - - - - Returns a that redirects to the specified URL. - - The URL to redirect to. - The that redirects to the specified URL. - - - - Returns a that redirects to the specified action. - - The name of the action. - The that redirects to the specified action. - - - - Returns a that redirects to the specified action. - - The name of the action. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - The that redirects to the specified action. - - - - Returns a that redirects to the specified action. - - The name of the action. - An object containing the parameters for a route. - The that redirects to the specified action. - - - - Returns a that redirects to the specified action. - - The name of the action. - The name of the controller. - The that redirects to the specified action. - - - - Returns a that redirects to the specified action. - - The name of the action. - The name of the controller. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - The that redirects to the specified action. - - - - Returns a that redirects to the specified action. - - The name of the action. - The name of the controller. - An object containing the parameters for a route. - The that redirects to the specified action. - - - - Returns a that redirects to the specified route. - - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - The that redirects to the specified route. - - - - Returns a that redirects to the specified route. - - An object containing the parameters for a route. - The that redirects to the specified route. - - - - Returns a that redirects to the specified route. - - The name of the route. - The that redirects to the specified route. - - - - Returns a that redirects to the specified route. - - The name of the route. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - The that redirects to the specified route. - - - - Returns a that redirects to the specified route. - - The name of the route. - An object containing the parameters for a route. - The that redirects to the specified route. - - - - Updates the specified model instance using values from the Controller's current ValueProvider. - - The type of the model object - The model instance to update. - true if successful; otherwise, false. - - - - Updates the specified model instance using values from the Controller's current ValueProvider. - - The type of the model object - The model instance to update. - Prefix to use when looking up values in the value provider. - true if successful; otherwise, false. - - - - Updates the specified model instance using values from the Controller's current ValueProvider. - - The type of the model object - The model instance to update. - List of properties of the model to update. - true if successful; otherwise, false. - - - - Updates the specified model instance using values from the Controller's current ValueProvider. - - The type of the model object - The model instance to update. - List of properties of the model to update. - Prefix to use when looking up values in the value provider. - true if successful; otherwise, false. - - - - Updates the specified model instance using values from the Controller's current ValueProvider. - - The type of the model object - The model instance to update. - Prefix to use when looking up values in the value provider. - List of properties of the model to update. - List of properties to explicitly exclude from update. These are excluded even if they are listed in the includeProperties list. - true if successful; otherwise, false. - - - - Updates the specified model instance using values from the Controller's current ValueProvider. - - The type of the model object - The model instance to update. - A dictionary of values used to update the model. - true if successful; otherwise, false. - - - - Updates the specified model instance using values from the Controller's current ValueProvider. - - The type of the model object - The model instance to update. - Prefix to use when looking up values in the value provider. - A dictionary of values used to update the model. - true if successful; otherwise, false. - - - - Updates the specified model instance using values from the Controller's current ValueProvider. - - The type of the model object - The model instance to update. - List of properties of the model to update. - A dictionary of values used to update the model. - true if successful; otherwise, false. - - - - Updates the specified model instance using values from the Controller's current ValueProvider. - - The type of the model object - The model instance to update. - Prefix to use when looking up values in the value provider. - List of properties of the model to update. - A dictionary of values used to update the model. - true if successful; otherwise, false. - - - - Updates the specified model instance using values from the Controller's current ValueProvider. - - The type of the model object - The model instance to update. - Prefix to use when looking up values in the value provider. - List of properties of the model to update. - List of properties to explicitly exclude from update. These are excluded even if they are listed in the includeProperties list. - A dictionary of values used to update the model. - true if successful; otherwise, false. - - - - Updates the specified model instance using values from the Controller's current ValueProvider. - - The type of the model object - The model instance to update. - - - - Updates the specified model instance using values from the Controller's current ValueProvider. - - The type of the model object - The model instance to update. - Prefix to use when looking up values in the value provider. - - - - Updates the specified model instance using values from the Controller's current ValueProvider. - - The type of the model object - The model instance to update. - List of properties of the model to update. - - - - Updates the specified model instance using values from the Controller's current ValueProvider. - - The type of the model object - The model instance to update. - Prefix to use when looking up values in the value provider. - List of properties of the model to update. - - - - Updates the specified model instance using values from the Controller's current ValueProvider. - - The type of the model object - The model instance to update. - Prefix to use when looking up values in the value provider. - List of properties of the model to update. - List of properties to explicitly exclude from update. These are excluded even if they are listed in the includeProperties list. - - - - Updates the specified model instance using values from the Controller's current ValueProvider. - - The type of the model object - The model instance to update. - A dictionary of values used to update the model. - - - - Updates the specified model instance using values from the Controller's current ValueProvider. - - The type of the model object - The model instance to update. - Prefix to use when looking up values in the value provider. - A dictionary of values used to update the model. - - - - Updates the specified model instance using values from the Controller's current ValueProvider. - - The type of the model object - The model instance to update. - List of properties of the model to update. - A dictionary of values used to update the model. - - - - Updates the specified model instance using values from the Controller's current ValueProvider. - - The type of the model object - The model instance to update. - Prefix to use when looking up values in the value provider. - List of properties of the model to update. - A dictionary of values used to update the model. - - - - Updates the specified model instance using values from the Controller's current ValueProvider. - - The type of the model object - The model instance to update. - Prefix to use when looking up values in the value provider. - List of properties of the model to update. - List of properties to explicitly exclude from update. These are excluded even if they are listed in the includeProperties list. - A dictionary of values used to update the model. - - - - Returns a that renders a view to the response. - - The that renders a view to the response. - - - - Returns a that renders a view to the response. - - The model rendered by the view. - The that renders a view to the response. - - - - Returns a that renders a view to the response. - - The name of the partial view. - The that renders a view to the response. - - - - Returns a that renders a view to the response. - - The name of the view. - The name of the master view. - The that renders a view to the response. - - - - Returns a that renders a view to the response. - - The name of the view. - The model rendered by the view. - The that renders a view to the response. - - - - Returns a that renders a view to the response. - - The name of the view. - The name of the master view. - The model rendered by the view. - The that renders a view to the response. - - - - Returns a that renders the specified to the response. - - The view rendered to the response. - The that renders the specified to the response. - - - - Returns a which renders the specified to the response. - - The view rendered to the response. - The model rendered by the view. - The which renders the specified to the response. - - - - Called before an action method executes. - - The filter context. - - - - Called before an action method executes. - - The filter context. - - - - Called when authorizing access to the action method. - - The filter context. - - - - Called when an exception occurs in an action method. - - The filter context. - - - - Called before the action result executes. - - The filter context. - - - - Called after the action result executes. - - The filter context. - - - - Gets the for the controller. - - The action invoker. - - - - Gets or sets the binders. - - The binders. - - - - Encapsulates all HTTP-specific information about an individual HTTP request. - - The HTTP context. - - - - Gets the object containing the - state of the model and model binding validation. - - The state of the model. - - - - Gets the object for the current HTTP request. - - The request. - - - - Gets the object for the current HTTP request. - - The response. - - - - Returns the for the current request. - - The route data. - - - - Gets the object that provides methods used in processing Web requests. - - The server. - - - - Gets the object for the current HTTP request. - - The session. - - - - Gets the object used to store data for the next request. - - The temp data provider. - - - - Gets the object used to generate URLs using routing. - - The URL. - - - - Gets the security information for the current HTTP request. - - The user. - - - - Attribute used for marking an action method whose output will be cached. - - - - - Called before the action result executes. - - The filter context. - - - - Gets or sets the cache profile. - - The cache profile. - - - - Gets or sets the duration. - - The duration. - - - - Gets or sets the location. - - The location. - - - - Gets or sets a value indicating whether to store the cache. - - true if the cache should be stored; otherwise, false. - - - - Gets or sets the SQL dependency. - - The SQL dependency. - - - - Gets or sets the vary by content encoding. - - The vary by content encoding. - - - - Gets or sets the vary by custom. - - The vary by custom. - - - - Gets or sets the vary by header. - - The vary by header. - - - - Gets or sets the vary by param. - - The vary by param. - - - - Initializes the control tree during page generation based on the declarative nature of the page. - - - - - Defines the methods required for a memory cache of view locations. - - - - - Gets the view location. - - The HTTP context. - The key. - The view location. - - - - Inserts the view location. - - The HTTP context. - The key. - The virtual path. - - - - Enumerates the AJAX script insertion modes. - - - - - Replace the element. - - - - - Insert before the element. - - - - - Insert after the element. - - - - - Attribute used associate a model type to a model-builder type. - - - - - Initializes a new instance of the class. - - Type of the binder. - - - - Gets the model binder. - - - A reference to the interface of the model binder. - - - - - Gets the type of the binder. - - The type of the binder. - - - - Represents support for ASP.NET AJAX within an ASP.NET MVC application. - - - - - Returns an anchor tag containing the URL to the specified action, such that when the action link is clicked, - the action is invoked asynchronously via JavaScript. - - The ajax helper. - The inner text of the anchor tag. - The name of the action. - An object providing options for the asynchronous request. - An anchor tag. - - - - Returns an anchor tag containing the URL to the specified action, such that when the action link is clicked, - the action is invoked asynchronously via JavaScript. - - The ajax helper. - The inner text of the anchor tag. - The name of the action. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An object providing options for the asynchronous request. - An anchor tag. - - - - Returns an anchor tag containing the URL to the specified action, such that when the action link is clicked, - the action is invoked asynchronously via JavaScript. - - The ajax helper. - The inner text of the anchor tag. - The name of the action. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An object providing options for the asynchronous request. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An anchor tag. - - - - Returns an anchor tag containing the URL to the specified action, such that when the action link is clicked, - the action is invoked asynchronously via JavaScript. - - The ajax helper. - The inner text of the anchor tag. - The name of the action. - An object containing the parameters for a route. - An object providing options for the asynchronous request. - An anchor tag. - - - - Returns an anchor tag containing the URL to the specified action, such that when the action link is clicked, - the action is invoked asynchronously via JavaScript. - - The ajax helper. - The inner text of the anchor tag. - The name of the action. - An object containing the parameters for a route. - An object providing options for the asynchronous request. - An object containing the HTML attributes for the element. - An anchor tag. - - - - Returns an anchor tag containing the URL to the specified action, such that when the action link is clicked, - the action is invoked asynchronously via JavaScript. - - The ajax helper. - The inner text of the anchor tag. - The name of the action. - The name of the controller. - An object providing options for the asynchronous request. - An anchor tag. - - - - Returns an anchor tag containing the URL to the specified action, such that when the action link is clicked, - the action is invoked asynchronously via JavaScript. - - The ajax helper. - The inner text of the anchor tag. - The name of the action. - The name of the controller. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An object providing options for the asynchronous request. - An anchor tag. - - - - Returns an anchor tag containing the URL to the specified action, such that when the action link is clicked, - the action is invoked asynchronously via JavaScript. - - The ajax helper. - The inner text of the anchor tag. - The name of the action. - The name of the controller. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An object providing options for the asynchronous request. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An anchor tag. - - - - Returns an anchor tag containing the URL to the specified action, such that when the action link is clicked, - the action is invoked asynchronously via JavaScript. - - The ajax helper. - The inner text of the anchor tag. - The name of the action. - The name of the controller. - An object containing the parameters for a route. - An object providing options for the asynchronous request. - An anchor tag. - - - - Returns an anchor tag containing the URL to the specified action, such that when the action link is clicked, - the action is invoked asynchronously via JavaScript. - - The ajax helper. - The inner text of the anchor tag. - The name of the action. - The name of the controller. - An object containing the parameters for a route. - An object providing options for the asynchronous request. - An object containing the HTML attributes for the element. - An anchor tag. - - - - Returns an anchor tag containing the URL to the specified action, such that when the action link is clicked, - the action is invoked asynchronously via JavaScript. - - The ajax helper. - The inner text of the anchor tag. - The name of the action. - The name of the controller. - The protocol for the URL such as "http" or "https". - The host name for the URL. - The URL fragment name (also known as anchor name). - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An object providing options for the asynchronous request. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An anchor tag. - - - - Returns an anchor tag containing the URL to the specified action, such that when the action link is clicked, - the action is invoked asynchronously via JavaScript. - - The ajax helper. - The inner text of the anchor tag. - The name of the action. - The name of the controller. - The protocol for the URL such as "http" or "https". - The host name for the URL. - The URL fragment name (also known as anchor name). - An object containing the parameters for a route. - An object providing options for the asynchronous request. - An object containing the HTML attributes for the element. - An anchor tag. - - - - Writes an opening form tag to the response while returning an - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. The form is submitted asynchronously using JavaScript. - - The ajax helper. - An object providing options for the asynchronous request. - - An instance. - - - - - Writes an opening form tag to the response while returning an - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. The form is submitted asynchronously using JavaScript. - - The ajax helper. - The name of the action. - An object providing options for the asynchronous request. - - An instance. - - - - - Writes an opening form tag to the response while returning an - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. The form is submitted asynchronously using JavaScript. - - The ajax helper. - The name of the action. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An object providing options for the asynchronous request. - - An instance. - - - - - Writes an opening form tag to the response while returning an - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. The form is submitted asynchronously using JavaScript. - - The ajax helper. - The name of the action. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An object providing options for the asynchronous request. - An object containing the HTML attributes for the element. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - - An instance. - - - - - Writes an opening form tag to the response while returning an - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. The form is submitted asynchronously using JavaScript. - - The ajax helper. - The name of the action. - An object containing the parameters for a route. - An object providing options for the asynchronous request. - - An instance. - - - - - Writes an opening form tag to the response while returning an - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. The form is submitted asynchronously using JavaScript. - - The ajax helper. - The name of the action. - An object containing the parameters for a route. - An object providing options for the asynchronous request. - An object containing the HTML attributes for the element. - - An instance. - - - - - Writes an opening form tag to the response while returning an - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. The form is submitted asynchronously using JavaScript. - - The ajax helper. - The name of the action. - The name of the controller. - An object providing options for the asynchronous request. - - An instance. - - - - - Writes an opening form tag to the response while returning an - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. The form is submitted asynchronously using JavaScript. - - The ajax helper. - The name of the action. - The name of the controller. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An object providing options for the asynchronous request. - - An instance. - - - - - Writes an opening form tag to the response while returning an - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. The form is submitted asynchronously using JavaScript. - - The ajax helper. - The name of the action. - The name of the controller. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An object providing options for the asynchronous request. - An object containing the HTML attributes for the element. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - - An instance. - - - - - Writes an opening form tag to the response while returning an - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. The form is submitted asynchronously using JavaScript. - - The ajax helper. - The name of the action. - The name of the controller. - An object containing the parameters for a route. - An object providing options for the asynchronous request. - - An instance. - - - - - Writes an opening form tag to the response while returning an - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. The form is submitted asynchronously using JavaScript. - - The ajax helper. - The name of the action. - The name of the controller. - An object containing the parameters for a route. - An object providing options for the asynchronous request. - An object containing the HTML attributes for the element. - - An instance. - - - - - Writes an opening form tag to the response while returning an - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. The form is submitted asynchronously using JavaScript. - - The ajax helper. - The name of the route to use to obtain the form post URL. - An object providing options for the asynchronous request. - - An instance. - - - - - Writes an opening form tag to the response while returning an - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. The form is submitted asynchronously using JavaScript. - - The ajax helper. - The name of the route to use to obtain the form post URL. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An object providing options for the asynchronous request. - - An instance. - - - - - Writes an opening form tag to the response while returning an - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. The form is submitted asynchronously using JavaScript. - - The ajax helper. - The name of the route to use to obtain the form post URL. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An object providing options for the asynchronous request. - An object containing the HTML attributes for the element. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - - An instance. - - - - - Writes an opening form tag to the response while returning an - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. The form is submitted asynchronously using JavaScript. - - The ajax helper. - The name of the route to use to obtain the form post URL. - An object containing the parameters for a route. - An object providing options for the asynchronous request. - - An instance. - - - - - Writes an opening form tag to the response while returning an - instance. Can be used in a using block, in which case it renders the closing form tag at the end of the - using block. The form is submitted asynchronously using JavaScript. - - The ajax helper. - The name of the route to use to obtain the form post URL. - An object containing the parameters for a route. - An object providing options for the asynchronous request. - An object containing the HTML attributes for the element. - - An instance. - - - - - Returns an anchor tag containing the virtual path for the specified route values, such that when the link is clicked, - a request is made to the virtual path asynchronously via JavaScript. - - The ajax helper. - The inner text of the anchor tag. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An object providing options for the asynchronous request. - An anchor tag. - - - - Returns an anchor tag containing the virtual path for the specified route values, such that when the link is clicked, - a request is made to the virtual path asynchronously via JavaScript. - - The ajax helper. - The inner text of the anchor tag. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An object providing options for the asynchronous request. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An anchor tag. - - - - Returns an anchor tag containing the virtual path for the specified route values, such that when the link is clicked, - a request is made to the virtual path asynchronously via JavaScript. - - The ajax helper. - The inner text of the anchor tag. - An object containing the parameters for a route. - An object providing options for the asynchronous request. - An anchor tag. - - - - Returns an anchor tag containing the virtual path for the specified route values, such that when the link is clicked, - a request is made to the virtual path asynchronously via JavaScript. - - The ajax helper. - The inner text of the anchor tag. - An object containing the parameters for a route. - An object providing options for the asynchronous request. - An object containing the HTML attributes for the element. - An anchor tag. - - - - Returns an anchor tag containing the virtual path for the specified route values, such that when the link is clicked, - a request is made to the virtual path asynchronously via JavaScript. - - The ajax helper. - The inner text of the anchor tag. - The name of the route to use to obtain the form post URL. - An object providing options for the asynchronous request. - An anchor tag. - - - - Returns an anchor tag containing the virtual path for the specified route values, such that when the link is clicked, - a request is made to the virtual path asynchronously via JavaScript. - - The ajax helper. - The inner text of the anchor tag. - The name of the route to use to obtain the form post URL. - An object providing options for the asynchronous request. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An anchor tag. - - - - Returns an anchor tag containing the virtual path for the specified route values, such that when the link is clicked, - a request is made to the virtual path asynchronously via JavaScript. - - The ajax helper. - The inner text of the anchor tag. - The name of the route to use to obtain the form post URL. - An object providing options for the asynchronous request. - An object containing the HTML attributes for the element. - An anchor tag. - - - - Returns an anchor tag containing the virtual path for the specified route values, such that when the link is clicked, - a request is made to the virtual path asynchronously via JavaScript. - - The ajax helper. - The inner text of the anchor tag. - The name of the route to use to obtain the form post URL. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An object providing options for the asynchronous request. - An anchor tag. - - - - Returns an anchor tag containing the virtual path for the specified route values, such that when the link is clicked, - a request is made to the virtual path asynchronously via JavaScript. - - The ajax helper. - The inner text of the anchor tag. - The name of the route to use to obtain the form post URL. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An object providing options for the asynchronous request. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An anchor tag. - - - - Returns an anchor tag containing the virtual path for the specified route values, such that when the link is clicked, - a request is made to the virtual path asynchronously via JavaScript. - - The ajax helper. - The inner text of the anchor tag. - The name of the route to use to obtain the form post URL. - An object containing the parameters for a route. - An object providing options for the asynchronous request. - An anchor tag. - - - - Returns an anchor tag containing the virtual path for the specified route values, such that when the link is clicked, - a request is made to the virtual path asynchronously via JavaScript. - - The ajax helper. - The inner text of the anchor tag. - The name of the route to use to obtain the form post URL. - An object containing the parameters for a route. - An object providing options for the asynchronous request. - An object containing the HTML attributes for the element. - An anchor tag. - - - - Returns an anchor tag containing the virtual path for the specified route values, such that when the link is clicked, - a request is made to the virtual path asynchronously via JavaScript. - - The ajax helper. - The inner text of the anchor tag. - The name of the route to use to obtain the form post URL. - The protocol for the URL such as "http" or "https". - The host name for the URL. - The URL fragment name (also known as anchor name). - An object containing the parameters for a route. - An object providing options for the asynchronous request. - An object containing the HTML attributes for the element. - An anchor tag. - - - - Provides the context for using an . - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The controller context. - - - - Gets or sets the result. - - The result. - - - - Represents the information needed to build a master view page. - - - - - Gets the ajax. - - The ajax. - - - - Gets the HTML. - - The HTML. - - - - Gets the model. - - The model. - - - - Gets the temporary data. - - The temporary data. - - - - Gets the URL. - - The URL. - - - - Gets the view context. - - The view context. - - - - Gets the view data. - - The view data. - - - - Gets the writer. - - The writer. - - - - Attribute that is use to indicated that a controller method is not an action method. - - - - - Determines whether the attribute marks a valid non-action method given the specified controller context. - - The controller context. - The method info. - - true if the attribute marks a valid non-action method; otherwise, false. - - - - - Extends a NameValueCollection so it copies the collection to specified dictionary./> - - - - - Copies to a given collection to the specified destination. - - The collection. - The destination. - - - - Copies to a given collection to the specified destination. - - The collection. - The destination. - If set to true, this method replaces the previous entries. - - - - Represents a user-defined content type that is the result of an action method. - - - - - Enables processing of the result of an action method by a custom type that inherits from . - - The context within which the result is executed. - - - - Gets or sets the content. - - The content. - - - - Gets or sets the content encoding. - - The content encoding. - - - - Gets or sets the type of the content. - - The type of the content. - - - - Represents support for making selects in a list. - - - - - Returns a select tag used to select a single option from a set of possible choices. - - The HTML helper. - The name of the form field and used as a key to look up possible options. If ViewData[name] implements IEnumerable of . - Provides the text for a default empty valued option, if it is not null. - - - - - Returns a select tag used to select a single option from a set of possible choices. - - The HTML helper. - The name of the form field and used as a key to look up possible options. If ViewData[name] implements IEnumerable of . - The enumeration of SelectListItem instances used to populate the drop-down list. - Provides the text for a default empty valued option, if it is not null. - - - - - Returns a select tag used to select a single option from a set of possible choices. - - The HTML helper. - The name of the form field and used as a key to look up possible options. If ViewData[name] implements IEnumerable of . - The enumeration of SelectListItem instances used to populate the drop-down list. - Provides the text for a default empty valued option, if it is not null. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - - - - - Returns a select tag used to select a single option from a set of possible choices. - - The HTML helper. - The name of the form field and used as a key to look up possible options. If ViewData[name] implements IEnumerable of . - - - - - Returns a select tag used to select a single option from a set of possible choices. - - The HTML helper. - The name of the form field and used as a key to look up possible options. If ViewData[name] implements IEnumerable of . - The enumeration of SelectListItem instances used to populate the drop-down list. - - - - - Returns a select tag used to select a single option from a set of possible choices. - - The HTML helper. - The name of the form field and used as a key to look up possible options. If ViewData[name] implements IEnumerable of . - The enumeration of SelectListItem instances used to populate the drop-down list. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - - - - - Returns a select tag used to select a single option from a set of possible choices. - - The HTML helper. - The name of the form field and used as a key to look up possible options. If ViewData[name] implements IEnumerable of . - The enumeration of SelectListItem instances used to populate the drop-down list. - An object containing the HTML attributes for the element. - - - - - Returns a select tag used to select a single option from a set of possible choices. - - The HTML helper. - The name of the form field and used as a key to look up possible options. If ViewData[name] implements IEnumerable of . - The enumeration of SelectListItem instances used to populate the drop-down list. - Provides the text for a default empty valued option, if it is not null. - An object containing the HTML attributes for the element. - - - - - Returns a select tag used to select a multiple options from a set of possible choices. - - The HTML helper. - The name of the form field and used as a key to look up possible options. If ViewData[name] implements IEnumerable of . - - - - - Returns a select tag used to select a multiple options from a set of possible choices. - - The HTML helper. - The name of the form field and used as a key to look up possible options. If ViewData[name] implements IEnumerable of . - The enumeration of SelectListItem instances used to populate the drop-down list. - - - - - Returns a select tag used to select a multiple options from a set of possible choices. - - The HTML helper. - The name of the form field and used as a key to look up possible options. If ViewData[name] implements IEnumerable of . - The enumeration of SelectListItem instances used to populate the drop-down list. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - - - - - Returns a select tag used to select a multiple options from a set of possible choices. - - The HTML helper. - The name of the form field and used as a key to look up possible options. If ViewData[name] implements IEnumerable of . - The enumeration of SelectListItem instances used to populate the drop-down list. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - - - - - Represents support for rendering a partial view. - - - - - Renders the specified partial view. - - The HTML helper. - The name of the partial view. - - - - Renders the specified partial view, replacing its ViewData property with the - supplied ViewDataDictionary. - - The HTML helper. - The name of the partial view. - The view data. - - - - Renders the specified partial view, passing in a copy of the current - ViewDataDictionary, but - with the Model property set to the specified model. - - The HTML helper. - The name of the partial view. - The model. - - - - Renders the specified partial view, replacing the partial view's ViewData property with the - supplied ViewDataDictionary. The Model - property of the view data is set to the specified model. - - The HTML helper. - The name of the partial view. - The model for the partial view. - The view data for the partial view. - - - - Represents the HTTP request type for a Form. - - - - - GET request. - - - - - POST request. - - - - - Contains information that describes a reflected action method. - - - - - Provides information about an action method, such as its name, controller, parameters, attributes, and filters. - - - - - Executes the action method with the given parameters and the specified controller context. - - The controller context. - The parameters. - The result of executing the action method. - - - - Returns an array of all of the custom attributes defined on this member, excluding named attributes, or an empty array if there are no custom attributes. - - When true, look up the hierarchy chain for the inherited custom attribute. - - An array of Objects representing custom attributes, or an empty array. - - - The custom attribute type cannot be loaded. - - - There is more than one attribute of type defined on this member. - - - - - Returns an array of custom attributes defined on this member, identified by type, or an empty array if there are no custom attributes of that type. - - The type of the custom attributes. - When true, look up the hierarchy chain for the inherited custom attribute. - - An array of Objects representing custom attributes, or an empty array. - - - The custom attribute type cannot be loaded. - - - There is more than one attribute of type defined on this member. - - - - - Gets the filters associated with this action method. - - The filters. - - - - Gets the parameters. - - The parameters. - - - - Gets the selectors. - - The selectors. - - - - Indicates whether one or more instance of is defined on this member. - - The type of the custom attributes. - When true, look up the hierarchy chain for the inherited custom attribute. - - true if the is defined on this member; false otherwise. - - - - - Gets the name of the action. - - The name of the action. - - - - Gets the controller descriptor. - - The controller descriptor. - - - - Initializes a new instance of the class. - - The action method information. - The name of the action. - The controller descriptor. - - - - Executes the specified controller context. - - The controller context. - The parameters. - The action return value. - - - - Returns an array of all of the custom attributes defined on this member, excluding named attributes, or an empty array if there are no custom attributes. - - When true, look up the hierarchy chain for the inherited custom attribute. - - An array of Objects representing custom attributes, or an empty array. - - - The custom attribute type cannot be loaded. - - - There is more than one attribute of type defined on this member. - - - - - Returns an array of custom attributes defined on this member, identified by type, or an empty array if there are no custom attributes of that type. - - The type of the custom attributes. - When true, look up the hierarchy chain for the inherited custom attribute. - - An array of Objects representing custom attributes, or an empty array. - - - The custom attribute type cannot be loaded. - - - There is more than one attribute of type defined on this member. - - - - - Gets information about action filters. - - The filter information. - - - - Gets the parameters of the action method. - - The parameters. - - - - Gets the action selectors. - - The action selectors. - - - - Indicates whether one or more instance of is defined on this member. - - The type of the custom attributes. - When true, look up the hierarchy chain for the inherited custom attribute. - - true if the is defined on this member; false otherwise. - - - - - Gets the name of the action. - - The name of the action. - - - - Gets the controller descriptor. - - The controller descriptor. - - - - Gets the action method information. - - The action method information. - - - - Represents support for rendering HTML in AJAX scenarios within a strongly typed view. - - The type of the model. - - - - Initializes a new instance of the class. - - The view context. - The view data container. - - - - Initializes a new instance of the class. - - The view context. - The view data container. - The route collection. - - - - Gets the current . - - The view data. - - - - Selects the controller that will handle an HTTP request. - - - - - Header name of the ASP.NET MVC version. - - - - - Initializes a new instance of the class. - - The request context. - - - - Adds the version header. - - The HTTP context. - - - - Processes the request. - - The HTTP context. - - - - Processes the request. - - The HTTP context. - - - - Processes the request. - - The HTTP context. - - - - Gets a value indicating whether another request can use the instance. - - - true if the instance is reusable; otherwise, false. - - - - - Gets or sets a value indicating whether [disable MVC response header]. - - - true if [disable MVC response header]; otherwise, false. - - - - - Gets the request context. - - The request context. - - - - Gets a value indicating whether another request can use the instance. - - - true if the instance is reusable; otherwise, false. - - - - - Encapsulates information for handling an error thrown by an action method. - - - - - Initializes a new instance of the class. - - The exception. - Name of the controller. - The name of the action. - - - - Gets the name of the action. - - The name of the action. - - - - Gets the name of the controller. - - The name of the controller. - - - - Gets the exception. - - The exception. - - - - Represents support for HTML links in an application. - - - - - Returns an anchor tag containing the virtual path to the specified action. - - The HTML helper. - The inner text of the anchor tag. - The name of the action. - An anchor tag. - - - - Returns an anchor tag containing the virtual path to the specified action. - - The HTML helper. - The inner text of the anchor tag. - The name of the action. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An anchor tag. - - - - Returns an anchor tag containing the virtual path to the specified action. - - The HTML helper. - The inner text of the anchor tag. - The name of the action. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An anchor tag. - - - - Returns an anchor tag containing the virtual path to the specified action. - - The HTML helper. - The inner text of the anchor tag. - The name of the action. - An object containing the parameters for a route. - An anchor tag. - - - - Returns an anchor tag containing the virtual path to the specified action. - - The HTML helper. - The inner text of the anchor tag. - The name of the action. - An object containing the parameters for a route. - An object containing the HTML attributes for the element. - An anchor tag. - - - - Returns an anchor tag containing the virtual path to the specified action. - - The HTML helper. - The inner text of the anchor tag. - The name of the action. - The name of the controller. - An anchor tag. - - - - Returns an anchor tag containing the virtual path to the specified action. - - The HTML helper. - The inner text of the anchor tag. - The name of the action. - The name of the controller. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An anchor tag. - - - - Returns an anchor tag containing the virtual path to the specified action. - - The HTML helper. - The inner text of the anchor tag. - The name of the action. - The name of the controller. - An object containing the parameters for a route. - An object containing the HTML attributes for the element. - An anchor tag. - - - - Returns an anchor tag containing the URL to the specified action. - - The HTML helper. - The inner text of the anchor tag. - The name of the action. - The name of the controller. - The protocol for the URL such as "http" or "https". - The host name for the URL. - The URL fragment name (also known as anchor name). - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An anchor tag. - - - - Returns an anchor tag containing the URL to the specified action. - - The HTML helper. - The inner text of the anchor tag. - The name of the action. - The name of the controller. - The protocol for the URL such as "http" or "https". - The host name for the URL. - The URL fragment name (also known as anchor name). - An object containing the parameters for a route. - An object containing the HTML attributes for the element. - An anchor tag. - - - - Returns an anchor tag containing the virtual path for the specified route values. - - The HTML helper. - The inner text of the anchor tag. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An anchor tag. - - - - Returns an anchor tag containing the virtual path for the specified route values. - - The HTML helper. - The inner text of the anchor tag. - An object containing the parameters for a route. - An anchor tag. - - - - Returns an anchor tag containing the virtual path for the specified route values. - - The HTML helper. - The inner text of the anchor tag. - The name of the route used to return a virtual path. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An anchor tag. - - - - Returns an anchor tag containing the virtual path for the specified route values. - - The HTML helper. - The inner text of the anchor tag. - The name of the route used to return a virtual path. - An object containing the parameters for a route. - An anchor tag. - - - - Returns an anchor tag containing the virtual path for the specified route values. - - The HTML helper. - The inner text of the anchor tag. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An anchor tag. - - - - Returns an anchor tag containing the virtual path for the specified route values. - - The HTML helper. - The inner text of the anchor tag. - An object containing the parameters for a route. - An object containing the HTML attributes for the element. - An anchor tag. - - - - Returns an anchor tag containing the virtual path for the specified route values. - - The HTML helper. - The inner text of the anchor tag. - The name of the route used to return a virtual path. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An anchor tag. - - - - Returns an anchor tag containing the virtual path for the specified route values. - - The HTML helper. - The inner text of the anchor tag. - The name of the route used to return a virtual path. - An object containing the parameters for a route. - An object containing the HTML attributes for the element. - An anchor tag. - - - - Returns an anchor tag containing the URL for the specified route values. - - The HTML helper. - The inner text of the anchor tag. - The name of the route used to return a virtual path. - The protocol for the URL such as "http" or "https". - The host name for the URL. - The URL fragment name (also known as anchor name). - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An anchor tag. - - - - Returns an anchor tag containing the URL for the specified route values. - - The HTML helper. - The inner text of the anchor tag. - The name of the route used to return a virtual path. - The protocol for the URL such as "http" or "https". - The host name for the URL. - The URL fragment name (also known as anchor name). - An object containing the parameters for a route. - An object containing the HTML attributes for the element. - An anchor tag. - - - - Represents support for HTML text area controls. - - - - - Returns a text area tag. - - The HTML helper. - The name. - The text area. - - - - Returns a text area tag. - - The HTML helper. - The name. - The HTML attributes. - The text area. - - - - Returns a text area tag. - - The HTML helper. - The name. - The HTML attributes. - The text area. - - - - Returns a text area tag. - - The HTML helper. - The name. - The value. - The text area. - - - - Returns a text area tag. - - The HTML helper. - The name. - The value. - The HTML attributes. - The text area. - - - - Returns a text area tag. - - The HTML helper. - The name. - The value. - The HTML attributes. - The text area. - - - - Returns a text area tag. - - The HTML helper. - The name. - The value. - The rows. - The columns. - The HTML attributes. - The text area. - - - - Returns a text area tag. - - The HTML helper. - The name. - The value. - The rows. - The columns. - The HTML attributes. - The text area. - - - - Sends the contents of a file to the response. - - - - - Initializes an instance of with the specified file name and content type. - - The name of the file to send to the response. - The content type of the response. - - - - Writes the file. - - The response. - - - - The path to the file which is sent to the response. - - The name of the file. - - - - Attribute used to mark action methods whose input needs to be validated. - - - - - Initializes a new instance of the class. - - if set to true [enable validation]. - - - - Called when authorization is required. - - The filter context. - - - - Gets a value indicating whether [enable validation]. - - true if [enable validation]; otherwise, false. - - - - Represents a collection of objects. - - - - - Initializes a new instance of the class. - - The controller context. - - - - Adds an item to the . - - The object to add to the . - - The is read-only. - - - - - Adds an element with the provided key and value to the . - - The object to use as the key of the element to add. - The object to use as the value of the element to add. - - is null. - - - An element with the same key already exists in the . - - - The is read-only. - - - - - Adds a key/value pair to the dictionary if it is not already present. - - The key. - The result. - - - - Removes all items from the . - - - The is read-only. - - - - - Determines whether the contains a specific value. - - The object to locate in the . - - true if is found in the ; otherwise, false. - - - - - Determines whether the contains an element with the specified key. - - The key to locate in the . - - true if the contains an element with the key; otherwise, false. - - - is null. - - - - - Copies the elements of the to an , starting at a particular index. - - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in at which copying begins. - - is null. - - - is less than 0. - - - is multidimensional. - -or- - is equal to or greater than the length of . - -or- - The number of elements in the source is greater than the available space from to the end of the destination . - -or- - Type cannot be cast automatically to the type of the destination . - - - - - Returns an enumerator that iterates through the collection. - - - A that can be used to iterate through the collection. - - - - - Removes the first occurrence of a specific object from the . - - The object to remove from the . - - true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . - - - The is read-only. - - - - - Removes the element with the specified key from the . - - The key of the element to remove. - - true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the original . - - - is null. - - - The is read-only. - - - - - Gets the value associated with the specified key. - - The key whose value to get. - When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the parameter. This parameter is passed uninitialized. - - true if the object that implements contains an element with the specified key; otherwise, false. - - - is null. - - - - - Returns an enumerator that iterates through a collection. - - - An object that can be used to iterate through the collection. - - - - - Gets the controller context. - - The controller context. - - - - Gets the number of elements contained in the . - - - - The number of elements contained in the . - - - - - Gets the dictionary. - - The dictionary. - - - - Gets a value indicating whether the is read-only. - - - true if the is read-only; otherwise, false. - - - - - Gets an containing the keys of the . - - - - An containing the keys of the object that implements . - - - - - Gets or sets the with the specified key. - - - - - - Gets an containing the values in the . - - - - An containing the values in the object that implements . - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The current request for action '{0}' on controller type '{1}' is ambiguous between the following action methods:{2}. - - - - - Looks up a localized string similar to {0} on type {1}. - - - - - Looks up a localized string similar to No route in the route table matches the supplied values. - - - - - Looks up a localized string similar to A required anti-forgery token was not supplied or was invalid. - - - - - Looks up a localized string similar to The value '{0}' is outside the valid range of the enumeration type '{1}'. - - - - - Looks up a localized string similar to Value cannot be null or empty. - - - - - Looks up a localized string similar to The partial view '{0}' could not be found. The following locations were searched:{1}. - - - - - Looks up a localized string similar to The property '{0}' cannot be null or empty. - - - - - Looks up a localized string similar to The value '{0}' is invalid. - - - - - Looks up a localized string similar to The view '{0}' or its master could not be found. The following locations were searched:{1}. - - - - - Looks up a localized string similar to A public action method '{0}' could not be found on controller '{1}'. - - - - - Looks up a localized string similar to The model of type '{0}' was not successfully updated. - - - - - Looks up a localized string similar to There was an error creating the IControllerFactory '{0}'. Check that it has a public parameterless constructor. - - - - - Looks up a localized string similar to The IControllerFactory '{0}' did not return a controller for a controller named '{1}'. - - - - - Looks up a localized string similar to The controller factory type '{0}' must implement the IControllerFactory interface. - - - - - Looks up a localized string similar to The controller name '{0}' is ambiguous between the following types:{1}. - - - - - Looks up a localized string similar to An error occurred while creating a controller of type '{0}'. If the controller doesn't have a controller factory, ensure that it has a parameterless public constructor. - - - - - Looks up a localized string similar to The controller for path '{0}' could not be found or it does not implement IController. - - - - - Looks up a localized string similar to The controller type '{0}' must implement IController. - - - - - Looks up a localized string similar to A value is required. - - - - - Looks up a localized string similar to The total number of ticks for the TimeSpan must be greater than 0. - - - - - Looks up a localized string similar to The type '{0}' does not inherit from Exception. - - - - - Looks up a localized string similar to Order must be greater than or equal to -1. - - - - - Looks up a localized string similar to There is no ViewData item with the key '{0}' of type '{1}'. - - - - - Looks up a localized string similar to The value must be greater than or equal to zero. - - - - - Looks up a localized string similar to The ViewData item with the key '{0}' is of type '{1}' but needs to be of type '{2}'. - - - - - Looks up a localized string similar to There was an error creating the IModelBinder '{0}'. Check that it has a public parameterless constructor. - - - - - Looks up a localized string similar to The type '{0}' does not implement the IModelBinder interface. - - - - - Looks up a localized string similar to The type '{0}' contains multiple attributes inheriting from CustomModelBinderAttribute. - - - - - Looks up a localized string similar to Cannot create a descriptor for instance method '{0}' on type '{1}' since the type does not subclass ControllerBase. - - - - - Looks up a localized string similar to Cannot call action method '{0}' on controller '{1}' since the parameter '{2}' is passed by reference. - - - - - Looks up a localized string similar to Cannot call action method '{0}' on controller '{1}' since it is a generic method. - - - - - Looks up a localized string similar to The parameters dictionary contains a null entry for parameter '{0}' of non-nullable type '{1}' for method '{2}' in '{3}'. To make a parameter optional its type should be either a reference type or a Nullable type. - - - - - Looks up a localized string similar to The parameters dictionary does not contain an entry for parameter '{0}' of type '{1}' for method '{2}' in '{3}'. The dictionary must contain an entry for each parameter, even parameters with null values. - - - - - Looks up a localized string similar to The parameters dictionary contains an invalid entry for parameter '{0}' for method '{1}' in '{2}'. The dictionary contains a value of type '{3}', but the parameter requires a value of type '{4}'. - - - - - Looks up a localized string similar to The parameter '{0}' on method '{1}' contains multiple attributes inheriting from CustomModelBinderAttribute. - - - - - Looks up a localized string similar to The SessionStateTempDataProvider requires SessionState to be enabled. - - - - - Looks up a localized string similar to The parameter conversion from type '{0}' to type '{1}' failed. See the inner exception for more information. - - - - - Looks up a localized string similar to The parameter conversion from type '{0}' to type '{1}' failed because no TypeConverter can convert between these types. - - - - - Looks up a localized string similar to The model item passed into the dictionary is of type '{0}' but this dictionary requires a model item of type '{1}'. - - - - - Looks up a localized string similar to A ViewMasterPage can only be used with content pages that derive from ViewPage or ViewPage<TViewItem>. - - - - - Looks up a localized string similar to The ViewUserControl '{0}' cannot find an IViewDataContainer. The ViewUserControl must be inside a ViewPage, ViewMasterPage, or another ViewUserControl. - - - - - Looks up a localized string similar to A ViewUserControl can only be used inside pages that derive from ViewPage or ViewPage<TViewItem>. - - - - - Looks up a localized string similar to A master name cannot be specified when the view is a ViewUserControl. - - - - - Looks up a localized string similar to The view found at '{0}' could not be created. - - - - - Looks up a localized string similar to The view at '{0}' must derive from ViewPage, ViewPage<TViewData>, ViewUserControl, or ViewUserControl<TViewData>. - - - - - Represents the result of an unauthorized HTTP request. - - - - - Enables processing of the result of an action method by a custom type that inherits from . - - The context within which the result is executed. - - - - Enumerates the HTTP verbs. - - - - - The GET method retrieves the information or entity that is identified by the URI of the Request. - - - - - The POST method is used to post a new entity as an addition to a URI. - - - - - The PUT method is used to replace an entity identified by a URI. - - - - - The DELETE method requests that a specified URI be deleted. - - - - - The HEAD method is identical to GET except that the server only returns message-headers in the response, without a message-body. - - - - - Delegate that contains the logic for selecting a action method. - - - - - Adds the ability to determine if a specified HTTP request is an AJAX request. - - - - - Determines whether the specified HTTP request is an AJAX request. - - The request. - - true if the specified HTTP request is an AJAX request; otherwise, false. - - - - - Provides the context for using the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The controller context. - The exception. - - - - Gets or sets the exception. - - The exception. - - - - Gets or sets a value indicating whether has been exception handled. - - true if has been exception handled; otherwise, false. - - - - Gets or sets the result. - - The result. - - - - Represents the information needed to build a strongly typed master view page. - - The type of the model. - - - - Gets the ajax. - - The ajax. - - - - Gets the HTML. - - The HTML. - - - - Gets the model. - - The model. - - - - Gets the view data. - - The view data. - - - - Represents a memory cache for view locations. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The time span. - - - - Creates an empty view location cache. - - - - - Gets the view location. - - The HTTP context. - The key. - The view location. - - - - Inserts the view location. - - The HTTP context. - The key. - The virtual path. - - - - Gets the time span. - - The time span. - - - - Represents option settings running AJAX scripts in an MVC application. - - - - - Gets or sets the junction to call for a confirmation. - - The the junction to call for a confirmation. - - - - Gets or sets the HTTP method. - - The HTTP method. - - - - Gets or sets the insertion mode. - - The insertion mode. - - - - Gets or sets the loading element id. - - The loading element id. - - - - Gets or sets the function to call on begin. - - The function to call on begin. - - - - Gets or sets the function to call on complete. - - The function to call on complete. - - - - Gets or sets the function to call on failure. - - The function to call on failure. - - - - Gets or sets the function to call on success. - - The function to call on success. - - - - Gets or sets the update target id. - - The update target id. - - - - Gets or sets the URL. - - The URL. - - - - Responsible for executing a specified action method. - - - - - Initializes a new instance of the class. - - The method info. - - - - Executes the specified action method. - - The controller. - The parameters. - The result. - - - - Gets the method information. - - The method information. - - - - Provides the context for the ResultExecuted method of an . - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The controller context. - The result. - if set to true [canceled]. - The exception. - - - - Gets or sets a value indicating whether this is canceled. - - true if canceled; otherwise, false. - - - - Gets or sets the exception. - - The exception. - - - - Gets or sets a value indicating whether [exception handled]. - - true if [exception handled]; otherwise, false. - - - - Gets or sets the action result. - - The action result. - - - - Responsible for invoking the action methods of a controller. - - - - - Defines the contract for an action invoker, used to invoke an action in response to an HTTP request. - - - - - Invokes the specified action. - - The controller context. - The name of the action. - - true if the action was found, otherwise false. - - - - - Creates the action result. - - The controller context. - The action descriptor. - The action return value. - The action result object. - - - - Gets the controller descriptor. - - The controller context. - The controller descriptor. - - - - Finds the action descriptor. - - The controller context. - The controller descriptor. - The name of the action. - The action descriptor object. - - - - Gets the filters. - - The controller context. - The action descriptor. - The filter information object. - - - - Gets the parameter value. - - The controller context. - The parameter descriptor. - The parameter value. - - - - Gets the parameter values. - - The controller context. - The action descriptor. - The parameter values. - - - - Invokes the specified action. - - The controller context. - The name of the action. - - - - - Invokes the action method. - - The controller context. - The action descriptor. - The parameters. - The result of the executing the action method. - - - - Invokes the action method with filters. - - The controller context. - The filters. - The action descriptor. - The parameters. - The the context for the ActionExecuted method of an . - - - - Invokes the action result. - - The controller context. - The action result. - - - - Invokes the action result with filters. - - The controller context. - The filters. - The action result. - The the context for the ResultExecuted method of an . - - - - Invokes the authorization filters. - - The controller context. - The filters. - The action descriptor. - The context for an . - - - - Invokes the exception filters. - - The controller context. - The filters. - The exception. - The context for an . - - - - Gets or sets the model binders. - - The model binders. - - - - Represents an error in model binding. - - - - - Initializes a new instance of the class. - - The exception. - - - - Initializes a new instance of the class. - - The exception. - The error message. - - - - Initializes a new instance of the class. - - The error message. - - - - Gets the exception. - - The exception. - - - - Gets the error message. - - The error message. - - - - Enumerates the modes available for rendering HTML tags. - - - - - Normal mode. - - - - - Start tag mode. - - - - - End tag mode. - - - - - Self-closing tag mode. - - - - - Represents the result of locating a view engine. - - - - - Initializes a new instance of the class. - - The searched locations. - - - - Initializes a new instance of the class. - - The view. - The view engine. - - - - Gets searched locations. - - The searched locations. - - - - Gets the view. - - The view. - - - - Gets the view engine. - - The view engine. - - - - Contains a set of methods for working with MVC routes. - - - - - Initializes a new instance of the class. - - An object that contains information about the current request and the defined route it matched. - - - - Initializes a new instance of the class. - - An object that contains information about the current request and the defined route it matched. - A collection of Route instances. - - - - Returns a virtual path for the specified route values. - - The name of the action. - The virtual path to the action. - - - - Returns a virtual path URL for the specified route values. - - The name of the action. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - The virtual path to the action. - - - - Returns a virtual path for the specified route values. - - The name of the action. - An object containing the parameters for a route. - The virtual path to the action. - - - - Returns a virtual path for the specified route values. - - The name of the action. - The name of the controller. - The virtual path to the action. - - - - Returns a virtual path for the specified route values. - - The name of the action. - The name of the controller. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - The virtual path to the action. - - - - Returns a virtual path for the specified route values. - - The name of the action. - The name of the controller. - An object containing the parameters for a route. - The virtual path to the action. - - - - Returns a fully qualified URL for the specified route values. - - The name of the action. - The name of the controller. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - The protocol for the URL such as "http" or "https". - The URL to the action. - - - - Returns a fully qualified URL for the specified route values. - - The name of the action. - The name of the controller. - An object containing the parameters for a route. - The protocol for the URL such as "http" or "https". - The host name for the URL. - The URL to the action. - - - - Converts a virtual path to an application absolute path. - - The virtual path to the content. - The application absolute path. - - If the specified does not start with the tilde [~] character, - then this method returns the specified unchanged. - - - - - Encodes a URL string. - - The text to encode. - An encoded string. - - - - Returns a virtual path for the specified route values. - - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - A virtual path. - - - - Returns a virtual path for the specified route values. - - An object containing the parameters for a route. - A virtual path. - - - - Returns a virtual path for the specified route values. - - The name of the route used to return a virtual path. - A virtual path. - - - - Returns a virtual path for the specified route values. - - The name of the route used to return a virtual path. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - A virtual path. - - - - Returns a virtual path for the specified route values. - - The name of the route used to return a virtual path. - An object containing the parameters for a route. - A virtual path. - - - - Returns a fully qualified URL for the specified route values. - - The name of the route used to return a virtual path. - An object containing the parameters for a route. The parameters are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - The protocol for the URL such as "http" or "https". - A virtual path. - - - - Returns a fully qualified URL for the specified route values. - - The name of the route used to generate the virtual path. - An object containing the parameters for a route. - The protocol for the URL such as "http" or "https". - The host name for the URL. - The virtual path to the action. - - - - Encapsulates information about an HTTP request that matches a defined route. - - The request context. - - - - A collection containing the routes registered for the application. - - The route collection. - - - - Represents a result that performs a redirection given a specified URI. - - - - - Initializes a new instance of the class. - - The URL. - - - - Enables processing of the result of an action method by a custom type that inherits from . - - The context within which the result is executed. - - - - Gets the URL. - - The URL. - - - - Enumerates the types of input controls. - - - - - A check box. - - - - - A hidden field. - - - - - A password box. - - - - - A radio button. - - - - - A text box. - - - - - Represents the information needed to build a strongly typed user control. - - The type of the model. - - - - Represents the information needed to build a user control. - - - - - Sets the view data. - - The view data. - - - - Ensures the view data. - - - - - Renders the view. - - The view context. - - - - Gets the ajax. - - The ajax. - - - - Gets the HTML. - - The HTML. - - - - Gets the model. - - The model. - - - - Gets the temp data. - - The temp data. - - - - Gets the URL. - - The URL. - - - - Gets or sets the view context. - - The view context. - - - - Gets or sets the view data. - - The view data. - - - - Gets or sets the view data key. - - The view data key. - - - - Gets the writer. - - The writer. - - - - Sets the view data. - - The view data. - - - - Gets the ajax. - - The ajax. - - - - Gets the HTML. - - The HTML. - - - - Gets the model. - - The model. - - - - Gets or sets the view data. - - The view data. - - - - Class used by the HTML helpers to build HTML tags. - - - - - Initializes a new instance of the class. - - Name of the tag. - - - - Adds the CSS class. - - The value. - - - - Generates the id. - - The name. - - - - Merges the attribute. - - The key. - The value. - - - - Merges the attribute. - - The key. - The value. - if set to true [replace existing]. - - - - Merges the attributes. - - The type of the key. - The type of the value. - The attributes. - - - - Merges the attributes. - - The type of the key. - The type of the value. - The attributes. - if set to true [replace existing]. - - - - Sets the inner text. - - The inner text. - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Toes the string. - - The render mode. - - - - - Gets the attributes. - - The attributes. - - - - Gets or sets the id attribute dot replacement. - - The id attribute dot replacement. - - - - Gets or sets the inner HTML. - - The inner HTML. - - - - Gets the name of the tag. - - The name of the tag. - - - - Represents a result that performs a redirection given a route values dictionary. - - - - - Initializes a new instance of the class. - - The route values. - - - - Initializes a new instance of the class. - - Name of the route. - The route values. - - - - Enables processing of the result of an action method by a custom type that inherits from . - - The context within which the result is executed. - - - - Gets the name of the route. - - The name of the route. - - - - Gets the route values. - - The route values. - - - - Responsible for dynamically building a controller. - - - - - Initializes a new instance of the class. - - - - - Gets the controller factory. - - The controller factory. - - - - Sets the controller factory. - - The controller factory. - - - - Sets the controller factory. - - Type of the controller factory. - - - - Gets the current controller builder object. - - The current controller builder. - - - - Gets the default namespaces. - - The default namespaces. - - - - Represents support for HTML input controls in an application. - - - - - Returns the input tag for a checkbox. - - The HTML helper. - The form field name. - - An input tag with the type set to "checkbox". - - - - - Returns the input tag for a checkbox. - - The HTML helper. - The form field name. - A boolean indicating whether or not the checkbox is checked. - - An input tag with the type set to "checkbox". - - - - - Returns the input tag for a checkbox. - - The HTML helper. - The form field name. - A boolean indicating whether or not the checkbox is checked. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - - An input tag with the type set to "checkbox". - - - - - Returns the input tag for a checkbox. - - The HTML helper. - The form field name. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - - An input tag with the type set to "checkbox". - - - - - Returns the input tag for a checkbox. - - The HTML helper. - The form field name. - An object containing the HTML attributes for the element. - - An input tag with the type set to "checkbox". - - - - - Returns the input tag for a checkbox. - - The HTML helper. - The form field name. - A boolean indicating whether or not the checkbox is checked. - An object containing the HTML attributes for the element. - - An input tag with the type set to "checkbox". - - - - - Returns a hidden input tag. - - The HTML helper. - The form field name and ViewData key used to look up the value. - - An input tag with the type set to "hidden". - - - - - Returns a hidden input tag. - - The HTML helper. - The form field name and ViewData key used to look up the value. - The value of the hidden input. If null, looks at the ViewData and then ModelStatefor the value. - - An input tag with the type set to "hidden". - - - - - Returns a hidden input tag. - - The HTML helper. - The form field name and ViewData key used to look up the value. - The value of the hidden input. If null, looks at the ViewData and then ModelStatefor the value. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - - An input tag with the type set to "hidden". - - - - - Returns a hidden input tag. - - The HTML helper. - The form field name and ViewData key used to look up the value. - The value of the hidden input. If null, looks at the ViewData and then ModelStatefor the value. - An object containing the HTML attributes for the element. - - An input tag with the type set to "hidden". - - - - - Returns a password tag. - - The HTML helper. - The form field name and ViewData key used to look up the value. - - An input tag with the type set to "password". - - - - - Returns a password tag. - - The HTML helper. - The form field name and ViewData key used to look up the value. - The value of the input. If null, looks at the ViewData and then ModelStatefor the value. - - An input tag with the type set to "password". - - - - - Returns a password tag. - - The HTML helper. - The form field name and ViewData key used to look up the value. - The value of the input. If null, looks at the ViewData and then ModelStatefor the value. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - - An input tag with the type set to "password". - - - - - Returns a password tag. - - The HTML helper. - The form field name and ViewData key used to look up the value. - The value of the input. If null, looks at the ViewData and then ModelStatefor the value. - An object containing the HTML attributes for the element. - - An input tag with the type set to "password". - - - - - Returns a radio button tag used to present one possible value, out of a range, for a form field specified by the name. - - The HTML helper. - The form field name and ViewData key used to look up the current value. - If checked, the value of the radio button submitted when the form is posted. If the value in ViewData or ModelState matches this value, the radio button is checked. - - An input tag with the type set to "radio". - - - - - Returns a radio button tag used to present one possible value, out of a range, for a form field specified by the name. - - The HTML helper. - The form field name and ViewData key used to look up the current value. - If checked, the value of the radio button submitted when the form is posted. If the value in ViewData or ModelState matches this value, the radio button is checked. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - - An input tag with the type set to "radio". - - - - - Returns a radio button tag used to present one possible value, out of a range, for a form field specified by the name. - - The HTML helper. - The form field name and ViewData key used to look up the current value. - If checked, the value of the radio button submitted when the form is posted. If the value in ViewData or ModelState matches this value, the radio button is checked. - An object containing the HTML attributes for the element. - - An input tag with the type set to "radio". - - - - - Returns a radio button tag used to present one possible value, out of a range, for a form field specified by the name. - - The HTML helper. - The form field name and ViewData key used to look up the current value. - If checked, the value of the radio button submitted when the form is posted. If the value in ViewData or ModelState matches this value, the radio button is checked. - Whether or not the radio button is checked. - - An input tag with the type set to "radio". - - - - - Returns a radio button tag used to present one possible value, out of a range, for a form field specified by the name. - - The HTML helper. - The form field name and ViewData key used to look up the current value. - If checked, the value of the radio button submitted when the form is posted. If the value in ViewData or ModelState matches this value, the radio button is checked. - Whether or not the radio button is checked. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - - An input tag with the type set to "radio". - - - - - Returns a radio button tag used to present one possible value, out of a range, for a form field specified by the name. - - The HTML helper. - The form field name and ViewData key used to look up the current value. - If checked, the value of the radio button submitted when the form is posted. If the value in ViewData or ModelState matches this value, the radio button is checked. - Whether or not the radio button is checked. - An object containing the HTML attributes for the element. - - An input tag with the type set to "radio". - - - - - Returns a text input tag. - - The HTML helper. - The form field name and ViewData key used to look up the value. - An input tag with the type set to "text". - - - - Returns a text input tag. - - The HTML helper. - The form field name and ViewData key used to look up the value. - The value of the input. If null, looks at the ViewData and then ModelStatefor the value. - An input tag with the type set to "text". - - - - Returns a text input tag. - - The HTML helper. - The form field name and ViewData key used to look up the value. - The value of the input. If null, looks at the ViewData and then ModelStatefor the value. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - An input tag with the type set to "text". - - - - Returns a text input tag. - - The HTML helper. - The form field name and ViewData key used to look up the value. - The value of the input. If null, looks at the ViewData and then ModelStatefor the value. - An object containing the HTML attributes for the element. - An input tag with the type set to "text". - - - - Contains the Form value providers for the application. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The collection. - - - - Returns a dictionary of value providers. - - A dictionary of value providers. - - - - Gets the value provider. - - The name of the value provider. - The value provider. - - - - Encapsulates information related to rendering a view. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The controller context. - The view. - The view data. - The temp data. - - - - Gets the to render. - - The view. - - - - Gets the view data supplied to the view. - - The view data. - - - - Gets data associated with this request which only lives for one request. - - The temp data. - - - - Contains all model binders for the application listed by binder type. - - - - - Adds an item to the . - - The object to add to the . - - The is read-only. - - - - - Adds an element with the provided key and value to the . - - The object to use as the key of the element to add. - The object to use as the value of the element to add. - - is null. - - - An element with the same key already exists in the . - - - The is read-only. - - - - - Removes all items from the . - - - The is read-only. - - - - - Determines whether the contains a specific value. - - The object to locate in the . - - true if is found in the ; otherwise, false. - - - - - Determines whether the contains an element with the specified key. - - The key to locate in the . - - true if the contains an element with the key; otherwise, false. - - - is null. - - - - - Copies the elements of the to an , starting at a particular index. - - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in at which copying begins. - - is null. - - - is less than 0. - - - is multidimensional. - -or- - is equal to or greater than the length of . - -or- - The number of elements in the source is greater than the available space from to the end of the destination . - -or- - Type cannot be cast automatically to the type of the destination . - - - - - Gets the model binder. - - Type of the model. - The model binder. - - - - Gets the model binder. - - Type of the model. - if set to true [fallback to default]. - The model binder. - - - - Returns an enumerator that iterates through the collection. - - - A that can be used to iterate through the collection. - - - - - Removes the first occurrence of a specific object from the . - - The object to remove from the . - - true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . - - - The is read-only. - - - - - Removes the element with the specified key from the . - - The key of the element to remove. - - true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the original . - - - is null. - - - The is read-only. - - - - - Gets the value associated with the specified key. - - The key whose value to get. - When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the parameter. This parameter is passed uninitialized. - - true if the object that implements contains an element with the specified key; otherwise, false. - - - is null. - - - - - Returns an enumerator that iterates through a collection. - - - An object that can be used to iterate through the collection. - - - - - Gets the number of elements contained in the . - - - - The number of elements contained in the . - - - - - Gets or sets the default binder. - - The default binder. - - - - Gets a value indicating whether the is read-only. - - - true if the is read-only; otherwise, false. - - - - - Gets an containing the keys of the . - - - - An containing the keys of the object that implements . - - - - - Gets or sets the with the specified key. - - - - - - Gets an containing the values in the . - - - - An containing the values in the object that implements . - - - - - Provides the context for the ResultExecuting method of an . - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The controller context. - The result. - - - - Gets or sets a value indicating whether this is cancel. - - true if cancel; otherwise, false. - - - - Gets or sets the action result. - - The action result. - - - - Collection of view engines available to the application. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The list that is wrapped by the new collection. - - is null. - - - - - Inserts an element into the at the specified index. - - The zero-based index at which should be inserted. - The object to insert. The value can be null for reference types. - - is less than zero. - -or- - is greater than . - - - - - Replaces the element at the specified index. - - The zero-based index of the element to replace. - The new value for the element at the specified index. The value can be null for reference types. - - is less than zero. - -or- - is greater than . - - - - - Finds the partial view. - - The controller context. - Name of the partial view. - The partial view. - - - - Finds the view. - - The controller context. - Name of the view. - Name of the master. - The view. - - - - Represents a list on which one item can be selected. - - - - - Initializes a new instance of the class. - - The items. - - - - Initializes a new instance of the class. - - The items. - The selected value. - - - - Initializes a new instance of the class. - - The items. - The data value field. - The data text field. - - - - Initializes a new instance of the class. - - The items. - The data value field. - The data text field. - The selected value. - - - - Gets the selected value. - - The selected value. - - - - Extends a RouteCollection object. - - - - - Ignores the route. - - The routes. - The URL. - - - - Ignores the route. - - The routes. - The URL. - The constraints. - - - - Maps the route. - - The routes. - The name. - The URL. - - - - - Maps the route. - - The routes. - The name. - The URL. - The defaults. - - - - - Maps the route. - - The routes. - The name. - The URL. - The defaults. - The constraints. - - - - - Maps the route. - - The routes. - The name. - The URL. - The namespaces. - - - - - Maps the route. - - The routes. - The name. - The URL. - The defaults. - The namespaces. - - - - - Maps the route. - - The routes. - The name. - The URL. - The defaults. - The constraints. - The namespaces. - - - - - Encapsulates the state of model binding to a property of an argument, or the argument itself, of an action method. - - - - - Returns a which encapsulates the value which was attempted to be bound by model binding. - - The value. - - - - Returns a containing any errors that occurred during model binding. - - The errors. - - - - Provides global access to the model binders for the application. - - - - - Gets the model binders. - - The model binders. - - - - Represents support for validating the input from an HTML form. - - - - - Displays a validation message if the specified field contains an error in the ModelState. - - The HTML helper. - The name of the property or model object being validated. - - An empty string if valid, otherwise a span with an error message. - - - - - Displays a validation message if the specified field contains an error in the ModelState. - - The HTML helper. - The name of the property or model object being validated. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - - An empty string if valid, otherwise a span with an error message. - - - - - Displays a validation message if the specified field contains an error in the ModelState. - - The HTML helper. - The name of the property or model object being validated. - The message to display if the specified field is in error. - - An empty string if valid, otherwise a span with an error message. - - - - - Displays a validation message if the specified field contains an error in the ModelState. - - The HTML helper. - The name of the property or model object being validated. - The message to display if the specified field is in error. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - - An empty string if valid, otherwise a span with an error message. - - - - - Displays a validation message if the specified field contains an error in the ModelState. - - The HTML helper. - The name of the property or model object being validated. - An object containing the HTML attributes for the element. - - An empty string if valid, otherwise a span with an error message. - - - - - Displays a validation message if the specified field contains an error in the ModelState. - - The HTML helper. - The name of the property or model object being validated. - The message to display if the specified field is in error. - An object containing the HTML attributes for the element. - - An empty string if valid, otherwise a span with an error message. - - - - - Returns an unordered list [ul] of validation messages within the ModelState. - - The HTML helper. - - - - - Returns an unordered list [ul] of validation messages within the ModelState. - - The HTML helper. - The message to display if the specified field is in error. - - - - - Returns an unordered list [ul] of validation messages within the ModelState. - - The HTML helper. - The message to display if the specified field is in error. - An object containing the HTML attributes for the element. The attributes are retrieved via reflection by examining the properties of the object. Typically created using object initializer syntax. - - - - - Returns an unordered list [ul] of validation messages within the ModelState. - - The HTML helper. - The message to display if the specified field is in error. - An object containing the HTML attributes for the element. - - - - - The name of the resource class used to localize validation messages. - - - - - Represents the result of an attempt to bind a supplied value (from a form post, query string, etc) to - a property of an argument to an action method or to the argument itself. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified - raw value, attempted value, and . - - The raw value. - The attempted value. - The culture. - - - - Converts the value encapsulated by this result to the specified type. - - The target type. - The converted value. - - - - Converts the value encapsulated by this result to the specified type. - - The target type. - The culture to use in the conversion. - The converted value. - - - - The raw value converted to a string for display purposes. - - The attempted value. - - - - Gets or sets the culture. - - The culture. - - - - The raw value supplied by the value provider. - - The raw value. - - - - Provides the context within which a model binder functions. - - - - - Gets or sets a value indicating whether [fallback to empty prefix]. - - - true if [fallback to empty prefix]; otherwise, false. - - - - - Gets or sets the model. - - The model. - - - - Gets or sets the name of the model. - - The name of the model. - - - - Gets or sets the state of the model. - - The state of the model. - - - - Gets or sets the type of the model. - - The type of the model. - - - - Gets or sets the property filter. - - The property filter. - - - - Gets or sets the value provider. - - The value provider. - - - - Caches a sequence of calls to action methods. - - - - - Initializes a new instance of the class. - - - - - Gets the dispatcher. - - The method info. - A reference to the action method dispatcher. - - - - When applied to an action method, restricts access of callers to the action method. - - - - - Authorizes the core. - - The HTTP context. - true if authorized; otherwise, false. - - - - Called when [authorization]. - - The filter context. - - - - Called when the caching module requests authorization. - - The HTTP context. - A refernce to the validation status. - - - - Gets or sets the roles. - - The roles. - - - - Gets or sets the users. - - The users. - - - diff --git a/aspclassiccompiler/Parser/AssemblyInfo.vb b/aspclassiccompiler/Parser/AssemblyInfo.vb new file mode 100644 index 0000000..b3b49e2 --- /dev/null +++ b/aspclassiccompiler/Parser/AssemblyInfo.vb @@ -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 + + + + + + + + + + + + \ No newline at end of file diff --git a/aspclassiccompiler/Parser/ExternalChecksum.vb b/aspclassiccompiler/Parser/ExternalChecksum.vb new file mode 100644 index 0000000..c04f57a --- /dev/null +++ b/aspclassiccompiler/Parser/ExternalChecksum.vb @@ -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. +' + +''' +''' An external checksum for a file. +''' +Public NotInheritable Class ExternalChecksum + Private ReadOnly _Filename As String + Private ReadOnly _Guid As String + Private ReadOnly _Checksum As String + + ''' + ''' The filename that the checksum is for. + ''' + Public ReadOnly Property Filename() As String + Get + Return _Filename + End Get + End Property + + ''' + ''' The guid of the file. + ''' + Public ReadOnly Property Guid() As String + Get + Return _Guid + End Get + End Property + + ''' + ''' The checksum for the file. + ''' + Public ReadOnly Property Checksum() As String + Get + Return _Checksum + End Get + End Property + + ''' + ''' Constructs a new external checksum. + ''' + ''' The filename that the checksum is for. + ''' The guid of the file. + ''' The checksum for the file. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/ExternalLineMapping.vb b/aspclassiccompiler/Parser/ExternalLineMapping.vb new file mode 100644 index 0000000..5e73ce0 --- /dev/null +++ b/aspclassiccompiler/Parser/ExternalLineMapping.vb @@ -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. +' + +''' +''' A line mapping from a source span to an external file and line. +''' +Public NotInheritable Class ExternalLineMapping + Private ReadOnly _Start, _Finish As Location + Private ReadOnly _File As String + Private ReadOnly _Line As Long + + ''' + ''' The start location of the mapping in the source. + ''' + Public ReadOnly Property Start() As Location + Get + Return _Start + End Get + End Property + + ''' + ''' The end location of the mapping in the source. + ''' + Public ReadOnly Property Finish() As Location + Get + Return _Finish + End Get + End Property + + ''' + ''' The external file the source maps to. + ''' + Public ReadOnly Property File() As String + Get + Return _File + End Get + End Property + + ''' + ''' The external line number the source maps to. + ''' + Public ReadOnly Property Line() As Long + Get + Return _Line + End Get + End Property + + ''' + ''' Constructs a new external line mapping. + ''' + ''' The start location in the source. + ''' The end location in the source. + ''' The name of the external file. + ''' The line number in the external file. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/IntegerBase.vb b/aspclassiccompiler/Parser/IntegerBase.vb new file mode 100644 index 0000000..6592eda --- /dev/null +++ b/aspclassiccompiler/Parser/IntegerBase.vb @@ -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. +' + +''' +''' The numeric base of an integer literal. +''' +Public Enum IntegerBase + ''' Base 10. + [Decimal] + + ''' Base 8. + Octal + + ''' Base 16. + Hexadecimal +End Enum + diff --git a/aspclassiccompiler/Parser/LanguageVersion.vb b/aspclassiccompiler/Parser/LanguageVersion.vb new file mode 100644 index 0000000..cd4cc10 --- /dev/null +++ b/aspclassiccompiler/Parser/LanguageVersion.vb @@ -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. +' + +''' +''' The version of the language you want. +''' + _ +Public Enum LanguageVersion + None = &H0 + + ''' Visual Basic 7.1 + ''' Shipped in Visual Basic 2003 + VisualBasic71 = &H1 + + ''' Visual Basic 8.0 + ''' Shipped in Visual Basic 2005 + VisualBasic80 = &H2 + + All = &H3 +End Enum \ No newline at end of file diff --git a/aspclassiccompiler/Parser/License.txt b/aspclassiccompiler/Parser/License.txt new file mode 100644 index 0000000..aedd635 --- /dev/null +++ b/aspclassiccompiler/Parser/License.txt @@ -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 it’s 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. diff --git a/aspclassiccompiler/Parser/Location.vb b/aspclassiccompiler/Parser/Location.vb new file mode 100644 index 0000000..d76b0af --- /dev/null +++ b/aspclassiccompiler/Parser/Location.vb @@ -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. +' + +''' +''' Stores source code line and column information. +''' +Public Structure Location + Private ReadOnly _Index As Integer + Private ReadOnly _Line As Integer + Private ReadOnly _Column As Integer + + ''' + ''' The index in the stream (0-based). + ''' + Public ReadOnly Property Index() As Integer + Get + Return _Index + End Get + End Property + + ''' + ''' The physical line number (1-based). + ''' + Public ReadOnly Property Line() As Integer + Get + Return _Line + End Get + End Property + + ''' + ''' The physical column number (1-based). + ''' + Public ReadOnly Property Column() As Integer + Get + Return _Column + End Get + End Property + + ''' + ''' Whether the location is a valid location. + ''' + Public ReadOnly Property IsValid() As Boolean + Get + Return Line <> 0 AndAlso Column <> 0 + End Get + End Property + + ''' + ''' Constructs a new Location for a particular source location. + ''' + ''' The index in the stream (0-based). + ''' The physical line number (1-based). + ''' The physical column number (1-based). + Public Sub New(ByVal index As Integer, ByVal line As Integer, ByVal column As Integer) + _Index = index + _Line = line + _Column = column + End Sub + + ''' + ''' Compares two specified Location values to see if they are equal. + ''' + ''' One location to compare. + ''' The other location to compare. + ''' True if the locations are the same, False otherwise. + Public Shared Operator =(ByVal left As Location, ByVal right As Location) As Boolean + Return left.Index = right.Index + End Operator + + ''' + ''' Compares two specified Location values to see if they are not equal. + ''' + ''' One location to compare. + ''' The other location to compare. + ''' True if the locations are not the same, False otherwise. + Public Shared Operator <>(ByVal left As Location, ByVal right As Location) As Boolean + Return left.Index <> right.Index + End Operator + + ''' + ''' Compares two specified Location values to see if one is before the other. + ''' + ''' One location to compare. + ''' The other location to compare. + ''' True if the first location is before the other location, False otherwise. + Public Shared Operator <(ByVal left As Location, ByVal right As Location) As Boolean + Return left.Index < right.Index + End Operator + + ''' + ''' Compares two specified Location values to see if one is after the other. + ''' + ''' One location to compare. + ''' The other location to compare. + ''' True if the first location is after the other location, False otherwise. + Public Shared Operator >(ByVal left As Location, ByVal right As Location) As Boolean + Return left.Index > right.Index + End Operator + + ''' + ''' Compares two specified Location values to see if one is before or the same as the other. + ''' + ''' One location to compare. + ''' The other location to compare. + ''' True if the first location is before or the same as the other location, False otherwise. + Public Shared Operator <=(ByVal left As Location, ByVal right As Location) As Boolean + Return left.Index <= right.Index + End Operator + + ''' + ''' Compares two specified Location values to see if one is after or the same as the other. + ''' + ''' One location to compare. + ''' The other location to compare. + ''' True if the first location is after or the same as the other location, False otherwise. + Public Shared Operator >=(ByVal left As Location, ByVal right As Location) As Boolean + Return left.Index >= right.Index + End Operator + + ''' + ''' Compares two specified Location values. + ''' + ''' One location to compare. + ''' The other location to compare. + ''' 0 if the locations are equal, -1 if the left one is less than the right one, 1 otherwise. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/My Project/Application.Designer.vb b/aspclassiccompiler/Parser/My Project/Application.Designer.vb new file mode 100644 index 0000000..4286ca6 --- /dev/null +++ b/aspclassiccompiler/Parser/My Project/Application.Designer.vb @@ -0,0 +1,13 @@ +'------------------------------------------------------------------------------ +' +' 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. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + diff --git a/aspclassiccompiler/Parser/My Project/Application.myapp b/aspclassiccompiler/Parser/My Project/Application.myapp new file mode 100644 index 0000000..1f3b462 --- /dev/null +++ b/aspclassiccompiler/Parser/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + false + false + 0 + true + 0 + 1 + false + true + \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Parser.VS2010.vbproj b/aspclassiccompiler/Parser/Parser.VS2010.vbproj new file mode 100644 index 0000000..4adbc11 --- /dev/null +++ b/aspclassiccompiler/Parser/Parser.VS2010.vbproj @@ -0,0 +1,453 @@ + + + + Local + 9.0.30729 + 2.0 + {57A0B340-BDA4-4DE3-B449-52B8C51D84B8} + Debug + AnyCPU + + + + + Dlrsoft.VBParser + + + None + JScript + Grid + IE50 + false + Library + Binary + On + On + Dlrsoft.VBScript.Parser + VBParser.(None) + + + v4.0 + + + false + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + + + ..\bin\Debug\ + Dlrsoft.VBParser.xml + 285212672 + + + + + true + true + true + false + false + false + false + 1 + 42016,42017,42018,42019,42032 + false + + + + + ..\bin\Release40\ + Dlrsoft.VBParser.xml + 285212672 + + + + + false + true + false + true + false + false + false + 1 + 42016,42017,42018,42019,42032 + + + + System + + + + + + + + + + + + + + + + Code + + + + Code + + + Code + + + Code + + + True + Application.myapp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 2.0 %28x86%29 + true + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + false + + + False + .NET Framework 3.5 SP1 + false + + + False + Microsoft Visual Basic PowerPacks 10.0 + true + + + + + + + + + + \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Parser.vb b/aspclassiccompiler/Parser/Parser.vb new file mode 100644 index 0000000..84623a7 --- /dev/null +++ b/aspclassiccompiler/Parser/Parser.vb @@ -0,0 +1,6861 @@ +' +' 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. +' + +''' +''' A parser for the Visual Basic .NET language based on the grammar +''' documented in the Language Specification. +''' +Public NotInheritable Class Parser + Implements IDisposable + + Private Enum PrecedenceLevel + None + [Xor] + [Or] + [And] + [Not] + Relational + Shift + Concatenate + Plus + Modulus + IntegralDivide + Multiply + Negate + Power + Range + End Enum + + Private NotInheritable Class ExternalSourceContext + Public Start As Location + Public File As String + Public Line As Long + End Class + + Private NotInheritable Class RegionContext + Public Start As Location + Public Description As String + End Class + + Private NotInheritable Class ConditionalCompilationContext + Public BlockActive As Boolean + Public AnyBlocksActive As Boolean + Public SeenElse As Boolean + End Class + + ' The scanner we're going to be using. + Private Scanner As Scanner + + ' The error table for the parsing + Private ErrorTable As IList(Of SyntaxError) + + ' External line mappings + Private ExternalLineMappings As IList(Of ExternalLineMapping) + + ' Source regions + Private SourceRegions As IList(Of SourceRegion) + + ' External checksums + Private ExternalChecksums As IList(Of ExternalChecksum) + + ' Conditional compilation constants + Private ConditionalCompilationConstants As IDictionary(Of String, Object) + + ' Whether there is an error in the construct + Private ErrorInConstruct As Boolean + + ' Whether we're at the beginning of a line + Private AtBeginningOfLine As Boolean + + ' Whether we're doing preprocessing or not + Private Preprocess As Boolean + + 'LC Allow continue with Line Terminator + Private CanContinueWithoutLineTerminator As Boolean + + ' The current stack of block contexts + Private BlockContextStack As Stack(Of TreeType) = New Stack(Of TreeType)() + + ' The current external source context + Private CurrentExternalSourceContext As ExternalSourceContext + + ' The current stack of region contexts + Private RegionContextStack As Stack(Of RegionContext) = New Stack(Of RegionContext)() + + ' The current stack of conditional compilation states + Private ConditionalCompilationContextStack As Stack(Of ConditionalCompilationContext) = New Stack(Of ConditionalCompilationContext)() + + ' Determine whether we have been disposed already or not + Private Disposed As Boolean = False + + ''' + ''' Disposes the parser. + ''' + Public Sub Dispose() Implements IDisposable.Dispose + If Not Disposed Then + Disposed = True + Scanner.Close() + End If + End Sub + + '* + '* Token reading functions + '* + + Private Function Peek() As Token + Return Scanner.Peek() + End Function + + Private Function PeekAheadOne() As Token + Dim Start As Token = Read() + Dim NextToken As Token = Peek() + + Backtrack(Start) + Return NextToken + End Function + + Private Function PeekAheadFor(ByVal ParamArray tokens() As TokenType) As TokenType + Dim Start As Token = Peek() + Dim Current As Token = Start + + While Not CanEndStatement(Current) + For Each Token As TokenType In tokens + If Current.AsUnreservedKeyword() = Token Then + Backtrack(Start) + Return Token + End If + Next + + Current = Read() + End While + + Backtrack(Start) + Return TokenType.None + End Function + + Private Function Read() As Token + Return Scanner.Read() + End Function + + Private Function ReadLocation() As Location + Return Read().Span.Start + End Function + + Private Sub Backtrack(ByVal token As Token) + Scanner.Seek(token) + End Sub + + Private Sub ResyncAt(ByVal ParamArray tokenTypes() As TokenType) + Dim CurrentToken As Token = Peek() + + While CurrentToken.Type <> TokenType.Colon AndAlso _ + CurrentToken.Type <> TokenType.EndOfStream AndAlso _ + CurrentToken.Type <> TokenType.LineTerminator AndAlso _ + Not BeginsStatement(CurrentToken) + For Each TokenType As TokenType In tokenTypes + ' CONSIDER: Need to check for non-reserved tokens? + If CurrentToken.Type = TokenType Then + Return + End If + Next + + Read() + CurrentToken = Peek() + End While + End Sub + + Private Function ParseTrailingComments() As List(Of Comment) + Dim Comments As List(Of Comment) = New List(Of Comment) + + ' Link in comments that follow the statement + While Peek().Type = TokenType.Comment + Dim CommentToken As CommentToken = CType(Scanner.Read(), CommentToken) + Comments.Add(New Comment(CommentToken.Comment, CommentToken.IsREM, CommentToken.Span)) + End While + + If Comments.Count > 0 Then + Return Comments + End If + + Return Nothing + End Function + + '* + '* Helpers + '* + + Private Sub PushBlockContext(ByVal type As TreeType) + BlockContextStack.Push(type) + End Sub + + Private Sub PopBlockContext() + BlockContextStack.Pop() + End Sub + + Private Function CurrentBlockContextType() As TreeType + If BlockContextStack.Count = 0 Then + Return TreeType.SyntaxError + Else + Return BlockContextStack.Peek() + End If + End Function + + Private Shared Function GetBinaryOperator(ByVal type As TokenType, Optional ByVal allowRange As Boolean = False) As OperatorType + Select Case type + Case TokenType.Ampersand + Return OperatorType.Concatenate + + Case TokenType.Star + Return OperatorType.Multiply + + Case TokenType.ForwardSlash + Return OperatorType.Divide + + Case TokenType.BackwardSlash + Return OperatorType.IntegralDivide + + Case TokenType.Caret + Return OperatorType.Power + + Case TokenType.Plus + Return OperatorType.Plus + + Case TokenType.Minus + Return OperatorType.Minus + + Case TokenType.LessThan + Return OperatorType.LessThan + + Case TokenType.LessThanEquals + Return OperatorType.LessThanEquals + + Case TokenType.Equals + Return OperatorType.Equals + + Case TokenType.NotEquals + Return OperatorType.NotEquals + + Case TokenType.GreaterThan + Return OperatorType.GreaterThan + + Case TokenType.GreaterThanEquals + Return OperatorType.GreaterThanEquals + + Case TokenType.LessThanLessThan + Return OperatorType.ShiftLeft + + Case TokenType.GreaterThanGreaterThan + Return OperatorType.ShiftRight + + Case TokenType.Mod + Return OperatorType.Modulus + + Case TokenType.Or + Return OperatorType.Or + + Case TokenType.OrElse + Return OperatorType.OrElse + + Case TokenType.And + Return OperatorType.And + + Case TokenType.AndAlso + Return OperatorType.AndAlso + + Case TokenType.Xor + Return OperatorType.Xor + + Case TokenType.Like + Return OperatorType.Like + + Case TokenType.Is + Return OperatorType.Is + + Case TokenType.IsNot + Return OperatorType.IsNot + + Case TokenType.To + If allowRange Then + Return OperatorType.To + Else + Return OperatorType.None + End If + + Case Else + Return OperatorType.None + End Select + End Function + + Private Shared Function GetOperatorPrecedence(ByVal [operator] As OperatorType) As PrecedenceLevel + Select Case [operator] + Case OperatorType.To + Return PrecedenceLevel.Range + + Case OperatorType.Power + Return PrecedenceLevel.Power + + Case OperatorType.Negate, OperatorType.UnaryPlus + Return PrecedenceLevel.Negate + + Case OperatorType.Multiply, OperatorType.Divide + Return PrecedenceLevel.Multiply + + Case OperatorType.IntegralDivide + Return PrecedenceLevel.IntegralDivide + + Case OperatorType.Modulus + Return PrecedenceLevel.Modulus + + Case OperatorType.Plus, OperatorType.Minus + Return PrecedenceLevel.Plus + + Case OperatorType.Concatenate + Return PrecedenceLevel.Concatenate + + Case OperatorType.ShiftLeft, OperatorType.ShiftRight + Return PrecedenceLevel.Shift + + Case OperatorType.Equals, _ + OperatorType.NotEquals, _ + OperatorType.LessThan, _ + OperatorType.GreaterThan, _ + OperatorType.GreaterThanEquals, _ + OperatorType.LessThanEquals, _ + OperatorType.Is, _ + OperatorType.IsNot, _ + OperatorType.Like + Return PrecedenceLevel.Relational + + Case OperatorType.Not + Return PrecedenceLevel.Not + + Case OperatorType.And, OperatorType.AndAlso + Return PrecedenceLevel.And + + Case OperatorType.Or, OperatorType.OrElse + Return PrecedenceLevel.Or + + Case OperatorType.Xor + Return PrecedenceLevel.Xor + + Case Else + Return PrecedenceLevel.None + End Select + End Function + + Private Shared Function GetCompoundAssignmentOperatorType(ByVal tokenType As TokenType) As OperatorType + Select Case tokenType + Case tokenType.PlusEquals + Return OperatorType.Plus + + Case tokenType.AmpersandEquals + Return OperatorType.Concatenate + + Case tokenType.StarEquals + Return OperatorType.Multiply + + Case tokenType.MinusEquals + Return OperatorType.Minus + + Case tokenType.ForwardSlashEquals + Return OperatorType.Divide + + Case tokenType.BackwardSlashEquals + Return OperatorType.IntegralDivide + + Case tokenType.CaretEquals + Return OperatorType.Power + + Case tokenType.LessThanLessThanEquals + Return OperatorType.ShiftLeft + + Case tokenType.GreaterThanGreaterThanEquals + Return OperatorType.ShiftRight + + Case Else + Return OperatorType.None + End Select + + Return OperatorType.None + End Function + + Private Shared Function GetAssignmentOperator(ByVal tokenType As TokenType) As TreeType + + Select Case tokenType + Case tokenType.Equals + Return TreeType.AssignmentStatement + + Case tokenType.PlusEquals, tokenType.AmpersandEquals, tokenType.StarEquals, tokenType.MinusEquals, _ + tokenType.ForwardSlashEquals, tokenType.BackwardSlashEquals, tokenType.CaretEquals, _ + tokenType.LessThanLessThanEquals, tokenType.GreaterThanGreaterThanEquals + Return TreeType.CompoundAssignmentStatement + + Case Else + End Select + + Return TreeType.SyntaxError + End Function + + Private Shared Function IsRelationalOperator(ByVal type As TokenType) As Boolean + Return type >= TokenType.LessThan AndAlso type <= TokenType.GreaterThanEquals + End Function + + Private Shared Function IsOverloadableOperator(ByVal op As Token) As Boolean + Select Case op.Type + Case TokenType.Plus, _ + TokenType.Minus, _ + TokenType.Not, _ + TokenType.Star, _ + TokenType.ForwardSlash, _ + TokenType.BackwardSlash, _ + TokenType.Ampersand, _ + TokenType.Like, _ + TokenType.Mod, _ + TokenType.And, _ + TokenType.Or, _ + TokenType.Xor, _ + TokenType.Caret, _ + TokenType.LessThanLessThan, _ + TokenType.GreaterThanGreaterThan, _ + TokenType.Equals, _ + TokenType.NotEquals, _ + TokenType.LessThan, _ + TokenType.GreaterThan, _ + TokenType.LessThanEquals, _ + TokenType.GreaterThanEquals, _ + TokenType.CType + Return True + Case TokenType.Identifier + If op.AsUnreservedKeyword() = TokenType.IsTrue OrElse _ + op.AsUnreservedKeyword() = TokenType.IsFalse Then + Return True + End If + End Select + + Return False + End Function + + Private Shared Function GetContinueType(ByVal tokenType As TokenType) As BlockType + Select Case tokenType + Case tokenType.Do + Return BlockType.Do + + Case tokenType.For + Return BlockType.For + + Case tokenType.While + Return BlockType.While + + Case Else + Return BlockType.None + End Select + End Function + + Private Shared Function GetExitType(ByVal tokenType As TokenType) As BlockType + Select Case tokenType + Case tokenType.Do + Return BlockType.Do + + Case tokenType.For + Return BlockType.For + + Case tokenType.While + Return BlockType.While + + Case tokenType.Select + Return BlockType.Select + + Case tokenType.Sub + Return BlockType.Sub + + Case tokenType.Function + Return BlockType.Function + + Case tokenType.Property + Return BlockType.Property + + Case tokenType.Try + Return BlockType.Try + + Case Else + Return BlockType.None + End Select + End Function + + Private Shared Function GetBlockType(ByVal type As TokenType) As BlockType + Select Case type + Case TokenType.While + Return BlockType.While + + Case TokenType.Select + Return BlockType.Select + + Case TokenType.If + Return BlockType.If + + Case TokenType.Try + Return BlockType.Try + + Case TokenType.SyncLock + Return BlockType.SyncLock + + Case TokenType.Using + Return BlockType.Using + + Case TokenType.With + Return BlockType.With + + Case TokenType.Sub + Return BlockType.Sub + + Case TokenType.Function + Return BlockType.Function + + Case TokenType.Operator + Return BlockType.Operator + + Case TokenType.Get + Return BlockType.Get + + Case TokenType.Set + Return BlockType.Set + + Case TokenType.Event + Return BlockType.Event + + Case TokenType.AddHandler + Return BlockType.AddHandler + + Case TokenType.RemoveHandler + Return BlockType.RemoveHandler + + Case TokenType.RaiseEvent + Return BlockType.RaiseEvent + + Case TokenType.Property + Return BlockType.Property + + Case TokenType.Class + Return BlockType.Class + + Case TokenType.Structure + Return BlockType.Structure + + Case TokenType.Module + Return BlockType.Module + + Case TokenType.Interface + Return BlockType.Interface + + Case TokenType.Enum + Return BlockType.Enum + + Case TokenType.Namespace + Return BlockType.Namespace + + Case Else + Return BlockType.None + End Select + End Function + + Private Sub ReportSyntaxError(ByVal syntaxError As SyntaxError) + If ErrorInConstruct Then + Return + End If + + ErrorInConstruct = True + + If ErrorTable IsNot Nothing Then + ErrorTable.Add(syntaxError) + End If + End Sub + + Private Sub ReportSyntaxError(ByVal errorType As SyntaxErrorType, ByVal span As Span) + ReportSyntaxError(New SyntaxError(errorType, span)) + End Sub + + Private Sub ReportSyntaxError(ByVal errorType As SyntaxErrorType, ByVal firstToken As Token, ByVal lastToken As Token) + ' A lexical error takes precedence over the parser error + If firstToken.Type = TokenType.LexicalError Then + ReportSyntaxError(CType(firstToken, ErrorToken).SyntaxError) + Else + ReportSyntaxError(errorType, SpanFrom(firstToken, lastToken)) + End If + End Sub + + Private Sub ReportSyntaxError(ByVal errorType As SyntaxErrorType, ByVal token As Token) + ReportSyntaxError(errorType, token, token) + End Sub + + Private Shared Function StatementEndsBlock(ByVal blockStatementType As TreeType, ByVal endStatement As Statement) As Boolean + Select Case blockStatementType + Case TreeType.DoBlockStatement + Return endStatement.Type = TreeType.LoopStatement + + Case TreeType.ForBlockStatement, TreeType.ForEachBlockStatement + Return endStatement.Type = TreeType.NextStatement + + Case TreeType.WhileBlockStatement + Return (endStatement.Type = TreeType.EndBlockStatement) AndAlso CType(endStatement, EndBlockStatement).EndType = BlockType.While + + Case TreeType.SyncLockBlockStatement + Return (endStatement.Type = TreeType.EndBlockStatement) AndAlso CType(endStatement, EndBlockStatement).EndType = BlockType.SyncLock + + Case TreeType.UsingBlockStatement + Return (endStatement.Type = TreeType.EndBlockStatement) AndAlso CType(endStatement, EndBlockStatement).EndType = BlockType.Using + + Case TreeType.WithBlockStatement + Return (endStatement.Type = TreeType.EndBlockStatement) AndAlso CType(endStatement, EndBlockStatement).EndType = BlockType.With + + Case TreeType.TryBlockStatement, TreeType.CatchBlockStatement + Return endStatement.Type = TreeType.CatchStatement OrElse _ + endStatement.Type = TreeType.FinallyStatement OrElse _ + (endStatement.Type = TreeType.EndBlockStatement AndAlso CType(endStatement, EndBlockStatement).EndType = BlockType.Try) + + Case TreeType.FinallyBlockStatement + Return endStatement.Type = TreeType.EndBlockStatement AndAlso CType(endStatement, EndBlockStatement).EndType = BlockType.Try + + Case TreeType.SelectBlockStatement, TreeType.CaseBlockStatement + Return endStatement.Type = TreeType.CaseStatement OrElse _ + endStatement.Type = TreeType.CaseElseStatement OrElse _ + (endStatement.Type = TreeType.EndBlockStatement AndAlso CType(endStatement, EndBlockStatement).EndType = BlockType.Select) + + Case TreeType.CaseElseBlockStatement + Return endStatement.Type = TreeType.EndBlockStatement AndAlso CType(endStatement, EndBlockStatement).EndType = BlockType.Select + + Case TreeType.IfBlockStatement, TreeType.ElseIfBlockStatement + Return endStatement.Type = TreeType.ElseIfStatement OrElse _ + endStatement.Type = TreeType.ElseStatement OrElse _ + (endStatement.Type = TreeType.EndBlockStatement AndAlso CType(endStatement, EndBlockStatement).EndType = BlockType.If) + + Case TreeType.ElseBlockStatement + Return endStatement.Type = TreeType.EndBlockStatement AndAlso CType(endStatement, EndBlockStatement).EndType = BlockType.If + + Case TreeType.LineIfBlockStatement + 'LC LineIf can end with end if + Return endStatement.Type = TreeType.EndBlockStatement AndAlso CType(endStatement, EndBlockStatement).EndType = BlockType.If + 'Return False + + Case TreeType.SubDeclaration, TreeType.ConstructorDeclaration + Return endStatement.Type = TreeType.EndBlockStatement AndAlso CType(endStatement, EndBlockStatement).EndType = BlockType.Sub + + Case TreeType.FunctionDeclaration + Return endStatement.Type = TreeType.EndBlockStatement AndAlso CType(endStatement, EndBlockStatement).EndType = BlockType.Function + + Case TreeType.OperatorDeclaration + Return endStatement.Type = TreeType.EndBlockStatement AndAlso CType(endStatement, EndBlockStatement).EndType = BlockType.Operator + + Case TreeType.GetAccessorDeclaration + Return endStatement.Type = TreeType.EndBlockStatement AndAlso CType(endStatement, EndBlockStatement).EndType = BlockType.Get + + Case TreeType.SetAccessorDeclaration + Return endStatement.Type = TreeType.EndBlockStatement AndAlso CType(endStatement, EndBlockStatement).EndType = BlockType.Set + + Case TreeType.PropertyDeclaration + Return endStatement.Type = TreeType.EndBlockStatement AndAlso CType(endStatement, EndBlockStatement).EndType = BlockType.Property + + Case TreeType.CustomEventDeclaration + Return endStatement.Type = TreeType.EndBlockStatement AndAlso CType(endStatement, EndBlockStatement).EndType = BlockType.Event + + Case TreeType.AddHandlerAccessorDeclaration + Return endStatement.Type = TreeType.EndBlockStatement AndAlso CType(endStatement, EndBlockStatement).EndType = BlockType.AddHandler + + Case TreeType.RemoveHandlerAccessorDeclaration + Return endStatement.Type = TreeType.EndBlockStatement AndAlso CType(endStatement, EndBlockStatement).EndType = BlockType.RemoveHandler + + Case TreeType.RaiseEventAccessorDeclaration + Return endStatement.Type = TreeType.EndBlockStatement AndAlso CType(endStatement, EndBlockStatement).EndType = BlockType.RaiseEvent + + Case TreeType.ClassDeclaration + Return endStatement.Type = TreeType.EndBlockStatement AndAlso CType(endStatement, EndBlockStatement).EndType = BlockType.Class + + Case TreeType.StructureDeclaration + Return endStatement.Type = TreeType.EndBlockStatement AndAlso CType(endStatement, EndBlockStatement).EndType = BlockType.Structure + + Case TreeType.ModuleDeclaration + Return endStatement.Type = TreeType.EndBlockStatement AndAlso CType(endStatement, EndBlockStatement).EndType = BlockType.Module + + Case TreeType.InterfaceDeclaration + Return endStatement.Type = TreeType.EndBlockStatement AndAlso CType(endStatement, EndBlockStatement).EndType = BlockType.Interface + + Case TreeType.EnumDeclaration + Return endStatement.Type = TreeType.EndBlockStatement AndAlso CType(endStatement, EndBlockStatement).EndType = BlockType.Enum + + Case TreeType.NamespaceDeclaration + Return endStatement.Type = TreeType.EndBlockStatement AndAlso CType(endStatement, EndBlockStatement).EndType = BlockType.Namespace + + Case Else + Debug.Assert(False, "Unexpected.") + End Select + + Return False + End Function + + Private Shared Function DeclarationEndsBlock(ByVal blockDeclarationType As TreeType, ByVal endDeclaration As EndBlockDeclaration) As Boolean + Select Case blockDeclarationType + Case TreeType.SubDeclaration, TreeType.ConstructorDeclaration + Return endDeclaration.EndType = BlockType.Sub + + Case TreeType.FunctionDeclaration + Return endDeclaration.EndType = BlockType.Function + + Case TreeType.OperatorDeclaration + Return endDeclaration.EndType = BlockType.Operator + + Case TreeType.PropertyDeclaration + Return endDeclaration.EndType = BlockType.Property + + Case TreeType.GetAccessorDeclaration + Return endDeclaration.EndType = BlockType.Get + + Case TreeType.SetAccessorDeclaration + Return endDeclaration.EndType = BlockType.Set + + Case TreeType.CustomEventDeclaration + Return endDeclaration.EndType = BlockType.Event + + Case TreeType.AddHandlerAccessorDeclaration + Return endDeclaration.EndType = BlockType.AddHandler + + Case TreeType.RemoveHandlerAccessorDeclaration + Return endDeclaration.EndType = BlockType.RemoveHandler + + Case TreeType.RaiseEventAccessorDeclaration + Return endDeclaration.EndType = BlockType.RaiseEvent + + Case TreeType.ClassDeclaration + Return endDeclaration.EndType = BlockType.Class + + Case TreeType.StructureDeclaration + Return endDeclaration.EndType = BlockType.Structure + + Case TreeType.ModuleDeclaration + Return endDeclaration.EndType = BlockType.Module + + Case TreeType.InterfaceDeclaration + Return endDeclaration.EndType = BlockType.Interface + + Case TreeType.EnumDeclaration + Return endDeclaration.EndType = BlockType.Enum + + Case TreeType.NamespaceDeclaration + Return endDeclaration.EndType = BlockType.Namespace + + Case Else + Debug.Assert(False, "Unexpected.") + End Select + + Return False + End Function + + Private Shared Function ValidInContext(ByVal blockType As TreeType, ByVal declarationType As TreeType) As Boolean + Select Case declarationType + Case TreeType.OptionDeclaration, TreeType.ImportsDeclaration, TreeType.AttributeDeclaration + Return blockType = TreeType.File + + Case TreeType.NamespaceDeclaration + Return blockType = TreeType.NamespaceDeclaration OrElse _ + blockType = TreeType.File + + Case TreeType.ClassDeclaration, TreeType.StructureDeclaration, TreeType.InterfaceDeclaration, _ + TreeType.DelegateSubDeclaration, TreeType.DelegateFunctionDeclaration, TreeType.EnumDeclaration + Return blockType = TreeType.ClassDeclaration OrElse _ + blockType = TreeType.StructureDeclaration OrElse _ + blockType = TreeType.ModuleDeclaration OrElse _ + blockType = TreeType.InterfaceDeclaration OrElse _ + blockType = TreeType.NamespaceDeclaration OrElse _ + blockType = TreeType.File + + Case TreeType.ModuleDeclaration + Return blockType = TreeType.NamespaceDeclaration OrElse _ + blockType = TreeType.File + + Case TreeType.EventDeclaration, TreeType.SubDeclaration, TreeType.FunctionDeclaration, _ + TreeType.PropertyDeclaration + Return blockType = TreeType.ClassDeclaration OrElse _ + blockType = TreeType.StructureDeclaration OrElse _ + blockType = TreeType.ModuleDeclaration OrElse _ + blockType = TreeType.InterfaceDeclaration + + Case TreeType.CustomEventDeclaration + Return blockType = TreeType.ClassDeclaration OrElse _ + blockType = TreeType.StructureDeclaration OrElse _ + blockType = TreeType.ModuleDeclaration + + Case TreeType.AddHandlerAccessorDeclaration, TreeType.RemoveHandlerAccessorDeclaration, _ + TreeType.RaiseEventAccessorDeclaration + Return blockType = TreeType.CustomEventDeclaration + + Case TreeType.OperatorDeclaration + Return blockType = TreeType.ClassDeclaration OrElse _ + blockType = TreeType.StructureDeclaration + + Case TreeType.VariableListDeclaration, TreeType.ExternalSubDeclaration, _ + TreeType.ExternalFunctionDeclaration + Return blockType = TreeType.ClassDeclaration OrElse _ + blockType = TreeType.StructureDeclaration OrElse _ + blockType = TreeType.ModuleDeclaration + + Case TreeType.ConstructorDeclaration + Return blockType = TreeType.ClassDeclaration OrElse _ + blockType = TreeType.StructureDeclaration + + Case TreeType.GetAccessorDeclaration, TreeType.SetAccessorDeclaration + Return blockType = TreeType.PropertyDeclaration + + Case TreeType.InheritsDeclaration + Return blockType = TreeType.ClassDeclaration OrElse _ + blockType = TreeType.InterfaceDeclaration + + Case TreeType.ImplementsDeclaration + Return blockType = TreeType.ClassDeclaration OrElse _ + blockType = TreeType.StructureDeclaration + + Case TreeType.EnumValueDeclaration + Return blockType = TreeType.EnumDeclaration + + Case TreeType.EmptyDeclaration + Return True + + Case Else + Debug.Assert(False, "Unexpected.") + End Select + End Function + + Private Shared Function ValidDeclaration(ByVal blockType As TreeType, ByVal declaration As Declaration, ByVal declarations As List(Of Declaration)) As SyntaxErrorType + If Not ValidInContext(blockType, declaration.Type) Then + Return InvalidDeclarationTypeError(blockType) + End If + + If declaration.Type = TreeType.InheritsDeclaration Then + For Each ExistingDeclaration As Declaration In declarations + If blockType = TreeType.ClassDeclaration OrElse ExistingDeclaration.Type <> TreeType.InheritsDeclaration Then + Return SyntaxErrorType.InheritsMustBeFirst + End If + Next + + If CType(declaration, InheritsDeclaration).InheritedTypes.Count > 1 AndAlso blockType <> TreeType.InterfaceDeclaration Then + Return SyntaxErrorType.NoMultipleInheritance + End If + End If + + If declaration.Type = TreeType.ImplementsDeclaration Then + For Each ExistingDeclaration As Declaration In declarations + If ExistingDeclaration.Type <> TreeType.InheritsDeclaration AndAlso _ + ExistingDeclaration.Type <> TreeType.ImplementsDeclaration Then + Return SyntaxErrorType.ImplementsInWrongOrder + End If + Next + End If + + If declaration.Type = TreeType.OptionDeclaration Then + For Each ExistingDeclaration As Declaration In declarations + If ExistingDeclaration.Type <> TreeType.OptionDeclaration Then + Return SyntaxErrorType.OptionStatementWrongOrder + End If + Next + End If + + If declaration.Type = TreeType.ImportsDeclaration Then + For Each ExistingDeclaration As Declaration In declarations + If ExistingDeclaration.Type <> TreeType.OptionDeclaration AndAlso _ + ExistingDeclaration.Type <> TreeType.ImportsDeclaration Then + Return SyntaxErrorType.ImportsStatementWrongOrder + End If + Next + End If + + If declaration.Type = TreeType.AttributeDeclaration Then + For Each ExistingDeclaration As Declaration In declarations + If ExistingDeclaration.Type <> TreeType.OptionDeclaration AndAlso _ + ExistingDeclaration.Type <> TreeType.ImportsDeclaration AndAlso _ + ExistingDeclaration.Type <> TreeType.AttributeDeclaration Then + Return SyntaxErrorType.AttributesStatementWrongOrder + End If + Next + End If + + Return SyntaxErrorType.None + End Function + + Private Sub ReportMismatchedEndError(ByVal blockType As TreeType, ByVal actualEndSpan As Span) + Dim ErrorType As SyntaxErrorType + + Select Case blockType + Case TreeType.DoBlockStatement + ErrorType = SyntaxErrorType.ExpectedLoop + + Case TreeType.ForBlockStatement, TreeType.ForEachBlockStatement + ErrorType = SyntaxErrorType.ExpectedNext + + Case TreeType.WhileBlockStatement + ErrorType = SyntaxErrorType.ExpectedEndWhile + + Case TreeType.SelectBlockStatement, TreeType.CaseBlockStatement, TreeType.CaseElseBlockStatement + ErrorType = SyntaxErrorType.ExpectedEndSelect + + Case TreeType.SyncLockBlockStatement + ErrorType = SyntaxErrorType.ExpectedEndSyncLock + + Case TreeType.UsingBlockStatement + ErrorType = SyntaxErrorType.ExpectedEndUsing + + Case TreeType.IfBlockStatement, TreeType.ElseIfBlockStatement, TreeType.ElseBlockStatement + ErrorType = SyntaxErrorType.ExpectedEndIf + + Case TreeType.TryBlockStatement, TreeType.CatchBlockStatement, TreeType.FinallyBlockStatement + ErrorType = SyntaxErrorType.ExpectedEndTry + + Case TreeType.WithBlockStatement + ErrorType = SyntaxErrorType.ExpectedEndWith + + Case TreeType.SubDeclaration, TreeType.ConstructorDeclaration + ErrorType = SyntaxErrorType.ExpectedEndSub + + Case TreeType.FunctionDeclaration + ErrorType = SyntaxErrorType.ExpectedEndFunction + + Case TreeType.OperatorDeclaration + ErrorType = SyntaxErrorType.ExpectedEndOperator + + Case TreeType.PropertyDeclaration + ErrorType = SyntaxErrorType.ExpectedEndProperty + + Case TreeType.GetAccessorDeclaration + ErrorType = SyntaxErrorType.ExpectedEndGet + + Case TreeType.SetAccessorDeclaration + ErrorType = SyntaxErrorType.ExpectedEndSet + + Case TreeType.CustomEventDeclaration + ErrorType = SyntaxErrorType.ExpectedEndEvent + + Case TreeType.AddHandlerAccessorDeclaration + ErrorType = SyntaxErrorType.ExpectedEndAddHandler + + Case TreeType.RemoveHandlerAccessorDeclaration + ErrorType = SyntaxErrorType.ExpectedEndRemoveHandler + + Case TreeType.RaiseEventAccessorDeclaration + ErrorType = SyntaxErrorType.ExpectedEndRaiseEvent + + Case TreeType.ClassDeclaration + ErrorType = SyntaxErrorType.ExpectedEndClass + + Case TreeType.StructureDeclaration + ErrorType = SyntaxErrorType.ExpectedEndStructure + + Case TreeType.ModuleDeclaration + ErrorType = SyntaxErrorType.ExpectedEndModule + + Case TreeType.InterfaceDeclaration + ErrorType = SyntaxErrorType.ExpectedEndInterface + + Case TreeType.EnumDeclaration + ErrorType = SyntaxErrorType.ExpectedEndEnum + + Case TreeType.NamespaceDeclaration + ErrorType = SyntaxErrorType.ExpectedEndNamespace + + Case Else + Debug.Assert(False, "Unexpected.") + End Select + + ReportSyntaxError(ErrorType, actualEndSpan) + End Sub + + Private Sub ReportMissingBeginStatementError(ByVal blockStatementType As TreeType, ByVal endStatement As Statement) + Dim ErrorType As SyntaxErrorType + + Select Case endStatement.Type + Case TreeType.LoopStatement + ErrorType = SyntaxErrorType.LoopWithoutDo + + Case TreeType.NextStatement + ErrorType = SyntaxErrorType.NextWithoutFor + + Case TreeType.EndBlockStatement + Select Case CType(endStatement, EndBlockStatement).EndType + Case BlockType.While + ErrorType = SyntaxErrorType.EndWhileWithoutWhile + + Case BlockType.Select + ErrorType = SyntaxErrorType.EndSelectWithoutSelect + + Case BlockType.SyncLock + ErrorType = SyntaxErrorType.EndSyncLockWithoutSyncLock + + Case BlockType.Using + ErrorType = SyntaxErrorType.EndUsingWithoutUsing + + Case BlockType.If + ErrorType = SyntaxErrorType.EndIfWithoutIf + + Case BlockType.Try + ErrorType = SyntaxErrorType.EndTryWithoutTry + + Case BlockType.With + ErrorType = SyntaxErrorType.EndWithWithoutWith + + Case BlockType.Sub + ErrorType = SyntaxErrorType.EndSubWithoutSub + + Case BlockType.Function + ErrorType = SyntaxErrorType.EndFunctionWithoutFunction + + Case BlockType.Operator + ErrorType = SyntaxErrorType.EndOperatorWithoutOperator + + Case BlockType.Get + ErrorType = SyntaxErrorType.EndGetWithoutGet + + Case BlockType.Set + ErrorType = SyntaxErrorType.EndSetWithoutSet + + Case BlockType.Property + ErrorType = SyntaxErrorType.EndPropertyWithoutProperty + + Case BlockType.Event + ErrorType = SyntaxErrorType.EndEventWithoutEvent + + Case BlockType.AddHandler + ErrorType = SyntaxErrorType.EndAddHandlerWithoutAddHandler + + Case BlockType.RemoveHandler + ErrorType = SyntaxErrorType.EndRemoveHandlerWithoutRemoveHandler + + Case BlockType.RaiseEvent + ErrorType = SyntaxErrorType.EndRaiseEventWithoutRaiseEvent + + Case BlockType.Class + ErrorType = SyntaxErrorType.EndClassWithoutClass + + Case BlockType.Structure + ErrorType = SyntaxErrorType.EndStructureWithoutStructure + + Case BlockType.Module + ErrorType = SyntaxErrorType.EndModuleWithoutModule + + Case BlockType.Interface + ErrorType = SyntaxErrorType.EndInterfaceWithoutInterface + + Case BlockType.Enum + ErrorType = SyntaxErrorType.EndEnumWithoutEnum + + Case BlockType.Namespace + ErrorType = SyntaxErrorType.EndNamespaceWithoutNamespace + + Case Else + Debug.Assert(False, "Unexpected.") + End Select + + Case TreeType.CatchStatement + If blockStatementType = TreeType.FinallyBlockStatement Then + ErrorType = SyntaxErrorType.CatchAfterFinally + Else + ErrorType = SyntaxErrorType.CatchWithoutTry + End If + + Case TreeType.FinallyStatement + If blockStatementType = TreeType.FinallyBlockStatement Then + ErrorType = SyntaxErrorType.FinallyAfterFinally + Else + ErrorType = SyntaxErrorType.FinallyWithoutTry + End If + + Case TreeType.CaseStatement + If blockStatementType = TreeType.CaseElseBlockStatement Then + ErrorType = SyntaxErrorType.CaseAfterCaseElse + Else + ErrorType = SyntaxErrorType.CaseWithoutSelect + End If + + Case TreeType.CaseElseStatement + If blockStatementType = TreeType.CaseElseBlockStatement Then + ErrorType = SyntaxErrorType.CaseElseAfterCaseElse + Else + ErrorType = SyntaxErrorType.CaseElseWithoutSelect + End If + + Case TreeType.ElseIfStatement + If blockStatementType = TreeType.ElseBlockStatement Then + ErrorType = SyntaxErrorType.ElseIfAfterElse + Else + ErrorType = SyntaxErrorType.ElseIfWithoutIf + End If + + Case TreeType.ElseStatement + If blockStatementType = TreeType.ElseBlockStatement Then + ErrorType = SyntaxErrorType.ElseAfterElse + Else + ErrorType = SyntaxErrorType.ElseWithoutIf + End If + + Case Else + Debug.Assert(False, "Unexpected.") + End Select + + ReportSyntaxError(ErrorType, endStatement.Span) + End Sub + + Private Sub ReportMissingBeginDeclarationError(ByVal endDeclaration As EndBlockDeclaration) + Dim ErrorType As SyntaxErrorType + + Select Case endDeclaration.EndType + Case BlockType.Sub + ErrorType = SyntaxErrorType.EndSubWithoutSub + + Case BlockType.Function + ErrorType = SyntaxErrorType.EndFunctionWithoutFunction + + Case BlockType.Operator + ErrorType = SyntaxErrorType.EndOperatorWithoutOperator + + Case BlockType.Property + ErrorType = SyntaxErrorType.EndPropertyWithoutProperty + + Case BlockType.Get + ErrorType = SyntaxErrorType.EndGetWithoutGet + + Case BlockType.Set + ErrorType = SyntaxErrorType.EndSetWithoutSet + + Case BlockType.Event + ErrorType = SyntaxErrorType.EndEventWithoutEvent + + Case BlockType.AddHandler + ErrorType = SyntaxErrorType.EndAddHandlerWithoutAddHandler + + Case BlockType.RemoveHandler + ErrorType = SyntaxErrorType.EndRemoveHandlerWithoutRemoveHandler + + Case BlockType.RaiseEvent + ErrorType = SyntaxErrorType.EndRaiseEventWithoutRaiseEvent + + Case BlockType.Class + ErrorType = SyntaxErrorType.EndClassWithoutClass + + Case BlockType.Structure + ErrorType = SyntaxErrorType.EndStructureWithoutStructure + + Case BlockType.Module + ErrorType = SyntaxErrorType.EndModuleWithoutModule + + Case BlockType.Interface + ErrorType = SyntaxErrorType.EndInterfaceWithoutInterface + + Case BlockType.Enum + ErrorType = SyntaxErrorType.EndEnumWithoutEnum + + Case BlockType.Namespace + ErrorType = SyntaxErrorType.EndNamespaceWithoutNamespace + + Case Else + Debug.Assert(False, "Unexpected.") + End Select + + ReportSyntaxError(ErrorType, endDeclaration.Span) + End Sub + + Private Shared Function InvalidDeclarationTypeError(ByVal blockType As TreeType) As SyntaxErrorType + Dim ErrorType As SyntaxErrorType + + Select Case blockType + Case TreeType.PropertyDeclaration + ErrorType = SyntaxErrorType.InvalidInsideProperty + + Case TreeType.ClassDeclaration + ErrorType = SyntaxErrorType.InvalidInsideClass + + Case TreeType.StructureDeclaration + ErrorType = SyntaxErrorType.InvalidInsideStructure + + Case TreeType.ModuleDeclaration + ErrorType = SyntaxErrorType.InvalidInsideModule + + Case TreeType.InterfaceDeclaration + ErrorType = SyntaxErrorType.InvalidInsideInterface + + Case TreeType.EnumDeclaration + ErrorType = SyntaxErrorType.InvalidInsideEnum + + Case TreeType.NamespaceDeclaration, TreeType.File + ErrorType = SyntaxErrorType.InvalidInsideNamespace + + Case Else + Debug.Assert(False, "Unexpected.") + End Select + + Return ErrorType + End Function + + Private Sub HandleUnexpectedToken(ByVal type As TokenType) + Dim ErrorType As SyntaxErrorType + + Select Case type + Case TokenType.Comma + ErrorType = SyntaxErrorType.ExpectedComma + + Case TokenType.LeftParenthesis + ErrorType = SyntaxErrorType.ExpectedLeftParenthesis + + Case TokenType.RightParenthesis + ErrorType = SyntaxErrorType.ExpectedRightParenthesis + + Case TokenType.Equals + ErrorType = SyntaxErrorType.ExpectedEquals + + Case TokenType.As + ErrorType = SyntaxErrorType.ExpectedAs + + Case TokenType.RightCurlyBrace + ErrorType = SyntaxErrorType.ExpectedRightCurlyBrace + + Case TokenType.Period + ErrorType = SyntaxErrorType.ExpectedPeriod + + Case TokenType.Minus + ErrorType = SyntaxErrorType.ExpectedMinus + + Case TokenType.Is + ErrorType = SyntaxErrorType.ExpectedIs + + Case TokenType.GreaterThan + ErrorType = SyntaxErrorType.ExpectedGreaterThan + + Case TokenType.Of + ErrorType = SyntaxErrorType.ExpectedOf + + Case Else + Debug.Assert(False, "Should give a more specific error.") + ErrorType = SyntaxErrorType.SyntaxError + End Select + + ReportSyntaxError(ErrorType, Peek()) + End Sub + + Private Function VerifyExpectedToken(ByVal type As TokenType) As Location + Dim Token As Token = Peek() + + If Token.Type = type Then + Return ReadLocation() + Else + HandleUnexpectedToken(type) + Return New Location + End If + End Function + + Private Function CanEndStatement(ByVal token As Token) As Boolean + Return token.Type = TokenType.Colon OrElse _ + token.Type = TokenType.LineTerminator OrElse _ + token.Type = TokenType.EndOfStream OrElse _ + token.Type = TokenType.Comment OrElse _ + (BlockContextStack.Count > 0 AndAlso CurrentBlockContextType() = TreeType.LineIfBlockStatement AndAlso token.Type = TokenType.Else) + End Function + + Private Function BeginsStatement(ByVal token As Token) As Boolean + If Not CanEndStatement(token) Then + Return False + End If + + Select Case token.Type + Case TokenType.AddHandler, _ + TokenType.Call, _ + TokenType.Case, _ + TokenType.Catch, _ + TokenType.Class, _ + TokenType.Const, _ + TokenType.Declare, _ + TokenType.Delegate, _ + TokenType.Dim, _ + TokenType.Do, _ + TokenType.Else, _ + TokenType.ElseIf, _ + TokenType.End, _ + TokenType.EndIf, _ + TokenType.Enum, _ + TokenType.Erase, _ + TokenType.Error, _ + TokenType.Event, _ + TokenType.Exit, _ + TokenType.Finally, _ + TokenType.For, _ + TokenType.Friend, _ + TokenType.Function, _ + TokenType.Get, _ + TokenType.GoTo, _ + TokenType.GoSub, _ + TokenType.If, _ + TokenType.Implements, _ + TokenType.Imports, _ + TokenType.Inherits, _ + TokenType.Interface, _ + TokenType.Loop, _ + TokenType.Module, _ + TokenType.MustInherit, _ + TokenType.MustOverride, _ + TokenType.Namespace, _ + TokenType.Narrowing, _ + TokenType.Next, _ + TokenType.NotInheritable, _ + TokenType.NotOverridable, _ + TokenType.Option, _ + TokenType.Overloads, _ + TokenType.Overridable, _ + TokenType.Overrides, _ + TokenType.Partial, _ + TokenType.Private, _ + TokenType.Property, _ + TokenType.Protected, _ + TokenType.Public, _ + TokenType.RaiseEvent, _ + TokenType.ReadOnly, _ + TokenType.ReDim, _ + TokenType.RemoveHandler, _ + TokenType.Resume, _ + TokenType.Return, _ + TokenType.Select, _ + TokenType.Shadows, _ + TokenType.Shared, _ + TokenType.Static, _ + TokenType.Stop, _ + TokenType.Structure, _ + TokenType.Sub, _ + TokenType.SyncLock, _ + TokenType.Throw, _ + TokenType.Try, _ + TokenType.Using, _ + TokenType.Wend, _ + TokenType.While, _ + TokenType.Widening, _ + TokenType.With, _ + TokenType.WithEvents, _ + TokenType.WriteOnly, _ + TokenType.Pound + Return True + + Case Else + Return False + End Select + End Function + + Private Function VerifyEndOfStatement() As Token + 'LC Added CanContinueWithoutLineTerminator to support Case statement on the single line + Dim NextToken As Token = Peek() + + Debug.Assert(Not NextToken.Type = TokenType.Comment, "Should have dealt with these by now!") + + If NextToken.Type = TokenType.LineTerminator OrElse NextToken.Type = TokenType.EndOfStream Then + AtBeginningOfLine = True + CanContinueWithoutLineTerminator = False + ElseIf NextToken.Type = TokenType.Colon Then + AtBeginningOfLine = False + ElseIf NextToken.Type = TokenType.Else AndAlso CurrentBlockContextType() = TreeType.LineIfBlockStatement Then + ' Line If statements allow Else to end the statement + AtBeginningOfLine = False + ElseIf NextToken.Type = TokenType.End AndAlso CurrentBlockContextType() = TreeType.LineIfBlockStatement Then + 'LC Line If statement can end with End If + AtBeginningOfLine = False + ElseIf CanContinueWithoutLineTerminator Then + Return NextToken + Else + ' Syntax error -- a valid statement is followed by something other than + ' a colon, end-of-line, or a comment. + ResyncAt() + ReportSyntaxError(SyntaxErrorType.ExpectedEndOfStatement, NextToken) + Return VerifyEndOfStatement() + End If + + Return Read() + End Function + + Private Shared Function MustEndStatement(ByVal token As Token) As Boolean + Return token.Type = TokenType.Colon OrElse _ + token.Type = TokenType.EndOfStream OrElse _ + token.Type = TokenType.LineTerminator OrElse _ + token.Type = TokenType.Comment + End Function + + Private Function SpanFrom(ByVal location As Location) As Span + Dim EndLocation As Location + + If Peek().Type = TokenType.EndOfStream Then + EndLocation = Scanner.Previous().Span.Finish + Else + EndLocation = Peek().Span.Start + End If + + Return New Span(location, EndLocation) + End Function + + Private Function SpanFrom(ByVal token As Token) As Span + Dim StartLocation, EndLocation As Location + + If token.Type = TokenType.EndOfStream AndAlso Not Scanner.IsOnFirstToken Then + StartLocation = Scanner.Previous().Span.Finish + EndLocation = StartLocation + Else + StartLocation = token.Span.Start + + If Peek().Type = TokenType.EndOfStream AndAlso Not Scanner.IsOnFirstToken Then + EndLocation = Scanner.Previous().Span.Finish + Else + EndLocation = Peek().Span.Start + End If + End If + + Return New Span(StartLocation, EndLocation) + End Function + + Private Function SpanFrom(ByVal startToken As Token, ByVal endToken As Token) As Span + Dim StartLocation, EndLocation As Location + + If startToken.Type = TokenType.EndOfStream AndAlso Not Scanner.IsOnFirstToken Then + StartLocation = Scanner.Previous().Span.Finish + EndLocation = StartLocation + Else + StartLocation = startToken.Span.Start + + If endToken.Type = TokenType.EndOfStream AndAlso Not Scanner.IsOnFirstToken Then + EndLocation = Scanner.Previous().Span.Finish + ElseIf endToken.Span.Start.Index = startToken.Span.Start.Index Then + EndLocation = endToken.Span.Finish + Else + EndLocation = endToken.Span.Start + End If + End If + + Return New Span(StartLocation, EndLocation) + End Function + + Private Shared Function SpanFrom(ByVal startToken As Token, ByVal endTree As Tree) As Span + Return New Span(startToken.Span.Start, endTree.Span.Finish) + End Function + + Private Function SpanFrom(ByVal startStatement As Statement, ByVal endStatement As Statement) As Span + If endStatement Is Nothing Then + Return SpanFrom(startStatement.Span.Start) + Else + Return New Span(startStatement.Span.Start, endStatement.Span.Start) + End If + End Function + + '* + '* Names + '* + + Private Function ParseSimpleName(ByVal allowKeyword As Boolean) As SimpleName + If Peek().Type = TokenType.Identifier Then + Dim IdentifierToken As IdentifierToken = CType(Read(), IdentifierToken) + Return New SimpleName(IdentifierToken.Identifier, IdentifierToken.TypeCharacter, IdentifierToken.Escaped, IdentifierToken.Span) + Else + ' If the token is a keyword, assume that the user meant it to + ' be an identifer and consume it. Otherwise, leave current token + ' as is and let caller decide what to do. + If IdentifierToken.IsKeyword(Peek().Type) Then + Dim IdentifierToken As IdentifierToken = CType(Read(), IdentifierToken) + + If Not allowKeyword Then + ReportSyntaxError(SyntaxErrorType.InvalidUseOfKeyword, IdentifierToken) + End If + + Return New SimpleName(IdentifierToken.Identifier, IdentifierToken.TypeCharacter, IdentifierToken.Escaped, IdentifierToken.Span) + Else + ReportSyntaxError(SyntaxErrorType.ExpectedIdentifier, Peek()) + Return SimpleName.GetBadSimpleName(SpanFrom(Peek(), Peek())) + End If + End If + End Function + + Private Function ParseName(ByVal AllowGlobal As Boolean) As Name + Dim Start As Token = Peek() + Dim Result As Name + Dim QualificationRequired As Boolean = False + + ' Seeing the global token implies > LanguageVersion.VisualBasic71 + If Start.Type = TokenType.Global Then + If Not AllowGlobal Then + ReportSyntaxError(SyntaxErrorType.InvalidUseOfGlobal, Peek()) + End If + + Read() + Result = New SpecialName(TreeType.GlobalNamespaceName, SpanFrom(Start)) + QualificationRequired = True + Else + Result = ParseSimpleName(False) + End If + + If Peek().Type = TokenType.Period Then + Dim Qualifier As SimpleName + Dim DotLocation As Location + + Do + DotLocation = ReadLocation() + Qualifier = ParseSimpleName(True) + Result = New QualifiedName(Result, DotLocation, Qualifier, SpanFrom(Start)) + Loop While Peek().Type = TokenType.Period + ElseIf QualificationRequired Then + ReportSyntaxError(SyntaxErrorType.ExpectedPeriod, Peek()) + End If + + Return Result + End Function + + Private Function ParseVariableName(ByVal allowExplicitArraySizes As Boolean) As VariableName + Dim Start As Token = Peek() + Dim Name As SimpleName + Dim ArrayType As ArrayTypeName = Nothing + + ' CONSIDER: Often, programmers put extra decl specifiers where they are not required. + ' Eg: Dim x as Integer, Dim y as Long + ' Check for this and give a more informative error? + + Name = ParseSimpleName(False) + + If Peek().Type = TokenType.LeftParenthesis Then + ArrayType = ParseArrayTypeName(Nothing, Nothing, allowExplicitArraySizes, False) + End If + + Return New VariableName(Name, ArrayType, SpanFrom(Start)) + End Function + + ' This function implements some of the special name parsing logic for names in a name + ' list such as Implements and Handles + Private Function ParseNameListName(Optional ByVal allowLeadingMeOrMyBase As Boolean = False) As Name + Dim Start As Token = Peek() + Dim Result As Name + + If Start.Type = TokenType.MyBase AndAlso allowLeadingMeOrMyBase Then + Result = New SpecialName(TreeType.MyBaseName, SpanFrom(ReadLocation())) + ElseIf Start.Type = TokenType.Me AndAlso allowLeadingMeOrMyBase AndAlso Scanner.Version >= LanguageVersion.VisualBasic80 Then + Result = New SpecialName(TreeType.MeName, SpanFrom(ReadLocation())) + Else + Result = ParseSimpleName(False) + End If + + If Peek().Type = TokenType.Period Then + Dim Qualifier As SimpleName + Dim DotLocation As Location + + Do + DotLocation = ReadLocation() + Qualifier = ParseSimpleName(True) + Result = New QualifiedName(Result, DotLocation, Qualifier, SpanFrom(Start)) + Loop While Peek().Type = TokenType.Period + Else + ReportSyntaxError(SyntaxErrorType.ExpectedPeriod, Peek()) + End If + + Return Result + End Function + + '* + '* Types + '* + + Private Function ParseTypeName(ByVal allowArrayType As Boolean, Optional ByVal allowOpenType As Boolean = False) As TypeName + Dim Start As Token = Peek() + Dim Result As TypeName = Nothing + Dim Types As IntrinsicType + + Select Case Start.Type + Case TokenType.Boolean + Types = IntrinsicType.Boolean + + Case TokenType.SByte + Types = IntrinsicType.SByte + + Case TokenType.Byte + Types = IntrinsicType.Byte + + Case TokenType.Short + Types = IntrinsicType.Short + + Case TokenType.UShort + Types = IntrinsicType.UShort + + Case TokenType.Integer + Types = IntrinsicType.Integer + + Case TokenType.UInteger + Types = IntrinsicType.UInteger + + Case TokenType.Long + Types = IntrinsicType.Long + + Case TokenType.ULong + Types = IntrinsicType.ULong + + Case TokenType.Decimal + Types = IntrinsicType.Decimal + + Case TokenType.Single + Types = IntrinsicType.Single + + Case TokenType.Double + Types = IntrinsicType.Double + + Case TokenType.Date + Types = IntrinsicType.Date + + Case TokenType.Char + Types = IntrinsicType.Char + + Case TokenType.String + Types = IntrinsicType.String + + Case TokenType.Object + Types = IntrinsicType.Object + + Case TokenType.Identifier, TokenType.Global + Result = ParseNamedTypeName(True, allowOpenType) + + Case Else + ReportSyntaxError(SyntaxErrorType.ExpectedType, Start) + Result = NamedTypeName.GetBadNamedType(SpanFrom(Start)) + End Select + + If Result Is Nothing Then + Read() + Result = New IntrinsicTypeName(Types, Start.Span) + End If + + If allowArrayType AndAlso Peek().Type = TokenType.LeftParenthesis Then + Return ParseArrayTypeName(Start, Result, False, False) + Else + Return Result + End If + End Function + + Private Function ParseNamedTypeName(ByVal allowGlobal As Boolean, Optional ByVal allowOpenType As Boolean = False) As NamedTypeName + Dim Start As Token = Peek() + Dim Name As Name = ParseName(allowGlobal) + + If Peek().Type = TokenType.LeftParenthesis Then + Dim LeftParenthesis As Token = Read() + + If Peek().Type = TokenType.Of Then + Return New ConstructedTypeName(Name, ParseTypeArguments(LeftParenthesis, allowOpenType), SpanFrom(Start)) + End If + + Backtrack(LeftParenthesis) + End If + + Return New NamedTypeName(Name, Name.Span) + End Function + + Private Function ParseTypeArguments(ByVal leftParenthesis As Token, Optional ByVal allowOpenType As Boolean = False) As TypeArgumentCollection + Dim Start As Token = leftParenthesis + Dim OfLocation As Location + Dim TypeArguments As List(Of TypeName) = New List(Of TypeName)() + Dim CommaLocations As List(Of Location) = New List(Of Location)() + Dim RightParenthesisLocation As Location + Dim OpenType As Boolean = False + + Debug.Assert(Peek().Type = TokenType.Of) + OfLocation = ReadLocation() + + If (Peek().Type = TokenType.Comma OrElse Peek().Type = TokenType.RightParenthesis) AndAlso allowOpenType Then + OpenType = True + End If + + If Not OpenType OrElse Peek().Type <> TokenType.RightParenthesis Then + Do + Dim TypeArgument As TypeName + + If TypeArguments.Count > 0 OrElse OpenType Then + CommaLocations.Add(ReadLocation()) + End If + + If Not OpenType Then + TypeArgument = ParseTypeName(True) + + If ErrorInConstruct Then + ResyncAt(TokenType.Comma, TokenType.RightParenthesis) + End If + + TypeArguments.Add(TypeArgument) + End If + Loop While ArrayBoundsContinue() + End If + + RightParenthesisLocation = VerifyExpectedToken(TokenType.RightParenthesis) + Return New TypeArgumentCollection(OfLocation, TypeArguments, CommaLocations, RightParenthesisLocation, SpanFrom(Start)) + End Function + + Private Function ArrayBoundsContinue() As Boolean + Dim NextToken As Token = Peek() + + If NextToken.Type = TokenType.Comma Then + Return True + ElseIf NextToken.Type = TokenType.RightParenthesis OrElse MustEndStatement(NextToken) Then + Return False + End If + + ReportSyntaxError(SyntaxErrorType.ArgumentSyntax, NextToken) + ResyncAt(TokenType.Comma, TokenType.RightParenthesis) + + If Peek().Type = TokenType.Comma Then + ErrorInConstruct = False + Return True + End If + + Return False + End Function + + Private Function ParseArrayTypeName(ByVal startType As Token, ByVal elementType As TypeName, ByVal allowExplicitSizes As Boolean, ByVal innerArrayType As Boolean) As ArrayTypeName + Dim ArgumentsStart As Token = Peek() + Dim Arguments As List(Of Argument) + Dim CommaLocations As List(Of Location) = New List(Of Location)() + Dim RightParenthesisLocation As Location + Dim ArgumentCollection As ArgumentCollection + + Debug.Assert(Peek().Type = TokenType.LeftParenthesis) + + If startType Is Nothing Then + startType = Peek() + End If + + Read() + + If Peek().Type = TokenType.RightParenthesis OrElse Peek().Type = TokenType.Comma Then + Arguments = Nothing + + While Peek().Type = TokenType.Comma + CommaLocations.Add(ReadLocation()) + End While + Else + Dim SizeStart As Token + Dim Size As Expression + + If Not allowExplicitSizes Then + If innerArrayType Then + ReportSyntaxError(SyntaxErrorType.NoConstituentArraySizes, Peek()) + Else + ReportSyntaxError(SyntaxErrorType.NoExplicitArraySizes, Peek()) + End If + End If + + Arguments = New List(Of Argument)() + + Do + If Arguments.Count > 0 Then + CommaLocations.Add(ReadLocation()) + End If + + SizeStart = Peek() + Size = ParseExpression(Scanner.Version > LanguageVersion.VisualBasic71) + + If ErrorInConstruct Then + ResyncAt(TokenType.Comma, TokenType.RightParenthesis, TokenType.As) + End If + + Arguments.Add(New Argument(Nothing, Nothing, Size, SpanFrom(SizeStart))) + Loop While ArrayBoundsContinue() + End If + + RightParenthesisLocation = VerifyExpectedToken(TokenType.RightParenthesis) + ArgumentCollection = New ArgumentCollection(Arguments, CommaLocations, RightParenthesisLocation, SpanFrom(ArgumentsStart)) + + If Peek().Type = TokenType.LeftParenthesis Then + elementType = ParseArrayTypeName(Peek(), elementType, False, True) + End If + + Return New ArrayTypeName(elementType, CommaLocations.Count + 1, ArgumentCollection, SpanFrom(startType)) + End Function + + '* + '* Initializers + '* + + Private Function ParseInitializer() As Initializer + If Peek().Type = TokenType.LeftCurlyBrace Then + Return ParseAggregateInitializer() + Else + Dim Expression As Expression = ParseExpression() + Return New ExpressionInitializer(Expression, Expression.Span) + End If + End Function + + Private Function InitializersContinue() As Boolean + Dim NextToken As Token = Peek() + + If NextToken.Type = TokenType.Comma Then + Return True + ElseIf NextToken.Type = TokenType.RightCurlyBrace OrElse MustEndStatement(NextToken) Then + Return False + End If + + ReportSyntaxError(SyntaxErrorType.InitializerSyntax, NextToken) + ResyncAt(TokenType.Comma, TokenType.RightCurlyBrace) + + If Peek().Type = TokenType.Comma Then + ErrorInConstruct = False + Return True + End If + + Return False + End Function + + Private Function ParseAggregateInitializer() As AggregateInitializer + Dim Start As Token = Peek() + Dim Initializers As List(Of Initializer) = New List(Of Initializer)() + Dim RightBracketLocation As Location + Dim CommaLocations As List(Of Location) = New List(Of Location)() + + Debug.Assert(Start.Type = TokenType.LeftCurlyBrace) + Read() + + If Peek().Type <> TokenType.RightCurlyBrace Then + Do + If Initializers.Count > 0 Then + CommaLocations.Add(ReadLocation()) + End If + + Initializers.Add(ParseInitializer()) + + If ErrorInConstruct Then + ResyncAt(TokenType.Comma, TokenType.RightCurlyBrace) + End If + Loop While InitializersContinue() + End If + + RightBracketLocation = VerifyExpectedToken(TokenType.RightCurlyBrace) + + Return New AggregateInitializer(New InitializerCollection(Initializers, CommaLocations, RightBracketLocation, SpanFrom(Start)), SpanFrom(Start)) + End Function + + '* + '* Arguments + '* + + Private Function ParseArgument(ByRef foundNamedArgument As Boolean) As Argument + Dim Start As Token = Read() + Dim Value As Expression + Dim Name As SimpleName + Dim ColonEqualsLocation As Location + + If Peek().Type = TokenType.ColonEquals Then + If Not foundNamedArgument Then + foundNamedArgument = True + End If + Else + If foundNamedArgument Then + ReportSyntaxError(SyntaxErrorType.ExpectedNamedArgument, Start) + foundNamedArgument = False + End If + End If + + Backtrack(Start) + + If foundNamedArgument Then + Name = ParseSimpleName(True) + ColonEqualsLocation = ReadLocation() + Value = ParseExpression() + Else + Name = Nothing + Value = ParseExpression() + End If + + If ErrorInConstruct Then + ResyncAt(TokenType.Comma, TokenType.RightParenthesis) + + If Peek().Type = TokenType.Comma Then + ErrorInConstruct = False + End If + End If + + Return New Argument(Name, ColonEqualsLocation, Value, SpanFrom(Start)) + End Function + + Private Function ArgumentsContinue() As Boolean + Dim NextToken As Token = Peek() + + If NextToken.Type = TokenType.Comma Then + Return True + ElseIf NextToken.Type = TokenType.RightParenthesis OrElse MustEndStatement(NextToken) Then + Return False + 'LC Line If can end with "End If" + ElseIf NextToken.Type = TokenType.End AndAlso CurrentBlockContextType() = TreeType.LineIfBlockStatement Then + Return False + End If + + ReportSyntaxError(SyntaxErrorType.ArgumentSyntax, NextToken) + ResyncAt(TokenType.Comma, TokenType.RightParenthesis) + + If Peek().Type = TokenType.Comma Then + ErrorInConstruct = False + Return True + End If + + Return False + End Function + 'LC Made requireParenthesis optional + Private Function ParseArguments(Optional ByVal requireParenthesis As Boolean = True) As ArgumentCollection + Dim Start As Token = Peek() + Dim Arguments As List(Of Argument) = New List(Of Argument)() + Dim CommaLocations As List(Of Location) = New List(Of Location)() + Dim RightParenthesisLocation As Location + + If Start.Type <> TokenType.LeftParenthesis Then + If requireParenthesis Then + Return Nothing + End If + Else + requireParenthesis = True 'If found left, then right is required to balance + Read() + End If + + If Peek().Type <> TokenType.RightParenthesis Then + Dim FoundNamedArgument As Boolean = False + Dim ArgumentStart As Token + Dim Argument As Argument + + Do + If Arguments.Count > 0 Then + CommaLocations.Add(ReadLocation()) + End If + + ArgumentStart = Peek() + + If ArgumentStart.Type = TokenType.Comma OrElse ArgumentStart.Type = TokenType.RightParenthesis Then + If FoundNamedArgument Then + ReportSyntaxError(SyntaxErrorType.ExpectedNamedArgument, Peek()) + End If + + Argument = Nothing + Else + Argument = ParseArgument(FoundNamedArgument) + End If + + Arguments.Add(Argument) + Loop While ArgumentsContinue() + End If + + If Peek().Type = TokenType.RightParenthesis Then + RightParenthesisLocation = ReadLocation() + Else + If requireParenthesis Then + Dim Current As Token = Peek() + + ' On error, peek for ")" with "(". If ")" seen before + ' "(", then sync on that. Otherwise, assume missing ")" + ' and let caller decide. + ResyncAt(TokenType.LeftParenthesis, TokenType.RightParenthesis) + + If Peek().Type = TokenType.RightParenthesis Then + ReportSyntaxError(SyntaxErrorType.SyntaxError, Peek()) + RightParenthesisLocation = ReadLocation() + Else + Backtrack(Current) + ReportSyntaxError(SyntaxErrorType.ExpectedRightParenthesis, Peek()) + End If + Else + RightParenthesisLocation = Peek().Span.Start 'LC No ")". Just give it a dummy + End If + End If + Return New ArgumentCollection(Arguments, CommaLocations, RightParenthesisLocation, SpanFrom(Start)) + End Function + + '* + '* Expressions + '* + + Private Function ParseLiteralExpression() As LiteralExpression + Dim Start As Token = Read() + + Select Case Start.Type + Case TokenType.True, TokenType.False + Return New BooleanLiteralExpression(Start.Type = TokenType.True, Start.Span) + + Case TokenType.IntegerLiteral + Dim Literal As IntegerLiteralToken = CType(Start, IntegerLiteralToken) + Return New IntegerLiteralExpression(Literal.Literal, Literal.IntegerBase, Literal.TypeCharacter, Literal.Span) + + Case TokenType.FloatingPointLiteral + Dim Literal As FloatingPointLiteralToken = CType(Start, FloatingPointLiteralToken) + Return New FloatingPointLiteralExpression(Literal.Literal, Literal.TypeCharacter, Literal.Span) + + Case TokenType.DecimalLiteral + Dim Literal As DecimalLiteralToken = CType(Start, DecimalLiteralToken) + Return New DecimalLiteralExpression(Literal.Literal, Literal.TypeCharacter, Literal.Span) + + Case TokenType.CharacterLiteral + Dim Literal As CharacterLiteralToken = CType(Start, CharacterLiteralToken) + Return New CharacterLiteralExpression(Literal.Literal, Literal.Span) + + Case TokenType.StringLiteral + Dim Literal As StringLiteralToken = CType(Start, StringLiteralToken) + Return New StringLiteralExpression(Literal.Literal, Literal.Span) + + Case TokenType.DateLiteral + Dim Literal As DateLiteralToken = CType(Start, DateLiteralToken) + Return New DateLiteralExpression(Literal.Literal, Literal.Span) + + Case Else + Debug.Assert(False, "Unexpected.") + End Select + + Return Nothing + End Function + + Private Function ParseCastExpression() As Expression + Dim Start As Token = Read() + Dim OperatorType As IntrinsicType + Dim Operand As Expression + Dim LeftParenthesisLocation As Location + Dim RightParenthesisLocation As Location + + Select Case Start.Type + Case TokenType.CBool + OperatorType = IntrinsicType.Boolean + + Case TokenType.CChar + OperatorType = IntrinsicType.Char + + Case TokenType.CDate + OperatorType = IntrinsicType.Date + + Case TokenType.CDbl + OperatorType = IntrinsicType.Double + + Case TokenType.CByte + OperatorType = IntrinsicType.Byte + + Case TokenType.CShort + OperatorType = IntrinsicType.Short + + Case TokenType.CInt + OperatorType = IntrinsicType.Integer + + Case TokenType.CLng + OperatorType = IntrinsicType.Long + + Case TokenType.CSng + OperatorType = IntrinsicType.Single + + Case TokenType.CStr + OperatorType = IntrinsicType.String + + Case TokenType.CDec + OperatorType = IntrinsicType.Decimal + + Case TokenType.CObj + OperatorType = IntrinsicType.Object + + Case TokenType.CSByte + OperatorType = IntrinsicType.SByte + + Case TokenType.CUShort + OperatorType = IntrinsicType.UShort + + Case TokenType.CUInt + OperatorType = IntrinsicType.UInteger + + Case TokenType.CULng + OperatorType = IntrinsicType.ULong + + Case Else + Debug.Assert(False, "Unexpected.") + Return Nothing + End Select + + LeftParenthesisLocation = VerifyExpectedToken(TokenType.LeftParenthesis) + Operand = ParseExpression() + RightParenthesisLocation = VerifyExpectedToken(TokenType.RightParenthesis) + + Return New IntrinsicCastExpression(OperatorType, LeftParenthesisLocation, Operand, RightParenthesisLocation, SpanFrom(Start)) + End Function + + Private Function ParseCTypeExpression() As Expression + Dim Start As Token = Read() + Dim Operand As Expression + Dim Target As TypeName + Dim LeftParenthesisLocation As Location + Dim RightParenthesisLocation As Location + Dim CommaLocation As Location + + Debug.Assert(Start.Type = TokenType.CType OrElse Start.Type = TokenType.DirectCast OrElse Start.Type = TokenType.TryCast) + + LeftParenthesisLocation = VerifyExpectedToken(TokenType.LeftParenthesis) + Operand = ParseExpression() + + If ErrorInConstruct Then + ResyncAt(TokenType.Comma, TokenType.RightParenthesis) + End If + + CommaLocation = VerifyExpectedToken(TokenType.Comma) + Target = ParseTypeName(True) + RightParenthesisLocation = VerifyExpectedToken(TokenType.RightParenthesis) + + If Start.Type = TokenType.CType Then + Return New CTypeExpression(LeftParenthesisLocation, Operand, CommaLocation, Target, RightParenthesisLocation, SpanFrom(Start)) + ElseIf Start.Type = TokenType.DirectCast Then + Return New DirectCastExpression(LeftParenthesisLocation, Operand, CommaLocation, Target, RightParenthesisLocation, SpanFrom(Start)) + Else + Return New TryCastExpression(LeftParenthesisLocation, Operand, CommaLocation, Target, RightParenthesisLocation, SpanFrom(Start)) + End If + End Function + + Private Function ParseInstanceExpression() As Expression + Dim Start As Token = Read() + Dim InstanceType As InstanceType + + Select Case Start.Type + Case TokenType.Me + InstanceType = InstanceType.Me + + Case TokenType.MyClass + InstanceType = InstanceType.MyClass + + If Peek().Type <> TokenType.Period Then + ReportSyntaxError(SyntaxErrorType.ExpectedPeriodAfterMyClass, Start) + End If + + Case TokenType.MyBase + InstanceType = InstanceType.MyBase + + If Peek().Type <> TokenType.Period Then + ReportSyntaxError(SyntaxErrorType.ExpectedPeriodAfterMyBase, Start) + End If + + Case Else + Debug.Assert(False, "Unexpected.") + End Select + + Return New InstanceExpression(InstanceType, Start.Span) + End Function + + Private Function ParseParentheticalExpression() As Expression + Dim Operand As Expression + Dim Start As Token = Read() + Dim RightParenthesisLocation As Location + + Debug.Assert(Start.Type = TokenType.LeftParenthesis) + + Operand = ParseExpression() + RightParenthesisLocation = VerifyExpectedToken(TokenType.RightParenthesis) + + Return New ParentheticalExpression(Operand, RightParenthesisLocation, SpanFrom(Start)) + End Function + + Private Function ParseSimpleNameExpression() As Expression + Dim Start As Token = Peek() + Return New SimpleNameExpression(ParseSimpleName(False), SpanFrom(Start)) + End Function + + Private Function ParseDotBangExpression(ByVal start As Token, ByVal terminal As Expression) As Expression + Dim Name As SimpleName + Dim DotBang As Token + + Debug.Assert(Peek().Type = TokenType.Period OrElse Peek().Type = TokenType.Exclamation) + + DotBang = Read() + Name = ParseSimpleName(True) + + If DotBang.Type = TokenType.Period Then + Return New QualifiedExpression(terminal, DotBang.Span.Start, Name, SpanFrom(start)) + Else + Return New DictionaryLookupExpression(terminal, DotBang.Span.Start, Name, SpanFrom(start)) + End If + End Function + + Private Function ParseCallOrIndexExpression(ByVal start As Token, ByVal terminal As Expression) As Expression + Dim Arguments As ArgumentCollection + + ' Because parentheses are used for array indexing, parameter passing, and array + ' declaring (via the Redim statement), there is some ambiguity about how to handle + ' a parenthesized list that begins with an expression. The most general case is to + ' parse it as an argument list. + + Arguments = ParseArguments() + Return New CallOrIndexExpression(terminal, Arguments, SpanFrom(start)) + End Function + + Private Function ParseTypeOfExpression() As Expression + Dim Start As Token = Peek() + Dim Value As Expression + Dim Target As TypeName + Dim IsLocation As Location + + Debug.Assert(Start.Type = TokenType.TypeOf) + + Read() + Value = ParseBinaryOperatorExpression(PrecedenceLevel.Relational) + + If ErrorInConstruct Then + ResyncAt(TokenType.Is) + End If + + IsLocation = VerifyExpectedToken(TokenType.Is) + Target = ParseTypeName(True) + + Return New TypeOfExpression(Value, IsLocation, Target, SpanFrom(Start)) + End Function + + Private Function ParseGetTypeExpression() As Expression + Dim Start As Token = Read() + Dim Target As TypeName + Dim LeftParenthesisLocation As Location + Dim RightParenthesisLocation As Location + + Debug.Assert(Start.Type = TokenType.GetType) + LeftParenthesisLocation = VerifyExpectedToken(TokenType.LeftParenthesis) + Target = ParseTypeName(True, True) + RightParenthesisLocation = VerifyExpectedToken(TokenType.RightParenthesis) + + Return New GetTypeExpression(LeftParenthesisLocation, Target, RightParenthesisLocation, SpanFrom(Start)) + End Function + + Private Function ParseNewExpression() As Expression + Dim Start As Token = Read() + Dim TypeStart As Token + Dim Type As TypeName + Dim Arguments As ArgumentCollection + Dim ArgumentsStart As Token + + Debug.Assert(Start.Type = TokenType.[New]) + + TypeStart = Peek() + Type = ParseTypeName(False) + + If ErrorInConstruct Then + ResyncAt(TokenType.LeftParenthesis) + End If + + ArgumentsStart = Peek() + + ' This is an ambiguity in the grammar between + ' + ' New ( ) + ' New + ' + ' Try it as the first form, and if this fails, try the second. + ' (All valid instances of the second form have a beginning that is a valid + ' instance of the first form, so no spurious errors should result.) + + Arguments = ParseArguments() + + If (Peek().Type = TokenType.LeftCurlyBrace OrElse Peek().Type = TokenType.LeftParenthesis) AndAlso _ + Arguments IsNot Nothing Then + Dim ArrayType As ArrayTypeName + + ' Treat this as the form of New expression that allocates an array. + Backtrack(ArgumentsStart) + ArrayType = ParseArrayTypeName(TypeStart, Type, True, False) + + If Peek().Type = TokenType.LeftCurlyBrace Then + Dim Initializer As AggregateInitializer = ParseAggregateInitializer() + Return New NewAggregateExpression(ArrayType, Initializer, SpanFrom(Start)) + Else + HandleUnexpectedToken(TokenType.LeftCurlyBrace) + End If + End If + + Return New NewExpression(Type, Arguments, SpanFrom(Start)) + End Function + + Private Function ParseTerminalExpression() As Expression + Dim Start As Token = Peek() + Dim Terminal As Expression + + Select Case Start.Type + Case TokenType.Identifier + Terminal = ParseSimpleNameExpression() + + Case TokenType.IntegerLiteral, TokenType.FloatingPointLiteral, TokenType.DecimalLiteral, _ + TokenType.CharacterLiteral, TokenType.StringLiteral, TokenType.DateLiteral, _ + TokenType.True, TokenType.False + Terminal = ParseLiteralExpression() + + Case TokenType.CBool, TokenType.CByte, TokenType.CShort, TokenType.CInt, TokenType.CLng, _ + TokenType.CDec, TokenType.CSng, TokenType.CDbl, TokenType.CChar, TokenType.CStr, _ + TokenType.CDate, TokenType.CObj, TokenType.CSByte, TokenType.CUShort, TokenType.CUInt, _ + TokenType.CULng + Terminal = ParseCastExpression() + + Case TokenType.DirectCast, TokenType.CType, TokenType.TryCast + Terminal = ParseCTypeExpression() + + Case TokenType.Me, TokenType.MyBase, TokenType.MyClass + Terminal = ParseInstanceExpression() + + Case TokenType.Global + Terminal = New GlobalExpression(Read().Span) + + If Peek().Type <> TokenType.Period Then + ReportSyntaxError(SyntaxErrorType.ExpectedPeriodAfterGlobal, Start) + End If + + Case TokenType.Nothing + Terminal = New NothingExpression(Read().Span) + + Case TokenType.LeftParenthesis + Terminal = ParseParentheticalExpression() + + Case TokenType.Period, TokenType.Exclamation + Terminal = ParseDotBangExpression(Start, Nothing) + + Case TokenType.TypeOf + Terminal = ParseTypeOfExpression() + + Case TokenType.GetType + Terminal = ParseGetTypeExpression() + + Case TokenType.[New] + Terminal = ParseNewExpression() + + Case TokenType.Short, TokenType.Integer, TokenType.Long, TokenType.Decimal, _ + TokenType.Single, TokenType.Double, TokenType.Byte, TokenType.Boolean, _ + TokenType.Char, TokenType.Date, TokenType.String, TokenType.Object + 'Dim ReferencedType As TypeName = ParseTypeName(False) + + 'Terminal = New TypeReferenceExpression(ReferencedType, ReferencedType.Span) + 'LC Parse the terminal as SimpleName Expression rather than TypeReferenceExpression + Terminal = New SimpleNameExpression(ParseSimpleName(True), SpanFrom(Start)) + + If Scanner.Peek.Type = TokenType.Period Then + Terminal = ParseDotBangExpression(Start, Terminal) + 'LC commented out the following to allow keyword to be used as a function + 'Else + ' HandleUnexpectedToken(TokenType.Period) + End If + + Case Else + ReportSyntaxError(SyntaxErrorType.ExpectedExpression, Peek()) + Terminal = Expression.GetBadExpression(SpanFrom(Peek(), Peek())) + End Select + + ' Valid suffixes are ".", "!", and "(". Everything else is considered + ' to end the term. + + While True + Dim NextToken As Token = Peek() + + If NextToken.Type = TokenType.Period OrElse NextToken.Type = TokenType.Exclamation Then + Terminal = ParseDotBangExpression(Start, Terminal) + ElseIf NextToken.Type = TokenType.LeftParenthesis Then + Dim LeftParenthesis As Token = Read() + + If Peek().Type = TokenType.Of Then + Return New GenericQualifiedExpression(Terminal, ParseTypeArguments(LeftParenthesis, False), SpanFrom(Start)) + Else + Backtrack(LeftParenthesis) + Terminal = ParseCallOrIndexExpression(Start, Terminal) + End If + Else + Exit While + End If + End While + + Return Terminal + End Function + + Private Function ParseUnaryOperatorExpression() As Expression + Dim Start As Token = Peek() + Dim Operand As Expression + Dim OperatorType As OperatorType + + Select Case Start.Type + Case TokenType.Minus + OperatorType = OperatorType.Negate + + Case TokenType.Plus + OperatorType = OperatorType.UnaryPlus + + Case TokenType.Not + OperatorType = OperatorType.Not + + Case TokenType.AddressOf + Read() + Operand = ParseBinaryOperatorExpression(PrecedenceLevel.None) + Return New AddressOfExpression(Operand, SpanFrom(Start, Operand)) + + Case Else + Return ParseTerminalExpression() + End Select + + Read() + Operand = ParseBinaryOperatorExpression(GetOperatorPrecedence(OperatorType)) + Return New UnaryOperatorExpression(OperatorType, Operand, SpanFrom(Start, Operand)) + End Function + + Private Function ParseBinaryOperatorExpression(ByVal pendingPrecedence As PrecedenceLevel, Optional ByVal allowRange As Boolean = False) As Expression + Dim Expression As Expression + Dim Start As Token = Peek() + + Expression = ParseUnaryOperatorExpression() + + ' Parse operators that follow the term according to precedence. + While True + Dim OperatorType As OperatorType = GetBinaryOperator(Peek().Type, allowRange) + Dim Right As Expression + Dim Precedence As PrecedenceLevel + Dim OperatorLocation As Location + + If OperatorType = OperatorType.None Then + Exit While + End If + + Precedence = GetOperatorPrecedence(OperatorType) + + ' Only continue parsing if precedence is high enough + If Precedence <= pendingPrecedence Then + Exit While + End If + + OperatorLocation = ReadLocation() + Right = ParseBinaryOperatorExpression(Precedence) + Expression = New BinaryOperatorExpression(Expression, OperatorType, OperatorLocation, Right, SpanFrom(Start, Right)) + End While + + Return Expression + End Function + + Private Function ParseExpressionList(Optional ByVal requireExpression As Boolean = False) As ExpressionCollection + Dim Start As Token = Peek() + Dim Expressions As List(Of Expression) = New List(Of Expression)() + Dim CommaLocations As List(Of Location) = New List(Of Location)() + + If CanEndStatement(Start) AndAlso Not requireExpression Then + Return Nothing + End If + + Do + If Expressions.Count > 0 Then + CommaLocations.Add(ReadLocation()) + End If + + Expressions.Add(ParseExpression()) + + If ErrorInConstruct Then + ResyncAt(TokenType.Comma) + End If + Loop While Peek().Type = TokenType.Comma + + If Expressions.Count = 0 AndAlso CommaLocations.Count = 0 Then + Return Nothing + Else + Return New ExpressionCollection(Expressions, CommaLocations, SpanFrom(Start)) + End If + End Function + + Private Function ParseExpression(Optional ByVal allowRange As Boolean = False) As Expression + Return ParseBinaryOperatorExpression(PrecedenceLevel.None, allowRange) + End Function + + '* + '* Statements + '* + + Private Function ParseExpressionStatement(ByVal type As TreeType, ByVal operandOptional As Boolean) As Statement + Dim Start As Token = Peek() + Dim Operand As Expression = Nothing + + Read() + + If Not operandOptional OrElse Not CanEndStatement(Peek()) Then + Operand = ParseExpression() + End If + + If ErrorInConstruct Then + ResyncAt() + End If + + Select Case type + Case TreeType.ReturnStatement + Return New ReturnStatement(Operand, SpanFrom(Start), ParseTrailingComments()) + + Case TreeType.ErrorStatement + Return New ErrorStatement(Operand, SpanFrom(Start), ParseTrailingComments()) + + Case TreeType.ThrowStatement + Return New ThrowStatement(Operand, SpanFrom(Start), ParseTrailingComments()) + + Case Else + Debug.Assert(False, "Unexpected!") + Return Nothing + End Select + End Function + + ' Parse a reference to a label, which can be an identifier or a line number. + Private Sub ParseLabelReference(ByRef name As SimpleName, ByRef isLineNumber As Boolean) + Dim Start As Token = Peek() + + If Start.Type = TokenType.Identifier Then + name = ParseSimpleName(False) + isLineNumber = False + ElseIf Start.Type = TokenType.IntegerLiteral Then + Dim IntegerLiteral As IntegerLiteralToken = CType(Start, IntegerLiteralToken) + + If IntegerLiteral.TypeCharacter <> TypeCharacter.None Then + ReportSyntaxError(SyntaxErrorType.SyntaxError, Start) + End If + + name = New SimpleName(CStr(IntegerLiteral.Literal), TypeCharacter.None, False, IntegerLiteral.Span) + isLineNumber = True + Read() + Else + ReportSyntaxError(SyntaxErrorType.ExpectedIdentifier, Start) + name = SimpleName.GetBadSimpleName(SpanFrom(Start)) + isLineNumber = False + End If + End Sub + + Private Function ParseGotoStatement() As Statement + Dim Start As Token = Peek() + Dim Name As SimpleName = Nothing + Dim IsLineNumber As Boolean + + Read() + ParseLabelReference(Name, IsLineNumber) + + If ErrorInConstruct Then + ResyncAt() + End If + + Return New GotoStatement(Name, IsLineNumber, SpanFrom(Start), ParseTrailingComments()) + End Function + + Private Function ParseContinueStatement() As Statement + Dim Start As Token = Peek() + Dim ContinueType As BlockType + Dim ContinueArgumentLocation As Location + + Read() + + ContinueType = GetContinueType(Peek().Type) + + If ContinueType = BlockType.None Then + ReportSyntaxError(SyntaxErrorType.ExpectedContinueKind, Peek()) + ResyncAt() + Else + ContinueArgumentLocation = ReadLocation() + End If + + Return New ContinueStatement(ContinueType, ContinueArgumentLocation, SpanFrom(Start), ParseTrailingComments()) + End Function + + Private Function ParseExitStatement() As Statement + Dim Start As Token = Peek() + Dim ExitType As BlockType + Dim ExitArgumentLocation As Location + + Read() + + ExitType = GetExitType(Peek().Type) + + If ExitType = BlockType.None Then + ReportSyntaxError(SyntaxErrorType.ExpectedExitKind, Peek()) + ResyncAt() + Else + ExitArgumentLocation = ReadLocation() + End If + + Return New ExitStatement(ExitType, ExitArgumentLocation, SpanFrom(Start), ParseTrailingComments()) + End Function + + Private Function ParseEndStatement() As Statement + Dim Start As Token = Read() + Dim EndType As BlockType = GetBlockType(Peek().Type) + + If EndType = BlockType.None Then + Return New EndStatement(SpanFrom(Start), ParseTrailingComments()) + End If + + Return New EndBlockStatement(EndType, ReadLocation(), SpanFrom(Start), ParseTrailingComments()) + End Function + + Private Function ParseWendStatement() As Statement + Dim Start As Token = Read() + Return New EndBlockStatement(BlockType.While, Start.Span.Finish, SpanFrom(Start), ParseTrailingComments()) + End Function + + Private Function ParseRaiseEventStatement() As Statement + Dim Start As Token = Peek() + Dim Name As SimpleName + Dim Arguments As ArgumentCollection + + Read() + Name = ParseSimpleName(True) + + If ErrorInConstruct Then + ResyncAt() + End If + + Arguments = ParseArguments() + + Return New RaiseEventStatement(Name, Arguments, SpanFrom(Start), ParseTrailingComments()) + End Function + + Private Function ParseHandlerStatement() As Statement + Dim Start As Token = Peek() + Dim EventName As Expression + Dim DelegateExpression As Expression + Dim CommaLocation As Location + + Read() + EventName = ParseExpression() + + If ErrorInConstruct Then + ResyncAt(TokenType.Comma) + End If + + CommaLocation = VerifyExpectedToken(TokenType.Comma) + DelegateExpression = ParseExpression() + + If ErrorInConstruct Then + ResyncAt() + End If + + If Start.Type = TokenType.AddHandler Then + Return New AddHandlerStatement(EventName, CommaLocation, DelegateExpression, SpanFrom(Start), ParseTrailingComments()) + Else + Return New RemoveHandlerStatement(EventName, CommaLocation, DelegateExpression, SpanFrom(Start), ParseTrailingComments()) + End If + End Function + + Private Function ParseOnErrorStatement() As Statement + Dim Start As Token = Read() + Dim OnErrorType As OnErrorType + Dim NextToken As Token + Dim Name As SimpleName = Nothing + Dim IsLineNumber As Boolean + Dim ErrorLocation As Location + Dim ResumeOrGoToLocation As Location + Dim NextOrZeroOrMinusLocation As Location + Dim OneLocation As Location + + If Peek().Type = TokenType.Error Then + ErrorLocation = ReadLocation() + NextToken = Peek() + + If NextToken.Type = TokenType.Resume Then + ResumeOrGoToLocation = ReadLocation() + + If Peek().Type = TokenType.Next Then + NextOrZeroOrMinusLocation = ReadLocation() + Else + ReportSyntaxError(SyntaxErrorType.ExpectedNext, Peek()) + End If + + OnErrorType = OnErrorType.Next + ElseIf NextToken.Type = TokenType.GoTo Then + ResumeOrGoToLocation = ReadLocation() + NextToken = Peek() + + If NextToken.Type = TokenType.IntegerLiteral AndAlso _ + CType(NextToken, IntegerLiteralToken).Literal = 0 Then + NextOrZeroOrMinusLocation = ReadLocation() + OnErrorType = OnErrorType.Zero + ElseIf NextToken.Type = TokenType.Minus Then + Dim NextNextToken As Token + + NextOrZeroOrMinusLocation = ReadLocation() + NextNextToken = Peek() + + If NextNextToken.Type = TokenType.IntegerLiteral AndAlso _ + CType(NextNextToken, IntegerLiteralToken).Literal = 1 Then + OneLocation = ReadLocation() + OnErrorType = OnErrorType.MinusOne + Else + Backtrack(NextToken) + GoTo Label + End If + Else +Label: + OnErrorType = OnErrorType.Label + ParseLabelReference(Name, IsLineNumber) + + If ErrorInConstruct Then + ResyncAt() + End If + End If + Else + ReportSyntaxError(SyntaxErrorType.ExpectedResumeOrGoto, Peek()) + OnErrorType = OnErrorType.Bad + ResyncAt() + End If + Else + ReportSyntaxError(SyntaxErrorType.ExpectedError, Peek()) + OnErrorType = OnErrorType.Bad + ResyncAt() + End If + + Return New OnErrorStatement(OnErrorType, ErrorLocation, ResumeOrGoToLocation, NextOrZeroOrMinusLocation, OneLocation, Name, IsLineNumber, SpanFrom(Start), ParseTrailingComments()) + End Function + + Private Function ParseResumeStatement() As Statement + Dim Start As Token = Read() + Dim ResumeType As ResumeType = ResumeType.None + Dim Name As SimpleName = Nothing + Dim IsLineNumber As Boolean + Dim NextLocation As Location + + If Not CanEndStatement(Peek()) Then + If Peek().Type = TokenType.Next Then + NextLocation = ReadLocation() + ResumeType = ResumeType.Next + Else + ParseLabelReference(Name, IsLineNumber) + + If ErrorInConstruct Then + ResumeType = ResumeType.None + Else + ResumeType = ResumeType.Label + End If + End If + End If + + Return New ResumeStatement(ResumeType, NextLocation, Name, IsLineNumber, SpanFrom(Start), ParseTrailingComments()) + End Function + + Private Function ParseReDimStatement() As Statement + Dim Start As Token = Read() + Dim PreserveLocation As Location + Dim Variables As ExpressionCollection + + If Peek().AsUnreservedKeyword() = TokenType.Preserve Then + PreserveLocation = ReadLocation() + End If + + Variables = ParseExpressionList(True) + + Return New ReDimStatement(PreserveLocation, Variables, SpanFrom(Start), ParseTrailingComments()) + End Function + + Private Function ParseEraseStatement() As Statement + Dim Start As Token = Read() + Dim Variables As ExpressionCollection = ParseExpressionList(True) + + Return New EraseStatement(Variables, SpanFrom(Start), ParseTrailingComments()) + End Function + + Private Function ParseCallStatement(Optional ByVal target As Expression = Nothing) As Statement + Dim Start As Token = Peek() + Dim StartLocation As Location + Dim CallLocation As Location + Dim Arguments As ArgumentCollection = Nothing + + If target Is Nothing Then + StartLocation = Start.Span.Start + + If Start.Type = TokenType.Call Then + CallLocation = ReadLocation() + End If + + target = ParseExpression() + + If ErrorInConstruct Then + ResyncAt() + End If + Else + StartLocation = target.Span.Start + End If + + If target.Type = TreeType.CallOrIndexExpression Then + ' Extract the operands of the call/index expression and make + ' them operands of the call statement. + Dim CallOrIndexExpression As CallOrIndexExpression = CType(target, CallOrIndexExpression) + + target = CallOrIndexExpression.TargetExpression + Arguments = CallOrIndexExpression.Arguments + ElseIf Not MustEndStatement(Peek()) Then 'LC Allow calls like response.write "hello" + Arguments = ParseArguments(False) + End If + + Return New CallStatement(CallLocation, target, Arguments, SpanFrom(StartLocation), ParseTrailingComments()) + End Function + + Private Function ParseMidAssignmentStatement() As Statement + Dim Start As Token = Read() + Dim Identifier As IdentifierToken = CType(Start, IdentifierToken) + Dim HasTypeCharacter As Boolean + Dim LeftParenthesisLocation As Location + Dim Target As Expression + Dim StartCommaLocation As Location + Dim StartExpression As Expression + Dim LengthCommaLocation As Location = Nothing + Dim LengthExpression As Expression = Nothing + Dim RightParenthesisLocation As Location + Dim OperatorLocation As Location + Dim Source As Expression + + If Identifier.TypeCharacter = TypeCharacter.StringSymbol Then + HasTypeCharacter = True + ElseIf Identifier.TypeCharacter <> TypeCharacter.None Then + GoTo NotMidAssignment + End If + + If Peek().Type = TokenType.LeftParenthesis Then + LeftParenthesisLocation = VerifyExpectedToken(TokenType.LeftParenthesis) + Else + GoTo NotMidAssignment + End If + + ' This is very unfortunate: ideally, we would continue parsing to + ' make sure the entire statement matched the form of a Mid assignment + ' statement. That way something like "Mid(10) = 5", where Mid is an + ' array identifier wouldn't cause an error. Alas, it's not that simple + ' because what about something that's in error? We could fall back on + ' error, but we have no way of backtracking on errors at the moment. + ' So we're going to do what the official compiler does: if we see + ' Mid and (, you've got yourself a Mid assignment statement! + Target = ParseExpression() + + If ErrorInConstruct Then + ResyncAt(TokenType.Comma) + End If + + StartCommaLocation = VerifyExpectedToken(TokenType.Comma) + StartExpression = ParseExpression() + + If ErrorInConstruct Then + ResyncAt(TokenType.Comma, TokenType.RightParenthesis) + End If + + If Peek().Type = TokenType.Comma Then + LengthCommaLocation = VerifyExpectedToken(TokenType.Comma) + LengthExpression = ParseExpression() + + If ErrorInConstruct Then + ResyncAt(TokenType.RightParenthesis) + End If + End If + + RightParenthesisLocation = VerifyExpectedToken(TokenType.RightParenthesis) + OperatorLocation = VerifyExpectedToken(TokenType.Equals) + + Source = ParseExpression() + + If ErrorInConstruct Then + ResyncAt() + End If + + Return New MidAssignmentStatement(HasTypeCharacter, LeftParenthesisLocation, Target, StartCommaLocation, StartExpression, LengthCommaLocation, LengthExpression, RightParenthesisLocation, OperatorLocation, Source, SpanFrom(Start), ParseTrailingComments()) + +NotMidAssignment: + Backtrack(Start) + Return Nothing + End Function + + Private Function ParseAssignmentStatement(ByVal target As Expression, ByVal isSetStatement As Boolean) As Statement + Dim CompoundOperator As OperatorType + Dim Source As Expression + Dim [Operator] As Token + + [Operator] = Read() + CompoundOperator = GetCompoundAssignmentOperatorType([Operator].Type) + Source = ParseExpression() + + If ErrorInConstruct Then + ResyncAt() + End If + + If CompoundOperator = TreeType.SyntaxError Then + Return New AssignmentStatement(target, [Operator].Span.Start, Source, SpanFrom(target.Span.Start), ParseTrailingComments(), isSetStatement) + Else + Return New CompoundAssignmentStatement(CompoundOperator, target, [Operator].Span.Start, Source, SpanFrom(target.Span.Start), ParseTrailingComments()) + End If + End Function + + Private Function ParseLocalDeclarationStatement() As Statement + Dim Start As Token = Peek() + Dim Modifiers As ModifierCollection + Const ValidModifiers As ModifierTypes = ModifierTypes.Dim Or _ + ModifierTypes.Const Or _ + ModifierTypes.Static + + Modifiers = ParseDeclarationModifierList() + ValidateModifierList(Modifiers, ValidModifiers) + + If Modifiers Is Nothing Then + ReportSyntaxError(SyntaxErrorType.ExpectedModifier, Peek()) + ElseIf Modifiers.Count > 1 Then + ReportSyntaxError(SyntaxErrorType.InvalidVariableModifiers, Modifiers.Span) + End If + + Return New LocalDeclarationStatement(Modifiers, ParseVariableDeclarators(), SpanFrom(Start), ParseTrailingComments()) + End Function + + Private Function ParseLabelStatement() As Statement + Dim Name As SimpleName = Nothing + Dim IsLineNumber As Boolean + Dim Start As Token = Peek() + + ParseLabelReference(Name, IsLineNumber) + Return New LabelStatement(Name, IsLineNumber, SpanFrom(Start), ParseTrailingComments()) + End Function + + Private Function ParseExpressionBlockStatement(ByVal blockType As TreeType) As Statement + Dim Start As Token = Read() + Dim Expression As Expression = ParseExpression() + Dim StatementCollection As StatementCollection + Dim EndStatement As Statement = Nothing + Dim Comments As List(Of Comment) = Nothing + + If ErrorInConstruct Then + ResyncAt() + End If + + StatementCollection = ParseStatementBlock(SpanFrom(Start), blockType, Comments, EndStatement) + + Select Case blockType + Case TreeType.WithBlockStatement + Return New WithBlockStatement(Expression, StatementCollection, CType(EndStatement, EndBlockStatement), SpanFrom(Start), Comments) + + Case TreeType.SyncLockBlockStatement + Return New SyncLockBlockStatement(Expression, StatementCollection, CType(EndStatement, EndBlockStatement), SpanFrom(Start), Comments) + + Case TreeType.WhileBlockStatement + Return New WhileBlockStatement(Expression, StatementCollection, CType(EndStatement, EndBlockStatement), SpanFrom(Start), Comments) + + Case Else + Debug.Assert(False, "Unexpected!") + Return Nothing + End Select + End Function + + Private Function ParseUsingBlockStatement() As Statement + Dim Start As Token = Read() + Dim Expression As Expression = Nothing + Dim VariableDeclarators As VariableDeclaratorCollection = Nothing + Dim StatementCollection As StatementCollection + Dim EndStatement As Statement = Nothing + Dim Comments As List(Of Comment) = Nothing + Dim NextToken As Token = PeekAheadOne() + + If NextToken.Type = TokenType.As OrElse NextToken.Type = TokenType.Equals Then + VariableDeclarators = ParseVariableDeclarators() + Else + Expression = ParseExpression() + End If + + If ErrorInConstruct Then + ResyncAt() + End If + + StatementCollection = ParseStatementBlock(SpanFrom(Start), TreeType.UsingBlockStatement, Comments, EndStatement) + + If Expression Is Nothing Then + Return New UsingBlockStatement(VariableDeclarators, StatementCollection, CType(EndStatement, EndBlockStatement), SpanFrom(Start), Comments) + Else + Return New UsingBlockStatement(Expression, StatementCollection, CType(EndStatement, EndBlockStatement), SpanFrom(Start), Comments) + End If + End Function + + Private Function ParseOptionalWhileUntilClause(ByRef isWhile As Boolean, ByRef whileOrUntilLocation As Location) As Expression + Dim Expression As Expression = Nothing + + If Not CanEndStatement(Peek()) Then + Dim Token As Token = Peek() + + If Token.Type = TokenType.While OrElse Token.AsUnreservedKeyword() = TokenType.Until Then + isWhile = (Token.Type = TokenType.While) + whileOrUntilLocation = ReadLocation() + Expression = ParseExpression() + + If ErrorInConstruct Then + ResyncAt() + End If + Else + ReportSyntaxError(SyntaxErrorType.SyntaxError, Peek()) + ResyncAt() + End If + End If + + Return Expression + End Function + + Private Function ParseDoBlockStatement() As Statement + Dim Start As Token = Read() + Dim IsWhile As Boolean + Dim Expression As Expression + Dim WhileOrUntilLocation As Location + Dim StatementCollection As StatementCollection + Dim EndStatement As Statement = Nothing + Dim LoopStatement As LoopStatement + Dim Comments As List(Of Comment) = Nothing + + Expression = ParseOptionalWhileUntilClause(IsWhile, WhileOrUntilLocation) + + StatementCollection = ParseStatementBlock(SpanFrom(Start), TreeType.DoBlockStatement, Comments, EndStatement) + LoopStatement = CType(EndStatement, LoopStatement) + + If Expression IsNot Nothing AndAlso LoopStatement IsNot Nothing AndAlso LoopStatement.Expression IsNot Nothing Then + ReportSyntaxError(SyntaxErrorType.LoopDoubleCondition, LoopStatement.Expression.Span) + End If + + Return New DoBlockStatement(Expression, IsWhile, WhileOrUntilLocation, StatementCollection, LoopStatement, SpanFrom(Start), Comments) + End Function + + Private Function ParseLoopStatement() As Statement + Dim Start As Token = Read() + Dim IsWhile As Boolean + Dim Expression As Expression + Dim WhileOrUntilLocation As Location + + Expression = ParseOptionalWhileUntilClause(IsWhile, WhileOrUntilLocation) + Return New LoopStatement(Expression, IsWhile, WhileOrUntilLocation, SpanFrom(Start), ParseTrailingComments()) + End Function + + Private Function ParseForLoopControlVariable(ByRef variableDeclarator As VariableDeclarator) As Expression + Dim Start As Token = Peek() + + If Start.Type = TokenType.Identifier Then + Dim NextToken As Token = PeekAheadOne() + Dim Expression As Expression = Nothing + + ' CONSIDER: Should we just always parse this as a variable declaration? + If NextToken.Type = TokenType.As Then + variableDeclarator = ParseForLoopVariableDeclarator(Expression) + Return Expression + ElseIf NextToken.Type = TokenType.LeftParenthesis Then + ' CONSIDER: Only do this if the token previous to the As is a right parenthesis + If PeekAheadFor(TokenType.As, TokenType.In, TokenType.Equals) = TokenType.As Then + variableDeclarator = ParseForLoopVariableDeclarator(Expression) + Return Expression + End If + End If + End If + + Return ParseBinaryOperatorExpression(PrecedenceLevel.Relational) + End Function + + Private Function ParseForBlockStatement() As Statement + Dim Start As Token = Read() + + If Peek().Type <> TokenType.Each Then + Dim ControlExpression As Expression + Dim LowerBoundExpression As Expression = Nothing + Dim UpperBoundExpression As Expression = Nothing + Dim StepExpression As Expression = Nothing + Dim EqualLocation As Location + Dim ToLocation As Location + Dim StepLocation As Location + Dim VariableDeclarator As VariableDeclarator = Nothing + Dim Statements As StatementCollection + Dim NextStatement As Statement = Nothing + Dim Comments As List(Of Comment) = Nothing + + ControlExpression = ParseForLoopControlVariable(VariableDeclarator) + + If ErrorInConstruct Then + ResyncAt(TokenType.Equals, TokenType.To) + End If + + If Peek().Type = TokenType.Equals Then + EqualLocation = ReadLocation() + LowerBoundExpression = ParseExpression() + + If ErrorInConstruct Then + ResyncAt(TokenType.To) + End If + Else + ReportSyntaxError(SyntaxErrorType.SyntaxError, Peek()) + ResyncAt(TokenType.To) + End If + + If Peek().Type = TokenType.To Then + ToLocation = ReadLocation() + UpperBoundExpression = ParseExpression() + + If ErrorInConstruct Then + ResyncAt(TokenType.Step) + End If + Else + ReportSyntaxError(SyntaxErrorType.SyntaxError, Peek()) + ResyncAt(TokenType.Step) + End If + + If Peek().Type = TokenType.Step Then + StepLocation = ReadLocation() + StepExpression = ParseExpression() + + If ErrorInConstruct Then + ResyncAt() + End If + End If + + Statements = ParseStatementBlock(SpanFrom(Start), TreeType.ForBlockStatement, Comments, NextStatement) + + Return New ForBlockStatement(ControlExpression, VariableDeclarator, EqualLocation, LowerBoundExpression, ToLocation, UpperBoundExpression, StepLocation, StepExpression, Statements, CType(NextStatement, NextStatement), SpanFrom(Start), Comments) + Else + Dim EachLocation As Location + Dim ControlExpression As Expression + Dim InLocation As Location + Dim VariableDeclarator As VariableDeclarator = Nothing + Dim CollectionExpression As Expression = Nothing + Dim Statements As StatementCollection + Dim NextStatement As Statement = Nothing + Dim Comments As List(Of Comment) = Nothing + + EachLocation = ReadLocation() + ControlExpression = ParseForLoopControlVariable(VariableDeclarator) + + If ErrorInConstruct Then + ResyncAt(TokenType.In) + End If + + If Peek().Type = TokenType.In Then + InLocation = ReadLocation() + CollectionExpression = ParseExpression() + + If ErrorInConstruct Then + ResyncAt() + End If + Else + ReportSyntaxError(SyntaxErrorType.SyntaxError, Peek()) + ResyncAt() + End If + + Statements = ParseStatementBlock(SpanFrom(Start), TreeType.ForBlockStatement, Comments, NextStatement) + + Return New ForEachBlockStatement(EachLocation, ControlExpression, VariableDeclarator, InLocation, CollectionExpression, Statements, CType(NextStatement, NextStatement), SpanFrom(Start), Comments) + End If + End Function + + Private Function ParseNextStatement() As Statement + Dim Start As Token = Read() + + Return New NextStatement(ParseExpressionList(), SpanFrom(Start), ParseTrailingComments()) + End Function + + Private Function ParseTryBlockStatement() As Statement + Dim Start As Token = Read() + Dim TryStatementList As StatementCollection + Dim StatementCollection As StatementCollection + Dim EndBlockStatement As Statement = Nothing + Dim CatchBlocks As List(Of Statement) = New List(Of Statement)() + Dim CatchBlockList As StatementCollection = Nothing + Dim FinallyBlock As FinallyBlockStatement = Nothing + Dim Comments As List(Of Comment) = Nothing + + TryStatementList = ParseStatementBlock(SpanFrom(Start), TreeType.TryBlockStatement, Comments, EndBlockStatement) + + While (EndBlockStatement IsNot Nothing) AndAlso (EndBlockStatement.Type <> TreeType.EndBlockStatement) + If EndBlockStatement.Type = TreeType.CatchStatement Then + Dim CatchStatement As CatchStatement = CType(EndBlockStatement, CatchStatement) + + StatementCollection = ParseStatementBlock(CatchStatement.Span, TreeType.CatchBlockStatement, Nothing, EndBlockStatement) + CatchBlocks.Add(New CatchBlockStatement(CatchStatement, StatementCollection, SpanFrom(CatchStatement, EndBlockStatement), Nothing)) + Else + Dim FinallyStatement As FinallyStatement = CType(EndBlockStatement, FinallyStatement) + + StatementCollection = ParseStatementBlock(FinallyStatement.Span, TreeType.FinallyBlockStatement, Nothing, EndBlockStatement) + FinallyBlock = New FinallyBlockStatement(FinallyStatement, StatementCollection, SpanFrom(FinallyStatement, EndBlockStatement), Nothing) + End If + End While + + If CatchBlocks.Count > 0 Then + CatchBlockList = New StatementCollection(CatchBlocks, Nothing, _ + New Span(CType(CatchBlocks(0), CatchBlockStatement).Span.Start, _ + CType(CatchBlocks(CatchBlocks.Count - 1), CatchBlockStatement).Span.Finish)) + End If + + Return New TryBlockStatement(TryStatementList, CatchBlockList, FinallyBlock, CType(EndBlockStatement, EndBlockStatement), SpanFrom(Start), Comments) + End Function + + Private Function ParseCatchStatement() As Statement + Dim Start As Token = Read() + Dim Name As SimpleName = Nothing + Dim AsLocation As Location + Dim Type As TypeName = Nothing + Dim WhenLocation As Location + Dim Filter As Expression = Nothing + + If Peek().Type = TokenType.Identifier Then + Name = ParseSimpleName(False) + + If Peek().Type = TokenType.As Then + AsLocation = ReadLocation() + Type = ParseTypeName(False) + + If ErrorInConstruct Then + ResyncAt(TokenType.When) + End If + End If + End If + + If Peek().Type = TokenType.When Then + WhenLocation = ReadLocation() + Filter = ParseExpression() + End If + + Return New CatchStatement(Name, AsLocation, Type, WhenLocation, Filter, SpanFrom(Start), ParseTrailingComments()) + End Function + + Private Function ParseCaseStatement() As Statement + Dim Start As Token = Read() + Dim CommaLocations As List(Of Location) + Dim Cases As List(Of CaseClause) + Dim CasesStart As Token = Peek() + + If Peek().Type = TokenType.Else Then + Return New CaseElseStatement(ReadLocation(), SpanFrom(Start), ParseTrailingComments()) + Else + CommaLocations = New List(Of Location)() + Cases = New List(Of CaseClause)() + + Do + If Cases.Count > 0 Then + CommaLocations.Add(ReadLocation()) + End If + + Cases.Add(ParseCase()) + Loop While Peek().Type = TokenType.Comma + + Return New CaseStatement(New CaseClauseCollection(Cases, CommaLocations, SpanFrom(CasesStart)), SpanFrom(Start), ParseTrailingComments()) + End If + End Function + + Private Function ParseSelectBlockStatement() As Statement + Dim Start As Token = Read() + Dim CaseLocation As Location + Dim SelectExpression As Expression + Dim Statements As StatementCollection + Dim EndBlockStatement As Statement = Nothing + Dim CaseBlocks As List(Of Statement) = New List(Of Statement)() + Dim CaseBlockList As StatementCollection = Nothing + Dim CaseElseBlockStatement As CaseElseBlockStatement = Nothing + Dim Comments As List(Of Comment) = Nothing + + If Peek().Type = TokenType.Case Then + CaseLocation = ReadLocation() + End If + + SelectExpression = ParseExpression() + + If ErrorInConstruct Then + ResyncAt() + End If + + Statements = ParseStatementBlock(SpanFrom(Start), TreeType.SelectBlockStatement, Comments, EndBlockStatement) + + If Statements IsNot Nothing AndAlso Statements.Count <> 0 Then + For Each Statement As Statement In Statements + If Statement.Type <> TreeType.EmptyStatement Then + ReportSyntaxError(SyntaxErrorType.ExpectedCase, Statements.Span) + End If + Next + End If + + While (EndBlockStatement IsNot Nothing) AndAlso (EndBlockStatement.Type <> TreeType.EndBlockStatement) + Dim CaseStatement As Statement = EndBlockStatement + Dim CaseStatements As StatementCollection + + If CaseStatement.Type = TreeType.CaseStatement Then + CaseStatements = ParseStatementBlock(CaseStatement.Span, TreeType.CaseBlockStatement, Nothing, EndBlockStatement) + CaseBlocks.Add(New CaseBlockStatement(CType(CaseStatement, CaseStatement), CaseStatements, SpanFrom(CaseStatement, EndBlockStatement), Nothing)) + Else + CaseStatements = ParseStatementBlock(CaseStatement.Span, TreeType.CaseElseBlockStatement, Nothing, EndBlockStatement) + CaseElseBlockStatement = New CaseElseBlockStatement(CType(CaseStatement, CaseElseStatement), CaseStatements, SpanFrom(CaseStatement, EndBlockStatement), Nothing) + End If + End While + + If CaseBlocks.Count > 0 Then + CaseBlockList = New StatementCollection(CaseBlocks, Nothing, _ + New Span(CType(CaseBlocks(0), CaseBlockStatement).Span.Start, _ + CType(CaseBlocks(CaseBlocks.Count - 1), CaseBlockStatement).Span.Finish)) + End If + + Return New SelectBlockStatement(CaseLocation, SelectExpression, Statements, CaseBlockList, CaseElseBlockStatement, CType(EndBlockStatement, EndBlockStatement), SpanFrom(Start), Comments) + End Function + + Private Function ParseElseIfStatement() As Statement + Dim Start As Token = Read() + Dim ThenLocation As Location + Dim Expression As Expression + + Expression = ParseExpression() + + If ErrorInConstruct Then + ResyncAt(TokenType.Then) + End If + + If Peek().Type = TokenType.Then Then + ThenLocation = ReadLocation() + End If + + Return New ElseIfStatement(Expression, ThenLocation, SpanFrom(Start), ParseTrailingComments()) + End Function + + Private Function ParseIfBlockStatement() As Statement + Dim Start As Token = Read() + Dim Expression As Expression + Dim ThenLocation As Location + Dim Statements As StatementCollection + Dim IfStatements As StatementCollection + Dim EndBlockStatement As Statement = Nothing + Dim ElseIfBlocks As List(Of Statement) = New List(Of Statement)() + Dim ElseIfBlockList As StatementCollection = Nothing + Dim ElseBlockStatement As ElseBlockStatement = Nothing + Dim Comments As List(Of Comment) = Nothing + + Expression = ParseExpression() + + If ErrorInConstruct Then + ResyncAt(TokenType.Then) + End If + + If Peek().Type = TokenType.Then Then + ThenLocation = ReadLocation() + + If Not CanEndStatement(Peek()) Then + Dim ElseLocation As Location + Dim ElseStatements As StatementCollection = Nothing + + ' We're in a line If context + AtBeginningOfLine = False + IfStatements = ParseLineIfStatementBlock() + + If Peek().Type = TokenType.Else Then + ElseLocation = ReadLocation() + ElseStatements = ParseLineIfStatementBlock() + End If + + Return New LineIfStatement(Expression, ThenLocation, IfStatements, ElseLocation, ElseStatements, SpanFrom(Start), ParseTrailingComments()) + End If + End If + + IfStatements = ParseStatementBlock(SpanFrom(Start), TreeType.IfBlockStatement, Comments, EndBlockStatement) + + While (EndBlockStatement IsNot Nothing) AndAlso (EndBlockStatement.Type <> TreeType.EndBlockStatement) + Dim ElseStatement As Statement = EndBlockStatement + + If ElseStatement.Type = TreeType.ElseIfStatement Then + Statements = ParseStatementBlock(ElseStatement.Span, TreeType.ElseIfBlockStatement, Nothing, EndBlockStatement) + ElseIfBlocks.Add(New ElseIfBlockStatement(CType(ElseStatement, ElseIfStatement), Statements, SpanFrom(ElseStatement, EndBlockStatement), Nothing)) + Else + Statements = ParseStatementBlock(ElseStatement.Span, TreeType.ElseBlockStatement, Nothing, EndBlockStatement) + ElseBlockStatement = New ElseBlockStatement(CType(ElseStatement, ElseStatement), Statements, SpanFrom(ElseStatement, EndBlockStatement), Nothing) + End If + End While + + If ElseIfBlocks.Count > 0 Then + ElseIfBlockList = New StatementCollection(ElseIfBlocks, Nothing, _ + New Span(CType(ElseIfBlocks(0), Statement).Span.Start, _ + CType(ElseIfBlocks(ElseIfBlocks.Count - 1), Statement).Span.Finish)) + End If + + Return New IfBlockStatement(Expression, ThenLocation, IfStatements, ElseIfBlockList, ElseBlockStatement, CType(EndBlockStatement, EndBlockStatement), SpanFrom(Start), Comments) + End Function + + Private Function ParseStatement(Optional ByRef terminator As Token = Nothing) As Statement + Dim Start As Token = Peek() + Dim Statement As Statement = Nothing + + 'If AtBeginningOfLine Then + ' While ParsePreprocessorStatement(True) + ' Start = Peek() + ' End While + 'End If + + ErrorInConstruct = False + + Select Case Start.Type + Case TokenType.GoTo + Statement = ParseGotoStatement() + + Case TokenType.Exit + Statement = ParseExitStatement() + + Case TokenType.Continue + Statement = ParseContinueStatement() + + Case TokenType.Stop + Statement = New StopStatement(SpanFrom(Read()), ParseTrailingComments()) + + Case TokenType.End + Statement = ParseEndStatement() + + 'LC Added Wend back + Case TokenType.Wend + Statement = ParseWendStatement() + + Case TokenType.Return + Statement = ParseExpressionStatement(TreeType.ReturnStatement, True) + + Case TokenType.RaiseEvent + Statement = ParseRaiseEventStatement() + + Case TokenType.AddHandler, TokenType.RemoveHandler + Statement = ParseHandlerStatement() + + Case TokenType.Error + Statement = ParseExpressionStatement(TreeType.ErrorStatement, False) + + Case TokenType.On + Statement = ParseOnErrorStatement() + + Case TokenType.Resume + Statement = ParseResumeStatement() + + Case TokenType.ReDim + Statement = ParseReDimStatement() + + Case TokenType.Erase + Statement = ParseEraseStatement() + + Case TokenType.Call + Statement = ParseCallStatement() + + Case TokenType.IntegerLiteral + If AtBeginningOfLine Then + Statement = ParseLabelStatement() + Else + GoTo SyntaxError + End If + + 'LC Add Set statement for VBScript + Case TokenType.Set + Read() + Dim Target As Expression + + Target = ParseBinaryOperatorExpression(PrecedenceLevel.Power) + + If ErrorInConstruct Then + ResyncAt(TokenType.Equals) + End If + + If GetAssignmentOperator(Peek().Type) <> TreeType.SyntaxError Then + Statement = ParseAssignmentStatement(Target, True) + Else + 'Missing assignment + GoTo SyntaxError + End If + + Case TokenType.Identifier + If AtBeginningOfLine Then + Dim IsLabel As Boolean + + Read() + IsLabel = Peek().Type = TokenType.Colon + Backtrack(Start) + + If IsLabel Then + Statement = ParseLabelStatement() + Else + GoTo NotLabel + End If + Else +NotLabel: + If Start.AsUnreservedKeyword() = TokenType.Mid Then + Statement = ParseMidAssignmentStatement() + End If + + If Statement Is Nothing Then + GoTo AssignmentOrCallStatement + End If + End If + + Case TokenType.Period, TokenType.Exclamation, _ + TokenType.Me, TokenType.MyBase, TokenType.MyClass, _ + TokenType.Boolean, TokenType.Byte, TokenType.Short, TokenType.Integer, TokenType.Long, _ + TokenType.Decimal, TokenType.Single, TokenType.Double, TokenType.Date, TokenType.Char, _ + TokenType.String, TokenType.Object, _ + TokenType.DirectCast, TokenType.CType, _ + TokenType.CBool, TokenType.CByte, TokenType.CShort, TokenType.CInt, TokenType.CLng, _ + TokenType.CDec, TokenType.CSng, TokenType.CDbl, TokenType.CDate, TokenType.CChar, _ + TokenType.CStr, TokenType.CObj, _ + TokenType.GetType + Dim Target As Expression + +AssignmentOrCallStatement: + Target = ParseBinaryOperatorExpression(PrecedenceLevel.Power) + + If ErrorInConstruct Then + ResyncAt(TokenType.Equals) + End If + + ' Could be a function call or it could be an assignment + If GetAssignmentOperator(Peek().Type) <> TreeType.SyntaxError Then + Statement = ParseAssignmentStatement(Target, False) + Else + Statement = ParseCallStatement(Target) + End If + + Case TokenType.Public, TokenType.Private, TokenType.Protected, TokenType.Friend, _ + TokenType.Static, TokenType.Shared, TokenType.Shadows, TokenType.Overloads, _ + TokenType.MustInherit, TokenType.NotInheritable, TokenType.Overrides, TokenType.NotOverridable, _ + TokenType.Overridable, TokenType.MustOverride, TokenType.Partial, TokenType.ReadOnly, TokenType.WriteOnly, _ + TokenType.Dim, TokenType.Const, TokenType.Default, TokenType.WithEvents, TokenType.Widening, TokenType.Narrowing + Statement = ParseLocalDeclarationStatement() + + Case TokenType.With + Statement = ParseExpressionBlockStatement(TreeType.WithBlockStatement) + + Case TokenType.SyncLock + Statement = ParseExpressionBlockStatement(TreeType.SyncLockBlockStatement) + + Case TokenType.Using + Statement = ParseUsingBlockStatement() + + Case TokenType.While + Statement = ParseExpressionBlockStatement(TreeType.WhileBlockStatement) + + Case TokenType.Do + Statement = ParseDoBlockStatement() + + Case TokenType.Loop + Statement = ParseLoopStatement() + + Case TokenType.For + Statement = ParseForBlockStatement() + + Case TokenType.Next + Statement = ParseNextStatement() + + Case TokenType.Throw + Statement = ParseExpressionStatement(TreeType.ThrowStatement, True) + + Case TokenType.Try + Statement = ParseTryBlockStatement() + + Case TokenType.Catch + Statement = ParseCatchStatement() + + Case TokenType.Finally + Statement = New FinallyStatement(SpanFrom(Read()), ParseTrailingComments()) + + Case TokenType.Select + Statement = ParseSelectBlockStatement() + + Case TokenType.Case + Statement = ParseCaseStatement() + CanContinueWithoutLineTerminator = True + + Case TokenType.If + Statement = ParseIfBlockStatement() + + Case TokenType.Else + Statement = New ElseStatement(SpanFrom(Read()), ParseTrailingComments()) + + Case TokenType.ElseIf + Statement = ParseElseIfStatement() + + Case TokenType.LineTerminator, TokenType.Colon + ' An empty statement + + Case TokenType.Comment + Dim Comments As List(Of Comment) = New List(Of Comment)() + Dim LastTerminator As Token + + Do + Dim CommentToken As CommentToken = CType(Scanner.Read(), CommentToken) + Comments.Add(New Comment(CommentToken.Comment, CommentToken.IsREM, CommentToken.Span)) + LastTerminator = Read() ' Eat the terminator of the comment + Loop While Peek().Type = TokenType.Comment + Backtrack(LastTerminator) + + Statement = New EmptyStatement(SpanFrom(Start), New List(Of Comment)(Comments)) + + Case Else +SyntaxError: + ReportSyntaxError(SyntaxErrorType.SyntaxError, Peek()) + End Select + + terminator = VerifyEndOfStatement() + + Return Statement + End Function + + Private Function ParseStatementOrDeclaration(Optional ByRef terminator As Token = Nothing) As Statement + Dim Start As Token = Peek() + Dim StartLocation As Location + Dim Statement As Statement = Nothing + + 'If AtBeginningOfLine Then + ' While ParsePreprocessorStatement(True) + ' Start = Peek() + ' End While + 'End If + + ErrorInConstruct = False + StartLocation = Peek().Span.Start + + Select Case Start.Type + Case TokenType.GoTo + Statement = ParseGotoStatement() + + Case TokenType.Exit + Statement = ParseExitStatement() + + Case TokenType.Continue + Statement = ParseContinueStatement() + + Case TokenType.Stop + Statement = New StopStatement(SpanFrom(Read()), ParseTrailingComments()) + + Case TokenType.End + Statement = ParseEndStatement() + + 'LC Added Wend back + Case TokenType.Wend + Statement = ParseWendStatement() + + Case TokenType.Return + Statement = ParseExpressionStatement(TreeType.ReturnStatement, True) + + Case TokenType.RaiseEvent + Statement = ParseRaiseEventStatement() + + Case TokenType.AddHandler, TokenType.RemoveHandler + Statement = ParseHandlerStatement() + + Case TokenType.Error + Statement = ParseExpressionStatement(TreeType.ErrorStatement, False) + + Case TokenType.On + Statement = ParseOnErrorStatement() + + Case TokenType.Resume + Statement = ParseResumeStatement() + + Case TokenType.ReDim + Statement = ParseReDimStatement() + + Case TokenType.Erase + Statement = ParseEraseStatement() + + Case TokenType.Call + Statement = ParseCallStatement() + + Case TokenType.IntegerLiteral + If AtBeginningOfLine Then + Statement = ParseLabelStatement() + Else + GoTo SyntaxError + End If + + 'LC Add Set statement for VBScript + Case TokenType.Set + Read() + Dim Target As Expression + + Target = ParseBinaryOperatorExpression(PrecedenceLevel.Power) + + If ErrorInConstruct Then + ResyncAt(TokenType.Equals) + End If + + If GetAssignmentOperator(Peek().Type) <> TreeType.SyntaxError Then + Statement = ParseAssignmentStatement(Target, True) + Else + 'Missing assignment + GoTo SyntaxError + End If + + Case TokenType.Identifier + If AtBeginningOfLine Then + Dim IsLabel As Boolean + + Read() + IsLabel = Peek().Type = TokenType.Colon + Backtrack(Start) + + If IsLabel Then + Statement = ParseLabelStatement() + Else + GoTo NotLabel + End If + Else +NotLabel: + If Start.AsUnreservedKeyword() = TokenType.Mid Then + Statement = ParseMidAssignmentStatement() + End If + + If Statement Is Nothing Then + GoTo AssignmentOrCallStatement + End If + End If + + Case TokenType.Period, TokenType.Exclamation, _ + TokenType.Me, TokenType.MyBase, TokenType.MyClass, _ + TokenType.Boolean, TokenType.Byte, TokenType.Short, TokenType.Integer, TokenType.Long, _ + TokenType.Decimal, TokenType.Single, TokenType.Double, TokenType.Date, TokenType.Char, _ + TokenType.String, TokenType.Object, _ + TokenType.DirectCast, TokenType.CType, _ + TokenType.CBool, TokenType.CByte, TokenType.CShort, TokenType.CInt, TokenType.CLng, _ + TokenType.CDec, TokenType.CSng, TokenType.CDbl, TokenType.CDate, TokenType.CChar, _ + TokenType.CStr, TokenType.CObj, _ + TokenType.GetType + Dim Target As Expression + +AssignmentOrCallStatement: + Target = ParseBinaryOperatorExpression(PrecedenceLevel.Power) + + If ErrorInConstruct Then + ResyncAt(TokenType.Equals) + End If + + ' Could be a function call or it could be an assignment + If GetAssignmentOperator(Peek().Type) <> TreeType.SyntaxError Then + Statement = ParseAssignmentStatement(Target, False) + Else + Statement = ParseCallStatement(Target) + End If + + Case TokenType.Public, TokenType.Private, TokenType.Protected, TokenType.Friend, _ + TokenType.Static, TokenType.Shared, TokenType.Shadows, TokenType.Overloads, _ + TokenType.MustInherit, TokenType.NotInheritable, TokenType.Overrides, TokenType.NotOverridable, _ + TokenType.Overridable, TokenType.MustOverride, TokenType.Partial, TokenType.ReadOnly, TokenType.WriteOnly, _ + TokenType.Dim, TokenType.Const, TokenType.Default, TokenType.WithEvents, TokenType.Widening, TokenType.Narrowing + 'LC Sub or function can have public/private modifier + Dim NextToken As Token = PeekAheadOne() + Select Case NextToken.Type + Case TokenType.Sub, TokenType.Function, TokenType.Default + Dim Modifiers As ModifierCollection = ParseDeclarationModifierList() + Statement = ParseMethodDeclaration(StartLocation, Nothing, Nothing) + Case Else + Statement = ParseLocalDeclarationStatement() + End Select + + Case TokenType.With + Statement = ParseExpressionBlockStatement(TreeType.WithBlockStatement) + + Case TokenType.SyncLock + Statement = ParseExpressionBlockStatement(TreeType.SyncLockBlockStatement) + + Case TokenType.Using + Statement = ParseUsingBlockStatement() + + Case TokenType.While + Statement = ParseExpressionBlockStatement(TreeType.WhileBlockStatement) + + Case TokenType.Do + Statement = ParseDoBlockStatement() + + Case TokenType.Loop + Statement = ParseLoopStatement() + + Case TokenType.For + Statement = ParseForBlockStatement() + + Case TokenType.Next + Statement = ParseNextStatement() + + Case TokenType.Throw + Statement = ParseExpressionStatement(TreeType.ThrowStatement, True) + + Case TokenType.Try + Statement = ParseTryBlockStatement() + + Case TokenType.Catch + Statement = ParseCatchStatement() + + Case TokenType.Finally + Statement = New FinallyStatement(SpanFrom(Read()), ParseTrailingComments()) + + Case TokenType.Select + Statement = ParseSelectBlockStatement() + + Case TokenType.Case + Statement = ParseCaseStatement() + + Case TokenType.If + Statement = ParseIfBlockStatement() + + Case TokenType.Else + Statement = New ElseStatement(SpanFrom(Read()), ParseTrailingComments()) + + Case TokenType.ElseIf + Statement = ParseElseIfStatement() + + Case TokenType.LineTerminator, TokenType.Colon + ' An empty statement + + 'LC added method declaration parsing + Case TokenType.Sub, TokenType.Function + Statement = ParseMethodDeclaration(StartLocation, Nothing, Nothing) + + Case TokenType.Class + Statement = ParseTypeDeclaration(StartLocation, Nothing, Nothing, TreeType.ClassDeclaration) + + Case TokenType.LineTerminator, TokenType.Colon + ' An empty statement + + Case TokenType.Imports + Statement = ParseImportsDeclaration(StartLocation, Nothing, Nothing) + + Case TokenType.Option + Statement = ParseOptionDeclaration(StartLocation, Nothing, Nothing) + + Case TokenType.Comment + Dim Comments As List(Of Comment) = New List(Of Comment)() + Dim LastTerminator As Token + + Do + Dim CommentToken As CommentToken = CType(Scanner.Read(), CommentToken) + Comments.Add(New Comment(CommentToken.Comment, CommentToken.IsREM, CommentToken.Span)) + LastTerminator = Read() ' Eat the terminator of the comment + Loop While Peek().Type = TokenType.Comment + Backtrack(LastTerminator) + + Statement = New EmptyStatement(SpanFrom(Start), New List(Of Comment)(Comments)) + + Case Else +SyntaxError: + ReportSyntaxError(SyntaxErrorType.SyntaxError, Peek()) + End Select + + terminator = VerifyEndOfStatement() + + Return Statement + End Function + + Private Function ParseStatementBlock(ByVal blockStartSpan As Span, ByVal blockType As TreeType, ByRef Comments As List(Of Comment), Optional ByRef endStatement As Statement = Nothing) As StatementCollection + Dim Statements As List(Of Statement) = New List(Of Statement)() + Dim ColonLocations As List(Of Location) = New List(Of Location)() + Dim Terminator As Token + Dim Start As Token + Dim StatementsEnd As Location + Dim BlockTerminated As Boolean = False + + Debug.Assert(blockType <> TreeType.LineIfBlockStatement) + Comments = ParseTrailingComments() + Terminator = VerifyEndOfStatement() + CanContinueWithoutLineTerminator = False + + If Terminator.Type = TokenType.Colon Then + If blockType = TreeType.SubDeclaration OrElse _ + blockType = TreeType.FunctionDeclaration OrElse _ + blockType = TreeType.ConstructorDeclaration OrElse _ + blockType = TreeType.OperatorDeclaration OrElse _ + blockType = TreeType.GetAccessorDeclaration OrElse _ + blockType = TreeType.SetAccessorDeclaration OrElse _ + blockType = TreeType.AddHandlerAccessorDeclaration OrElse _ + blockType = TreeType.RemoveHandlerAccessorDeclaration OrElse _ + blockType = TreeType.RaiseEventAccessorDeclaration Then + ReportSyntaxError(SyntaxErrorType.MethodBodyNotAtLineStart, Terminator.Span) + End If + + ColonLocations.Add(Terminator.Span.Start) + End If + + Start = Peek() + StatementsEnd = Start.Span.Finish + endStatement = Nothing + + PushBlockContext(blockType) + + While Peek().Type <> TokenType.EndOfStream + Dim PreviousTerminator As Token = Terminator + Dim Statement As Statement + + Statement = ParseStatement(Terminator) + + If Statement IsNot Nothing Then + If Statement.Type >= TreeType.LoopStatement AndAlso Statement.Type <= TreeType.EndBlockStatement Then + If StatementEndsBlock(blockType, Statement) Then + endStatement = Statement + Backtrack(Terminator) + BlockTerminated = True + Exit While + Else + Dim StatementEndsOuterBlock As Boolean = False + + ' If the end statement matches an outer block context, then we want to unwind + ' up to that level. Otherwise, we want to just give an error and keep going. + For Each BlockContext As TreeType In BlockContextStack + If StatementEndsBlock(BlockContext, Statement) Then + StatementEndsOuterBlock = True + Exit For + End If + Next + + If StatementEndsOuterBlock Then + ReportMismatchedEndError(blockType, Statement.Span) + ' CONSIDER: Can we avoid parsing and re-parsing this statement? + Backtrack(PreviousTerminator) + ' We consider the block terminated. + BlockTerminated = True + Exit While + Else + ReportMissingBeginStatementError(blockType, Statement) + End If + End If + End If + + Statements.Add(Statement) + End If + + If Terminator.Type = TokenType.Colon Then + ColonLocations.Add(Terminator.Span.Start) + StatementsEnd = Terminator.Span.Finish + Else + StatementsEnd = Terminator.Span.Finish + End If + End While + + If Not BlockTerminated Then + ReportMismatchedEndError(blockType, blockStartSpan) + End If + + PopBlockContext() + + If Statements.Count = 0 AndAlso ColonLocations.Count = 0 Then + Return Nothing + Else + Return New StatementCollection(Statements, ColonLocations, New Span(Start.Span.Start, StatementsEnd)) + End If + End Function + + Private Function ParseLineIfStatementBlock() As StatementCollection + Dim Statements As List(Of Statement) = New List(Of Statement)() + Dim ColonLocations As List(Of Location) = New List(Of Location)() + Dim Terminator As Token = Nothing + Dim Start As Token + Dim StatementsEnd As Location + + Start = Peek() + StatementsEnd = Start.Span.Finish + + PushBlockContext(TreeType.LineIfBlockStatement) + + While Not CanEndStatement(Peek()) + Dim Statement As Statement + + Statement = ParseStatement(Terminator) + + If Statement IsNot Nothing Then + If Statement.Type >= TreeType.LoopStatement AndAlso Statement.Type <= TreeType.EndBlockStatement Then + ReportSyntaxError(SyntaxErrorType.EndInLineIf, Statement.Span) + End If + + Statements.Add(Statement) + End If + + If Terminator.Type = TokenType.Colon Then + ColonLocations.Add(Terminator.Span.Start) + StatementsEnd = Terminator.Span.Finish + Else + Backtrack(Terminator) + Exit While + End If + End While + + 'LC LineIf can end with endif + If Terminator.Type = TokenType.End Then + Dim Statement As Statement + Statement = ParseStatement(Terminator) + If StatementEndsBlock(CurrentBlockContextType(), Statement) Then + Backtrack(Terminator) + Else + ReportSyntaxError(SyntaxErrorType.ExpectedEndIf, Statement.Span) + End If + End If + + PopBlockContext() + + If Statements.Count = 0 AndAlso ColonLocations.Count = 0 Then + Return Nothing + Else + Return New StatementCollection(Statements, ColonLocations, New Span(Start.Span.Start, StatementsEnd)) + End If + End Function + + '* + '* Modifiers + '* + + Private Sub ValidateModifierList(ByVal modifiers As ModifierCollection, ByVal validTypes As ModifierTypes) + If modifiers Is Nothing Then + Return + End If + + For Each Modifier As Modifier In modifiers + If (validTypes And Modifier.ModifierType) = 0 Then + ReportSyntaxError(SyntaxErrorType.InvalidModifier, Modifier.Span) + End If + Next + End Sub + + Private Function ParseDeclarationModifierList() As ModifierCollection + Dim Modifiers As List(Of Modifier) = New List(Of Modifier)() + Dim Start As Token = Peek() + Dim ModifierTypes As ModifierTypes + Dim FoundTypes As ModifierTypes + + While True + Select Case Peek().Type + Case TokenType.Public + ModifierTypes = ModifierTypes.Public + + Case TokenType.Private + ModifierTypes = ModifierTypes.Private + + Case TokenType.Protected + ModifierTypes = ModifierTypes.Protected + + Case TokenType.Friend + ModifierTypes = ModifierTypes.Friend + + Case TokenType.Static + ModifierTypes = ModifierTypes.Static + + Case TokenType.Shared + ModifierTypes = ModifierTypes.Shared + + Case TokenType.Shadows + ModifierTypes = ModifierTypes.Shadows + + Case TokenType.Overloads + ModifierTypes = ModifierTypes.Overloads + + Case TokenType.MustInherit + ModifierTypes = ModifierTypes.MustInherit + + Case TokenType.NotInheritable + ModifierTypes = ModifierTypes.NotInheritable + + Case TokenType.Overrides + ModifierTypes = ModifierTypes.Overrides + + Case TokenType.Overridable + ModifierTypes = ModifierTypes.Overridable + + Case TokenType.NotOverridable + ModifierTypes = ModifierTypes.NotOverridable + + Case TokenType.MustOverride + ModifierTypes = ModifierTypes.MustOverride + + Case TokenType.Partial + ModifierTypes = ModifierTypes.Partial + + Case TokenType.ReadOnly + ModifierTypes = ModifierTypes.ReadOnly + + Case TokenType.WriteOnly + ModifierTypes = ModifierTypes.WriteOnly + + Case TokenType.Dim + ModifierTypes = ModifierTypes.Dim + + Case TokenType.Const + ModifierTypes = ModifierTypes.Const + + Case TokenType.Default + ModifierTypes = ModifierTypes.Default + + Case TokenType.WithEvents + ModifierTypes = ModifierTypes.WithEvents + + Case TokenType.Widening + ModifierTypes = ModifierTypes.Widening + + Case TokenType.Narrowing + ModifierTypes = ModifierTypes.Narrowing + + Case Else + Exit While + End Select + + If (FoundTypes And ModifierTypes) <> 0 Then + ReportSyntaxError(SyntaxErrorType.DuplicateModifier, Peek()) + Else + FoundTypes = FoundTypes Or ModifierTypes + End If + + Modifiers.Add(New Modifier(ModifierTypes, SpanFrom(Read()))) + End While + + If Modifiers.Count = 0 Then + Return Nothing + Else + Return New ModifierCollection(Modifiers, SpanFrom(Start)) + End If + End Function + + Private Function ParseParameterModifierList() As ModifierCollection + Dim Modifiers As List(Of Modifier) = New List(Of Modifier)() + Dim Start As Token = Peek() + Dim ModifierTypes As ModifierTypes + Dim FoundTypes As ModifierTypes + + While True + Select Case Peek().Type + Case TokenType.ByVal + ModifierTypes = ModifierTypes.ByVal + + Case TokenType.ByRef + ModifierTypes = ModifierTypes.ByRef + + Case TokenType.Optional + ModifierTypes = ModifierTypes.Optional + + Case TokenType.ParamArray + ModifierTypes = ModifierTypes.ParamArray + + Case Else + Exit While + End Select + + If (FoundTypes And ModifierTypes) <> 0 Then + ReportSyntaxError(SyntaxErrorType.DuplicateModifier, Peek()) + Else + FoundTypes = FoundTypes Or ModifierTypes + End If + + Modifiers.Add(New Modifier(ModifierTypes, SpanFrom(Read()))) + End While + + If Modifiers.Count = 0 Then + Return Nothing + Else + Return New ModifierCollection(Modifiers, SpanFrom(Start)) + End If + End Function + + '* + '* VariableDeclarators + '* + + Private Function ParseVariableDeclarator() As VariableDeclarator + Dim DeclarationStart As Token = Peek() + Dim VariableNamesCommaLocations As List(Of Location) = New List(Of Location)() + Dim VariableNames As List(Of VariableName) = New List(Of VariableName)() + Dim AsLocation As Location + Dim NewLocation As Location + Dim Type As TypeName = Nothing + Dim NewArguments As ArgumentCollection = Nothing + Dim EqualsLocation As Location + Dim Initializer As Initializer = Nothing + Dim VariableNameCollection As VariableNameCollection + + ' Parse the declarators + Do + Dim VariableName As VariableName + + If VariableNames.Count > 0 Then + VariableNamesCommaLocations.Add(ReadLocation()) + End If + + VariableName = ParseVariableName(True) + + If ErrorInConstruct Then + ResyncAt(TokenType.As, TokenType.Comma, TokenType.[New], TokenType.Equals) + End If + + VariableNames.Add(VariableName) + Loop While Peek().Type = TokenType.Comma + + VariableNameCollection = New VariableNameCollection(VariableNames, VariableNamesCommaLocations, SpanFrom(DeclarationStart)) + + If Peek().Type = TokenType.As Then + AsLocation = ReadLocation() + + If Peek().Type = TokenType.[New] Then + NewLocation = ReadLocation() + Type = ParseTypeName(False) + NewArguments = ParseArguments() + Else + Type = ParseTypeName(True) + + If ErrorInConstruct Then + ResyncAt(TokenType.Comma, TokenType.Equals) + End If + End If + End If + + If Peek.Type = TokenType.Equals AndAlso Not NewLocation.IsValid Then + EqualsLocation = ReadLocation() + Initializer = ParseInitializer() + + If ErrorInConstruct Then + ResyncAt(TokenType.Comma) + End If + End If + + Return New VariableDeclarator(VariableNameCollection, AsLocation, NewLocation, Type, NewArguments, EqualsLocation, Initializer, SpanFrom(DeclarationStart)) + End Function + + Private Function ParseVariableDeclarators() As VariableDeclaratorCollection + Dim Start As Token = Peek() + Dim VariableDeclarators As List(Of VariableDeclarator) = New List(Of VariableDeclarator)() + Dim DeclarationsCommaLocations As List(Of Location) = New List(Of Location)() + + ' Parse the declarations + Do + If VariableDeclarators.Count > 0 Then + DeclarationsCommaLocations.Add(ReadLocation()) + End If + + VariableDeclarators.Add(ParseVariableDeclarator()) + Loop While Peek().Type = TokenType.Comma + + Return New VariableDeclaratorCollection(VariableDeclarators, DeclarationsCommaLocations, SpanFrom(Start)) + End Function + + Private Function ParseForLoopVariableDeclarator(ByRef controlExpression As Expression) As VariableDeclarator + Dim Start As Token = Peek() + Dim AsLocation As Location + Dim Type As TypeName = Nothing + Dim VariableName As VariableName + Dim VariableNames As List(Of VariableName) = New List(Of VariableName)() + Dim VariableNameCollection As VariableNameCollection + + VariableName = ParseVariableName(False) + VariableNames.Add(VariableName) + VariableNameCollection = New VariableNameCollection(VariableNames, Nothing, SpanFrom(Start)) + + If ErrorInConstruct Then + ' If we see As before a In or Each, then assume that we are still on the Control Variable Declaration. + ' Otherwise, don't resync and allow the caller to decide how to recover. + If PeekAheadFor(TokenType.As, TokenType.In, TokenType.Equals) = TokenType.As Then + ResyncAt(TokenType.As) + End If + End If + + If Peek().Type = TokenType.As Then + AsLocation = ReadLocation() + Type = ParseTypeName(True) + End If + + controlExpression = New SimpleNameExpression(VariableName.Name, VariableName.Span) + + Return New VariableDeclarator(VariableNameCollection, AsLocation, Nothing, Type, Nothing, Nothing, Nothing, SpanFrom(Start)) + End Function + + '* + '* CaseClauses + '* + + Private Function ParseCase() As CaseClause + Dim Start As Token = Peek() + + If Start.Type = TokenType.Is OrElse IsRelationalOperator(Start.Type) Then + Dim IsLocation As Location + Dim OperatorToken As Token + Dim [Operator] As OperatorType = OperatorType.None + Dim Operand As Expression + + If Start.Type = TokenType.Is Then + IsLocation = ReadLocation() + End If + + If IsRelationalOperator(Peek().Type) Then + OperatorToken = Read() + [Operator] = GetBinaryOperator(OperatorToken.Type) + Operand = ParseExpression() + + If ErrorInConstruct Then + ResyncAt() + End If + + Return New ComparisonCaseClause(IsLocation, [Operator], OperatorToken.Span.Start, Operand, SpanFrom(Start)) + Else + ReportSyntaxError(SyntaxErrorType.ExpectedRelationalOperator, Peek()) + ResyncAt() + Return Nothing + End If + Else + Return New RangeCaseClause(ParseExpression(True), SpanFrom(Start)) + End If + End Function + + '* + '* Attributes + '* + + Private Function ParseAttributeBlock(ByVal attributeTypesAllowed As AttributeTypes) As AttributeCollection + Dim Start As Token = Peek() + Dim Attributes As List(Of Attribute) = New List(Of Attribute)() + Dim RightBracketLocation As Location + Dim CommaLocations As List(Of Location) = New List(Of Location)() + + If Start.Type <> TokenType.LessThan Then + Return Nothing + End If + + Read() + + Do + Dim AttributeStart As Token + Dim AttributeTypes As AttributeTypes = AttributeTypes.Regular + Dim AttributeTypeLocation As Location = New Location + Dim ColonLocation As Location = New Location + Dim Name As Name + Dim Arguments As ArgumentCollection + + If Attributes.Count > 0 Then + CommaLocations.Add(ReadLocation()) + End If + + AttributeStart = Peek() + + If AttributeStart.AsUnreservedKeyword() = TokenType.Assembly Then + AttributeTypes = AttributeTypes.Assembly + AttributeTypeLocation = ReadLocation() + ColonLocation = VerifyExpectedToken(TokenType.Colon) + ElseIf AttributeStart.Type = TokenType.Module Then + AttributeTypes = AttributeTypes.Module + AttributeTypeLocation = ReadLocation() + ColonLocation = VerifyExpectedToken(TokenType.Colon) + End If + + If (AttributeTypes And attributeTypesAllowed) = 0 Then + ReportSyntaxError(SyntaxErrorType.IncorrectAttributeType, AttributeStart) + End If + + Name = ParseName(True) + Arguments = ParseArguments() + + Attributes.Add(New Attribute(AttributeTypes, AttributeTypeLocation, ColonLocation, Name, Arguments, SpanFrom(AttributeStart))) + Loop While Peek().Type = TokenType.Comma + + RightBracketLocation = VerifyExpectedToken(TokenType.GreaterThan) + + Return New AttributeCollection(Attributes, CommaLocations, RightBracketLocation, SpanFrom(Start)) + End Function + + Private Function ParseAttributes(Optional ByVal attributeTypesAllowed As AttributeTypes = AttributeTypes.Regular) As AttributeBlockCollection + Dim Start As Token = Peek() + Dim AttributeBlocks As List(Of AttributeCollection) = New List(Of AttributeCollection)() + + While Peek().Type = TokenType.LessThan + AttributeBlocks.Add(ParseAttributeBlock(attributeTypesAllowed)) + End While + + If AttributeBlocks.Count = 0 Then + Return Nothing + Else + Return New AttributeBlockCollection(AttributeBlocks, SpanFrom(Start)) + End If + End Function + + '* + '* Declaration statements + '* + + Private Function ParseNameList(Optional ByVal allowLeadingMeOrMyBase As Boolean = False) As NameCollection + Dim Start As Token = Read() + Dim CommaLocations As List(Of Location) = New List(Of Location)() + Dim Names As List(Of Name) = New List(Of Name)() + + Do + If Names.Count > 0 Then + CommaLocations.Add(ReadLocation()) + End If + + Names.Add(ParseNameListName(allowLeadingMeOrMyBase)) + + If ErrorInConstruct Then + ResyncAt(TokenType.Comma) + End If + Loop While Peek().Type = TokenType.Comma + + Return New NameCollection(Names, CommaLocations, SpanFrom(Start)) + End Function + + Private Function ParsePropertyDeclaration(ByVal startLocation As Location, ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection) As Declaration + Const RegularValidModifiers As ModifierTypes = _ + ModifierTypes.AccessModifiers Or _ + ModifierTypes.Shadows Or ModifierTypes.Shared Or _ + ModifierTypes.Overridable Or ModifierTypes.NotOverridable Or _ + ModifierTypes.MustOverride Or ModifierTypes.Overrides Or _ + ModifierTypes.Overloads Or ModifierTypes.Default Or _ + ModifierTypes.ReadOnly Or ModifierTypes.WriteOnly + Const InterfaceValidModifiers As ModifierTypes = _ + ModifierTypes.Shadows Or _ + ModifierTypes.Overloads Or _ + ModifierTypes.Default Or _ + ModifierTypes.ReadOnly Or _ + ModifierTypes.WriteOnly + + Dim ValidModifiers As ModifierTypes + Dim PropertyLocation As Location + Dim Name As SimpleName + Dim Parameters As ParameterCollection + Dim AsLocation As Location + Dim ReturnType As TypeName = Nothing + Dim ReturnTypeAttributes As AttributeBlockCollection = Nothing + Dim ImplementsList As NameCollection = Nothing + Dim Accessors As DeclarationCollection = Nothing + Dim EndBlockDeclaration As EndBlockDeclaration = Nothing + Dim InInterface As Boolean = CurrentBlockContextType() = TreeType.InterfaceDeclaration + Dim Comments As List(Of Comment) = Nothing + Dim TypeParameters As TypeParameterCollection + + If InInterface Then + ValidModifiers = InterfaceValidModifiers + Else + ValidModifiers = RegularValidModifiers + End If + + ValidateModifierList(modifiers, ValidModifiers) + PropertyLocation = ReadLocation() + Name = ParseSimpleName(False) + + If ErrorInConstruct Then + ResyncAt(TokenType.LeftParenthesis, TokenType.As) + End If + + TypeParameters = ParseTypeParameters() + + If ErrorInConstruct Then + ResyncAt(TokenType.LeftParenthesis, TokenType.As) + End If + + If TypeParameters IsNot Nothing AndAlso TypeParameters.Count > 0 Then + ReportSyntaxError(SyntaxErrorType.PropertiesCantBeGeneric, TypeParameters.Span) + End If + + Parameters = ParseParameters() + + If Peek().Type = TokenType.As Then + AsLocation = ReadLocation() + ReturnTypeAttributes = ParseAttributes() + ReturnType = ParseTypeName(True) + + If ErrorInConstruct Then + ResyncAt(TokenType.Implements) + End If + End If + + If InInterface Then + Comments = ParseTrailingComments() + Else + If Peek().Type = TokenType.Implements Then + ImplementsList = ParseNameList() + End If + + If modifiers Is Nothing OrElse (modifiers.ModifierTypes And ModifierTypes.MustOverride) = 0 Then + Accessors = ParseDeclarationBlock(SpanFrom(startLocation), TreeType.PropertyDeclaration, Comments, EndBlockDeclaration) + Else + Comments = ParseTrailingComments() + End If + End If + + Return New PropertyDeclaration(attributes, modifiers, PropertyLocation, Name, Parameters, AsLocation, _ + ReturnTypeAttributes, ReturnType, ImplementsList, Accessors, EndBlockDeclaration, SpanFrom(startLocation), _ + Comments) + End Function + + Private Function ParseExternalDeclaration(ByVal startLocation As Location, ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection) As Declaration + Const ValidModifiers As ModifierTypes = ModifierTypes.AccessModifiers Or ModifierTypes.Shadows Or ModifierTypes.Overloads + Dim DeclareLocation As Location + Dim CharsetLocation As Location + Dim Charset As Charset = Charset.Auto + Dim MethodType As TreeType = TreeType.SyntaxError + Dim SubOrFunctionLocation As Location + Dim Name As SimpleName + Dim LibLocation As Location + Dim LibLiteral As StringLiteralExpression = Nothing + Dim AliasLocation As Location + Dim AliasLiteral As StringLiteralExpression = Nothing + Dim Parameters As ParameterCollection + Dim AsLocation As Location + Dim ReturnType As TypeName = Nothing + Dim ReturnTypeAttributes As AttributeBlockCollection = Nothing + + ValidateModifierList(modifiers, ValidModifiers) + + DeclareLocation = ReadLocation() + + Select Case Peek().AsUnreservedKeyword() + Case TokenType.Ansi + Charset = Charset.Ansi + CharsetLocation = ReadLocation() + + Case TokenType.Unicode + Charset = Charset.Unicode + CharsetLocation = ReadLocation() + + Case TokenType.Auto + Charset = Charset.Auto + CharsetLocation = ReadLocation() + End Select + + If Peek().Type = TokenType.Sub Then + MethodType = TreeType.ExternalSubDeclaration + SubOrFunctionLocation = ReadLocation() + ElseIf Peek().Type = TokenType.Function Then + MethodType = TreeType.ExternalFunctionDeclaration + SubOrFunctionLocation = ReadLocation() + Else + ReportSyntaxError(SyntaxErrorType.ExpectedSubOrFunction, Peek()) + End If + + Name = ParseSimpleName(False) + + If ErrorInConstruct Then + ResyncAt(TokenType.Lib, TokenType.LeftParenthesis) + End If + + If Peek().Type = TokenType.Lib Then + LibLocation = ReadLocation() + + If Peek().Type = TokenType.StringLiteral Then + Dim Literal As StringLiteralToken = CType(Read(), StringLiteralToken) + LibLiteral = New StringLiteralExpression(Literal.Literal, Literal.Span) + Else + ReportSyntaxError(SyntaxErrorType.ExpectedStringLiteral, Peek()) + ResyncAt(TokenType.Alias, TokenType.LeftParenthesis) + End If + Else + + ReportSyntaxError(SyntaxErrorType.ExpectedLib, Peek()) + End If + + If Peek().Type = TokenType.Alias Then + AliasLocation = ReadLocation() + + If Peek().Type = TokenType.StringLiteral Then + Dim Literal As StringLiteralToken = CType(Read(), StringLiteralToken) + AliasLiteral = New StringLiteralExpression(Literal.Literal, Literal.Span) + Else + ReportSyntaxError(SyntaxErrorType.ExpectedStringLiteral, Peek()) + ResyncAt(TokenType.LeftParenthesis) + End If + End If + + Parameters = ParseParameters() + + If MethodType = TreeType.ExternalFunctionDeclaration Then + If Peek().Type = TokenType.As Then + AsLocation = ReadLocation() + ReturnTypeAttributes = ParseAttributes() + ReturnType = ParseTypeName(True) + + If ErrorInConstruct Then + ResyncAt() + End If + End If + + Return New ExternalFunctionDeclaration(attributes, modifiers, DeclareLocation, CharsetLocation, _ + Charset, SubOrFunctionLocation, Name, LibLocation, LibLiteral, AliasLocation, AliasLiteral, _ + Parameters, AsLocation, ReturnTypeAttributes, ReturnType, SpanFrom(startLocation), ParseTrailingComments()) + ElseIf MethodType = TreeType.ExternalSubDeclaration Then + Return New ExternalSubDeclaration(attributes, modifiers, DeclareLocation, CharsetLocation, _ + Charset, SubOrFunctionLocation, Name, LibLocation, LibLiteral, AliasLocation, AliasLiteral, _ + Parameters, SpanFrom(startLocation), ParseTrailingComments()) + Else + Return Declaration.GetBadDeclaration(SpanFrom(startLocation), ParseTrailingComments()) + End If + End Function + + Private Function ParseMethodDeclaration(ByVal startLocation As Location, ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection) As Declaration + Const ValidMethodModifiers As ModifierTypes = _ + ModifierTypes.AccessModifiers Or _ + ModifierTypes.Shadows Or ModifierTypes.Shared Or _ + ModifierTypes.Overridable Or ModifierTypes.NotOverridable Or _ + ModifierTypes.MustOverride Or ModifierTypes.Overrides Or _ + ModifierTypes.Overloads + Const ValidConstructorModifiers As ModifierTypes = _ + ModifierTypes.AccessModifiers Or ModifierTypes.Shared + Const ValidInterfaceModifiers As ModifierTypes = _ + ModifierTypes.Shadows Or ModifierTypes.Overloads + + Dim MethodType As TreeType + Dim SubOrFunctionLocation As Location + Dim Name As SimpleName + Dim Parameters As ParameterCollection + Dim AsLocation As Location + Dim ReturnType As TypeName = Nothing + Dim ReturnTypeAttributes As AttributeBlockCollection = Nothing + Dim ImplementsList As NameCollection = Nothing + Dim HandlesList As NameCollection = Nothing + Dim AllowKeywordsForName As Boolean = False + Dim ValidModifiers As ModifierTypes = ValidMethodModifiers + Dim Statements As StatementCollection = Nothing + Dim EndStatement As Statement = Nothing + Dim EndDeclaration As EndBlockDeclaration = Nothing + Dim InInterface As Boolean = CurrentBlockContextType() = TreeType.InterfaceDeclaration + Dim Comments As List(Of Comment) = Nothing + Dim TypeParameters As TypeParameterCollection = Nothing + + If Not AtBeginningOfLine Then + ReportSyntaxError(SyntaxErrorType.MethodMustBeFirstStatementOnLine, Peek()) + End If + + If Peek().Type = TokenType.Sub Then + SubOrFunctionLocation = ReadLocation() + + If Peek().Type = TokenType.[New] Then + MethodType = TreeType.ConstructorDeclaration + AllowKeywordsForName = True + ValidModifiers = ValidConstructorModifiers + Else + MethodType = TreeType.SubDeclaration + End If + Else + SubOrFunctionLocation = ReadLocation() + MethodType = TreeType.FunctionDeclaration + End If + + If InInterface Then + ValidModifiers = ValidInterfaceModifiers + End If + + ValidateModifierList(modifiers, ValidModifiers) + Name = ParseSimpleName(AllowKeywordsForName) + + If ErrorInConstruct Then + ResyncAt(TokenType.LeftParenthesis, TokenType.As) + End If + + TypeParameters = ParseTypeParameters() + + If ErrorInConstruct Then + ResyncAt(TokenType.LeftParenthesis, TokenType.As) + End If + + If MethodType = TreeType.ConstructorDeclaration AndAlso TypeParameters IsNot Nothing AndAlso TypeParameters.Count > 0 Then + ReportSyntaxError(SyntaxErrorType.ConstructorsCantBeGeneric, TypeParameters.Span) + End If + + Parameters = ParseParameters() + + If MethodType = TreeType.FunctionDeclaration AndAlso Peek().Type = TokenType.As Then + AsLocation = ReadLocation() + ReturnTypeAttributes = ParseAttributes() + ReturnType = ParseTypeName(True) + + If ErrorInConstruct Then + ResyncAt(TokenType.Implements, TokenType.Handles) + End If + End If + + If InInterface Then + Comments = ParseTrailingComments() + Else + If Peek().Type = TokenType.Implements Then + ImplementsList = ParseNameList() + ElseIf Peek().Type = TokenType.Handles Then + HandlesList = ParseNameList(True) + End If + + If modifiers Is Nothing OrElse (modifiers.ModifierTypes And ModifierTypes.MustOverride) = 0 Then + Statements = ParseStatementBlock(SpanFrom(startLocation), MethodType, Comments, EndStatement) + Else + Comments = ParseTrailingComments() + End If + + If EndStatement IsNot Nothing Then + EndDeclaration = New EndBlockDeclaration(CType(EndStatement, EndBlockStatement)) + End If + End If + + If MethodType = TreeType.SubDeclaration Then + Return New SubDeclaration(attributes, modifiers, SubOrFunctionLocation, Name, TypeParameters, Parameters, _ + ImplementsList, HandlesList, Statements, EndDeclaration, SpanFrom(startLocation), Comments) + ElseIf MethodType = TreeType.FunctionDeclaration Then + Return New FunctionDeclaration(attributes, modifiers, SubOrFunctionLocation, Name, TypeParameters, _ + Parameters, AsLocation, ReturnTypeAttributes, ReturnType, ImplementsList, HandlesList, Statements, _ + EndDeclaration, SpanFrom(startLocation), Comments) + Else + Return New ConstructorDeclaration(attributes, modifiers, SubOrFunctionLocation, Name, _ + Parameters, Statements, EndDeclaration, SpanFrom(startLocation), Comments) + End If + End Function + + + Private Function ParseOperatorDeclaration(ByVal startLocation As Location, ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection) As Declaration + Const ValidOperatorModifiers As ModifierTypes = _ + ModifierTypes.Shared Or ModifierTypes.Public Or ModifierTypes.Shadows Or ModifierTypes.Overloads Or _ + ModifierTypes.Widening Or ModifierTypes.Narrowing + + Dim KeywordLocation As Location + Dim OperatorToken As Token = Nothing + Dim Parameters As ParameterCollection + Dim AsLocation As Location + Dim ReturnType As TypeName = Nothing + Dim ReturnTypeAttributes As AttributeBlockCollection = Nothing + Dim ValidModifiers As ModifierTypes = ValidOperatorModifiers + Dim Statements As StatementCollection = Nothing + Dim EndStatement As Statement = Nothing + Dim EndDeclaration As EndBlockDeclaration = Nothing + Dim Comments As List(Of Comment) = Nothing + Dim TypeParameters As TypeParameterCollection + + If Not AtBeginningOfLine Then + ReportSyntaxError(SyntaxErrorType.MethodMustBeFirstStatementOnLine, Peek()) + End If + + KeywordLocation = ReadLocation() + ValidateModifierList(modifiers, ValidModifiers) + + If IsOverloadableOperator(Peek()) Then + OperatorToken = Read() + Else + ReportSyntaxError(SyntaxErrorType.InvalidOperator, Peek()) + ResyncAt(TokenType.LeftParenthesis, TokenType.As) + End If + + TypeParameters = ParseTypeParameters() + + If ErrorInConstruct Then + ResyncAt(TokenType.LeftParenthesis, TokenType.As) + End If + + If TypeParameters IsNot Nothing AndAlso TypeParameters.Count > 0 Then + ReportSyntaxError(SyntaxErrorType.OperatorsCantBeGeneric, TypeParameters.Span) + End If + + Parameters = ParseParameters() + + If Peek().Type = TokenType.As Then + AsLocation = ReadLocation() + ReturnTypeAttributes = ParseAttributes() + ReturnType = ParseTypeName(True) + + If ErrorInConstruct Then + ResyncAt() + End If + End If + + Statements = ParseStatementBlock(SpanFrom(startLocation), TreeType.OperatorDeclaration, Comments, EndStatement) + Comments = ParseTrailingComments() + + If EndStatement IsNot Nothing Then + EndDeclaration = New EndBlockDeclaration(CType(EndStatement, EndBlockStatement)) + End If + + Return New OperatorDeclaration(attributes, modifiers, KeywordLocation, OperatorToken, Parameters, AsLocation, _ + ReturnTypeAttributes, ReturnType, Statements, EndDeclaration, SpanFrom(startLocation), Comments) + End Function + + Private Function ParseAccessorDeclaration(ByVal startLocation As Location, ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection) As Declaration + Dim AccessorType As TreeType + Dim GetOrSetLocation As Location + Dim Parameters As ParameterCollection = Nothing + Dim Statements As StatementCollection + Dim EndStatement As Statement = Nothing + Dim EndDeclaration As EndBlockDeclaration = Nothing + Dim Comments As List(Of Comment) = Nothing + Dim ValidModifiers As ModifierTypes = ModifierTypes.None + + If Scanner.Version > LanguageVersion.VisualBasic71 Then + ValidModifiers = ValidModifiers Or ModifierTypes.AccessModifiers + End If + + If Not AtBeginningOfLine Then + ReportSyntaxError(SyntaxErrorType.MethodMustBeFirstStatementOnLine, Peek()) + End If + + ValidateModifierList(modifiers, ValidModifiers) + + If Peek().Type = TokenType.Get Then + AccessorType = TreeType.GetAccessorDeclaration + Else + AccessorType = TreeType.SetAccessorDeclaration + End If + GetOrSetLocation = ReadLocation() + + If AccessorType = TreeType.SetAccessorDeclaration Then + Parameters = ParseParameters() + End If + + Statements = ParseStatementBlock(SpanFrom(startLocation), AccessorType, Comments, EndStatement) + + If EndStatement IsNot Nothing Then + EndDeclaration = New EndBlockDeclaration(CType(EndStatement, EndBlockStatement)) + End If + + If AccessorType = TreeType.GetAccessorDeclaration Then + Return New GetAccessorDeclaration(attributes, modifiers, GetOrSetLocation, Statements, _ + EndDeclaration, SpanFrom(startLocation), Comments) + Else + Return New SetAccessorDeclaration(attributes, modifiers, GetOrSetLocation, Parameters, Statements, _ + EndDeclaration, SpanFrom(startLocation), Comments) + End If + End Function + + Private Function ParseCustomEventDeclaration(ByVal startLocation As Location, ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection) As Declaration + Const ValidModifiers As ModifierTypes = _ + ModifierTypes.AccessModifiers Or ModifierTypes.Shadows Or ModifierTypes.Shared + + Dim CustomLocation, EventLocation As Location + Dim Name As SimpleName + Dim AsLocation As Location + Dim EventType As TypeName + Dim ImplementsList As NameCollection = Nothing + Dim Accessors As DeclarationCollection = Nothing + Dim EndBlockDeclaration As EndBlockDeclaration = Nothing + Dim Comments As List(Of Comment) = Nothing + + ValidateModifierList(modifiers, ValidModifiers) + CustomLocation = ReadLocation() + Debug.Assert(Peek().Type = TokenType.Event) + EventLocation = ReadLocation() + + Name = ParseSimpleName(False) + + If ErrorInConstruct Then + ResyncAt(TokenType.As) + End If + + AsLocation = VerifyExpectedToken(TokenType.As) + EventType = ParseTypeName(True) + + If ErrorInConstruct Then + ResyncAt(TokenType.Implements) + End If + + If Peek().Type = TokenType.Implements Then + ImplementsList = ParseNameList() + End If + + Accessors = ParseDeclarationBlock(SpanFrom(startLocation), TreeType.CustomEventDeclaration, Comments, EndBlockDeclaration) + + Return New CustomEventDeclaration(attributes, modifiers, CustomLocation, EventLocation, Name, AsLocation, _ + EventType, ImplementsList, Accessors, EndBlockDeclaration, SpanFrom(startLocation), _ + Comments) + End Function + + Private Function ParseEventAccessorDeclaration(ByVal startLocation As Location, ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection) As Declaration + Const ValidModifiers As ModifierTypes = ModifierTypes.None + Dim AccessorType As TreeType + Dim AccessorTypeLocation As Location + Dim Parameters As ParameterCollection = Nothing + Dim Statements As StatementCollection + Dim EndStatement As Statement = Nothing + Dim EndDeclaration As EndBlockDeclaration = Nothing + Dim Comments As List(Of Comment) = Nothing + + If Not AtBeginningOfLine Then + ReportSyntaxError(SyntaxErrorType.MethodMustBeFirstStatementOnLine, Peek()) + End If + + ValidateModifierList(modifiers, ValidModifiers) + + If Peek().Type = TokenType.AddHandler Then + AccessorType = TreeType.AddHandlerAccessorDeclaration + ElseIf Peek().Type = TokenType.RemoveHandler Then + AccessorType = TreeType.RemoveHandlerAccessorDeclaration + Else + AccessorType = TreeType.RaiseEventAccessorDeclaration + End If + AccessorTypeLocation = ReadLocation() + + Parameters = ParseParameters() + Statements = ParseStatementBlock(SpanFrom(startLocation), AccessorType, Comments, EndStatement) + + If EndStatement IsNot Nothing Then + EndDeclaration = New EndBlockDeclaration(CType(EndStatement, EndBlockStatement)) + End If + + If AccessorType = TreeType.AddHandlerAccessorDeclaration Then + Return New AddHandlerAccessorDeclaration(attributes, AccessorTypeLocation, Parameters, Statements, _ + EndDeclaration, SpanFrom(startLocation), Comments) + ElseIf AccessorType = TreeType.RemoveHandlerAccessorDeclaration Then + Return New RemoveHandlerAccessorDeclaration(attributes, AccessorTypeLocation, Parameters, Statements, _ + EndDeclaration, SpanFrom(startLocation), Comments) + Else + Return New RaiseEventAccessorDeclaration(attributes, AccessorTypeLocation, Parameters, Statements, _ + EndDeclaration, SpanFrom(startLocation), Comments) + End If + End Function + + Private Function ParseEventDeclaration(ByVal startLocation As Location, ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection) As Declaration + Const RegularValidModifiers As ModifierTypes = _ + ModifierTypes.AccessModifiers Or ModifierTypes.Shadows Or ModifierTypes.Shared + Const InterfaceValidModifiers As ModifierTypes = ModifierTypes.Shadows + + Dim EventLocation As Location + Dim Name As SimpleName + Dim AsLocation As Location + Dim EventType As TypeName = Nothing + Dim Parameters As ParameterCollection = Nothing + Dim ImplementsList As NameCollection = Nothing + Dim InInterface As Boolean = CurrentBlockContextType() = TreeType.InterfaceDeclaration + Dim ValidModifiers As ModifierTypes + + If InInterface Then + ValidModifiers = InterfaceValidModifiers + Else + ValidModifiers = RegularValidModifiers + End If + + ValidateModifierList(modifiers, ValidModifiers) + + EventLocation = ReadLocation() + Name = ParseSimpleName(False) + + If ErrorInConstruct Then + ResyncAt(TokenType.As, TokenType.LeftParenthesis, TokenType.Implements) + End If + + If Peek().Type = TokenType.As Then + AsLocation = ReadLocation() + EventType = ParseTypeName(False) + + If ErrorInConstruct Then + ResyncAt(TokenType.Implements) + End If + Else + Parameters = ParseParameters() + + ' Give a good error if they attempt to do a return type + If Peek().Type = TokenType.As Then + Dim ErrorStart As Token = Peek() + + ResyncAt(TokenType.Implements) + ReportSyntaxError(SyntaxErrorType.EventsCantBeFunctions, ErrorStart, Peek()) + End If + End If + + If Peek().Type = TokenType.Implements Then + ImplementsList = ParseNameList() + End If + + Return New EventDeclaration(attributes, modifiers, EventLocation, Name, Parameters, AsLocation, _ + Nothing, EventType, ImplementsList, SpanFrom(startLocation), ParseTrailingComments()) + End Function + + Private Function ParseVariableListDeclaration(ByVal startLocation As Location, ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection) As Declaration + Dim ValidModifiers As ModifierTypes + + If modifiers IsNot Nothing AndAlso (modifiers.ModifierTypes And ModifierTypes.Const) <> 0 Then + ValidModifiers = ModifierTypes.Const Or ModifierTypes.AccessModifiers Or _ + ModifierTypes.Shadows + Else + ValidModifiers = ModifierTypes.Dim Or ModifierTypes.AccessModifiers Or _ + ModifierTypes.Shadows Or ModifierTypes.Shared Or _ + ModifierTypes.ReadOnly Or ModifierTypes.WithEvents + End If + + ValidateModifierList(modifiers, ValidModifiers) + + If modifiers Is Nothing Then + ReportSyntaxError(SyntaxErrorType.ExpectedModifier, Peek()) + End If + + Return New VariableListDeclaration(attributes, modifiers, ParseVariableDeclarators(), SpanFrom(startLocation), ParseTrailingComments()) + End Function + + Private Function ParseEndDeclaration() As Declaration + Dim Start As Token = Read() + Dim EndType As BlockType = GetBlockType(Peek().Type) + + Select Case EndType + Case BlockType.Sub + If Not AtBeginningOfLine Then + ReportSyntaxError(SyntaxErrorType.EndSubNotAtLineStart, SpanFrom(Start)) + End If + + Case BlockType.Function + If Not AtBeginningOfLine Then + ReportSyntaxError(SyntaxErrorType.EndFunctionNotAtLineStart, SpanFrom(Start)) + End If + + Case BlockType.Operator + If Not AtBeginningOfLine Then + ReportSyntaxError(SyntaxErrorType.EndOperatorNotAtLineStart, SpanFrom(Start)) + End If + + Case BlockType.Get + If Not AtBeginningOfLine Then + ReportSyntaxError(SyntaxErrorType.EndGetNotAtLineStart, SpanFrom(Start)) + End If + + Case BlockType.Set + If Not AtBeginningOfLine Then + ReportSyntaxError(SyntaxErrorType.EndSetNotAtLineStart, SpanFrom(Start)) + End If + + Case BlockType.AddHandler + If Not AtBeginningOfLine Then + ReportSyntaxError(SyntaxErrorType.EndAddHandlerNotAtLineStart, SpanFrom(Start)) + End If + + Case BlockType.RemoveHandler + If Not AtBeginningOfLine Then + ReportSyntaxError(SyntaxErrorType.EndRemoveHandlerNotAtLineStart, SpanFrom(Start)) + End If + + Case BlockType.RaiseEvent + If Not AtBeginningOfLine Then + ReportSyntaxError(SyntaxErrorType.EndRaiseEventNotAtLineStart, SpanFrom(Start)) + End If + + Case BlockType.None + ReportSyntaxError(SyntaxErrorType.UnrecognizedEnd, Peek()) + Return Declaration.GetBadDeclaration(SpanFrom(Start), ParseTrailingComments()) + End Select + + Return New EndBlockDeclaration(EndType, ReadLocation(), SpanFrom(Start), ParseTrailingComments()) + End Function + + Private Function ParseTypeDeclaration(ByVal startLocation As Location, ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection, ByVal blockType As TreeType) As Declaration + Dim ValidModifiers As ModifierTypes + Dim KeywordLocation As Location + Dim Name As SimpleName + Dim Members As DeclarationCollection + Dim EndBlockDeclaration As EndBlockDeclaration = Nothing + Dim Comments As List(Of Comment) = Nothing + Dim TypeParameters As TypeParameterCollection = Nothing + + If blockType = TreeType.ModuleDeclaration Then + ValidModifiers = ModifierTypes.AccessModifiers + Else + ValidModifiers = ModifierTypes.AccessModifiers Or ModifierTypes.Shadows + + If blockType = TreeType.ClassDeclaration Then + ValidModifiers = ValidModifiers Or ModifierTypes.MustInherit Or ModifierTypes.NotInheritable + End If + + If blockType = TreeType.ClassDeclaration OrElse blockType = TreeType.StructureDeclaration Then + ValidModifiers = ValidModifiers Or ModifierTypes.Partial + End If + End If + + ValidateModifierList(modifiers, ValidModifiers) + + KeywordLocation = ReadLocation() + + Name = ParseSimpleName(False) + + If ErrorInConstruct Then + ResyncAt() + End If + + TypeParameters = ParseTypeParameters() + + If ErrorInConstruct Then + ResyncAt() + End If + + If blockType = TreeType.ModuleDeclaration AndAlso TypeParameters IsNot Nothing AndAlso TypeParameters.Count > 0 Then + ReportSyntaxError(SyntaxErrorType.ModulesCantBeGeneric, TypeParameters.Span) + End If + + Members = ParseDeclarationBlock(SpanFrom(startLocation), blockType, Comments, EndBlockDeclaration) + + Select Case blockType + Case TreeType.ClassDeclaration + Return New ClassDeclaration(attributes, modifiers, KeywordLocation, Name, TypeParameters, Members, EndBlockDeclaration, SpanFrom(startLocation), Comments) + + Case TreeType.ModuleDeclaration + Return New ModuleDeclaration(attributes, modifiers, KeywordLocation, Name, Members, EndBlockDeclaration, SpanFrom(startLocation), Comments) + + Case TreeType.InterfaceDeclaration + Return New InterfaceDeclaration(attributes, modifiers, KeywordLocation, Name, TypeParameters, Members, EndBlockDeclaration, SpanFrom(startLocation), Comments) + + Case TreeType.StructureDeclaration + Return New StructureDeclaration(attributes, modifiers, KeywordLocation, Name, TypeParameters, Members, EndBlockDeclaration, SpanFrom(startLocation), Comments) + + Case Else + Debug.Assert(False, "unexpected!") + Return Nothing + End Select + End Function + + Private Function ParseEnumDeclaration(ByVal startLocation As Location, ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection) As Declaration + Const ValidModifiers As ModifierTypes = ModifierTypes.AccessModifiers Or ModifierTypes.Shadows + Dim KeywordLocation As Location + Dim Name As SimpleName + Dim AsLocation As Location + Dim Type As TypeName = Nothing + Dim Members As DeclarationCollection + Dim EndBlockDeclaration As EndBlockDeclaration = Nothing + Dim Comments As List(Of Comment) = Nothing + + ValidateModifierList(modifiers, ValidModifiers) + + KeywordLocation = ReadLocation() + + Name = ParseSimpleName(False) + + If ErrorInConstruct Then + ResyncAt(TokenType.As) + End If + + If Peek().Type = TokenType.As Then + AsLocation = ReadLocation() + Type = ParseTypeName(False) + + If ErrorInConstruct Then + ResyncAt() + End If + End If + + Members = ParseDeclarationBlock(SpanFrom(startLocation), TreeType.EnumDeclaration, Comments, EndBlockDeclaration) + + If Members Is Nothing OrElse Members.Count = 0 Then + ReportSyntaxError(SyntaxErrorType.EmptyEnum, Name.Span) + End If + + Return New EnumDeclaration(attributes, modifiers, KeywordLocation, Name, AsLocation, Type, Members, EndBlockDeclaration, SpanFrom(startLocation), Comments) + End Function + + Private Function ParseDelegateDeclaration(ByVal startLocation As Location, ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection) As Declaration + Const ValidModifiers As ModifierTypes = ModifierTypes.AccessModifiers Or ModifierTypes.Shadows Or ModifierTypes.Shared + Dim DelegateLocation As Location + Dim MethodType As TreeType = TreeType.SyntaxError + Dim SubOrFunctionLocation As Location + Dim Name As SimpleName + Dim Parameters As ParameterCollection + Dim AsLocation As Location + Dim ReturnType As TypeName = Nothing + Dim ReturnTypeAttributes As AttributeBlockCollection = Nothing + Dim TypeParameters As TypeParameterCollection = Nothing + + ValidateModifierList(modifiers, ValidModifiers) + + DelegateLocation = ReadLocation() + + If Peek().Type = TokenType.Sub Then + SubOrFunctionLocation = ReadLocation() + MethodType = TreeType.SubDeclaration + ElseIf Peek().Type = TokenType.Function Then + SubOrFunctionLocation = ReadLocation() + MethodType = TreeType.FunctionDeclaration + Else + ReportSyntaxError(SyntaxErrorType.ExpectedSubOrFunction, Peek()) + MethodType = TreeType.SubDeclaration + End If + + Name = ParseSimpleName(False) + + If ErrorInConstruct Then + ResyncAt(TokenType.LeftParenthesis, TokenType.As) + End If + + TypeParameters = ParseTypeParameters() + + If ErrorInConstruct Then + ResyncAt(TokenType.LeftParenthesis, TokenType.As) + End If + + Parameters = ParseParameters() + + If MethodType = TreeType.FunctionDeclaration AndAlso Peek().Type = TokenType.As Then + AsLocation = ReadLocation() + ReturnTypeAttributes = ParseAttributes() + ReturnType = ParseTypeName(True) + + If ErrorInConstruct Then + ResyncAt() + End If + End If + + If MethodType = TreeType.SubDeclaration Then + Return New DelegateSubDeclaration(attributes, modifiers, DelegateLocation, SubOrFunctionLocation, _ + Name, TypeParameters, Parameters, SpanFrom(startLocation), ParseTrailingComments()) + Else + Return New DelegateFunctionDeclaration(attributes, modifiers, DelegateLocation, SubOrFunctionLocation, _ + Name, TypeParameters, Parameters, AsLocation, ReturnTypeAttributes, ReturnType, SpanFrom(startLocation), ParseTrailingComments()) + End If + End Function + + Private Function ParseTypeListDeclaration(ByVal startLocation As Location, ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection, ByVal listType As TreeType) As Declaration + Dim CommaLocations As List(Of Location) = New List(Of Location)() + Dim Types As List(Of TypeName) = New List(Of TypeName)() + Dim ListStart As Token + + Read() + + If attributes IsNot Nothing Then + ReportSyntaxError(SyntaxErrorType.SpecifiersInvalidOnTypeListDeclaration, attributes.Span) + End If + + If modifiers IsNot Nothing Then + ReportSyntaxError(SyntaxErrorType.SpecifiersInvalidOnTypeListDeclaration, modifiers.Span) + End If + + ListStart = Peek() + + Do + If Types.Count > 0 Then + CommaLocations.Add(ReadLocation()) + End If + + Types.Add(ParseTypeName(False)) + + If ErrorInConstruct Then + ResyncAt(TokenType.Comma) + End If + Loop While Peek().Type = TokenType.Comma + + If listType = TreeType.InheritsDeclaration Then + Return New InheritsDeclaration(New TypeNameCollection(Types, CommaLocations, SpanFrom(ListStart)), SpanFrom(startLocation), ParseTrailingComments()) + Else + Return New ImplementsDeclaration(New TypeNameCollection(Types, CommaLocations, SpanFrom(ListStart)), SpanFrom(startLocation), ParseTrailingComments()) + End If + End Function + + Private Function ParseNamespaceDeclaration(ByVal startLocation As Location, ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection) As Declaration + Dim KeywordLocation As Location + Dim Name As Name + Dim Members As DeclarationCollection + Dim EndBlockDeclaration As EndBlockDeclaration = Nothing + Dim Comments As List(Of Comment) = Nothing + + If attributes IsNot Nothing Then + ReportSyntaxError(SyntaxErrorType.SpecifiersInvalidOnNamespaceDeclaration, attributes.Span) + End If + + If modifiers IsNot Nothing Then + ReportSyntaxError(SyntaxErrorType.SpecifiersInvalidOnNamespaceDeclaration, modifiers.Span) + End If + + KeywordLocation = ReadLocation() + + Name = ParseName(False) + + If ErrorInConstruct Then + ResyncAt() + End If + + Members = ParseDeclarationBlock(SpanFrom(startLocation), TreeType.NamespaceDeclaration, Comments, EndBlockDeclaration) + + Return New NamespaceDeclaration(attributes, modifiers, KeywordLocation, Name, Members, EndBlockDeclaration, SpanFrom(startLocation), Comments) + End Function + + Private Function ParseImportsDeclaration(ByVal startLocation As Location, ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection) As Declaration + Dim ImportMembers As List(Of Import) = New List(Of Import)() + Dim CommaLocations As List(Of Location) = New List(Of Location)() + Dim ListStart As Token + + If attributes IsNot Nothing Then + ReportSyntaxError(SyntaxErrorType.SpecifiersInvalidOnImportsDeclaration, attributes.Span) + End If + + If modifiers IsNot Nothing Then + ReportSyntaxError(SyntaxErrorType.SpecifiersInvalidOnImportsDeclaration, modifiers.Span) + End If + + Read() + ListStart = Peek() + + Do + If ImportMembers.Count > 0 Then + CommaLocations.Add(ReadLocation()) + End If + + If PeekAheadFor(TokenType.Equals, TokenType.Comma, TokenType.Period) = TokenType.Equals Then + Dim ImportStart As Token = Peek() + Dim Name As SimpleName + Dim EqualsLocation As Location + Dim AliasedTypeName As TypeName + + Name = ParseSimpleName(False) + EqualsLocation = ReadLocation() + AliasedTypeName = ParseNamedTypeName(False) + + If ErrorInConstruct Then + ResyncAt() + End If + + ImportMembers.Add(New AliasImport(Name, EqualsLocation, AliasedTypeName, SpanFrom(ImportStart))) + Else + Dim ImportStart As Token = Peek() + Dim TypeName As TypeName + + TypeName = ParseNamedTypeName(False) + + If ErrorInConstruct Then + ResyncAt() + End If + + ImportMembers.Add(New NameImport(TypeName, SpanFrom(ImportStart))) + End If + Loop While Peek().Type = TokenType.Comma + + Return New ImportsDeclaration(New ImportCollection(ImportMembers, CommaLocations, SpanFrom(ListStart)), SpanFrom(startLocation), ParseTrailingComments()) + End Function + + Private Function ParseOptionDeclaration(ByVal startLocation As Location, ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection) As Declaration + Dim OptionType As OptionType + Dim OptionTypeLocation As Location + Dim OptionArgumentLocation As Location + + Read() + + If attributes IsNot Nothing Then + ReportSyntaxError(SyntaxErrorType.SpecifiersInvalidOnOptionDeclaration, attributes.Span) + End If + + If modifiers IsNot Nothing Then + ReportSyntaxError(SyntaxErrorType.SpecifiersInvalidOnOptionDeclaration, modifiers.Span) + End If + + If Peek().AsUnreservedKeyword() = TokenType.Explicit Then + OptionTypeLocation = ReadLocation() + + If Peek().AsUnreservedKeyword() = TokenType.Off Then + OptionArgumentLocation = ReadLocation() + OptionType = OptionType.ExplicitOff + ElseIf Peek().Type = TokenType.On Then + OptionArgumentLocation = ReadLocation() + OptionType = OptionType.ExplicitOn + ElseIf Peek().Type = TokenType.Identifier Then + OptionType = OptionType.SyntaxError + ReportSyntaxError(SyntaxErrorType.InvalidOptionExplicitType, SpanFrom(startLocation)) + Else + OptionType = OptionType.Explicit + End If + ElseIf Peek().AsUnreservedKeyword() = TokenType.Strict Then + OptionTypeLocation = ReadLocation() + + If Peek().AsUnreservedKeyword() = TokenType.Off Then + OptionArgumentLocation = ReadLocation() + OptionType = OptionType.StrictOff + ElseIf Peek().Type = TokenType.On Then + OptionArgumentLocation = ReadLocation() + OptionType = OptionType.StrictOn + ElseIf Peek().Type = TokenType.Identifier Then + OptionType = OptionType.SyntaxError + ReportSyntaxError(SyntaxErrorType.InvalidOptionStrictType, SpanFrom(startLocation)) + Else + OptionType = OptionType.Strict + End If + ElseIf Peek().AsUnreservedKeyword() = TokenType.Compare Then + OptionTypeLocation = ReadLocation() + + If Peek().AsUnreservedKeyword() = TokenType.Binary Then + OptionArgumentLocation = ReadLocation() + OptionType = OptionType.CompareBinary + ElseIf Peek().AsUnreservedKeyword() = TokenType.Text Then + OptionArgumentLocation = ReadLocation() + OptionType = OptionType.CompareText + Else + OptionType = OptionType.SyntaxError + ReportSyntaxError(SyntaxErrorType.InvalidOptionCompareType, SpanFrom(startLocation)) + End If + Else + OptionType = OptionType.SyntaxError + ReportSyntaxError(SyntaxErrorType.InvalidOptionType, SpanFrom(startLocation)) + End If + + If ErrorInConstruct Then + ResyncAt() + End If + + Return New OptionDeclaration(OptionType, OptionTypeLocation, OptionArgumentLocation, SpanFrom(startLocation), ParseTrailingComments()) + End Function + + Private Function ParseAttributeDeclaration() As Declaration + Dim Attributes As AttributeBlockCollection + + Attributes = ParseAttributes(AttributeTypes.Module Or AttributeTypes.Assembly) + + Return New AttributeDeclaration(Attributes, Attributes.Span, ParseTrailingComments()) + End Function + + Private Function ParseDeclaration(Optional ByRef terminator As Token = Nothing) As Declaration + Dim Start As Token + Dim StartLocation As Location + Dim Declaration As Declaration = Nothing + Dim Attributes As AttributeBlockCollection = Nothing + Dim Modifiers As ModifierCollection = Nothing + Dim LookAhead As TokenType = TokenType.None + + 'If AtBeginningOfLine Then + ' While ParsePreprocessorStatement(False) + ' ' Loop + ' End While + 'End If + + Start = Peek() + + ErrorInConstruct = False + + StartLocation = Peek().Span.Start + LookAhead = PeekAheadFor(TokenType.Assembly, TokenType.Module, TokenType.GreaterThan) + If Peek().Type <> TokenType.LessThan OrElse (LookAhead <> TokenType.Assembly AndAlso LookAhead <> TokenType.Module) Then + Attributes = ParseAttributes() + Modifiers = ParseDeclarationModifierList() + End If + + Select Case Peek().Type + Case TokenType.End + If Attributes Is Nothing AndAlso Modifiers Is Nothing Then + Declaration = ParseEndDeclaration() + Else + GoTo Identifier + End If + + Case TokenType.Property + Declaration = ParsePropertyDeclaration(StartLocation, Attributes, Modifiers) + + Case TokenType.Declare + Declaration = ParseExternalDeclaration(StartLocation, Attributes, Modifiers) + + Case TokenType.Sub, TokenType.Function + Declaration = ParseMethodDeclaration(StartLocation, Attributes, Modifiers) + + Case TokenType.Get, TokenType.Set + Declaration = ParseAccessorDeclaration(StartLocation, Attributes, Modifiers) + + Case TokenType.AddHandler, TokenType.RemoveHandler, TokenType.RaiseEvent + Declaration = ParseEventAccessorDeclaration(StartLocation, Attributes, Modifiers) + + Case TokenType.Event + Declaration = ParseEventDeclaration(StartLocation, Attributes, Modifiers) + + Case TokenType.Operator + Declaration = ParseOperatorDeclaration(StartLocation, Attributes, Modifiers) + + Case TokenType.Delegate + Declaration = ParseDelegateDeclaration(StartLocation, Attributes, Modifiers) + + Case TokenType.Class + Declaration = ParseTypeDeclaration(StartLocation, Attributes, Modifiers, TreeType.ClassDeclaration) + + Case TokenType.Structure + Declaration = ParseTypeDeclaration(StartLocation, Attributes, Modifiers, TreeType.StructureDeclaration) + + Case TokenType.Module + Declaration = ParseTypeDeclaration(StartLocation, Attributes, Modifiers, TreeType.ModuleDeclaration) + + Case TokenType.Interface + Declaration = ParseTypeDeclaration(StartLocation, Attributes, Modifiers, TreeType.InterfaceDeclaration) + + Case TokenType.Enum + Declaration = ParseEnumDeclaration(StartLocation, Attributes, Modifiers) + + Case TokenType.Namespace + Declaration = ParseNamespaceDeclaration(StartLocation, Attributes, Modifiers) + + Case TokenType.Implements + Declaration = ParseTypeListDeclaration(StartLocation, Attributes, Modifiers, TreeType.ImplementsDeclaration) + + Case TokenType.Inherits + Declaration = ParseTypeListDeclaration(StartLocation, Attributes, Modifiers, TreeType.InheritsDeclaration) + + Case TokenType.Imports + Declaration = ParseImportsDeclaration(StartLocation, Attributes, Modifiers) + + Case TokenType.Option + Declaration = ParseOptionDeclaration(StartLocation, Attributes, Modifiers) + + Case TokenType.LessThan + Declaration = ParseAttributeDeclaration() + + Case TokenType.Identifier +Identifier: + If Peek().AsUnreservedKeyword = TokenType.Custom AndAlso PeekAheadOne().Type = TokenType.Event Then + Declaration = ParseCustomEventDeclaration(StartLocation, Attributes, Modifiers) + Else + Declaration = ParseVariableListDeclaration(StartLocation, Attributes, Modifiers) + End If + + Case TokenType.LineTerminator, TokenType.Colon, TokenType.EndOfStream + If Attributes Is Nothing AndAlso Modifiers Is Nothing Then + ' An empty declaration + Else + ReportSyntaxError(SyntaxErrorType.ExpectedIdentifier, Peek()) + End If + + Case TokenType.Comment + Dim Comments As List(Of Comment) = New List(Of Comment) + Dim LastTerminator As Token + + Do + Dim CommentToken As CommentToken = CType(Scanner.Read(), CommentToken) + Comments.Add(New Comment(CommentToken.Comment, CommentToken.IsREM, CommentToken.Span)) + LastTerminator = Read() ' Eat the terminator of the comment + Loop While Peek().Type = TokenType.Comment + Backtrack(LastTerminator) + + Declaration = New EmptyDeclaration(SpanFrom(Start), Comments) + + Case Else + ReportSyntaxError(SyntaxErrorType.SyntaxError, Peek()) + End Select + + terminator = VerifyEndOfStatement() + + Return Declaration + End Function + + Private Function ParseDeclarationInEnum(Optional ByRef terminator As Token = Nothing) As Declaration + Dim Start As Token + Dim StartLocation As Location + Dim Attributes As AttributeBlockCollection + Dim Name As SimpleName + Dim EqualsLocation As Location + Dim Expression As Expression = Nothing + Dim Declaration As Declaration = Nothing + + 'If AtBeginningOfLine Then + ' While ParsePreprocessorStatement(False) + ' ' Loop + ' End While + 'End If + + Start = Peek() + + If Start.Type = TokenType.Comment Then + Dim Comments As List(Of Comment) = New List(Of Comment)() + Dim LastTerminator As Token + + Do + Dim CommentToken As CommentToken = CType(Scanner.Read(), CommentToken) + Comments.Add(New Comment(CommentToken.Comment, CommentToken.IsREM, CommentToken.Span)) + LastTerminator = Read() ' Eat the terminator of the comment + Loop While Peek().Type = TokenType.Comment + Backtrack(LastTerminator) + + Declaration = New EmptyDeclaration(SpanFrom(Start), Comments) + GoTo HaveStatement + End If + + If Start.Type = TokenType.LineTerminator OrElse Start.Type = TokenType.Colon Then + GoTo HaveStatement + End If + + ErrorInConstruct = False + + StartLocation = Peek().Span.Start + Attributes = ParseAttributes() + + If Peek().Type = TokenType.End AndAlso Attributes Is Nothing Then + Declaration = ParseEndDeclaration() + GoTo HaveStatement + End If + + Name = ParseSimpleName(False) + + If ErrorInConstruct Then + ResyncAt(TokenType.Equals) + End If + + If Peek().Type = TokenType.Equals Then + EqualsLocation = ReadLocation() + Expression = ParseExpression() + + If ErrorInConstruct Then + ResyncAt() + End If + End If + + Declaration = New EnumValueDeclaration(Attributes, Name, EqualsLocation, Expression, SpanFrom(StartLocation), ParseTrailingComments()) + +HaveStatement: + terminator = VerifyEndOfStatement() + + Return Declaration + End Function + + Private Function ParseDeclarationBlock(ByVal blockStartSpan As Span, ByVal blockType As TreeType, ByRef Comments As List(Of Comment), Optional ByRef endDeclaration As EndBlockDeclaration = Nothing) As DeclarationCollection + Dim Declarations As List(Of Declaration) = New List(Of Declaration)() + Dim ColonLocations As List(Of Location) = New List(Of Location)() + Dim Terminator As Token + Dim Start As Token + Dim DeclarationsEnd As Location + Dim BlockTerminated As Boolean = False + + Comments = ParseTrailingComments() + Terminator = VerifyEndOfStatement() + + If Terminator.Type = TokenType.Colon Then + ColonLocations.Add(Terminator.Span.Start) + End If + + Start = Peek() + DeclarationsEnd = Start.Span.Finish + endDeclaration = Nothing + + PushBlockContext(blockType) + + While Peek().Type <> TokenType.EndOfStream + Dim PreviousTerminator As Token = Terminator + Dim Declaration As Declaration + + If blockType = TreeType.EnumDeclaration Then + Declaration = ParseDeclarationInEnum(Terminator) + Else + Declaration = ParseDeclaration(Terminator) + End If + + If Declaration IsNot Nothing Then + Dim ErrorType As SyntaxErrorType + + If Declaration.Type = TreeType.EndBlockDeclaration Then + Dim PotentialEndDeclaration As EndBlockDeclaration = CType(Declaration, EndBlockDeclaration) + + If DeclarationEndsBlock(blockType, PotentialEndDeclaration) Then + endDeclaration = PotentialEndDeclaration + Backtrack(Terminator) + BlockTerminated = True + Exit While + Else + Dim DeclarationEndsOuterBlock As Boolean = False + + ' If the end Declaration matches an outer block context, then we want to unwind + ' up to that level. Otherwise, we want to just give an error and keep going. + For Each BlockContext As TreeType In BlockContextStack + If DeclarationEndsBlock(BlockContext, PotentialEndDeclaration) Then + DeclarationEndsOuterBlock = True + Exit For + End If + Next + + If DeclarationEndsOuterBlock Then + ReportMismatchedEndError(blockType, Declaration.Span) + ' CONSIDER: Can we avoid parsing and re-parsing this declaration? + Backtrack(PreviousTerminator) + ' We consider the block terminated. + BlockTerminated = True + Exit While + Else + ReportMissingBeginDeclarationError(PotentialEndDeclaration) + End If + End If + Else + ErrorType = ValidDeclaration(blockType, Declaration, Declarations) + + If ErrorType <> SyntaxErrorType.None Then + ReportSyntaxError(ErrorType, Declaration.Span) + End If + End If + + Declarations.Add(Declaration) + End If + + If Terminator.Type = TokenType.Colon Then + ColonLocations.Add(Terminator.Span.Start) + End If + + DeclarationsEnd = Terminator.Span.Finish + End While + + If Not BlockTerminated Then + ReportMismatchedEndError(blockType, blockStartSpan) + End If + + PopBlockContext() + + If Declarations.Count = 0 AndAlso ColonLocations.Count = 0 Then + Return Nothing + Else + Return New DeclarationCollection(Declarations, ColonLocations, New Span(Start.Span.Start, DeclarationsEnd)) + End If + End Function + + '* + '* Parameters + '* + + Private Function ParseParameter() As Parameter + Dim Start As Token = Peek() + Dim Attributes As AttributeBlockCollection + Dim Modifiers As ModifierCollection + Dim VariableName As VariableName + Dim AsLocation As Location + Dim Type As TypeName = Nothing + Dim EqualsLocation As Location + Dim Initializer As Initializer = Nothing + + Attributes = ParseAttributes() + Modifiers = ParseParameterModifierList() + VariableName = ParseVariableName(False) + + If ErrorInConstruct Then + ' If we see As before a comma or RParen, then assume that + ' we are still on the same parameter. Otherwise, don't resync + ' and allow the caller to decide how to recover. + If PeekAheadFor(TokenType.As, TokenType.Comma, TokenType.RightParenthesis) = TokenType.As Then + ResyncAt(TokenType.As) + End If + End If + + If Peek().Type = TokenType.As Then + AsLocation = ReadLocation() + Type = ParseTypeName(True) + End If + + If ErrorInConstruct Then + ResyncAt(TokenType.Equals, TokenType.Comma, TokenType.RightParenthesis) + End If + + If Peek().Type = TokenType.Equals Then + EqualsLocation = ReadLocation() + Initializer = ParseInitializer() + End If + + If ErrorInConstruct Then + ResyncAt(TokenType.Comma, TokenType.RightParenthesis) + End If + + Return New Parameter(Attributes, Modifiers, VariableName, AsLocation, Type, EqualsLocation, Initializer, SpanFrom(Start)) + End Function + + Private Function ParametersContinue() As Boolean + Dim NextToken As Token = Peek() + + If NextToken.Type = TokenType.Comma Then + Return True + ElseIf NextToken.Type = TokenType.RightParenthesis OrElse MustEndStatement(NextToken) Then + Return False + End If + + ReportSyntaxError(SyntaxErrorType.ParameterSyntax, NextToken) + ResyncAt(TokenType.Comma, TokenType.RightParenthesis) + + If Peek().Type = TokenType.Comma Then + ErrorInConstruct = False + Return True + End If + + Return False + End Function + + Private Function ParseParameters() As ParameterCollection + Dim Start As Token = Peek() + Dim Parameters As List(Of Parameter) = New List(Of Parameter)() + Dim CommaLocations As List(Of Location) = New List(Of Location)() + Dim RightParenthesisLocation As Location + + If Start.Type <> TokenType.LeftParenthesis Then + Return Nothing + Else + Read() + End If + + If Peek().Type <> TokenType.RightParenthesis Then + Do + If Parameters.Count > 0 Then + CommaLocations.Add(ReadLocation()) + End If + + Parameters.Add(ParseParameter()) + + If ErrorInConstruct Then + ResyncAt(TokenType.Comma, TokenType.RightParenthesis) + End If + Loop While ParametersContinue() + End If + + If Peek().Type = TokenType.RightParenthesis Then + RightParenthesisLocation = ReadLocation() + Else + Dim CurrentToken As Token = Peek() + + ' On error, peek for ")" with "(". If ")" seen before + ' "(", then sync on that. Otherwise, assume missing ")" + ' and let caller decide. + ResyncAt(TokenType.LeftParenthesis, TokenType.RightParenthesis) + + If Peek().Type = TokenType.RightParenthesis Then + ReportSyntaxError(SyntaxErrorType.SyntaxError, Peek()) + RightParenthesisLocation = ReadLocation() + Else + Backtrack(CurrentToken) + ReportSyntaxError(SyntaxErrorType.ExpectedRightParenthesis, Peek()) + End If + End If + + Return New ParameterCollection(Parameters, CommaLocations, RightParenthesisLocation, SpanFrom(Start)) + End Function + + '* + '* Type Parameters + '* + + Private Function ParseTypeConstraints() As TypeConstraintCollection + Dim Start As Token = Peek() + Dim CommaLocations As List(Of Location) = New List(Of Location)() + Dim Types As List(Of TypeName) = New List(Of TypeName)() + Dim RightBracketLocation As Location + + If Peek().Type = TokenType.LeftCurlyBrace Then + Read() + + Do + If Types.Count > 0 Then + CommaLocations.Add(ReadLocation()) + End If + + Types.Add(ParseTypeName(True)) + + If ErrorInConstruct Then + ResyncAt(TokenType.Comma) + End If + Loop While Peek().Type = TokenType.Comma + + RightBracketLocation = VerifyExpectedToken(TokenType.RightCurlyBrace) + Else + Types.Add(ParseTypeName(True)) + End If + + Return New TypeConstraintCollection(Types, CommaLocations, RightBracketLocation, SpanFrom(Start)) + End Function + + Private Function ParseTypeParameter() As TypeParameter + Dim Start As Token = Peek() + Dim Name As SimpleName + Dim AsLocation As Location + Dim TypeConstraints As TypeConstraintCollection = Nothing + + Name = ParseSimpleName(False) + + If ErrorInConstruct Then + ' If we see As before a comma or RParen, then assume that + ' we are still on the same parameter. Otherwise, don't resync + ' and allow the caller to decide how to recover. + If PeekAheadFor(TokenType.As, TokenType.Comma, TokenType.RightParenthesis) = TokenType.As Then + ResyncAt(TokenType.As) + End If + End If + + If Peek().Type = TokenType.As Then + AsLocation = ReadLocation() + TypeConstraints = ParseTypeConstraints() + End If + + If ErrorInConstruct Then + ResyncAt(TokenType.Equals, TokenType.Comma, TokenType.RightParenthesis) + End If + + If ErrorInConstruct Then + ResyncAt(TokenType.Comma, TokenType.RightParenthesis) + End If + + Return New TypeParameter(Name, AsLocation, TypeConstraints, SpanFrom(Start)) + End Function + + Private Function ParseTypeParameters() As TypeParameterCollection + Dim Start As Token = Peek() + Dim OfLocation As Location + Dim TypeParameters As List(Of TypeParameter) = New List(Of TypeParameter)() + Dim CommaLocations As List(Of Location) = New List(Of Location)() + Dim RightParenthesisLocation As Location + + If Start.Type <> TokenType.LeftParenthesis OrElse Scanner.Version < LanguageVersion.VisualBasic80 Then + Return Nothing + Else + Read() + + If Peek().Type <> TokenType.Of OrElse Scanner.Version < LanguageVersion.VisualBasic80 Then + Backtrack(Start) + + Return Nothing + End If + End If + + OfLocation = VerifyExpectedToken(TokenType.Of) + + Do + If TypeParameters.Count > 0 Then + CommaLocations.Add(ReadLocation()) + End If + + TypeParameters.Add(ParseTypeParameter()) + + If ErrorInConstruct Then + ResyncAt(TokenType.Comma, TokenType.RightParenthesis) + End If + Loop While ParametersContinue() + + RightParenthesisLocation = VerifyExpectedToken(TokenType.RightParenthesis) + + Return New TypeParameterCollection(OfLocation, TypeParameters, CommaLocations, RightParenthesisLocation, SpanFrom(Start)) + End Function + + '* + '* Files + '* + + Private Function ParseFile() As File + Dim Declarations As List(Of Declaration) = New List(Of Declaration)() + Dim ColonLocations As List(Of Location) = New List(Of Location)() + Dim Terminator As Token = Nothing + Dim Start As Token = Peek() + + While Peek().Type <> TokenType.EndOfStream + Dim Declaration As Declaration + + Declaration = ParseDeclaration(Terminator) + + If Declaration IsNot Nothing Then + Dim ErrorType As SyntaxErrorType = SyntaxErrorType.None + + ErrorType = ValidDeclaration(TreeType.File, Declaration, Declarations) + + If ErrorType <> SyntaxErrorType.None Then + ReportSyntaxError(ErrorType, Declaration.Span) + End If + + Declarations.Add(Declaration) + End If + + If Terminator.Type = TokenType.Colon Then + ColonLocations.Add(Terminator.Span.Start) + End If + End While + + If Declarations.Count = 0 AndAlso ColonLocations.Count = 0 Then + Return New File(Nothing, SpanFrom(Start)) + Else + Return New File(New DeclarationCollection(Declarations, ColonLocations, SpanFrom(Start)), SpanFrom(Start)) + End If + End Function + 'LC Parse the script files + Private Function ParseScriptFile() As ScriptBlock + Dim Statements As List(Of Statement) = New List(Of Statement)() + Dim ColonLocations As List(Of Location) = New List(Of Location)() + Dim Terminator As Token + Dim Start As Token + Dim StatementsEnd As Location + Dim BlockTerminated As Boolean = False + + Start = Peek() + StatementsEnd = Start.Span.Finish + + While Peek().Type <> TokenType.EndOfStream + Dim PreviousTerminator As Token = Terminator + Dim Statement As Statement + + Statement = ParseStatementOrDeclaration(Terminator) + + If Not Statement Is Nothing Then + Statements.Add(Statement) + End If + + If Terminator.Type = TokenType.Colon Then + ColonLocations.Add(Terminator.Span.Start) + StatementsEnd = Terminator.Span.Finish + Else + StatementsEnd = Terminator.Span.Finish + End If + End While + + If Statements.Count = 0 AndAlso ColonLocations.Count = 0 Then + Return New ScriptBlock(Nothing, SpanFrom(Start)) + Else + Return New ScriptBlock(New StatementCollection(Statements, ColonLocations, New Span(Start.Span.Start, StatementsEnd)), SpanFrom(Start)) + End If + End Function + + '* + '* Preprocessor statements + '* + + Private Sub ParseExternalSourceStatement(ByVal start As Token) + Dim Line As Long + Dim File As String + + ' Consume the ExternalSource keyword + Read() + + If CurrentExternalSourceContext IsNot Nothing Then + ResyncAt() + ReportSyntaxError(SyntaxErrorType.NestedExternalSourceStatement, SpanFrom(start)) + Else + VerifyExpectedToken(TokenType.LeftParenthesis) + + If Peek().Type <> TokenType.StringLiteral Then + ReportSyntaxError(SyntaxErrorType.ExpectedStringLiteral, Peek()) + ResyncAt() + Return + End If + + File = CType(Read(), StringLiteralToken).Literal + VerifyExpectedToken(TokenType.Comma) + + If Peek().Type <> TokenType.IntegerLiteral Then + ReportSyntaxError(SyntaxErrorType.ExpectedIntegerLiteral, Peek()) + ResyncAt() + Return + End If + + Line = CType(Read(), IntegerLiteralToken).Literal + + VerifyExpectedToken(TokenType.RightParenthesis) + + CurrentExternalSourceContext = New ExternalSourceContext() + With CurrentExternalSourceContext + .File = File + .Line = Line + .Start = Peek().Span.Start + End With + End If + End Sub + + Private Sub ParseExternalChecksumStatement() + Dim Filename, Guid, Checksum As String + + ' Consume the ExternalChecksum keyword + Read() + VerifyExpectedToken(TokenType.LeftParenthesis) + + If Peek().Type <> TokenType.StringLiteral Then + ReportSyntaxError(SyntaxErrorType.ExpectedStringLiteral, Peek()) + ResyncAt() + Return + End If + + Filename = CType(Read(), StringLiteralToken).Literal + VerifyExpectedToken(TokenType.Comma) + + If Peek().Type <> TokenType.StringLiteral Then + ReportSyntaxError(SyntaxErrorType.ExpectedStringLiteral, Peek()) + ResyncAt() + Return + End If + + Guid = CType(Read(), StringLiteralToken).Literal + VerifyExpectedToken(TokenType.Comma) + + If Peek().Type <> TokenType.StringLiteral Then + ReportSyntaxError(SyntaxErrorType.ExpectedStringLiteral, Peek()) + ResyncAt() + Return + End If + + Checksum = CType(Read(), StringLiteralToken).Literal + VerifyExpectedToken(TokenType.RightParenthesis) + + If ExternalChecksums IsNot Nothing Then + ExternalChecksums.Add(New ExternalChecksum(Filename, Guid, Checksum)) + End If + End Sub + + Private Sub ParseRegionStatement(ByVal start As Token, ByVal statementLevel As Boolean) + Dim Description As String + Dim RegionContext As RegionContext + + If statementLevel = True Then + ResyncAt() + ReportSyntaxError(SyntaxErrorType.RegionInsideMethod, SpanFrom(start)) + Return + End If + + ' Consume the Region keyword + Read() + + If Peek().Type <> TokenType.StringLiteral Then + ReportSyntaxError(SyntaxErrorType.ExpectedStringLiteral, Peek()) + ResyncAt() + Return + End If + + Description = CType(Read(), StringLiteralToken).Literal + + RegionContext = New RegionContext + RegionContext.Description = Description + RegionContext.Start = Peek().Span.Start + RegionContextStack.Push(RegionContext) + End Sub + + Private Sub ParseEndPreprocessingStatement(ByVal start As Token, ByVal statementLevel As Boolean) + ' Consume the End keyword + Read() + + If Peek().AsUnreservedKeyword() = TokenType.ExternalSource Then + Read() + + If CurrentExternalSourceContext Is Nothing Then + ReportSyntaxError(SyntaxErrorType.EndExternalSourceWithoutExternalSource, SpanFrom(start)) + ResyncAt() + Else + If ExternalLineMappings IsNot Nothing Then + With CurrentExternalSourceContext + ExternalLineMappings.Add(New ExternalLineMapping(.Start, start.Span.Start, .File, .Line)) + End With + End If + CurrentExternalSourceContext = Nothing + End If + + Return + ElseIf Peek().AsUnreservedKeyword() = TokenType.Region Then + Read() + + If statementLevel = True Then + ResyncAt() + ReportSyntaxError(SyntaxErrorType.RegionInsideMethod, SpanFrom(start)) + Return + End If + + If RegionContextStack.Count = 0 Then + ReportSyntaxError(SyntaxErrorType.EndRegionWithoutRegion, SpanFrom(start)) + ResyncAt() + Else + Dim RegionContext As RegionContext = RegionContextStack.Pop() + + If SourceRegions IsNot Nothing Then + SourceRegions.Add(New SourceRegion(RegionContext.Start, start.Span.Start, RegionContext.Description)) + End If + End If + + Return + ElseIf Peek().Type = TokenType.If Then + ' Read the If keyword + Read() + + If ConditionalCompilationContextStack.Count = 0 Then + ReportSyntaxError(SyntaxErrorType.CCEndIfWithoutCCIf, SpanFrom(start)) + Else + ConditionalCompilationContextStack.Pop() + End If + + Return + End If + + ResyncAt() + ReportSyntaxError(SyntaxErrorType.ExpectedEndKind, Peek()) + End Sub + + 'Private Shared Function EvaluateCCLiteral(ByVal expression As LiteralExpression) As Object + ' Select Case expression.Type + ' Case TreeType.IntegerLiteralExpression + ' Return CType(expression, IntegerLiteralExpression).Literal + + ' Case TreeType.FloatingPointLiteralExpression + ' Return CType(expression, FloatingPointLiteralExpression).Literal + + ' Case TreeType.StringLiteralExpression + ' Return CType(expression, StringLiteralExpression).Literal + + ' Case TreeType.CharacterLiteralExpression + ' Return CType(expression, CharacterLiteralExpression).Literal + + ' Case TreeType.DateLiteralExpression + ' Return CType(expression, DateLiteralExpression).Literal + + ' Case TreeType.DecimalLiteralExpression + ' Return CType(expression, DecimalLiteralExpression).Literal + + ' Case TreeType.BooleanLiteralExpression + ' Return CType(expression, BooleanLiteralExpression).Literal + + ' Case Else + ' Debug.Assert(False, "Unexpected!") + ' Return Nothing + ' End Select + 'End Function + + Private Shared Function TypeCodeOfCastExpression(ByVal castType As IntrinsicType) As TypeCode + Select Case castType + Case IntrinsicType.Boolean + Return TypeCode.Boolean + + Case IntrinsicType.Byte + Return TypeCode.Byte + + Case IntrinsicType.Char + Return TypeCode.Char + + Case IntrinsicType.Date + Return TypeCode.DateTime + + Case IntrinsicType.Decimal + Return TypeCode.Decimal + + Case IntrinsicType.Double + Return TypeCode.Double + + Case IntrinsicType.Integer + Return TypeCode.Int32 + + Case IntrinsicType.Long + Return TypeCode.Int64 + + Case IntrinsicType.Object + Return TypeCode.Object + + Case IntrinsicType.Short + Return TypeCode.Int16 + + Case IntrinsicType.Single + Return TypeCode.Single + + Case IntrinsicType.String + Return TypeCode.String + + Case Else + Debug.Assert(False, "Unexpected!") + Return TypeCode.Empty + End Select + End Function + + 'Private Function EvaluateCCCast(ByVal expression As IntrinsicCastExpression) As Object + ' ' This cast is safe because only intrinsics are ever returned + ' Dim Operand As IConvertible = CType(EvaluateCCExpression(expression.Operand), IConvertible) + ' Dim OperandType As TypeCode + ' Dim CastType As TypeCode = TypeCodeOfCastExpression(expression.IntrinsicType) + + ' If CastType = TypeCode.Empty Then + ' Return Nothing + ' End If + + ' If Operand Is Nothing Then + ' Operand = 0 + ' End If + + ' OperandType = Operand.GetTypeCode() + + ' If CastType = OperandType OrElse CastType = TypeCode.Object Then + ' Return Operand + ' End If + + ' Select Case OperandType + ' Case TypeCode.Boolean + ' If CastType = TypeCode.Byte Then + ' Operand = 255 + ' Else + ' Operand = -1 + ' End If + ' OperandType = TypeCode.Int32 + + ' Case TypeCode.String + ' If CastType <> TypeCode.Char Then + ' ReportSyntaxError(SyntaxErrorType.CantCastStringInCCExpression, expression.Span) + ' Return Nothing + ' End If + + ' Case TypeCode.Char + ' If CastType <> TypeCode.String Then + ' ReportSyntaxError(SyntaxErrorType.InvalidCCCast, expression.Span) + ' Return Nothing + ' End If + + ' Case TypeCode.DateTime + ' ReportSyntaxError(SyntaxErrorType.InvalidCCCast, expression.Span) + ' Return Nothing + ' End Select + + ' Select Case expression.IntrinsicType + ' Case IntrinsicType.Boolean + ' Return CBool(Operand) + + ' Case IntrinsicType.Byte + ' Return CByte(Operand) + + ' Case IntrinsicType.Short + ' Return CShort(Operand) + + ' Case IntrinsicType.Integer + ' Return CInt(Operand) + + ' Case IntrinsicType.Long + ' Return CLng(Operand) + + ' Case IntrinsicType.Decimal + ' Return CDec(Operand) + + ' Case IntrinsicType.Single + ' Return CSng(Operand) + + ' Case IntrinsicType.Double + ' Return CDbl(Operand) + + ' Case IntrinsicType.Char + ' If OperandType = TypeCode.String Then + ' Return CChar(DirectCast(Operand, String)) + ' End If + + ' ReportSyntaxError(SyntaxErrorType.InvalidCCCast, expression.Span) + ' Return Nothing + + ' Case IntrinsicType.String + ' If OperandType = TypeCode.Char Then + ' Return CStr(DirectCast(Operand, Char)) + ' End If + + ' ReportSyntaxError(SyntaxErrorType.CantCastStringInCCExpression, expression.Span) + ' Return Nothing + + ' Case IntrinsicType.Date + ' ReportSyntaxError(SyntaxErrorType.InvalidCCCast, expression.Span) + ' Return Nothing + + ' Case Else + ' Debug.Assert(False, "Unexpected!") + ' Return Nothing + ' End Select + 'End Function + + 'Private Function EvaluateCCUnaryOperator(ByVal expression As UnaryOperatorExpression) As Object + ' ' This cast is safe because only intrinsics are ever returned + ' Dim Operand As IConvertible = CType(EvaluateCCExpression(expression.Operand), IConvertible) + ' Dim OperandType As TypeCode + + ' If Operand Is Nothing Then + ' Operand = 0 + ' End If + + ' OperandType = Operand.GetTypeCode() + + ' If OperandType = TypeCode.String OrElse OperandType = TypeCode.Char OrElse OperandType = TypeCode.DateTime Then + ' ReportSyntaxError(SyntaxErrorType.InvalidCCOperator, expression.Span) + ' Return Nothing + ' End If + + ' Select Case expression.[Operator] + ' Case OperatorType.UnaryPlus + ' If OperandType = TypeCode.Boolean Then + ' ReportSyntaxError(SyntaxErrorType.InvalidCCOperator, expression.Span) + ' Return Nothing + ' Else + ' Return Operand + ' End If + + ' Case OperatorType.Negate + ' If OperandType = TypeCode.Boolean OrElse OperandType = TypeCode.Byte Then + ' ReportSyntaxError(SyntaxErrorType.InvalidCCOperator, expression.Span) + ' Return Nothing + ' Else + ' Return CompilerServices.ObjectType.NegObj(Operand) + ' End If + + ' Case OperatorType.Not + ' If OperandType = TypeCode.Decimal OrElse OperandType = TypeCode.Single OrElse _ + ' OperandType = TypeCode.Double Then + ' ReportSyntaxError(SyntaxErrorType.InvalidCCOperator, expression.Span) + ' Return Nothing + ' Else + ' Return CompilerServices.ObjectType.NotObj(Operand) + ' End If + + ' Case Else + ' Debug.Assert(False, "Unexpected!") + ' Return Nothing + ' End Select + 'End Function + + Private Shared Function EitherIsTypeCode(ByVal x As TypeCode, ByVal y As TypeCode, ByVal type As TypeCode) As Boolean + Return x = type OrElse y = type + End Function + + Private Shared Function IsEitherTypeCode(ByVal x As TypeCode, ByVal type1 As TypeCode, ByVal type2 As TypeCode) As Boolean + Return x = type1 OrElse x = type2 + End Function + + 'Private Function EvaluateCCBinaryOperator(ByVal expression As BinaryOperatorExpression) As Object + ' ' This cast is safe because only intrinsics are ever returned + ' Dim LeftOperand As IConvertible = CType(EvaluateCCExpression(expression.LeftOperand), IConvertible) + ' Dim RightOperand As IConvertible = CType(EvaluateCCExpression(expression.RightOperand), IConvertible) + ' Dim LeftOperandType, RightOperandType As TypeCode + + ' If LeftOperand Is Nothing Then + ' LeftOperand = 0 + ' End If + + ' If RightOperand Is Nothing Then + ' RightOperand = 0 + ' End If + + ' LeftOperandType = LeftOperand.GetTypeCode() + ' RightOperandType = RightOperand.GetTypeCode() + + ' If EitherIsTypeCode(LeftOperandType, RightOperandType, TypeCode.DateTime) Then + ' ReportSyntaxError(SyntaxErrorType.InvalidCCOperator, expression.Span) + ' Return Nothing + ' End If + + ' If expression.[Operator] <> OperatorType.Concatenate AndAlso _ + ' expression.[Operator] <> OperatorType.Plus AndAlso _ + ' expression.[Operator] <> OperatorType.Equals AndAlso _ + ' expression.[Operator] <> OperatorType.NotEquals AndAlso _ + ' (EitherIsTypeCode(LeftOperandType, RightOperandType, TypeCode.Char) OrElse _ + ' EitherIsTypeCode(LeftOperandType, RightOperandType, TypeCode.String)) Then + ' ReportSyntaxError(SyntaxErrorType.InvalidCCOperator, expression.Span) + ' Return Nothing + ' End If + + ' Select Case expression.[Operator] + ' Case OperatorType.Plus + ' If EitherIsTypeCode(LeftOperandType, RightOperandType, TypeCode.String) OrElse _ + ' EitherIsTypeCode(LeftOperandType, RightOperandType, TypeCode.Char) Then + ' If Not IsEitherTypeCode(LeftOperandType, TypeCode.Char, TypeCode.String) OrElse _ + ' Not IsEitherTypeCode(LeftOperandType, TypeCode.Char, TypeCode.String) Then + ' ReportSyntaxError(SyntaxErrorType.InvalidCCOperator, expression.Span) + ' Return Nothing + ' Else + ' Return CStr(LeftOperand) + CStr(RightOperand) + ' End If + ' Else + ' Return CompilerServices.ObjectType.AddObj(LeftOperand, RightOperand) + ' End If + + ' Case OperatorType.Minus + ' Return CompilerServices.ObjectType.SubObj(LeftOperand, RightOperand) + + ' Case OperatorType.Multiply + ' Return CompilerServices.ObjectType.MulObj(LeftOperand, RightOperand) + + ' Case OperatorType.IntegralDivide + ' Return CompilerServices.ObjectType.IDivObj(LeftOperand, RightOperand) + + ' Case OperatorType.Divide + ' Return CompilerServices.ObjectType.DivObj(LeftOperand, RightOperand) + + ' Case OperatorType.Modulus + ' Return CompilerServices.ObjectType.ModObj(LeftOperand, RightOperand) + + ' Case OperatorType.Power + ' Return CompilerServices.ObjectType.PowObj(LeftOperand, RightOperand) + + ' Case OperatorType.ShiftLeft + ' Return CompilerServices.ObjectType.ShiftLeftObj(LeftOperand, CInt(RightOperand)) + + ' Case OperatorType.ShiftRight + ' Return CompilerServices.ObjectType.ShiftRightObj(LeftOperand, CInt(RightOperand)) + + ' Case OperatorType.And + ' Return CompilerServices.ObjectType.BitAndObj(LeftOperand, CInt(RightOperand)) + + ' Case OperatorType.Or + ' Return CompilerServices.ObjectType.BitOrObj(LeftOperand, CInt(RightOperand)) + + ' Case OperatorType.Xor + ' Return CompilerServices.ObjectType.BitXorObj(LeftOperand, CInt(RightOperand)) + + ' Case OperatorType.AndAlso + ' Return CBool(LeftOperand) AndAlso CBool(RightOperand) + + ' Case OperatorType.OrElse + ' Return CBool(LeftOperand) OrElse CBool(RightOperand) + + ' Case OperatorType.Equals + ' If (EitherIsTypeCode(LeftOperandType, RightOperandType, TypeCode.String) OrElse _ + ' EitherIsTypeCode(LeftOperandType, RightOperandType, TypeCode.Char)) AndAlso _ + ' (Not IsEitherTypeCode(LeftOperandType, TypeCode.Char, TypeCode.String) OrElse _ + ' Not IsEitherTypeCode(LeftOperandType, TypeCode.Char, TypeCode.String)) Then + ' ReportSyntaxError(SyntaxErrorType.InvalidCCOperator, expression.Span) + ' Return Nothing + ' End If + + ' Return CompilerServices.ObjectType.ObjTst(LeftOperand, RightOperand, False) = 0 + + ' Case OperatorType.NotEquals + ' If (EitherIsTypeCode(LeftOperandType, RightOperandType, TypeCode.String) OrElse _ + ' EitherIsTypeCode(LeftOperandType, RightOperandType, TypeCode.Char)) AndAlso _ + ' (Not IsEitherTypeCode(LeftOperandType, TypeCode.Char, TypeCode.String) OrElse _ + ' Not IsEitherTypeCode(LeftOperandType, TypeCode.Char, TypeCode.String)) Then + ' ReportSyntaxError(SyntaxErrorType.InvalidCCOperator, expression.Span) + ' Return Nothing + ' End If + + ' Return CompilerServices.ObjectType.ObjTst(LeftOperand, RightOperand, False) <> 0 + + ' Case OperatorType.LessThan + ' Return CompilerServices.ObjectType.ObjTst(LeftOperand, RightOperand, False) = -1 + + ' Case OperatorType.GreaterThan + ' Return CompilerServices.ObjectType.ObjTst(LeftOperand, RightOperand, False) = 1 + + ' Case OperatorType.LessThanEquals + ' Return CompilerServices.ObjectType.ObjTst(LeftOperand, RightOperand, False) <> 1 + + ' Case OperatorType.GreaterThanEquals + ' Return CompilerServices.ObjectType.ObjTst(LeftOperand, RightOperand, False) <> -1 + + ' Case OperatorType.Concatenate + ' If Not IsEitherTypeCode(LeftOperandType, TypeCode.Char, TypeCode.String) OrElse _ + ' Not IsEitherTypeCode(LeftOperandType, TypeCode.Char, TypeCode.String) Then + ' ReportSyntaxError(SyntaxErrorType.InvalidCCOperator, expression.Span) + ' Return Nothing + ' Else + ' Return CStr(LeftOperand) & CStr(RightOperand) + ' End If + + ' Case Else + ' Debug.Assert(False, "Unexpected!") + ' Return Nothing + ' End Select + 'End Function + + 'Private Function EvaluateCCExpression(ByVal expression As Expression) As Object + ' Select Case expression.Type + ' Case TreeType.SyntaxError + ' ' Do nothing + + ' Case TreeType.NothingExpression + ' Return Nothing + + ' Case TreeType.IntegerLiteralExpression, TreeType.FloatingPointLiteralExpression, _ + ' TreeType.StringLiteralExpression, TreeType.CharacterLiteralExpression, _ + ' TreeType.DateLiteralExpression, TreeType.DecimalLiteralExpression, _ + ' TreeType.BooleanLiteralExpression + ' Return EvaluateCCLiteral(CType(expression, LiteralExpression)) + + ' Case TreeType.ParentheticalExpression + ' Return EvaluateCCExpression(CType(expression, ParentheticalExpression).Operand) + + ' Case TreeType.SimpleNameExpression + ' If ConditionalCompilationConstants.ContainsKey(CType(expression, SimpleNameExpression).Name.Name) Then + ' Return ConditionalCompilationConstants(CType(expression, SimpleNameExpression).Name.Name) + ' Else + ' Return Nothing + ' End If + + ' Case TreeType.IntrinsicCastExpression + ' Return EvaluateCCCast(CType(expression, IntrinsicCastExpression)) + + ' Case TreeType.UnaryOperatorExpression + ' Return EvaluateCCUnaryOperator(CType(expression, UnaryOperatorExpression)) + + ' Case TreeType.BinaryOperatorExpression + ' Return EvaluateCCBinaryOperator(CType(expression, BinaryOperatorExpression)) + + ' Case Else + ' ReportSyntaxError(SyntaxErrorType.CCExpressionRequired, expression.Span) + ' End Select + + ' Return Nothing + 'End Function + + 'Private Sub ParseConditionalConstantStatement() + ' Dim Identifier As IdentifierToken + ' Dim Expression As Expression + + ' ' Consume the Const keyword + ' Read() + + ' If Peek().Type = TokenType.Identifier Then + ' Identifier = CType(Read(), IdentifierToken) + ' Else + ' ReportSyntaxError(SyntaxErrorType.ExpectedIdentifier, Peek()) + ' ResyncAt() + ' Return + ' End If + + ' VerifyExpectedToken(TokenType.Equals) + ' Expression = ParseExpression() + + ' If Not ErrorInConstruct Then + ' ConditionalCompilationConstants.Add(Identifier.Identifier, EvaluateCCExpression(Expression)) + ' Else + ' ResyncAt() + ' End If + 'End Sub + + 'Private Sub ParseConditionalIfStatement() + ' Dim Expression As Expression + ' Dim CCContext As ConditionalCompilationContext + + ' ' Consume the If + ' Read() + + ' Expression = ParseExpression() + + ' If ErrorInConstruct Then + ' ResyncAt(TokenType.Then) + ' End If + + ' If Peek().Type = TokenType.Then Then + ' ' Consume the Then keyword + ' Read() + ' End If + + ' CCContext = New ConditionalCompilationContext + ' With CCContext + ' .BlockActive = CBool(EvaluateCCExpression(Expression)) + ' .AnyBlocksActive = .BlockActive + ' End With + ' ConditionalCompilationContextStack.Push(CCContext) + 'End Sub + + 'Private Sub ParseConditionalElseIfStatement(ByVal start As Token) + ' Dim Expression As Expression + ' Dim CCContext As ConditionalCompilationContext + + ' ' Consume the If + ' Read() + + ' Expression = ParseExpression() + + ' If ErrorInConstruct Then + ' ResyncAt(TokenType.Then) + ' End If + + ' If Peek().Type = TokenType.Then Then + ' ' Consume the Then keyword + ' Read() + ' End If + + ' If ConditionalCompilationContextStack.Count = 0 Then + ' ReportSyntaxError(SyntaxErrorType.CCElseIfWithoutCCIf, SpanFrom(start)) + ' Else + ' CCContext = ConditionalCompilationContextStack.Peek() + + ' If CCContext.SeenElse Then + ' ReportSyntaxError(SyntaxErrorType.CCElseIfAfterCCElse, SpanFrom(start)) + ' CCContext.BlockActive = False + ' ElseIf CCContext.BlockActive Then + ' CCContext.BlockActive = False + ' ElseIf Not CCContext.AnyBlocksActive AndAlso CBool(EvaluateCCExpression(Expression)) Then + ' CCContext.BlockActive = True + ' CCContext.AnyBlocksActive = True + ' End If + ' End If + 'End Sub + + 'Private Sub ParseConditionalElseStatement(ByVal start As Token) + ' Dim CCContext As ConditionalCompilationContext + + ' ' Consume the else + ' Read() + + ' If ConditionalCompilationContextStack.Count = 0 Then + ' ReportSyntaxError(SyntaxErrorType.CCElseWithoutCCIf, SpanFrom(start)) + ' Else + ' CCContext = ConditionalCompilationContextStack.Peek() + + ' If CCContext.SeenElse Then + ' ReportSyntaxError(SyntaxErrorType.CCElseAfterCCElse, SpanFrom(start)) + ' CCContext.BlockActive = False + ' Else + ' CCContext.SeenElse = True + + ' If CCContext.BlockActive Then + ' CCContext.BlockActive = False + ' ElseIf Not CCContext.AnyBlocksActive Then + ' CCContext.BlockActive = True + ' End If + ' End If + ' End If + 'End Sub + + ' Private Function ParsePreprocessorStatement(ByVal statementLevel As Boolean) As Boolean + ' Dim Start As Token = Peek() + + ' Debug.Assert(AtBeginningOfLine, "Must be at beginning of line!") + + ' If Not Preprocess Then + ' Return False + ' End If + + ' If Start.Type = TokenType.Pound Then + ' ErrorInConstruct = False + + ' ' Consume the pound + ' Read() + + ' Select Case Peek().AsUnreservedKeyword() + ' Case TokenType.Const + ' ParseConditionalConstantStatement() + + ' Case TokenType.If + ' ParseConditionalIfStatement() + + ' Case TokenType.Else + ' ParseConditionalElseStatement(Start) + + ' Case TokenType.ElseIf + ' ParseConditionalElseIfStatement(Start) + + ' Case TokenType.ExternalSource + ' ParseExternalSourceStatement(Start) + + ' Case TokenType.Region + ' ParseRegionStatement(Start, statementLevel) + + ' Case TokenType.ExternalChecksum + ' ParseExternalChecksumStatement() + + ' Case TokenType.End + ' ParseEndPreprocessingStatement(Start, statementLevel) + + ' Case Else + 'InvalidStatement: + ' ResyncAt() + ' ReportSyntaxError(SyntaxErrorType.InvalidPreprocessorStatement, SpanFrom(Start)) + ' End Select + + ' ParseTrailingComments() + + ' If Peek().Type <> TokenType.LineTerminator AndAlso Peek().Type <> TokenType.EndOfStream Then + ' ReportSyntaxError(SyntaxErrorType.ExpectedEndOfStatement, Peek()) + ' ResyncAt() + ' End If + + ' Read() + ' Return True + ' Else + ' ' If we're in a false conditional compilation statement, then keep reading lines as if they + ' ' were preprocessing statements until we are done. + ' If Start.Type <> TokenType.EndOfStream AndAlso _ + ' ConditionalCompilationContextStack.Count > 0 AndAlso _ + ' Not ConditionalCompilationContextStack.Peek().BlockActive Then + ' ResyncAt() + ' Read() + + ' Return True + ' Else + ' Return False + ' End If + ' End If + ' End Function + + '* + '* Public APIs + '* + + Private Sub StartParsing(ByVal scanner As Scanner, _ + ByVal errorTable As IList(Of SyntaxError), _ + Optional ByVal preprocess As Boolean = False, _ + Optional ByVal conditionalCompilationConstants As IDictionary(Of String, Object) = Nothing, _ + Optional ByVal sourceRegions As IList(Of SourceRegion) = Nothing, _ + Optional ByVal externalLineMappings As IList(Of ExternalLineMapping) = Nothing, _ + Optional ByVal externalChecksums As IList(Of ExternalChecksum) = Nothing) + Me.Scanner = scanner + Me.ErrorTable = errorTable + Me.Preprocess = preprocess + If conditionalCompilationConstants Is Nothing Then + Me.ConditionalCompilationConstants = New Dictionary(Of String, Object)() + Else + ' We have to clone this because the same hashtable could be used for + ' multiple parses. + Me.ConditionalCompilationConstants = New Dictionary(Of String, Object)(conditionalCompilationConstants) + End If + Me.ExternalLineMappings = externalLineMappings + Me.SourceRegions = sourceRegions + Me.ExternalChecksums = externalChecksums + ErrorInConstruct = False + AtBeginningOfLine = True + BlockContextStack.Clear() + End Sub + + Private Sub FinishParsing() + If CurrentExternalSourceContext IsNot Nothing Then + ReportSyntaxError(SyntaxErrorType.ExpectedEndExternalSource, Peek()) + End If + + If Not RegionContextStack.Count = 0 Then + ReportSyntaxError(SyntaxErrorType.ExpectedEndRegion, Peek()) + End If + + If Not ConditionalCompilationContextStack.Count = 0 Then + ReportSyntaxError(SyntaxErrorType.ExpectedCCEndIf, Peek()) + End If + + StartParsing(Nothing, Nothing, False, Nothing, Nothing, Nothing) + End Sub + + ''' + ''' Parse an entire file. + ''' + ''' The scanner to use to fetch the tokens. + ''' The list of errors produced during parsing. + ''' A file-level parse tree. + Public Function ParseFile(ByVal scanner As Scanner, ByVal errorTable As IList(Of SyntaxError)) As File + Dim File As File + + StartParsing(scanner, errorTable, True) + File = ParseFile() + FinishParsing() + + Return File + End Function + + ''' + ''' Parse an entire file. + ''' + ''' The scanner to use to fetch the tokens. + ''' The list of errors produced during parsing. + ''' Pre-defined conditional compilation constants. + ''' Source regions defined in the file. + ''' External line mappings defined in the file. + ''' A file-level parse tree. + Public Function ParseFile(ByVal scanner As Scanner, _ + ByVal errorTable As IList(Of SyntaxError), _ + ByVal conditionalCompilationConstants As IDictionary(Of String, Object), _ + ByVal sourceRegions As IList(Of SourceRegion), _ + ByVal externalLineMappings As IList(Of ExternalLineMapping), _ + ByVal externalChecksums As IList(Of ExternalChecksum)) As File + Dim File As File + + StartParsing(scanner, errorTable, True, conditionalCompilationConstants, sourceRegions, externalLineMappings, externalChecksums) + File = ParseFile() + FinishParsing() + + Return File + End Function + + 'LC the entry method to parse script file + Public Function ParseScriptFile(ByVal scanner As Scanner, ByVal errorTable As IList(Of SyntaxError)) As ScriptBlock + Dim File As ScriptBlock + + StartParsing(scanner, errorTable, True) + File = ParseScriptFile() + FinishParsing() + + Return File + End Function + 'LC the entry method to parse script file + Public Function ParseScriptFile(ByVal scanner As Scanner, _ + ByVal errorTable As IList(Of SyntaxError), _ + ByVal conditionalCompilationConstants As IDictionary(Of String, Object), _ + ByVal sourceRegions As IList(Of SourceRegion), _ + ByVal externalLineMappings As IList(Of ExternalLineMapping), _ + ByVal externalChecksums As IList(Of ExternalChecksum)) As ScriptBlock + Dim File As ScriptBlock + + StartParsing(scanner, errorTable, True, conditionalCompilationConstants, sourceRegions, externalLineMappings, externalChecksums) + File = ParseScriptFile() + FinishParsing() + + Return File + End Function + + + ''' + ''' Parse a declaration. + ''' + ''' The scanner to use to fetch the tokens. + ''' The list of errors produced during parsing. + ''' A declaration-level parse tree. + Public Function ParseDeclaration(ByVal scanner As Scanner, ByVal errorTable As IList(Of SyntaxError)) As Declaration + Dim Declaration As Declaration + + StartParsing(scanner, errorTable) + Declaration = ParseDeclaration() + FinishParsing() + + Return Declaration + End Function + + ''' + ''' Parse a statement. + ''' + ''' The scanner to use to fetch the tokens. + ''' The list of errors produced during parsing. + ''' A statement-level parse tree. + Public Function ParseStatement(ByVal scanner As Scanner, ByVal errorTable As IList(Of SyntaxError)) As Statement + Dim Statement As Statement + + StartParsing(scanner, errorTable) + Statement = ParseStatement() + FinishParsing() + + Return Statement + End Function + + ''' + ''' Parse an expression. + ''' + ''' The scanner to use to fetch the tokens. + ''' The list of errors produced during parsing. + ''' An expression-level parse tree. + Public Function ParseExpression(ByVal scanner As Scanner, ByVal errorTable As IList(Of SyntaxError)) As Expression + Dim Expression As Expression + + StartParsing(scanner, errorTable) + Expression = ParseExpression() + FinishParsing() + + Return Expression + End Function + + ''' + ''' Parse a type name. + ''' + ''' The scanner to use to fetch the tokens. + ''' The list of errors produced during parsing. + ''' A typename-level parse tree. + Public Function ParseTypeName(ByVal scanner As Scanner, ByVal errorTable As IList(Of SyntaxError)) As TypeName + Dim TypeName As TypeName + + StartParsing(scanner, errorTable) + TypeName = ParseTypeName(True) + FinishParsing() + + Return TypeName + End Function +End Class diff --git a/aspclassiccompiler/Parser/Parser.vbproj b/aspclassiccompiler/Parser/Parser.vbproj new file mode 100644 index 0000000..65c5c4e --- /dev/null +++ b/aspclassiccompiler/Parser/Parser.vbproj @@ -0,0 +1,447 @@ + + + Local + 9.0.30729 + 2.0 + {57A0B340-BDA4-4DE3-B449-52B8C51D84B8} + Debug + AnyCPU + + + + + Dlrsoft.VBParser + + + None + JScript + Grid + IE50 + false + Library + Binary + On + On + Dlrsoft.VBScript.Parser + VBParser.(None) + + + 3.5 + + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + ..\bin\Debug + Dlrsoft.VBParser.xml + 285212672 + + + + + true + true + true + false + false + false + false + 1 + 42016,42017,42018,42019,42032 + false + + + + + ..\bin\Release\ + Dlrsoft.VBParser.xml + 285212672 + + + + + false + true + false + true + false + false + false + 1 + 42016,42017,42018,42019,42032 + + + + System + + + + + + + + + + + + + + + + Code + + + + Code + + + Code + + + Code + + + True + Application.myapp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + + + False + .NET Framework Client Profile + false + + + False + .NET Framework 2.0 %28x86%29 + true + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + false + + + False + .NET Framework 3.5 SP1 + false + + + + + + + + + + \ No newline at end of file diff --git a/aspclassiccompiler/Parser/SLVBParser.vbproj b/aspclassiccompiler/Parser/SLVBParser.vbproj new file mode 100644 index 0000000..9702741 --- /dev/null +++ b/aspclassiccompiler/Parser/SLVBParser.vbproj @@ -0,0 +1,305 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {FAE34487-11A6-4EE2-96BB-7F73C7611097} + {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{F184B08F-C81C-45F6-A57F-5ABD9991F28F} + Library + Dlrsoft.VBScript.Parser + Dlrsoft.VBParser + v3.5 + false + true + true + On + Binary + Off + On + + + true + full + true + true + true + true + Empty + ..Bin\Silverlight Debug\ + Dlrsoft.VBParser.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + SILVERLIGHT=1 + + + pdbonly + false + true + true + true + true + ..\Bin\Silverlight Release\ + Dlrsoft.VBParser.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + SILVERLIGHT=1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Scanner.vb b/aspclassiccompiler/Parser/Scanner.vb new file mode 100644 index 0000000..f9fe91d --- /dev/null +++ b/aspclassiccompiler/Parser/Scanner.vb @@ -0,0 +1,1361 @@ +' +' 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.Globalization + +''' +''' A lexical analyzer for Visual Basic .NET. It produces a stream of lexical tokens. +''' +Public NotInheritable Class Scanner + Implements IDisposable + + ' The text to be read. We use a TextReader here so that lexical analysis + ' can be done on strings as well as streams. + Private _Source As TextReader + + ' For performance reasons, we cache the character when we peek ahead. + Private _PeekCache As Char + Private _PeekCacheHasValue As Boolean = False + + ' There are a few places where we're going to need to peek one character + ' ahead + Private _PeekAheadCache As Char + Private _PeekAheadCacheHasValue As Boolean = False + + ' Since we're only using a TextReader which has no position information, + ' we have to keep track of line/column information ourselves. + Private _Index As Integer = 0 + Private _Line As Integer = 1 + Private _Column As Integer = 1 + + ' A buffer of all the tokens we've returned so far + Private _Tokens As List(Of Token) = New List(Of Token)() + + ' Our current position in the buffer. -1 means before the beginning. + Private _Position As Integer = -1 + + ' Determine whether we have been disposed already or not + Private _Disposed As Boolean = False + + ' How many columns a tab character should be treated as + Private _TabSpaces As Integer = 4 + + ' Version of the language to parse + Private _Version As LanguageVersion = LanguageVersion.VisualBasic80 + + ''' + ''' How many columns a tab character should be considered. + ''' + Public Property TabSpaces() As Integer + Get + Return _TabSpaces + End Get + + Set(ByVal value As Integer) + If Value < 1 Then + Throw New ArgumentException("Tabs cannot represent less than one space.") + End If + + _TabSpaces = Value + End Set + End Property + + ''' + ''' The version of Visual Basic this scanner operates on. + ''' + Public ReadOnly Property Version() As LanguageVersion + Get + Return _Version + End Get + End Property + + ''' + ''' Constructs a scanner for a string. + ''' + ''' The string to scan. + Public Sub New(ByVal source As String) + If source Is Nothing Then Throw New ArgumentNullException("Source") + _Source = New StringReader(source) + End Sub + + ''' + ''' Constructs a scanner for a string. + ''' + ''' The string to scan. + ''' The language version to parse. + Public Sub New(ByVal source As String, ByVal version As LanguageVersion) + If source Is Nothing Then Throw New ArgumentNullException("Source") + If version <> LanguageVersion.VisualBasic71 AndAlso version <> LanguageVersion.VisualBasic80 Then + Throw New ArgumentOutOfRangeException("Version") + End If + _Source = New StringReader(source) + _Version = version + End Sub + + ''' + ''' Constructs a scanner for a stream. + ''' + ''' The stream to scan. + Public Sub New(ByVal source As Stream) + If source Is Nothing Then Throw New ArgumentNullException("Source") + _Source = New StreamReader(source) + End Sub + + ''' + ''' Constructs a scanner for a stream. + ''' + ''' The stream to scan. + ''' The language version to parse. + Public Sub New(ByVal source As Stream, ByVal version As LanguageVersion) + If source Is Nothing Then Throw New ArgumentNullException("Source") + If version <> LanguageVersion.VisualBasic71 AndAlso version <> LanguageVersion.VisualBasic80 Then + Throw New ArgumentOutOfRangeException("Version") + End If + _Source = New StreamReader(source) + _Version = version + End Sub + + ''' + ''' Constructs a canner for a general TextReader. + ''' + ''' The TextReader to scan. + Public Sub New(ByVal source As TextReader) + If source Is Nothing Then Throw New ArgumentNullException("Source") + _Source = source + End Sub + + ''' + ''' Constructs a canner for a general TextReader. + ''' + ''' The TextReader to scan. + ''' The language version to parse. + Public Sub New(ByVal source As TextReader, ByVal version As LanguageVersion) + If source Is Nothing Then Throw New ArgumentNullException("Source") + If version <> LanguageVersion.VisualBasic71 AndAlso version <> LanguageVersion.VisualBasic80 Then + Throw New ArgumentOutOfRangeException("Version") + End If + _Source = source + _Version = version + End Sub + + ''' + ''' Closes/disposes the scanner. + ''' + Public Sub Close() Implements IDisposable.Dispose + If Not _Disposed Then + _Disposed = True + _Source.Close() + End If + End Sub + + ' Read a character + Private Function ReadChar() As Char + Dim c As Char + + If _PeekCacheHasValue Then + c = _PeekCache + _PeekCacheHasValue = False + + If _PeekAheadCacheHasValue Then + _PeekCache = _PeekAheadCache + _PeekCacheHasValue = True + _PeekAheadCacheHasValue = False + End If + Else + Debug.Assert(Not _PeekAheadCacheHasValue, "Cache incorrect!") + c = ChrW(_Source.Read()) + End If + + _Index += 1 + If AscW(c) = &H9 Then + _Column += _TabSpaces + Else + _Column += 1 + End If + + Return c + End Function + + ' Peek ahead at the next character + Private Function PeekChar() As Char + If Not _PeekCacheHasValue Then + _PeekCache = ChrW(_Source.Read()) + _PeekCacheHasValue = True + End If + + Return _PeekCache + End Function + + ' Peek at the character past the next character + Private Function PeekAheadChar() As Char + If Not _PeekAheadCacheHasValue Then + If Not _PeekCacheHasValue Then + PeekChar() + End If + + _PeekAheadCache = ChrW(_Source.Read()) + _PeekAheadCacheHasValue = True + End If + + Return _PeekAheadCache + End Function + + ' The current line/column position + Private ReadOnly Property CurrentLocation() As Location + Get + Return New Location(_Index, _Line, _Column) + End Get + End Property + + ' Creates a span from the start location to the current location. + Private Function SpanFrom(ByVal start As Location) As Span + Return New Span(start, CurrentLocation) + End Function + + Private Shared Function IsAlphaClass(ByVal c As UnicodeCategory) As Boolean + Return c = UnicodeCategory.UppercaseLetter OrElse _ + c = UnicodeCategory.LowercaseLetter OrElse _ + c = UnicodeCategory.TitlecaseLetter OrElse _ + c = UnicodeCategory.OtherLetter OrElse _ + c = UnicodeCategory.ModifierLetter OrElse _ + c = UnicodeCategory.LetterNumber + End Function + + Private Shared Function IsNumericClass(ByVal c As UnicodeCategory) As Boolean + Return c = UnicodeCategory.DecimalDigitNumber + End Function + + Private Shared Function IsUnderscoreClass(ByVal c As UnicodeCategory) As Boolean + Return c = UnicodeCategory.ConnectorPunctuation + End Function + + Private Shared Function IsSingleQuote(ByVal c As Char) As Boolean + Return c = "'"c OrElse c = ChrW(&HFF07) OrElse c = ChrW(&H2018) OrElse c = ChrW(&H2019) + End Function + + Private Shared Function IsDoubleQuote(ByVal c As Char) As Boolean + Return c = """"c OrElse c = ChrW(&HFF02) OrElse c = ChrW(&H201C) OrElse c = ChrW(&H201D) + End Function + + Private Shared Function IsDigit(ByVal c As Char) As Boolean + Return (c >= "0"c AndAlso c <= "9"c) OrElse (c >= ChrW(&HFF10) AndAlso c <= ChrW(&HFF19)) + End Function + + Private Shared Function IsOctalDigit(ByVal c As Char) As Boolean + Return (c >= "0"c AndAlso c <= "7"c) OrElse (c >= ChrW(&HFF10) AndAlso c <= ChrW(&HFF17)) + End Function + + Private Shared Function IsHexDigit(ByVal c As Char) As Boolean + Return IsDigit(c) OrElse _ + (c >= "a"c AndAlso c <= "f"c) OrElse (c >= "A"c AndAlso c <= "F"c) OrElse _ + (c >= ChrW(&HFF41) AndAlso c <= ChrW(&HFF46)) OrElse (c >= ChrW(&HFF21) AndAlso c <= ChrW(&HFF26)) + End Function + + Private Shared Function IsEquals(ByVal c As Char) As Boolean + Return c = "="c OrElse c = ChrW(&HFF1D) + End Function + + Private Shared Function IsLessThan(ByVal c As Char) As Boolean + Return c = "<"c OrElse c = ChrW(&HFF1C) + End Function + + Private Shared Function IsGreaterThan(ByVal c As Char) As Boolean + Return c = ">"c OrElse c = ChrW(&HFF1E) + End Function + + Private Shared Function IsAmpersand(ByVal c As Char) As Boolean + Return c = "&"c OrElse c = ChrW(&HFF06) + End Function + + Private Shared Function IsUnderscore(ByVal c As Char) As Boolean + Return IsUnderscoreClass(Char.GetUnicodeCategory(c)) + End Function + + Private Shared Function IsHexDesignator(ByVal c As Char) As Boolean + Return c = "H"c OrElse c = "h"c OrElse c = ChrW(&HFF48) OrElse c = ChrW(&HFF28) + End Function + + Private Shared Function IsOctalDesignator(ByVal c As Char) As Boolean + Return c = "O"c OrElse c = "o"c OrElse c = ChrW(&HFF2F) OrElse c = ChrW(&HFF4F) + End Function + + Private Shared Function IsPeriod(ByVal c As Char) As Boolean + Return c = "."c OrElse c = ChrW(&HFF0E) + End Function + + Private Shared Function IsExponentDesignator(ByVal c As Char) As Boolean + Return c = "e"c OrElse c = "E"c OrElse c = ChrW(&HFF45) OrElse c = ChrW(&HFF25) + End Function + + Private Shared Function IsPlus(ByVal c As Char) As Boolean + Return c = "+"c OrElse c = ChrW(&HFF0B) + End Function + + Private Shared Function IsMinus(ByVal c As Char) As Boolean + Return c = "-"c OrElse c = ChrW(&HFF0D) + End Function + + Private Shared Function IsForwardSlash(ByVal c As Char) As Boolean + Return c = "/"c OrElse c = ChrW(&HFF0F) + End Function + + Private Shared Function IsColon(ByVal c As Char) As Boolean + Return c = ":"c OrElse c = ChrW(&HFF1A) + End Function + + Private Shared Function IsPound(ByVal c As Char) As Boolean + Return c = "#"c OrElse c = ChrW(&HFF03) + End Function + + Private Shared Function IsA(ByVal c As Char) As Boolean + Return c = "a"c OrElse c = ChrW(&HFF41) OrElse c = "A"c OrElse c = ChrW(&HFF21) + End Function + + Private Shared Function IsP(ByVal c As Char) As Boolean + Return c = "p"c OrElse c = ChrW(&HFF50) OrElse c = "P"c OrElse c = ChrW(&HFF30) + End Function + + Private Shared Function IsM(ByVal c As Char) As Boolean + Return c = "m"c OrElse c = ChrW(&HFF4D) OrElse c = "M"c OrElse c = ChrW(&HFF2D) + End Function + + Private Shared Function IsCharDesignator(ByVal c As Char) As Boolean + Return c = "c"c OrElse c = "C"c OrElse c = ChrW(&HFF43) OrElse c = ChrW(&HFF23) + End Function + + Private Shared Function IsLeftBracket(ByVal c As Char) As Boolean + Return c = "["c OrElse c = ChrW(&HFF3B) + End Function + + Private Shared Function IsRightBracket(ByVal c As Char) As Boolean + Return c = "]"c OrElse c = ChrW(&HFF3D) + End Function + + Private Shared Function IsUnsignedTypeChar(ByVal c As Char) As Boolean + Return c = "u"c OrElse c = "U"c OrElse c = ChrW(&HFF35) OrElse c = ChrW(&HFF55) + End Function + + Private Shared Function IsIdentifier(ByVal c As Char) As Boolean + Dim CharClass As UnicodeCategory = Char.GetUnicodeCategory(c) + + Return _ + IsAlphaClass(CharClass) OrElse _ + IsNumericClass(CharClass) OrElse _ + CharClass = UnicodeCategory.SpacingCombiningMark OrElse _ + CharClass = UnicodeCategory.NonSpacingMark OrElse _ + CharClass = UnicodeCategory.Format OrElse _ + IsUnderscoreClass(CharClass) + End Function + + Friend Shared Function MakeHalfWidth(ByVal c As Char) As Char + If c < ChrW(&HFF01) OrElse c > ChrW(&HFF5E) Then + Return c + Else + Return ChrW(AscW(c) - &HFF00 + &H20) + End If + End Function + + Friend Shared Function MakeFullWidth(ByVal c As Char) As Char + If c < ChrW(&H21) OrElse c > ChrW(&H7E) Then + Return c + Else + Return ChrW(AscW(c) + &HFF00 - &H20) + End If + End Function + + Friend Shared Function MakeFullWidth(ByVal s As String) As String + Dim Builder As StringBuilder = New StringBuilder(s) + + For Index As Integer = 0 To Builder.Length - 1 + Builder(Index) = MakeFullWidth(Builder(Index)) + Next + + Return Builder.ToString() + End Function + + ' + ' Scan functions + ' + ' Each function assumes that the reader is positioned at the beginning of + ' the token. At the end, the function will have read through the entire + ' token. If an error occurs, the function may attempt to do error recovery. + ' + + Private Function ScanPossibleTypeCharacter(ByVal ValidTypeCharacters As TypeCharacter) As TypeCharacter + Dim TypeChar As Char = PeekChar() + Dim TypeString As String + Static TypeCharacterTable As Dictionary(Of String, TypeCharacter) + + If TypeCharacterTable Is Nothing Then + Dim Table As Dictionary(Of String, TypeCharacter) = New Dictionary(Of String, TypeCharacter)(StringComparer.InvariantCultureIgnoreCase) + ' 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 TypeCharacter As TypeCharacter = TypeCharacter.StringSymbol + + For Index As Integer = 0 To TypeCharacters.Length - 1 + With Table + .Add(TypeCharacters(Index), TypeCharacter) + .Add(Scanner.MakeFullWidth(TypeCharacters(Index)), TypeCharacter) + End With + + TypeCharacter = CType(TypeCharacter << 1, TypeCharacter) + Next + + TypeCharacterTable = Table + End If + + If IsUnsignedTypeChar(TypeChar) AndAlso _Version > LanguageVersion.VisualBasic71 Then + ' At the point at which we've seen a "U", we don't know if it's going to + ' be a valid type character or just something invalid. + TypeString = TypeChar & PeekAheadChar() + Else + TypeString = TypeChar + End If + + If TypeCharacterTable.ContainsKey(TypeString) Then + Dim TypeCharacter As TypeCharacter = TypeCharacterTable(TypeString) + + If (TypeCharacter And ValidTypeCharacters) <> 0 Then + ' A bang (!) is a type character unless it is followed by a legal identifier start. + If TypeCharacter = TypeCharacter.SingleSymbol AndAlso CanStartIdentifier(PeekAheadChar()) Then + Return TypeCharacter.None + End If + + ReadChar() + + If IsUnsignedTypeChar(TypeChar) Then + ReadChar() + End If + + Return TypeCharacter + End If + End If + + Return TypeCharacter.None + End Function + + Private Function ScanPossibleMultiCharacterPunctuator(ByVal leadingCharacter As Char, ByVal start As Location) As PunctuatorToken + Dim NextChar As Char = PeekChar() + Dim Punctuator As TokenType + Dim PunctuatorString As String = leadingCharacter + + Debug.Assert(PunctuatorToken.TokenTypeFromString(leadingCharacter) <> TokenType.None) + + If IsEquals(NextChar) OrElse IsLessThan(NextChar) OrElse IsGreaterThan(NextChar) Then + PunctuatorString &= NextChar + Punctuator = PunctuatorToken.TokenTypeFromString(PunctuatorString) + + If Punctuator <> TokenType.None Then + ReadChar() + + If (Punctuator = TokenType.LessThanLessThan OrElse _ + Punctuator = TokenType.GreaterThanGreaterThan) AndAlso _ + IsEquals(PeekChar()) Then + PunctuatorString &= ReadChar() + Punctuator = PunctuatorToken.TokenTypeFromString(PunctuatorString) + End If + + Return New PunctuatorToken(Punctuator, SpanFrom(start)) + End If + End If + + Punctuator = PunctuatorToken.TokenTypeFromString(leadingCharacter) + Return New PunctuatorToken(Punctuator, SpanFrom(start)) + End Function + + Private Function ScanNumericLiteral() As Token + Dim Start As Location = CurrentLocation + Dim Literal As StringBuilder = New StringBuilder() + Dim Base As IntegerBase = IntegerBase.Decimal + Dim TypeCharacter As TypeCharacter = TypeCharacter.None + + Debug.Assert(CanStartNumericLiteral()) + + If IsAmpersand(PeekChar()) Then + Literal.Append(MakeHalfWidth(ReadChar())) + + If IsHexDesignator(PeekChar()) Then + Literal.Append(MakeHalfWidth(ReadChar())) + Base = IntegerBase.Hexadecimal + + While IsHexDigit(PeekChar()) + Literal.Append(MakeHalfWidth(ReadChar())) + End While + ElseIf IsOctalDesignator(PeekChar()) Then + Literal.Append(MakeHalfWidth(ReadChar())) + Base = IntegerBase.Octal + + While IsOctalDigit(PeekChar()) + Literal.Append(MakeHalfWidth(ReadChar())) + End While + ElseIf IsOctalDigit(PeekChar()) Then 'VbScript Octal is like &123456& + Base = IntegerBase.Octal + Literal.Append("O"c) 'VB.net Octal starts with &O + + While IsOctalDigit(PeekChar()) + Literal.Append(MakeHalfWidth(ReadChar())) + End While + + If IsAmpersand(PeekChar()) Then + ReadChar() 'Ignored the last '&' + End If + Else + Return ScanPossibleMultiCharacterPunctuator("&"c, Start) + End If + + If Literal.Length > 2 Then + Const ValidTypeChars As TypeCharacter = _ + TypeCharacter.ShortChar Or TypeCharacter.UnsignedShortChar Or _ + TypeCharacter.IntegerSymbol Or TypeCharacter.IntegerChar Or TypeCharacter.UnsignedIntegerChar Or _ + TypeCharacter.LongSymbol Or TypeCharacter.LongChar Or TypeCharacter.UnsignedLongChar + + TypeCharacter = ScanPossibleTypeCharacter(ValidTypeChars) + + Try + Select Case TypeCharacter + Case TypeCharacter.ShortChar + Dim Value As Long = CLng(Literal.ToString()) + + If Value <= &HFFFFL Then + If Value > &H7FFFL Then + Value = -(&H10000L - Value) + End If + + If Value >= Short.MinValue AndAlso Value <= Short.MaxValue Then + Return New IntegerLiteralToken(CShort(Value), Base, TypeCharacter, SpanFrom(Start)) + End If + End If + ' Fall through + + Case TypeCharacter.UnsignedShortChar + Dim Value As ULong = CULng(Literal.ToString()) + + If Value <= &HFFFFL Then + If Value >= UShort.MinValue AndAlso Value <= UShort.MaxValue Then + Return New UnsignedIntegerLiteralToken(CUShort(Value), Base, TypeCharacter, SpanFrom(Start)) + End If + End If + ' Fall through + + Case TypeCharacter.IntegerSymbol, TypeCharacter.IntegerChar + Dim Value As Long = CLng(Literal.ToString()) + + If Value <= &HFFFFFFFFL Then + If Value > &H7FFFFFFFL Then + Value = -(&H100000000L - Value) + End If + + If Value >= Integer.MinValue AndAlso Value <= Integer.MaxValue Then + Return New IntegerLiteralToken(CInt(Value), Base, TypeCharacter, SpanFrom(Start)) + End If + End If + ' Fall through + + Case TypeCharacter.UnsignedIntegerChar + Dim Value As ULong = CULng(Literal.ToString()) + + If Value <= &HFFFFFFFFL Then + If Value >= UInteger.MinValue AndAlso Value <= UInteger.MaxValue Then + Return New UnsignedIntegerLiteralToken(CUInt(Value), Base, TypeCharacter, SpanFrom(Start)) + End If + End If + ' Fall through + + Case TypeCharacter.LongSymbol, TypeCharacter.LongChar + Return New IntegerLiteralToken(ParseInt(Literal.ToString()), Base, TypeCharacter, SpanFrom(Start)) + + Case TypeCharacter.UnsignedLongChar + Return New UnsignedIntegerLiteralToken(CULng(Literal.ToString()), Base, TypeCharacter, SpanFrom(Start)) + + Case Else + TypeCharacter = TypeCharacter.None + Return New IntegerLiteralToken(ParseInt(Literal.ToString()), Base, TypeCharacter, SpanFrom(Start)) + End Select + Catch ex As OverflowException + Return New ErrorToken(SyntaxErrorType.InvalidIntegerLiteral, SpanFrom(Start)) + Catch ex As InvalidCastException + Return New ErrorToken(SyntaxErrorType.InvalidIntegerLiteral, SpanFrom(Start)) + End Try + End If + + Return New ErrorToken(SyntaxErrorType.InvalidIntegerLiteral, SpanFrom(Start)) + End If + + While IsDigit(PeekChar()) + Literal.Append(MakeHalfWidth(ReadChar())) + End While + + If IsPeriod(PeekChar()) OrElse IsExponentDesignator(PeekChar()) Then + Dim ErrorType As SyntaxErrorType = SyntaxErrorType.None + Const ValidTypeChars As TypeCharacter = _ + TypeCharacter.DecimalChar Or TypeCharacter.DecimalSymbol Or _ + TypeCharacter.SingleChar Or TypeCharacter.SingleSymbol Or _ + TypeCharacter.DoubleChar Or TypeCharacter.DoubleSymbol + + If IsPeriod(PeekChar()) Then + Literal.Append(MakeHalfWidth(ReadChar())) + + If Not IsDigit(PeekChar()) And Literal.Length = 1 Then + Return New PunctuatorToken(TokenType.Period, SpanFrom(Start)) + End If + + While IsDigit(PeekChar()) + Literal.Append(MakeHalfWidth(ReadChar())) + End While + End If + + If IsExponentDesignator(PeekChar()) Then + Literal.Append(MakeHalfWidth(ReadChar())) + + If IsPlus(PeekChar()) OrElse IsMinus(PeekChar()) Then + Literal.Append(MakeHalfWidth(ReadChar())) + End If + + If Not IsDigit(PeekChar()) Then + Return New ErrorToken(SyntaxErrorType.InvalidFloatingPointLiteral, SpanFrom(Start)) + End If + + While IsDigit(PeekChar()) + Literal.Append(MakeHalfWidth(ReadChar())) + End While + End If + + TypeCharacter = ScanPossibleTypeCharacter(ValidTypeChars) + + Try + Select Case TypeCharacter + Case TypeCharacter.DecimalChar, TypeCharacter.DecimalSymbol + ErrorType = SyntaxErrorType.InvalidDecimalLiteral + Return New DecimalLiteralToken(CDec(Literal.ToString()), TypeCharacter, SpanFrom(Start)) + + Case TypeCharacter.SingleSymbol, TypeCharacter.SingleChar + ErrorType = SyntaxErrorType.InvalidFloatingPointLiteral + Return New FloatingPointLiteralToken(CSng(Literal.ToString()), TypeCharacter, SpanFrom(Start)) + + Case TypeCharacter.DoubleSymbol, TypeCharacter.DoubleChar + ErrorType = SyntaxErrorType.InvalidFloatingPointLiteral + Return New FloatingPointLiteralToken(CDbl(Literal.ToString()), TypeCharacter, SpanFrom(Start)) + + Case Else + ErrorType = SyntaxErrorType.InvalidFloatingPointLiteral + TypeCharacter = TypeCharacter.None + Return New FloatingPointLiteralToken(CDbl(Literal.ToString()), TypeCharacter, SpanFrom(Start)) + End Select + Catch ex As OverflowException + Return New ErrorToken(ErrorType, SpanFrom(Start)) + Catch ex As InvalidCastException + Return New ErrorToken(ErrorType, SpanFrom(Start)) + End Try + Else + Dim ErrorType As SyntaxErrorType = SyntaxErrorType.None + Const ValidTypeChars As TypeCharacter = _ + TypeCharacter.ShortChar Or _ + TypeCharacter.IntegerSymbol Or TypeCharacter.IntegerChar Or _ + TypeCharacter.LongSymbol Or TypeCharacter.LongChar Or _ + TypeCharacter.DecimalSymbol Or TypeCharacter.DecimalChar Or _ + TypeCharacter.SingleSymbol Or TypeCharacter.SingleChar Or _ + TypeCharacter.DoubleSymbol Or TypeCharacter.DoubleChar Or _ + TypeCharacter.UnsignedShortChar Or TypeCharacter.UnsignedIntegerChar Or _ + TypeCharacter.UnsignedLongChar + + TypeCharacter = ScanPossibleTypeCharacter(ValidTypeChars) + + Try + Select Case TypeCharacter + Case TypeCharacter.ShortChar + ErrorType = SyntaxErrorType.InvalidIntegerLiteral + Return New IntegerLiteralToken(CShort(Literal.ToString()), Base, TypeCharacter, SpanFrom(Start)) + + Case TypeCharacter.UnsignedShortChar + ErrorType = SyntaxErrorType.InvalidIntegerLiteral + Return New UnsignedIntegerLiteralToken(CUShort(Literal.ToString()), Base, TypeCharacter, SpanFrom(Start)) + + Case TypeCharacter.IntegerSymbol, TypeCharacter.IntegerChar + ErrorType = SyntaxErrorType.InvalidIntegerLiteral + Return New IntegerLiteralToken(CInt(Literal.ToString()), Base, TypeCharacter, SpanFrom(Start)) + + Case TypeCharacter.UnsignedIntegerChar + ErrorType = SyntaxErrorType.InvalidIntegerLiteral + Return New UnsignedIntegerLiteralToken(CUInt(Literal.ToString()), Base, TypeCharacter, SpanFrom(Start)) + + Case TypeCharacter.LongSymbol, TypeCharacter.LongChar + ErrorType = SyntaxErrorType.InvalidIntegerLiteral + Return New IntegerLiteralToken(CInt(Literal.ToString()), Base, TypeCharacter, SpanFrom(Start)) + + Case TypeCharacter.UnsignedLongChar + ErrorType = SyntaxErrorType.InvalidIntegerLiteral + Return New UnsignedIntegerLiteralToken(CULng(Literal.ToString()), Base, TypeCharacter, SpanFrom(Start)) + + Case TypeCharacter.DecimalChar, TypeCharacter.DecimalSymbol + ErrorType = SyntaxErrorType.InvalidDecimalLiteral + Return New DecimalLiteralToken(CDec(Literal.ToString()), TypeCharacter, SpanFrom(Start)) + + Case TypeCharacter.SingleSymbol, TypeCharacter.SingleChar + ErrorType = SyntaxErrorType.InvalidFloatingPointLiteral + Return New FloatingPointLiteralToken(CSng(Literal.ToString()), TypeCharacter, SpanFrom(Start)) + + Case TypeCharacter.DoubleSymbol, TypeCharacter.DoubleChar + ErrorType = SyntaxErrorType.InvalidFloatingPointLiteral + Return New FloatingPointLiteralToken(CDbl(Literal.ToString()), TypeCharacter, SpanFrom(Start)) + + Case Else + ErrorType = SyntaxErrorType.InvalidIntegerLiteral + Return New IntegerLiteralToken(CInt(Literal.ToString()), Base, TypeCharacter.None, SpanFrom(Start)) + End Select + Catch ex As OverflowException + Return New ErrorToken(ErrorType, SpanFrom(Start)) + Catch ex As InvalidCastException + Return New ErrorToken(ErrorType, SpanFrom(Start)) + End Try + End If + End Function + + Private Function CanStartNumericLiteral() As Boolean + Return IsPeriod(PeekChar()) OrElse IsAmpersand(PeekChar()) OrElse IsDigit(PeekChar()) + End Function + + Private Function ReadIntegerLiteral() As Long + Dim Value As Long = 0 + + While IsDigit(PeekChar()) + Dim c As Char = MakeHalfWidth(ReadChar()) + Value *= 10 + Value += AscW(c) - AscW("0"c) + End While + + Return Value + End Function + + Private Function ScanDateLiteral() As Token + Dim Start As Location = CurrentLocation + Dim PossibleEnd As Location + Dim Month As Integer = 0 + Dim Day As Integer = 0 + Dim Year As Integer = 0 + Dim Hour As Integer = 0 + Dim Minute As Integer = 0 + Dim Second As Integer = 0 + Dim HaveDateValue As Boolean = False + Dim HaveTimeValue As Boolean = False + Dim Value As Long + + Debug.Assert(CanStartDateLiteral()) + + ReadChar() + PossibleEnd = CurrentLocation + EatWhitespace() + + ' Distinguish between date literals and the # punctuator + If Not IsDigit(PeekChar()) Then + Return New PunctuatorToken(TokenType.Pound, New Span(Start, PossibleEnd)) + End If + + Value = ReadIntegerLiteral() + + 'LC in VBScript, it is legal to have something like #08 / 27 / 97 5:11:42pm# + EatWhitespace() + + If IsForwardSlash(PeekChar()) OrElse IsMinus(PeekChar()) Then + Dim Separator As Char = ReadChar() + Dim YearStart As Location + + HaveDateValue = True + If Value < 1 OrElse Value > 12 Then GoTo Invalid + Month = CInt(Value) + + 'LC + EatWhitespace() + + If Not IsDigit(PeekChar()) Then GoTo Invalid + Value = ReadIntegerLiteral() + If Value < 1 OrElse Value > 31 Then GoTo Invalid + Day = CInt(Value) + + 'LC + EatWhitespace() + + If PeekChar() <> Separator Then GoTo Invalid + ReadChar() + + 'LC + EatWhitespace() + + If Not IsDigit(PeekChar()) Then GoTo Invalid + YearStart = CurrentLocation + Value = ReadIntegerLiteral() + If Value < 1 OrElse Value > 9999 Then GoTo Invalid + ' Years less than 1000 have to be four digits long to avoid y2k confusion + 'If Value < 1000 And CurrentLocation.Column - YearStart.Column <> 4 Then GoTo Invalid + + Year = CInt(Value) + + 'LC 2 digit year conversion + If CurrentLocation.Column - YearStart.Column = 2 Then + If Year > 30 Then + Year += 2000 + Else + Year += 1900 + End If + ElseIf CurrentLocation.Column - YearStart.Column <> 4 Then + GoTo Invalid + End If + + If Day > Date.DaysInMonth(Year, Month) Then GoTo Invalid + + EatWhitespace() + If IsDigit(PeekChar()) Then + Value = ReadIntegerLiteral() + + If Not IsColon(PeekChar()) Then GoTo Invalid + End If + End If + + If IsColon(PeekChar()) Then + ReadChar() + HaveTimeValue = True + If Value < 0 OrElse Value > 23 Then GoTo Invalid + Hour = CInt(Value) + + If Not IsDigit(PeekChar()) Then GoTo Invalid + Value = ReadIntegerLiteral() + If Value < 0 OrElse Value > 59 Then GoTo Invalid + Minute = CInt(Value) + + If IsColon(PeekChar()) Then + ReadChar() + If Not IsDigit(PeekChar()) Then GoTo Invalid + Value = ReadIntegerLiteral() + If Value < 0 OrElse Value > 59 Then GoTo Invalid + Second = CInt(Value) + End If + + EatWhitespace() + + If IsA(PeekChar()) Then + ReadChar() + + If IsM(PeekChar()) Then + ReadChar() + If Hour < 1 OrElse Hour > 12 Then + GoTo Invalid + End If + Else + GoTo Invalid + End If + ElseIf IsP(PeekChar()) Then + ReadChar() + + If IsM(PeekChar()) Then + ReadChar() + If Hour < 1 OrElse Hour > 12 Then + GoTo Invalid + End If + + Hour += 12 + + If Hour = 24 Then + Hour = 12 + End If + Else + GoTo Invalid + End If + End If + End If + + If Not IsPound(PeekChar()) Then + GoTo Invalid + Else + ReadChar() + End If + + If Not HaveTimeValue AndAlso Not HaveDateValue Then +Invalid: + While Not IsPound(PeekChar()) AndAlso Not CanStartLineTerminator() + ReadChar() + End While + + If IsPound(PeekChar()) Then + ReadChar() + End If + + Return New ErrorToken(SyntaxErrorType.InvalidDateLiteral, SpanFrom(Start)) + End If + + If HaveDateValue Then + If HaveTimeValue Then + Return New DateLiteralToken(New Date(Year, Month, Day, Hour, Minute, Second), SpanFrom(Start)) + Else + Return New DateLiteralToken(New Date(Year, Month, Day), SpanFrom(Start)) + End If + Else + Return New DateLiteralToken(New Date(1, 1, 1, Hour, Minute, Second), SpanFrom(Start)) + End If + End Function + + Private Function CanStartDateLiteral() As Boolean + Return IsPound(PeekChar()) + End Function + + ' Actually, this scans string and char literals + Private Function ScanStringLiteral() As Token + Dim Start As Location = CurrentLocation + Dim s As StringBuilder = New StringBuilder() + + Debug.Assert(CanStartStringLiteral()) + + ReadChar() + +ContinueScan: + While Not IsDoubleQuote(PeekChar()) AndAlso Not CanStartLineTerminator() + s.Append(ReadChar()) + End While + + If IsDoubleQuote(PeekChar()) Then + ReadChar() + + If IsDoubleQuote(PeekChar()) Then + ReadChar() + ' NOTE: We take what could be a full-width double quote and make it a half-width. + s.Append(""""c) + GoTo ContinueScan + End If + Else + Return New ErrorToken(SyntaxErrorType.InvalidStringLiteral, SpanFrom(Start)) + End If + + If IsCharDesignator(PeekChar()) Then + ReadChar() + + If s.Length <> 1 Then + Return New ErrorToken(SyntaxErrorType.InvalidCharacterLiteral, SpanFrom(Start)) + Else + Return New CharacterLiteralToken(s(0), SpanFrom(Start)) + End If + Else + Return New StringLiteralToken(s.ToString(), SpanFrom(Start)) + End If + End Function + + Private Function CanStartStringLiteral() As Boolean + Return IsDoubleQuote(PeekChar()) + End Function + + Private Function ScanIdentifier() As Token + Dim Start As Location = CurrentLocation + Dim Escaped As Boolean = False + Dim TypeCharacter As TypeCharacter = TypeCharacter.None + Dim Identifier As String + Dim s As StringBuilder = New StringBuilder() + Dim Type As TokenType = TokenType.Identifier + Dim UnreservedType As TokenType = TokenType.Identifier + + Debug.Assert(CanStartIdentifier()) + + If IsLeftBracket(PeekChar()) Then + Escaped = True + ReadChar() + + If Not CanStartNonEscapedIdentifier() Then + While Not IsRightBracket(PeekChar()) AndAlso Not CanStartLineTerminator() + ReadChar() + End While + + If IsRightBracket(PeekChar()) Then + ReadChar() + End If + + Return New ErrorToken(SyntaxErrorType.InvalidEscapedIdentifier, SpanFrom(Start)) + End If + End If + + s.Append(ReadChar()) + + If IsUnderscore(s(0)) AndAlso Not IsIdentifier(PeekChar()) Then + Dim [End] As Location = CurrentLocation + + EatWhitespace() + + ' This is a line continuation + If CanStartLineTerminator() Then + ScanLineTerminator(False) + Return Nothing + Else + Return New ErrorToken(SyntaxErrorType.InvalidIdentifier, New Span(Start, [End])) + End If + End If + + While IsIdentifier(PeekChar()) + ' NOTE: We do not convert full-width to half-width here! + s.Append(ReadChar()) + End While + + Identifier = s.ToString() + + If Escaped Then + If IsRightBracket(PeekChar()) Then + ReadChar() + Else + While Not IsRightBracket(PeekChar()) AndAlso Not CanStartLineTerminator() + ReadChar() + End While + + If IsRightBracket(PeekChar()) Then + ReadChar() + End If + + Return New ErrorToken(SyntaxErrorType.InvalidEscapedIdentifier, SpanFrom(Start)) + End If + Else + Const ValidTypeChars As TypeCharacter = _ + TypeCharacter.DecimalSymbol Or TypeCharacter.DoubleSymbol Or _ + TypeCharacter.IntegerSymbol Or TypeCharacter.LongSymbol Or _ + TypeCharacter.SingleSymbol Or TypeCharacter.StringSymbol + Type = IdentifierToken.TokenTypeFromString(Identifier, _Version, False) + + If Type = TokenType.[REM] Then + Return ScanComment(Start) + End If + + UnreservedType = IdentifierToken.TokenTypeFromString(Identifier, _Version, True) + 'LC In VBScript, we do not allow type character after the identifier + 'TypeCharacter = ScanPossibleTypeCharacter(ValidTypeChars) + + If Type <> TokenType.Identifier AndAlso TypeCharacter <> TypeCharacter.None Then + ' In VB 8.0, keywords with a type character are considered identifiers. + If _Version > LanguageVersion.VisualBasic71 Then + Type = TokenType.Identifier + Else + Return New ErrorToken(SyntaxErrorType.InvalidTypeCharacterOnKeyword, SpanFrom(Start)) + End If + End If + End If + + Return New IdentifierToken(Type, UnreservedType, Identifier, Escaped, TypeCharacter, SpanFrom(Start)) + End Function + + Private Function CanStartNonEscapedIdentifier() As Boolean + Return CanStartNonEscapedIdentifier(PeekChar()) + End Function + + Private Shared Function CanStartNonEscapedIdentifier(ByVal c As Char) As Boolean + Dim CharClass As UnicodeCategory = Char.GetUnicodeCategory(c) + + Return IsAlphaClass(CharClass) OrElse IsUnderscoreClass(CharClass) + End Function + + Private Function CanStartIdentifier() As Boolean + Return CanStartIdentifier(PeekChar()) + End Function + + Private Shared Function CanStartIdentifier(ByVal c As Char) As Boolean + Return IsLeftBracket(c) OrElse CanStartNonEscapedIdentifier(c) + End Function + + ' Scan a comment that begins with a tick mark + Private Function ScanComment() As CommentToken + Dim s As StringBuilder = New StringBuilder() + Dim Start As Location = CurrentLocation + + Debug.Assert(CanStartComment()) + ReadChar() + + While Not CanStartLineTerminator() + ' NOTE: We don't convert full-width to half-width here. + s.Append(ReadChar()) + End While + + Return New CommentToken(s.ToString(), False, SpanFrom(Start)) + End Function + + ' Scan a comment that begins with REM. + Private Function ScanComment(ByVal start As Location) As CommentToken + Dim s As StringBuilder = New StringBuilder() + + While Not CanStartLineTerminator() + ' NOTE: We don't convert full-width to half-width here. + s.Append(ReadChar()) + End While + + Return New CommentToken(s.ToString(), True, SpanFrom(start)) + End Function + + ' We only check for tick mark here. + Private Function CanStartComment() As Boolean + Return IsSingleQuote(PeekChar()) + End Function + + Private Function ScanLineTerminator(Optional ByVal produceToken As Boolean = True) As Token + Dim Start As Location = CurrentLocation + Dim Token As Token = Nothing + + Debug.Assert(CanStartLineTerminator()) + + If PeekChar() = ChrW(&HFFFF) Then + Token = New EndOfStreamToken(SpanFrom(Start)) + Else + If ReadChar() = ChrW(&HD) Then + ' A CR/LF pair is a legal line terminator + If PeekChar() = ChrW(&HA) Then + ReadChar() + End If + End If + + If produceToken Then + Token = New LineTerminatorToken(SpanFrom(Start)) + End If + _Line += 1 + _Column = 1 + End If + + Return Token + End Function + + Private Function CanStartLineTerminator() As Boolean + Dim c As Char = PeekChar() + + Return c = ChrW(&HD) OrElse c = ChrW(&HA) OrElse _ + c = ChrW(&H2028) OrElse c = ChrW(&H2029) OrElse _ + c = ChrW(&HFFFF) + End Function + + Private Function EatWhitespace() As Boolean + Dim c As Char = PeekChar() + + While c = ChrW(9) OrElse Char.GetUnicodeCategory(c) = UnicodeCategory.SpaceSeparator + ReadChar() + EatWhitespace = True + c = PeekChar() + End While + End Function + + Private Function Read(ByVal advance As Boolean) As Token + Dim TokenRead As Token + Dim CurrentToken As Token + + If _Position > -1 Then + CurrentToken = _Tokens(_Position) + Else + CurrentToken = Nothing + End If + + ' If we've reached the end of the stream, just return the end of stream token again + If CurrentToken IsNot Nothing AndAlso CurrentToken.Type = TokenType.EndOfStream Then + Return CurrentToken + End If + + ' If we haven't read a token yet, or if we've reached the end of the tokens that we've read + ' so far, then we need to read a fresh token in. + If _Position = _Tokens.Count - 1 Then +ContinueLine: + EatWhitespace() + + If CanStartLineTerminator() Then + TokenRead = ScanLineTerminator() + ElseIf CanStartComment() Then + TokenRead = ScanComment() + ElseIf CanStartIdentifier() Then + Dim Token As Token = ScanIdentifier() + + If Token Is Nothing Then + ' This was a line continuation, so skip and keep going + GoTo ContinueLine + Else + TokenRead = Token + End If + ElseIf CanStartStringLiteral() Then + TokenRead = ScanStringLiteral() + ElseIf CanStartDateLiteral() Then + TokenRead = ScanDateLiteral() + ElseIf CanStartNumericLiteral() Then + TokenRead = ScanNumericLiteral() + Else + Dim Start As Location = CurrentLocation + Dim Punctuator As TokenType = PunctuatorToken.TokenTypeFromString(PeekChar()) + + If Punctuator <> TokenType.None Then + ' CONSIDER: Only call this if we know it can start a two-character punctuator + TokenRead = ScanPossibleMultiCharacterPunctuator(ReadChar(), Start) + Else + ReadChar() + TokenRead = New ErrorToken(SyntaxErrorType.InvalidCharacter, SpanFrom(Start)) + End If + End If + + _Tokens.Add(TokenRead) + End If + + ' Advance to the next token if we need to + If advance Then + _Position += 1 + Return _Tokens(_Position) + Else + Return _Tokens(_Position + 1) + End If + End Function + + ''' + ''' Seeks backwards in the stream position to a particular token. + ''' + ''' The token to seek back to. + ''' Thrown when the scanner has been closed. + ''' Thrown when token was not produced by this scanner. + Public Sub Seek(ByVal token As Token) + Dim CurrentPosition As Integer + Dim StartPosition As Integer = _Position + Dim TokenFound As Boolean = False + + If _Disposed Then Throw New ObjectDisposedException("Scanner") + + If StartPosition = _Tokens.Count - 1 Then + StartPosition -= 1 + End If + + For CurrentPosition = StartPosition To -1 Step -1 + If _Tokens(CurrentPosition + 1) Is token Then + TokenFound = True + Exit For + End If + Next + + If Not TokenFound Then + Throw New ArgumentException("Token not created by this scanner.") + Else + _Position = CurrentPosition + End If + End Sub + + ''' + ''' Whether the stream is positioned on the first token. + ''' + Public ReadOnly Property IsOnFirstToken() As Boolean + Get + Return _Position = -1 + End Get + End Property + + ''' + ''' Fetches the previous token in the stream. + ''' + ''' The previous token. + ''' Thrown when the scanner has been closed. + ''' Thrown when the scanner is positioned on the first token. + Public Function Previous() As Token + If _Disposed Then Throw New ObjectDisposedException("Scanner") + + If _Position = -1 Then + Throw New InvalidOperationException("Scanner is positioned on the first token.") + Else + Return _Tokens(_Position) + End If + End Function + + ''' + ''' Fetches the current token without advancing the stream position. + ''' + ''' The current token. + ''' Thrown when the scanner has been closed. + Public Function Peek() As Token + If _Disposed Then Throw New ObjectDisposedException("Scanner") + Return Read(False) + End Function + + ''' + ''' Fetches the current token and advances the stream position. + ''' + ''' The current token. + ''' Thrown when the scanner has been closed. + Public Function Read() As Token + If _Disposed Then Throw New ObjectDisposedException("Scanner") + Return Read(True) + End Function + + ''' + ''' Fetches more than one token at a time from the stream. + ''' + ''' The array to put the tokens into. + ''' The location in the array to start putting the tokens into. + ''' The number of tokens to read. + ''' The number of tokens read. + ''' Thrown when the scanner has been closed. + ''' Thrown when the buffer is Nothing. + ''' Thrown when the index or count is invalid, or when there isn't enough room in the buffer. + Public Function ReadBlock(ByVal buffer() As Token, ByVal index As Integer, ByVal count As Integer) As Integer + Dim FinalCount As Integer = 0 + + If buffer Is Nothing Then Throw New ArgumentNullException("buffer") + If (index < 0) OrElse (count < 0) Then Throw New ArgumentException("Index or count cannot be negative.") + If buffer.Length - index < count Then Throw New ArgumentException("Not enough room in buffer.") + If _Disposed Then Throw New ObjectDisposedException("Scanner") + + While count > 0 + Dim CurrentToken As Token = Read() + + If CurrentToken.Type = TokenType.EndOfStream Then + Return FinalCount + End If + + buffer(FinalCount + index) = CurrentToken + count -= 1 + FinalCount += 1 + End While + + Return FinalCount + End Function + + ''' + ''' Reads all of the tokens between the current position and the end of the line (or the end of the stream). + ''' + ''' The tokens read. + ''' Thrown when the scanner has been closed. + Public Function ReadLine() As Token() + Dim TokenArray As List(Of Token) = New List(Of Token)() + + If _Disposed Then Throw New ObjectDisposedException("Scanner") + + While Peek().Type <> TokenType.EndOfStream And Peek().Type <> TokenType.LineTerminator + TokenArray.Add(Read()) + End While + + Return TokenArray.ToArray() + End Function + + ''' + ''' Reads all the tokens between the current position and the end of the stream. + ''' + ''' The tokens read. + ''' Thrown when the scanner has been closed. + Public Function ReadToEnd() As Token() + Dim TokenArray As List(Of Token) = New List(Of Token)() + + If _Disposed Then Throw New ObjectDisposedException("Scanner") + + While Peek().Type <> TokenType.EndOfStream + TokenArray.Add(Read()) + End While + + Return TokenArray.ToArray() + End Function + + Private Function ParseInt(ByVal literal As String) As Integer + Dim base As Integer + If literal.StartsWith("&"c) Then + If literal(1) = "H"c OrElse literal(1) = "h"c Then + base = 16 + Else + base = 8 'Assume oct here + End If + literal = literal.Substring(2) + Else + base = 10 + End If + Return Convert.ToInt32(literal, base) + End Function + +End Class diff --git a/aspclassiccompiler/Parser/Serializers/ErrorXmlSerializer.vb b/aspclassiccompiler/Parser/Serializers/ErrorXmlSerializer.vb new file mode 100644 index 0000000..dab586c --- /dev/null +++ b/aspclassiccompiler/Parser/Serializers/ErrorXmlSerializer.vb @@ -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 diff --git a/aspclassiccompiler/Parser/Serializers/TokenXmlSerializer.vb b/aspclassiccompiler/Parser/Serializers/TokenXmlSerializer.vb new file mode 100644 index 0000000..b4ef3b3 --- /dev/null +++ b/aspclassiccompiler/Parser/Serializers/TokenXmlSerializer.vb @@ -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 diff --git a/aspclassiccompiler/Parser/Serializers/TreeXmlSerializer.vb b/aspclassiccompiler/Parser/Serializers/TreeXmlSerializer.vb new file mode 100644 index 0000000..0978165 --- /dev/null +++ b/aspclassiccompiler/Parser/Serializers/TreeXmlSerializer.vb @@ -0,0 +1,1403 @@ +' +' 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 TreeXmlSerializer + Private ReadOnly Writer As XmlWriter + + Public Sub New(ByVal Writer As XmlWriter) + Me.Writer = Writer + End Sub + + Private Shared Function GetOperatorToken(ByVal type As OperatorType) As TokenType + Select Case type + Case OperatorType.Concatenate + Return TokenType.Ampersand + + Case OperatorType.Multiply + Return TokenType.Star + + Case OperatorType.Divide + Return TokenType.ForwardSlash + + Case OperatorType.IntegralDivide + Return TokenType.BackwardSlash + + Case OperatorType.Power + Return TokenType.Caret + + Case OperatorType.Plus, OperatorType.UnaryPlus + Return TokenType.Plus + + Case OperatorType.Minus, OperatorType.Negate + Return TokenType.Minus + + Case OperatorType.LessThan + Return TokenType.LessThan + + Case OperatorType.LessThanEquals + Return TokenType.LessThanEquals + + Case OperatorType.Equals + Return TokenType.Equals + + Case OperatorType.NotEquals + Return TokenType.NotEquals + + Case OperatorType.GreaterThan + Return TokenType.GreaterThan + + Case OperatorType.GreaterThanEquals + Return TokenType.GreaterThanEquals + + Case OperatorType.ShiftLeft + Return TokenType.LessThanLessThan + + Case OperatorType.ShiftRight + Return TokenType.GreaterThanGreaterThan + + Case OperatorType.Modulus + Return TokenType.Mod + + Case OperatorType.Or + Return TokenType.Or + + Case OperatorType.OrElse + Return TokenType.OrElse + + Case OperatorType.And + Return TokenType.And + + Case OperatorType.AndAlso + Return TokenType.AndAlso + + Case OperatorType.Xor + Return TokenType.Xor + + Case OperatorType.Like + Return TokenType.Like + + Case OperatorType.Is + Return TokenType.Is + + Case OperatorType.IsNot + Return TokenType.IsNot + + Case OperatorType.Not + Return TokenType.Not + + Case OperatorType.To + Return TokenType.To + + Case Else + Return TokenType.LexicalError + End Select + End Function + + Private Shared Function GetCompoundAssignmentOperatorToken(ByVal compoundOperator As OperatorType) As TokenType + Select Case compoundOperator + Case OperatorType.Plus + Return TokenType.PlusEquals + + Case OperatorType.Concatenate + Return TokenType.AmpersandEquals + + Case OperatorType.Multiply + Return TokenType.StarEquals + + Case OperatorType.Minus + Return TokenType.MinusEquals + + Case OperatorType.Divide + Return TokenType.ForwardSlashEquals + + Case OperatorType.IntegralDivide + Return TokenType.BackwardSlashEquals + + Case OperatorType.Power + Return TokenType.CaretEquals + + Case OperatorType.ShiftLeft + Return TokenType.LessThanLessThanEquals + + Case OperatorType.ShiftRight + Return TokenType.GreaterThanGreaterThanEquals + + Case Else + Debug.Assert(False, "Unexpected!") + End Select + End Function + + Private Shared Function GetBlockTypeToken(ByVal blockType As BlockType) As TokenType + Select Case blockType + Case blockType.Class + Return TokenType.Class + + Case blockType.Enum + Return TokenType.Enum + + Case blockType.Function + Return TokenType.Function + + Case blockType.Get + Return TokenType.Get + + Case blockType.Event + Return TokenType.Event + + Case blockType.AddHandler + Return TokenType.AddHandler + + Case blockType.RemoveHandler + Return TokenType.RemoveHandler + + Case blockType.RaiseEvent + Return TokenType.RaiseEvent + + Case blockType.If + Return TokenType.If + + Case blockType.Interface + Return TokenType.Interface + + Case blockType.Module + Return TokenType.Module + + Case blockType.Namespace + Return TokenType.Namespace + + Case blockType.Property + Return TokenType.Property + + Case blockType.Select + Return TokenType.Select + + Case blockType.Set + Return TokenType.Set + + Case blockType.Structure + Return TokenType.Structure + + Case blockType.Sub + Return TokenType.Sub + + Case blockType.SyncLock + Return TokenType.SyncLock + + Case blockType.Using + Return TokenType.Using + + Case blockType.Try + Return TokenType.Try + + Case blockType.While + Return TokenType.While + + Case blockType.With + Return TokenType.With + + Case blockType.None + Return TokenType.LexicalError + + Case blockType.Do + Return TokenType.Do + + Case blockType.For + Return TokenType.For + + Case blockType.Operator + Return TokenType.Operator + + Case Else + Debug.Assert(False, "Unexpected!") + End Select + End Function + + Private Sub SerializeSpan(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 SerializeLocation(ByVal Location As Location) + Writer.WriteAttributeString("line", CStr(Location.Line)) + Writer.WriteAttributeString("col", CStr(Location.Column)) + End Sub + + Protected Sub SerializeToken(ByVal TokenType As TokenType, ByVal Location As Location) + If Location.IsValid Then + Writer.WriteStartElement(TokenType.ToString()) + SerializeLocation(Location) + Writer.WriteEndElement() + End If + End Sub + + Private Sub SerializeTypeCharacter(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 + + Private Sub SerializeColonDelimitedList(Of T As Tree)(ByVal List As ColonDelimitedTreeCollection(Of T)) + With List + Dim ColonEnumerator As IEnumerator(Of Location) + Dim MoreColons As Boolean + + If Not .ColonLocations Is Nothing Then + ColonEnumerator = .ColonLocations.GetEnumerator() + MoreColons = ColonEnumerator.MoveNext() + Else + ColonEnumerator = Nothing + MoreColons = False + End If + + For Each Child As Tree In .Children + While MoreColons AndAlso ColonEnumerator.Current <= Child.Span.Start + SerializeToken(TokenType.Colon, ColonEnumerator.Current) + MoreColons = ColonEnumerator.MoveNext() + End While + + Serialize(Child) + Next + + While MoreColons + SerializeToken(TokenType.Colon, ColonEnumerator.Current) + MoreColons = ColonEnumerator.MoveNext() + End While + End With + End Sub + + Private Sub SerializeCommaDelimitedList(Of T As Tree)(ByVal List As CommaDelimitedTreeCollection(Of T)) + With List + Dim CommaEnumerator As IEnumerator(Of Location) + Dim MoreCommas As Boolean + + If Not .CommaLocations Is Nothing Then + CommaEnumerator = .CommaLocations.GetEnumerator() + MoreCommas = CommaEnumerator.MoveNext() + Else + CommaEnumerator = Nothing + MoreCommas = False + End If + + For Each Child As Tree In .Children + If Not Child Is Nothing Then + While MoreCommas AndAlso CommaEnumerator.Current <= Child.Span.Start + SerializeToken(TokenType.Comma, CommaEnumerator.Current) + MoreCommas = CommaEnumerator.MoveNext() + End While + + Serialize(Child) + End If + Next + + While MoreCommas + SerializeToken(TokenType.Comma, CommaEnumerator.Current) + MoreCommas = CommaEnumerator.MoveNext() + End While + End With + End Sub + + Private Sub SerializeList(ByVal List As Tree) + Select Case List.Type + Case TreeType.ArgumentCollection + SerializeCommaDelimitedList(CType(List, ArgumentCollection)) + With CType(List, ArgumentCollection) + If .RightParenthesisLocation.IsValid Then + SerializeToken(TokenType.RightParenthesis, .RightParenthesisLocation) + End If + End With + + Case TreeType.AttributeCollection + SerializeCommaDelimitedList(CType(List, AttributeCollection)) + With CType(List, AttributeCollection) + If .RightBracketLocation.IsValid Then + SerializeToken(TokenType.GreaterThan, .RightBracketLocation) + End If + End With + + Case TreeType.CaseClauseCollection + SerializeCommaDelimitedList(CType(List, CaseClauseCollection)) + + Case TreeType.ExpressionCollection + SerializeCommaDelimitedList(CType(List, ExpressionCollection)) + + Case TreeType.ImportCollection + SerializeCommaDelimitedList(CType(List, ImportCollection)) + + Case TreeType.InitializerCollection + SerializeCommaDelimitedList(CType(List, InitializerCollection)) + With CType(List, InitializerCollection) + If .RightCurlyBraceLocation.IsValid Then + SerializeToken(TokenType.RightCurlyBrace, .RightCurlyBraceLocation) + End If + End With + + Case TreeType.NameCollection + SerializeCommaDelimitedList(CType(List, NameCollection)) + + Case TreeType.VariableNameCollection + SerializeCommaDelimitedList(CType(List, VariableNameCollection)) + + Case TreeType.ParameterCollection + SerializeCommaDelimitedList(CType(List, ParameterCollection)) + With CType(List, ParameterCollection) + If .RightParenthesisLocation.IsValid Then + SerializeToken(TokenType.RightParenthesis, .RightParenthesisLocation) + End If + End With + + Case TreeType.TypeNameCollection + SerializeCommaDelimitedList(CType(List, TypeNameCollection)) + + Case TreeType.VariableDeclaratorCollection + SerializeCommaDelimitedList(CType(List, VariableDeclaratorCollection)) + + Case TreeType.DeclarationCollection + SerializeColonDelimitedList(CType(List, DeclarationCollection)) + + Case TreeType.StatementCollection + SerializeColonDelimitedList(CType(List, StatementCollection)) + + Case TreeType.TypeParameterCollection + With CType(List, TypeParameterCollection) + If .OfLocation.IsValid Then + SerializeToken(TokenType.Of, .OfLocation) + End If + SerializeCommaDelimitedList(CType(List, TypeParameterCollection)) + If .RightParenthesisLocation.IsValid Then + SerializeToken(TokenType.RightParenthesis, .RightParenthesisLocation) + End If + End With + + Case TreeType.TypeConstraintCollection + SerializeCommaDelimitedList(CType(List, TypeConstraintCollection)) + With CType(List, TypeConstraintCollection) + If .RightBracketLocation.IsValid Then + SerializeToken(TokenType.RightCurlyBrace, .RightBracketLocation) + End If + End With + + Case TreeType.TypeArgumentCollection + With CType(List, TypeArgumentCollection) + If .OfLocation.IsValid Then + SerializeToken(TokenType.Of, .OfLocation) + End If + SerializeCommaDelimitedList(CType(List, TypeArgumentCollection)) + If .RightParenthesisLocation.IsValid Then + SerializeToken(TokenType.RightParenthesis, .RightParenthesisLocation) + End If + End With + + Case Else + For Each Child As Tree In List.Children + Serialize(Child) + Next + End Select + End Sub + + Private Sub SerializeName(ByVal Name As Tree) + Select Case Name.Type + Case TreeType.SimpleName + With CType(Name, SimpleName) + SerializeTypeCharacter(.TypeCharacter) + Writer.WriteAttributeString("escaped", CStr(.Escaped)) + Writer.WriteString(.Name) + End With + + Case TreeType.VariableName + With CType(Name, VariableName) + Serialize(.Name) + Serialize(.ArrayType) + End With + + Case TreeType.QualifiedName + With CType(Name, QualifiedName) + Serialize(.Qualifier) + SerializeToken(TokenType.Period, .DotLocation) + Serialize(.Name) + End With + End Select + End Sub + + Private Sub SerializeType(ByVal Type As Tree) + Select Case Type.Type + Case TreeType.IntrinsicType + Writer.WriteAttributeString("intrinsicType", CType(Type, IntrinsicTypeName).IntrinsicType.ToString()) + + Case TreeType.NamedType + With CType(Type, NamedTypeName) + Serialize(.Name) + End With + + Case TreeType.ArrayType + With CType(Type, ArrayTypeName) + Writer.WriteAttributeString("rank", CStr(.Rank)) + Serialize(.ElementTypeName) + Serialize(.Arguments) + End With + + Case TreeType.ConstructedType + With CType(Type, ConstructedTypeName) + Serialize(.Name) + Serialize(.TypeArguments) + End With + End Select + End Sub + + Private Sub SerializeInitializer(ByVal Initializer As Tree) + Select Case Initializer.Type + Case TreeType.AggregateInitializer + With CType(Initializer, AggregateInitializer) + Serialize(.Elements) + End With + + Case TreeType.ExpressionInitializer + With CType(Initializer, ExpressionInitializer) + Serialize(.Expression) + End With + End Select + End Sub + + Private Sub SerializeExpression(ByVal Expression As Tree) + Writer.WriteAttributeString("isConstant", CStr(CType(Expression, Expression).IsConstant)) + + Select Case Expression.Type + Case TreeType.StringLiteralExpression + With CType(Expression, StringLiteralExpression) + Writer.WriteString(.Literal) + End With + + Case TreeType.CharacterLiteralExpression + With CType(Expression, CharacterLiteralExpression) + Writer.WriteString(.Literal) + End With + + Case TreeType.DateLiteralExpression + With CType(Expression, DateLiteralExpression) + Writer.WriteString(CStr(.Literal)) + End With + + Case TreeType.IntegerLiteralExpression + With CType(Expression, IntegerLiteralExpression) + SerializeTypeCharacter(.TypeCharacter) + Writer.WriteAttributeString("base", .IntegerBase.ToString()) + Writer.WriteString(CStr(.Literal)) + End With + + Case TreeType.FloatingPointLiteralExpression + With CType(Expression, FloatingPointLiteralExpression) + SerializeTypeCharacter(.TypeCharacter) + Writer.WriteString(CStr(.Literal)) + End With + + Case TreeType.DecimalLiteralExpression + With CType(Expression, DecimalLiteralExpression) + SerializeTypeCharacter(.TypeCharacter) + Writer.WriteString(CStr(.Literal)) + End With + + Case TreeType.BooleanLiteralExpression + With CType(Expression, BooleanLiteralExpression) + Writer.WriteString(CStr(.Literal)) + End With + + Case TreeType.GetTypeExpression + With CType(Expression, GetTypeExpression) + SerializeToken(TokenType.LeftParenthesis, .LeftParenthesisLocation) + Serialize(.Target) + SerializeToken(TokenType.RightParenthesis, .RightParenthesisLocation) + End With + + Case TreeType.CTypeExpression, TreeType.DirectCastExpression + With CType(Expression, CastTypeExpression) + SerializeToken(TokenType.LeftParenthesis, .LeftParenthesisLocation) + Serialize(.Operand) + SerializeToken(TokenType.Comma, .CommaLocation) + Serialize(.Target) + SerializeToken(TokenType.RightParenthesis, .RightParenthesisLocation) + End With + + Case TreeType.TypeOfExpression + With CType(Expression, TypeOfExpression) + Serialize(.Operand) + SerializeToken(TokenType.Is, .IsLocation) + Serialize(.Target) + End With + + Case TreeType.IntrinsicCastExpression + With CType(Expression, IntrinsicCastExpression) + Writer.WriteAttributeString("intrinsicType", .IntrinsicType.ToString()) + SerializeToken(TokenType.LeftParenthesis, .LeftParenthesisLocation) + Serialize(.Operand) + SerializeToken(TokenType.RightParenthesis, .RightParenthesisLocation) + End With + + Case TreeType.QualifiedExpression + With CType(Expression, QualifiedExpression) + Serialize(.Qualifier) + SerializeToken(TokenType.Period, .DotLocation) + Serialize(.Name) + End With + + Case TreeType.DictionaryLookupExpression + With CType(Expression, DictionaryLookupExpression) + Serialize(.Qualifier) + SerializeToken(TokenType.Exclamation, .BangLocation) + Serialize(.Name) + End With + + Case TreeType.InstanceExpression + With CType(Expression, InstanceExpression) + Writer.WriteAttributeString("type", .InstanceType.ToString()) + End With + + Case TreeType.ParentheticalExpression + With CType(Expression, ParentheticalExpression) + Serialize(.Operand) + SerializeToken(TokenType.RightParenthesis, .RightParenthesisLocation) + End With + + Case TreeType.BinaryOperatorExpression + With CType(Expression, BinaryOperatorExpression) + Writer.WriteAttributeString("operator", .[Operator].ToString()) + Serialize(.LeftOperand) + SerializeToken(GetOperatorToken(.[Operator]), .OperatorLocation) + Serialize(.RightOperand) + End With + + + Case TreeType.UnaryOperatorExpression + With CType(Expression, UnaryOperatorExpression) + SerializeToken(GetOperatorToken(.[Operator]), .Span.Start) + Serialize(.Operand) + End With + + Case Else + For Each Child As Tree In Expression.Children + Serialize(Child) + Next + End Select + End Sub + + Private Sub SerializeStatementComments(ByVal Statement As Tree) + With CType(Statement, Statement) + If Not .Comments Is Nothing Then + For Each Comment As Comment In .Comments + Serialize(Comment) + Next + End If + End With + End Sub + + Private Sub SerializeStatement(ByVal Statement As Tree) + Select Case Statement.Type + Case TreeType.GotoStatement, TreeType.LabelStatement + With CType(Statement, LabelReferenceStatement) + Writer.WriteAttributeString("isLineNumber", CStr(.IsLineNumber)) + SerializeStatementComments(Statement) + Serialize(.Name) + End With + + Case TreeType.ContinueStatement + With CType(Statement, ContinueStatement) + Writer.WriteAttributeString("continueType", .ContinueType.ToString()) + SerializeStatementComments(Statement) + SerializeToken(GetBlockTypeToken(.ContinueType), .ContinueArgumentLocation) + End With + + Case TreeType.ExitStatement + With CType(Statement, ExitStatement) + Writer.WriteAttributeString("exitType", .ExitType.ToString()) + SerializeStatementComments(Statement) + SerializeToken(GetBlockTypeToken(.ExitType), .ExitArgumentLocation) + End With + + Case TreeType.ReturnStatement, TreeType.ErrorStatement, TreeType.ThrowStatement + With CType(Statement, ExpressionStatement) + SerializeStatementComments(Statement) + Serialize(.Expression) + End With + + Case TreeType.RaiseEventStatement + With CType(Statement, RaiseEventStatement) + SerializeStatementComments(Statement) + Serialize(.Name) + Serialize(.Arguments) + End With + + Case TreeType.AddHandlerStatement, TreeType.RemoveHandlerStatement + With CType(Statement, HandlerStatement) + SerializeStatementComments(Statement) + Serialize(.Name) + SerializeToken(TokenType.Comma, .CommaLocation) + Serialize(.DelegateExpression) + End With + + Case TreeType.OnErrorStatement + With CType(Statement, OnErrorStatement) + Writer.WriteAttributeString("onErrorType", .OnErrorType.ToString()) + SerializeStatementComments(Statement) + SerializeToken(TokenType.Error, .ErrorLocation) + + Select Case .OnErrorType + Case OnErrorType.Zero + SerializeToken(TokenType.GoTo, .ResumeOrGoToLocation) + Writer.WriteStartElement("Zero") + SerializeLocation(.NextOrZeroOrMinusLocation) + Writer.WriteEndElement() + + Case OnErrorType.MinusOne + SerializeToken(TokenType.GoTo, .ResumeOrGoToLocation) + SerializeToken(TokenType.Minus, .NextOrZeroOrMinusLocation) + Writer.WriteStartElement("One") + SerializeLocation(.OneLocation) + Writer.WriteEndElement() + + Case OnErrorType.Label + SerializeToken(TokenType.GoTo, .ResumeOrGoToLocation) + Serialize(.Name) + + Case OnErrorType.Next + SerializeToken(TokenType.Resume, .ResumeOrGoToLocation) + SerializeToken(TokenType.Next, .NextOrZeroOrMinusLocation) + + Case OnErrorType.Bad + ' Do nothing + End Select + End With + + Case TreeType.ResumeStatement + With CType(Statement, ResumeStatement) + Writer.WriteAttributeString("resumeType", .ResumeType.ToString()) + SerializeStatementComments(Statement) + Select Case .ResumeType + Case ResumeType.Next + SerializeToken(TokenType.Next, .NextLocation) + + Case ResumeType.Label + Serialize(.Name) + + Case ResumeType.None + ' Do nothing + End Select + End With + + Case TreeType.ReDimStatement + With CType(Statement, ReDimStatement) + SerializeStatementComments(Statement) + SerializeToken(TokenType.Preserve, .PreserveLocation) + Serialize(.Variables) + End With + + Case TreeType.EraseStatement + With CType(Statement, EraseStatement) + SerializeStatementComments(Statement) + Serialize(.Variables) + End With + + Case TreeType.CallStatement + With CType(Statement, CallStatement) + SerializeStatementComments(Statement) + SerializeToken(TokenType.Call, .CallLocation) + Serialize(.TargetExpression) + Serialize(.Arguments) + End With + + Case TreeType.AssignmentStatement + With CType(Statement, AssignmentStatement) + SerializeStatementComments(Statement) + Serialize(.TargetExpression) + SerializeToken(TokenType.Equals, .OperatorLocation) + Serialize(.SourceExpression) + End With + + Case TreeType.MidAssignmentStatement + With CType(Statement, MidAssignmentStatement) + Writer.WriteAttributeString("hasTypeCharacter", CStr(.HasTypeCharacter)) + SerializeStatementComments(Statement) + SerializeToken(TokenType.LeftParenthesis, .LeftParenthesisLocation) + Serialize(.TargetExpression) + SerializeToken(TokenType.Comma, .StartCommaLocation) + Serialize(.StartExpression) + SerializeToken(TokenType.Comma, .LengthCommaLocation) + Serialize(.LengthExpression) + SerializeToken(TokenType.RightParenthesis, .RightParenthesisLocation) + SerializeToken(TokenType.Equals, .OperatorLocation) + Serialize(.SourceExpression) + End With + + Case TreeType.CompoundAssignmentStatement + With CType(Statement, CompoundAssignmentStatement) + SerializeStatementComments(Statement) + Serialize(.TargetExpression) + SerializeToken(GetCompoundAssignmentOperatorToken(.CompoundOperator), .OperatorLocation) + Serialize(.SourceExpression) + End With + + Case TreeType.LocalDeclarationStatement + With CType(Statement, LocalDeclarationStatement) + SerializeStatementComments(Statement) + Serialize(.Modifiers) + Serialize(.VariableDeclarators) + End With + + Case TreeType.EndBlockStatement + With CType(Statement, EndBlockStatement) + Writer.WriteAttributeString("endType", .EndType.ToString()) + SerializeStatementComments(Statement) + SerializeToken(GetBlockTypeToken(.EndType), .EndArgumentLocation) + End With + + Case TreeType.WithBlockStatement, TreeType.SyncLockBlockStatement, TreeType.WhileBlockStatement + With CType(Statement, ExpressionBlockStatement) + SerializeStatementComments(Statement) + Serialize(.Expression) + Serialize(.Statements) + Serialize(.EndStatement) + End With + + Case TreeType.UsingBlockStatement + With CType(Statement, UsingBlockStatement) + SerializeStatementComments(Statement) + If .Expression IsNot Nothing Then + Serialize(.Expression) + Else + Serialize(.VariableDeclarators) + End If + Serialize(.Statements) + Serialize(.EndStatement) + End With + + Case TreeType.DoBlockStatement + With CType(Statement, DoBlockStatement) + If Not .Expression Is Nothing Then + Writer.WriteAttributeString("isWhile", Str(.IsWhile)) + SerializeStatementComments(Statement) + If .IsWhile Then + SerializeToken(TokenType.While, .WhileOrUntilLocation) + Else + SerializeToken(TokenType.Until, .WhileOrUntilLocation) + End If + Serialize(.Expression) + Else + SerializeStatementComments(Statement) + End If + Serialize(.Statements) + Serialize(.EndStatement) + End With + + Case TreeType.LoopStatement + With CType(Statement, LoopStatement) + If Not .Expression Is Nothing Then + Writer.WriteAttributeString("isWhile", Str(.IsWhile)) + SerializeStatementComments(Statement) + If .IsWhile Then + SerializeToken(TokenType.While, .WhileOrUntilLocation) + Else + SerializeToken(TokenType.Until, .WhileOrUntilLocation) + End If + Serialize(.Expression) + Else + SerializeStatementComments(Statement) + End If + End With + + Case TreeType.NextStatement + With CType(Statement, NextStatement) + SerializeStatementComments(Statement) + Serialize(.Variables) + End With + + Case TreeType.ForBlockStatement + With CType(Statement, ForBlockStatement) + SerializeStatementComments(Statement) + Serialize(.ControlExpression) + Serialize(.ControlVariableDeclarator) + SerializeToken(TokenType.Equals, .EqualsLocation) + Serialize(.LowerBoundExpression) + SerializeToken(TokenType.To, .ToLocation) + Serialize(.UpperBoundExpression) + SerializeToken(TokenType.Step, .StepLocation) + Serialize(.StepExpression) + Serialize(.Statements) + Serialize(.NextStatement) + End With + + Case TreeType.ForEachBlockStatement + With CType(Statement, ForEachBlockStatement) + SerializeStatementComments(Statement) + SerializeToken(TokenType.Each, .EachLocation) + Serialize(.ControlExpression) + Serialize(.ControlVariableDeclarator) + SerializeToken(TokenType.In, .InLocation) + Serialize(.CollectionExpression) + Serialize(.Statements) + Serialize(.NextStatement) + End With + + Case TreeType.CatchStatement + With CType(Statement, CatchStatement) + SerializeStatementComments(Statement) + Serialize(.Name) + SerializeToken(TokenType.As, .AsLocation) + Serialize(.ExceptionType) + SerializeToken(TokenType.When, .WhenLocation) + Serialize(.FilterExpression) + End With + + Case TreeType.CaseElseStatement + With CType(Statement, CaseElseStatement) + SerializeStatementComments(Statement) + SerializeToken(TokenType.Else, .ElseLocation) + End With + + Case TreeType.SelectBlockStatement + With CType(Statement, SelectBlockStatement) + SerializeStatementComments(Statement) + SerializeToken(TokenType.Case, .CaseLocation) + Serialize(.Expression) + Serialize(.Statements) + Serialize(.CaseBlockStatements) + Serialize(.CaseElseBlockStatement) + Serialize(.EndStatement) + End With + + Case TreeType.ElseIfStatement + With CType(Statement, ElseIfStatement) + SerializeStatementComments(Statement) + Serialize(.Expression) + SerializeToken(TokenType.Then, .ThenLocation) + End With + + Case TreeType.IfBlockStatement + With CType(Statement, IfBlockStatement) + SerializeStatementComments(Statement) + Serialize(.Expression) + SerializeToken(TokenType.Then, .ThenLocation) + Serialize(.Statements) + Serialize(.ElseIfBlockStatements) + Serialize(.ElseBlockStatement) + Serialize(.EndStatement) + End With + + Case TreeType.LineIfBlockStatement + With CType(Statement, LineIfStatement) + SerializeStatementComments(Statement) + Serialize(.Expression) + SerializeToken(TokenType.Then, .ThenLocation) + Serialize(.IfStatements) + SerializeToken(TokenType.Else, .ElseLocation) + Serialize(.ElseStatements) + End With + + Case Else + SerializeStatementComments(Statement) + For Each Child As Tree In Statement.Children + Serialize(Child) + Next + End Select + End Sub + + Private Sub SerializeCaseClause(ByVal CaseClause As Tree) + Select Case CaseClause.Type + Case TreeType.ComparisonCaseClause + With CType(CaseClause, ComparisonCaseClause) + SerializeToken(TokenType.Is, .IsLocation) + SerializeToken(GetOperatorToken(.ComparisonOperator), .OperatorLocation) + Serialize(.Operand) + End With + + Case TreeType.RangeCaseClause + With CType(CaseClause, RangeCaseClause) + Serialize(.RangeExpression) + End With + + Case Else + Debug.Assert(False, "Unexpected.") + End Select + End Sub + + Private Sub SerializeDeclarationComments(ByVal Declaration As Tree) + With CType(Declaration, Declaration) + If Not .Comments Is Nothing Then + For Each Comment As Comment In .Comments + Serialize(Comment) + Next + End If + End With + End Sub + + Private Sub SerializeDeclaration(ByVal Declaration As Tree) + Select Case Declaration.Type + Case TreeType.EndBlockDeclaration + With CType(Declaration, EndBlockDeclaration) + Writer.WriteAttributeString("endType", .EndType.ToString()) + SerializeDeclarationComments(Declaration) + SerializeToken(GetBlockTypeToken(.EndType), .EndArgumentLocation) + End With + + Case TreeType.EventDeclaration + With CType(Declaration, EventDeclaration) + SerializeDeclarationComments(Declaration) + Serialize(.Attributes) + Serialize(.Modifiers) + SerializeToken(TokenType.Event, .KeywordLocation) + Serialize(.Name) + Serialize(.Parameters) + SerializeToken(TokenType.As, .AsLocation) + Serialize(.ResultTypeAttributes) + Serialize(.ResultType) + Serialize(.ImplementsList) + End With + + Case TreeType.CustomEventDeclaration + With CType(Declaration, CustomEventDeclaration) + SerializeDeclarationComments(Declaration) + Serialize(.Attributes) + Serialize(.Modifiers) + SerializeToken(TokenType.Custom, .CustomLocation) + SerializeToken(TokenType.Event, .KeywordLocation) + Serialize(.Name) + SerializeToken(TokenType.As, .AsLocation) + Serialize(.ResultType) + Serialize(.ImplementsList) + Serialize(.Accessors) + Serialize(.EndDeclaration) + End With + + Case TreeType.ConstructorDeclaration, TreeType.SubDeclaration, TreeType.FunctionDeclaration + With CType(Declaration, MethodDeclaration) + SerializeDeclarationComments(Declaration) + Serialize(.Attributes) + Serialize(.Modifiers) + + Select Case Declaration.Type + Case TreeType.SubDeclaration + SerializeToken(TokenType.Sub, .KeywordLocation) + + Case TreeType.FunctionDeclaration + SerializeToken(TokenType.Function, .KeywordLocation) + + Case TreeType.ConstructorDeclaration + SerializeToken(TokenType.[New], .KeywordLocation) + End Select + + Serialize(.Name) + Serialize(.Parameters) + Serialize(.TypeParameters) + SerializeToken(TokenType.As, .AsLocation) + Serialize(.ResultTypeAttributes) + Serialize(.ResultType) + Serialize(.ImplementsList) + Serialize(.HandlesList) + Serialize(.Statements) + Serialize(.EndDeclaration) + End With + + Case TreeType.OperatorDeclaration + With CType(Declaration, OperatorDeclaration) + SerializeDeclarationComments(Declaration) + Serialize(.Attributes) + Serialize(.Modifiers) + SerializeToken(TokenType.Operator, .KeywordLocation) + If .OperatorToken IsNot Nothing Then + SerializeToken(.OperatorToken.Type, .OperatorToken.Span.Start) + End If + Serialize(.Parameters) + SerializeToken(TokenType.As, .AsLocation) + Serialize(.ResultTypeAttributes) + Serialize(.ResultType) + Serialize(.Statements) + Serialize(.EndDeclaration) + End With + + Case TreeType.ExternalSubDeclaration, TreeType.ExternalFunctionDeclaration + With CType(Declaration, ExternalDeclaration) + SerializeDeclarationComments(Declaration) + Serialize(.Attributes) + Serialize(.Modifiers) + + SerializeToken(TokenType.Declare, .KeywordLocation) + + Select Case .Charset + Case Charset.Auto + SerializeToken(TokenType.Auto, .CharsetLocation) + + Case Charset.Ansi + SerializeToken(TokenType.Ansi, .CharsetLocation) + + Case Charset.Unicode + SerializeToken(TokenType.Unicode, .CharsetLocation) + End Select + + Select Case Declaration.Type + Case TreeType.ExternalSubDeclaration + SerializeToken(TokenType.Sub, .SubOrFunctionLocation) + + Case TreeType.ExternalFunctionDeclaration + SerializeToken(TokenType.Function, .SubOrFunctionLocation) + End Select + + Serialize(.Name) + SerializeToken(TokenType.Lib, .LibLocation) + Serialize(.LibLiteral) + SerializeToken(TokenType.Alias, .AliasLocation) + Serialize(.AliasLiteral) + Serialize(.Parameters) + SerializeToken(TokenType.As, .AsLocation) + Serialize(.ResultTypeAttributes) + Serialize(.ResultType) + End With + + Case TreeType.PropertyDeclaration + With CType(Declaration, PropertyDeclaration) + SerializeDeclarationComments(Declaration) + Serialize(.Attributes) + Serialize(.Modifiers) + SerializeToken(TokenType.Event, .KeywordLocation) + Serialize(.Name) + Serialize(.Parameters) + SerializeToken(TokenType.As, .AsLocation) + Serialize(.ResultTypeAttributes) + Serialize(.ResultType) + Serialize(.ImplementsList) + Serialize(.Accessors) + Serialize(.EndDeclaration) + End With + + Case TreeType.GetAccessorDeclaration + With CType(Declaration, GetAccessorDeclaration) + SerializeDeclarationComments(Declaration) + Serialize(.Attributes) + Serialize(.Modifiers) + SerializeToken(TokenType.Get, .GetLocation) + Serialize(.Statements) + Serialize(.EndDeclaration) + End With + + Case TreeType.SetAccessorDeclaration + With CType(Declaration, SetAccessorDeclaration) + SerializeDeclarationComments(Declaration) + Serialize(.Attributes) + Serialize(.Modifiers) + SerializeToken(TokenType.Set, .SetLocation) + Serialize(.Parameters) + Serialize(.Statements) + Serialize(.EndDeclaration) + End With + + Case TreeType.EnumValueDeclaration + With CType(Declaration, EnumValueDeclaration) + SerializeDeclarationComments(Declaration) + Serialize(.Attributes) + Serialize(.Modifiers) + Serialize(.Name) + SerializeToken(TokenType.Equals, .EqualsLocation) + Serialize(.Expression) + End With + + Case TreeType.DelegateSubDeclaration + With CType(Declaration, DelegateSubDeclaration) + SerializeDeclarationComments(Declaration) + Serialize(.Attributes) + Serialize(.Modifiers) + SerializeToken(TokenType.Delegate, .KeywordLocation) + SerializeToken(TokenType.Sub, .SubOrFunctionLocation) + Serialize(.Name) + Serialize(.TypeParameters) + Serialize(.Parameters) + End With + + Case TreeType.DelegateFunctionDeclaration + With CType(Declaration, DelegateFunctionDeclaration) + SerializeDeclarationComments(Declaration) + Serialize(.Attributes) + Serialize(.Modifiers) + SerializeToken(TokenType.Delegate, .KeywordLocation) + SerializeToken(TokenType.Function, .SubOrFunctionLocation) + Serialize(.Name) + Serialize(.Parameters) + SerializeToken(TokenType.As, .AsLocation) + Serialize(.ResultTypeAttributes) + Serialize(.ResultType) + End With + + Case TreeType.ModuleDeclaration + With CType(Declaration, BlockDeclaration) + SerializeDeclarationComments(Declaration) + Serialize(.Attributes) + Serialize(.Modifiers) + SerializeToken(TokenType.Module, .KeywordLocation) + Serialize(.Name) + Serialize(.Declarations) + Serialize(.EndDeclaration) + End With + + Case TreeType.ClassDeclaration, TreeType.StructureDeclaration, TreeType.InterfaceDeclaration + With CType(Declaration, GenericBlockDeclaration) + SerializeDeclarationComments(Declaration) + Serialize(.Attributes) + Serialize(.Modifiers) + + Select Case Declaration.Type + Case TreeType.ClassDeclaration + SerializeToken(TokenType.Class, .KeywordLocation) + + Case TreeType.StructureDeclaration + SerializeToken(TokenType.Structure, .KeywordLocation) + + Case TreeType.ModuleDeclaration + SerializeToken(TokenType.Module, .KeywordLocation) + + Case TreeType.InterfaceDeclaration + SerializeToken(TokenType.Interface, .KeywordLocation) + End Select + + Serialize(.Name) + Serialize(.TypeParameters) + Serialize(.Declarations) + Serialize(.EndDeclaration) + End With + + Case TreeType.NamespaceDeclaration + With CType(Declaration, NamespaceDeclaration) + SerializeDeclarationComments(Declaration) + Serialize(.Attributes) + Serialize(.Modifiers) + + SerializeToken(TokenType.Namespace, .NamespaceLocation) + Serialize(.Name) + Serialize(.Declarations) + Serialize(.EndDeclaration) + End With + + Case TreeType.EnumDeclaration + With CType(Declaration, EnumDeclaration) + SerializeDeclarationComments(Declaration) + Serialize(.Attributes) + Serialize(.Modifiers) + SerializeToken(TokenType.Enum, .KeywordLocation) + Serialize(.Name) + SerializeToken(TokenType.As, .AsLocation) + Serialize(.ElementType) + Serialize(.Declarations) + Serialize(.EndDeclaration) + End With + + Case TreeType.OptionDeclaration + With CType(Declaration, OptionDeclaration) + Writer.WriteAttributeString("type", .OptionType.ToString()) + SerializeDeclarationComments(Declaration) + + Select Case .OptionType + Case OptionType.SyntaxError + + Case OptionType.Explicit, OptionType.ExplicitOn, _ + OptionType.ExplicitOff + Writer.WriteStartElement("Explicit") + SerializeLocation(.OptionTypeLocation) + Writer.WriteEndElement() + + If .OptionType = OptionType.ExplicitOn Then + SerializeToken(TokenType.On, .OptionArgumentLocation) + ElseIf .OptionType = OptionType.ExplicitOff Then + Writer.WriteStartElement("Off") + SerializeLocation(.OptionArgumentLocation) + Writer.WriteEndElement() + End If + + Case OptionType.Strict, OptionType.StrictOn, _ + OptionType.StrictOff + + Writer.WriteStartElement("Strict") + SerializeLocation(.OptionTypeLocation) + Writer.WriteEndElement() + + If .OptionType = OptionType.StrictOn Then + SerializeToken(TokenType.On, .OptionArgumentLocation) + ElseIf .OptionType = OptionType.StrictOff Then + Writer.WriteStartElement("Off") + SerializeLocation(.OptionArgumentLocation) + Writer.WriteEndElement() + End If + + Case OptionType.CompareBinary, OptionType.CompareText + Writer.WriteStartElement("Compare") + SerializeLocation(.OptionTypeLocation) + Writer.WriteEndElement() + + If .OptionType = OptionType.CompareBinary Then + Writer.WriteStartElement("Binary") + SerializeLocation(.OptionArgumentLocation) + Writer.WriteEndElement() + Else + Writer.WriteStartElement("Text") + SerializeLocation(.OptionArgumentLocation) + Writer.WriteEndElement() + End If + End Select + End With + + Case Else + SerializeDeclarationComments(Declaration) + For Each Child As Tree In Declaration.Children + Serialize(Child) + Next + End Select + End Sub + + Private Sub SerializeImport(ByVal Import As Tree) + Select Case Import.Type + Case TreeType.NameImport + With CType(Import, NameImport) + Serialize(.TypeName) + End With + + Case TreeType.AliasImport + With CType(Import, AliasImport) + Serialize(.AliasedTypeName) + SerializeToken(TokenType.Equals, .EqualsLocation) + Serialize(.Name) + End With + End Select + End Sub + + Public Sub Serialize(ByVal Tree As Tree) + If Tree Is Nothing Then + Return + End If + + Writer.WriteStartElement(Tree.Type.ToString()) + If Tree.IsBad Then + Writer.WriteAttributeString("isBad", CStr(True)) + End If + SerializeSpan(Tree.Span) + + Select Case Tree.Type + Case TreeType.ArgumentCollection To TreeType.DeclarationCollection + SerializeList(Tree) + + Case TreeType.Comment + With CType(Tree, Comment) + Writer.WriteAttributeString("isRem", CStr(.IsREM)) + + If Not .Comment Is Nothing Then + Writer.WriteString(.Comment) + End If + End With + + Case TreeType.SimpleName To TreeType.QualifiedName + SerializeName(Tree) + + Case TreeType.IntrinsicType To TreeType.ArrayType + SerializeType(Tree) + + Case TreeType.Argument + With CType(Tree, Argument) + Serialize(.Name) + SerializeToken(TokenType.ColonEquals, .ColonEqualsLocation) + Serialize(.Expression) + End With + + Case TreeType.SimpleNameExpression To TreeType.GetTypeExpression + SerializeExpression(Tree) + + Case TreeType.EmptyStatement To TreeType.EndBlockStatement + SerializeStatement(Tree) + + Case TreeType.Modifier + With CType(Tree, Modifier) + Writer.WriteAttributeString("type", .ModifierType.ToString()) + End With + + Case TreeType.VariableDeclarator + With CType(Tree, VariableDeclarator) + Serialize(.VariableNames) + SerializeToken(TokenType.As, .AsLocation) + SerializeToken(TokenType.[New], .NewLocation) + Serialize(.VariableType) + Serialize(.Arguments) + SerializeToken(TokenType.Equals, .EqualsLocation) + Serialize(.Initializer) + End With + + Case TreeType.ComparisonCaseClause To TreeType.RangeCaseClause + SerializeCaseClause(Tree) + + Case TreeType.Attribute + With CType(Tree, Attribute) + Writer.WriteAttributeString("type", .AttributeType.ToString()) + + Select Case .AttributeType + Case AttributeTypes.Assembly + SerializeToken(TokenType.Colon, .ColonLocation) + SerializeToken(TokenType.Assembly, .AttributeTypeLocation) + + Case AttributeTypes.Module + SerializeToken(TokenType.Module, .AttributeTypeLocation) + SerializeToken(TokenType.Colon, .ColonLocation) + End Select + + Serialize(.Name) + Serialize(.Arguments) + End With + + Case TreeType.EmptyDeclaration To TreeType.DelegateFunctionDeclaration + SerializeDeclaration(Tree) + + Case TreeType.Parameter + With CType(Tree, Parameter) + Serialize(.Attributes) + Serialize(.Modifiers) + Serialize(.VariableName) + SerializeToken(TokenType.As, .AsLocation) + Serialize(.ParameterType) + SerializeToken(TokenType.Equals, .EqualsLocation) + Serialize(.Initializer) + End With + + Case TreeType.TypeParameter + With CType(Tree, TypeParameter) + Serialize(.TypeName) + SerializeToken(TokenType.As, .AsLocation) + Serialize(.TypeConstraints) + End With + + Case TreeType.NameImport To TreeType.AliasImport + SerializeImport(Tree) + + Case Else + For Each Child As Tree In Tree.Children + Serialize(Child) + Next + End Select + + Writer.WriteEndElement() + End Sub +End Class diff --git a/aspclassiccompiler/Parser/SourceRegion.vb b/aspclassiccompiler/Parser/SourceRegion.vb new file mode 100644 index 0000000..8583f89 --- /dev/null +++ b/aspclassiccompiler/Parser/SourceRegion.vb @@ -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. +' + +''' +''' A region marked in the source code. +''' +Public NotInheritable Class SourceRegion + Private ReadOnly _Start, _Finish As Location + Private ReadOnly _Description As String + + ''' + ''' The start location of the region. + ''' + Public ReadOnly Property Start() As Location + Get + Return _Start + End Get + End Property + + ''' + ''' The end location of the region. + ''' + Public ReadOnly Property Finish() As Location + Get + Return _Finish + End Get + End Property + + ''' + ''' The description of the region. + ''' + Public ReadOnly Property Description() As String + Get + Return _Description + End Get + End Property + + ''' + ''' Constructs a new source region. + ''' + ''' The start location of the region. + ''' The end location of the region. + ''' The description of the region. + 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 diff --git a/aspclassiccompiler/Parser/Span.vb b/aspclassiccompiler/Parser/Span.vb new file mode 100644 index 0000000..3f19aa0 --- /dev/null +++ b/aspclassiccompiler/Parser/Span.vb @@ -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. +' + +''' +''' Stores the location of a span of text. +''' +''' The end location is exclusive. +Public Structure Span + Private ReadOnly _Start As Location + Private ReadOnly _Finish As Location + + ''' + ''' The start location of the span. + ''' + Public ReadOnly Property Start() As Location + Get + Return _Start + End Get + End Property + + ''' + ''' The end location of the span. + ''' + Public ReadOnly Property Finish() As Location + Get + Return _Finish + End Get + End Property + + ''' + ''' Whether the locations in the span are valid. + ''' + Public ReadOnly Property IsValid() As Boolean + Get + Return Start.IsValid AndAlso Finish.IsValid + End Get + End Property + + ''' + ''' Constructs a new span with a specific start and end location. + ''' + ''' The beginning of the span. + ''' The end of the span. + Public Sub New(ByVal start As Location, ByVal finish As Location) + _Start = Start + _Finish = Finish + End Sub + + ''' + ''' Compares two specified Span values to see if they are equal. + ''' + ''' One span to compare. + ''' The other span to compare. + ''' True if the spans are the same, False otherwise. + 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 + + ''' + ''' Compares two specified Span values to see if they are not equal. + ''' + ''' One span to compare. + ''' The other span to compare. + ''' True if the spans are not the same, False otherwise. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/SyntaxError.vb b/aspclassiccompiler/Parser/SyntaxError.vb new file mode 100644 index 0000000..633c1e0 --- /dev/null +++ b/aspclassiccompiler/Parser/SyntaxError.vb @@ -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. +' + +''' +''' A syntax error. +''' +Public NotInheritable Class SyntaxError + Private ReadOnly _Type As SyntaxErrorType + Private ReadOnly _Span As Span + + ''' + ''' The type of the syntax error. + ''' + Public ReadOnly Property Type() As SyntaxErrorType + Get + Return _Type + End Get + End Property + + ''' + ''' The location of the syntax error. + ''' + Public ReadOnly Property Span() As Span + Get + Return _Span + End Get + End Property + + ''' + ''' Constructs a new syntax error. + ''' + ''' The type of the syntax error. + ''' The location of the syntax error. + 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 diff --git a/aspclassiccompiler/Parser/SyntaxErrorType.vb b/aspclassiccompiler/Parser/SyntaxErrorType.vb new file mode 100644 index 0000000..3389759 --- /dev/null +++ b/aspclassiccompiler/Parser/SyntaxErrorType.vb @@ -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. +' + +''' +''' The type of a syntax error. +''' +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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Tokens/CharacterLiteralToken.vb b/aspclassiccompiler/Parser/Tokens/CharacterLiteralToken.vb new file mode 100644 index 0000000..3a967ab --- /dev/null +++ b/aspclassiccompiler/Parser/Tokens/CharacterLiteralToken.vb @@ -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. +' + +''' +''' A character literal. +''' +Public NotInheritable Class CharacterLiteralToken + Inherits Token + + Private ReadOnly _Literal As Char + + ''' + ''' The literal value. + ''' + Public ReadOnly Property Literal() As Char + Get + Return _Literal + End Get + End Property + + ''' + ''' Constructs a new character literal token. + ''' + ''' The literal value. + ''' The location of the literal. + Public Sub New(ByVal literal As Char, ByVal span As Span) + MyBase.New(TokenType.CharacterLiteral, span) + _Literal = Literal + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Tokens/CommentToken.vb b/aspclassiccompiler/Parser/Tokens/CommentToken.vb new file mode 100644 index 0000000..1ad9527 --- /dev/null +++ b/aspclassiccompiler/Parser/Tokens/CommentToken.vb @@ -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. +' + +''' +''' A comment token. +''' +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 + + ''' + ''' Whether the comment was preceded by REM. + ''' + Public ReadOnly Property IsREM() As Boolean + Get + Return _IsREM + End Get + End Property + + ''' + ''' The text of the comment. + ''' + Public ReadOnly Property Comment() As String + Get + Return _Comment + End Get + End Property + + ''' + ''' Constructs a new comment token. + ''' + ''' The comment value. + ''' Whether the comment was preceded by REM. + ''' The location of the comment. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Tokens/DateLiteralToken.vb b/aspclassiccompiler/Parser/Tokens/DateLiteralToken.vb new file mode 100644 index 0000000..4ecb9e1 --- /dev/null +++ b/aspclassiccompiler/Parser/Tokens/DateLiteralToken.vb @@ -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. +' + +''' +''' A date/time literal. +''' +Public NotInheritable Class DateLiteralToken + Inherits Token + + Private ReadOnly _Literal As Date + + ''' + ''' The literal value. + ''' + Public ReadOnly Property Literal() As Date + Get + Return _Literal + End Get + End Property + + ''' + ''' Constructs a new date literal instance. + ''' + ''' The literal value. + ''' The location of the literal. + Public Sub New(ByVal literal As Date, ByVal span As Span) + MyBase.New(TokenType.DateLiteral, span) + _Literal = literal + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Tokens/DecimalLiteralToken.vb b/aspclassiccompiler/Parser/Tokens/DecimalLiteralToken.vb new file mode 100644 index 0000000..ff32681 --- /dev/null +++ b/aspclassiccompiler/Parser/Tokens/DecimalLiteralToken.vb @@ -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. +' + +''' +''' A decimal literal token. +''' +Public NotInheritable Class DecimalLiteralToken + Inherits Token + + Private ReadOnly _Literal As Decimal + Private ReadOnly _TypeCharacter As TypeCharacter ' The type character after the literal, if any + + ''' + ''' The literal value. + ''' + Public ReadOnly Property Literal() As Decimal + Get + Return _Literal + End Get + End Property + + ''' + ''' The type character of the literal. + ''' + Public ReadOnly Property TypeCharacter() As TypeCharacter + Get + Return _TypeCharacter + End Get + End Property + + ''' + ''' Constructs a new decimal literal token. + ''' + ''' The literal value. + ''' The literal's type character. + ''' The location of the literal. + 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 diff --git a/aspclassiccompiler/Parser/Tokens/EndOfStreamToken.vb b/aspclassiccompiler/Parser/Tokens/EndOfStreamToken.vb new file mode 100644 index 0000000..4fe02aa --- /dev/null +++ b/aspclassiccompiler/Parser/Tokens/EndOfStreamToken.vb @@ -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. +' + +''' +''' A token representing the end of the file. +''' +Public NotInheritable Class EndOfStreamToken + Inherits Token + + ''' + ''' Creates a new end-of-stream token. + ''' + ''' The location of the end of the stream. + Public Sub New(ByVal span As Span) + MyBase.New(TokenType.EndOfStream, Span) + End Sub +End Class + diff --git a/aspclassiccompiler/Parser/Tokens/ErrorToken.vb b/aspclassiccompiler/Parser/Tokens/ErrorToken.vb new file mode 100644 index 0000000..96cf76e --- /dev/null +++ b/aspclassiccompiler/Parser/Tokens/ErrorToken.vb @@ -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. +' + +''' +''' A lexical error. +''' +Public NotInheritable Class ErrorToken + Inherits Token + + Private ReadOnly _SyntaxError As SyntaxError + + ''' + ''' The syntax error that represents the lexical error. + ''' + Public ReadOnly Property SyntaxError() As SyntaxError + Get + Return _SyntaxError + End Get + End Property + + ''' + ''' Creates a new lexical error token. + ''' + ''' The type of the error. + ''' The location of the error. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Tokens/FloatingPointLiteralToken.vb b/aspclassiccompiler/Parser/Tokens/FloatingPointLiteralToken.vb new file mode 100644 index 0000000..58f33d8 --- /dev/null +++ b/aspclassiccompiler/Parser/Tokens/FloatingPointLiteralToken.vb @@ -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. +' + +''' +''' A floating point literal. +''' +Public NotInheritable Class FloatingPointLiteralToken + Inherits Token + + Private ReadOnly _Literal As Double + Private ReadOnly _TypeCharacter As TypeCharacter ' The type character after the literal, if any + + ''' + ''' The value of the literal. + ''' + Public ReadOnly Property Literal() As Double + Get + Return _Literal + End Get + End Property + + ''' + ''' The type character after the literal. + ''' + Public ReadOnly Property TypeCharacter() As TypeCharacter + Get + Return _TypeCharacter + End Get + End Property + + ''' + ''' Constructs a new floating point literal token. + ''' + ''' The literal value. + ''' The type character of the literal. + ''' The location of the literal. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Tokens/IdentifierToken.vb b/aspclassiccompiler/Parser/Tokens/IdentifierToken.vb new file mode 100644 index 0000000..c99b62e --- /dev/null +++ b/aspclassiccompiler/Parser/Tokens/IdentifierToken.vb @@ -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. +' + +''' +''' An identifier. +''' +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 + + ''' + ''' Determines if a token type is a keyword. + ''' + ''' The token type to check. + ''' True if the token type is a keyword, False otherwise. + 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 + + ''' + ''' The identifier name. + ''' + Public ReadOnly Property Identifier() As String + Get + Return _Identifier + End Get + End Property + + ''' + ''' Whether the identifier is escaped. + ''' + Public ReadOnly Property Escaped() As Boolean + Get + Return _Escaped + End Get + End Property + + ''' + ''' The type character of the identifier. + ''' + Public ReadOnly Property TypeCharacter() As TypeCharacter + Get + Return _TypeCharacter + End Get + End Property + + ''' + ''' Constructs a new identifier token. + ''' + ''' The token type of the identifier. + ''' The unreserved token type of the identifier. + ''' The text of the identifier + ''' Whether the identifier is escaped. + ''' The type character of the identifier. + ''' The location of the identifier. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Tokens/IntegerLiteralToken.vb b/aspclassiccompiler/Parser/Tokens/IntegerLiteralToken.vb new file mode 100644 index 0000000..6596270 --- /dev/null +++ b/aspclassiccompiler/Parser/Tokens/IntegerLiteralToken.vb @@ -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. +' + +''' +''' An integer literal. +''' +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 + + ''' + ''' The value of the literal. + ''' + Public ReadOnly Property Literal() As Integer + Get + Return _Literal + End Get + End Property + + ''' + ''' The type character of the literal. + ''' + Public ReadOnly Property TypeCharacter() As TypeCharacter + Get + Return _TypeCharacter + End Get + End Property + + ''' + ''' The integer base of the literal. + ''' + Public ReadOnly Property IntegerBase() As IntegerBase + Get + Return _IntegerBase + End Get + End Property + + ''' + ''' Constructs a new integer literal. + ''' + ''' The literal value. + ''' The integer base of the literal. + ''' The type character of the literal. + ''' The location of the literal. + 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 + diff --git a/aspclassiccompiler/Parser/Tokens/LineTerminatorToken.vb b/aspclassiccompiler/Parser/Tokens/LineTerminatorToken.vb new file mode 100644 index 0000000..359e8d2 --- /dev/null +++ b/aspclassiccompiler/Parser/Tokens/LineTerminatorToken.vb @@ -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. +' + +''' +''' A line terminator. +''' +Public NotInheritable Class LineTerminatorToken + Inherits Token + + ''' + ''' Create a new line terminator token. + ''' + ''' The location of the line terminator. + Public Sub New(ByVal span As Span) + MyBase.New(TokenType.LineTerminator, span) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Tokens/PunctuatorToken.vb b/aspclassiccompiler/Parser/Tokens/PunctuatorToken.vb new file mode 100644 index 0000000..036b803 --- /dev/null +++ b/aspclassiccompiler/Parser/Tokens/PunctuatorToken.vb @@ -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. +' + +''' +''' A punctuation token. +''' +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 + + ''' + ''' Constructs a new punctuator token. + ''' + ''' The punctuator token type. + ''' The location of the punctuator. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Tokens/StringLiteralToken.vb b/aspclassiccompiler/Parser/Tokens/StringLiteralToken.vb new file mode 100644 index 0000000..e925693 --- /dev/null +++ b/aspclassiccompiler/Parser/Tokens/StringLiteralToken.vb @@ -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. +' + +''' +''' A string literal. +''' +Public NotInheritable Class StringLiteralToken + Inherits Token + + Private ReadOnly _Literal As String + + ''' + ''' The value of the literal. + ''' + Public ReadOnly Property Literal() As String + Get + Return _Literal + End Get + End Property + + ''' + ''' Constructs a new string literal token. + ''' + ''' The value of the literal. + ''' The location of the literal. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Tokens/Token.vb b/aspclassiccompiler/Parser/Tokens/Token.vb new file mode 100644 index 0000000..689b63d --- /dev/null +++ b/aspclassiccompiler/Parser/Tokens/Token.vb @@ -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. +' + +''' +''' The base class for all tokens. Contains line and column information as well as token type. +''' +Public MustInherit Class Token + Private ReadOnly _Type As TokenType + Private ReadOnly _Span As Span ' A span ends at the first character beyond the token + + ''' + ''' The type of the token. + ''' + Public ReadOnly Property Type() As TokenType + Get + Return _Type + End Get + End Property + + ''' + ''' The span of the token in the source text. + ''' + 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 + + ''' + ''' Returns the unreserved keyword type of an identifier. + ''' + ''' The unreserved keyword type of an identifier, the token's type otherwise. + Public Overridable Function AsUnreservedKeyword() As TokenType + Return Type + End Function +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Tokens/TokenType.vb b/aspclassiccompiler/Parser/Tokens/TokenType.vb new file mode 100644 index 0000000..9811e10 --- /dev/null +++ b/aspclassiccompiler/Parser/Tokens/TokenType.vb @@ -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. +' + +''' +''' The type of a token. +''' +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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Tokens/UnsignedIntegerLiteralToken.vb b/aspclassiccompiler/Parser/Tokens/UnsignedIntegerLiteralToken.vb new file mode 100644 index 0000000..ba86c4f --- /dev/null +++ b/aspclassiccompiler/Parser/Tokens/UnsignedIntegerLiteralToken.vb @@ -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. +' + +''' +''' An integer literal. +''' +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 + + ''' + ''' The value of the literal. + ''' + _ + Public ReadOnly Property Literal() As ULong + Get + Return _Literal + End Get + End Property + + ''' + ''' The type character of the literal. + ''' + Public ReadOnly Property TypeCharacter() As TypeCharacter + Get + Return _TypeCharacter + End Get + End Property + + ''' + ''' The integer base of the literal. + ''' + Public ReadOnly Property IntegerBase() As IntegerBase + Get + Return _IntegerBase + End Get + End Property + + ''' + ''' Constructs a new unsigned integer literal. + ''' + ''' The literal value. + ''' The integer base of the literal. + ''' The type character of the literal. + ''' The location of the literal. + _ + 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 + diff --git a/aspclassiccompiler/Parser/Trees/Arguments/Argument.vb b/aspclassiccompiler/Parser/Trees/Arguments/Argument.vb new file mode 100644 index 0000000..dfd2d3d --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Arguments/Argument.vb @@ -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. +' + +''' +''' A parse tree for an argument to a call or index. +''' +Public NotInheritable Class Argument + Inherits Tree + + Private ReadOnly _Name As SimpleName + Private ReadOnly _ColonEqualsLocation As Location + Private ReadOnly _Expression As Expression + + ''' + ''' The name of the argument, if any. + ''' + Public ReadOnly Property Name() As SimpleName + Get + Return _Name + End Get + End Property + + ''' + ''' The location of the ':=', if any. + ''' + Public ReadOnly Property ColonEqualsLocation() As Location + Get + Return _ColonEqualsLocation + End Get + End Property + + ''' + ''' The argument, if any. + ''' + Public ReadOnly Property Expression() As Expression + Get + Return _Expression + End Get + End Property + + ''' + ''' Constructs a new parse tree for an argument. + ''' + ''' The name of the argument, if any. + ''' The location of the ':=', if any. + ''' The expression, if any. + ''' The location of the parse tree. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Arguments/ArgumentCollection.vb b/aspclassiccompiler/Parser/Trees/Arguments/ArgumentCollection.vb new file mode 100644 index 0000000..b452bc3 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Arguments/ArgumentCollection.vb @@ -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. +' + +''' +''' A read-only collection of arguments. +''' +Public NotInheritable Class ArgumentCollection + Inherits CommaDelimitedTreeCollection(Of Argument) + + Private ReadOnly _RightParenthesisLocation As Location + + ''' + ''' The location of the ')'. + ''' + Public ReadOnly Property RightParenthesisLocation() As Location + Get + Return _RightParenthesisLocation + End Get + End Property + + ''' + ''' Constructs a new argument collection. + ''' + ''' The arguments in the collection. + ''' The location of the commas in the collection. + ''' The location of the ')'. + ''' The location of the parse tree. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Attributes/Attribute.vb b/aspclassiccompiler/Parser/Trees/Attributes/Attribute.vb new file mode 100644 index 0000000..a442da1 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Attributes/Attribute.vb @@ -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. +' + +''' +''' A parse tree for an attribute usage. +''' +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 + + ''' + ''' The target type of the attribute. + ''' + Public ReadOnly Property AttributeType() As AttributeTypes + Get + Return _AttributeType + End Get + End Property + + ''' + ''' The location of the attribute type, if any. + ''' + Public ReadOnly Property AttributeTypeLocation() As Location + Get + Return _AttributeTypeLocation + End Get + End Property + + ''' + ''' The location of the ':', if any. + ''' + Public ReadOnly Property ColonLocation() As Location + Get + Return _ColonLocation + End Get + End Property + + ''' + ''' The name of the attribute being applied. + ''' + Public ReadOnly Property Name() As Name + Get + Return _Name + End Get + End Property + + ''' + ''' The arguments to the attribute. + ''' + Public ReadOnly Property Arguments() As ArgumentCollection + Get + Return _Arguments + End Get + End Property + + ''' + ''' Constructs a new attribute parse tree. + ''' + ''' The target type of the attribute. + ''' The location of the attribute type. + ''' The location of the ':'. + ''' The name of the attribute being applied. + ''' The arguments to the attribute. + ''' The location of the parse tree. + 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 diff --git a/aspclassiccompiler/Parser/Trees/Attributes/AttributeBlockCollection.vb b/aspclassiccompiler/Parser/Trees/Attributes/AttributeBlockCollection.vb new file mode 100644 index 0000000..61c1047 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Attributes/AttributeBlockCollection.vb @@ -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. +' + +''' +''' A read-only collection of attributes. +''' +Public NotInheritable Class AttributeBlockCollection + Inherits TreeCollection(Of AttributeCollection) + + ''' + ''' Constructs a new collection of attribute blocks. + ''' + ''' The attribute blockss in the collection. + ''' The location of the parse tree. + 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 diff --git a/aspclassiccompiler/Parser/Trees/Attributes/AttributeCollection.vb b/aspclassiccompiler/Parser/Trees/Attributes/AttributeCollection.vb new file mode 100644 index 0000000..ae7f6e4 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Attributes/AttributeCollection.vb @@ -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. +' + +''' +''' A read-only collection of attributes. +''' +Public NotInheritable Class AttributeCollection + Inherits CommaDelimitedTreeCollection(Of Attribute) + + Private ReadOnly _RightBracketLocation As Location + + ''' + ''' The location of the '}'. + ''' + Public ReadOnly Property RightBracketLocation() As Location + Get + Return _RightBracketLocation + End Get + End Property + + ''' + ''' Constructs a new collection of attributes. + ''' + ''' The attributes in the collection. + ''' The location of the commas in the list. + ''' The location of the right bracket. + ''' The location of the parse tree. + 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 diff --git a/aspclassiccompiler/Parser/Trees/Attributes/AttributeTypes.vb b/aspclassiccompiler/Parser/Trees/Attributes/AttributeTypes.vb new file mode 100644 index 0000000..92975c3 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Attributes/AttributeTypes.vb @@ -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. +' + +''' +''' The type of an attribute usage. +''' + _ +Public Enum AttributeTypes + ''' Regular application. + Regular = &H1 + + ''' Applied to the netmodule. + [Module] = &H2 + + ''' Applied to the assembly. + Assembly = &H4 +End Enum \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/BlockType.vb b/aspclassiccompiler/Parser/Trees/BlockType.vb new file mode 100644 index 0000000..e72ac1f --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/BlockType.vb @@ -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. +' + +''' +''' The type a block declaration. +''' +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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/CaseClauses/CaseClause.vb b/aspclassiccompiler/Parser/Trees/CaseClauses/CaseClause.vb new file mode 100644 index 0000000..7e1f54c --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/CaseClauses/CaseClause.vb @@ -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. +' + +''' +''' A parse tree for a case clause in a Select statement. +''' +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 diff --git a/aspclassiccompiler/Parser/Trees/CaseClauses/CaseClauseCollection.vb b/aspclassiccompiler/Parser/Trees/CaseClauses/CaseClauseCollection.vb new file mode 100644 index 0000000..678cd7a --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/CaseClauses/CaseClauseCollection.vb @@ -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. +' + +''' +''' A collection of case clauses. +''' +Public NotInheritable Class CaseClauseCollection + Inherits CommaDelimitedTreeCollection(Of CaseClause) + + ''' + ''' Constructs a new collection of case clauses. + ''' + ''' The case clauses in the collection. + ''' The locations of the commas in the list. + ''' The location of the parse tree. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/CaseClauses/ComparisonCaseClause.vb b/aspclassiccompiler/Parser/Trees/CaseClauses/ComparisonCaseClause.vb new file mode 100644 index 0000000..190bd5f --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/CaseClauses/ComparisonCaseClause.vb @@ -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. +' + +''' +''' A parse tree for a case clause that compares values. +''' +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 + + ''' + ''' The location of the 'Is', if any. + ''' + Public ReadOnly Property IsLocation() As Location + Get + Return _IsLocation + End Get + End Property + + ''' + ''' The comparison operator used in the case clause. + ''' + Public ReadOnly Property ComparisonOperator() As OperatorType + Get + Return _ComparisonOperator + End Get + End Property + + ''' + ''' The location of the comparison operator. + ''' + Public ReadOnly Property OperatorLocation() As Location + Get + Return _OperatorLocation + End Get + End Property + + ''' + ''' The operand of the case clause. + ''' + Public ReadOnly Property Operand() As Expression + Get + Return _Operand + End Get + End Property + + ''' + ''' Constructs a new parse tree for a comparison case clause. + ''' + ''' The location of the 'Is', if any. + ''' The comparison operator used. + ''' The location of the comparison operator. + ''' The operand of the comparison. + ''' The location of the parse tree. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/CaseClauses/RangeCaseClause.vb b/aspclassiccompiler/Parser/Trees/CaseClauses/RangeCaseClause.vb new file mode 100644 index 0000000..07fa7bd --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/CaseClauses/RangeCaseClause.vb @@ -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. +' + +''' +''' A parse tree for a case clause that compares against a range of values. +''' +Public NotInheritable Class RangeCaseClause + Inherits CaseClause + + Private ReadOnly _RangeExpression As Expression + + ''' + ''' The range expression. + ''' + Public ReadOnly Property RangeExpression() As Expression + Get + Return _RangeExpression + End Get + End Property + + ''' + ''' Constructs a new range case clause parse tree. + ''' + ''' The range expression. + ''' The location of the parse tree. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Collections/ColonDelimitedTreeCollection.vb b/aspclassiccompiler/Parser/Trees/Collections/ColonDelimitedTreeCollection.vb new file mode 100644 index 0000000..65d8fd2 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Collections/ColonDelimitedTreeCollection.vb @@ -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. +' + +''' +''' A collection of trees that are colon delimited. +''' +Public MustInherit Class ColonDelimitedTreeCollection(Of T As Tree) + Inherits TreeCollection(Of T) + + Private ReadOnly _ColonLocations As ReadOnlyCollection(Of Location) + + ''' + ''' The locations of the colons in the collection. + ''' + 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 diff --git a/aspclassiccompiler/Parser/Trees/Collections/CommaDelimitedTreeCollection.vb b/aspclassiccompiler/Parser/Trees/Collections/CommaDelimitedTreeCollection.vb new file mode 100644 index 0000000..8681198 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Collections/CommaDelimitedTreeCollection.vb @@ -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. +' + +''' +''' A collection of trees that are delimited by commas. +''' +Public MustInherit Class CommaDelimitedTreeCollection(Of T As Tree) + Inherits TreeCollection(Of T) + + Private ReadOnly _CommaLocations As ReadOnlyCollection(Of Location) + + ''' + ''' The location of the commas in the list. + ''' + 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 diff --git a/aspclassiccompiler/Parser/Trees/Collections/TreeCollection.vb b/aspclassiccompiler/Parser/Trees/Collections/TreeCollection.vb new file mode 100644 index 0000000..22419e9 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Collections/TreeCollection.vb @@ -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. +' + +''' +''' A collection of a particular type of trees +''' +''' The type of tree the collection contains. +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 diff --git a/aspclassiccompiler/Parser/Trees/Comments/Comment.vb b/aspclassiccompiler/Parser/Trees/Comments/Comment.vb new file mode 100644 index 0000000..0290719 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Comments/Comment.vb @@ -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. +' + +''' +''' A parse tree for a comment. +''' +Public NotInheritable Class Comment + Inherits Tree + + Private ReadOnly _Comment As String + Private ReadOnly _IsREM As Boolean + + ''' + ''' The text of the comment. + ''' + Public ReadOnly Property Comment() As String + Get + Return _Comment + End Get + End Property + + ''' + ''' Whether the comment is a REM comment. + ''' + Public ReadOnly Property IsREM() As Boolean + Get + Return _IsREM + End Get + End Property + + ''' + ''' Constructs a new comment parse tree. + ''' + ''' The text of the comment. + ''' Whether the comment is a REM comment. + ''' The location of the parse tree. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Declarations/AttributeDeclaration.vb b/aspclassiccompiler/Parser/Trees/Declarations/AttributeDeclaration.vb new file mode 100644 index 0000000..da934f5 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Declarations/AttributeDeclaration.vb @@ -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. +' + +''' +''' A parse tree for an assembly-level or module-level attribute declaration. +''' +Public NotInheritable Class AttributeDeclaration + Inherits Declaration + + Private ReadOnly _Attributes As AttributeBlockCollection + + ''' + ''' The attributes. + ''' + Public ReadOnly Property Attributes() As AttributeBlockCollection + Get + Return _Attributes + End Get + End Property + + ''' + ''' Constructs a new parse tree for assembly-level or module-level attribute declarations. + ''' + ''' The attributes. + ''' The location of the parse tree. + ''' The comments for the parse tree. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Declarations/BlockDeclaration.vb b/aspclassiccompiler/Parser/Trees/Declarations/BlockDeclaration.vb new file mode 100644 index 0000000..63bec8d --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Declarations/BlockDeclaration.vb @@ -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. +' + +''' +''' A parse tree for a block declaration. +''' +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 + + ''' + ''' The location of the keyword. + ''' + Public ReadOnly Property KeywordLocation() As Location + Get + Return _KeywordLocation + End Get + End Property + + ''' + ''' The name of the declaration. + ''' + Public ReadOnly Property Name() As SimpleName + Get + Return _Name + End Get + End Property + + ''' + ''' The declarations in the block. + ''' + Public ReadOnly Property Declarations() As DeclarationCollection + Get + Return _Declarations + End Get + End Property + + ''' + ''' The End statement for the block. + ''' + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Declarations/Declaration.vb b/aspclassiccompiler/Parser/Trees/Declarations/Declaration.vb new file mode 100644 index 0000000..e998426 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Declarations/Declaration.vb @@ -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 + +''' +''' A parse tree for a declaration. +''' +Public Class Declaration + Inherits Statement + + ''' + ''' Creates a bad declaration. + ''' + ''' The location of the parse tree. + ''' The comments for the parse tree. + ''' A bad declaration. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Declarations/DeclarationCollection.vb b/aspclassiccompiler/Parser/Trees/Declarations/DeclarationCollection.vb new file mode 100644 index 0000000..e36bfc2 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Declarations/DeclarationCollection.vb @@ -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. +' + +''' +''' A read-only collection of declarations. +''' +Public NotInheritable Class DeclarationCollection + Inherits ColonDelimitedTreeCollection(Of Declaration) + + ''' + ''' Constructs a new collection of declarations. + ''' + ''' The declarations in the collection. + ''' The locations of the colons in the collection. + ''' The location of the parse tree. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Declarations/EmptyDeclaration.vb b/aspclassiccompiler/Parser/Trees/Declarations/EmptyDeclaration.vb new file mode 100644 index 0000000..b72fc6e --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Declarations/EmptyDeclaration.vb @@ -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. +' + +''' +''' A parse tree for an empty declaration. +''' +Public NotInheritable Class EmptyDeclaration + Inherits Declaration + + ''' + ''' Constructs a new parse tree for an empty declaration. + ''' + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.EmptyDeclaration, span, comments) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Declarations/EndBlockDeclaration.vb b/aspclassiccompiler/Parser/Trees/Declarations/EndBlockDeclaration.vb new file mode 100644 index 0000000..2fe393a --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Declarations/EndBlockDeclaration.vb @@ -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. +' + +''' +''' A parse tree for an End declaration. +''' +Public NotInheritable Class EndBlockDeclaration + Inherits Declaration + + Private ReadOnly _EndType As BlockType + Private ReadOnly _EndArgumentLocation As Location + + ''' + ''' The type of block the declaration ends. + ''' + Public ReadOnly Property EndType() As BlockType + Get + Return _EndType + End Get + End Property + + ''' + ''' The location of the end block argument. + ''' + Public ReadOnly Property EndArgumentLocation() As Location + Get + Return _EndArgumentLocation + End Get + End Property + + ''' + ''' Creates a new parse tree for an End block declaration. + ''' + ''' The type of the block the statement ends. + ''' The location of the end block argument. + ''' The location of the parse tree. + ''' The comments for the parse tree. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Declarations/ModifiedDeclaration.vb b/aspclassiccompiler/Parser/Trees/Declarations/ModifiedDeclaration.vb new file mode 100644 index 0000000..d6213c7 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Declarations/ModifiedDeclaration.vb @@ -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. +' + +''' +''' A parse tree for a declaration with modifiers. +''' +Public MustInherit Class ModifiedDeclaration + Inherits Declaration + + Private ReadOnly _Attributes As AttributeBlockCollection + Private ReadOnly _Modifiers As ModifierCollection + + ''' + ''' The attributes on the declaration. + ''' + Public ReadOnly Property Attributes() As AttributeBlockCollection + Get + Return _Attributes + End Get + End Property + + ''' + ''' The modifiers on the declaration. + ''' + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/AddressOfExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/AddressOfExpression.vb new file mode 100644 index 0000000..3500bd8 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/AddressOfExpression.vb @@ -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. +' + +''' +''' A parse tree for an AddressOf expression. +''' +Public NotInheritable Class AddressOfExpression + Inherits UnaryExpression + + ''' + ''' Constructs a new AddressOf expression parse tree. + ''' + ''' The operand of AddressOf. + ''' The location of the parse tree. + Public Sub New(ByVal operand As Expression, ByVal span As Span) + MyBase.New(TreeType.AddressOfExpression, operand, span) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/BinaryOperatorExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/BinaryOperatorExpression.vb new file mode 100644 index 0000000..214b59e --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/BinaryOperatorExpression.vb @@ -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. +' + +''' +''' A parse tree for a binary operator expression. +''' +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 + + ''' + ''' The left operand expression. + ''' + Public ReadOnly Property LeftOperand() As Expression + Get + Return _LeftOperand + End Get + End Property + + ''' + ''' The operator. + ''' + Public ReadOnly Property [Operator]() As OperatorType + Get + Return _Operator + End Get + End Property + + ''' + ''' The location of the operator. + ''' + Public ReadOnly Property OperatorLocation() As Location + Get + Return _OperatorLocation + End Get + End Property + + ''' + ''' The right operand expression. + ''' + Public ReadOnly Property RightOperand() As Expression + Get + Return _RightOperand + End Get + End Property + + ''' + ''' Constructs a new parse tree for a binary operation. + ''' + ''' The left operand expression. + ''' The operator. + ''' The location of the operator. + ''' The right operand expression. + ''' The location of the parse tree. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/BooleanLiteralExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/BooleanLiteralExpression.vb new file mode 100644 index 0000000..d310d30 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/BooleanLiteralExpression.vb @@ -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. +' + +''' +''' A parse tree for a Boolean literal expression. +''' +Public NotInheritable Class BooleanLiteralExpression + Inherits LiteralExpression + + Private ReadOnly _Literal As Boolean + + ''' + ''' The literal value. + ''' + 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 + + ''' + ''' Constructs a new parse tree for a Boolean literal expression. + ''' + ''' The literal value. + ''' The location of the parse tree. + Public Sub New(ByVal literal As Boolean, ByVal span As Span) + MyBase.New(TreeType.BooleanLiteralExpression, span) + _Literal = literal + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/CTypeExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/CTypeExpression.vb new file mode 100644 index 0000000..e397117 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/CTypeExpression.vb @@ -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. +' + +''' +''' A parse tree for a CType expression. +''' +Public NotInheritable Class CTypeExpression + Inherits CastTypeExpression + + ''' + ''' Constructs a new parse tree for a CType expression. + ''' + ''' The location of the '('. + ''' The expression to be converted. + ''' The location of the ','. + ''' The target type of the conversion. + ''' The location of the ')'. + ''' The location of the parse tree. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/CallOrIndexExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/CallOrIndexExpression.vb new file mode 100644 index 0000000..9b3a4a4 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/CallOrIndexExpression.vb @@ -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. +' + +''' +''' A parse tree for a call or index expression. +''' +Public NotInheritable Class CallOrIndexExpression + Inherits Expression + + Private ReadOnly _TargetExpression As Expression + Private ReadOnly _Arguments As ArgumentCollection + + ''' + ''' The target of the call or index. + ''' + Public ReadOnly Property TargetExpression() As Expression + Get + Return _TargetExpression + End Get + End Property + + ''' + ''' The arguments to the call or index. + ''' + Public ReadOnly Property Arguments() As ArgumentCollection + Get + Return _Arguments + End Get + End Property + + ''' + ''' Constructs a new parse tree for a call or index expression. + ''' + ''' The target of the call or index. + ''' The arguments to the call or index. + ''' The location of the parse tree. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/CastTypeExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/CastTypeExpression.vb new file mode 100644 index 0000000..4f28c7e --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/CastTypeExpression.vb @@ -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. +' + +''' +''' A parse tree for a CType or DirectCast expression. +''' +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 + + ''' + ''' The location of the '('. + ''' + Public ReadOnly Property LeftParenthesisLocation() As Location + Get + Return _LeftParenthesisLocation + End Get + End Property + + ''' + ''' The location of the ','. + ''' + Public ReadOnly Property CommaLocation() As Location + Get + Return _CommaLocation + End Get + End Property + + ''' + ''' The target type for the operand. + ''' + Public ReadOnly Property Target() As TypeName + Get + Return _Target + End Get + End Property + + ''' + ''' The location of the ')'. + ''' + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/CharacterLiteralExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/CharacterLiteralExpression.vb new file mode 100644 index 0000000..0d0da07 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/CharacterLiteralExpression.vb @@ -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. +' + +''' +''' A parse tree for a character literal expression. +''' +Public NotInheritable Class CharacterLiteralExpression + Inherits LiteralExpression + + Private ReadOnly _Literal As Char + + ''' + ''' The literal value. + ''' + 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 + + ''' + ''' Constructs a new parse tree for a character literal expression. + ''' + ''' The literal value. + ''' The location of the parse tree. + Public Sub New(ByVal literal As Char, ByVal span As Span) + MyBase.New(TreeType.CharacterLiteralExpression, span) + _Literal = literal + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/DateLiteralExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/DateLiteralExpression.vb new file mode 100644 index 0000000..7d4cb12 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/DateLiteralExpression.vb @@ -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. +' + +''' +''' A parse tree for a date literal expression. +''' +Public NotInheritable Class DateLiteralExpression + Inherits LiteralExpression + + Private ReadOnly _Literal As Date + + ''' + ''' The literal value. + ''' + 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 + + ''' + ''' Constructs a new parse tree for a date literal. + ''' + ''' The literal value. + ''' The location of the parse tree. + Public Sub New(ByVal literal As Date, ByVal span As Span) + MyBase.New(TreeType.DateLiteralExpression, span) + _Literal = literal + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/DecimalLiteralExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/DecimalLiteralExpression.vb new file mode 100644 index 0000000..79a7ae8 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/DecimalLiteralExpression.vb @@ -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. +' + +''' +''' A parse tree for a decimal literal expression. +''' +Public NotInheritable Class DecimalLiteralExpression + Inherits LiteralExpression + + Private ReadOnly _Literal As Decimal + Private ReadOnly _TypeCharacter As TypeCharacter + + ''' + ''' The literal value. + ''' + 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 + + ''' + ''' The type character on the literal value. + ''' + Public ReadOnly Property TypeCharacter() As TypeCharacter + Get + Return _TypeCharacter + End Get + End Property + + ''' + ''' Constructs a new parse tree for a floating point literal. + ''' + ''' The literal value. + ''' The type character on the literal value. + ''' The location of the parse tree. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/DictionaryLookupExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/DictionaryLookupExpression.vb new file mode 100644 index 0000000..2b09c60 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/DictionaryLookupExpression.vb @@ -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. +' + +''' +''' A parse tree for a dictionary lookup expression. +''' +Public NotInheritable Class DictionaryLookupExpression + Inherits Expression + + Private ReadOnly _Qualifier As Expression + Private ReadOnly _BangLocation As Location + Private ReadOnly _Name As SimpleName + + ''' + ''' The dictionary expression. + ''' + Public ReadOnly Property Qualifier() As Expression + Get + Return _Qualifier + End Get + End Property + + ''' + ''' The location of the '!'. + ''' + Public ReadOnly Property BangLocation() As Location + Get + Return _BangLocation + End Get + End Property + + ''' + ''' The name to look up. + ''' + Public ReadOnly Property Name() As SimpleName + Get + Return _Name + End Get + End Property + + ''' + ''' Constructs a new parse tree for a dictionary lookup expression. + ''' + ''' The dictionary expression. + ''' The location of the '!'. + ''' The name to look up.. + ''' The location of the parse tree. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/DirectCastExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/DirectCastExpression.vb new file mode 100644 index 0000000..f73f1a0 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/DirectCastExpression.vb @@ -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. +' + +''' +''' A parse tree for a DirectCast expression. +''' +Public NotInheritable Class DirectCastExpression + Inherits CastTypeExpression + + ''' + ''' Constructs a new parse tree for a DirectCast expression. + ''' + ''' The location of the '('. + ''' The expression to be converted. + ''' The location of the ','. + ''' The target type of the conversion. + ''' The location of the ')'. + ''' The location of the parse tree. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/Expression.vb b/aspclassiccompiler/Parser/Trees/Expressions/Expression.vb new file mode 100644 index 0000000..ccee8b7 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/Expression.vb @@ -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. +' + +''' +''' A parse tree for an expression. +''' +Public Class Expression + Inherits Tree + + ''' + ''' Creates a bad expression. + ''' + ''' The location of the parse tree. + ''' A bad expression. + Public Shared Function GetBadExpression(ByVal span As Span) As Expression + Return New Expression(span) + End Function + + ''' + ''' Whether the expression is constant or not. + ''' + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/ExpressionCollection.vb b/aspclassiccompiler/Parser/Trees/Expressions/ExpressionCollection.vb new file mode 100644 index 0000000..1543e7e --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/ExpressionCollection.vb @@ -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. +' + +''' +''' A read-only collection of expressions. +''' +Public NotInheritable Class ExpressionCollection + Inherits CommaDelimitedTreeCollection(Of Expression) + + ''' + ''' Constructs a new collection of expressions. + ''' + ''' The expressions in the collection. + ''' The locations of the commas in the collection. + ''' The location of the parse tree. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/FloatingPointLiteralExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/FloatingPointLiteralExpression.vb new file mode 100644 index 0000000..6899006 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/FloatingPointLiteralExpression.vb @@ -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. +' + +''' +''' A parse tree for a floating point literal. +''' +Public NotInheritable Class FloatingPointLiteralExpression + Inherits LiteralExpression + + Private ReadOnly _Literal As Double + Private ReadOnly _TypeCharacter As TypeCharacter + + ''' + ''' The literal value. + ''' + 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 + + ''' + ''' The type character on the literal value. + ''' + Public ReadOnly Property TypeCharacter() As TypeCharacter + Get + Return _TypeCharacter + End Get + End Property + + ''' + ''' Constructs a new parse tree for a floating point literal. + ''' + ''' The literal value. + ''' The type character on the literal. + ''' The location of the parse tree. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/GenericQualifiedExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/GenericQualifiedExpression.vb new file mode 100644 index 0000000..ae229ea --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/GenericQualifiedExpression.vb @@ -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. +' + +''' +''' A parse tree for a qualified name expression. +''' +Public NotInheritable Class GenericQualifiedExpression + Inherits Expression + + Private ReadOnly _Base As Expression + Private ReadOnly _TypeArguments As TypeArgumentCollection + + ''' + ''' The base expression. + ''' + Public ReadOnly Property Base() As Expression + Get + Return _Base + End Get + End Property + + ''' + ''' The qualifying type arguments. + ''' + Public ReadOnly Property TypeArguments() As TypeArgumentCollection + Get + Return _TypeArguments + End Get + End Property + + ''' + ''' Constructs a new parse tree for a generic qualified expression. + ''' + ''' The base expression. + ''' The qualifying type arguments. + ''' The location of the parse tree. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/GetTypeExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/GetTypeExpression.vb new file mode 100644 index 0000000..3ca374d --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/GetTypeExpression.vb @@ -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. +' + +''' +''' A parse tree for a GetType expression. +''' +Public NotInheritable Class GetTypeExpression + Inherits Expression + + Private ReadOnly _LeftParenthesisLocation As Location + Private ReadOnly _Target As TypeName + Private ReadOnly _RightParenthesisLocation As Location + + ''' + ''' The location of the '('. + ''' + Public ReadOnly Property LeftParenthesisLocation() As Location + Get + Return _LeftParenthesisLocation + End Get + End Property + + ''' + ''' The target type of the GetType expression. + ''' + Public ReadOnly Property Target() As TypeName + Get + Return _Target + End Get + End Property + + ''' + ''' The location of the ')'. + ''' + Public ReadOnly Property RightParenthesisLocation() As Location + Get + Return _RightParenthesisLocation + End Get + End Property + + ''' + ''' Constructs a new parse tree for a GetType expression. + ''' + ''' The location of the '('. + ''' The target type of the GetType expression. + ''' The location of the ')'. + ''' The location of the parse tree. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/GlobalExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/GlobalExpression.vb new file mode 100644 index 0000000..76994bc --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/GlobalExpression.vb @@ -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. +' + +''' +''' A parse tree for Nothing. +''' +Public NotInheritable Class GlobalExpression + Inherits Expression + + ''' + ''' Constructs a new parse tree for Global. + ''' + ''' The location of the parse tree. + Public Sub New(ByVal span As Span) + MyBase.New(TreeType.GlobalExpression, span) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/InstanceExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/InstanceExpression.vb new file mode 100644 index 0000000..32f36d3 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/InstanceExpression.vb @@ -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. +' + +''' +''' A parse tree for Me, MyBase or MyClass. +''' +Public NotInheritable Class InstanceExpression + Inherits Expression + + Private _InstanceType As InstanceType + + ''' + ''' The type of the instance expression. + ''' + Public ReadOnly Property InstanceType() As InstanceType + Get + Return _InstanceType + End Get + End Property + + ''' + ''' Constructs a new parse tree for My, MyBase or MyClass. + ''' + ''' The type of the instance expression. + ''' The location of the parse tree. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/InstanceType.vb b/aspclassiccompiler/Parser/Trees/Expressions/InstanceType.vb new file mode 100644 index 0000000..275ada4 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/InstanceType.vb @@ -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. +' + +''' +''' The type of an instance expression. +''' +Public Enum InstanceType + [Me] + [MyClass] + [MyBase] +End Enum diff --git a/aspclassiccompiler/Parser/Trees/Expressions/IntegerLiteralExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/IntegerLiteralExpression.vb new file mode 100644 index 0000000..39bab04 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/IntegerLiteralExpression.vb @@ -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. +' + +''' +''' A parse tree for an integer literal. +''' +Public NotInheritable Class IntegerLiteralExpression + Inherits LiteralExpression + + Private ReadOnly _Literal As Integer + Private ReadOnly _TypeCharacter As TypeCharacter + Private ReadOnly _IntegerBase As IntegerBase + + ''' + ''' The literal value. + ''' + 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 + + ''' + ''' The type character on the literal. + ''' + Public ReadOnly Property TypeCharacter() As TypeCharacter + Get + Return _TypeCharacter + End Get + End Property + + ''' + ''' The integer base of the literal. + ''' + Public ReadOnly Property IntegerBase() As IntegerBase + Get + Return _IntegerBase + End Get + End Property + + ''' + ''' Constructs a new parse tree for an integer literal. + ''' + ''' The literal value. + ''' The integer base of the literal. + ''' The type character on the literal. + ''' The location of the parse tree. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/IntrinsicCastExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/IntrinsicCastExpression.vb new file mode 100644 index 0000000..68c3c46 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/IntrinsicCastExpression.vb @@ -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. +' + +''' +''' A parse tree for an intrinsic conversion expression. +''' +Public NotInheritable Class IntrinsicCastExpression + Inherits UnaryExpression + + Private ReadOnly _IntrinsicType As IntrinsicType + Private ReadOnly _LeftParenthesisLocation As Location + Private ReadOnly _RightParenthesisLocation As Location + + ''' + ''' The intrinsic type conversion. + ''' + Public ReadOnly Property IntrinsicType() As IntrinsicType + Get + Return _IntrinsicType + End Get + End Property + + ''' + ''' The location of the '('. + ''' + Public ReadOnly Property LeftParenthesisLocation() As Location + Get + Return _LeftParenthesisLocation + End Get + End Property + + ''' + ''' The location of the ')'. + ''' + Public ReadOnly Property RightParenthesisLocation() As Location + Get + Return _RightParenthesisLocation + End Get + End Property + + ''' + ''' Constructs a new parse tree for an intrinsic conversion expression. + ''' + ''' The intrinsic type conversion. + ''' The location of the '('. + ''' The expression to convert. + ''' The location of the ')'. + ''' The location of the parse tree. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/LiteralExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/LiteralExpression.vb new file mode 100644 index 0000000..a897901 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/LiteralExpression.vb @@ -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. +' + +''' +''' A parse tree for a literal expression. +''' +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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/NewAggregateExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/NewAggregateExpression.vb new file mode 100644 index 0000000..3ee2d14 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/NewAggregateExpression.vb @@ -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. +' + +''' +''' A parse tree for a New array expression. +''' +Public NotInheritable Class NewAggregateExpression + Inherits Expression + + Private ReadOnly _Target As ArrayTypeName + Private ReadOnly _Initializer As AggregateInitializer + + ''' + ''' The target array type to create. + ''' + Public ReadOnly Property Target() As ArrayTypeName + Get + Return _Target + End Get + End Property + + ''' + ''' The initializer for the array. + ''' + Public ReadOnly Property Initializer() As AggregateInitializer + Get + Return _Initializer + End Get + End Property + + ''' + ''' The constructor for a New array expression parse tree. + ''' + ''' The target array type to create. + ''' The initializer for the array. + ''' The location of the parse tree. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/NewExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/NewExpression.vb new file mode 100644 index 0000000..d57f0d5 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/NewExpression.vb @@ -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. +' + +''' +''' A parse tree for a New expression. +''' +Public NotInheritable Class NewExpression + Inherits Expression + + Private ReadOnly _Target As TypeName + Private ReadOnly _Arguments As ArgumentCollection + + ''' + ''' The target type to create. + ''' + Public ReadOnly Property Target() As TypeName + Get + Return _Target + End Get + End Property + + ''' + ''' The arguments to the constructor. + ''' + Public ReadOnly Property Arguments() As ArgumentCollection + Get + Return _Arguments + End Get + End Property + + ''' + ''' Constructs a new parse tree for a New expression. + ''' + ''' The target type to create. + ''' The arguments to the constructor. + ''' The location of the parse tree. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/NothingExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/NothingExpression.vb new file mode 100644 index 0000000..3001078 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/NothingExpression.vb @@ -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. +' + +''' +''' A parse tree for Nothing. +''' +Public NotInheritable Class NothingExpression + Inherits Expression + + Public Overrides ReadOnly Property IsConstant() As Boolean + Get + Return True + End Get + End Property + + ''' + ''' Constructs a new parse tree for Nothing. + ''' + ''' The location of the parse tree. + Public Sub New(ByVal span As Span) + MyBase.New(TreeType.NothingExpression, span) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/OperatorType.vb b/aspclassiccompiler/Parser/Trees/Expressions/OperatorType.vb new file mode 100644 index 0000000..7b31305 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/OperatorType.vb @@ -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. +' + +''' +''' The type of a unary operator expression. +''' +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 diff --git a/aspclassiccompiler/Parser/Trees/Expressions/ParentheticalExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/ParentheticalExpression.vb new file mode 100644 index 0000000..bda13a9 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/ParentheticalExpression.vb @@ -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. +' + +''' +''' A parse tree for a parenthesized expression. +''' +Public NotInheritable Class ParentheticalExpression + Inherits UnaryExpression + + Private ReadOnly _RightParenthesisLocation As Location + + ''' + ''' The location of the ')'. + ''' + Public ReadOnly Property RightParenthesisLocation() As Location + Get + Return _RightParenthesisLocation + End Get + End Property + + ''' + ''' Constructs a new parenthesized expression parse tree. + ''' + ''' The operand of the expression. + ''' The location of the ')'. + ''' The location of the parse tree. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/QualifiedExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/QualifiedExpression.vb new file mode 100644 index 0000000..a821588 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/QualifiedExpression.vb @@ -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. +' + +''' +''' A parse tree for a qualified name expression. +''' +Public NotInheritable Class QualifiedExpression + Inherits Expression + + Private ReadOnly _Qualifier As Expression + Private ReadOnly _DotLocation As Location + Private ReadOnly _Name As SimpleName + + ''' + ''' The expression qualifying the name. + ''' + Public ReadOnly Property Qualifier() As Expression + Get + Return _Qualifier + End Get + End Property + + ''' + ''' The location of the '.'. + ''' + Public ReadOnly Property DotLocation() As Location + Get + Return _DotLocation + End Get + End Property + + ''' + ''' The qualified name. + ''' + Public ReadOnly Property Name() As SimpleName + Get + Return _Name + End Get + End Property + + ''' + ''' Constructs a new parse tree for a qualified name expression. + ''' + ''' The expression qualifying the name. + ''' The location of the '.'. + ''' The qualified name. + ''' The location of the parse tree. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/SimpleNameExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/SimpleNameExpression.vb new file mode 100644 index 0000000..c5781c7 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/SimpleNameExpression.vb @@ -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. +' + +''' +''' A parse tree for a simple name expression. +''' +Public NotInheritable Class SimpleNameExpression + Inherits Expression + + Private ReadOnly _Name As SimpleName + + ''' + ''' The name. + ''' + Public ReadOnly Property Name() As SimpleName + Get + Return _Name + End Get + End Property + + ''' + ''' Constructs a new parse tree for a simple name expression. + ''' + ''' The name. + ''' The location of the parse tree. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/StringLiteralExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/StringLiteralExpression.vb new file mode 100644 index 0000000..8642635 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/StringLiteralExpression.vb @@ -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. +' + +''' +''' A parse tree for a string literal expression. +''' +Public NotInheritable Class StringLiteralExpression + Inherits LiteralExpression + + Private ReadOnly _Literal As String + + ''' + ''' The literal value. + ''' + 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 + + ''' + ''' Constructs a new string literal expression parse tree. + ''' + ''' The literal value. + ''' The location of the parse tree. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/TryCastExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/TryCastExpression.vb new file mode 100644 index 0000000..05589cc --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/TryCastExpression.vb @@ -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. +' + +''' +''' A parse tree for a CType expression. +''' +Public NotInheritable Class TryCastExpression + Inherits CastTypeExpression + + ''' + ''' Constructs a new parse tree for a TryCast expression. + ''' + ''' The location of the '('. + ''' The expression to be converted. + ''' The location of the ','. + ''' The target type of the conversion. + ''' The location of the ')'. + ''' The location of the parse tree. + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/TypeOfExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/TypeOfExpression.vb new file mode 100644 index 0000000..34bf4b7 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/TypeOfExpression.vb @@ -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. +' + +''' +''' A parse tree for a TypeOf ... Is expression. +''' +Public NotInheritable Class TypeOfExpression + Inherits UnaryExpression + + Private ReadOnly _IsLocation As Location + Private ReadOnly _Target As TypeName + + ''' + ''' The location of the 'Is'. + ''' + Public ReadOnly Property IsLocation() As Location + Get + Return _IsLocation + End Get + End Property + + ''' + ''' The target type for the operand. + ''' + Public ReadOnly Property Target() As TypeName + Get + Return _Target + End Get + End Property + + ''' + ''' Constructs a new parse tree for a TypeOf ... Is expression. + ''' + ''' The target value. + ''' The location of the 'Is'. + ''' The target type to check against. + ''' The location of the parse tree. + Public Sub New(ByVal operand As Expression, ByVal isLocation As Location, ByVal target As TypeName, ByVal span As Span) + MyBase.New(TreeType.TypeOfExpression, operand, span) + + If target Is Nothing Then + Throw New ArgumentNullException("target") + End If + + SetParent(target) + + _Target = target + _IsLocation = isLocation + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + MyBase.GetChildTrees(childList) + AddChild(childList, Target) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/TypeReferenceExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/TypeReferenceExpression.vb new file mode 100644 index 0000000..c435e8a --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/TypeReferenceExpression.vb @@ -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. +' + +''' +''' A parse tree for an expression that refers to a type. +''' +Public NotInheritable Class TypeReferenceExpression + Inherits Expression + + Private ReadOnly _TypeName As TypeName + + ''' + ''' The name of the type being referred to. + ''' + Public ReadOnly Property TypeName() As TypeName + Get + Return _TypeName + End Get + End Property + + ''' + ''' Constructs a new parse tree for a type reference. + ''' + ''' The name of the type being referred to. + ''' The location of the parse tree. + Public Sub New(ByVal typeName As TypeName, ByVal span As Span) + MyBase.New(TreeType.TypeReferenceExpression, span) + + If typeName Is Nothing Then + Throw New ArgumentNullException("typeName") + End If + + SetParent(typeName) + _TypeName = typeName + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, TypeName) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/UnaryExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/UnaryExpression.vb new file mode 100644 index 0000000..42bb8ab --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/UnaryExpression.vb @@ -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. +' + +''' +''' A parse tree for an expression that has an operand. +''' +Public MustInherit Class UnaryExpression + Inherits Expression + + Private ReadOnly _Operand As Expression + + ''' + ''' The operand of the expression. + ''' + Public ReadOnly Property Operand() As Expression + Get + Return _Operand + End Get + End Property + + Protected Sub New(ByVal type As TreeType, ByVal operand As Expression, ByVal span As Span) + MyBase.New(type, span) + + Debug.Assert(type = TreeType.ParentheticalExpression OrElse _ + type = TreeType.TypeOfExpression OrElse _ + (type = TreeType.CTypeExpression OrElse type = TreeType.DirectCastExpression OrElse type = TreeType.TryCastExpression) OrElse _ + type = TreeType.IntrinsicCastExpression OrElse _ + (type >= TreeType.UnaryOperatorExpression AndAlso type <= TreeType.AddressOfExpression)) + + If operand Is Nothing Then + Throw New ArgumentNullException("operand") + End If + + SetParent(operand) + _Operand = operand + End Sub + + Public Overrides ReadOnly Property IsConstant() As Boolean + Get + Return Operand.IsConstant + End Get + End Property + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, Operand) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Expressions/UnaryOperatorExpression.vb b/aspclassiccompiler/Parser/Trees/Expressions/UnaryOperatorExpression.vb new file mode 100644 index 0000000..9c3760d --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Expressions/UnaryOperatorExpression.vb @@ -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. +' + +''' +''' A parse tree for an unary operator expression. +''' +Public NotInheritable Class UnaryOperatorExpression + Inherits UnaryExpression + + Private _Operator As OperatorType + + ''' + ''' The operator. + ''' + Public ReadOnly Property [Operator]() As OperatorType + Get + Return _Operator + End Get + End Property + + ''' + ''' Constructs a new unary operator expression parse tree. + ''' + ''' The type of the unary operator. + ''' The operand of the operator. + ''' The location of the parse tree. + Public Sub New(ByVal [operator] As OperatorType, ByVal operand As Expression, ByVal span As Span) + MyBase.New(TreeType.UnaryOperatorExpression, operand, span) + + If [operator] < OperatorType.UnaryPlus OrElse [operator] > OperatorType.Not Then + Throw New ArgumentOutOfRangeException("operator") + End If + + _Operator = [operator] + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Files/File.vb b/aspclassiccompiler/Parser/Trees/Files/File.vb new file mode 100644 index 0000000..5e6c57e --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Files/File.vb @@ -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. +' + +''' +''' A parse tree for an entire file. +''' +Public NotInheritable Class File + Inherits Tree + + Private ReadOnly _Declarations As DeclarationCollection + + ''' + ''' The declarations in the file. + ''' + Public ReadOnly Property Declarations() As DeclarationCollection + Get + Return _Declarations + End Get + End Property + + ''' + ''' Constructs a new file parse tree. + ''' + ''' The declarations in the file. + ''' The location of the tree. + Public Sub New(ByVal declarations As DeclarationCollection, ByVal span As Span) + MyBase.New(TreeType.File, span) + + SetParent(declarations) + + _Declarations = declarations + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, Declarations) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Files/ImportsDeclaration.vb b/aspclassiccompiler/Parser/Trees/Files/ImportsDeclaration.vb new file mode 100644 index 0000000..2d0e4b1 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Files/ImportsDeclaration.vb @@ -0,0 +1,51 @@ +' +' 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. +' + +''' +''' A parse tree for an Imports declaration. +''' +Public NotInheritable Class ImportsDeclaration + Inherits Declaration + + Private ReadOnly _ImportMembers As ImportCollection + + ''' + ''' The members imported. + ''' + Public ReadOnly Property ImportMembers() As ImportCollection + Get + Return _ImportMembers + End Get + End Property + + ''' + ''' Constructs a parse tree for an Imports declaration. + ''' + ''' The members imported. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal importMembers As ImportCollection, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.ImportsDeclaration, span, comments) + + If importMembers Is Nothing Then + Throw New ArgumentNullException("importMembers") + End If + + SetParent(importMembers) + + _ImportMembers = importMembers + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + MyBase.GetChildTrees(childList) + + AddChild(childList, ImportMembers) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Files/NamespaceDeclaration.vb b/aspclassiccompiler/Parser/Trees/Files/NamespaceDeclaration.vb new file mode 100644 index 0000000..b0a8b4e --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Files/NamespaceDeclaration.vb @@ -0,0 +1,93 @@ +' +' 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. +' + +''' +''' A parse tree for a namespace declaration. +''' +Public NotInheritable Class NamespaceDeclaration + Inherits ModifiedDeclaration + + Private ReadOnly _NamespaceLocation As Location + Private ReadOnly _Name As Name + Private ReadOnly _Declarations As DeclarationCollection + Private ReadOnly _EndDeclaration As EndBlockDeclaration + + ''' + ''' The location of 'Namespace'. + ''' + Public ReadOnly Property NamespaceLocation() As Location + Get + Return _NamespaceLocation + End Get + End Property + + ''' + ''' The name of the namespace. + ''' + Public ReadOnly Property Name() As Name + Get + Return _Name + End Get + End Property + + ''' + ''' The declarations in the namespace. + ''' + Public ReadOnly Property Declarations() As DeclarationCollection + Get + Return _Declarations + End Get + End Property + + ''' + ''' The End Namespace declaration, if any. + ''' + Public ReadOnly Property EndDeclaration() As EndBlockDeclaration + Get + Return _EndDeclaration + End Get + End Property + + ''' + ''' Constructs a parse tree for a namespace declaration. + ''' + ''' The attributes on the declaration. + ''' The modifiers on the declaration. + ''' The location of 'Namespace'. + ''' The name of the namespace. + ''' The declarations in the namespace. + ''' The End Namespace statement, if any. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection, ByVal namespaceLocation As Location, ByVal name As Name, ByVal declarations As DeclarationCollection, ByVal endDeclaration As EndBlockDeclaration, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.NamespaceDeclaration, attributes, modifiers, span, comments) + + If name Is Nothing Then + Throw New ArgumentNullException("name") + End If + + SetParent(name) + SetParent(declarations) + SetParent(endDeclaration) + + _NamespaceLocation = namespaceLocation + _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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Files/OptionDeclaration.vb b/aspclassiccompiler/Parser/Trees/Files/OptionDeclaration.vb new file mode 100644 index 0000000..3fdc2b6 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Files/OptionDeclaration.vb @@ -0,0 +1,67 @@ +' +' 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. +' + +''' +''' A parse tree for an Option declaration. +''' +Public NotInheritable Class OptionDeclaration + Inherits Declaration + + Private ReadOnly _OptionType As OptionType + Private ReadOnly _OptionTypeLocation As Location + Private ReadOnly _OptionArgumentLocation As Location + + ''' + ''' The type of Option statement. + ''' + Public ReadOnly Property OptionType() As OptionType + Get + Return _OptionType + End Get + End Property + + ''' + ''' The location of the Option type (e.g. "Strict"), if any. + ''' + Public ReadOnly Property OptionTypeLocation() As Location + Get + Return _OptionTypeLocation + End Get + End Property + + ''' + ''' The location of the Option argument (e.g. "On"), if any. + ''' + Public ReadOnly Property OptionArgumentLocation() As Location + Get + Return _OptionArgumentLocation + End Get + End Property + + ''' + ''' Constructs a new parse tree for an Option declaration. + ''' + ''' The type of the Option declaration. + ''' The location of the Option type, if any. + ''' The location of the Option argument, if any. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal optionType As OptionType, ByVal optionTypeLocation As Location, ByVal optionArgumentLocation As Location, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.OptionDeclaration, span, comments) + + If optionType < optionType.SyntaxError OrElse optionType > optionType.CompareText Then + Throw New ArgumentOutOfRangeException("optionType") + End If + + _OptionType = optionType + _OptionTypeLocation = optionTypeLocation + _OptionArgumentLocation = optionArgumentLocation + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Files/OptionType.vb b/aspclassiccompiler/Parser/Trees/Files/OptionType.vb new file mode 100644 index 0000000..8b94ee6 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Files/OptionType.vb @@ -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. +' + +''' +''' The type of an Option declaration. +''' +Public Enum OptionType + SyntaxError + Explicit + ExplicitOn + ExplicitOff + Strict + StrictOn + StrictOff + CompareBinary + CompareText +End Enum diff --git a/aspclassiccompiler/Parser/Trees/Files/ScriptBlock.vb b/aspclassiccompiler/Parser/Trees/Files/ScriptBlock.vb new file mode 100644 index 0000000..1300b81 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Files/ScriptBlock.vb @@ -0,0 +1,32 @@ +'LC Represent a script file +Public Class ScriptBlock + Inherits Tree + + Private ReadOnly _statements As StatementCollection + + ''' + ''' The declarations in the file. + ''' + Public ReadOnly Property Statements() As StatementCollection + Get + Return _statements + End Get + End Property + + ''' + ''' Constructs a new file parse tree. + ''' + ''' The statements in the file. + ''' The location of the tree. + Public Sub New(ByVal statements As StatementCollection, ByVal span As Span) + MyBase.New(TreeType.ScriptBlock, span) + + SetParent(statements) + + _statements = statements + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, _statements) + End Sub +End Class diff --git a/aspclassiccompiler/Parser/Trees/Imports/AliasImport.vb b/aspclassiccompiler/Parser/Trees/Imports/AliasImport.vb new file mode 100644 index 0000000..164fd64 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Imports/AliasImport.vb @@ -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. +' + +''' +''' A parse tree for an Imports statement that aliases a type or namespace. +''' +Public NotInheritable Class AliasImport + Inherits Import + + Private ReadOnly _Name As SimpleName + Private ReadOnly _EqualsLocation As Location + Private ReadOnly _AliasedTypeName As TypeName + + ''' + ''' The alias name. + ''' + Public ReadOnly Property Name() As SimpleName + Get + Return _Name + End Get + End Property + + ''' + ''' The location of the '='. + ''' + Public ReadOnly Property EqualsLocation() As Location + Get + Return _EqualsLocation + End Get + End Property + + ''' + ''' The name being aliased. + ''' + Public ReadOnly Property AliasedTypeName() As TypeName + Get + Return _AliasedTypeName + End Get + End Property + + ''' + ''' Constructs a new aliased import parse tree. + ''' + ''' The name of the alias. + ''' The location of the '='. + ''' The name being aliased. + ''' The location of the parse tree. + Public Sub New(ByVal name As SimpleName, ByVal equalsLocation As Location, ByVal aliasedTypeName As TypeName, ByVal span As Span) + MyBase.New(TreeType.AliasImport, span) + + If aliasedTypeName Is Nothing Then + Throw New ArgumentNullException("aliasedTypeName") + End If + + If name Is Nothing Then + Throw New ArgumentNullException("name") + End If + + SetParent(name) + SetParent(aliasedTypeName) + + _Name = name + _EqualsLocation = equalsLocation + _AliasedTypeName = aliasedTypeName + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + MyBase.GetChildTrees(childList) + + AddChild(childList, AliasedTypeName) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Imports/Import.vb b/aspclassiccompiler/Parser/Trees/Imports/Import.vb new file mode 100644 index 0000000..a9d10d6 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Imports/Import.vb @@ -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. +' + +''' +''' A parse tree for an Imports statement. +''' +Public MustInherit Class Import + Inherits Tree + + Protected Sub New(ByVal type As TreeType, ByVal span As Span) + MyBase.New(type, span) + + Debug.Assert(type = TreeType.AliasImport OrElse type = TreeType.NameImport) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Imports/ImportCollection.vb b/aspclassiccompiler/Parser/Trees/Imports/ImportCollection.vb new file mode 100644 index 0000000..ac2dca7 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Imports/ImportCollection.vb @@ -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. +' + +''' +''' A read-only collection of imports. +''' +Public NotInheritable Class ImportCollection + Inherits CommaDelimitedTreeCollection(Of Import) + + ''' + ''' Constructs a collection of imports. + ''' + ''' The imports in the collection. + ''' The location of the commas. + ''' The location of the parse tree. + Public Sub New(ByVal importMembers As IList(Of Import), ByVal commaLocations As IList(Of Location), ByVal span As Span) + MyBase.New(TreeType.ImportCollection, importMembers, commaLocations, span) + + If importMembers Is Nothing OrElse importMembers.Count = 0 Then + Throw New ArgumentException("ImportCollection cannot be empty.") + End If + End Sub +End Class + diff --git a/aspclassiccompiler/Parser/Trees/Imports/NameImport.vb b/aspclassiccompiler/Parser/Trees/Imports/NameImport.vb new file mode 100644 index 0000000..0a0c79d --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Imports/NameImport.vb @@ -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. +' + +''' +''' A parse tree for an Imports statement for a name. +''' +Public NotInheritable Class NameImport + Inherits Import + + Private ReadOnly _TypeName As TypeName + + ''' + ''' The imported name. + ''' + Public ReadOnly Property TypeName() As TypeName + Get + Return _TypeName + End Get + End Property + + ''' + ''' Constructs a new name import parse tree. + ''' + ''' The name to import. + ''' The location of the parse tree. + Public Sub New(ByVal typeName As TypeName, ByVal span As Span) + MyBase.New(TreeType.NameImport, span) + + If typeName Is Nothing Then + Throw New ArgumentNullException("typeName") + End If + + SetParent(typeName) + + _TypeName = typeName + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, TypeName) + End Sub +End Class diff --git a/aspclassiccompiler/Parser/Trees/Initializers/AggregateInitializer.vb b/aspclassiccompiler/Parser/Trees/Initializers/AggregateInitializer.vb new file mode 100644 index 0000000..a3c8afe --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Initializers/AggregateInitializer.vb @@ -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. +' + +''' +''' A parse tree for an aggregate initializer. +''' +Public NotInheritable Class AggregateInitializer + Inherits Initializer + + Private ReadOnly _Elements As InitializerCollection + + ''' + ''' The elements of the aggregate initializer. + ''' + Public ReadOnly Property Elements() As InitializerCollection + Get + Return _Elements + End Get + End Property + + ''' + ''' Constructs a new aggregate initializer parse tree. + ''' + ''' The elements of the aggregate initializer. + ''' The location of the parse tree. + Public Sub New(ByVal elements As InitializerCollection, ByVal span As Span) + MyBase.New(TreeType.AggregateInitializer, span) + + If elements Is Nothing Then + Throw New ArgumentNullException("elements") + End If + + SetParent(elements) + _Elements = elements + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, Elements) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Initializers/ExpressionInitializer.vb b/aspclassiccompiler/Parser/Trees/Initializers/ExpressionInitializer.vb new file mode 100644 index 0000000..e97f69e --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Initializers/ExpressionInitializer.vb @@ -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. +' + +''' +''' A parse tree for an expression initializer. +''' +Public NotInheritable Class ExpressionInitializer + Inherits Initializer + + Private ReadOnly _Expression As Expression + + ''' + ''' The expression. + ''' + Public ReadOnly Property Expression() As Expression + Get + Return _Expression + End Get + End Property + + ''' + ''' Constructs a new expression initializer parse tree. + ''' + ''' The expression. + ''' The location of the parse tree. + Public Sub New(ByVal expression As Expression, ByVal span As Span) + MyBase.New(TreeType.ExpressionInitializer, span) + + If expression Is Nothing Then + Throw New ArgumentNullException("expression") + End If + + SetParent(expression) + + _Expression = expression + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, Expression) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Initializers/Initializer.vb b/aspclassiccompiler/Parser/Trees/Initializers/Initializer.vb new file mode 100644 index 0000000..4cc3d16 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Initializers/Initializer.vb @@ -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. +' + +''' +''' A parse tree for an initializer. +''' +Public MustInherit Class Initializer + Inherits Tree + + Protected Sub New(ByVal type As TreeType, ByVal span As Span) + MyBase.New(type, span) + + Debug.Assert(type = TreeType.ExpressionInitializer OrElse type = TreeType.AggregateInitializer) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Initializers/InitializerCollection.vb b/aspclassiccompiler/Parser/Trees/Initializers/InitializerCollection.vb new file mode 100644 index 0000000..edfce68 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Initializers/InitializerCollection.vb @@ -0,0 +1,38 @@ +' +' 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. +' + +''' +''' A read-only collection of initializers. +''' +Public NotInheritable Class InitializerCollection + Inherits CommaDelimitedTreeCollection(Of Initializer) + Private ReadOnly _RightCurlyBraceLocation As Location + + ''' + ''' The location of the '}'. + ''' + Public ReadOnly Property RightCurlyBraceLocation() As Location + Get + Return _RightCurlyBraceLocation + End Get + End Property + ''' + ''' Constructs a new initializer collection. + ''' + ''' The initializers in the collection. + ''' The locations of the commas in the collection. + ''' The location of the '}'. + ''' The location of the parse tree. + Public Sub New(ByVal initializers As IList(Of Initializer), ByVal commaLocations As IList(Of Location), ByVal rightCurlyBraceLocation As Location, ByVal span As Span) + MyBase.New(TreeType.InitializerCollection, initializers, commaLocations, span) + + _RightCurlyBraceLocation = rightCurlyBraceLocation + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/IntrinsicType.vb b/aspclassiccompiler/Parser/Trees/IntrinsicType.vb new file mode 100644 index 0000000..7c4cf0a --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/IntrinsicType.vb @@ -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. +' + +''' +''' The type of an intrinsic type name. +''' +Public Enum IntrinsicType + [Boolean] + [SByte] + [Byte] + [Short] + [UShort] + [Integer] + [UInteger] + [Long] + [ULong] + [Decimal] + [Single] + [Double] + [Date] + [Char] + [String] + [Object] +End Enum diff --git a/aspclassiccompiler/Parser/Trees/Members/AddHandlerAccessorDeclaration.vb b/aspclassiccompiler/Parser/Trees/Members/AddHandlerAccessorDeclaration.vb new file mode 100644 index 0000000..1474184 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Members/AddHandlerAccessorDeclaration.vb @@ -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. +' + +''' +''' A parse tree for a AddHandler property accessor. +''' +Public NotInheritable Class AddHandlerAccessorDeclaration + Inherits ModifiedDeclaration + + Private ReadOnly _AddHandlerLocation As Location + Private ReadOnly _Parameters As ParameterCollection + Private ReadOnly _Statements As StatementCollection + Private ReadOnly _EndStatement As EndBlockDeclaration + + ''' + ''' The location of the 'AddHandler'. + ''' + Public ReadOnly Property AddHandlerLocation() As Location + Get + Return _AddHandlerLocation + End Get + End Property + + ''' + ''' The accessor's parameters. + ''' + Public ReadOnly Property Parameters() As ParameterCollection + Get + Return _Parameters + End Get + End Property + + ''' + ''' The statements in the accessor. + ''' + Public ReadOnly Property Statements() As StatementCollection + Get + Return _Statements + End Get + End Property + + ''' + ''' The End declaration for the accessor. + ''' + Public ReadOnly Property EndStatement() As EndBlockDeclaration + Get + Return _EndStatement + End Get + End Property + + ''' + ''' Constructs a new parse tree for a property accessor. + ''' + ''' The attributes for the parse tree. + ''' The location of the 'AddHandler'. + ''' The parameters of the declaration. + ''' The statements in the declaration. + ''' The end block declaration, if any. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal addHandlerLocation As Location, ByVal parameters As ParameterCollection, ByVal statements As StatementCollection, ByVal endStatement As EndBlockDeclaration, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.AddHandlerAccessorDeclaration, attributes, Nothing, span, comments) + + SetParent(parameters) + SetParent(statements) + SetParent(endStatement) + + _Parameters = parameters + _AddHandlerLocation = addHandlerLocation + _Statements = statements + _EndStatement = endStatement + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + MyBase.GetChildTrees(childList) + + AddChild(childList, Parameters) + AddChild(childList, Statements) + AddChild(childList, EndStatement) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Members/Charset.vb b/aspclassiccompiler/Parser/Trees/Members/Charset.vb new file mode 100644 index 0000000..e6e124c --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Members/Charset.vb @@ -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. +' + +''' +''' The character set of a Declare statement. +''' +Public Enum Charset + Ansi + Unicode + Auto +End Enum \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Members/ConstructorDeclaration.vb b/aspclassiccompiler/Parser/Trees/Members/ConstructorDeclaration.vb new file mode 100644 index 0000000..356663c --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Members/ConstructorDeclaration.vb @@ -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. +' + +''' +''' A parse tree for a constructor declaration. +''' +Public NotInheritable Class ConstructorDeclaration + Inherits MethodDeclaration + + ''' + ''' Creates a new parse tree for a constructor declaration. + ''' + ''' The attributes for the parse tree. + ''' The modifiers for the parse tree. + ''' The location of the keyword. + ''' The name of the declaration. + ''' The parameters of the declaration. + ''' The statements in the declaration. + ''' The end block declaration, if any. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection, ByVal keywordLocation As Location, ByVal name As SimpleName, ByVal parameters As ParameterCollection, ByVal statements As StatementCollection, ByVal endDeclaration As EndBlockDeclaration, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.ConstructorDeclaration, attributes, modifiers, keywordLocation, name, Nothing, parameters, Nothing, Nothing, Nothing, Nothing, Nothing, statements, endDeclaration, span, comments) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Members/CustomEventDeclaration.vb b/aspclassiccompiler/Parser/Trees/Members/CustomEventDeclaration.vb new file mode 100644 index 0000000..9e93baa --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Members/CustomEventDeclaration.vb @@ -0,0 +1,92 @@ +' +' 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. +' + +''' +''' A parse tree for a custom event declaration. +''' +Public NotInheritable Class CustomEventDeclaration + Inherits SignatureDeclaration + + Private ReadOnly _CustomLocation As Location + Private ReadOnly _ImplementsList As NameCollection + Private ReadOnly _Accessors As DeclarationCollection + Private ReadOnly _EndDeclaration As EndBlockDeclaration + + ''' + ''' The location of the 'Custom' keyword. + ''' + Public ReadOnly Property CustomLocation() As Location + Get + Return _CustomLocation + End Get + End Property + + ''' + ''' The list of implemented members. + ''' + Public ReadOnly Property ImplementsList() As NameCollection + Get + Return _ImplementsList + End Get + End Property + + ''' + ''' The event accessors. + ''' + Public ReadOnly Property Accessors() As DeclarationCollection + Get + Return _Accessors + End Get + End Property + + ''' + ''' The End Event declaration, if any. + ''' + Public ReadOnly Property EndDeclaration() As EndBlockDeclaration + Get + Return _EndDeclaration + End Get + End Property + + ''' + ''' Constructs a new parse tree for a custom property declaration. + ''' + ''' The attributes on the declaration. + ''' The modifiers on the declaration. + ''' The location of the 'Custom' keyword. + ''' The location of the keyword. + ''' The name of the custom event. + ''' The location of the 'As', if any. + ''' The result type, if any. + ''' The implements list. + ''' The custom event accessors. + ''' The End Event declaration, if any. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection, ByVal customLocation As Location, ByVal keywordLocation As Location, ByVal name As SimpleName, ByVal asLocation As Location, ByVal resultType As TypeName, ByVal implementsList As NameCollection, ByVal accessors As DeclarationCollection, ByVal endDeclaration As EndBlockDeclaration, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.CustomEventDeclaration, attributes, modifiers, keywordLocation, name, Nothing, Nothing, asLocation, Nothing, resultType, span, comments) + + SetParent(accessors) + SetParent(endDeclaration) + SetParent(implementsList) + + _CustomLocation = customLocation + _ImplementsList = implementsList + _Accessors = accessors + _EndDeclaration = endDeclaration + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + MyBase.GetChildTrees(childList) + AddChild(childList, ImplementsList) + AddChild(childList, Accessors) + AddChild(childList, EndDeclaration) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Members/EnumValueDeclaration.vb b/aspclassiccompiler/Parser/Trees/Members/EnumValueDeclaration.vb new file mode 100644 index 0000000..23559d1 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Members/EnumValueDeclaration.vb @@ -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. +' + +''' +''' A parse tree for an enumerated value declaration. +''' +Public NotInheritable Class EnumValueDeclaration + Inherits ModifiedDeclaration + + Private ReadOnly _Name As Name + Private ReadOnly _EqualsLocation As Location + Private ReadOnly _Expression As Expression + + ''' + ''' The name of the enumerated value. + ''' + Public ReadOnly Property Name() As Name + Get + Return _Name + End Get + End Property + + ''' + ''' The location of the '=', if any. + ''' + Public ReadOnly Property EqualsLocation() As Location + Get + Return _EqualsLocation + End Get + End Property + + ''' + ''' The enumerated value, if any. + ''' + Public ReadOnly Property Expression() As Expression + Get + Return _Expression + End Get + End Property + + ''' + ''' Constructs a new parse tree for an enumerated value. + ''' + ''' The attributes on the declaration. + ''' The name of the declaration. + ''' The location of the '=', if any. + ''' The enumerated value, if any. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal name As Name, ByVal equalsLocation As Location, ByVal expression As Expression, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.EnumValueDeclaration, attributes, Nothing, span, comments) + + If name Is Nothing Then + Throw New ArgumentNullException("name") + End If + + SetParent(name) + SetParent(expression) + + _Name = name + _EqualsLocation = equalsLocation + _Expression = expression + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + MyBase.GetChildTrees(childList) + + AddChild(childList, Name) + AddChild(childList, Expression) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Members/EventDeclaration.vb b/aspclassiccompiler/Parser/Trees/Members/EventDeclaration.vb new file mode 100644 index 0000000..13af68f --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Members/EventDeclaration.vb @@ -0,0 +1,53 @@ +' +' 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. +' + +''' +''' A parse tree for an event declaration. +''' +Public NotInheritable Class EventDeclaration + Inherits SignatureDeclaration + + Private ReadOnly _ImplementsList As NameCollection + + ''' + ''' The list of implemented members. + ''' + Public ReadOnly Property ImplementsList() As NameCollection + Get + Return _ImplementsList + End Get + End Property + + ''' + ''' Constructs a parse tree for an event declaration. + ''' + ''' The attributes for the parse tree. + ''' The modifiers for the parse tree. + ''' The location of the keyword. + ''' The name of the declaration. + ''' The parameters of the declaration. + ''' The location of the 'As', if any. + ''' The attributes on the result type, if any. + ''' The result type, if any. + ''' The list of implemented members. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection, ByVal keywordLocation As Location, ByVal name As SimpleName, ByVal parameters As ParameterCollection, ByVal asLocation As Location, ByVal resultTypeAttributes As AttributeBlockCollection, ByVal resultType As TypeName, ByVal implementsList As NameCollection, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.EventDeclaration, attributes, modifiers, keywordLocation, name, Nothing, parameters, asLocation, resultTypeAttributes, resultType, span, comments) + + SetParent(implementsList) + _ImplementsList = implementsList + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + MyBase.GetChildTrees(childList) + AddChild(childList, ImplementsList) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Members/ExternalDeclaration.vb b/aspclassiccompiler/Parser/Trees/Members/ExternalDeclaration.vb new file mode 100644 index 0000000..31280a9 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Members/ExternalDeclaration.vb @@ -0,0 +1,108 @@ +' +' 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. +' + +''' +''' A parse tree for a Declare statement. +''' +Public MustInherit Class ExternalDeclaration + Inherits SignatureDeclaration + + Private ReadOnly _CharsetLocation As Location + Private ReadOnly _Charset As Charset + Private ReadOnly _SubOrFunctionLocation As Location + Private ReadOnly _LibLocation As Location + Private ReadOnly _LibLiteral As StringLiteralExpression + Private ReadOnly _AliasLocation As Location + Private ReadOnly _AliasLiteral As StringLiteralExpression + + ''' + ''' The location of 'Auto', 'Ansi' or 'Unicode', if any. + ''' + Public ReadOnly Property CharsetLocation() As Location + Get + Return _CharsetLocation + End Get + End Property + + ''' + ''' The charset. + ''' + Public ReadOnly Property Charset() As Charset + Get + Return _Charset + End Get + End Property + + ''' + ''' The location of 'Sub' or 'Function'. + ''' + Public ReadOnly Property SubOrFunctionLocation() As Location + Get + Return _SubOrFunctionLocation + End Get + End Property + + ''' + ''' The location of 'Lib', if any. + ''' + Public ReadOnly Property LibLocation() As Location + Get + Return _LibLocation + End Get + End Property + + ''' + ''' The library, if any. + ''' + Public ReadOnly Property LibLiteral() As StringLiteralExpression + Get + Return _LibLiteral + End Get + End Property + + ''' + ''' The location of 'Alias', if any. + ''' + Public ReadOnly Property AliasLocation() As Location + Get + Return _AliasLocation + End Get + End Property + + ''' + ''' The alias, if any. + ''' + Public ReadOnly Property AliasLiteral() As StringLiteralExpression + Get + Return _AliasLiteral + End Get + End Property + + Protected Sub New(ByVal type As TreeType, ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection, ByVal keywordLocation As Location, ByVal charsetLocation As Location, ByVal charset As Charset, ByVal subOrFunctionLocation As Location, ByVal name As SimpleName, ByVal libLocation As Location, ByVal libLiteral As StringLiteralExpression, ByVal aliasLocation As Location, ByVal aliasLiteral As StringLiteralExpression, ByVal parameters As ParameterCollection, ByVal asLocation As Location, ByVal resultTypeAttributes As AttributeBlockCollection, ByVal resultType As TypeName, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(type, attributes, modifiers, keywordLocation, name, Nothing, parameters, asLocation, resultTypeAttributes, resultType, span, comments) + + SetParent(libLiteral) + SetParent(aliasLiteral) + + _CharsetLocation = charsetLocation + _Charset = charset + _SubOrFunctionLocation = subOrFunctionLocation + _LibLocation = libLocation + _LibLiteral = libLiteral + _AliasLocation = aliasLocation + _AliasLiteral = aliasLiteral + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + MyBase.GetChildTrees(childList) + AddChild(childList, LibLiteral) + AddChild(childList, AliasLiteral) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Members/ExternalFunctionDeclaration.vb b/aspclassiccompiler/Parser/Trees/Members/ExternalFunctionDeclaration.vb new file mode 100644 index 0000000..a3c086a --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Members/ExternalFunctionDeclaration.vb @@ -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. +' + +''' +''' A parse tree for a Declare Function statement. +''' +Public NotInheritable Class ExternalFunctionDeclaration + Inherits ExternalDeclaration + + ''' + ''' Constructs a parse tree for a Declare Function statement. + ''' + ''' The attributes for the parse tree. + ''' The modifiers for the parse tree. + ''' The location of the keyword. + ''' The location of the 'Ansi', 'Auto' or 'Unicode', if any. + ''' The charset. + ''' The location of 'Function'. + ''' The name of the declaration. + ''' The location of 'Lib', if any. + ''' The library, if any. + ''' The location of 'Alias', if any. + ''' The alias, if any. + ''' The parameters of the declaration. + ''' The location of the 'As', if any. + ''' The attributes on the result type, if any. + ''' The result type, if any. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection, ByVal keywordLocation As Location, ByVal charsetLocation As Location, ByVal charset As Charset, ByVal functionLocation As Location, ByVal name As SimpleName, ByVal libLocation As Location, ByVal libLiteral As StringLiteralExpression, ByVal aliasLocation As Location, ByVal aliasLiteral As StringLiteralExpression, ByVal parameters As ParameterCollection, ByVal asLocation As Location, ByVal resultTypeAttributes As AttributeBlockCollection, ByVal resultType As TypeName, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.ExternalFunctionDeclaration, attributes, modifiers, keywordLocation, charsetLocation, charset, functionLocation, name, libLocation, libLiteral, aliasLocation, aliasLiteral, parameters, asLocation, resultTypeAttributes, resultType, span, comments) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Members/ExternalSubDeclaration.vb b/aspclassiccompiler/Parser/Trees/Members/ExternalSubDeclaration.vb new file mode 100644 index 0000000..974e0d9 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Members/ExternalSubDeclaration.vb @@ -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. +' + +''' +''' A parse tree for a Declare Sub statement. +''' +Public NotInheritable Class ExternalSubDeclaration + Inherits ExternalDeclaration + + ''' + ''' Constructs a parse tree for a Declare Sub statement. + ''' + ''' The attributes for the parse tree. + ''' The modifiers for the parse tree. + ''' The location of the keyword. + ''' The location of the 'Ansi', 'Auto' or 'Unicode', if any. + ''' The charset. + ''' The location of 'Sub'. + ''' The name of the declaration. + ''' The location of 'Lib', if any. + ''' The library, if any. + ''' The location of 'Alias', if any. + ''' The alias, if any. + ''' The parameters of the declaration. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection, ByVal keywordLocation As Location, ByVal charsetLocation As Location, ByVal charset As Charset, ByVal subLocation As Location, ByVal name As SimpleName, ByVal libLocation As Location, ByVal libLiteral As StringLiteralExpression, ByVal aliasLocation As Location, ByVal aliasLiteral As StringLiteralExpression, ByVal parameters As ParameterCollection, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.ExternalSubDeclaration, attributes, modifiers, keywordLocation, charsetLocation, charset, subLocation, name, libLocation, libLiteral, aliasLocation, aliasLiteral, parameters, Nothing, Nothing, Nothing, span, comments) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Members/FunctionDeclaration.vb b/aspclassiccompiler/Parser/Trees/Members/FunctionDeclaration.vb new file mode 100644 index 0000000..de1cda0 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Members/FunctionDeclaration.vb @@ -0,0 +1,38 @@ +' +' 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. +' + +''' +''' A parse tree for a Function declaration. +''' +Public NotInheritable Class FunctionDeclaration + Inherits MethodDeclaration + + ''' + ''' Creates a new parse tree for a Function declaration. + ''' + ''' The attributes for the parse tree. + ''' The modifiers for the parse tree. + ''' The location of the keyword. + ''' The name of the declaration. + ''' The type parameters on the declaration, if any. + ''' The parameters of the declaration. + ''' The location of the 'As', if any. + ''' The attributes on the result type, if any. + ''' The result type, if any. + ''' The list of implemented members. + ''' The list of handled events. + ''' The statements in the declaration. + ''' The end block declaration, if any. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection, ByVal keywordLocation As Location, ByVal name As SimpleName, ByVal typeParameters As TypeParameterCollection, ByVal parameters As ParameterCollection, ByVal asLocation As Location, ByVal resultTypeAttributes As AttributeBlockCollection, ByVal resultType As TypeName, ByVal implementsList As NameCollection, ByVal handlesList As NameCollection, ByVal statements As StatementCollection, ByVal endDeclaration As EndBlockDeclaration, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.FunctionDeclaration, attributes, modifiers, keywordLocation, name, typeParameters, parameters, asLocation, resultTypeAttributes, resultType, implementsList, handlesList, statements, endDeclaration, span, comments) + End Sub +End Class diff --git a/aspclassiccompiler/Parser/Trees/Members/GetAccessorDeclaration.vb b/aspclassiccompiler/Parser/Trees/Members/GetAccessorDeclaration.vb new file mode 100644 index 0000000..4cefc67 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Members/GetAccessorDeclaration.vb @@ -0,0 +1,75 @@ +' +' 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. +' + +''' +''' A parse tree for a Get property accessor. +''' +Public NotInheritable Class GetAccessorDeclaration + Inherits ModifiedDeclaration + + Private ReadOnly _GetLocation As Location + Private ReadOnly _Statements As StatementCollection + Private ReadOnly _EndDeclaration As EndBlockDeclaration + + ''' + ''' The location of the 'Get'. + ''' + Public ReadOnly Property GetLocation() As Location + Get + Return _GetLocation + End Get + End Property + + ''' + ''' The statements in the accessor. + ''' + Public ReadOnly Property Statements() As StatementCollection + Get + Return _Statements + End Get + End Property + + ''' + ''' The End declaration for the accessor. + ''' + Public ReadOnly Property EndDeclaration() As EndBlockDeclaration + Get + Return _EndDeclaration + End Get + End Property + + ''' + ''' Constructs a new parse tree for a Get property accessor. + ''' + ''' The attributes for the parse tree. + ''' The modifiers for the parse tree. + ''' The location of the 'Get'. + ''' The statements in the declaration. + ''' The end block declaration, if any. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection, ByVal getLocation As Location, ByVal statements As StatementCollection, ByVal endDeclaration As EndBlockDeclaration, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.GetAccessorDeclaration, attributes, modifiers, span, comments) + + SetParent(statements) + SetParent(endDeclaration) + + _GetLocation = getLocation + _Statements = statements + _EndDeclaration = endDeclaration + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + MyBase.GetChildTrees(childList) + + AddChild(childList, Statements) + AddChild(childList, EndDeclaration) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Members/MethodDeclaration.vb b/aspclassiccompiler/Parser/Trees/Members/MethodDeclaration.vb new file mode 100644 index 0000000..54de911 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Members/MethodDeclaration.vb @@ -0,0 +1,83 @@ +' +' 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. +' + +''' +''' A parse tree for a Sub, Function or constructor declaration. +''' +Public MustInherit Class MethodDeclaration + Inherits SignatureDeclaration + + Private ReadOnly _ImplementsList As NameCollection + Private ReadOnly _HandlesList As NameCollection + Private ReadOnly _Statements As StatementCollection + Private ReadOnly _EndDeclaration As EndBlockDeclaration + + ''' + ''' The list of implemented members. + ''' + Public ReadOnly Property ImplementsList() As NameCollection + Get + Return _ImplementsList + End Get + End Property + + ''' + ''' The events that the declaration handles. + ''' + Public ReadOnly Property HandlesList() As NameCollection + Get + Return _HandlesList + End Get + End Property + + ''' + ''' The statements in the declaration. + ''' + Public ReadOnly Property Statements() As StatementCollection + Get + Return _Statements + End Get + End Property + + ''' + ''' The end block declaration, if any. + ''' + 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 typeParameters As TypeParameterCollection, ByVal parameters As ParameterCollection, ByVal asLocation As Location, ByVal resultTypeAttributes As AttributeBlockCollection, ByVal resultType As TypeName, ByVal implementsList As NameCollection, ByVal handlesList As NameCollection, ByVal statements As StatementCollection, ByVal endDeclaration As EndBlockDeclaration, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(type, attributes, modifiers, keywordLocation, name, typeParameters, parameters, asLocation, resultTypeAttributes, resultType, span, comments) + + Debug.Assert(type = TreeType.SubDeclaration OrElse _ + type = TreeType.FunctionDeclaration OrElse _ + type = TreeType.ConstructorDeclaration OrElse _ + type = TreeType.OperatorDeclaration) + SetParent(statements) + SetParent(endDeclaration) + SetParent(handlesList) + SetParent(implementsList) + + _ImplementsList = implementsList + _HandlesList = handlesList + _Statements = statements + _EndDeclaration = endDeclaration + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + MyBase.GetChildTrees(childList) + AddChild(childList, ImplementsList) + AddChild(childList, HandlesList) + AddChild(childList, Statements) + AddChild(childList, EndDeclaration) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Members/OperatorDeclaration.vb b/aspclassiccompiler/Parser/Trees/Members/OperatorDeclaration.vb new file mode 100644 index 0000000..3582d0b --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Members/OperatorDeclaration.vb @@ -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. +' + +''' +''' A parse tree for an overloaded operator declaration. +''' +Public NotInheritable Class OperatorDeclaration + Inherits MethodDeclaration + + Private ReadOnly _OperatorToken As Token + + ''' + ''' The operator being overloaded. + ''' + Public ReadOnly Property OperatorToken() As Token + Get + Return _OperatorToken + End Get + End Property + + ''' + ''' Creates a new parse tree for an overloaded operator declaration. + ''' + ''' The attributes for the parse tree. + ''' The modifiers for the parse tree. + ''' The location of the keyword. + ''' The operator being overloaded. + ''' The parameters of the declaration. + ''' The location of the 'As', if any. + ''' The attributes on the result type, if any. + ''' The result type, if any. + ''' The statements in the declaration. + ''' The end block declaration, if any. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection, ByVal keywordLocation As Location, ByVal operatorToken As Token, ByVal parameters As ParameterCollection, ByVal asLocation As Location, ByVal resultTypeAttributes As AttributeBlockCollection, ByVal resultType As TypeName, ByVal statements As StatementCollection, ByVal endDeclaration As EndBlockDeclaration, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.OperatorDeclaration, attributes, modifiers, keywordLocation, Nothing, Nothing, parameters, asLocation, resultTypeAttributes, resultType, Nothing, Nothing, statements, endDeclaration, span, comments) + + _OperatorToken = operatorToken + End Sub +End Class diff --git a/aspclassiccompiler/Parser/Trees/Members/PropertyDeclaration.vb b/aspclassiccompiler/Parser/Trees/Members/PropertyDeclaration.vb new file mode 100644 index 0000000..2525927 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Members/PropertyDeclaration.vb @@ -0,0 +1,82 @@ +' +' 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. +' + +''' +''' A parse tree for a property declaration. +''' +Public NotInheritable Class PropertyDeclaration + Inherits SignatureDeclaration + + Private ReadOnly _ImplementsList As NameCollection + Private ReadOnly _Accessors As DeclarationCollection + Private ReadOnly _EndDeclaration As EndBlockDeclaration + + ''' + ''' The list of implemented members. + ''' + Public ReadOnly Property ImplementsList() As NameCollection + Get + Return _ImplementsList + End Get + End Property + + ''' + ''' The property accessors. + ''' + Public ReadOnly Property Accessors() As DeclarationCollection + Get + Return _Accessors + End Get + End Property + + ''' + ''' The End Property declaration, if any. + ''' + Public ReadOnly Property EndDeclaration() As EndBlockDeclaration + Get + Return _EndDeclaration + End Get + End Property + + ''' + ''' Constructs a new parse tree for a property declaration. + ''' + ''' The attributes on the declaration. + ''' The modifiers on the declaration. + ''' The location of the keyword. + ''' The name of the property. + ''' The parameters of the property. + ''' The location of the 'As', if any. + ''' The attributes on the result type. + ''' The result type, if any. + ''' The implements list. + ''' The property accessors. + ''' The End Property declaration, if any. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection, ByVal keywordLocation As Location, ByVal name As SimpleName, ByVal parameters As ParameterCollection, ByVal asLocation As Location, ByVal resultTypeAttributes As AttributeBlockCollection, ByVal resultType As TypeName, ByVal implementsList As NameCollection, ByVal accessors As DeclarationCollection, ByVal endDeclaration As EndBlockDeclaration, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.PropertyDeclaration, attributes, modifiers, keywordLocation, name, Nothing, parameters, asLocation, resultTypeAttributes, resultType, span, comments) + + SetParent(accessors) + SetParent(endDeclaration) + SetParent(implementsList) + + _ImplementsList = implementsList + _Accessors = accessors + _EndDeclaration = endDeclaration + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + MyBase.GetChildTrees(childList) + AddChild(childList, ImplementsList) + AddChild(childList, Accessors) + AddChild(childList, EndDeclaration) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Members/RaiseEventAccessorDeclaration.vb b/aspclassiccompiler/Parser/Trees/Members/RaiseEventAccessorDeclaration.vb new file mode 100644 index 0000000..2bd7972 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Members/RaiseEventAccessorDeclaration.vb @@ -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. +' + +''' +''' A parse tree for a RaiseEvent property accessor. +''' +Public NotInheritable Class RaiseEventAccessorDeclaration + Inherits ModifiedDeclaration + + Private ReadOnly _RaiseEventLocation As Location + Private ReadOnly _Parameters As ParameterCollection + Private ReadOnly _Statements As StatementCollection + Private ReadOnly _EndStatement As EndBlockDeclaration + + ''' + ''' The location of the 'RaiseEvent'. + ''' + Public ReadOnly Property RaiseEventLocation() As Location + Get + Return _RaiseEventLocation + End Get + End Property + + ''' + ''' The accessor's parameters. + ''' + Public ReadOnly Property Parameters() As ParameterCollection + Get + Return _Parameters + End Get + End Property + + ''' + ''' The statements in the accessor. + ''' + Public ReadOnly Property Statements() As StatementCollection + Get + Return _Statements + End Get + End Property + + ''' + ''' The End declaration for the accessor. + ''' + Public ReadOnly Property EndStatement() As EndBlockDeclaration + Get + Return _EndStatement + End Get + End Property + + ''' + ''' Constructs a new parse tree for a property accessor. + ''' + ''' The attributes for the parse tree. + ''' The location of the 'RaiseEvent'. + ''' The parameters of the declaration. + ''' The statements in the declaration. + ''' The end block declaration, if any. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal raiseEventLocation As Location, ByVal parameters As ParameterCollection, ByVal statements As StatementCollection, ByVal endStatement As EndBlockDeclaration, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.RaiseEventAccessorDeclaration, attributes, Nothing, span, comments) + + SetParent(parameters) + SetParent(statements) + SetParent(endStatement) + + _Parameters = parameters + _RaiseEventLocation = raiseEventLocation + _Statements = statements + _EndStatement = endStatement + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + MyBase.GetChildTrees(childList) + + AddChild(childList, Parameters) + AddChild(childList, Statements) + AddChild(childList, EndStatement) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Members/RemoveHandlerAccessorDeclaration.vb b/aspclassiccompiler/Parser/Trees/Members/RemoveHandlerAccessorDeclaration.vb new file mode 100644 index 0000000..70b7c5f --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Members/RemoveHandlerAccessorDeclaration.vb @@ -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. +' + +''' +''' A parse tree for a RemoveHandler property accessor. +''' +Public NotInheritable Class RemoveHandlerAccessorDeclaration + Inherits ModifiedDeclaration + + Private ReadOnly _RemoveHandlerLocation As Location + Private ReadOnly _Parameters As ParameterCollection + Private ReadOnly _Statements As StatementCollection + Private ReadOnly _EndStatement As EndBlockDeclaration + + ''' + ''' The location of the 'RemoveHandler'. + ''' + Public ReadOnly Property RemoveHandlerLocation() As Location + Get + Return _RemoveHandlerLocation + End Get + End Property + + ''' + ''' The accessor's parameters. + ''' + Public ReadOnly Property Parameters() As ParameterCollection + Get + Return _Parameters + End Get + End Property + + ''' + ''' The statements in the accessor. + ''' + Public ReadOnly Property Statements() As StatementCollection + Get + Return _Statements + End Get + End Property + + ''' + ''' The End declaration for the accessor. + ''' + Public ReadOnly Property EndStatement() As EndBlockDeclaration + Get + Return _EndStatement + End Get + End Property + + ''' + ''' Constructs a new parse tree for a property accessor. + ''' + ''' The attributes for the parse tree. + ''' The location of the 'RemoveHandler'. + ''' The parameters of the declaration. + ''' The statements in the declaration. + ''' The end block declaration, if any. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal removeHandlerLocation As Location, ByVal parameters As ParameterCollection, ByVal statements As StatementCollection, ByVal endStatement As EndBlockDeclaration, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.RemoveHandlerAccessorDeclaration, attributes, Nothing, span, comments) + + SetParent(parameters) + SetParent(statements) + SetParent(endStatement) + + _Parameters = parameters + _RemoveHandlerLocation = removeHandlerLocation + _Statements = statements + _EndStatement = endStatement + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + MyBase.GetChildTrees(childList) + + AddChild(childList, Parameters) + AddChild(childList, Statements) + AddChild(childList, EndStatement) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Members/SetAccessorDeclaration.vb b/aspclassiccompiler/Parser/Trees/Members/SetAccessorDeclaration.vb new file mode 100644 index 0000000..1f905ce --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Members/SetAccessorDeclaration.vb @@ -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. +' + +''' +''' A parse tree for a Set property accessor. +''' +Public NotInheritable Class SetAccessorDeclaration + Inherits ModifiedDeclaration + + Private ReadOnly _SetLocation As Location + Private ReadOnly _Parameters As ParameterCollection + Private ReadOnly _Statements As StatementCollection + Private ReadOnly _EndDeclaration As EndBlockDeclaration + + ''' + ''' The location of the 'Set'. + ''' + Public ReadOnly Property SetLocation() As Location + Get + Return _SetLocation + End Get + End Property + + ''' + ''' The accessor's parameters. + ''' + Public ReadOnly Property Parameters() As ParameterCollection + Get + Return _Parameters + End Get + End Property + + ''' + ''' The statements in the accessor. + ''' + Public ReadOnly Property Statements() As StatementCollection + Get + Return _Statements + End Get + End Property + + ''' + ''' The End declaration for the accessor. + ''' + Public ReadOnly Property EndDeclaration() As EndBlockDeclaration + Get + Return _EndDeclaration + End Get + End Property + + ''' + ''' Constructs a new parse tree for a property accessor. + ''' + ''' The attributes for the parse tree. + ''' The modifiers for the parse tree. + ''' The location of the 'Set'. + ''' The parameters of the declaration. + ''' The statements in the declaration. + ''' The end block declaration, if any. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection, ByVal setLocation As Location, ByVal parameters As ParameterCollection, ByVal statements As StatementCollection, ByVal endDeclaration As EndBlockDeclaration, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.SetAccessorDeclaration, attributes, modifiers, span, comments) + + SetParent(parameters) + SetParent(statements) + SetParent(endDeclaration) + + _Parameters = parameters + _SetLocation = setLocation + _Statements = statements + _EndDeclaration = endDeclaration + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + MyBase.GetChildTrees(childList) + + AddChild(childList, Parameters) + AddChild(childList, Statements) + AddChild(childList, EndDeclaration) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Members/SignatureDeclaration.vb b/aspclassiccompiler/Parser/Trees/Members/SignatureDeclaration.vb new file mode 100644 index 0000000..d99c66c --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Members/SignatureDeclaration.vb @@ -0,0 +1,114 @@ +' +' 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. +' + +''' +''' A parse tree for a declaration with a signature. +''' +Public MustInherit Class SignatureDeclaration + Inherits ModifiedDeclaration + + Private ReadOnly _KeywordLocation As Location + Private ReadOnly _Name As SimpleName + Private ReadOnly _TypeParameters As TypeParameterCollection + Private ReadOnly _Parameters As ParameterCollection + Private ReadOnly _AsLocation As Location + Private ReadOnly _ResultTypeAttributes As AttributeBlockCollection + Private ReadOnly _ResultType As TypeName + + ''' + ''' The location of the declaration's keyword. + ''' + Public ReadOnly Property KeywordLocation() As Location + Get + Return _KeywordLocation + End Get + End Property + + ''' + ''' The name of the declaration. + ''' + Public ReadOnly Property Name() As SimpleName + Get + Return _Name + End Get + End Property + + ''' + ''' The type parameters on the declaration, if any. + ''' + Public ReadOnly Property TypeParameters() As TypeParameterCollection + Get + Return _TypeParameters + End Get + End Property + + ''' + ''' The parameters of the declaration. + ''' + Public ReadOnly Property Parameters() As ParameterCollection + Get + Return _Parameters + End Get + End Property + + ''' + ''' The location of the 'As', if any. + ''' + Public ReadOnly Property AsLocation() As Location + Get + Return _AsLocation + End Get + End Property + + ''' + ''' The result type attributes, if any. + ''' + Public ReadOnly Property ResultTypeAttributes() As AttributeBlockCollection + Get + Return _ResultTypeAttributes + End Get + End Property + + ''' + ''' The result type, if any. + ''' + Public ReadOnly Property ResultType() As TypeName + Get + Return _ResultType + 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 typeParameters As TypeParameterCollection, ByVal parameters As ParameterCollection, ByVal asLocation As Location, ByVal resultTypeAttributes As AttributeBlockCollection, ByVal resultType As TypeName, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(type, attributes, modifiers, span, comments) + + SetParent(name) + SetParent(typeParameters) + SetParent(parameters) + SetParent(resultType) + SetParent(resultTypeAttributes) + + _KeywordLocation = keywordLocation + _Name = name + _TypeParameters = typeParameters + _Parameters = parameters + _AsLocation = asLocation + _ResultTypeAttributes = resultTypeAttributes + _ResultType = resultType + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + MyBase.GetChildTrees(childList) + AddChild(childList, Name) + AddChild(childList, TypeParameters) + AddChild(childList, Parameters) + AddChild(childList, ResultTypeAttributes) + AddChild(childList, ResultType) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Members/SubDeclaration.vb b/aspclassiccompiler/Parser/Trees/Members/SubDeclaration.vb new file mode 100644 index 0000000..b333863 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Members/SubDeclaration.vb @@ -0,0 +1,35 @@ +' +' 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. +' + +''' +''' A parse tree for a Sub declaration. +''' +Public NotInheritable Class SubDeclaration + Inherits MethodDeclaration + + ''' + ''' Creates a new parse tree for a Sub declaration. + ''' + ''' The attributes for the parse tree. + ''' The modifiers for the parse tree. + ''' The location of the keyword. + ''' The name of the declaration. + ''' The type parameters on the declaration, if any. + ''' The parameters of the declaration. + ''' The list of implemented members. + ''' The list of handled events. + ''' The statements in the declaration. + ''' The end block declaration, if any. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection, ByVal keywordLocation As Location, ByVal name As SimpleName, ByVal typeParameters As TypeParameterCollection, ByVal parameters As ParameterCollection, ByVal implementsList As NameCollection, ByVal handlesList As NameCollection, ByVal statements As StatementCollection, ByVal endDeclaration As EndBlockDeclaration, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.SubDeclaration, attributes, modifiers, keywordLocation, name, typeParameters, parameters, Nothing, Nothing, Nothing, implementsList, handlesList, statements, endDeclaration, span, comments) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Members/VariableListDeclaration.vb b/aspclassiccompiler/Parser/Trees/Members/VariableListDeclaration.vb new file mode 100644 index 0000000..b7db68a --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Members/VariableListDeclaration.vb @@ -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. +' + +''' +''' A parse tree for variable declarations. +''' +Public NotInheritable Class VariableListDeclaration + Inherits ModifiedDeclaration + + Private ReadOnly _VariableDeclarators As VariableDeclaratorCollection + + ''' + ''' The variables being declared. + ''' + Public ReadOnly Property VariableDeclarators() As VariableDeclaratorCollection + Get + Return _VariableDeclarators + End Get + End Property + + ''' + ''' Constructs a parse tree for variable declarations. + ''' + ''' The attributes on the declaration. + ''' The modifiers on the declaration. + ''' The variables being declared. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection, ByVal variableDeclarators As VariableDeclaratorCollection, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.VariableListDeclaration, attributes, modifiers, span, comments) + + If variableDeclarators Is Nothing Then + Throw New ArgumentNullException("variableDeclarators") + End If + + SetParent(variableDeclarators) + + _VariableDeclarators = variableDeclarators + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + MyBase.GetChildTrees(childList) + AddChild(childList, VariableDeclarators) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Modifiers/Modifier.vb b/aspclassiccompiler/Parser/Trees/Modifiers/Modifier.vb new file mode 100644 index 0000000..fa77078 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Modifiers/Modifier.vb @@ -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. +' + +''' +''' A parse tree for a declaration modifier. +''' +Public NotInheritable Class Modifier + Inherits Tree + + Private ReadOnly _ModifierType As ModifierTypes + + ''' + ''' The type of the modifier. + ''' + Public ReadOnly Property ModifierType() As ModifierTypes + Get + Return _ModifierType + End Get + End Property + + ''' + ''' Constructs a new modifier parse tree. + ''' + ''' The type of the modifier. + ''' The location of the parse tree. + Public Sub New(ByVal modifierType As ModifierTypes, ByVal span As Span) + MyBase.New(TreeType.Modifier, span) + + If (modifierType And (modifierType - 1)) <> 0 OrElse _ + modifierType < ModifierTypes.None OrElse _ + modifierType > ModifierTypes.Narrowing Then + Throw New ArgumentOutOfRangeException("modifierType") + End If + + _ModifierType = modifierType + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Modifiers/ModifierCollection.vb b/aspclassiccompiler/Parser/Trees/Modifiers/ModifierCollection.vb new file mode 100644 index 0000000..5051a57 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Modifiers/ModifierCollection.vb @@ -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. +' + +''' +''' A read-only collection of modifiers. +''' +Public NotInheritable Class ModifierCollection + Inherits TreeCollection(Of Modifier) + + Private ReadOnly _ModifierTypes As ModifierTypes + + ''' + ''' All the modifiers in the collection. + ''' + Public ReadOnly Property ModifierTypes() As ModifierTypes + Get + Return _ModifierTypes + End Get + End Property + + ''' + ''' Constructs a collection of modifiers. + ''' + ''' The modifiers in the collection. + ''' The location of the parse tree. + Public Sub New(ByVal modifiers As IList(Of Modifier), ByVal span As Span) + MyBase.New(TreeType.ModifierCollection, modifiers, span) + + If modifiers Is Nothing OrElse modifiers.Count = 0 Then + Throw New ArgumentException("ModifierCollection cannot be empty.") + End If + + For Each Modifier As Modifier In modifiers + _ModifierTypes = _ModifierTypes Or Modifier.ModifierType + Next + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Modifiers/ModifierTypes.vb b/aspclassiccompiler/Parser/Trees/Modifiers/ModifierTypes.vb new file mode 100644 index 0000000..a017996 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Modifiers/ModifierTypes.vb @@ -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. +' + +''' +''' The type of a parse tree modifier. +''' + Public Enum ModifierTypes + None = &H0 + [Public] = &H1 + [Private] = &H2 + [Protected] = &H4 + [Friend] = &H8 + AccessModifiers = [Public] Or [Private] Or [Protected] Or [Friend] + [Static] = &H10 + [Shared] = &H20 + [Shadows] = &H40 + [Overloads] = &H80 + [MustInherit] = &H100 + [NotInheritable] = &H200 + [Overrides] = &H400 + [NotOverridable] = &H800 + [Overridable] = &H1000 + [MustOverride] = &H2000 + [ReadOnly] = &H4000 + [WriteOnly] = &H8000 + [Dim] = &H10000 + [Const] = &H20000 + [Default] = &H40000 + [WithEvents] = &H80000 + [ByVal] = &H100000 + [ByRef] = &H200000 + [Optional] = &H400000 + [ParamArray] = &H800000 + [Partial] = &H1000000 + [Widening] = &H2000000 + [Narrowing] = &H4000000 +End Enum \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Names/GlobalNamespaceName.vb b/aspclassiccompiler/Parser/Trees/Names/GlobalNamespaceName.vb new file mode 100644 index 0000000..16a7ea4 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Names/GlobalNamespaceName.vb @@ -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. +' + +''' +''' A parse tree for the global namespace (i.e. 'Global'). +''' +Public NotInheritable Class GlobalNamespaceName + Inherits Name + + ''' + ''' Constructs a new global namespace name parse tree. + ''' + ''' The location of the parse tree. + Public Sub New(ByVal span As Span) + MyBase.New(TreeType.GlobalNamespaceName, span) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Names/Name.vb b/aspclassiccompiler/Parser/Trees/Names/Name.vb new file mode 100644 index 0000000..a20fd8f --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Names/Name.vb @@ -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. +' + +''' +''' A parse tree for a name. +''' +Public MustInherit Class Name + Inherits Tree + + Protected Sub New(ByVal type As TreeType, ByVal span As Span) + MyBase.New(type, span) + + Debug.Assert(type >= TreeType.SimpleName AndAlso type <= TreeType.MyBaseName) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Names/NameCollection.vb b/aspclassiccompiler/Parser/Trees/Names/NameCollection.vb new file mode 100644 index 0000000..9f42776 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Names/NameCollection.vb @@ -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. +' + +''' +''' A read-only collection of names. +''' +Public NotInheritable Class NameCollection + Inherits CommaDelimitedTreeCollection(Of Name) + ''' + ''' Constructs a new name collection. + ''' + ''' The names in the collection. + ''' The locations of the commas in the collection. + ''' The location of the parse tree. + Public Sub New(ByVal names As IList(Of Name), ByVal commaLocations As IList(Of Location), ByVal span As Span) + MyBase.New(TreeType.NameCollection, names, CommaLocations, Span) + + If names Is Nothing OrElse names.Count = 0 Then + Throw New ArgumentException("NameCollection cannot be empty.") + End If + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Names/QualifiedName.vb b/aspclassiccompiler/Parser/Trees/Names/QualifiedName.vb new file mode 100644 index 0000000..e0b04fb --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Names/QualifiedName.vb @@ -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. +' + +''' +''' A parse tree for a qualified name (e.g. 'foo.bar'). +''' +Public NotInheritable Class QualifiedName + Inherits Name + + Private ReadOnly _Qualifier As Name + Private ReadOnly _DotLocation As Location + Private ReadOnly _Name As SimpleName + + ''' + ''' The qualifier on the left-hand side of the dot. + ''' + Public ReadOnly Property Qualifier() As Name + Get + Return _Qualifier + End Get + End Property + + ''' + ''' The location of the dot. + ''' + Public ReadOnly Property DotLocation() As Location + Get + Return _DotLocation + End Get + End Property + + ''' + ''' The name on the right-hand side of the dot. + ''' + Public ReadOnly Property Name() As SimpleName + Get + Return _Name + End Get + End Property + + ''' + ''' Constructs a new parse tree for a qualified name. + ''' + ''' The qualifier on the left-hand side of the dot. + ''' The location of the dot. + ''' The name on the right-hand side of the dot. + ''' The location of the parse tree. + Public Sub New(ByVal qualifier As Name, ByVal dotLocation As Location, ByVal name As SimpleName, ByVal span As Span) + MyBase.New(TreeType.QualifiedName, span) + + If qualifier Is Nothing Then + Throw New ArgumentNullException("qualifier") + End If + + 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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Names/SimpleName.vb b/aspclassiccompiler/Parser/Trees/Names/SimpleName.vb new file mode 100644 index 0000000..f21e820 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Names/SimpleName.vb @@ -0,0 +1,96 @@ +' +' 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. +' + +''' +''' A parse tree for a simple name (e.g. 'foo'). +''' +Public NotInheritable Class SimpleName + Inherits Name + + Private ReadOnly _Name As String + Private ReadOnly _TypeCharacter As TypeCharacter + Private ReadOnly _Escaped As Boolean + + ''' + ''' The name, if any. + ''' + Public ReadOnly Property Name() As String + Get + Return _Name + End Get + End Property + + ''' + ''' The type character. + ''' + Public ReadOnly Property TypeCharacter() As TypeCharacter + Get + Return _TypeCharacter + End Get + End Property + + ''' + ''' Whether the name is escaped. + ''' + Public ReadOnly Property Escaped() As Boolean + Get + Return _Escaped + End Get + End Property + + ''' + ''' Creates a bad simple name. + ''' + ''' The location of the parse tree. + ''' A bad simple name. + Public Shared Function GetBadSimpleName(ByVal span As Span) As SimpleName + Return New SimpleName(Span) + End Function + + ''' + ''' Constructs a new simple name parse tree. + ''' + ''' The name, if any. + ''' The type character. + ''' Whether the name is escaped. + ''' The location of the parse tree. + Public Sub New(ByVal name As String, ByVal typeCharacter As TypeCharacter, ByVal escaped As Boolean, ByVal span As Span) + MyBase.New(TreeType.SimpleName, span) + + If typeCharacter <> typeCharacter.None AndAlso escaped Then + Throw New ArgumentException("Escaped named cannot have type characters.") + 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 name Is Nothing Then + Throw New ArgumentNullException("name") + End If + + _Name = name + _TypeCharacter = typeCharacter + _Escaped = escaped + End Sub + + Private Sub New(ByVal span As Span) + MyBase.New(TreeType.SimpleName, span) + End Sub + + Public Overrides ReadOnly Property IsBad() As Boolean + Get + Return Name Is Nothing + End Get + End Property +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Names/SpecialName.vb b/aspclassiccompiler/Parser/Trees/Names/SpecialName.vb new file mode 100644 index 0000000..0386128 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Names/SpecialName.vb @@ -0,0 +1,26 @@ +' +' 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. +' + +''' +''' A parse tree for a special name (i.e. 'Global'). +''' +Public NotInheritable Class SpecialName + Inherits Name + + ''' + ''' Constructs a new special name parse tree. + ''' + ''' The location of the parse tree. + Public Sub New(ByVal type As TreeType, ByVal span As Span) + MyBase.New(type, span) + + Debug.Assert(type = TreeType.GlobalNamespaceName OrElse type = TreeType.MeName OrElse type = TreeType.MyBaseName) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Names/SpecialNameTypes.vb b/aspclassiccompiler/Parser/Trees/Names/SpecialNameTypes.vb new file mode 100644 index 0000000..732a276 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Names/SpecialNameTypes.vb @@ -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. +' + +''' +''' The types of special names that exist. +''' +Public Enum SpecialNameTypes + [Me] + [MyBase] + [Global] +End Enum diff --git a/aspclassiccompiler/Parser/Trees/Names/VariableName.vb b/aspclassiccompiler/Parser/Trees/Names/VariableName.vb new file mode 100644 index 0000000..4402949 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Names/VariableName.vb @@ -0,0 +1,65 @@ +' +' 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. +' + +''' +''' A parse tree to represent a variable name. +''' +''' +''' A variable name can have an array modifier after it (e.g. 'x(10) As Integer'). +''' +Public NotInheritable Class VariableName + Inherits Name + + Private ReadOnly _Name As SimpleName + Private ReadOnly _ArrayType As ArrayTypeName + + ''' + ''' The name. + ''' + Public ReadOnly Property Name() As SimpleName + Get + Return _Name + End Get + End Property + + ''' + ''' The array modifier, if any. + ''' + Public ReadOnly Property ArrayType() As ArrayTypeName + Get + Return _ArrayType + End Get + End Property + + ''' + ''' Constructs a new variable name parse tree. + ''' + ''' The name. + ''' The array modifier, if any. + ''' The location of the parse tree. + Public Sub New(ByVal name As SimpleName, ByVal arrayType As ArrayTypeName, ByVal span As Span) + MyBase.New(TreeType.VariableName, span) + + If name Is Nothing Then + Throw New ArgumentNullException("name") + End If + + SetParent(name) + SetParent(arrayType) + + _Name = name + _ArrayType = arrayType + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, Name) + AddChild(childList, ArrayType) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Names/VariableNameCollection.vb b/aspclassiccompiler/Parser/Trees/Names/VariableNameCollection.vb new file mode 100644 index 0000000..ce52e68 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Names/VariableNameCollection.vb @@ -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. +' + +''' +''' A read-only collection of variable names. +''' +Public NotInheritable Class VariableNameCollection + Inherits CommaDelimitedTreeCollection(Of VariableName) + ''' + ''' Constructs a new variable name collection. + ''' + ''' The variable names in the collection. + ''' The locations of the commas in the collection. + ''' The location of the parse tree. + Public Sub New(ByVal variableNames As IList(Of VariableName), ByVal commaLocations As IList(Of Location), ByVal span As Span) + MyBase.New(TreeType.VariableNameCollection, variableNames, commaLocations, span) + + If variableNames Is Nothing OrElse variableNames.Count = 0 Then + Throw New ArgumentException("VariableNameCollection cannot be empty.") + End If + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Parameters/Parameter.vb b/aspclassiccompiler/Parser/Trees/Parameters/Parameter.vb new file mode 100644 index 0000000..ef4226c --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Parameters/Parameter.vb @@ -0,0 +1,128 @@ +' +' 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. +' + +''' +''' A parse tree for a parameter. +''' +Public NotInheritable Class Parameter + Inherits Tree + + Private ReadOnly _Attributes As AttributeBlockCollection + Private ReadOnly _Modifiers As ModifierCollection + Private ReadOnly _VariableName As VariableName + Private ReadOnly _AsLocation As Location + Private ReadOnly _ParameterType As TypeName + Private ReadOnly _EqualsLocation As Location + Private ReadOnly _Initializer As Initializer + + ''' + ''' The attributes on the parameter. + ''' + Public ReadOnly Property Attributes() As AttributeBlockCollection + Get + Return _Attributes + End Get + End Property + + ''' + ''' The modifiers on the parameter. + ''' + Public ReadOnly Property Modifiers() As ModifierCollection + Get + Return _Modifiers + End Get + End Property + + ''' + ''' The name of the parameter. + ''' + Public ReadOnly Property VariableName() As VariableName + Get + Return _VariableName + End Get + End Property + + ''' + ''' The location of the 'As', if any. + ''' + Public ReadOnly Property AsLocation() As Location + Get + Return _AsLocation + End Get + End Property + + ''' + ''' The parameter type, if any. + ''' + Public ReadOnly Property ParameterType() As TypeName + Get + Return _ParameterType + End Get + End Property + + ''' + ''' The location of the '=', if any. + ''' + Public ReadOnly Property EqualsLocation() As Location + Get + Return _EqualsLocation + End Get + End Property + + ''' + ''' The initializer for the parameter, if any. + ''' + Public ReadOnly Property Initializer() As Initializer + Get + Return _Initializer + End Get + End Property + + ''' + ''' Constructs a new parameter parse tree. + ''' + ''' The attributes on the parameter. + ''' The modifiers on the parameter. + ''' The name of the parameter. + ''' The location of the 'As'. + ''' The type of the parameter. Can be Nothing. + ''' The location of the '='. + ''' The initializer for the parameter. Can be Nothing. + ''' The location of the parse tree. + Public Sub New(ByVal attributes As AttributeBlockCollection, ByVal modifiers As ModifierCollection, ByVal variableName As VariableName, ByVal asLocation As Location, ByVal parameterType As TypeName, ByVal equalsLocation As Location, ByVal initializer As Initializer, ByVal span As Span) + MyBase.New(TreeType.Parameter, span) + + If variableName Is Nothing Then + Throw New ArgumentNullException("variableName") + End If + + SetParent(attributes) + SetParent(modifiers) + SetParent(variableName) + SetParent(parameterType) + SetParent(initializer) + + _Attributes = attributes + _Modifiers = modifiers + _VariableName = variableName + _AsLocation = asLocation + _ParameterType = parameterType + _EqualsLocation = equalsLocation + _Initializer = initializer + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, Attributes) + AddChild(childList, Modifiers) + AddChild(childList, VariableName) + AddChild(childList, ParameterType) + AddChild(childList, Initializer) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Parameters/ParameterCollection.vb b/aspclassiccompiler/Parser/Trees/Parameters/ParameterCollection.vb new file mode 100644 index 0000000..aa671d0 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Parameters/ParameterCollection.vb @@ -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. +' + +''' +''' A collection of parameters. +''' +Public NotInheritable Class ParameterCollection + Inherits CommaDelimitedTreeCollection(Of Parameter) + + Private ReadOnly _RightParenthesisLocation As Location + + ''' + ''' The location of the ')'. + ''' + Public ReadOnly Property RightParenthesisLocation() As Location + Get + Return _RightParenthesisLocation + End Get + End Property + + ''' + ''' Constructs a new collection of parameters. + ''' + ''' The parameters in the collection + ''' The locations of the commas. + ''' The location of the right parenthesis. + ''' The location of the parse tree. + Public Sub New(ByVal parameters As IList(Of Parameter), ByVal commaLocations As IList(Of Location), ByVal rightParenthesisLocation As Location, ByVal span As Span) + MyBase.New(TreeType.ParameterCollection, parameters, commaLocations, span) + + _RightParenthesisLocation = rightParenthesisLocation + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/AddHandlerStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/AddHandlerStatement.vb new file mode 100644 index 0000000..cc9895e --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/AddHandlerStatement.vb @@ -0,0 +1,28 @@ +' +' 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. +' + +''' +''' A parse tree for an AddHandler statement. +''' +Public NotInheritable Class AddHandlerStatement + Inherits HandlerStatement + + ''' + ''' Constructs a new parse tree for an AddHandler statement. + ''' + ''' The name of the event. + ''' The location of the ','. + ''' The delegate expression. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal name As Expression, ByVal commaLocation As Location, ByVal delegateExpression As Expression, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.AddHandlerStatement, name, commaLocation, delegateExpression, span, comments) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/AssignmentStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/AssignmentStatement.vb new file mode 100644 index 0000000..1399951 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/AssignmentStatement.vb @@ -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. +' + +''' +''' A parse tree for an assignment statement. +''' +Public NotInheritable Class AssignmentStatement + Inherits Statement + + Private ReadOnly _TargetExpression As Expression + Private ReadOnly _OperatorLocation As Location + Private ReadOnly _SourceExpression As Expression + Private ReadOnly _IsSetStatement As Boolean + + ''' + ''' The target of the assignment. + ''' + Public ReadOnly Property TargetExpression() As Expression + Get + Return _TargetExpression + End Get + End Property + + ''' + ''' The location of the operator. + ''' + Public ReadOnly Property OperatorLocation() As Location + Get + Return _OperatorLocation + End Get + End Property + + ''' + ''' The source of the assignment. + ''' + Public ReadOnly Property SourceExpression() As Expression + Get + Return _SourceExpression + End Get + End Property + + Public ReadOnly Property IsSetStatement() As Boolean + Get + Return _IsSetStatement + End Get + End Property + + ''' + ''' Constructs a new parse tree for an assignment statement. + ''' + ''' The target of the assignment. + ''' The location of the operator. + ''' The source of the assignment. + ''' The location of the parse tree. + ''' The comments for the parse tree. + ''' Whether is is a set statement + Public Sub New(ByVal targetExpression As Expression, ByVal operatorLocation As Location, ByVal sourceExpression As Expression, ByVal span As Span, ByVal comments As IList(Of Comment), ByVal isSetStatement As Boolean) + MyBase.New(TreeType.AssignmentStatement, span, comments) + + If targetExpression Is Nothing Then + Throw New ArgumentNullException("targetExpression") + End If + + If sourceExpression Is Nothing Then + Throw New ArgumentNullException("sourceExpression") + End If + + SetParent(targetExpression) + SetParent(sourceExpression) + + _TargetExpression = targetExpression + _OperatorLocation = operatorLocation + _SourceExpression = sourceExpression + _IsSetStatement = isSetStatement + End Sub + + ''' + ''' Constructs a new parse tree for an assignment statement. + ''' + ''' The target of the assignment. + ''' The location of the operator. + ''' The source of the assignment. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal targetExpression As Expression, ByVal operatorLocation As Location, ByVal sourceExpression As Expression, ByVal span As Span, ByVal comments As IList(Of Comment)) + Me.New(targetExpression, operatorLocation, sourceExpression, span, comments, False) + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, TargetExpression) + AddChild(childList, SourceExpression) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/BlockStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/BlockStatement.vb new file mode 100644 index 0000000..1784669 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/BlockStatement.vb @@ -0,0 +1,38 @@ +' +' 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. +' + +''' +''' A parse tree for a block statement. +''' +Public MustInherit Class BlockStatement + Inherits Statement + + Private ReadOnly _Statements As StatementCollection + + ''' + ''' The statements in the block. + ''' + Public ReadOnly Property Statements() As StatementCollection + Get + Return _Statements + End Get + End Property + + Protected Sub New(ByVal type As TreeType, ByVal statements As StatementCollection, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(type, span, comments) + + _Statements = statements + SetParent(statements) + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, Statements) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/CallStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/CallStatement.vb new file mode 100644 index 0000000..05edbe8 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/CallStatement.vb @@ -0,0 +1,75 @@ +' +' 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. +' + +''' +''' A parse tree for a method call statement. +''' +Public NotInheritable Class CallStatement + Inherits Statement + + Private ReadOnly _CallLocation As Location + Private ReadOnly _TargetExpression As Expression + Private ReadOnly _Arguments As ArgumentCollection + + ''' + ''' The location of the 'Call', if any. + ''' + Public ReadOnly Property CallLocation() As Location + Get + Return _CallLocation + End Get + End Property + + ''' + ''' The target of the call. + ''' + Public ReadOnly Property TargetExpression() As Expression + Get + Return _TargetExpression + End Get + End Property + + ''' + ''' The arguments to the call. + ''' + Public ReadOnly Property Arguments() As ArgumentCollection + Get + Return _Arguments + End Get + End Property + + ''' + ''' Constructs a new parse tree for a method call statement. + ''' + ''' The location of the 'Call', if any. + ''' The target of the call. + ''' The arguments to the call. + ''' The location of the parse tree. + ''' The comments of the parse tree. + Public Sub New(ByVal callLocation As Location, ByVal targetExpression As Expression, ByVal arguments As ArgumentCollection, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.CallStatement, span, comments) + + If targetExpression Is Nothing Then + Throw New ArgumentNullException("targetExpression") + End If + + SetParent(targetExpression) + SetParent(arguments) + + _CallLocation = callLocation + _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 \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/CaseBlockStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/CaseBlockStatement.vb new file mode 100644 index 0000000..edb95c8 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/CaseBlockStatement.vb @@ -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. +' + +''' +''' A parse tree for the block of a Case statement. +''' +Public NotInheritable Class CaseBlockStatement + Inherits BlockStatement + + Private ReadOnly _CaseStatement As CaseStatement + + ''' + ''' The Case statement that started the block. + ''' + Public ReadOnly Property CaseStatement() As CaseStatement + Get + Return _CaseStatement + End Get + End Property + + ''' + ''' Constructs a new parse tree for the block of a Case statement. + ''' + ''' The Case statement that started the block. + ''' The statements in the block. + ''' The location of the parse tree. + ''' The comments of the tree. + Public Sub New(ByVal caseStatement As CaseStatement, ByVal statements As StatementCollection, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.CaseBlockStatement, statements, span, comments) + + If caseStatement Is Nothing Then + Throw New ArgumentNullException("caseStatement") + End If + + SetParent(caseStatement) + _CaseStatement = caseStatement + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, CaseStatement) + MyBase.GetChildTrees(childList) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/CaseElseBlockStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/CaseElseBlockStatement.vb new file mode 100644 index 0000000..7255c03 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/CaseElseBlockStatement.vb @@ -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. +' + +''' +''' A parse tree for the block of a Case Else statement. +''' +Public NotInheritable Class CaseElseBlockStatement + Inherits BlockStatement + + Private ReadOnly _CaseElseStatement As CaseElseStatement + + ''' + ''' The Case Else statement that started the block. + ''' + Public ReadOnly Property CaseElseStatement() As CaseElseStatement + Get + Return _CaseElseStatement + End Get + End Property + + ''' + ''' Constructs a new parse tree for the block of a Case Else statement. + ''' + ''' The Case Else statement that started the block. + ''' The statements in the block. + ''' The location of the parse tree. + ''' The comments of the tree. + Public Sub New(ByVal caseElseStatement As CaseElseStatement, ByVal statements As StatementCollection, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.CaseElseBlockStatement, statements, span, comments) + + If caseElseStatement Is Nothing Then + Throw New ArgumentNullException("caseElseStatement") + End If + + SetParent(caseElseStatement) + _CaseElseStatement = caseElseStatement + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, CaseElseStatement) + MyBase.GetChildTrees(childList) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/CaseElseStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/CaseElseStatement.vb new file mode 100644 index 0000000..566a9bb --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/CaseElseStatement.vb @@ -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. +' + +''' +''' A parse tree for a Case Else statement. +''' +Public NotInheritable Class CaseElseStatement + Inherits Statement + + Private ReadOnly _ElseLocation As Location + + ''' + ''' The location of the 'Else'. + ''' + Public ReadOnly Property ElseLocation() As Location + Get + Return _ElseLocation + End Get + End Property + + ''' + ''' Constructs a new parse tree for a Case Else statement. + ''' + ''' The location of the 'Else'. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal elseLocation As Location, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.CaseElseStatement, span, comments) + + _ElseLocation = elseLocation + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/CaseStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/CaseStatement.vb new file mode 100644 index 0000000..a8529c3 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/CaseStatement.vb @@ -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. +' + +''' +''' A parse tree for a Case statement. +''' +Public NotInheritable Class CaseStatement + Inherits Statement + + Private ReadOnly _CaseClauses As CaseClauseCollection + + ''' + ''' The clauses in the Case statement. + ''' + Public ReadOnly Property CaseClauses() As CaseClauseCollection + Get + Return _CaseClauses + End Get + End Property + + ''' + ''' Constructs a new parse tree for a Case statement. + ''' + ''' The clauses in the Case statement. + ''' The location of the parse tree. + ''' The comments on the parse tree. + Public Sub New(ByVal caseClauses As CaseClauseCollection, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.CaseStatement, span, comments) + + If caseClauses Is Nothing Then + Throw New ArgumentNullException("caseClauses") + End If + + SetParent(caseClauses) + _CaseClauses = caseClauses + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, CaseClauses) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/CatchBlockStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/CatchBlockStatement.vb new file mode 100644 index 0000000..9fe821d --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/CatchBlockStatement.vb @@ -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. +' + +''' +''' A parse tree for a Catch block statement. +''' +Public NotInheritable Class CatchBlockStatement + Inherits BlockStatement + + Private ReadOnly _CatchStatement As CatchStatement + + ''' + ''' The Catch statement. + ''' + Public ReadOnly Property CatchStatement() As CatchStatement + Get + Return _CatchStatement + End Get + End Property + + ''' + ''' Constructs a new parse tree for a Catch block statement. + ''' + ''' The Catch statement. + ''' The statements in the block. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal catchStatement As CatchStatement, ByVal statements As StatementCollection, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.CatchBlockStatement, statements, span, comments) + + If catchStatement Is Nothing Then + Throw New ArgumentNullException("catchStatement") + End If + + SetParent(catchStatement) + _CatchStatement = catchStatement + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, CatchStatement) + MyBase.GetChildTrees(childList) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/CatchStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/CatchStatement.vb new file mode 100644 index 0000000..f5a2c61 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/CatchStatement.vb @@ -0,0 +1,97 @@ +' +' 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. +' + +''' +''' A parse tree for a Catch statement. +''' +Public NotInheritable Class CatchStatement + Inherits Statement + + Private ReadOnly _Name As SimpleName + Private ReadOnly _AsLocation As Location + Private ReadOnly _ExceptionType As TypeName + Private ReadOnly _WhenLocation As Location + Private ReadOnly _FilterExpression As Expression + + ''' + ''' The name of the catch variable, if any. + ''' + Public ReadOnly Property Name() As SimpleName + Get + Return _Name + End Get + End Property + + ''' + ''' The location of the 'As', if any. + ''' + Public ReadOnly Property AsLocation() As Location + Get + Return _AsLocation + End Get + End Property + + ''' + ''' The type of the catch variable, if any. + ''' + Public ReadOnly Property ExceptionType() As TypeName + Get + Return _ExceptionType + End Get + End Property + + ''' + ''' The location of the 'When', if any. + ''' + Public ReadOnly Property WhenLocation() As Location + Get + Return _WhenLocation + End Get + End Property + + ''' + ''' The filter expression, if any. + ''' + Public ReadOnly Property FilterExpression() As Expression + Get + Return _FilterExpression + End Get + End Property + + ''' + ''' Constructs a new parse tree for a Catch statement. + ''' + ''' The name of the catch variable, if any. + ''' The location of the 'As', if any. + ''' The type of the catch variable, if any. + ''' The location of the 'When', if any. + ''' The filter expression, if any. + ''' The location of the parse tree, if any. + ''' The comments for the parse tree, if any. + Public Sub New(ByVal name As SimpleName, ByVal asLocation As Location, ByVal exceptionType As TypeName, ByVal whenLocation As Location, ByVal filterExpression As Expression, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.CatchStatement, span, comments) + + SetParent(name) + SetParent(exceptionType) + SetParent(filterExpression) + + _Name = name + _AsLocation = asLocation + _ExceptionType = exceptionType + _WhenLocation = whenLocation + _FilterExpression = filterExpression + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, Name) + AddChild(childList, ExceptionType) + AddChild(childList, FilterExpression) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/CompoundAssignmentStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/CompoundAssignmentStatement.vb new file mode 100644 index 0000000..d648dc5 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/CompoundAssignmentStatement.vb @@ -0,0 +1,95 @@ +' +' 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. +' + +''' +''' A parse tree for a compound assignment statement. +''' +Public NotInheritable Class CompoundAssignmentStatement + Inherits Statement + + Private ReadOnly _TargetExpression As Expression + Private ReadOnly _CompoundOperator As OperatorType + Private ReadOnly _OperatorLocation As Location + Private ReadOnly _SourceExpression As Expression + + ''' + ''' The target of the assignment. + ''' + Public ReadOnly Property TargetExpression() As Expression + Get + Return _TargetExpression + End Get + End Property + + ''' + ''' The compound operator. + ''' + Public ReadOnly Property CompoundOperator() As OperatorType + Get + Return _CompoundOperator + End Get + End Property + + ''' + ''' The location of the operator. + ''' + Public ReadOnly Property OperatorLocation() As Location + Get + Return _OperatorLocation + End Get + End Property + + ''' + ''' The source of the assignment. + ''' + Public ReadOnly Property SourceExpression() As Expression + Get + Return _SourceExpression + End Get + End Property + + ''' + ''' Constructs a new parse tree for a compound assignment statement. + ''' + ''' The compound operator. + ''' The target of the assignment. + ''' The location of the operator. + ''' The source of the assignment. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal compoundOperator As OperatorType, ByVal targetExpression As Expression, ByVal operatorLocation As Location, ByVal sourceExpression As Expression, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.CompoundAssignmentStatement, span, comments) + + If compoundOperator < OperatorType.Plus OrElse compoundOperator > OperatorType.Power Then + Throw New ArgumentOutOfRangeException("compoundOperator") + End If + + If targetExpression Is Nothing Then + Throw New ArgumentNullException("targetExpression") + End If + + If sourceExpression Is Nothing Then + Throw New ArgumentNullException("sourceExpression") + End If + + SetParent(targetExpression) + SetParent(sourceExpression) + + _CompoundOperator = compoundOperator + _TargetExpression = targetExpression + _OperatorLocation = operatorLocation + _SourceExpression = sourceExpression + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, TargetExpression) + AddChild(childList, SourceExpression) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/ContinueStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/ContinueStatement.vb new file mode 100644 index 0000000..d751293 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/ContinueStatement.vb @@ -0,0 +1,59 @@ +' +' 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. +' + +''' +''' A parse tree for an Continue statement. +''' +Public NotInheritable Class ContinueStatement + Inherits Statement + + Private ReadOnly _ContinueType As BlockType + Private ReadOnly _ContinueArgumentLocation As Location + + ''' + ''' The type of tree this statement continues. + ''' + Public ReadOnly Property ContinueType() As BlockType + Get + Return _ContinueType + End Get + End Property + + ''' + ''' The location of the Continue statement type. + ''' + Public ReadOnly Property ContinueArgumentLocation() As Location + Get + Return _ContinueArgumentLocation + End Get + End Property + + ''' + ''' Constructs a parse tree for an Continue statement. + ''' + ''' The type of tree this statement continues. + ''' The location of the Continue statement type. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal continueType As BlockType, ByVal continueArgumentLocation As Location, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.ContinueStatement, span, comments) + + Select Case continueType + Case BlockType.Do, BlockType.For, BlockType.While, BlockType.None + ' OK + + Case Else + Throw New ArgumentOutOfRangeException("continueType") + End Select + + _ContinueType = continueType + _ContinueArgumentLocation = continueArgumentLocation + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/DoBlockStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/DoBlockStatement.vb new file mode 100644 index 0000000..0419ea7 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/DoBlockStatement.vb @@ -0,0 +1,85 @@ +' +' 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. +' + +''' +''' A parse tree for a Do statement. +''' +Public NotInheritable Class DoBlockStatement + Inherits BlockStatement + + Private ReadOnly _IsWhile As Boolean + Private ReadOnly _WhileOrUntilLocation As Location + Private ReadOnly _Expression As Expression + Private ReadOnly _EndStatement As LoopStatement + + ''' + ''' Whether the Do is followed by a While or Until, if any. + ''' + Public ReadOnly Property IsWhile() As Boolean + Get + Return _IsWhile + End Get + End Property + + ''' + ''' The location of the While or Until, if any. + ''' + Public ReadOnly Property WhileOrUntilLocation() As Location + Get + Return _WhileOrUntilLocation + End Get + End Property + + ''' + ''' The While or Until expression, if any. + ''' + Public ReadOnly Property Expression() As Expression + Get + Return _Expression + End Get + End Property + + ''' + ''' The ending Loop statement. + ''' + Public ReadOnly Property EndStatement() As LoopStatement + Get + Return _EndStatement + End Get + End Property + + ''' + ''' Constructs a new parse tree for a Do statement. + ''' + ''' The While or Until expression, if any. + ''' Whether the Do is followed by a While or Until, if any. + ''' The location of the While or Until, if any. + ''' The statements in the block. + ''' The ending Loop statement. + ''' The location of the parse tree. + ''' The comments on the parse tree. + Public Sub New(ByVal expression As Expression, ByVal isWhile As Boolean, ByVal whileOrUntilLocation As Location, ByVal statements As StatementCollection, ByVal endStatement As LoopStatement, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.DoBlockStatement, statements, span, comments) + + SetParent(expression) + SetParent(endStatement) + + _Expression = expression + _IsWhile = isWhile + _WhileOrUntilLocation = whileOrUntilLocation + _EndStatement = endStatement + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, Expression) + MyBase.GetChildTrees(childList) + AddChild(childList, EndStatement) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/ElseBlockStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/ElseBlockStatement.vb new file mode 100644 index 0000000..722a34b --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/ElseBlockStatement.vb @@ -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. +' + +''' +''' A parse tree for an Else block statement. +''' +Public NotInheritable Class ElseBlockStatement + Inherits BlockStatement + + Private ReadOnly _ElseStatement As ElseStatement + + ''' + ''' The Else or Else If statement. + ''' + Public ReadOnly Property ElseStatement() As ElseStatement + Get + Return _ElseStatement + End Get + End Property + + ''' + ''' Constructs a new parse tree for an Else block statement. + ''' + ''' The Else statement. + ''' The statements in the block. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal elseStatement As ElseStatement, ByVal statements As StatementCollection, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.ElseBlockStatement, statements, span, comments) + + If elseStatement Is Nothing Then + Throw New ArgumentNullException("elseStatement") + End If + + SetParent(elseStatement) + _ElseStatement = elseStatement + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, ElseStatement) + MyBase.GetChildTrees(childList) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/ElseIfBlockStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/ElseIfBlockStatement.vb new file mode 100644 index 0000000..8ed4d94 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/ElseIfBlockStatement.vb @@ -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. +' + +''' +''' A parse tree for an Else If block statement. +''' +Public NotInheritable Class ElseIfBlockStatement + Inherits BlockStatement + + Private ReadOnly _ElseIfStatement As ElseIfStatement + + ''' + ''' The Else If statement. + ''' + Public ReadOnly Property ElseIfStatement() As ElseIfStatement + Get + Return _ElseIfStatement + End Get + End Property + + ''' + ''' Constructs a new parse tree for an Else If block statement. + ''' + ''' The Else If statement. + ''' The statements in the block. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal elseIfStatement As ElseIfStatement, ByVal statements As StatementCollection, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.ElseIfBlockStatement, statements, span, comments) + + If elseIfStatement Is Nothing Then + Throw New ArgumentNullException("elseIfStatement") + End If + + SetParent(elseIfStatement) + _ElseIfStatement = elseIfStatement + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, ElseIfStatement) + MyBase.GetChildTrees(childList) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/ElseIfStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/ElseIfStatement.vb new file mode 100644 index 0000000..5790ee6 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/ElseIfStatement.vb @@ -0,0 +1,60 @@ +' +' 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. +' + +''' +''' A parse tree for an Else If statement. +''' +Public NotInheritable Class ElseIfStatement + Inherits Statement + + Private ReadOnly _Expression As Expression + Private ReadOnly _ThenLocation As Location + + ''' + ''' The conditional expression. + ''' + Public ReadOnly Property Expression() As Expression + Get + Return _Expression + End Get + End Property + + ''' + ''' The location of the 'Then', if any. + ''' + Public ReadOnly Property ThenLocation() As Location + Get + Return _ThenLocation + End Get + End Property + + ''' + ''' Constructs a new parse tree for an Else If statement. + ''' + ''' The conditional expression. + ''' The location of the 'Then', if any. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal expression As Expression, ByVal thenLocation As Location, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.ElseIfStatement, span, comments) + + If expression Is Nothing Then + Throw New ArgumentNullException("expression") + End If + + SetParent(expression) + _Expression = expression + _ThenLocation = thenLocation + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, Expression) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/ElseStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/ElseStatement.vb new file mode 100644 index 0000000..1f19424 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/ElseStatement.vb @@ -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. +' + +''' +''' A parse tree for an Else statement. +''' +Public NotInheritable Class ElseStatement + Inherits Statement + + ''' + ''' Constructs a new parse tree for an Else statement. + ''' + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.ElseStatement, span, comments) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/EmptyStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/EmptyStatement.vb new file mode 100644 index 0000000..98b89f2 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/EmptyStatement.vb @@ -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. +' + +''' +''' A parse tree for an empty statement. +''' +Public NotInheritable Class EmptyStatement + Inherits Statement + + ''' + ''' Constructs a new parse tree for an empty statement. + ''' + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.EmptyStatement, span, comments) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/EndBlockStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/EndBlockStatement.vb new file mode 100644 index 0000000..86bd794 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/EndBlockStatement.vb @@ -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. +' + +''' +''' A parse tree for an End statement of a block. +''' +Public NotInheritable Class EndBlockStatement + Inherits Statement + + Private ReadOnly _EndType As BlockType + Private ReadOnly _EndArgumentLocation As Location + + ''' + ''' The type of block the statement ends. + ''' + Public ReadOnly Property EndType() As BlockType + Get + Return _EndType + End Get + End Property + + ''' + ''' The location of the end block argument. + ''' + Public ReadOnly Property EndArgumentLocation() As Location + Get + Return _EndArgumentLocation + End Get + End Property + + ''' + ''' Creates a new parse tree for an End block statement. + ''' + ''' The type of the block the statement ends. + ''' The location of the end block argument. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal endType As BlockType, ByVal endArgumentLocation As Location, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.EndBlockStatement, span, comments) + + If endType < BlockType.While OrElse endType > BlockType.Namespace Then + Throw New ArgumentOutOfRangeException("endType") + End If + + _EndType = endType + _EndArgumentLocation = endArgumentLocation + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/EndStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/EndStatement.vb new file mode 100644 index 0000000..8cc154c --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/EndStatement.vb @@ -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. +' + +''' +''' A parse tree for an End statement. +''' +Public NotInheritable Class EndStatement + Inherits Statement + + ''' + ''' Constructs a new parse tree for an End statement. + ''' + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.EndStatement, span, comments) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/EraseStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/EraseStatement.vb new file mode 100644 index 0000000..f7a9783 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/EraseStatement.vb @@ -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. +' + +''' +''' A parse tree for an Erase statement. +''' +Public NotInheritable Class EraseStatement + Inherits Statement + + Private ReadOnly _Variables As ExpressionCollection + + ''' + ''' The variables to erase. + ''' + Public ReadOnly Property Variables() As ExpressionCollection + Get + Return _Variables + End Get + End Property + + ''' + ''' Constructs a new parse tree for an Erase statement. + ''' + ''' The variables to erase. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal variables As ExpressionCollection, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.EraseStatement, span, comments) + + If variables Is Nothing Then + Throw New ArgumentNullException("variables") + End If + + SetParent(variables) + _Variables = variables + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, Variables) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/ErrorStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/ErrorStatement.vb new file mode 100644 index 0000000..1f99f13 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/ErrorStatement.vb @@ -0,0 +1,26 @@ +' +' 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. +' + +''' +''' A parse tree for an Error statement. +''' +Public NotInheritable Class ErrorStatement + Inherits ExpressionStatement + + ''' + ''' Constructs a new parse tree for an Error statement. + ''' + ''' The expression. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal expression As Expression, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.ErrorStatement, expression, span, comments) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/ExitStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/ExitStatement.vb new file mode 100644 index 0000000..294bae3 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/ExitStatement.vb @@ -0,0 +1,60 @@ +' +' 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. +' + +''' +''' A parse tree for an Exit statement. +''' +Public NotInheritable Class ExitStatement + Inherits Statement + + Private ReadOnly _ExitType As BlockType + Private ReadOnly _ExitArgumentLocation As Location + + ''' + ''' The type of tree this statement exits. + ''' + Public ReadOnly Property ExitType() As BlockType + Get + Return _ExitType + End Get + End Property + + ''' + ''' The location of the exit statement type. + ''' + Public ReadOnly Property ExitArgumentLocation() As Location + Get + Return _ExitArgumentLocation + End Get + End Property + + ''' + ''' Constructs a parse tree for an Exit statement. + ''' + ''' The type of tree this statement exits. + ''' The location of the exit statement type. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal exitType As BlockType, ByVal exitArgumentLocation As Location, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.ExitStatement, span, comments) + + Select Case exitType + Case BlockType.Do, BlockType.For, BlockType.While, BlockType.Select, BlockType.Sub, BlockType.Function, _ + BlockType.Property, BlockType.Try, BlockType.None + ' OK + + Case Else + Throw New ArgumentOutOfRangeException("exitType") + End Select + + _ExitType = exitType + _ExitArgumentLocation = exitArgumentLocation + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/ExpressionBlockStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/ExpressionBlockStatement.vb new file mode 100644 index 0000000..50c5a88 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/ExpressionBlockStatement.vb @@ -0,0 +1,58 @@ +' +' 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. +' + +''' +''' A parse tree for an expression block statement. +''' +Public MustInherit Class ExpressionBlockStatement + Inherits BlockStatement + + Private ReadOnly _Expression As Expression + Private ReadOnly _EndStatement As EndBlockStatement + + ''' + ''' The expression. + ''' + Public ReadOnly Property Expression() As Expression + Get + Return _Expression + End Get + End Property + + ''' + ''' The End statement for the block, if any. + ''' + Public ReadOnly Property EndStatement() As EndBlockStatement + Get + Return _EndStatement + End Get + End Property + + Protected Sub New(ByVal type As TreeType, ByVal expression As Expression, ByVal statements As StatementCollection, ByVal endStatement As EndBlockStatement, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(type, statements, span, comments) + + Debug.Assert(type = TreeType.WithBlockStatement OrElse _ + type = TreeType.SyncLockBlockStatement OrElse _ + type = TreeType.WhileBlockStatement OrElse _ + type = TreeType.UsingBlockStatement) + + SetParent(expression) + SetParent(endStatement) + + _Expression = expression + _EndStatement = endStatement + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, Expression) + MyBase.GetChildTrees(childList) + AddChild(childList, EndStatement) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/ExpressionStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/ExpressionStatement.vb new file mode 100644 index 0000000..84098aa --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/ExpressionStatement.vb @@ -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. +' + +''' +''' A parse tree for an expression statement. +''' +Public MustInherit Class ExpressionStatement + Inherits Statement + + Private ReadOnly _Expression As Expression + + ''' + ''' The expression. + ''' + Public ReadOnly Property Expression() As Expression + Get + Return _Expression + End Get + End Property + + ''' + ''' Constructs a new parse tree for an expression statement. + ''' + ''' The type of the parse tree. + ''' The expression. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Protected Sub New(ByVal type As TreeType, ByVal expression As Expression, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(type, span, comments) + + Debug.Assert(type = TreeType.ReturnStatement OrElse type = TreeType.ErrorStatement OrElse type = TreeType.ThrowStatement) + + SetParent(expression) + _Expression = expression + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, Expression) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/FinallyBlockStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/FinallyBlockStatement.vb new file mode 100644 index 0000000..b399459 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/FinallyBlockStatement.vb @@ -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. +' + +''' +''' A parse tree for a Finally block statement. +''' +Public NotInheritable Class FinallyBlockStatement + Inherits BlockStatement + + Private ReadOnly _FinallyStatement As FinallyStatement + + ''' + ''' The Finally statement. + ''' + Public ReadOnly Property FinallyStatement() As FinallyStatement + Get + Return _FinallyStatement + End Get + End Property + + ''' + ''' Constructs a new parse tree for a Finally block statement. + ''' + ''' The Finally statement. + ''' The statements in the block. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal finallyStatement As FinallyStatement, ByVal statements As StatementCollection, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.FinallyBlockStatement, statements, span, comments) + + If finallyStatement Is Nothing Then + Throw New ArgumentNullException("finallyStatement") + End If + + SetParent(finallyStatement) + _FinallyStatement = finallyStatement + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, FinallyStatement) + MyBase.GetChildTrees(childList) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/FinallyStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/FinallyStatement.vb new file mode 100644 index 0000000..0f352d8 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/FinallyStatement.vb @@ -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. +' + +''' +''' A parse tree for a Finally statement. +''' +Public NotInheritable Class FinallyStatement + Inherits Statement + + ''' + ''' Constructs a new parse tree for a Finally statement. + ''' + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.FinallyStatement, span, comments) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/ForBlockStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/ForBlockStatement.vb new file mode 100644 index 0000000..31109e3 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/ForBlockStatement.vb @@ -0,0 +1,157 @@ +' +' 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. +' + +''' +''' A parse tree for a For statement. +''' +Public NotInheritable Class ForBlockStatement + Inherits BlockStatement + + Private ReadOnly _ControlExpression As Expression + Private ReadOnly _ControlVariableDeclarator As VariableDeclarator + Private ReadOnly _EqualsLocation As Location + Private ReadOnly _LowerBoundExpression As Expression + Private ReadOnly _ToLocation As Location + Private ReadOnly _UpperBoundExpression As Expression + Private ReadOnly _StepLocation As Location + Private ReadOnly _StepExpression As Expression + Private ReadOnly _NextStatement As NextStatement + + ''' + ''' The control expression for the loop. + ''' + Public ReadOnly Property ControlExpression() As Expression + Get + Return _ControlExpression + End Get + End Property + + ''' + ''' The control variable declarator, if any. + ''' + Public ReadOnly Property ControlVariableDeclarator() As VariableDeclarator + Get + Return _ControlVariableDeclarator + End Get + End Property + + ''' + ''' The location of the '='. + ''' + Public ReadOnly Property EqualsLocation() As Location + Get + Return _EqualsLocation + End Get + End Property + + ''' + ''' The lower bound of the loop. + ''' + Public ReadOnly Property LowerBoundExpression() As Expression + Get + Return _LowerBoundExpression + End Get + End Property + + ''' + ''' The location of the 'To'. + ''' + Public ReadOnly Property ToLocation() As Location + Get + Return _ToLocation + End Get + End Property + + ''' + ''' The upper bound of the loop. + ''' + Public ReadOnly Property UpperBoundExpression() As Expression + Get + Return _UpperBoundExpression + End Get + End Property + + ''' + ''' The location of the 'Step', if any. + ''' + Public ReadOnly Property StepLocation() As Location + Get + Return _StepLocation + End Get + End Property + + ''' + ''' The step of the loop, if any. + ''' + Public ReadOnly Property StepExpression() As Expression + Get + Return _StepExpression + End Get + End Property + + ''' + ''' The Next statement, if any. + ''' + Public ReadOnly Property NextStatement() As NextStatement + Get + Return _NextStatement + End Get + End Property + + ''' + ''' Constructs a new parse tree for a For statement. + ''' + ''' The control expression for the loop. + ''' The control variable declarator, if any. + ''' The location of the '='. + ''' The lower bound of the loop. + ''' The location of the 'To'. + ''' The upper bound of the loop. + ''' The location of the 'Step', if any. + ''' The step of the loop, if any. + ''' The statements in the For loop. + ''' The Next statement, if any. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal controlExpression As Expression, ByVal controlVariableDeclarator As VariableDeclarator, ByVal equalsLocation As Location, ByVal lowerBoundExpression As Expression, ByVal toLocation As Location, ByVal upperBoundExpression As Expression, ByVal stepLocation As Location, ByVal stepExpression As Expression, ByVal statements As StatementCollection, ByVal nextStatement As NextStatement, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.ForBlockStatement, statements, span, comments) + + If controlExpression Is Nothing Then + Throw New ArgumentNullException("controlExpression") + End If + + SetParent(controlExpression) + SetParent(controlVariableDeclarator) + SetParent(lowerBoundExpression) + SetParent(upperBoundExpression) + SetParent(stepExpression) + SetParent(nextStatement) + + _ControlExpression = controlExpression + _ControlVariableDeclarator = controlVariableDeclarator + _EqualsLocation = equalsLocation + _LowerBoundExpression = lowerBoundExpression + _ToLocation = toLocation + _UpperBoundExpression = upperBoundExpression + _StepLocation = stepLocation + _StepExpression = stepExpression + _NextStatement = nextStatement + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, ControlExpression) + AddChild(childList, ControlVariableDeclarator) + AddChild(childList, LowerBoundExpression) + AddChild(childList, UpperBoundExpression) + AddChild(childList, StepExpression) + MyBase.GetChildTrees(childList) + AddChild(childList, NextStatement) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/ForEachBlockStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/ForEachBlockStatement.vb new file mode 100644 index 0000000..054ade1 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/ForEachBlockStatement.vb @@ -0,0 +1,117 @@ +' +' 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. +' + +''' +''' A parse tree for a For Each statement. +''' +Public NotInheritable Class ForEachBlockStatement + Inherits BlockStatement + + Private ReadOnly _EachLocation As Location + Private ReadOnly _ControlExpression As Expression + Private ReadOnly _ControlVariableDeclarator As VariableDeclarator + Private ReadOnly _InLocation As Location + Private ReadOnly _CollectionExpression As Expression + Private ReadOnly _NextStatement As NextStatement + + ''' + ''' The location of the 'Each'. + ''' + Public ReadOnly Property EachLocation() As Location + Get + Return _EachLocation + End Get + End Property + + ''' + ''' The control expression. + ''' + Public ReadOnly Property ControlExpression() As Expression + Get + Return _ControlExpression + End Get + End Property + + ''' + ''' The control variable declarator, if any. + ''' + Public ReadOnly Property ControlVariableDeclarator() As VariableDeclarator + Get + Return _ControlVariableDeclarator + End Get + End Property + + ''' + ''' The location of the 'In'. + ''' + Public ReadOnly Property InLocation() As Location + Get + Return _InLocation + End Get + End Property + + ''' + ''' The collection expression. + ''' + Public ReadOnly Property CollectionExpression() As Expression + Get + Return _CollectionExpression + End Get + End Property + + ''' + ''' The Next statement, if any. + ''' + Public ReadOnly Property NextStatement() As NextStatement + Get + Return _NextStatement + End Get + End Property + + ''' + ''' Constructs a new parse tree for a For Each statement. + ''' + ''' The location of the 'Each'. + ''' The control expression. + ''' The control variable declarator, if any. + ''' The location of the 'In'. + ''' The collection expression. + ''' The statements in the block. + ''' The Next statement, if any. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal eachLocation As Location, ByVal controlExpression As Expression, ByVal controlVariableDeclarator As VariableDeclarator, ByVal inLocation As Location, ByVal collectionExpression As Expression, ByVal statements As StatementCollection, ByVal nextStatement As NextStatement, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.ForEachBlockStatement, statements, span, comments) + + If controlExpression Is Nothing Then + Throw New ArgumentNullException("controlExpression") + End If + + SetParent(controlExpression) + SetParent(controlVariableDeclarator) + SetParent(collectionExpression) + SetParent(nextStatement) + + _EachLocation = eachLocation + _ControlExpression = controlExpression + _ControlVariableDeclarator = controlVariableDeclarator + _InLocation = inLocation + _CollectionExpression = collectionExpression + _NextStatement = nextStatement + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, ControlExpression) + AddChild(childList, ControlVariableDeclarator) + AddChild(childList, CollectionExpression) + MyBase.GetChildTrees(childList) + AddChild(childList, NextStatement) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/GotoStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/GotoStatement.vb new file mode 100644 index 0000000..de5b1fe --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/GotoStatement.vb @@ -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. +' + +''' +''' A parse tree for a GoTo statement. +''' +Public NotInheritable Class GotoStatement + Inherits LabelReferenceStatement + + ''' + ''' Constructs a parse tree for a GoTo statement. + ''' + ''' The label to branch to, if any. + ''' Whether the label is a line number. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal name As SimpleName, ByVal isLineNumber As Boolean, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.GotoStatement, name, isLineNumber, span, comments) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/HandlerStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/HandlerStatement.vb new file mode 100644 index 0000000..81e6cda --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/HandlerStatement.vb @@ -0,0 +1,73 @@ +' +' 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. +' + +''' +''' A parse tree for an AddHandler or RemoveHandler statement. +''' +Public MustInherit Class HandlerStatement + Inherits Statement + + Private ReadOnly _Name As Expression + Private ReadOnly _CommaLocation As Location + Private ReadOnly _DelegateExpression As Expression + + ''' + ''' The event name. + ''' + Public ReadOnly Property Name() As Expression + Get + Return _Name + End Get + End Property + + ''' + ''' The location of the ','. + ''' + Public ReadOnly Property CommaLocation() As Location + Get + Return _CommaLocation + End Get + End Property + + ''' + ''' The delegate expression. + ''' + Public ReadOnly Property DelegateExpression() As Expression + Get + Return _DelegateExpression + End Get + End Property + + Protected Sub New(ByVal type As TreeType, ByVal name As Expression, ByVal commaLocation As Location, ByVal delegateExpression As Expression, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(type, span, comments) + + Debug.Assert(type = TreeType.AddHandlerStatement OrElse type = TreeType.RemoveHandlerStatement) + + If name Is Nothing Then + Throw New ArgumentNullException("name") + End If + + If delegateExpression Is Nothing Then + Throw New ArgumentNullException("delegateExpression") + End If + + SetParent(name) + SetParent(delegateExpression) + + _Name = name + _CommaLocation = commaLocation + _DelegateExpression = delegateExpression + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, Name) + AddChild(childList, DelegateExpression) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/IfBlockStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/IfBlockStatement.vb new file mode 100644 index 0000000..74ae017 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/IfBlockStatement.vb @@ -0,0 +1,105 @@ +' +' 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. +' + +''' +''' A parse tree for an If block. +''' +Public NotInheritable Class IfBlockStatement + Inherits BlockStatement + + Private ReadOnly _Expression As Expression + Private ReadOnly _ThenLocation As Location + Private ReadOnly _ElseIfBlockStatements As StatementCollection + Private ReadOnly _ElseBlockStatement As ElseBlockStatement + Private ReadOnly _EndStatement As EndBlockStatement + + ''' + ''' The conditional expression. + ''' + Public ReadOnly Property Expression() As Expression + Get + Return _Expression + End Get + End Property + + ''' + ''' The location of the 'Then', if any. + ''' + Public ReadOnly Property ThenLocation() As Location + Get + Return _ThenLocation + End Get + End Property + + ''' + ''' The Else If statements. + ''' + Public ReadOnly Property ElseIfBlockStatements() As StatementCollection + Get + Return _ElseIfBlockStatements + End Get + End Property + + ''' + ''' The Else statement, if any. + ''' + Public ReadOnly Property ElseBlockStatement() As ElseBlockStatement + Get + Return _ElseBlockStatement + End Get + End Property + + ''' + ''' The End If statement, if any. + ''' + Public ReadOnly Property EndStatement() As EndBlockStatement + Get + Return _EndStatement + End Get + End Property + + ''' + ''' Constructs a new parse tree for a If statement. + ''' + ''' The conditional expression. + ''' The location of the 'Then', if any. + ''' The statements in the If block. + ''' The Else If statements. + ''' The Else statement, if any. + ''' The End If statement, if any. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal expression As Expression, ByVal thenLocation As Location, ByVal statements As StatementCollection, ByVal elseIfBlockStatements As StatementCollection, ByVal elseBlockStatement As ElseBlockStatement, ByVal endStatement As EndBlockStatement, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.IfBlockStatement, statements, span, comments) + + If expression Is Nothing Then + Throw New ArgumentNullException("expression") + End If + + SetParent(expression) + SetParent(elseIfBlockStatements) + SetParent(elseBlockStatement) + SetParent(endStatement) + + _Expression = expression + _ThenLocation = thenLocation + _ElseIfBlockStatements = elseIfBlockStatements + _ElseBlockStatement = elseBlockStatement + _EndStatement = endStatement + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, Expression) + MyBase.GetChildTrees(childList) + AddChild(childList, ElseIfBlockStatements) + AddChild(childList, ElseBlockStatement) + AddChild(childList, EndStatement) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/LabelReferenceStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/LabelReferenceStatement.vb new file mode 100644 index 0000000..7d6b6eb --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/LabelReferenceStatement.vb @@ -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. +' + +''' +''' A parse tree for a statement that refers to a label. +''' +Public MustInherit Class LabelReferenceStatement + Inherits Statement + + Private ReadOnly _Name As SimpleName + Private ReadOnly _IsLineNumber As Boolean + + ''' + ''' The name of the label being referred to. + ''' + Public ReadOnly Property Name() As SimpleName + Get + Return _Name + End Get + End Property + + ''' + ''' Whether the label is a line number. + ''' + Public ReadOnly Property IsLineNumber() As Boolean + Get + Return _IsLineNumber + End Get + End Property + + Protected Sub New(ByVal type As TreeType, ByVal name As SimpleName, ByVal isLineNumber As Boolean, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(type, span, comments) + + Debug.Assert(type = TreeType.GotoStatement OrElse type = TreeType.LabelStatement OrElse _ + type = TreeType.OnErrorStatement OrElse type = TreeType.ResumeStatement) + + SetParent(name) + _Name = name + _IsLineNumber = isLineNumber + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, Name) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/LabelStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/LabelStatement.vb new file mode 100644 index 0000000..7c51244 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/LabelStatement.vb @@ -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. +' + +''' +''' A parse tree for a label declaration statement. +''' +Public NotInheritable Class LabelStatement + Inherits LabelReferenceStatement + + ''' + ''' Constructs a parse tree for a label declaration statement. + ''' + ''' The label to branch to, if any. + ''' Whether the label is a line number. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal name As SimpleName, ByVal isLineNumber As Boolean, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.LabelStatement, name, isLineNumber, span, comments) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/LineIfStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/LineIfStatement.vb new file mode 100644 index 0000000..345bd16 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/LineIfStatement.vb @@ -0,0 +1,101 @@ +' +' 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. +' + +''' +''' A parse tree for a line If statement. +''' +Public NotInheritable Class LineIfStatement + Inherits Statement + + Private ReadOnly _Expression As Expression + Private ReadOnly _ThenLocation As Location + Private ReadOnly _IfStatements As StatementCollection + Private ReadOnly _ElseLocation As Location + Private ReadOnly _ElseStatements As StatementCollection + + ''' + ''' The conditional expression. + ''' + Public ReadOnly Property Expression() As Expression + Get + Return _Expression + End Get + End Property + + ''' + ''' The location of the 'Then'. + ''' + Public ReadOnly Property ThenLocation() As Location + Get + Return _ThenLocation + End Get + End Property + + ''' + ''' The If statements. + ''' + Public ReadOnly Property IfStatements() As StatementCollection + Get + Return _IfStatements + End Get + End Property + + ''' + ''' The location of the 'Else', if any. + ''' + Public ReadOnly Property ElseLocation() As Location + Get + Return _ElseLocation + End Get + End Property + + ''' + ''' The Else statements. + ''' + Public ReadOnly Property ElseStatements() As StatementCollection + Get + Return _ElseStatements + End Get + End Property + + ''' + ''' Constructs a new parse tree for a line If statement. + ''' + ''' The conditional expression. + ''' The location of the 'Then'. + ''' The If statements. + ''' The location of the 'Else', if any. + ''' The Else statements. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal expression As Expression, ByVal thenLocation As Location, ByVal ifStatements As StatementCollection, ByVal elseLocation As Location, ByVal elseStatements As StatementCollection, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.LineIfBlockStatement, span, comments) + + If expression Is Nothing Then + Throw New ArgumentNullException("expression") + End If + + SetParent(expression) + SetParent(ifStatements) + SetParent(elseStatements) + + _Expression = expression + _ThenLocation = thenLocation + _IfStatements = ifStatements + _ElseLocation = elseLocation + _ElseStatements = elseStatements + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, Expression) + AddChild(childList, IfStatements) + AddChild(childList, ElseStatements) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/LocalDeclarationStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/LocalDeclarationStatement.vb new file mode 100644 index 0000000..fda3844 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/LocalDeclarationStatement.vb @@ -0,0 +1,67 @@ +' +' 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. +' + +''' +''' A parse tree for a local declaration statement. +''' +Public NotInheritable Class LocalDeclarationStatement + Inherits Statement + + Private ReadOnly _Modifiers As ModifierCollection + Private ReadOnly _VariableDeclarators As VariableDeclaratorCollection + + ''' + ''' The statement modifiers. + ''' + Public ReadOnly Property Modifiers() As ModifierCollection + Get + Return _Modifiers + End Get + End Property + + ''' + ''' The variable declarators. + ''' + Public ReadOnly Property VariableDeclarators() As VariableDeclaratorCollection + Get + Return _VariableDeclarators + End Get + End Property + + ''' + ''' Constructs a new parse tree for a local declaration statement. + ''' + ''' The statement modifiers. + ''' The variable declarators. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal modifiers As ModifierCollection, ByVal variableDeclarators As VariableDeclaratorCollection, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.LocalDeclarationStatement, span, comments) + + If modifiers Is Nothing Then + Throw New ArgumentNullException("modifers") + End If + + If variableDeclarators Is Nothing Then + Throw New ArgumentNullException("variableDeclarators") + End If + + SetParent(modifiers) + SetParent(variableDeclarators) + + _Modifiers = modifiers + _VariableDeclarators = variableDeclarators + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, Modifiers) + AddChild(childList, VariableDeclarators) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/LoopStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/LoopStatement.vb new file mode 100644 index 0000000..50d1a98 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/LoopStatement.vb @@ -0,0 +1,69 @@ +' +' 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. +' + +''' +''' A parse tree for a Loop statement. +''' +Public NotInheritable Class LoopStatement + Inherits Statement + + Private ReadOnly _IsWhile As Boolean + Private ReadOnly _WhileOrUntilLocation As Location + Private ReadOnly _Expression As Expression + + ''' + ''' Whether the Loop has a While or Until. + ''' + Public ReadOnly Property IsWhile() As Boolean + Get + Return _IsWhile + End Get + End Property + + ''' + ''' The location of the While or Until, if any. + ''' + Public ReadOnly Property WhileOrUntilLocation() As Location + Get + Return _WhileOrUntilLocation + End Get + End Property + + ''' + ''' The loop expression, if any. + ''' + Public ReadOnly Property Expression() As Expression + Get + Return _Expression + End Get + End Property + + ''' + ''' Constructs a parse tree for a Loop statement. + ''' + ''' The loop expression, if any. + ''' WHether the Loop has a While or Until. + ''' The location of the While or Until, if any. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal expression As Expression, ByVal isWhile As Boolean, ByVal whileOrUntilLocation As Location, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.LoopStatement, span, comments) + + SetParent(expression) + + _Expression = expression + _IsWhile = isWhile + _WhileOrUntilLocation = whileOrUntilLocation + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, Expression) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/MidAssignmentStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/MidAssignmentStatement.vb new file mode 100644 index 0000000..1938bd4 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/MidAssignmentStatement.vb @@ -0,0 +1,170 @@ +' +' 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. +' + +''' +''' A parse tree for a Mid assignment statement. +''' +Public NotInheritable Class MidAssignmentStatement + Inherits Statement + + Private ReadOnly _HasTypeCharacter As Boolean + Private ReadOnly _LeftParenthesisLocation As Location + Private ReadOnly _TargetExpression As Expression + Private ReadOnly _StartCommaLocation As Location + Private ReadOnly _StartExpression As Expression + Private ReadOnly _LengthCommaLocation As Location + Private ReadOnly _LengthExpression As Expression + Private ReadOnly _RightParenthesisLocation As Location + Private ReadOnly _OperatorLocation As Location + Private ReadOnly _SourceExpression As Expression + + ''' + ''' Whether the Mid identifier had a type character. + ''' + Public ReadOnly Property HasTypeCharacter() As Boolean + Get + Return _HasTypeCharacter + End Get + End Property + + ''' + ''' The location of the left parenthesis. + ''' + Public ReadOnly Property LeftParenthesisLocation() As Location + Get + Return _LeftParenthesisLocation + End Get + End Property + + ''' + ''' The target of the assignment. + ''' + Public ReadOnly Property TargetExpression() As Expression + Get + Return _TargetExpression + End Get + End Property + + ''' + ''' The location of the comma before the start expression. + ''' + Public ReadOnly Property StartCommaLocation() As Location + Get + Return _StartCommaLocation + End Get + End Property + + ''' + ''' The expression representing the start of the string to replace. + ''' + Public ReadOnly Property StartExpression() As Expression + Get + Return _StartExpression + End Get + End Property + + ''' + ''' The location of the comma before the length expression, if any. + ''' + Public ReadOnly Property LengthCommaLocation() As Location + Get + Return _LengthCommaLocation + End Get + End Property + + ''' + ''' The expression representing the length of the string to replace, if any. + ''' + Public ReadOnly Property LengthExpression() As Expression + Get + Return _LengthExpression + End Get + End Property + + ''' + ''' The right parenthesis location. + ''' + Public ReadOnly Property RightParenthesisLocation() As Location + Get + Return _RightParenthesisLocation + End Get + End Property + + ''' + ''' The location of the operator. + ''' + Public ReadOnly Property OperatorLocation() As Location + Get + Return _OperatorLocation + End Get + End Property + + ''' + ''' The source of the assignment. + ''' + Public ReadOnly Property SourceExpression() As Expression + Get + Return _SourceExpression + End Get + End Property + + ''' + ''' Constructs a new parse tree for an assignment statement. + ''' + ''' Whether the Mid identifier has a type character. + ''' The location of the left parenthesis. + ''' The target of the assignment. + ''' The location of the comma before the start expression. + ''' The expression representing the start of the string to replace. + ''' The location of the comma before the length expression, if any. + ''' The expression representing the length of the string to replace, if any. + ''' The location of the operator. + ''' The source of the assignment. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal hasTypeCharacter As Boolean, ByVal leftParenthesisLocation As Location, ByVal targetExpression As Expression, ByVal startCommaLocation As Location, ByVal startExpression As Expression, ByVal lengthCommaLocation As Location, ByVal lengthExpression As Expression, ByVal rightParenthesisLocation As Location, ByVal operatorLocation As Location, ByVal sourceExpression As Expression, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.MidAssignmentStatement, span, comments) + + If targetExpression Is Nothing Then + Throw New ArgumentNullException("targetExpression") + End If + + If startExpression Is Nothing Then + Throw New ArgumentNullException("startExpression") + End If + + If sourceExpression Is Nothing Then + Throw New ArgumentNullException("sourceExpression") + End If + + SetParent(targetExpression) + SetParent(startExpression) + SetParent(lengthExpression) + SetParent(sourceExpression) + + _HasTypeCharacter = hasTypeCharacter + _LeftParenthesisLocation = leftParenthesisLocation + _TargetExpression = targetExpression + _StartCommaLocation = startCommaLocation + _StartExpression = startExpression + _LengthCommaLocation = lengthCommaLocation + _LengthExpression = lengthExpression + _RightParenthesisLocation = rightParenthesisLocation + _OperatorLocation = operatorLocation + _SourceExpression = sourceExpression + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, TargetExpression) + AddChild(childList, StartExpression) + AddChild(childList, LengthExpression) + AddChild(childList, SourceExpression) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/NextStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/NextStatement.vb new file mode 100644 index 0000000..9d15035 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/NextStatement.vb @@ -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. +' + +''' +''' A parse tree for a Next statement. +''' +Public NotInheritable Class NextStatement + Inherits Statement + + Private ReadOnly _Variables As ExpressionCollection + + ''' + ''' The loop control variables. + ''' + Public ReadOnly Property Variables() As ExpressionCollection + Get + Return _Variables + End Get + End Property + + ''' + ''' Constructs a parse tree for a Next statement. + ''' + ''' The loop control variables. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal variables As ExpressionCollection, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.NextStatement, span, comments) + + SetParent(variables) + _Variables = variables + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + AddChild(childList, Variables) + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/OnErrorStatement.vb b/aspclassiccompiler/Parser/Trees/Statements/OnErrorStatement.vb new file mode 100644 index 0000000..3c75878 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/OnErrorStatement.vb @@ -0,0 +1,99 @@ +' +' 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. +' + +''' +''' A parse tree for an On Error statement. +''' +Public NotInheritable Class OnErrorStatement + Inherits LabelReferenceStatement + + Private ReadOnly _OnErrorType As OnErrorType + Private ReadOnly _ErrorLocation As Location + Private ReadOnly _ResumeOrGoToLocation As Location + Private ReadOnly _NextOrZeroOrMinusLocation As Location + Private ReadOnly _OneLocation As Location + + ''' + ''' The type of On Error statement. + ''' + Public ReadOnly Property OnErrorType() As OnErrorType + Get + Return _OnErrorType + End Get + End Property + + ''' + ''' The location of the 'Error'. + ''' + Public ReadOnly Property ErrorLocation() As Location + Get + Return _ErrorLocation + End Get + End Property + + ''' + ''' The location of the 'Resume' or 'GoTo'. + ''' + Public ReadOnly Property ResumeOrGoToLocation() As Location + Get + Return _ResumeOrGoToLocation + End Get + End Property + + ''' + ''' The location of the 'Next', '0' or '-', if any. + ''' + Public ReadOnly Property NextOrZeroOrMinusLocation() As Location + Get + Return _NextOrZeroOrMinusLocation + End Get + End Property + + ''' + ''' The location of the '1', if any. + ''' + Public ReadOnly Property OneLocation() As Location + Get + Return _OneLocation + End Get + End Property + + ''' + ''' Constructs a parse tree for an On Error statement. + ''' + ''' The type of the On Error statement. + ''' The location of the 'Error'. + ''' The location of the 'Resume' or 'GoTo'. + ''' The location of the 'Next', '0' or '-', if any. + ''' The location of the '1', if any. + ''' The label to branch to, if any. + ''' Whether the label is a line number. + ''' The location of the parse tree. + ''' The comments for the parse tree. + Public Sub New(ByVal onErrorType As OnErrorType, ByVal errorLocation As Location, ByVal resumeOrGoToLocation As Location, ByVal nextOrZeroOrMinusLocation As Location, ByVal oneLocation As Location, ByVal name As SimpleName, ByVal isLineNumber As Boolean, ByVal span As Span, ByVal comments As IList(Of Comment)) + MyBase.New(TreeType.OnErrorStatement, name, isLineNumber, span, comments) + + If onErrorType < onErrorType.Bad OrElse onErrorType > onErrorType.Label Then + Throw New ArgumentOutOfRangeException("onErrorType") + End If + + _OnErrorType = onErrorType + _ErrorLocation = errorLocation + _ResumeOrGoToLocation = resumeOrGoToLocation + _NextOrZeroOrMinusLocation = nextOrZeroOrMinusLocation + _OneLocation = oneLocation + End Sub + + Protected Overrides Sub GetChildTrees(ByVal childList As IList(Of Tree)) + If OnErrorType = OnErrorType.Label Then + MyBase.GetChildTrees(childList) + End If + End Sub +End Class \ No newline at end of file diff --git a/aspclassiccompiler/Parser/Trees/Statements/OnErrorType.vb b/aspclassiccompiler/Parser/Trees/Statements/OnErrorType.vb new file mode 100644 index 0000000..b7b4ac5 --- /dev/null +++ b/aspclassiccompiler/Parser/Trees/Statements/OnErrorType.vb @@ -0,0 +1,20 @@ +' +' 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. +' + +''' +''' The type of an On Error statement. +''' +Public Enum OnErrorType + Bad + [Next] ' On Error Resume Next + Zero ' On Error GoTo 0 + MinusOne ' On Error GoTo -1 + Label ' On Error GoTo