1/* 2 * Copyright 2014, Rene Gollent, rene@gollent.com 3 * Distributed under the terms of the MIT License. 4 */ 5 6 7#include "ExpressionValueNode.h" 8 9#include <new> 10 11#include "Type.h" 12 13 14// #pragma mark - ExpressionValueNode 15 16 17ExpressionValueNode::ExpressionValueNode(ExpressionValueNodeChild* nodeChild, 18 Type* type) 19 : 20 ChildlessValueNode(nodeChild), 21 fType(type) 22{ 23 fType->AcquireReference(); 24} 25 26 27ExpressionValueNode::~ExpressionValueNode() 28{ 29 fType->ReleaseReference(); 30} 31 32 33Type* 34ExpressionValueNode::GetType() const 35{ 36 return fType; 37} 38 39 40status_t 41ExpressionValueNode::ResolvedLocationAndValue(ValueLoader* valueLoader, 42 ValueLocation*& _location, Value*& _value) 43{ 44 return B_NOT_SUPPORTED; 45} 46 47 48// #pragma mark - ExpressionValueNodeChild 49 50 51ExpressionValueNodeChild::ExpressionValueNodeChild(const BString& expression, 52 Type* resultType) 53 : 54 fExpression(expression), 55 fResultType(resultType) 56{ 57 fResultType->AcquireReference(); 58} 59 60 61ExpressionValueNodeChild::~ExpressionValueNodeChild() 62{ 63 fResultType->ReleaseReference(); 64} 65 66 67const BString& 68ExpressionValueNodeChild::Name() const 69{ 70 return fExpression; 71} 72 73 74Type* 75ExpressionValueNodeChild::GetType() const 76{ 77 return fResultType; 78} 79 80 81ValueNode* 82ExpressionValueNodeChild::Parent() const 83{ 84 return NULL; 85} 86 87 88status_t 89ExpressionValueNodeChild::ResolveLocation(ValueLoader* valueLoader, 90 ValueLocation*& _location) 91{ 92 _location = NULL; 93 return B_OK; 94} 95