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
checkModifiable(exp, sc, flag)
doCopyOrMove(sc, e, t) Handle the postblit call on lvalue, or the move of rvalue.
expandTuples(exps) Expand tuples.
expToVariable(e) Given an Expression, find the variable it really is.
firstComma(e) Find the first non-comma expression.
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.
hasThis(sc) Determine if this is available by walking up the enclosing scopes until a function is found.
isAliasThisTuple(e) Expand alias this tuples.
isArrayConstructionOrAssign(id) Verify if the given identifier is any of d_array{ctor,setctor,setassign,assign_l, assign_r}.
isDefaultInitOp(op)
isDotOpDispatch(e) check e is exp.opDispatch!(tiargs) or not It's used to switch to UFCS the semantic analysis path
isNeedThisScope(sc, d) Determine if a this is needed to access d.
lastComma(e) Find the last non-comma expression.
RealIdentical(x1, x2) Test to see if two reals are the same. Regard NaN's as equivalent. Regard +0 and -0 as different.
typeDotIdExp(loc, type, ident) TypeDotIdExp
valueNoDtor(e) If we want the value of this expression, but do not want to call the destructor on it.

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
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
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
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.
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
UnionExp

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