|
| TypeWrapped (Expression e, Meta m=Meta()) |
|
| TypeWrapped (Expression e, Type t, Meta m=Meta()) |
|
| TypeWrapped (Expression e, Type t, ValidateTypeMatch _, Meta m=Meta()) |
|
| TypeWrapped (Expression e, NodeRef t, Meta m=Meta()) |
|
| TypeWrapped (Expression e, NodeRef t, ValidateTypeMatch _, Meta m=Meta()) |
|
const auto & | expression () const |
|
bool | validateTypeMatch () const |
|
bool | operator== (const TypeWrapped &other) const |
|
bool | isLhs () const |
|
bool | isTemporary () const |
|
Type | type () const |
|
auto | isConstant () const |
|
auto | isEqual (const Expression &other) const |
|
auto | properties () const |
|
| NodeBase (Meta meta) |
|
| NodeBase (std::vector< Node > childs, Meta meta) |
|
template<typename T > |
const T & | child (int i) const |
|
template<typename T > |
void | assertChildIsA (int i) |
|
template<typename T > |
std::vector< T > | childs (int begin, int end) const |
|
template<typename T > |
std::vector< T > | childsOfType () const |
|
template<typename T > |
auto | nodesOfType () const |
|
template<typename T > |
auto | nodesOfType () |
|
void | addChild (Node n) |
|
auto & | childs () const |
|
auto & | childs () |
|
auto & | meta () const |
|
void | setMeta (Meta m) |
|
const NodeRef & | originalNode () const |
|
void | setOriginalNode (const NodeRef &n) |
|
void | clearCache () |
|
AST node for an expression wrapped into another which does not have a known type yet, for example because IDs are stil unresolved. With a "normal" expression, calling type()
would yield an unusable type. This expression instead returns a place-holder type that's derived on one of two ways:
1. If the fully resolved type of the expression is actually known
a-priori, it can be jsut passed into the constructor and will then
always be returned, independent of the inner expression's type
itself.
2. If no explicit type is given, `type()` returns a proxy type that
evaluates the expression's type on demand once requested (but not,
crucially, immediately). So once the expression is fully resolved,
this will yield its correct type. In the meantime, the proxy can be
passed around like any other type.
In case 1, one can in addition require that the expression's eventual fully-resolved type matches the type that was specified. If it doesn't the validator will then reject the code.