# IndentAwareLexer

Class in [Yarn.Compiler](/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)](/api/csharp/yarn.compiler/yarn.compiler.indentawarelexer/yarn.compiler.indentawarelexer..ctor.md) | Initializes a new instance of the [IndentAwareLexer](/api/csharp/yarn.compiler/yarn.compiler.indentawarelexer.md) class. |

## Methods

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

## Properties

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

## Structs

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


---

# 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/api/csharp/yarn.compiler/yarn.compiler.indentawarelexer.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.
