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

Aliases

fp2_t
alias fp2_t = bool function(const ref Loc loc, TOK, Expression, Expression)
Undocumented in source.
fp_t
alias fp_t = UnionExp function(const ref Loc loc, Type, Expression, Expression)
Undocumented in source.

Classes

AddAssignExp
class AddAssignExp
AddExp
class AddExp

http://dlang.org/spec/expression.html#add_expressions

AddrExp
class AddrExp
AndAssignExp
class AndAssignExp
AndExp
class AndExp
ArrayExp
class ArrayExp

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

ArrayLengthExp
class ArrayLengthExp
ArrayLiteralExp
class ArrayLiteralExp

[ e1, e2, e3, ... ]

AssertExp
class AssertExp

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

AssignExp
class AssignExp
AssocArrayLiteralExp
class AssocArrayLiteralExp

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

BinAssignExp
class BinAssignExp
BinExp
class BinExp
BlitExp
class BlitExp
CallExp
class CallExp
CastExp
class CastExp

Possible to cast to one type while painting to another type

CatAssignExp
class CatAssignExp

The ~= operator. It can have one of the following operators:

CatDcharAssignExp
class CatDcharAssignExp
CatElemAssignExp
class CatElemAssignExp
CatExp
class CatExp

http://dlang.org/spec/expression.html#cat_expressions

CmpExp
class CmpExp

op is one of: TOK.lessThan, TOK.lessOrEqual, TOK.greaterThan, TOK.greaterOrEqual

ComExp
class ComExp
CommaExp
class CommaExp
ComplexExp
class ComplexExp
CondExp
class CondExp

econd ? e1 : e2

ConstructExp
class ConstructExp
DeclarationExp
class DeclarationExp

Declaration of a symbol

DefaultInitExp
class DefaultInitExp
DelegateExp
class DelegateExp
DelegateFuncptrExp
class DelegateFuncptrExp
DelegatePtrExp
class DelegatePtrExp
Undocumented in source but is binding to C++. You might be able to learn more by searching the web for its name.
DeleteExp
class DeleteExp
DivAssignExp
class DivAssignExp
DivExp
class DivExp

http://dlang.org/spec/expression.html#mul_expressions

DollarExp
class DollarExp
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. It should behave as a 'sink' to prevent further cascaded error messages.

Expression
class Expression

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

FileInitExp
class FileInitExp
FuncExp
class FuncExp

Function/Delegate literal

FuncInitExp
class FuncInitExp
HaltExp
class HaltExp
IdentifierExp
class IdentifierExp
IdentityExp
class IdentityExp

is and !is

ImportExp
class ImportExp
InExp
class InExp
IndexExp
class IndexExp

e1 [ e2 ]

IntegerExp
class IntegerExp
IntervalExp
class IntervalExp

Mainly just a placeholder

IsExp
class IsExp

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

LineInitExp
class LineInitExp
LogicalExp
class LogicalExp

http://dlang.org/spec/expression.html#andand_expressions

http://dlang.org/spec/expression.html#oror_expressions

MinAssignExp
class MinAssignExp
MinExp
class MinExp
MixinExp
class MixinExp

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

ModAssignExp
class ModAssignExp
ModExp
class ModExp

http://dlang.org/spec/expression.html#mul_expressions

ModuleInitExp
class ModuleInitExp
MulAssignExp
class MulAssignExp
MulExp
class MulExp

http://dlang.org/spec/expression.html#mul_expressions

NegExp
class NegExp
NewAnonClassExp
class NewAnonClassExp

thisexp.new(newargs) class baseclasses { } (arguments)

NewExp
class NewExp

thisexp.new(newargs) newtype(arguments)

NotExp
class NotExp
NullExp
class NullExp

http://dlang.org/spec/expression.html#null

ObjcClassReferenceExp
class ObjcClassReferenceExp

Objective-C class reference expression.

OrAssignExp
class OrAssignExp
OrExp
class OrExp
OverExp
class OverExp

Overload Set

PostExp
class PostExp

For both i++ and i--

PowAssignExp
class PowAssignExp
PowExp
class PowExp

http://dlang.org/spec/expression.html#pow_expressions

PreExp
class PreExp

For both ++i and --i

PrettyFuncInitExp
class PrettyFuncInitExp
PtrExp
class PtrExp
RealExp
class RealExp
RemoveExp
class RemoveExp

This deletes the key e1 from the associative array e2

ScopeExp
class ScopeExp

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

ShlAssignExp
class ShlAssignExp
ShlExp
class ShlExp
ShrAssignExp
class ShrAssignExp
ShrExp
class ShrExp
SliceExp
class SliceExp

e1 [lwr .. upr]

StringExp
class StringExp

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

StructLiteralExp
class StructLiteralExp

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

SuperExp
class SuperExp

http://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

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

TraitsExp
class TraitsExp

__traits(identifier, args...)

TupleExp
class TupleExp
TypeExp
class TypeExp

Mainly just a placeholder

TypeidExp
class TypeidExp

typeid(int)

UAddExp
class UAddExp
UnaExp
class UnaExp
UshrAssignExp
class UshrAssignExp
UshrExp
class UshrExp
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
XorExp
class XorExp

Enums

MemorySet
enum MemorySet
Undocumented in source.
Modifiable
enum Modifiable
Undocumented in source.
OwnedBy
enum OwnedBy
Undocumented in source.

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.

doCopyOrMove
Expression doCopyOrMove(Scope* sc, Expression e, Type t)

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

emplaceExp
void emplaceExp(T* p, Expression e)
Undocumented in source. Be warned that the author may not have intended to support it.
emplaceExp
void emplaceExp(void* p, Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
expToVariable
VarDeclaration expToVariable(Expression e)

Given an Expression, find the variable it really is.

expandAliasThisTuples
int expandAliasThisTuples(Expressions* exps, size_t starti)
Undocumented in source. Be warned that the author may not have intended to support it.
expandTuples
void expandTuples(Expressions* exps)

Expand tuples. Input: exps aray of Expressions Output: exps rewritten 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.

isDefaultInitOp
bool isDefaultInitOp(TOK 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

isFuncAddress
FuncDeclaration isFuncAddress(Expression e, bool* hasOverloads)
Undocumented in source. Be warned that the author may not have intended to support it.
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

LOGSEMANTIC
enum LOGSEMANTIC;
Undocumented in source.
WANTexpand
enum WANTexpand;
Undocumented in source.
WANTvalue
enum WANTvalue;
Undocumented in source.
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

UnionExp
struct UnionExp

Meta