AbstractCharStream

An implementation of interface CharStream, where the stream is assumed to contain only ASCII characters (without unicode processing).

Inheritors

Constructors

Link copied to clipboard
constructor(nStartLine: Int, nStartColumn: Int, nBufferSize: Int)
Constructor.

Properties

Link copied to clipboard
val DEFAULT_BUF_SIZE: Int = 4096
Default buffer size if nothing is specified

Functions

Link copied to clipboard
fun adjustBeginLineColumn(nNewLine: Int, nNewCol: Int)
Move the recorded position of the token currently being matched, and of everything buffered after it, so that the token starts at the given line and column.
Link copied to clipboard
open fun backup(nAmount: Int)
Backs up the input stream by amount steps.
Link copied to clipboard
open fun beginToken(): Char
Start matching a new token here.
Link copied to clipboard
open fun done()
The lexer calls this function to indicate that it is done with the stream and hence implementations can free any resources held by this class.
Link copied to clipboard
open fun getBeginColumn(): Int
Where the token being matched starts.
Link copied to clipboard
open fun getBeginLine(): Int
Where the token being matched starts.
Link copied to clipboard
open fun getEndColumn(): Int
Where the token being matched ends.
Link copied to clipboard
open fun getEndLine(): Int
Where the token being matched ends.
Link copied to clipboard
open fun getImage(): String
The text of the token being matched.
Link copied to clipboard
open fun getSuffix(len: Int): Array<Char>
The tail of the token being matched, for MORE productions.
Link copied to clipboard
How wide a tab is taken to be when counting columns.
Link copied to clipboard
Whether positions are being maintained at all.
Link copied to clipboard
open fun readChar(): Char
Get the next character from the selected input.
Link copied to clipboard
fun reInit(nStartLine: Int, nStartColumn: Int, nBufferSize: Int)
Reinitialise, so that the same instance can read another input.
Link copied to clipboard
fun setTabSize(nTabSize: Int)
Set the tab size to use.
Link copied to clipboard
fun setTrackLineColumn(bTrackLineColumn: Boolean)
Enable or disable line number and column number tracking.