96 references to StackFrameKind
Microsoft.CodeAnalysis.Features (96)
EmbeddedLanguages\StackFrame\StackFrameCompilationUnit.cs (3)
10
using StackFrameNodeOrToken = EmbeddedSyntaxNodeOrToken<
StackFrameKind
, StackFrameNode>;
11
using StackFrameToken = EmbeddedSyntaxToken<
StackFrameKind
>;
18
internal sealed class StackFrameCompilationUnit(StackFrameMethodDeclarationNode methodDeclaration, StackFrameFileInformationNode? fileInformationExpression, StackFrameToken endOfLineToken) : StackFrameNode(
StackFrameKind
.CompilationUnit)
EmbeddedLanguages\StackFrame\StackFrameExtensions.cs (1)
10
using StackFrameTrivia = EmbeddedSyntaxTrivia<
StackFrameKind
>;
EmbeddedLanguages\StackFrame\StackFrameLexer.cs (51)
18
using StackFrameToken = EmbeddedSyntaxToken<
StackFrameKind
>;
19
using StackFrameTrivia = EmbeddedSyntaxTrivia<
StackFrameKind
>;
78
return CreateTrivia(
StackFrameKind
.SkippedTextTrivia, GetSubSequenceToCurrentPos(start));
117
StackFrameKind
.IdentifierToken,
127
return CreateToken(
StackFrameKind
.EndOfFrame, VirtualCharSequence.Empty);
141
public bool ScanCurrentCharAsTokenIfMatch(
StackFrameKind
kind, out StackFrameToken token)
151
public bool ScanCurrentCharAsTokenIfMatch(
StackFrameKind
kind, bool scanTrailingWhitespace, out StackFrameToken token)
177
public bool ScanCurrentCharAsTokenIfMatch(Func<
StackFrameKind
, bool> isMatch, out StackFrameToken token)
194
var result = TryScanStringTrivia(language.At,
StackFrameKind
.AtTrivia);
208
var result = TryScanStringTrivia(language.In,
StackFrameKind
.InTrivia);
222
var result = TryScanStringTrivia(language.Line,
StackFrameKind
.LineTrivia);
233
/// Attempts to parse <see cref="
StackFrameKind
.InTrivia"/> and a path following https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#file-and-directory-names
282
return CreateToken(
StackFrameKind
.PathToken, inTrivia.ToImmutableArray(), GetSubSequenceToCurrentPos(startPosition));
286
/// Returns a number token with the <see cref="
StackFrameKind
.LineTrivia"/> and remaining <see cref="
StackFrameKind
.SkippedTextTrivia"/>
324
return CreateToken(
StackFrameKind
.NumberToken, GetSubSequenceToCurrentPos(start));
352
return CreateToken(
StackFrameKind
.GeneratedNameSeparatorToken, GetSubSequenceToCurrentPos(start));
383
return CreateToken(
StackFrameKind
.GeneratedNameSuffixToken, GetSubSequenceToCurrentPos(start));
405
public static StackFrameToken CreateToken(
StackFrameKind
kind, VirtualCharSequence virtualChars)
408
public static StackFrameToken CreateToken(
StackFrameKind
kind, ImmutableArray<StackFrameTrivia> leadingTrivia, VirtualCharSequence virtualChars)
411
public static StackFrameToken CreateToken(
StackFrameKind
kind, ImmutableArray<StackFrameTrivia> leadingTrivia, VirtualCharSequence virtualChars, ImmutableArray<StackFrameTrivia> trailingTrivia)
414
private static StackFrameTrivia CreateTrivia(
StackFrameKind
kind, VirtualCharSequence virtualChars)
417
private static StackFrameTrivia CreateTrivia(
StackFrameKind
kind, VirtualCharSequence virtualChars, ImmutableArray<EmbeddedDiagnostic> diagnostics)
455
private StackFrameTrivia? TryScanStringTrivia(string valueToLookFor,
StackFrameKind
triviaKind)
468
private StackFrameToken? TryScanStringToken(string valueToLookFor,
StackFrameKind
tokenKind)
495
return CreateTrivia(
StackFrameKind
.WhitespaceTrivia, GetSubSequenceToCurrentPos(startPosition));
503
return TryScanStringToken(".ctor",
StackFrameKind
.ConstructorToken) ??
504
TryScanStringToken(".cctor",
StackFrameKind
.ConstructorToken);
507
private static
StackFrameKind
GetKind(VirtualChar ch)
512
'&' =>
StackFrameKind
.AmpersandToken,
513
'[' =>
StackFrameKind
.OpenBracketToken,
514
']' =>
StackFrameKind
.CloseBracketToken,
515
'(' =>
StackFrameKind
.OpenParenToken,
516
')' =>
StackFrameKind
.CloseParenToken,
517
'.' =>
StackFrameKind
.DotToken,
518
'+' =>
StackFrameKind
.PlusToken,
519
',' =>
StackFrameKind
.CommaToken,
520
':' =>
StackFrameKind
.ColonToken,
521
'=' =>
StackFrameKind
.EqualsToken,
522
'>' =>
StackFrameKind
.GreaterThanToken,
523
'<' =>
StackFrameKind
.LessThanToken,
524
'-' =>
StackFrameKind
.MinusToken,
525
'\'' =>
StackFrameKind
.SingleQuoteToken,
526
'`' =>
StackFrameKind
.GraveAccentToken,
527
'\\' =>
StackFrameKind
.BackslashToken,
528
'/' =>
StackFrameKind
.ForwardSlashToken,
529
'$' =>
StackFrameKind
.DollarToken,
530
'|' =>
StackFrameKind
.PipeToken,
532
?
StackFrameKind
.WhitespaceTrivia
534
?
StackFrameKind
.NumberToken
535
:
StackFrameKind
.SkippedTextTrivia
EmbeddedLanguages\StackFrame\StackFrameNodeDefinitions.cs (6)
14
using StackFrameNodeOrToken = EmbeddedSyntaxNodeOrToken<
StackFrameKind
, StackFrameNode>;
15
using StackFrameToken = EmbeddedSyntaxToken<
StackFrameKind
>;
17
internal abstract class StackFrameNode : EmbeddedSyntaxNode<
StackFrameKind
, StackFrameNode>
19
protected StackFrameNode(
StackFrameKind
kind) : base(kind)
28
protected StackFrameDeclarationNode(
StackFrameKind
kind) : base(kind)
36
StackFrameParameterList argumentList) : StackFrameDeclarationNode(
StackFrameKind
.MethodDeclaration)
EmbeddedLanguages\StackFrame\StackFrameParser.cs (34)
15
using StackFrameNodeOrToken = EmbeddedSyntaxNodeOrToken<
StackFrameKind
, StackFrameNode>;
16
using StackFrameToken = EmbeddedSyntaxToken<
StackFrameKind
>;
90
Contract.ThrowIfFalse(eolToken.Kind ==
StackFrameKind
.EndOfFrame);
188
if (!_lexer.ScanCurrentCharAsTokenIfMatch(
StackFrameKind
.DotToken, out var dotToken))
193
if (lhs.Kind is
StackFrameKind
.Constructor ||
194
lhs is StackFrameQualifiedNameNode { Right.Kind:
StackFrameKind
.Constructor })
255
if (!_lexer.ScanCurrentCharAsTokenIfMatch(
StackFrameKind
.LessThanToken, out var lessThanToken))
260
if (_lexer.CurrentCharAsToken().Kind ==
StackFrameKind
.LessThanToken)
273
if (!_lexer.ScanCurrentCharAsTokenIfMatch(
StackFrameKind
.GreaterThanToken, out var greaterThanToken))
278
if (_lexer.ScanCurrentCharAsTokenIfMatch(
StackFrameKind
.DollarToken, out var dollarToken))
303
if (!_lexer.ScanCurrentCharAsTokenIfMatch(
StackFrameKind
.PipeToken, out var suffixSeparator))
334
if (!_lexer.ScanCurrentCharAsTokenIfMatch(
StackFrameKind
.GraveAccentToken, out var graveAccentToken))
336
if (identifierToken.Kind ==
StackFrameKind
.ConstructorToken)
365
kind => kind is
StackFrameKind
.OpenBracketToken or
StackFrameKind
.LessThanToken,
371
var
closeBracketKind = openToken.Kind is
StackFrameKind
.OpenBracketToken
372
?
StackFrameKind
.CloseBracketToken
373
:
StackFrameKind
.GreaterThanToken;
379
while (currentIdentifier.HasValue && currentIdentifier.Value.Kind ==
StackFrameKind
.IdentifierToken)
388
if (!_lexer.ScanCurrentCharAsTokenIfMatch(
StackFrameKind
.CommaToken, out var commaToken))
407
var separatedList = new EmbeddedSeparatedSyntaxNodeList<
StackFrameKind
, StackFrameNode, StackFrameIdentifierNameNode>(builder.ToImmutable());
421
if (!_lexer.ScanCurrentCharAsTokenIfMatch(
StackFrameKind
.OpenParenToken, scanTrailingWhitespace: true, out var openParen))
426
if (_lexer.ScanCurrentCharAsTokenIfMatch(
StackFrameKind
.CloseParenToken, out var closeParen))
428
return new(openParen, EmbeddedSeparatedSyntaxNodeList<
StackFrameKind
, StackFrameNode, StackFrameParameterDeclarationNode>.Empty, closeParen);
444
if (!_lexer.ScanCurrentCharAsTokenIfMatch(
StackFrameKind
.CommaToken, out var commaToken))
452
if (!_lexer.ScanCurrentCharAsTokenIfMatch(
StackFrameKind
.CloseParenToken, out closeParen))
457
var parameters = new EmbeddedSeparatedSyntaxNodeList<
StackFrameKind
, StackFrameNode, StackFrameParameterDeclarationNode>(builder.ToImmutable());
476
if (CurrentCharAsToken().Kind ==
StackFrameKind
.OpenBracketToken)
510
if (!_lexer.ScanCurrentCharAsTokenIfMatch(
StackFrameKind
.OpenBracketToken, scanTrailingWhitespace: true, out var openBracket))
515
while (_lexer.ScanCurrentCharAsTokenIfMatch(
StackFrameKind
.CommaToken, scanTrailingWhitespace: true, out var commaToken))
520
if (!_lexer.ScanCurrentCharAsTokenIfMatch(
StackFrameKind
.CloseBracketToken, scanTrailingWhitespace: true, out var closeBracket))
544
if (path.Kind ==
StackFrameKind
.None)
549
if (!_lexer.ScanCurrentCharAsTokenIfMatch(
StackFrameKind
.ColonToken, out var colonToken))
EmbeddedLanguages\StackFrame\StackFrameTree.cs (1)
11
internal sealed class StackFrameTree(VirtualCharSequence text, StackFrameCompilationUnit root) : EmbeddedSyntaxTree<
StackFrameKind
, StackFrameNode, StackFrameCompilationUnit>(text, root, ImmutableArray<EmbeddedDiagnostic>.Empty)