dumper.vb
来自「大名鼎鼎的mono是.NET平台的跨平台(支持linux」· VB 代码 · 共 1,255 行 · 第 1/3 页
VB
1,255 行
End Sub Public Sub Dump(ByVal Element As PropertySetDeclaration) If Element.CustomAttributes IsNot Nothing Then Dump(Element.CustomAttributes) ' Dump(Element.Modifiers) Dumper.Write("Set ") If Element.Signature.Parameters IsNot Nothing Then Dumper.Write("(") Dump(Element.Signature.Parameters) dumper.write(")") End If Dumper.WriteLine("") Dumper.Indent() Dump(Element.Code) Dumper.Unindent() Dumper.WriteLine("End Set") End Sub Public Sub Dump(ByVal Element As RegularPropertyDeclaration) If Element.CustomAttributes IsNot Nothing Then Dump(Element.CustomAttributes) Dump(Element.Modifiers) Dumper.Write("Property ") Dump(Element.Signature) If Element.ImplementsClause IsNot Nothing Then Dump(Element.ImplementsClause) Dumper.WriteLine("") Dumper.Indent() If Element.GetDeclaration IsNot Nothing Then Dump(Element.GetDeclaration) If Element.SetDeclaration IsNot Nothing Then Dump(Element.SetDeclaration) Dumper.Unindent() Dumper.WriteLine("End Property") End Sub Public Sub Dump(ByVal Element As PropertyGetDeclaration) If Element.CustomAttributes IsNot Nothing Then Dump(Element.CustomAttributes) 'Dump(Element.Modifiers) Dumper.WriteLine("Get ") Dumper.Indent() Dump(Element.Code) Dumper.Unindent() Dumper.WriteLine("End Get") End Sub Public Sub Dump(ByVal Element As InterfacePropertyMemberDeclaration) If Element.CustomAttributes IsNot Nothing Then Dump(Element.CustomAttributes) If Element.Modifiers IsNot Nothing Then Dump(Element.Modifiers) Dumper.Write("Property ") Dump(Element.Signature) Dumper.WriteLine("") End Sub Public Sub Dump(ByVal Element As InterfaceSubDeclaration) If Element.CustomAttributes IsNot Nothing Then Dump(Element.CustomAttributes) If Element.Modifiers IsNot Nothing Then Dump(Element.Modifiers) Dumper.Write("Sub ") Dump(Element.Signature) Dumper.WriteLine("") End Sub Public Sub Dump(ByVal Element As FunctionDeclaration) If Element.CustomAttributes IsNot Nothing Then Dump(Element.CustomAttributes) Dump(Element.Modifiers) Dumper.Write("Function ") Dump(Element.Signature) If Element.HandlesOrImplements IsNot Nothing Then Dump(Element.HandlesOrImplements) Dumper.WriteLine("") If Element.IsMustOverride = False Then Dump(Element.Code) Dumper.WriteLine("End Function") End If End Sub Public Sub Dump(ByVal Element As InterfaceEventMemberDeclaration) If Element.CustomAttributes IsNot Nothing Then Dump(Element.CustomAttributes) If Element.Modifiers IsNot Nothing Then Dump(Element.Modifiers) Dumper.Write("Event ") Dump(Element.Identifier) If Element.Parameters IsNot Nothing Then Dump(Element.Parameters) If Element.Type IsNot Nothing Then Dump(Element.Type) Dumper.WriteLine("") End Sub Public Sub Dump(ByVal Element As SubDeclaration) If Element.CustomAttributes IsNot Nothing Then Dump(Element.CustomAttributes) Dump(Element.Modifiers) Dumper.Write("Sub ") Dump(Element.Signature) If Element.HandlesOrImplements IsNot Nothing Then Dump(Element.HandlesOrImplements) Dumper.WriteLine("") If Element.IsMustOverride = False Then Dump(Element.Code) Dumper.WriteLine("End Sub") End If End Sub Public Sub Dump(ByVal Element As InterfaceFunctionDeclaration) If Element.CustomAttributes IsNot Nothing Then Dump(Element.CustomAttributes) If Element.Modifiers IsNot Nothing Then Dump(Element.Modifiers) Dumper.Write("Function ") Dump(Element.Signature) Dumper.WriteLine("") End Sub Public Sub Dump(ByVal Element As CustomEventDeclaration) If Element.CustomAttributes IsNot Nothing Then Dump(Element.CustomAttributes) Dump(Element.Modifiers) Dumper.Write("Custom Event ") Dump(Element.Identifier) Dumper.Write(" As ") Dump(Element.Type) If Element.ImplementsClause IsNot Nothing Then Dump(Element.ImplementsClause) Dumper.WriteLine("") Dumper.Indent() Dumper.WriteLine("not implemented") Dumper.Unindent() Dumper.WriteLine("End Event") End Sub Public Sub DumpClassDeclaration(ByVal Element As ClassDeclaration) If Element.CustomAttributes IsNot Nothing Then Dump(Element.CustomAttributes) If Element.Modifiers IsNot Nothing Then Dump(Element.Modifiers) Dumper.Write("Class " & Element.Identifier.Name) If Element.TypeParameters IsNot Nothing Then Dump(Element.TypeParameters) Dumper.WriteLine("") Dumper.Indent() If Element.Inherits IsNot Nothing Then Dumper.WriteLine("Inherits " & Element.Inherits.Name) If Element.Implements IsNot Nothing Then Dump(Element.Implements) If Element.Members IsNot Nothing Then Dump(Element.Members) Dumper.Unindent() Dumper.WriteLine("End Class") End Sub Public Sub Dump(ByVal Element As RegularEventDeclaration) If Element.CustomAttributes IsNot Nothing Then Dump(Element.CustomAttributes) If Element.Modifiers IsNot Nothing Then Dump(Element.Modifiers) Dumper.Write("Event ") Dump(Element.Identifier) If Element.Parameters IsNot Nothing Then Dump(Element.Parameters) If Element.Type IsNot Nothing Then Dump(Element.Type) If Element.ImplementsClause IsNot Nothing Then Dump(Element.ImplementsClause) Dumper.WriteLine("") End Sub Public Sub Dump(ByVal Element As Operand) Dumper.Write("ByVal ") Element.Identifier.Dump(Dumper) If Element.TypeName IsNot Nothing Then Dumper.Write(" As ") Dump(Element.TypeName) End If End Sub Public Sub Dump(ByVal Element As OperatorDeclaration) If Element.CustomAttributes IsNot Nothing Then Dump(Element.CustomAttributes) Dump(Element.Modifiers) Dumper.Write("Operator " & Element.Operator.ToString & "(") Dump(Element.Operand1) If Element.Operand2 IsNot Nothing Then Dumper.Write(", ") Dump(Element.Operand2) End If Dumper.Write(")") If Element.Signature.TypeName IsNot Nothing Then Dumper.Write(" As ") If Element.Signature.ReturnTypeAttributes IsNot Nothing Then Dump(Element.Signature.ReturnTypeAttributes) Dump(Element.Signature.TypeName) End If Dumper.WriteLine("") Dumper.Indent() Dump(Element.Code) Dumper.Unindent() Dumper.WriteLine("End Operator") End Sub Public Sub Dump(ByVal Element As InterfaceMemberSpecifier) Dump(Element.First) If Element.Second IsNot Nothing Then Dumper.Write(".") Dump(Element.Second) End If End Sub Public Sub Dump(ByVal Element As ParametersOrType) If Element.Parameters IsNot Nothing Then Dumper.Write("(") Dump(Element.Parameters) Dumper.Write(")") ElseIf Element.Type IsNot Nothing Then Dumper.Write("As ") Dump(Element.Type) End If End Sub Public Sub Dump(ByVal Element As MemberImplementsClause) Dumper.Write("Implements ") Dump(Element.ImplementsList) End Sub Public Sub Dump(ByVal Element As StructureDeclaration) If Element.CustomAttributes IsNot Nothing Then Dump(Element.CustomAttributes) If Element.Modifiers IsNot Nothing Then Dump(Element.Modifiers) Dumper.Write("Structure ") Element.Identifier.Dump(Dumper) If Element.TypeParameters IsNot Nothing Then Dump(Element.TypeParameters) Dumper.WriteLine("") Dumper.Indent() If Element.Implements IsNot Nothing Then Dump(Element.Implements) Dump(Element.Members) Dumper.Unindent() Dumper.WriteLine("End Structure") End Sub Public Sub Dump(ByVal Elements As InterfaceBases) For i As Integer = 0 To Elements.Bases.GetUpperBound(0) Dumper.Write("Inherits ") Dump(Elements.Bases(i)) Dumper.WriteLine("") Next End Sub Public Sub Dump(ByVal Element As InterfaceDeclaration) If Element.CustomAttributes IsNot Nothing Then Dump(Element.CustomAttributes) Dump(Element.Modifiers) Dumper.Write("Interface ") Element.Identifier.Dump(Dumper) If Element.TypeParameters IsNot Nothing Then Dump(Element.TypeParameters) Dumper.WriteLine("") Dumper.Indent() If Element.InterfaceBases IsNot Nothing Then Dump(Element.InterfaceBases) Dump(Element.Members) Dumper.Unindent() Dumper.WriteLine("End Interface") End Sub Public Sub Dump(ByVal Element As EnumDeclaration) If Element.CustomAttributes IsNot Nothing Then Dump(Element.CustomAttributes) If Element.Modifiers IsNot Nothing Then Dump(Element.Modifiers) Dumper.Write("Enum " & Element.Name) If Element.QualifiedName <> KS.None Then Dumper.Write(" As " & Element.QualifiedName.ToString) End If Dumper.WriteLine("") Dumper.Indent() Dump(Element.Members) Dumper.Unindent() Dumper.WriteLine("End Enum") End Sub Public Sub Dump(ByVal Element As SubSignature) If Element.Identifier IsNot Nothing AndAlso TypeOf Element.FindMethod Is ConstructorDeclaration = False Then Element.Identifier.Dump(Dumper) End If If Element.TypeParameters IsNot Nothing Then Dump(Element.TypeParameters) If Element.Parameters IsNot Nothing Then Dumper.Write("(") Dump(Element.Parameters) Dumper.Write(")") End If End Sub Public Sub Dump(ByVal Element As DelegateDeclaration) If Element.CustomAttributes IsNot Nothing Then Dump(Element.CustomAttributes) If Element.Modifiers IsNot Nothing Then Dump(Element.Modifiers) Dump(Element.Modifiers) End Sub Public Sub Dump(ByVal Elements As TypeParameterConstraints) Dumper.Write(" As ") Dumper.Write("{") Dump(Elements.Constraints) Dumper.Write("}") End Sub Public Sub Dump(ByVal Element As TypeParameter) Element.Identifier.Dump(Dumper) If Element.TypeParameterConstraints IsNot Nothing Then Dump(Element.TypeParameterConstraints) End Sub Public Sub Dump(ByVal Element As TypeParameters) If Element IsNot Nothing AndAlso Element.Parameters IsNot Nothing AndAlso Element.Parameters.Count > 0 Then Dumper.Write("(Of ") Dump(Element.Parameters) Dumper.Write(")") End If End Sub Public Sub Dump(ByVal Elements As Attributes) If Elements.Count > 0 Then Dumper.Write("<") For Each e As Attribute In Elements Dump(e) Next Dumper.Write(">") End If End Sub Public Sub Dump(ByVal Element As BaseList) Dim sep As String = "" For Each e As BaseObject In Element Dumper.Write(sep) Dump(e) sep = ", " Next End Sub Public Sub Dump(ByVal Element As SimpleTypeName) Dump(Element.TypeName) End Sub Public Sub Dump(ByVal Element As ModuleDeclaration) If Element.CustomAttributes IsNot Nothing Then Dump(Element.CustomAttributes) Dump(Element.Modifiers) Dumper.Write("Module " & Element.Name) Dumper.WriteLine("") Dumper.Indent() Dump(Element.Members) Dumper.Unindent() Dumper.WriteLine("End Module") End Sub Public Sub Dump(ByVal Element As VariableIdentifier) Dump(Element.Identifier) If Element.ArrayNameModifier IsNot Nothing Then Dump(Element.ArrayNameModifier) End If End Sub Sub Dump(ByVal Element As Token) Element.Dump(Dumper) End Sub Public Sub Dump(ByVal Element As NamedArgument) Dumper.Write(Element.Name & " := ") Element.Expression.Dump(Dumper) End Sub Public Sub Dump(ByVal Element As BuiltInTypeName) Dumper.Write(Element.TypeName.ToString) End Sub Public Sub Dump(ByVal Element As LibraryClause) Dumper.Write("Lib """ & Element.StringLiteral.LiteralValue.ToString & "") End Sub Public Sub Dump(ByVal Element As AliasClause) Dumper.Write("Alias """ & Element.StringLiteral.LiteralValue.ToString & "") End Sub Public Sub Dump(ByVal Element As Modifiers) If Element.Modifiers Is Nothing Then Return For Each ks As KS In Element.Modifiers Dumper.Write(ks.ToString & " ") Next End Sub Public Sub Dump(ByVal Element As ParameterIdentifier) Dump(Element.Identifier) If Element.ArrayNameModifier IsNot Nothing Then Dump(Element.ArrayNameModifier) End Sub Public Sub Dump(ByVal Element As ArraySizeInitializationModifier) Dumper.Write("(") If Element.BoundList IsNot Nothing Then Dump(Element.BoundList) End If If Element.ArrayTypeModifiers IsNot Nothing Then Dump(Element.ArrayTypeModifiers) End If Dumper.Write(")") End Sub Public Sub Dump(ByVal Element As ArrayNameModifier) Dump(Element.ArrayModifier) End Sub Public Sub Dump(ByVal Element As Parameter) If Element.Attributes IsNot Nothing Then Dump(Element.Attributes) Dump(Element.Modifiers) Dumper.Write(Element.Name) If Element.TypeName IsNot Nothing Then Dumper.Write(" As ") Dump(Element.TypeName) End If If Element.ConstantExpression IsNot Nothing Then Dumper.Write(" = ") Element.ConstantExpression.Dump(Dumper) End If End Sub ''' <summary> ''' Dumps the type name. ''' </summary> ''' <remarks></remarks> Public Sub Dump(ByVal Element As TypeName) If Element.TypeName IsNot Nothing Then Dump(Element.TypeName) Else Dumper.Write(Element.ToString) End If End Sub Public Sub Dump(ByVal Element As ArrayTypeModifiers) Dumper.Write(Element.ToString) End Sub Public Sub Dump(ByVal Element As NonArrayTypeName) Dump(Element.TypeName) End Sub Public Sub Dump(ByVal Element As AttributeBlock) Dumper.Write("<") Dump(Element.List) Dumper.Write(">") End Sub#Else Sub Dump(ByVal o As Object) End Sub#End IfEnd Class
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?