View source code
Display the source code in dmd/expression.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

Module 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)

Documentation

https://dlang.org/phobos/dmd_expression.html

Coverage

https://codecov.io/gh/dlang/dmd/src/master/src/dmd/expression.d

Functions

NameDescription
calledFunctionType(ce) Get the called function type from a call expression
expandTuples(exps, names) Expand tuples in-place.
expToVariable(e) Given an Expression, find the variable it really is.
getFuncTemplateDecl(s) If s is a function template, i.e. the only member of a template and that member is a function, return that template.
isAliasThisTuple(e) Expand alias this tuples.
isArrayConstruction(id) Verify if the given identifier is d_array{,set}ctor.
lastComma(e) Find the last non-comma expression.
typeDotIdExp(loc, type, ident) TypeDotIdExp

Classes

NameDescription
AddAssignExp x += y
AddExp The addition operator, x + y
AddrExp The 'address of' operator, &p
AndAssignExp x &= y
AndExp The bitwise 'and' operator, x & y
ArrayExp e1 [ a0, a1, a2, a3 ,... ]
ArrayLengthExp The .length property of an array
ArrayLiteralExp [ e1, e2, e3, ... ]
AssertExp An assert expression, assert(x == y)
AssignExp The assignment / initialization operator, =
AssocArrayLiteralExp [ key0 : value0, key1 : value1, ... ]
BinAssignExp Binary operator assignment, += -= *= etc.
BinExp Base class for binary operators
BlitExp A bit-for-bit copy from e2 to e1
CallExp
CastExp The type cast operator, cast(T) x
CatAssignExp The ~= operator.
CatDcharAssignExp The ~= operator when appending a single dchar
CatElemAssignExp The ~= operator when appending a single element
CatExp The concatenation operator, x ~ y
ClassReferenceExp A reference to a class, or an interface. We need this when we point to a base class (we must record what the type is).
CmpExp A comparison operator, < <= > >=
ComExp The bitwise complement operator, ~x
CommaExp
ComplexExp A compile-time complex number (deprecated)
CompoundLiteralExp C11 6.5.2.5 ( type-name ) { initializer-list }
CondExp The ternary operator, econd ? e1 : e2
ConstructExp
CTFEExp This type is only used by the interpreter.
DeclarationExp Declaration of a symbol
DefaultInitExp A special keyword when used as a function's default argument
DelegateExp
DelegateFuncptrExp The dg.funcptr property, pointing to the delegate's function
DelegatePtrExp The dg.ptr property, pointing to the delegate's 'context'
DeleteExp The delete operator, delete x (deprecated)
DivAssignExp x /= y
DivExp The division operator, x / y
DollarExp The dollar operator used when indexing or slicing an array. E.g a[$], a[1 .. $] etc.
DotExp
DotIdExp
DotTemplateExp Mainly just a placeholder
DotTemplateInstanceExp foo.bar!(args)
DotTypeExp
DotVarExp
DsymbolExp Won't be generated by parser.
EqualExp == and !=
ErrorExp Use this expression for error recovery.
Expression
FileInitExp The __FILE__ token as a default argument
FuncExp Function/Delegate literal
FuncInitExp The __FUNCTION__ token as a default argument
GenericExp C11 6.5.1.1 Generic Selection For ImportC
HaltExp Generates a halt instruction
IdentifierExp An identifier in the context of an expression (as opposed to a declaration)
IdentityExp is and !is
ImportExp An import expression, import("file.txt")
IndexExp e1 [ e2 ]
InExp The in operator, "a" in ["a": 1]
IntegerExp A compile-time known integer value
IntervalExp Mainly just a placeholder
IsExp is(targ id tok tspec) is(targ id == tok2)
LineInitExp The __LINE__ token as a default argument
LogicalExp The logical 'and' / 'or' operator, X && Y / X || Y
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 x -= y
MinExp The minus operator, x - y
MixinExp A string mixin, mixin("x")
ModAssignExp x %= y
ModExp The modulo operator, x % y
ModuleInitExp The __MODULE__ token as a default argument
MulAssignExp x *= y
MulExp The multiplication operator, x * y
NegExp The negation operator, -x
NewAnonClassExp class baseclasses { } (arguments)
NewExp newtype(arguments)
NotExp The logical not operator, !x
NullExp A compile-time known null value
ObjcClassReferenceExp Objective-C class reference expression.
OrAssignExp x |= y
OrExp The bitwise 'or' operator, x | y
OverExp Overload Set
PostExp The postfix increment/decrement operator, i++ / i--
PowAssignExp x ^^= y
PowExp The 'power' operator, x ^^ y
PreExp The prefix increment/decrement operator, ++i / --i
PrettyFuncInitExp The __PRETTY_FUNCTION__ token as a default argument
PtrExp The pointer dereference operator, *p
RealExp A compile-time known floating point number
RemoveExp Associative array removal, aa.remove(arg)
ScopeExp Mainly just a placeholder of Package, Module, Nspace, and TemplateInstance (including TemplateMixin)
ShlAssignExp x <<= y
ShlExp The 'shift left' operator, x << y
ShrAssignExp x >>= y
ShrExp The 'shift right' operator, x >> y
SliceExp e1 [lwr .. upr]
StringExp
StructLiteralExp sd( e1, e2, e3, ... )
SuperExp
SymbolExp
SymOffExp Offset from symbol
TemplateExp Mainly just a placeholder
ThisExp
ThrowExp throw <e1> as proposed by DIP 1034.
ThrownExceptionExp Fake class which holds the thrown exception. Used for implementing exception handling.
TraitsExp _traits(identifier, args...)
TupleExp A sequence of expressions
TypeExp Mainly just a placeholder
TypeidExp typeid(int)
UAddExp The unary add operator, +x
UnaExp Base class for unary operators
UshrAssignExp x >>>= y
UshrExp The 'unsigned shift right' operator, x >>> y
VarExp Variable
VectorArrayExp e1.array property for vectors.
VectorExp
VoidInitExp An uninitialized value, generated from void initializers.
XorAssignExp x ^= y
XorExp The bitwise 'xor' operator, x ^ y

Structs

NameDescription
ArgumentList The arguments of a function call

Enums

NameDescription
Modifiable Return value for checkModifiable
ModifyFlags Specifies how the checkModify deals with certain situations

Manifest constants

NameTypeDescription
stageApply apply is running
stageInlineScan inlineScan is running
stageOptimize optimize is running
stageScrub scrubReturnValue is running
stageSearchPointers hasNonConstPointers is running
stageToCBuffer toCBuffer is running

Authors

Walter Bright

License

Boost License 1.0