267 references to ScannerState
Microsoft.CodeAnalysis.VisualBasic (267)
Parser\ParseExpression.vb (15)
736
GetNextToken(
ScannerState
.VB)
740
ResetCurrentToken(
ScannerState
.Element)
742
VerifyExpectedToken(SyntaxKind.OpenParenToken, openParen,
ScannerState
.Element)
747
GetNextToken(
ScannerState
.Element)
953
TryEatNewLine(
ScannerState
.VB)
1056
GetNextToken(
ScannerState
.VB)
1063
If PeekNextToken(
ScannerState
.VB).Kind = SyntaxKind.LessThanToken Then
1065
GetNextToken(
ScannerState
.Element)
1069
GetNextToken(
ScannerState
.VB)
1162
Private Function TransitionFromVBToXml(Of T As VisualBasicSyntaxNode)(state As
ScannerState
, node As T) As T
1187
ResetCurrentToken(
ScannerState
.Content)
1192
ResetCurrentToken(
ScannerState
.Element)
1193
Dim name = ParseXmlQualifiedName(False, False,
ScannerState
.Element,
ScannerState
.Element)
1207
ResetCurrentToken(
ScannerState
.VB)
Parser\ParseInterpolatedString.vb (18)
20
ResetCurrentToken(
ScannerState
.InterpolatedStringPunctuation)
25
GetNextToken(
ScannerState
.InterpolatedStringContent)
40
GetNextToken(
ScannerState
.InterpolatedStringPunctuation)
59
GetNextToken(
ScannerState
.InterpolatedStringContent)
71
GetNextToken(
ScannerState
.VB)
107
GetNextToken(
ScannerState
.VB)
131
GetNextToken(
ScannerState
.VB)
143
GetNextToken(
ScannerState
.VB)
157
GetNextToken(
ScannerState
.VB)
185
GetNextToken(
ScannerState
.InterpolatedStringFormatString)
191
GetNextToken(
ScannerState
.InterpolatedStringPunctuation)
226
GetNextToken(
ScannerState
.InterpolatedStringFormatString)
235
ResetCurrentToken(
ScannerState
.InterpolatedStringPunctuation)
238
GetNextToken(
ScannerState
.InterpolatedStringContent)
241
GetNextToken(
ScannerState
.VB)
247
ResetCurrentToken(
ScannerState
.InterpolatedStringFormatString)
254
ResetCurrentToken(
ScannerState
.InterpolatedStringContent)
255
GetNextToken(
ScannerState
.InterpolatedStringContent)
Parser\Parser.vb (29)
446
ResetCurrentToken(
ScannerState
.VBAllowLeadingMultilineTrivia)
452
ResetCurrentToken(If(_allowLeadingMultilineTrivia,
ScannerState
.VBAllowLeadingMultilineTrivia,
ScannerState
.VB))
464
ResetCurrentToken(If(_allowLeadingMultilineTrivia,
ScannerState
.VBAllowLeadingMultilineTrivia,
ScannerState
.VB))
4736
ResetCurrentToken(
ScannerState
.Element)
4743
If VerifyExpectedToken(SyntaxKind.LessThanToken, lessToken,
ScannerState
.Element) Then
4755
Dim unexpected = ResyncAt(
ScannerState
.Element, {SyntaxKind.GreaterThanToken})
4763
Dim unexpected = ResyncAt(
ScannerState
.Element, {SyntaxKind.GreaterThanToken})
4769
VerifyExpectedToken(SyntaxKind.GreaterThanToken, greaterToken,
ScannerState
.Element)
5485
GetNextToken(
ScannerState
.VB)
5494
GetNextToken(
ScannerState
.VB)
5512
ResetCurrentToken(
ScannerState
.VB)
5545
ResetCurrentToken(
ScannerState
.VB)
5918
Optional state As
ScannerState
=
ScannerState
.VB) As Boolean
5942
Optional state As
ScannerState
=
ScannerState
.VB) As Boolean
5971
Dim state = If(_allowLeadingMultilineTrivia,
ScannerState
.VBAllowLeadingMultilineTrivia,
ScannerState
.VB)
5975
Friend Function PeekNextToken(Optional state As
ScannerState
=
ScannerState
.VB) As SyntaxToken
5976
If _allowLeadingMultilineTrivia AndAlso state =
ScannerState
.VB Then
5977
state =
ScannerState
.VBAllowLeadingMultilineTrivia
6004
Private Sub ResetCurrentToken(state As
ScannerState
)
6012
Friend Sub GetNextToken(Optional state As
ScannerState
=
ScannerState
.VB)
6013
If _allowLeadingMultilineTrivia AndAlso state =
ScannerState
.VB Then
6014
state =
ScannerState
.VBAllowLeadingMultilineTrivia
Parser\ParseScan.vb (8)
243
Private Sub ResyncAt(skippedTokens As SyntaxListBuilder(Of SyntaxToken), state As
ScannerState
, resyncTokens As SyntaxKind())
265
Private Function ResyncAt(state As
ScannerState
, resyncTokens As SyntaxKind()) As CodeAnalysis.Syntax.InternalSyntax.SyntaxList(Of SyntaxToken)
286
GetNextToken(
ScannerState
.VB)
294
GetNextToken(
ScannerState
.VB)
304
Return ResyncAt(
ScannerState
.VB, Array.Empty(Of SyntaxKind))
309
Return ResyncAt(
ScannerState
.VB, resyncTokens)
326
Private Function TryEatNewLine(Optional state As
ScannerState
=
ScannerState
.VB) As Boolean
Parser\ParseVerify.vb (2)
163
Optional state As
ScannerState
=
ScannerState
.VB
Parser\ParseXml.vb (125)
30
ResetCurrentToken(
ScannerState
.Content)
37
Result = ParseXmlElement(
ScannerState
.VB)
52
Dim nextToken = PeekNextToken(
ScannerState
.Element)
71
body = ParseXmlElement(
ScannerState
.Misc)
74
body = ParseXmlEmbedded(
ScannerState
.Misc)
94
Return ParseXmlProcessingInstruction(
ScannerState
.VB, whitespaceChecker)
104
PeekNextToken(
ScannerState
.Element).Kind = SyntaxKind.XmlNameToken AndAlso
105
DirectCast(PeekNextToken(
ScannerState
.Element), XmlNameTokenSyntax).PossibleKeywordKind = SyntaxKind.XmlKeyword, "ParseXmlDecl called on the wrong token.")
108
GetNextToken(
ScannerState
.Element)
111
VerifyExpectedToken(SyntaxKind.XmlNameToken, nameToken,
ScannerState
.Element)
222
unexpected = ResyncAt(
ScannerState
.Element, {SyntaxKind.EndOfXmlToken,
230
VerifyExpectedToken(SyntaxKind.QuestionGreaterThanToken, endPrologue,
ScannerState
.Content)
272
VerifyExpectedToken(SyntaxKind.XmlNameToken, name,
ScannerState
.Element)
280
Dim exp = ParseXmlEmbedded(
ScannerState
.Element)
285
If Not VerifyExpectedToken(SyntaxKind.EqualsToken, equals,
ScannerState
.Element) Then
286
skipped = ResyncAt(
ScannerState
.Element,
299
value = ParseXmlString(
ScannerState
.Element)
303
Dim exp = ParseXmlEmbedded(
ScannerState
.Element)
330
skipped = ParseXmlDocType(
ScannerState
.Misc)
333
GetNextToken(
ScannerState
.Misc)
343
result = ParseXmlComment(
ScannerState
.Misc)
346
result = ParseXmlProcessingInstruction(
ScannerState
.Misc, whitespaceChecker)
365
Private Function ParseXmlDocType(enclosingState As
ScannerState
) As GreenNode
376
GetNextToken(
ScannerState
.DocType)
377
VerifyExpectedToken(SyntaxKind.XmlNameToken, name,
ScannerState
.DocType)
400
GetNextToken(
ScannerState
.DocType)
401
Dim systemLiteral = ParseXmlString(
ScannerState
.DocType)
406
GetNextToken(
ScannerState
.DocType)
407
Dim publicLiteral = ParseXmlString(
ScannerState
.DocType)
409
Dim systemLiteral = ParseXmlString(
ScannerState
.DocType)
420
unexpected = ResyncAt(
ScannerState
.DocType, {SyntaxKind.BadToken,
439
GetNextToken(
ScannerState
.DocType)
443
GetNextToken(
ScannerState
.DocType)
448
unexpected = ResyncAt(
ScannerState
.DocType, {SyntaxKind.BadToken,
462
GetNextToken(
ScannerState
.DocType)
475
GetNextToken(
ScannerState
.DocType)
481
Dim xmlPI = ParseXmlProcessingInstruction(
ScannerState
.DocType, Nothing)
485
Dim xmlComment = ParseXmlComment(
ScannerState
.DocType)
490
GetNextToken(
ScannerState
.DocType)
499
GetNextToken(
ScannerState
.DocType)
508
Private Function ParseXmlElementStartTag(enclosingState As
ScannerState
) As XmlNodeSyntax
512
GetNextToken(
ScannerState
.Element)
515
Dim Name = ParseXmlQualifiedName(False, True,
ScannerState
.Element,
ScannerState
.Element)
528
GetNextToken(
ScannerState
.Content)
541
If PeekNextToken(
ScannerState
.Element).Kind = SyntaxKind.GreaterThanToken Then
545
GetNextToken(
ScannerState
.Element)
575
Private Function ParseXmlElement(enclosingState As
ScannerState
) As XmlNodeSyntax
599
Dim nextTokenIsSlash As Boolean = PeekNextToken(
ScannerState
.Element).Kind = SyntaxKind.SlashToken
612
nextState =
ScannerState
.Content
676
Dim docTypeTrivia = ParseXmlDocType(
ScannerState
.Element)
774
Private Function ResyncXmlElement(state As
ScannerState
, lessThan As PunctuationSyntax, Name As XmlNodeSyntax, attributes As CodeAnalysis.Syntax.InternalSyntax.SyntaxList(Of XmlNodeSyntax)) As XmlNodeSyntax
776
Dim unexpectedSyntax = ResyncAt(
ScannerState
.Element,
802
GetNextToken(
ScannerState
.Content)
830
Dim unexpectedSyntax = ResyncAt(
ScannerState
.Content,
846
GetNextToken(
ScannerState
.Content)
862
Private Function ParseXmlElementEndTag(nextState As
ScannerState
) As XmlElementEndTagSyntax
870
unexpected = ResyncAt(
ScannerState
.Content,
876
If Not VerifyExpectedToken(SyntaxKind.LessThanSlashToken, beginEndElement,
ScannerState
.EndElement) Then
881
Dim slashToken As SyntaxToken = PeekNextToken(
ScannerState
.EndElement)
896
GetNextToken(
ScannerState
.EndElement)
897
GetNextToken(
ScannerState
.EndElement)
912
name = DirectCast(ParseXmlQualifiedName(False, False,
ScannerState
.EndElement,
ScannerState
.EndElement), XmlNameSyntax)
975
Dim Name = ParseXmlQualifiedName(requireLeadingWhitespace, True,
ScannerState
.Element,
ScannerState
.Element)
981
GetNextToken(
ScannerState
.Element)
986
value = ParseXmlEmbedded(
ScannerState
.Element)
994
value = ParseXmlString(
ScannerState
.Element)
1014
value = ParseXmlString(
ScannerState
.Element)
1060
Dim state As
ScannerState
1064
state = If(CurrentToken.Text = "'"c,
ScannerState
.SingleQuotedString,
ScannerState
.SmartSingleQuotedString)
1067
state = If(CurrentToken.Text = """"c,
ScannerState
.QuotedString,
ScannerState
.SmartQuotedString)
1126
GetNextToken(
ScannerState
.Element)
1157
Me.ResetCurrentToken(
ScannerState
.Element)
1383
Dim state As
ScannerState
1387
state = If(CurrentToken.Text = "'"c,
ScannerState
.SingleQuotedString,
ScannerState
.SmartSingleQuotedString)
1390
state = If(CurrentToken.Text = """"c,
ScannerState
.QuotedString,
ScannerState
.SmartQuotedString)
1426
GetNextToken(
ScannerState
.Element)
1437
Me.ResetCurrentToken(
ScannerState
.Element)
1519
stateForName As
ScannerState
,
1520
nextState As
ScannerState
1539
Private Function ParseXmlQualifiedName(requireLeadingWhitespace As Boolean, stateForName As
ScannerState
, nextState As
ScannerState
) As XmlNodeSyntax
1599
GetNextToken(
ScannerState
.VB)
1622
ResetCurrentToken(
ScannerState
.Element)
1624
GetNextToken(
ScannerState
.Element)
1634
GetNextToken(
ScannerState
.VB)
1705
GetNextToken(
ScannerState
.Content)
1708
Dim tempNodes = ParseXmlContent(
ScannerState
.Content)
1726
Friend Function ParseXmlContent(state As
ScannerState
) As CodeAnalysis.Syntax.InternalSyntax.SyntaxList(Of XmlNodeSyntax)
1751
xml = ParseXmlElement(
ScannerState
.Content)
1754
xml = ReportSyntaxError(ParseXmlElementEndTag(
ScannerState
.Content), ERRID.ERR_XmlEndElementNoMatchingStart)
1757
xml = ParseXmlComment(
ScannerState
.Content)
1760
xml = ParseXmlProcessingInstruction(
ScannerState
.Content, whitespaceChecker)
1763
xml = ParseXmlCData(
ScannerState
.Content)
1766
xml = ParseXmlEmbedded(
ScannerState
.Content)
1776
GetNextToken(
ScannerState
.Content)
1795
Dim docTypeTrivia = ParseXmlDocType(
ScannerState
.Element)
1806
If state =
ScannerState
.Content Then
1826
Private Function ParseXmlProcessingInstruction(nextState As
ScannerState
, whitespaceChecker As XmlWhitespaceChecker) As XmlProcessingInstructionSyntax
1831
GetNextToken(
ScannerState
.Element)
1839
If Not VerifyExpectedToken(SyntaxKind.XmlNameToken, name,
ScannerState
.StartProcessingInstruction) Then
1843
ResetCurrentToken(
ScannerState
.StartProcessingInstruction)
1865
GetNextToken(
ScannerState
.ProcessingInstruction)
1888
Private Function ParseXmlCData(nextState As
ScannerState
) As XmlCDataSectionSyntax
1893
GetNextToken(
ScannerState
.CData)
1899
GetNextToken(
ScannerState
.CData)
1914
Private Function ParseXmlComment(nextState As
ScannerState
) As XmlNodeSyntax
1918
GetNextToken(
ScannerState
.Comment)
1928
GetNextToken(
ScannerState
.Comment)
1943
Friend Function ParseXmlString(nextState As
ScannerState
) As XmlStringSyntax
1945
Dim state As
ScannerState
1949
state = If(CurrentToken.Text = "'"c,
ScannerState
.SingleQuotedString,
ScannerState
.SmartSingleQuotedString)
1953
state = If(CurrentToken.Text = """"c,
ScannerState
.QuotedString,
ScannerState
.SmartQuotedString)
1959
state =
ScannerState
.UnQuotedString
2005
Private Function ParseXmlEmbedded(enclosingState As
ScannerState
) As XmlEmbeddedExpressionSyntax
2011
TryEatNewLine(
ScannerState
.VB)
2019
ResyncAt(skippedTokens,
ScannerState
.VB, {SyntaxKind.PercentGreaterThanToken,
Scanner\Blender.vb (1)
459
If Not Me._currentToken.State =
ScannerState
.VBAllowLeadingMultilineTrivia AndAlso
Scanner\Directives.vb (8)
40
Me.GetNextTokenInState(
ScannerState
.VB)
52
Me.GetNextTokenInState(
ScannerState
.VB)
552
Dim nextKind = Me.PeekToken(1,
ScannerState
.VB).Kind
553
Dim nextNextToken = Me.PeekToken(2,
ScannerState
.VB)
586
GetNextTokenInState(
ScannerState
.VB)
590
GetNextTokenInState(
ScannerState
.VB)
598
GetNextTokenInState(
ScannerState
.VB)
604
GetNextTokenInState(
ScannerState
.VB)
Scanner\ScannerXml.vb (11)
56
Friend Function ScanXmlElement(Optional state As
ScannerState
=
ScannerState
.Element) As SyntaxToken
57
Debug.Assert(state =
ScannerState
.Element OrElse state =
ScannerState
.EndElement OrElse state =
ScannerState
.DocType)
210
Private Function ScanXmlForPossibleStatement(state As
ScannerState
) As Boolean
262
If state =
ScannerState
.EndElement Then
637
Friend Function ScanXmlPIData(state As
ScannerState
) As SyntaxToken
646
Debug.Assert(state =
ScannerState
.StartProcessingInstruction OrElse
647
state =
ScannerState
.ProcessingInstruction)
652
If state =
ScannerState
.StartProcessingInstruction AndAlso CanGet() Then
Scanner\TokenStream.vb (37)
17
Friend Function IsVBState(state As
ScannerState
) As Boolean
18
Return state <=
ScannerState
.VBAllowLeadingMultilineTrivia
235
Friend Sub ResetCurrentToken(state As
ScannerState
)
240
If _currentToken.State =
ScannerState
.VB AndAlso state =
ScannerState
.Content Then
281
Dim state =
ScannerState
.VB
335
Dim state =
ScannerState
.VB
341
Friend Sub TransitionFromVBToXml(state As
ScannerState
, toCompare As CoreInternalSyntax.SyntaxList(Of VisualBasicSyntaxNode), ByRef toRemove As CoreInternalSyntax.SyntaxList(Of VisualBasicSyntaxNode), ByRef toAdd As CoreInternalSyntax.SyntaxList(Of VisualBasicSyntaxNode))
375
Friend Sub GetNextTokenInState(state As
ScannerState
)
387
Friend Function PeekNextToken(state As
ScannerState
) As SyntaxToken
405
Friend Function PeekToken(tokenOffset As Integer, state As
ScannerState
) As SyntaxToken
457
Private Function GetTokenAndAddToQueue(state As
ScannerState
) As SyntaxToken
469
_currentToken = _currentToken.With(
ScannerState
.VB, Nothing)
476
_currentToken = New ScannerToken(_scannerPreprocessorState, _lineBufferOffset, _endOfTerminatorTrivia, Nothing,
ScannerState
.VB)
575
Private Function GetScannerToken(state As
ScannerState
) As SyntaxToken
579
Case
ScannerState
.VB
582
Case
ScannerState
.VBAllowLeadingMultilineTrivia
585
Case
ScannerState
.Misc
588
Case
ScannerState
.Element,
589
ScannerState
.EndElement,
590
ScannerState
.DocType
593
Case
ScannerState
.Content
596
Case
ScannerState
.CData
599
Case
ScannerState
.StartProcessingInstruction,
600
ScannerState
.ProcessingInstruction
603
Case
ScannerState
.Comment
606
Case
ScannerState
.SingleQuotedString
609
Case
ScannerState
.SmartSingleQuotedString
612
Case
ScannerState
.QuotedString
615
Case
ScannerState
.SmartQuotedString
618
Case
ScannerState
.UnQuotedString
621
Case
ScannerState
.InterpolatedStringPunctuation
624
Case
ScannerState
.InterpolatedStringContent
627
Case
ScannerState
.InterpolatedStringFormatString
643
state As
ScannerState
)
651
Friend Function [With](state As
ScannerState
, token As SyntaxToken) As ScannerToken
662
Public ReadOnly State As
ScannerState
Scanner\XmlDocComments.vb (7)
61
Me.GetNextTokenInState(
ScannerState
.Content)
98
Dim nodes = parser.ParseXmlContent(
ScannerState
.Content)
347
Friend Function ScanXmlPIDataInXmlDoc(state As
ScannerState
) As SyntaxToken
353
Debug.Assert(state =
ScannerState
.StartProcessingInstruction OrElse
354
state =
ScannerState
.ProcessingInstruction)
367
If state =
ScannerState
.StartProcessingInstruction AndAlso CanGet() Then
438
Private Function ScanXmlElementInXmlDoc(state As
ScannerState
) As SyntaxToken
Scanner\XmlTokenFactories.vb (6)
347
Private Function XmlLessThanExclamationToken(state As
ScannerState
, precedingTrivia As CoreInternalSyntax.SyntaxList(Of VisualBasicSyntaxNode)) As BadTokenSyntax
349
Return XmlMakeBadToken(SyntaxSubKind.LessThanExclamationToken, precedingTrivia, 2, If(state =
ScannerState
.DocType, ERRID.ERR_DTDNotSupported, ERRID.ERR_Syntax))
352
Private Function XmlMakeOpenBracketToken(state As
ScannerState
, precedingTrivia As CoreInternalSyntax.SyntaxList(Of VisualBasicSyntaxNode)) As BadTokenSyntax
354
Return XmlMakeBadToken(SyntaxSubKind.OpenBracketToken, precedingTrivia, 1, If(state =
ScannerState
.DocType, ERRID.ERR_DTDNotSupported, ERRID.ERR_IllegalXmlNameChar))
357
Private Function XmlMakeCloseBracketToken(state As
ScannerState
, precedingTrivia As CoreInternalSyntax.SyntaxList(Of VisualBasicSyntaxNode)) As BadTokenSyntax
360
Return XmlMakeBadToken(SyntaxSubKind.CloseBracketToken, precedingTrivia, 1, If(state =
ScannerState
.DocType, ERRID.ERR_DTDNotSupported, ERRID.ERR_IllegalXmlNameChar))