> 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/2.5/api/csharp/yarn.compiler/yarn.compiler.indentawarelexer.md).

# IndentAwareLexer

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

Inherits from `Antlr4.Runtime.Lexer`

## Summary

A Lexer subclass that detects newlines and generates indent and dedent tokens accordingly.

```csharp
public abstract class IndentAwareLexer : Lexer
```

## Constructors

| Name                                                                                                                                                        | Description                                                                                                                  |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| [IndentAwareLexer(ICharStream,TextWriter,TextWriter)](/2.5/api/csharp/yarn.compiler/yarn.compiler.indentawarelexer/yarn.compiler.indentawarelexer..ctor.md) | Initializes a new instance of the [IndentAwareLexer](/2.5/api/csharp/yarn.compiler/yarn.compiler.indentawarelexer.md) class. |

## Methods

| Name                                                                                                                    | Description |
| ----------------------------------------------------------------------------------------------------------------------- | ----------- |
| [NextToken()](/2.5/api/csharp/yarn.compiler/yarn.compiler.indentawarelexer/yarn.compiler.indentawarelexer.nexttoken.md) |             |

## Properties

| Name                                                                                                                | Description                                               |
| ------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
| [Warnings](/2.5/api/csharp/yarn.compiler/yarn.compiler.indentawarelexer/yarn.compiler.indentawarelexer.warnings.md) | Gets the collection of warnings determined during lexing. |

## Structs

| Name                                                                                                              | Description                      |
| ----------------------------------------------------------------------------------------------------------------- | -------------------------------- |
| [Warning](/2.5/api/csharp/yarn.compiler/yarn.compiler.indentawarelexer/yarn.compiler.indentawarelexer.warning.md) | A warning emitted during lexing. |
