Token

open class Token

A token of the SAPERE math-expression grammar, as produced by ExpTokenManager. Tokens form a singly linked stream through next.

Constructors

Link copied to clipboard
constructor()
Builds a token with kind 0 and no image.
constructor(kind: Int)
Builds a token of the given kind with no image.
constructor(kind: Int, image: String)
Builds a token of the given kind and image.

Properties

Link copied to clipboard
open var beginColumn: Int
The column number of the first character of this Token.
Link copied to clipboard
open var beginLine: Int
The line number of the first character of this Token.
Link copied to clipboard
open var endColumn: Int
The column number of the last character of this Token.
Link copied to clipboard
open var endLine: Int
The line number of the last character of this Token.
Link copied to clipboard
open var image: String
The string image of the token.
Link copied to clipboard
open var kind: Int
The kind of this token, as one of the token identifiers declared in ExpConstants.
Link copied to clipboard
open var next: Token
The next regular token of the input stream, or null if this is the last token or the token manager has not read beyond it yet.
Link copied to clipboard
The last special token between the preceding regular token and this one, or null if there is none.

Functions

Link copied to clipboard
open fun getValue(): Any
An optional semantic value attached to this token, distinct from its image.
Link copied to clipboard
open fun newToken(ofKind: Int): Token
Factory for tokens without an image.
open fun newToken(ofKind: Int, image: String): Token
Factory used by ExpTokenManager to create tokens.
Link copied to clipboard
open fun toString(): String