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
- 
  DeclarationclassLexer;- 
  DeclarationboolCcompile;trueif compiling ImportC
- 
  Declarationubyteboolsize;size of a C Bool, default 1 
- 
  Declarationubyteshortsize;size of a C short, default 2 
- 
  Declarationubyteintsize;size of a C int, default 4 
- 
  Declarationubytelongsize;size of C long, 4 or 8 
- 
  Declarationubytelong_longsize;size of a C long long, default 8 
- 
  Declarationubytelong_doublesize;size of C long double, 8 or D real.sizeof 
- 
  Declarationubytewchar_tsize;size of C wchar_t, 2 or 4 
- 
  DeclarationErrorSinkeSink;send error messages through this interface 
- 
  Declarationpure nothrow scope this(const(char)*filename, const(char)*base, size_tbegoffset, size_tendoffset, booldoDocComment, boolcommentToken, ErrorSinkerrorSink, const(char)[]vendor= "DLF", uintversionNumber= 1);Creates a Lexer for the source code base[begoffset..endoffset+1]. The last character,base[endoffset], must benull(0) or EOF (0x1A).Parametersconst(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 ErrorSinkerrorSinkwhere error messages go, must not be nullconst(char)[]vendorname of the vendoruintversionNumberversion of the caller 
- 
  Declarationnothrow this(const(char)*filename, const(char)*base, size_tbegoffset, size_tendoffset, booldoDocComment, boolcommentToken, boolwhitespaceToken, ErrorSinkerrorSink);Alternative entry point for DMDLIB, adds whitespaceToken
- 
  Declarationnothrow scope this(ErrorSinkerrorSink);Used for unittests for a mock Lexer 
- 
  Declarationfinal nothrow voidresetDefineLines(const(char)[]slice);Reset lexer to lex #define's 
- 
  Declarationfinal nothrow voidnextDefineLine();Set up for next #define line. p should be at start of next line. 
- 
  Declarationfinal const pure nothrow @nogc @property @safe boolempty();Range interface 
- 
  Declarationpure nothrow @safe Token*allocateToken();Return Valuea newly allocated Token.
- 
  Declarationfinal nothrow TOKpeekNext();Look ahead at next token's value. 
- 
  Declarationfinal nothrow TOKpeekNext2();Look 2 tokens ahead at value. 
- 
  Declarationfinal nothrow voidscan(Token*t);Turn next token in buffer into a token. ParametersToken*tthe token to set the resulting Token to 
- 
  Declarationfinal nothrow Token*peekPastParen(Token*tk);tkis on the opening (. Look ahead and return token that is past the closing ).
- 
  Declarationnothrow boolparseSpecialTokenSequence();Parse special token sequence: Return Valuetrueif the special token sequence was handled
- 
  Declarationfinal nothrow voidpoundLine(ref Tokentok, boollinemarker);Parse line/file preprocessor directive: #line linnum [filespec] Allow __LINE__ for linnum, and __FILE__ for filespec. Accept linemarkerformat:linnum [filespec] {flags}There can be zero or more flags, which are one of the digits 1..4, and must be in ascending order. The flags are ignored.ParametersTokentoktoken we're on, which is linnum of linemarkerboollinemarkertrueif line marker format and lexer is on linnumReferences: linemarkerhttps://gcc.gnu.org/onlinedocs/gcc-11.1.0/cpp/Preprocessor-Output.html
- 
  Declarationfinal nothrow voidskipToNextLine(OutBuffer*defines= null);Scan forward to start of next line. ParametersOutBuffer*definessend characters to defines
- 
  Declarationstatic 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.
 
-