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