Lexer

class Lexer {
Identifier[d_string] stringtable;
Token* freelist;
d_string sourcename;
d_string base;
immutable(char)* end;
immutable(char)* p;
uint currentline;
Token token;
OutBuffer stringbuffer;
int useStringtable;
ErrInfo errinfo;
bool inited;
}

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Functions

escapeSequence
dchar escapeSequence()

Parse escape sequence.

number
TOK number(Token* t)

Read a number.

regexp
d_string regexp()

Scan regular expression. Return null with buffer pointer intact if it is not a regexp.

rescan
void rescan()

Horrible kludge to support disambiguating TOKregexp from TOKdivide. The idea is, if we are looking for a TOKdivide, and find instead a TOKregexp, we back up and rescan.

scan
void scan(Token* t)

Turn next token in buffer into a token.

string
d_string string(tchar quote)
unicode
dchar unicode()

Static functions

locToSrcline
d_string locToSrcline(immutable(char)* src, Loc loc)

Given source text, convert loc to a string for the corresponding line.

Meta