Show / Hide Table of Contents

Class SyntaxToken

Represents a tokenized portion of source text that is identified with a SyntaxKind and may contain a parsed value in StringValue. Tokens also carry leading trivia which are usually uninteresting tokens (white space, comments). A token may be fully round-tripped through its SourceText property.

Inheritance
System.Object
SyntaxNode
SyntaxToken
Inherited Members
SyntaxNode.IsParsed
SyntaxNode.ToString()
SyntaxNode.Write(TextWriter)
Namespace: DotLang.CodeAnalysis.Syntax
Assembly: DotLang.dll
Syntax
public sealed class SyntaxToken : SyntaxNode

Properties

| Improve this Doc View Source

Invalid

Declaration
public static SyntaxToken Invalid { get; }
Property Value
Type Description
SyntaxToken
| Improve this Doc View Source

Kind

The syntax kind of this token.

Declaration
public SyntaxKind Kind { get; }
Property Value
Type Description
SyntaxKind
| Improve this Doc View Source

LeadingTrivia

Any potential leading trivia tokens that precede this token such as white space or comments.

Declaration
public IReadOnlyList<SyntaxToken> LeadingTrivia { get; }
Property Value
Type Description
System.Collections.Generic.IReadOnlyList<SyntaxToken>
| Improve this Doc View Source

Location

The location, including start and end points, of this token in its original source text.

Declaration
public SourceLocation Location { get; }
Property Value
Type Description
SourceLocation
| Improve this Doc View Source

SourceText

The original source text for this token (based on Location).

Declaration
public string SourceText { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

StringValue

A semantic string representation of this token's value.

Declaration
public string StringValue { get; }
Property Value
Type Description
System.String

Methods

| Improve this Doc View Source

Accept(SyntaxVisitor)

Declaration
public override void Accept(SyntaxVisitor visitor)
Parameters
Type Name Description
SyntaxVisitor visitor
Overrides
SyntaxNode.Accept(SyntaxVisitor)

Extension Methods

SyntaxFacts.IsValid(SyntaxToken)
SyntaxFacts.IsIdentifier(SyntaxToken)
SyntaxFacts.IsEdge(SyntaxToken)
SyntaxFacts.IsTrivia(SyntaxToken)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX