# Yarn.Compiler Namespace

## Summary

Contains classes for compiling Yarn code.

## Classes

| Name                                                                                | Description                                                                                |
| ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| [Compiler](/2.1/api/csharp/yarn.compiler/yarn.compiler.compiler.md)                 | Compiles Yarn code.                                                                        |
| [Declaration](/2.1/api/csharp/yarn.compiler/yarn.compiler.declaration.md)           |                                                                                            |
| [Diagnostic](/2.1/api/csharp/yarn.compiler/yarn.compiler.diagnostic.md)             |                                                                                            |
| [IndentAwareLexer](/2.1/api/csharp/yarn.compiler/yarn.compiler.indentawarelexer.md) | A Lexer subclass that detects newlines and generates indent and dedent tokens accordingly. |
| [Utility](/2.1/api/csharp/yarn.compiler/yarn.compiler.utility.md)                   | Utility methods for working with line tags.                                                |

## Namespaces

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

## Structs

| Name                                                                                  | Description                                                                                    |
| ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| [CompilationJob](/2.1/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.1/api/csharp/yarn.compiler/yarn.compiler.compilationresult.md) | The result of a compilation.                                                                   |
| [FileParseResult](/2.1/api/csharp/yarn.compiler/yarn.compiler.fileparseresult.md)     | Contains the result of parsing a single file of source code.                                   |
| [StringInfo](/2.1/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.1/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.
