| 1 |
|
| 2 |
/* Compiler implementation of the D programming language |
| 3 |
* Copyright (C) 1999-2025 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 |
| 9 |
*/ |
| 10 |
|
| 11 |
#pragma once |
| 12 |
|
| 13 |
#include "tokens.h" |
| 14 |
#include "expression.h" |
| 15 |
|
| 16 |
/** |
| 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). |
| 19 |
*/ |
| 20 |
class ClassReferenceExp final : public Expression |
| 21 |
{ |
| 22 |
public: |
| 23 |
StructLiteralExp *value; |
| 24 |
ClassDeclaration *originalClass(); |
| 25 |
|
| 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); } |
| 30 |
}; |
| 31 |
|
| 32 |
/** |
| 33 |
An uninitialized value |
| 34 |
*/ |
| 35 |
class VoidInitExp final : public Expression |
| 36 |
{ |
| 37 |
public: |
| 38 |
VarDeclaration *var; |
| 39 |
|
| 40 |
void accept(Visitor *v) override { v->visit(this); } |
| 41 |
}; |
| 42 |
|
| 43 |
/** |
| 44 |
Fake class which holds the thrown exception. |
| 45 |
Used for implementing exception handling. |
| 46 |
*/ |
| 47 |
class ThrownExceptionExp final : public Expression |
| 48 |
{ |
| 49 |
public: |
| 50 |
ClassReferenceExp *thrown; // the thing being tossed |
| 51 |
void accept(Visitor *v) override { v->visit(this); } |
| 52 |
}; |
| 53 |
|
| 54 |
/****************************************************************/ |
| 55 |
|
| 56 |
// This type is only used by the interpreter. |
| 57 |
|
| 58 |
class CTFEExp final : public Expression |
| 59 |
{ |
| 60 |
}; |