Lexer

Undocumented in source but is binding to C++. You might be able to learn more by searching the web for its name.

Constructors

this
this(const(char)* filename, const(char)* base, size_t begoffset, size_t endoffset, int doDocComment, int commentToken)
Undocumented in source.

Members

Functions

charConstant
TOK charConstant(Token* t, int wide)
decodeUTF
uint decodeUTF()

Decode UTF character. Issue error messages for invalid sequences. Return decoded character, advance p to last character in UTF sequence.

delimitedStringConstant
TOK delimitedStringConstant(Token* t)

Lex delimited strings: q"(foo(xxx))" // "foo(xxx)" q"[foo(]" // "foo(" q"/foo]/" // "foo]" q"HERE foo HERE" // "foo\n" Input: p is on the "

deprecation
void deprecation(const(char)* format, ...)
Undocumented in source. Be warned that the author may not have intended to support it.
error
void error(const(char)* format, ...)
Undocumented in source. Be warned that the author may not have intended to support it.
error
void error(Loc loc, const(char)* format, ...)
Undocumented in source. Be warned that the author may not have intended to support it.
escapeSequence
uint escapeSequence()

Parse escape sequence.

escapeStringConstant
TOK escapeStringConstant(Token* t, int wide)
getDocComment
void getDocComment(Token* t, uint lineComment)

Parse doc comment embedded between t->ptr and p. Remove trailing blanks and tabs from lines. Replace all newlines with \n. Remove leading comment character from each line. Decide if it's a lineComment or a blockComment. Append to previous one for this token.

hexStringConstant
TOK hexStringConstant(Token* t)

Lex hex strings: x"0A ae 34FE BD"

inreal
TOK inreal(Token* t)

Read in characters, converting them to real.

loc
Loc loc()
Undocumented in source. Be warned that the author may not have intended to support it.
nextToken
TOK nextToken()
Undocumented in source. Be warned that the author may not have intended to support it.
number
TOK number(Token* t)

Read in a number. If it's an integer, store it in tok.TKutok.Vlong. integers can be decimal, octal or hex Handle the suffixes U, UL, LU, L, etc. If it's double, store it in tok.TKutok.Vdouble.

peek
Token* peek(Token* ct)
Undocumented in source. Be warned that the author may not have intended to support it.
peekNext
TOK peekNext()

Look ahead at next token's value.

peekNext2
TOK peekNext2()

Look 2 tokens ahead at value.

peekPastParen
Token* peekPastParen(Token* tk)

tk is on the opening (. Look ahead and return token that is past the closing ).

poundLine
void poundLine()

parse: #line linnum filespec also allow __LINE__ for linnum, and __FILE__ for filespec

scan
void scan(Token* t)

Turn next token in buffer into a token.

stringPostfix
void stringPostfix(Token* t)

Get postfix of string literal.

tokenStringConstant
TOK tokenStringConstant(Token* t)

Lex delimited strings: q{ foo(xxx) } // " foo(xxx) " q{foo(} // "foo(" q{{foo}"}"} // "{foo}"}"" Input: p is on the q

wysiwygStringConstant
TOK wysiwygStringConstant(Token* t, int tc)

Static functions

combineComments
const(char)* combineComments(const(char)* c1, const(char)* c2)

Combine two document comments into one, separated by a newline.

initLexer
void initLexer()
Undocumented in source. Be warned that the author may not have intended to support it.
isValidIdentifier
bool isValidIdentifier(const(char)* p)

Determine if string is a valid Identifier. Placed here because of commonality with Lexer functionality.

Static variables

stringbuffer
OutBuffer stringbuffer;

Lexer *******************************************

Variables

anyToken
int anyToken;
Undocumented in source.
base
const(char)* base;
Undocumented in source.
commentToken
int commentToken;
Undocumented in source.
doDocComment
int doDocComment;
Undocumented in source.
end
const(char)* end;
Undocumented in source.
errors
bool errors;
Undocumented in source.
line
const(char)* line;
Undocumented in source.
p
const(char)* p;
Undocumented in source.
scanloc
Loc scanloc;
Undocumented in source.
token
Token token;
Undocumented in source.

Meta