# Yarn.Compiler Namespace

## Summary

Contains classes for compiling Yarn code.

## Classes

| Name                                                                                                              | Description                                                                                                                                                                                                                                                                            |
| ----------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [BasicBlock](/2.4/api/csharp/yarn.compiler/yarn.compiler.basicblock.md)                                           | A basic block is a run of instructions inside a Node. Basic blocks group instructions up into segments such that execution only ever begins at the start of a block (that is, a program never jumps into the middle of a block), and execution only ever leaves at the end of a block. |
| [Compiler](/2.4/api/csharp/yarn.compiler/yarn.compiler.compiler.md)                                               | Compiles Yarn code.                                                                                                                                                                                                                                                                    |
| [DebugInfo](/2.4/api/csharp/yarn.compiler/yarn.compiler.debuginfo.md)                                             | Contains debug information for a node in a Yarn file.                                                                                                                                                                                                                                  |
| [Declaration](/2.4/api/csharp/yarn.compiler/yarn.compiler.declaration.md)                                         | Represents a variable declaration                                                                                                                                                                                                                                                      |
| [DeclarationBuilder](/2.4/api/csharp/yarn.compiler/yarn.compiler.declarationbuilder.md)                           | Provides methods for constructing [Declaration](/2.4/api/csharp/yarn.compiler/yarn.compiler.declaration.md) objects.                                                                                                                                                                   |
| [DeferredTypeDiagnostic](/2.4/api/csharp/yarn.compiler/yarn.compiler.deferredtypediagnostic.md)                   | Represents a potential type error diagnostic message.                                                                                                                                                                                                                                  |
| [Diagnostic](/2.4/api/csharp/yarn.compiler/yarn.compiler.diagnostic.md)                                           | A diagnostic message that describes an error, warning or informational message that the user can take action on.                                                                                                                                                                       |
| [FunctionTypeBuilder](/2.4/api/csharp/yarn.compiler/yarn.compiler.functiontypebuilder.md)                         | Provides methods for constructing [FunctionType](/2.4/api/csharp/yarn/yarn.functiontype.md) objects.                                                                                                                                                                                   |
| [IndentAwareLexer](/2.4/api/csharp/yarn.compiler/yarn.compiler.indentawarelexer.md)                               | A Lexer subclass that detects newlines and generates indent and dedent tokens accordingly.                                                                                                                                                                                             |
| [InstructionCollectionExtensions](/2.4/api/csharp/yarn.compiler/yarn.compiler.instructioncollectionextensions.md) | Contains extension methods for producing [BasicBlock](/2.4/api/csharp/yarn.compiler/yarn.compiler.basicblock.md) objects from a Node.                                                                                                                                                  |
| [Position](/2.4/api/csharp/yarn.compiler/yarn.compiler.position.md)                                               | Represents a position in a multi-line string.                                                                                                                                                                                                                                          |
| [Project](/2.4/api/csharp/yarn.compiler/yarn.compiler.project.md)                                                 | Yarn Projects represent instructions on where to find Yarn scripts and associated assets, and how they should be compiled.                                                                                                                                                             |
| [Range](/2.4/api/csharp/yarn.compiler/yarn.compiler.range.md)                                                     | Represents a range of text in a multi-line string.                                                                                                                                                                                                                                     |
| [Utility](/2.4/api/csharp/yarn.compiler/yarn.compiler.utility.md)                                                 | Utility methods for working with line tags.                                                                                                                                                                                                                                            |

## Namespaces

| Name                                                                | Description                                                                       |
| ------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| [Yarn.Compiler.Upgrader](/2.4/api/csharp/yarn.compiler.upgrader.md) | Contains classes for upgrading Yarn code to more recent versions of the language. |

## Structs

| Name                                                                                  | Description                                                                                    |
| ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| [CompilationJob](/2.4/api/csharp/yarn.compiler/yarn.compiler.compilationjob.md)       | An object that contains Yarn source code to compile, and instructions on how to compile it.    |
| [CompilationResult](/2.4/api/csharp/yarn.compiler/yarn.compiler.compilationresult.md) | The result of a compilation.                                                                   |
| [FileParseResult](/2.4/api/csharp/yarn.compiler/yarn.compiler.fileparseresult.md)     | Contains the result of parsing a single file of source code.                                   |
| [StringInfo](/2.4/api/csharp/yarn.compiler/yarn.compiler.stringinfo.md)               | Information about a string. Stored inside a string table, which is produced from the Compiler. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yarnspinner.dev/2.4/api/csharp/yarn.compiler.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
