dmd.lexer
Implements the lexical analyzer, which converts source code into lexical tokens.
Specification: Lexical
License
Source: lexer.d
Documentation: https://dlang.org/phobos/dmd_lexer.html
-
Declaration
classLexer;-
Declaration
pure nothrow this(const(char)*filename, const(char)*base, size_tbegoffset, size_tendoffset, booldoDocComment, boolcommentToken);Creates a Lexer for the source code
base[begoffset..endoffset+1]. The last character,base[endoffset], must benull(0) or EOF (0x1A).Parameters
const(char)*filenameused for error messages
const(char)*basesource code, must be terminated by a
null(0) or EOF (0x1A) charactersize_tbegoffsetstarting offset into
base[]size_tendoffsetthe last offset to read into
base[]booldoDocCommenthandle documentation comments
boolcommentTokencomments become TOK.comment's
-
Declaration
pure nothrow @safe Token*allocateToken();Return Value
a newly allocated
Token. -
Declaration
final nothrow TOKpeekNext();Look ahead at next token's value.
-
Declaration
final nothrow TOKpeekNext2();Look 2 tokens ahead at value.
-
Declaration
final nothrow voidscan(Token*t);Turn next token in buffer into a token.
-
Declaration
final nothrow Token*peekPastParen(Token*tk);tkis on the opening (. Look ahead and return token that is past the closing ). -
Declaration
static pure nothrow const(char)*combineComments(const(char)[]c1, const(char)[]c2, boolnewParagraph);Combine two document comments into one, separated by an extra newline if
newParagraphistrue.
-