Sdílet prostřednictvím


Microsoft.CodeAnalysis.CSharp Namespace

Classes

CSharpCommandLineArguments

The command line arguments to a C# Microsoft.CodeAnalysis.CSharp.CSharpCompiler.

CSharpCommandLineParser
CSharpCompilation

The compilation object is an immutable representation of a single invocation of the compiler. Although immutable, a compilation is also on-demand, and will realize and cache data as necessary. A compilation can produce a new compilation from existing compilation with the application of small deltas. In many cases, it is more efficient than creating a new compilation from scratch, as the new compilation can reuse information from the old compilation.

CSharpCompilationOptions

Represents various options that affect compilation, such as whether to emit an executable or a library, whether to optimize generated code, and so on.

CSharpDiagnosticFormatter
CSharpExtensions
CSharpFileSystemExtensions
CSharpGeneratorDriver

A GeneratorDriver implementation for the CSharp language.

CSharpParseOptions

This class stores several source parsing related options and offers access to their values.

CSharpScriptCompilationInfo
CSharpSyntaxNode

Represents a non-terminal node in the syntax tree.

CSharpSyntaxRewriter

Represents a CSharpSyntaxVisitor<TResult> which descends an entire CSharpSyntaxNode graph and may replace or remove visited SyntaxNodes in depth-first order.

CSharpSyntaxTree

The parsed representation of a C# source document.

CSharpSyntaxVisitor

Represents a CSharpSyntaxNode visitor that visits only the single CSharpSyntaxNode passed into its Visit method.

CSharpSyntaxVisitor<TResult>

Represents a CSharpSyntaxNode visitor that visits only the single CSharpSyntaxNode passed into its Visit method and produces a value of the type specified by the TResult parameter.

CSharpSyntaxWalker

Represents a CSharpSyntaxVisitor that descends an entire CSharpSyntaxNode graph visiting each CSharpSyntaxNode and its child SyntaxNodes and SyntaxTokens in depth-first order.

InterceptableLocation
LanguageVersionFacts
SymbolDisplay

Displays a symbol in the C# style.

SyntaxExtensions
SyntaxFactory

A class containing factory methods for constructing syntax nodes, tokens and trivia.

SyntaxFacts

Defines a set of methods to determine how Unicode characters are treated by the C# compiler.

SyntaxTokenParser

A token parser that can be used to parse tokens continuously from a source. This parser parses continuously; every call to ParseNextToken() will return the next token in the source text, starting from position 0. SkipForwardTo(Int32) can be used to skip forward in the file to a specific position, and ResetTo(SyntaxTokenParser+Result) can be used to reset the parser to a previously-lexed position.

TypedConstantExtensions

Structs

AwaitExpressionInfo

Structure containing all semantic information about an await expression.

Conversion

Summarizes whether a conversion is allowed, and if so, which kind of conversion (and in some cases, the associated symbol).

DeconstructionInfo

The representation of a deconstruction as a tree of Deconstruct methods and conversions. Methods only appear in non-terminal nodes. All terminal nodes have a Conversion.

Here's an example: A deconstruction like (int x1, (long x2, long x3)) = deconstructable1 with Deconstructable1.Deconstruct(out int y1, out Deconstructable2 y2) and Deconstructable2.Deconstruct(out int z1, out int z2) is represented as 5 DeconstructionInfo nodes.

The top-level node has a Method (Deconstructable1.Deconstruct), no Conversion, but has two Nested nodes. Its first nested node has no Method, but has a Conversion (Identity). Its second nested node has a Method (Deconstructable2.Deconstruct), no Conversion, and two Nested nodes. Those last two nested nodes have no Method, but each have a Conversion (ImplicitNumeric, from int to long).

ForEachStatementInfo

Structure containing all semantic information about a for each statement.

QueryClauseInfo

Semantic information associated with a query clause in a C# query expression.

SyntaxTokenParser.Result

The result of a call to ParseNextToken(). This is also a context object that can be used to reset the parser to before the token it represents was parsed.

Enums

LanguageVersion

Specifies the language version.

NullableContextOptions

Specifies the nullable context.

SyntaxKind