1 write to _writer
VisualBasicSyntaxGenerator (1)
RedNodes\RedNodeFactoryWriter.vb (1)
20
_writer
= writer
143 references to _writer
VisualBasicSyntaxGenerator (143)
RedNodes\RedNodeFactoryWriter.vb (143)
31
_writer
.WriteLine()
33
_writer
.WriteLine("Namespace {0}", Ident(_parseTree.NamespaceName))
34
_writer
.WriteLine()
37
_writer
.WriteLine(" Public Partial Class {0}", Ident(_parseTree.FactoryClassName))
39
_writer
.WriteLine()
41
_writer
.WriteLine(" End Class")
44
_writer
.WriteLine("End Namespace")
138
_writer
.WriteLine(" Private Shared Function {0}(kind As SyntaxKind) As SyntaxKind", name)
139
_writer
.WriteLine(" Select Case kind")
144
_writer
.WriteLine(" Case SyntaxKind.{0}", nodeKind.Name)
145
_writer
.WriteLine(" Return SyntaxKind.{0}", childNodeKind.Name)
148
_writer
.WriteLine(" Case Else")
149
_writer
.WriteLine(" Throw New ArgumentException(""{0}"")", child.Name)
151
_writer
.WriteLine(" End Select")
152
_writer
.WriteLine(" End Function")
227
_writer
.Write(" Return New SyntaxToken(Nothing, New InternalSyntax.{0}(", StructureTypeName(nodeStructure))
229
_writer
.Write(" Return New SyntaxTrivia(Nothing, New InternalSyntax.{0}(", StructureTypeName(nodeStructure))
231
_writer
.Write(" Return New {0}(", StructureTypeName(nodeStructure))
235
_writer
.Write("kind")
237
_writer
.Write("{0}.{1}", NodeKindType(), Ident(nodeKind.Name))
241
_writer
.Write(", Nothing, Nothing")
247
_writer
.Write(", VbCrLf")
249
_writer
.Write(", ""{0}""", If(tokenText <> """", tokenText, tokenText + tokenText))
253
_writer
.Write(", text")
259
_writer
.Write(", leadingTrivia.Node, trailingTrivia.Node")
264
_writer
.Write(", {0}", FieldParamName(field, factoryFunctionName))
269
_writer
.Write(", Nothing")
273
_writer
.Write(", {0}.Node", ChildParamName(child, factoryFunctionName))
275
_writer
.Write(", {0}.Node", ChildParamName(child, factoryFunctionName))
278
_writer
.Write(", DirectCast({0}.Node, {1})", ChildParamName(child, factoryFunctionName), ChildConstructorTypeRef(child, True))
280
_writer
.Write(", {0}", ChildParamName(child, factoryFunctionName))
287
_writer
.WriteLine("), 0, 0)")
289
_writer
.WriteLine(")")
294
_writer
.WriteLine(" End Function")
295
_writer
.WriteLine()
305
_writer
.Write(" Return {0}(Nothing", Ident(factoryFunctionName)) ' leading trivia
308
_writer
.Write(", kind")
313
_writer
.Write(", text")
318
_writer
.Write(", {0}", FieldParamName(field, factoryFunctionName))
322
_writer
.Write(", {0}", ChildParamName(child, factoryFunctionName))
325
_writer
.WriteLine(", Nothing)") ' trailing trivia
329
_writer
.WriteLine(" End Function")
330
_writer
.WriteLine()
338
_writer
.WriteLine()
339
GenerateSummaryXmlComment(
_writer
, nodeStructure.Description)
345
GenerateParameterXmlComment(
_writer
, "kind", String.Format("A <see cref=""SyntaxKind""/> representing the specific kind of {0}. One of {1}.", nodeStructure.Name, kindsList))
349
GenerateParameterXmlComment(
_writer
, "text", "The actual text of this token.")
353
GenerateParameterXmlComment(
_writer
, LowerFirstCharacter(OptionalChildName(child)), child.Description, escapeText:=True)
356
_writer
.Write(" Public {0}Shared Function {1}(",
364
_writer
.Write(", ")
367
_writer
.Write("leadingTrivia As SyntaxTriviaList")
374
_writer
.Write(", ")
377
_writer
.Write("ByVal kind As {0}", NodeKindType())
387
_writer
.Write(", ")
390
_writer
.Write("text as String")
398
_writer
.Write(", ")
406
If needComma Then
_writer
.Write(", ")
414
_writer
.Write(", ")
417
_writer
.Write("trailingTrivia As SyntaxTriviaList")
423
_writer
.WriteLine(") As SyntaxToken")
425
_writer
.WriteLine(") As SyntaxTrivia")
427
_writer
.WriteLine(") As {0}", StructureTypeName(nodeStructure))
434
_writer
.WriteLine(" If Not SyntaxFacts.Is{0}(kind) Then", structureName)
435
_writer
.WriteLine(" Throw New ArgumentException(""kind"")")
436
_writer
.WriteLine(" End If")
440
_writer
.WriteLine(" if {0} Is Nothing Then", name)
441
_writer
.WriteLine(" Throw New ArgumentNullException(NameOf({0}))", name)
442
_writer
.WriteLine(" End If")
460
_writer
.WriteLine(" Select Case {0}.Kind()", paramName)
461
_writer
.Write(" Case SyntaxKind.{0}", childNodeKind.Name)
463
_writer
.WriteLine()
464
_writer
.WriteLine(" Case Else")
465
_writer
.WriteLine(" Throw new ArgumentException(""{0}"")", paramName)
466
_writer
.WriteLine(" End Select")
473
_writer
.Write(" If ")
475
_writer
.Write("(Not {0}.IsKind(SyntaxKind.None)) AndAlso ", paramName)
478
_writer
.WriteLine("(Not {0}.IsKind({1}(kind))) Then", paramName, getterName)
480
_writer
.WriteLine(" Throw new ArgumentException(""{0}"")", paramName)
481
_writer
.WriteLine(" End If")
486
_writer
.WriteLine(" Select Case {0}.Kind()", paramName)
492
_writer
.Write(" Case SyntaxKind.{0}", childNodeKind.Name)
496
_writer
.WriteLine(",")
497
_writer
.Write(" SyntaxKind.{0}", childNodeKind.Name)
500
_writer
.WriteLine()
502
_writer
.WriteLine(" Case Else")
503
_writer
.WriteLine(" Throw new ArgumentException(""{0}"")", paramName)
504
_writer
.WriteLine(" End Select")
520
_writer
.WriteLine(" Select Case {0}.Kind()", paramName)
521
_writer
.Write(" Case SyntaxKind.{0}", childNodeKind.Name)
524
_writer
.WriteLine(" :")
525
_writer
.Write(" Case SyntaxKind.None")
528
_writer
.WriteLine()
529
_writer
.WriteLine(" Case Else")
530
_writer
.WriteLine(" Throw new ArgumentException(""{0}"")", paramName)
531
_writer
.WriteLine(" End Select")
539
_writer
.Write(" If ")
541
_writer
.Write("(Not ({0}.IsKind(SyntaxKind.None)) AndAlso ", paramName)
544
_writer
.WriteLine("(Not {0}.IsKind({1}(kind))) Then", paramName, getterName)
546
_writer
.WriteLine(" Throw new ArgumentException(""{0}"")", paramName)
547
_writer
.WriteLine(" End If")
551
_writer
.WriteLine(" Select Case {0}.Kind()", paramName)
557
_writer
.WriteLine(" :")
559
_writer
.Write(" Case SyntaxKind.{0}", childNodeKind.Name)
564
_writer
.WriteLine(" :")
565
_writer
.WriteLine(" Case SyntaxKind.None")
568
_writer
.WriteLine()
570
_writer
.WriteLine(" Case Else")
571
_writer
.WriteLine(" Throw new ArgumentException(""{0}"")", paramName)
572
_writer
.WriteLine(" End Select")
664
_writer
.WriteLine()
665
GenerateSummaryXmlComment(
_writer
, nodeStructure.Description)
671
GenerateParameterXmlComment(
_writer
, "kind", String.Format("A <see cref=""SyntaxKind""/> representing the specific kind of {0}. One of {1}.", nodeStructure.Name, kindsList))
675
GenerateParameterXmlComment(
_writer
, "text", "The actual text of this token.")
679
GenerateParameterXmlComment(
_writer
, LowerFirstCharacter(OptionalChildName(child)), child.Description, escapeText:=True)
682
_writer
.Write(" Public {0}Shared Function {1}(",
688
_writer
.Write("ByVal kind As {0}", NodeKindType())
697
_writer
.Write(", ")
700
_writer
.Write("text as String")
708
_writer
.Write(", ")
716
If needComma Then
_writer
.Write(", ")
724
_writer
.Write(", ")
728
_writer
.Write("Optional leadingTrivia As SyntaxTriviaList = Nothing, Optional trailingTrivia As SyntaxTriviaList = Nothing")
732
_writer
.WriteLine(") As SyntaxToken")
734
_writer
.WriteLine(") As SyntaxTrivia")
736
_writer
.WriteLine(") As {0}", StructureTypeName(nodeStructure))
743
_writer
.Write(" Return SyntaxFactory.{0}(", Ident(factoryFunctionName))
747
_writer
.Write("kind")
752
_writer
.Write("SyntaxKind." + nodeKind.Name)
759
_writer
.Write(", ")
761
_writer
.Write("{0}", FieldParamName(field, factoryFunctionName))
767
_writer
.Write(", ")
772
_writer
.Write("{0}", defaultedParameterExpression)
774
_writer
.Write("SyntaxFactory.Identifier({0})", ChildParamName(child, factoryFunctionName))
777
_writer
.Write("SyntaxFactory.SeparatedList(Of {0})().AddRange({1})", BaseTypeReference(child), ChildParamName(child, factoryFunctionName))
779
_writer
.Write("SyntaxFactory.List({0})", ChildParamName(child, factoryFunctionName))
783
_writer
.Write("{0}", ChildParamName(child, factoryFunctionName))
788
_writer
.WriteLine(")")
792
_writer
.WriteLine(" End Function")
793
_writer
.WriteLine()
799
_writer
.Write("{0} As {1}", FieldParamName(field, conflictName), FieldTypeRef(field))
821
_writer
.Write("ParamArray {0} As {1}()", ChildParamName(child, conflictName), BaseTypeReference(child))
823
_writer
.Write("{0} As {1}", ChildParamName(child, conflictName), type)
826
_writer
.Write("Optional {0} As {1} = Nothing", ChildParamName(child, conflictName), type)