dmd.expression

Defines the bulk of the classes which represent the AST at the expression level.

Specification: ($LINK2 https://dlang.org/spec/expression.html, Expressions)

Members

Classes

AddAssignExp
class AddAssignExp

x += y

AddExp
class AddExp

The addition operator, x + y

AddrExp
class AddrExp

The 'address of' operator, &p

AndAssignExp
class AndAssignExp

x &= y

AndExp
class AndExp

The bitwise 'and' operator, x & y

ArrayExp
class ArrayExp

e1 [ a0, a1, a2, a3 ,... ]

ArrayLengthExp
class ArrayLengthExp

The .length property of an array

ArrayLiteralExp
class ArrayLiteralExp

[ e1, e2, e3, ... ]

AssertExp
class AssertExp

An assert expression, assert(x == y)

AssignExp
class AssignExp

The assignment / initialization operator, =

AssocArrayLiteralExp
class AssocArrayLiteralExp

[ key0 : value0, key1 : value1, ... ]

BinAssignExp
class BinAssignExp

Binary operator assignment, += -= *= etc.

BinExp
class BinExp

Base class for binary operators

BlitExp
class BlitExp

A bit-for-bit copy from e2 to e1

CallExp
class CallExp
CastExp
class CastExp

The type cast operator, cast(T) x

CatAssignExp
class CatAssignExp

The ~= operator.

CatDcharAssignExp
class CatDcharAssignExp

The ~= operator when appending a single dchar

CatElemAssignExp
class CatElemAssignExp

The ~= operator when appending a single element

CatExp
class CatExp

The concatenation operator, x ~ y

CmpExp
class CmpExp

A comparison operator, < <= > >=

ComExp
class ComExp

The bitwise complement operator, ~x

CommaExp
class CommaExp
ComplexExp
class ComplexExp

A compile-time complex number (deprecated)

CompoundLiteralExp
class CompoundLiteralExp

C11 6.5.2.5 ( type-name ) { initializer-list }

CondExp
class CondExp

The ternary operator, econd ? e1 : e2

ConstructExp
class ConstructExp
DeclarationExp
class DeclarationExp

Declaration of a symbol

DefaultInitExp
class DefaultInitExp

A special keyword when used as a function's default argument

DelegateExp
class DelegateExp
DelegateFuncptrExp
class DelegateFuncptrExp

The dg.funcptr property, pointing to the delegate's function

DelegatePtrExp
class DelegatePtrExp

The dg.ptr property, pointing to the delegate's 'context'

DeleteExp
class DeleteExp

The delete operator, delete x (deprecated)

DivAssignExp
class DivAssignExp

x /= y

DivExp
class DivExp

The division operator, x / y

DollarExp
class DollarExp

The dollar operator used when indexing or slicing an array. E.g a[$], a[1 .. $] etc.

DotExp
class DotExp
DotIdExp
class DotIdExp
DotTemplateExp
class DotTemplateExp

Mainly just a placeholder

DotTemplateInstanceExp
class DotTemplateInstanceExp

foo.bar!(args)

DotTypeExp
class DotTypeExp
DotVarExp
class DotVarExp
DsymbolExp
class DsymbolExp

Won't be generated by parser.

EqualExp
class EqualExp

== and !=

ErrorExp
class ErrorExp

Use this expression for error recovery.

Expression
class Expression

https://dlang.org/spec/expression.html#expression

FileInitExp
class FileInitExp

The __FILE__ token as a default argument

FuncExp
class FuncExp

Function/Delegate literal

FuncInitExp
class FuncInitExp

The __FUNCTION__ token as a default argument

GenericExp
class GenericExp

C11 6.5.1.1 Generic Selection For ImportC

HaltExp
class HaltExp

Generates a halt instruction

IdentifierExp
class IdentifierExp

An identifier in the context of an expression (as opposed to a declaration)

IdentityExp
class IdentityExp

is and !is

ImportExp
class ImportExp

An import expression, import("file.txt")

InExp
class InExp

The in operator, "a" in ["a": 1]

IndexExp
class IndexExp

e1 [ e2 ]

IntegerExp
class IntegerExp

A compile-time known integer value

IntervalExp
class IntervalExp

Mainly just a placeholder

IsExp
class IsExp

is(targ id tok tspec) is(targ id == tok2)

LineInitExp
class LineInitExp

The __LINE__ token as a default argument

LogicalExp
class LogicalExp

The logical 'and' / 'or' operator, X && Y / X || Y

LoweredAssignExp
class LoweredAssignExp

When an assignment expression is lowered to a druntime call this class is used to store the lowering. It essentially behaves the same as an AssignExp, but it is used to not waste space for other AssignExp that are not lowered to anything.

MinAssignExp
class MinAssignExp

x -= y

MinExp
class MinExp

The minus operator, x - y

MixinExp
class MixinExp

A string mixin, mixin("x")

ModAssignExp
class ModAssignExp

x %= y

ModExp
class ModExp

The modulo operator, x % y

ModuleInitExp
class ModuleInitExp

The __MODULE__ token as a default argument

MulAssignExp
class MulAssignExp

x *= y

MulExp
class MulExp

The multiplication operator, x * y

NegExp
class NegExp

The negation operator, -x

NewAnonClassExp
class NewAnonClassExp

class baseclasses { } (arguments)

NewExp
class NewExp

newtype(arguments)

NotExp
class NotExp

The logical not operator, !x

NullExp
class NullExp

A compile-time known null value

ObjcClassReferenceExp
class ObjcClassReferenceExp

Objective-C class reference expression.

OrAssignExp
class OrAssignExp

x |= y

OrExp
class OrExp

The bitwise 'or' operator, x | y

OverExp
class OverExp

Overload Set

PostExp
class PostExp

The postfix increment/decrement operator, i++ / i--

PowAssignExp
class PowAssignExp

x ^^= y

PowExp
class PowExp

The 'power' operator, x ^^ y

PreExp
class PreExp

The prefix increment/decrement operator, ++i / --i

PrettyFuncInitExp
class PrettyFuncInitExp

The __PRETTY_FUNCTION__ token as a default argument

PtrExp
class PtrExp

The pointer dereference operator, *p

RealExp
class RealExp

A compile-time known floating point number

RemoveExp
class RemoveExp

Associative array removal, aa.remove(arg)

ScopeExp
class ScopeExp

Mainly just a placeholder of Package, Module, Nspace, and TemplateInstance (including TemplateMixin)

ShlAssignExp
class ShlAssignExp

x <<= y

ShlExp
class ShlExp

The 'shift left' operator, x << y

ShrAssignExp
class ShrAssignExp

x >>= y

ShrExp
class ShrExp

The 'shift right' operator, x >> y

SliceExp
class SliceExp

e1 [lwr .. upr]

StringExp
class StringExp

https://dlang.org/spec/expression.html#string_literals

StructLiteralExp
class StructLiteralExp

sd( e1, e2, e3, ... )

SuperExp
class SuperExp

https://dlang.org/spec/expression.html#super

SymOffExp
class SymOffExp

Offset from symbol

SymbolExp
class SymbolExp
TemplateExp
class TemplateExp

Mainly just a placeholder

ThisExp
class ThisExp

https://dlang.org/spec/expression.html#this

ThrowExp
class ThrowExp

throw <e1> as proposed by DIP 1034.

TraitsExp
class TraitsExp

__traits(identifier, args...)

TupleExp
class TupleExp

A sequence of expressions

TypeExp
class TypeExp

Mainly just a placeholder

TypeidExp
class TypeidExp

typeid(int)

UAddExp
class UAddExp

The unary add operator, +x

UnaExp
class UnaExp

Base class for unary operators

UshrAssignExp
class UshrAssignExp

x >>>= y

UshrExp
class UshrExp

The 'unsigned shift right' operator, x >>> y

VarExp
class VarExp

Variable

VectorArrayExp
class VectorArrayExp

e1.array property for vectors.

VectorExp
class VectorExp
VoidInitExp
class VoidInitExp

An uninitialized value, generated from void initializers.

XorAssignExp
class XorAssignExp

x ^= y

XorExp
class XorExp

The bitwise 'xor' operator, x ^ y

Enums

Modifiable
enum Modifiable

Return value for checkModifiable

ModifyFlags
enum ModifyFlags

Specifies how the checkModify deals with certain situations

Functions

RealIdentical
bool RealIdentical(real_t x1, real_t x2)

Test to see if two reals are the same. Regard NaN's as equivalent. Regard +0 and -0 as different.

checkModifiable
Modifiable checkModifiable(Expression exp, Scope* sc, ModifyFlags flag)
doCopyOrMove
Expression doCopyOrMove(Scope* sc, Expression e, Type t)

Handle the postblit call on lvalue, or the move of rvalue.

expToVariable
VarDeclaration expToVariable(Expression e)

Given an Expression, find the variable it really is.

expandTuples
void expandTuples(Expressions* exps, Identifiers* names)

Expand tuples in-place.

firstComma
inout(Expression) firstComma(Expression e)

Find the first non-comma expression.

getFuncTemplateDecl
TemplateDeclaration getFuncTemplateDecl(Dsymbol s)

If s is a function template, i.e. the only member of a template and that member is a function, return that template.

hasThis
FuncDeclaration hasThis(Scope* sc)

Determine if this is available by walking up the enclosing scopes until a function is found.

isAliasThisTuple
TupleDeclaration isAliasThisTuple(Expression e)

Expand alias this tuples.

isArrayConstructionOrAssign
bool isArrayConstructionOrAssign(Identifier id)

Verify if the given identifier is any of _d_array{ctor,setctor,setassign,assign_l, assign_r}.

isDefaultInitOp
bool isDefaultInitOp(EXP op)
isDotOpDispatch
bool isDotOpDispatch(Expression e)

check e is exp.opDispatch!(tiargs) or not It's used to switch to UFCS the semantic analysis path

isNeedThisScope
bool isNeedThisScope(Scope* sc, Declaration d)

Determine if a this is needed to access d.

lastComma
inout(Expression) lastComma(Expression e)

Find the last non-comma expression.

typeDotIdExp
DotIdExp typeDotIdExp(Loc loc, Type type, Identifier ident)

TypeDotIdExp ***********************************

valueNoDtor
Expression valueNoDtor(Expression e)

If we want the value of this expression, but do not want to call the destructor on it.

Manifest constants

stageApply
enum stageApply;

apply is running

stageInlineScan
enum stageInlineScan;

inlineScan is running

stageOptimize
enum stageOptimize;

optimize is running

stageScrub
enum stageScrub;

scrubReturnValue is running

stageSearchPointers
enum stageSearchPointers;

hasNonConstPointers is running

stageToCBuffer
enum stageToCBuffer;

toCBuffer is running

Structs

ArgumentList
struct ArgumentList

The arguments of a function call

UnionExp
struct UnionExp

Meta