> For the complete documentation index, see [llms.txt](https://docs.yarnspinner.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yarnspinner.dev/api/csharp/yarn.compiler/yarn.compiler.compiler.md).

# Compiler

Class in [Yarn.Compiler](/api/csharp/yarn.compiler.md)

Inherits from `System.Object`

## Summary

Compiles Yarn code.

```csharp
public static class Compiler
```

## Methods

| Name                                                                                                                                                            | Description                                                                                                                                                                        |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Compile(CompilationJob)](/api/csharp/yarn.compiler/yarn.compiler.compiler/yarn.compiler.compiler.compile.md)                                                   | Compiles Yarn code, as specified by a compilation job.                                                                                                                             |
| [FlattenParseTree(IParseTree)](/api/csharp/yarn.compiler/yarn.compiler.compiler/yarn.compiler.compiler.flattenparsetree.md)                                     | Flattens a tree of `Antlr4.Runtime.Tree.IParseTree` objects by recursively visiting their children, and converting them into a flat ``System.Collections.Generic.IEnumerable`1`` . |
| [GetDocumentComments(CommonTokenStream,ParserRuleContext,bool)](/api/csharp/yarn.compiler/yarn.compiler.compiler/yarn.compiler.compiler.getdocumentcomments.md) | Gets the text of the documentation comments that either immediately precede `context` , or are on the same line as `context` .                                                     |
| [GetLineIDForNodeName(string)](/api/csharp/yarn.compiler/yarn.compiler.compiler/yarn.compiler.compiler.getlineidfornodename.md)                                 | Generates a line id for a raw text node                                                                                                                                            |
