1 /* 2 * Copyright 2014, Rene Gollent, rene@gollent.com. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef EXPRESSION_VALUE_NODE_H 6 #define EXPRESSION_VALUE_NODE_H 7 8 9 #include "ValueNode.h" 10 11 12 class ExpressionValueNodeChild; 13 14 15 class ExpressionValueNode : public ChildlessValueNode { 16 public: 17 ExpressionValueNode( 18 ExpressionValueNodeChild* nodeChild, 19 Type* type); 20 virtual ~ExpressionValueNode(); 21 22 virtual Type* GetType() const; 23 24 virtual status_t ResolvedLocationAndValue( 25 ValueLoader* valueLoader, 26 ValueLocation*& _location, 27 Value*& _value); 28 29 private: 30 Type* fType; 31 }; 32 33 34 class ExpressionValueNodeChild : public ValueNodeChild { 35 public: 36 ExpressionValueNodeChild( 37 const BString& expression, 38 Type* type); 39 virtual ~ExpressionValueNodeChild(); 40 41 virtual const BString& Name() const; 42 virtual Type* GetType() const; 43 virtual ValueNode* Parent() const; 44 45 const BString& GetExpression() const { return fExpression; }; 46 47 virtual status_t ResolveLocation(ValueLoader* valueLoader, 48 ValueLocation*& _location); 49 50 private: 51 BString fExpression; 52 Type* fResultType; 53 }; 54 55 56 #endif // EXPRESSION_VALUE_NODE_H 57