ddmd.expression

Compiler implementation of the D programming language.

Members

Classes

AddAssignExp
class AddAssignExp
AddExp
class AddExp
AddrExp
class AddrExp
AndAndExp
class AndAndExp
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
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
CatExp
class CatExp
CmpExp
class CmpExp
ComExp
class ComExp
CommaExp
class CommaExp
CompileExp
class CompileExp
ComplexExp
class ComplexExp
CondExp
class CondExp
ConstructExp
class ConstructExp
DeclarationExp
class DeclarationExp

Declaration of a symbol

DefaultInitExp
class DefaultInitExp
DelegateExp
class DelegateExp
DelegateFuncptrExp
class DelegateFuncptrExp
DeleteExp
class DeleteExp
DivAssignExp
class DivAssignExp
DivExp
class DivExp
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. A placeholder expression to call DsymbolExp.resolve on specific symbol.

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
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
MinAssignExp
class MinAssignExp
MinExp
class MinExp
ModAssignExp
class ModAssignExp
ModExp
class ModExp
ModuleInitExp
class ModuleInitExp
MulAssignExp
class MulAssignExp
MulExp
class MulExp
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
OrAssignExp
class OrAssignExp
OrExp
class OrExp
OrOrExp
class OrOrExp
OverExp
class OverExp

Overload Set

PostExp
class PostExp

For both i++ and i--

PowAssignExp
class PowAssignExp
PowExp
class PowExp
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
StringExp
class StringExp
StructLiteralExp
class StructLiteralExp

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

SuperExp
class SuperExp
SymOffExp
class SymOffExp

Offset from symbol

SymbolExp
class SymbolExp
TemplateExp
class TemplateExp

Mainly just a placeholder

ThisExp
class ThisExp
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

VectorExp
class VectorExp
XorAssignExp
class XorAssignExp
XorExp
class XorExp

Functions

RealEquals
int RealEquals(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.

arrayExpressionSemantic
bool arrayExpressionSemantic(Expressions* exps, Scope* sc, bool preserveErrors = false)

Perform semantic() on an array of Expressions.

arrayExpressionToCommonType
bool arrayExpressionToCommonType(Scope* sc, Expressions* exps, Type* pt)

The common type is determined by applying ?: to each pair. Output: exps[] properties resolved, implicitly cast to common type, rewritten in place *pt if pt is not NULL, set to the common type

callCpCtor
Expression callCpCtor(Scope* sc, Expression e)

If e is an instance of a struct, and that struct has a copy constructor, rewrite e as: (tmp = e),tmp Input: sc just used to specify the scope of created temporary variable

checkDefCtor
bool checkDefCtor(Loc loc, Type t)

Issue an error if default construction is disabled for type t. Default construction is required for arrays and 'out' parameters.

checkPropertyCall
bool checkPropertyCall(Expression e, Expression emsg)

Check the tail CallExp is really property function call.

doCopyOrMove
Expression doCopyOrMove(Scope* sc, Expression e)

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

expandTuples
void expandTuples(Expressions* exps)

Expand tuples. Input: exps aray of Expressions Output: exps rewritten in place

extractOpDollarSideEffect
Expression extractOpDollarSideEffect(Scope* sc, UnaExp ue)
functionParameters
bool functionParameters(Loc loc, Scope* sc, TypeFunction tf, Type tthis, Expressions* arguments, FuncDeclaration fd, Type* prettype, Expression* peprefix)

Now that we know the exact type of the function we're calling, the arguments[] need to be adjusted: 1. implicitly convert argument to the corresponding parameter type 2. add default arguments for any missing arguments 3. do default promotions on arguments corresponding to ... 4. add hidden _arguments[] argument 5. call copy constructor for struct value arguments Input: tf type of the function fd the function being called, NULL if called indirectly Output: *prettype return type of function *peprefix expression to execute before arguments[] are evaluated, NULL if none

getFuncTemplateDecl
TemplateDeclaration getFuncTemplateDecl(Dsymbol s)

Get TemplateDeclaration enclosing FuncDeclaration.

getRightThis
Expression getRightThis(Loc loc, Scope* sc, AggregateDeclaration ad, Expression e1, Declaration var, int flag = 0)

Given var, we need to get the right 'this' pointer if var is in an outer class, but our existing 'this' pointer is in an inner class. Input: e1 existing 'this' ad struct or class we need the correct 'this' for var the specific member of ad we're accessing

hasThis
FuncDeclaration hasThis(Scope* sc)

Determine if 'this' is available. If it is, return the FuncDeclaration that has it.

isAliasThisTuple
TupleDeclaration isAliasThisTuple(Expression e)

Expand alias this tuples.

isDotOpDispatch
bool isDotOpDispatch(Expression e)

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

modifyFieldVar
int modifyFieldVar(Loc loc, Scope* sc, VarDeclaration var, Expression e1)

Mark variable v as modified if it is inside a constructor that var is a field in.

preFunctionParameters
bool preFunctionParameters(Loc loc, Scope* sc, Expressions* exps)

Preprocess arguments to function. Output: exps[] tuples expanded, properties resolved, rewritten in place

resolveOpDollar
Expression resolveOpDollar(Scope* sc, ArrayExp ae, IntervalExp ie, Expression* pe0)

Runs semantic on se->lwr and se->upr. Declares a temporary variable if '$' was used.

resolveOpDollar
Expression resolveOpDollar(Scope* sc, ArrayExp ae, Expression* pe0)

Runs semantic on ae->arguments. Declares temporary variables if '$' was used.

resolvePropertiesOnly
Expression resolvePropertiesOnly(Scope* sc, Expression e1)

If e1 is a property function (template), resolve it.

resolvePropertiesX
Expression resolvePropertiesX(Scope* sc, Expression e1, Expression e2 = null)

Pull out any properties.

resolveUFCS
Expression resolveUFCS(Scope* sc, CallExp ce)

Pull out callable entity with UFCS.

resolveUFCSProperties
Expression resolveUFCSProperties(Scope* sc, Expression e1, Expression e2 = null)

Pull out property with UFCS.

searchUFCS
Expression searchUFCS(Scope* sc, UnaExp ue, Identifier ident)

Find symbol in accordance with the UFCS name look up rule

semanticString
StringExp semanticString(Scope* sc, Expression exp, const char* s)

Resolve exp as a compile-time known string.

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.

Structs

UnionExp
struct UnionExp

Meta

Source

See Source File
$(DMDSRC _expression.d)