---
title: "Token"
sidebar_label: "Token"
description: "Kotlin binding reference: Token."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.runtime](../index.md)/[Token](index.md)

# Token

[common]\
data class [Token](index.md)(val id: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html), val text: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), val begin: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val end: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val special: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html))

One token of [Tokenizer.tokenize](../Tokenizer/tokenize.md): its [id](id.md), the surface [text](text.md) it spells, the half-open byte span `[begin, end)` it covers in the source text, and whether the tokenizer injected it itself ([special](special.md): bos, eos, ...) rather than reading it from the input.

## Constructors

| | |
|---|---|
| [Token](Token.md) | [common]<br>constructor(id: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html), text: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), begin: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), end: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), special: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)) |

## Properties

| Name | Summary |
|---|---|
| [begin](begin.md) | [common]<br>val [begin](begin.md): [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) |
| [end](end.md) | [common]<br>val [end](end.md): [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) |
| [id](id.md) | [common]<br>val [id](id.md): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) |
| [special](special.md) | [common]<br>val [special](special.md): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) |
| [text](text.md) | [common]<br>val [text](text.md): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) |