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/ctfe.h
14 #include "expression.h"
17 A reference to a class, or an interface. We need this when we
18 point to a base class (we must record what the type is).
20 class ClassReferenceExp final
: public Expression
23 StructLiteralExp
*value
;
24 ClassDeclaration
*originalClass();
26 /// Return index of the field, or -1 if not found
27 /// Same as getFieldIndex, but checks for a direct match with the VarDeclaration
28 int findFieldIndexByName(VarDeclaration
*v
);
29 void accept(Visitor
*v
) override
{ v
->visit(this); }
33 An uninitialized value
35 class VoidInitExp final
: public Expression
40 void accept(Visitor
*v
) override
{ v
->visit(this); }
44 Fake class which holds the thrown exception.
45 Used for implementing exception handling.
47 class ThrownExceptionExp final
: public Expression
50 ClassReferenceExp
*thrown
; // the thing being tossed
51 const char *toChars() const override
;
52 void accept(Visitor
*v
) override
{ v
->visit(this); }
55 /****************************************************************/
57 // This type is only used by the interpreter.
59 class CTFEExp final
: public Expression
62 const char *toChars() const override
;