# IndentAwareLexer

Class in [Yarn.Compiler](https://docs.yarnspinner.dev/3.1/api/csharp/yarn.compiler)

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)](https://docs.yarnspinner.dev/3.1/api/csharp/yarn.compiler/yarn.compiler.indentawarelexer/yarn.compiler.indentawarelexer..ctor) | Initializes a new instance of the [IndentAwareLexer](https://docs.yarnspinner.dev/3.1/api/csharp/yarn.compiler/yarn.compiler.indentawarelexer) class. |

## Methods

| Name                                                                                                                                                             | Description                                                                                                    |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| [IsInWhenClause()](https://docs.yarnspinner.dev/3.1/api/csharp/yarn.compiler/yarn.compiler.indentawarelexer/yarn.compiler.indentawarelexer.isinwhenclause)       | Returns a value indicating whether the lexer is currently lexing an expression that's part of a 'when' clause. |
| [NextToken()](https://docs.yarnspinner.dev/3.1/api/csharp/yarn.compiler/yarn.compiler.indentawarelexer/yarn.compiler.indentawarelexer.nexttoken)                 |                                                                                                                |
| [SetInWhenClause(bool)](https://docs.yarnspinner.dev/3.1/api/csharp/yarn.compiler/yarn.compiler.indentawarelexer/yarn.compiler.indentawarelexer.setinwhenclause) | Sets a value indicating whether the lexer is currently lexing an expression that's part of a 'when' clause.    |

## Properties

| Name                                                                                                                                         | Description                                               |
| -------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
| [Warnings](https://docs.yarnspinner.dev/3.1/api/csharp/yarn.compiler/yarn.compiler.indentawarelexer/yarn.compiler.indentawarelexer.warnings) | Gets the collection of warnings determined during lexing. |

## Structs

| Name                                                                                                                                                 | Description                      |
| ---------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
| [LexerWarning](https://docs.yarnspinner.dev/3.1/api/csharp/yarn.compiler/yarn.compiler.indentawarelexer/yarn.compiler.indentawarelexer.lexerwarning) | A warning emitted during lexing. |
