> 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.utility.md).

# Utility

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

Inherits from `System.Object`

## Summary

Utility methods for working with line tags.

```csharp
public static class Utility
```

## Methods

| Name                                                                                                                                                                                                                                     | Description                                                                                                                               |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| [AddTagsToLines(string,ICollection?)](/api/csharp/yarn.compiler/yarn.compiler.utility/yarn.compiler.utility.addtagstolines.md)                                                                                                           | Given Yarn source code, adds line tags to the ends of all lines that need one and do not already have one.                                |
| [DetermineNodeConnections(string\[\])](/api/csharp/yarn.compiler/yarn.compiler.utility/yarn.compiler.utility.determinenodeconnections.md)                                                                                                | Finds and collates every jump in every node.                                                                                              |
| [ExtractStringBlocks(IEnumerable,ProjectDebugInfo)](/api/csharp/yarn.compiler/yarn.compiler.utility/yarn.compiler.utility.extractstringblocks.md)                                                                                        | Gets the collection of contiguous runs of lines in the provided nodes. Each run of lines is guaranteed to run to completion once entered. |
| [GenerateYarnFileWithDeclarations(IEnumerable\<Yarn.Compiler.Declaration>,string,IEnumerable?,IDictionary\<string, string>?)](/api/csharp/yarn.compiler/yarn.compiler.utility/yarn.compiler.utility.generateyarnfilewithdeclarations.md) | Generates a Yarn script that contains a node that declares variables.                                                                     |
| [GetCompiledCodeAsString(Program,Library?,CompilationResult?)](/api/csharp/yarn.compiler/yarn.compiler.utility/yarn.compiler.utility.getcompiledcodeasstring.md)                                                                         | Gets a string containing a representation of the compiled bytecode for a [Program](/api/csharp/yarn/yarn.program.md) .                    |
| [GetYarnValue(IConvertible)](/api/csharp/yarn.compiler/yarn.compiler.utility/yarn.compiler.utility.getyarnvalue.md)                                                                                                                      | Returns an [IYarnValue](/api/csharp/yarn/yarn.iyarnvalue.md) representation of the provided value.                                        |
| [ParseSource(string)](/api/csharp/yarn.compiler/yarn.compiler.utility/yarn.compiler.utility.parsesource.md)                                                                                                                              | Parses a string of Yarn source code, and produces a FileParseResult and (if there were any problems) a collection of diagnostics.         |
| [TagLines(string,ICollection?)](/api/csharp/yarn.compiler/yarn.compiler.utility/yarn.compiler.utility.taglines.md)                                                                                                                       | Given Yarn source code, adds line tags to the ends of all lines that need one and do not already have one.                                |
| [TryGetNodeTitle(string?,YarnSpinnerParser.NodeContext,string?,string?,string?,string?)](/api/csharp/yarn.compiler/yarn.compiler.utility/yarn.compiler.utility.trygetnodetitle.md)                                                       | Gets the title for a node as defined in the source code, along with its unique title (which may be different to the source title.)        |
