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 17 ExpressionValueNode::ExpressionValueNode(ExpressionValueNodeChild* nodeChild, 18 Type* type) 19 : 20 ChildlessValueNode(nodeChild), 21 fType(type) 22 { 23 fType->AcquireReference(); 24 } 25 26 27 ExpressionValueNode::~ExpressionValueNode() 28 { 29 fType->ReleaseReference(); 30 } 31 32 33 Type* 34 ExpressionValueNode::GetType() const 35 { 36 return fType; 37 } 38 39 40 status_t 41 ExpressionValueNode::ResolvedLocationAndValue(ValueLoader* valueLoader, 42 ValueLocation*& _location, Value*& _value) 43 { 44 return B_NOT_SUPPORTED; 45 } 46 47 48 // #pragma mark - ExpressionValueNodeChild 49 50 51 ExpressionValueNodeChild::ExpressionValueNodeChild(const BString& expression, 52 Type* resultType) 53 : 54 fExpression(expression), 55 fResultType(resultType) 56 { 57 fResultType->AcquireReference(); 58 } 59 60 61 ExpressionValueNodeChild::~ExpressionValueNodeChild() 62 { 63 fResultType->ReleaseReference(); 64 } 65 66 67 const BString& 68 ExpressionValueNodeChild::Name() const 69 { 70 return fExpression; 71 } 72 73 74 Type* 75 ExpressionValueNodeChild::GetType() const 76 { 77 return fResultType; 78 } 79 80 81 ValueNode* 82 ExpressionValueNodeChild::Parent() const 83 { 84 return NULL; 85 } 86 87 88 status_t 89 ExpressionValueNodeChild::ResolveLocation(ValueLoader* valueLoader, 90 ValueLocation*& _location) 91 { 92 _location = NULL; 93 return B_OK; 94 } 95