2 /* Compiler implementation of the D programming language
3 * Copyright (C) 1999-2023 by The D Language Foundation, All Rights Reserved
4 * written by Walter Bright
5 * https://www.digitalmars.com
6 * Distributed under the Boost Software License, Version 1.0.
7 * https://www.boost.org/LICENSE_1_0.txt
8 * https://github.com/dlang/dmd/blob/master/src/dmd/tokens.h
13 #include "root/dcompat.h"
14 #include "root/port.h"
23 < > <= >= == != === !==
24 << >> <<= >>= >>> >>>=
35 enum class TOK
: unsigned char
85 unsignedRightShiftAssign
,
86 concatenateAssign
, // ~=
243 moduleString
, // __MODULE__
244 functionString
, // __FUNCTION__
245 prettyFunction
, // __PRETTY_FUNCTION__
257 endOfLine
, // \n, \r, \u2028, \u2029
280 // C only extended keywords
293 enum class EXP
: unsigned char
323 dotTemplateDeclaration
,
338 delegateFunctionPointer
,
357 unsignedRightShiftAssign
,
359 concatenateAssign
, // ~=
360 concatenateElemAssign
,
361 concatenateDcharAssign
,
424 moduleString
, // __MODULE__
425 functionString
, // __FUNCTION__
426 prettyFunction
, // __PRETTY_FUNCTION__
438 compoundLiteral
, // ( type-name ) { initializer-list }
445 #define TOKwild TOKinout
447 // Token has an anonymous struct, which is not strict ISO C++.
448 #if defined(__GNUC__)
449 #pragma GCC diagnostic push
450 #pragma GCC diagnostic ignored "-Wpedantic"
457 const utf8_t
*ptr
; // pointer to first character of this token within buffer
459 DString blockComment
; // doc comment string prior to this token
460 DString lineComment
; // doc comment for previous token
471 { utf8_t
*ustring
; // UTF8 string
473 unsigned char postfix
; // 'c', 'w', 'd'
481 Token() : next(NULL
) {}
483 const char *toChars() const;
485 static const char *toChars(TOK value
);
488 #if defined(__GNUC__)
489 #pragma GCC diagnostic pop