1 write to _writer
VisualBasicSyntaxGenerator (1)
GreenNodes\GreenNodeWriter.vb (1)
28
_writer
= writer
168 references to _writer
VisualBasicSyntaxGenerator (168)
GreenNodes\GreenNodeWriter.vb (168)
38
_writer
.WriteLine()
40
_writer
.WriteLine("Namespace {0}", Ident(_parseTree.NamespaceName) + ".Syntax.InternalSyntax")
41
_writer
.WriteLine()
55
_writer
.WriteLine("End Namespace")
85
GenerateXmlComment(
_writer
, nodeStructure, 4, includeRemarks:=False)
88
_writer
.Write(" ")
90
_writer
.Write("Partial ")
95
_writer
.WriteLine("{0} MustInherit Class {1}", visibility, StructureTypeName(nodeStructure))
97
_writer
.WriteLine("{0} NotInheritable Class {1}", visibility, StructureTypeName(nodeStructure))
99
_writer
.WriteLine("{0} Class {1}", visibility, StructureTypeName(nodeStructure))
104
_writer
.WriteLine(" Inherits {0}", StructureTypeName(nodeStructure.ParentStructure))
106
_writer
.WriteLine()
162
_writer
.WriteLine(" End Class")
163
_writer
.WriteLine()
172
_writer
.WriteLine(" Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode")
173
_writer
.WriteLine(" Return new {0}.Syntax.{1}(Me, parent, startLocation)", _parseTree.NamespaceName, StructureTypeName(nodeStructure))
174
_writer
.WriteLine(" End Function")
175
_writer
.WriteLine()
186
_writer
.WriteLine(" Friend Overrides Function SetDiagnostics(ByVal newErrors As DiagnosticInfo()) As GreenNode")
187
_writer
.Write(" Return new {0}", StructureTypeName(nodeStructure))
189
_writer
.WriteLine(" End Function")
190
_writer
.WriteLine()
201
_writer
.WriteLine(" Friend Overrides Function SetAnnotations(ByVal annotations As SyntaxAnnotation()) As GreenNode")
202
_writer
.Write(" Return new {0}", StructureTypeName(nodeStructure))
204
_writer
.WriteLine(" End Function")
205
_writer
.WriteLine()
216
_writer
.WriteLine(" Public Overrides Function WithLeadingTrivia(ByVal trivia As GreenNode) As GreenNode")
217
_writer
.Write(" Return new {0}", StructureTypeName(nodeStructure))
219
_writer
.WriteLine(" End Function")
220
_writer
.WriteLine()
222
_writer
.WriteLine(" Public Overrides Function WithTrailingTrivia(ByVal trivia As GreenNode) As GreenNode")
223
_writer
.Write(" Return new {0}", StructureTypeName(nodeStructure))
225
_writer
.WriteLine(" End Function")
226
_writer
.WriteLine()
241
_writer
.WriteLine(" Friend Overrides Function GetSlot(i as Integer) as GreenNode")
247
_writer
.WriteLine(" Select case i")
250
_writer
.WriteLine(" Case {0}", i)
251
_writer
.WriteLine(" Return Me.{0}", ChildVarName(children(i)))
253
_writer
.WriteLine(" Case Else")
254
_writer
.WriteLine(" Debug.Assert(false, ""child index out of range"")")
255
_writer
.WriteLine(" Return Nothing")
256
_writer
.WriteLine(" End Select")
258
_writer
.WriteLine(" If i = 0 Then")
259
_writer
.WriteLine(" Return Me.{0}", ChildVarName(children(0)))
261
_writer
.WriteLine(" Else")
262
_writer
.WriteLine(" Debug.Assert(false, ""child index out of range"")")
263
_writer
.WriteLine(" Return Nothing")
264
_writer
.WriteLine(" End If")
267
_writer
.WriteLine(" End Function")
268
_writer
.WriteLine()
276
_writer
.WriteLine()
283
_writer
.WriteLine(" Friend ReadOnly {0} as {1}", FieldVarName(field), FieldTypeRef(field))
288
_writer
.WriteLine(" Friend ReadOnly {0} as {1}", ChildVarName(child), ChildFieldTypeRef(child, True))
291
_writer
.WriteLine()
310
_writer
.Write(" Friend Sub New(")
313
_writer
.Write("ByVal kind As {0}", NodeKindType())
315
_writer
.Write(", ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation()", NodeKindType())
320
_writer
.Write(", text as String")
326
_writer
.Write(", leadingTrivia As GreenNode, trailingTrivia As GreenNode", StructureTypeName(_parseTree.RootStructure))
330
_writer
.Write(", ")
335
_writer
.Write(", ")
340
_writer
.Write(", context As ISyntaxFactoryContext")
343
_writer
.WriteLine(")")
346
_writer
.Write(" MyBase.New(kind", NodeKindType())
349
_writer
.Write(", errors, annotations")
354
_writer
.Write(", text")
358
_writer
.Write(", leadingTrivia, trailingTrivia")
365
_writer
.Write(", {0}", ChildParamName(child))
369
_writer
.WriteLine(")")
375
_writer
.WriteLine(" Me.SlotCount = {0}", childrenCount)
382
_writer
.WriteLine(" Me.SetFactoryContext(context)")
387
_writer
.WriteLine(" Me.{0} = {1}", FieldVarName(allFields(i)), FieldParamName(allFields(i)))
393
_writer
.WriteLine()
399
_writer
.WriteLine(" If {0} IsNot Nothing Then", ChildParamName(child))
404
_writer
.WriteLine("{0} AdjustFlagsAndWidth({1})", indent, ChildParamName(child))
405
_writer
.WriteLine("{0} Me.{1} = {2}", indent, ChildVarName(child), ChildParamName(child))
409
_writer
.WriteLine(" End If", ChildParamName(child))
414
_writer
.WriteLine()
419
_writer
.WriteLine(" SetFlags(NodeFlags.ContainsDirectives)")
423
_writer
.WriteLine(" SetFlags(NodeFlags.ContainsAttributes)")
427
_writer
.WriteLine(" End Sub")
428
_writer
.WriteLine()
434
_writer
.Write("(Me.Kind")
436
_writer
.Write(", {0}", errorParam)
437
_writer
.Write(", {0}", annotationParam)
441
_writer
.Write(", text")
445
_writer
.Write(", {0}, {1}", precedingTriviaParam, followingTriviaParam)
448
_writer
.Write(", Me.Text")
452
_writer
.Write(", {0}", FieldVarName(field))
456
_writer
.Write(", {0}", ChildVarName(child))
459
_writer
.WriteLine(")")
464
_writer
.Write("{0} As {1}", FieldParamName(field, conflictName), FieldTypeRef(field))
469
_writer
.Write("{0} As {1}", ChildParamName(child, conflictName), ChildConstructorTypeRef(child, isGreen))
494
GenerateXmlComment(
_writer
, field, 8)
496
_writer
.WriteLine(" Friend {2}ReadOnly Property {0} As {1}", FieldPropertyName(field), FieldTypeRef(field), GetModifiers(field.ContainingStructure, isOverride, field.Name))
497
_writer
.WriteLine(" Get")
498
_writer
.WriteLine(" Return Me.{0}", FieldVarName(field))
499
_writer
.WriteLine(" End Get")
500
_writer
.WriteLine(" End Property")
501
_writer
.WriteLine("")
507
GenerateXmlComment(
_writer
, child, 8)
511
_writer
.WriteLine(" Friend {2}ReadOnly Property {0} As {1}", ChildPropertyName(child), ChildPropertyTypeRef(node, child, True), GetModifiers(child.ContainingStructure, False, child.Name))
512
_writer
.WriteLine(" Get")
514
_writer
.WriteLine(" Return Me.{0}", ChildVarName(child))
517
_writer
.WriteLine(" Return new {0}(New Microsoft.CodeAnalysis.Syntax.InternalSyntax.SyntaxList(of {1})(Me.{2}))", ChildPropertyTypeRef(node, child, True), BaseTypeReference(child), ChildVarName(child))
520
_writer
.WriteLine(" Return New Microsoft.CodeAnalysis.Syntax.InternalSyntax.SyntaxList(of GreenNode)(Me.{1})", BaseTypeReference(child), ChildVarName(child))
523
_writer
.WriteLine(" Return new {0}(Me.{1})", ChildPropertyTypeRef(node, child, True), ChildVarName(child))
525
_writer
.WriteLine(" End Get")
526
_writer
.WriteLine(" End Property")
527
_writer
.WriteLine("")
540
GenerateWithXmlComment(
_writer
, withChild, 8)
541
_writer
.WriteLine(" Friend {2}Function {0}({3} as {4}) As {1}", ChildWithFunctionName(withChild), StructureTypeName(withChild.ContainingStructure), GetModifiers(withChild.ContainingStructure, isOverride, withChild.Name), Ident(UpperFirstCharacter(withChild.Name)), ChildConstructorTypeRef(withChild))
542
_writer
.WriteLine(" Ensures(Result(Of {0}) IsNot Nothing)", StructureTypeName(withChild.ContainingStructure))
543
_writer
.Write(" return New {0}(", StructureTypeName(nodeStructure))
545
_writer
.Write("Kind, Green.Errors")
550
_writer
.Write(", {0}", FieldParamName(allFields(i)))
556
_writer
.Write(", {0}", ChildParamName(child))
558
_writer
.Write(", {0}", Ident(UpperFirstCharacter(child.Name)))
562
_writer
.WriteLine(")")
563
_writer
.WriteLine(" End Function")
566
GenerateWithXmlComment(
_writer
, withChild, 8)
567
_writer
.WriteLine(" Friend {2} Function {0}({3} as {4}) As {1}", ChildWithFunctionName(withChild), StructureTypeName(withChild.ContainingStructure), "MustOverride", Ident(UpperFirstCharacter(withChild.Name)), ChildConstructorTypeRef(withChild))
569
_writer
.WriteLine("")
579
_writer
.WriteLine(" Public {0} Function Accept(ByVal visitor As {1}) As VisualBasicSyntaxNode", If(IsRoot(nodeStructure), "Overridable", "Overrides"), _parseTree.VisitorName)
580
_writer
.WriteLine(" Return visitor.{0}(Me)", VisitorMethodName(nodeStructure))
581
_writer
.WriteLine(" End Function")
582
_writer
.WriteLine()
588
_writer
.WriteLine()
593
_writer
.WriteLine(" Friend MustInherit Class {0}", Ident(_parseTree.VisitorName))
596
_writer
.WriteLine(" Public Overridable Function Visit(ByVal node As {0}) As VisualBasicSyntaxNode", StructureTypeName(_parseTree.RootStructure))
597
_writer
.WriteLine(" If node IsNot Nothing")
598
_writer
.WriteLine(" Return node.Accept(Me)")
599
_writer
.WriteLine(" Else")
600
_writer
.WriteLine(" Return Nothing")
601
_writer
.WriteLine(" End If")
602
_writer
.WriteLine(" End Function")
610
_writer
.WriteLine(" End Class")
611
_writer
.WriteLine()
622
_writer
.WriteLine(" Public Overridable Function {0}(ByVal node As {1}) As VisualBasicSyntaxNode",
626
_writer
.WriteLine(" Debug.Assert(node IsNot Nothing)")
629
_writer
.WriteLine(" Return {0}(node)", VisitorMethodName(nodeStructure.ParentStructure))
631
_writer
.WriteLine(" Return node")
633
_writer
.WriteLine(" End Function")
638
_writer
.WriteLine(" Friend MustInherit Class {0}", Ident(_parseTree.RewriteVisitorName))
639
_writer
.WriteLine(" Inherits {0}", Ident(_parseTree.VisitorName), StructureTypeName(_parseTree.RootStructure))
640
_writer
.WriteLine()
646
_writer
.WriteLine(" End Class")
647
_writer
.WriteLine()
664
_writer
.WriteLine(" Public Overrides Function {0}(ByVal node As {1}) As {2}",
674
_writer
.WriteLine(" Dim anyChanges As Boolean = False")
675
_writer
.WriteLine()
680
_writer
.WriteLine(" Dim {0} = VisitList(node.{1})" + Environment.NewLine +
684
_writer
.WriteLine(" Dim {0} = DirectCast(Visit(node.{2}), {1})" + Environment.NewLine +
688
_writer
.WriteLine(" Dim {0} = DirectCast(Visit(node.{2}), {1})" + Environment.NewLine +
693
_writer
.WriteLine()
696
_writer
.WriteLine(" If anyChanges Then")
698
_writer
.Write(" Return New {0}(node.Kind", StructureTypeName(nodeStructure))
700
_writer
.Write(", node.GetDiagnostics, node.GetAnnotations")
703
_writer
.Write(", node.{0}", FieldPropertyName(field))
707
_writer
.Write(", {0}.Node", ChildNewVarName(child))
709
_writer
.Write(", {0}", ChildNewVarName(child))
711
_writer
.Write(", {0}", ChildNewVarName(child))
714
_writer
.WriteLine(")")
716
_writer
.WriteLine(" Else")
717
_writer
.WriteLine(" Return node")
718
_writer
.WriteLine(" End If")
720
_writer
.WriteLine(" End Function")
721
_writer
.WriteLine()