2 * Copyright 2006-2014 Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
6 * Stephan Aßmus <superstippi@gmx.de>
7 * Rene Gollent <rene@gollent.com>
8 * John Scipione <jscipione@gmail.com>
9 * Ingo Weinhold <bonefish@cs.tu-berlin.de>
11 #ifndef C_LANGUAGE_EXPRESSION_EVALUATOR_H
12 #define C_LANGUAGE_EXPRESSION_EVALUATOR_H
24 class TeamTypeInformation
;
28 class ValueNodeManager
;
32 class ValueNeededException
{
34 ValueNeededException(ValueNode
* node
)
44 class ExpressionResult
;
48 class CLanguageExpressionEvaluator
{
51 CLanguageExpressionEvaluator();
52 ~CLanguageExpressionEvaluator();
54 ExpressionResult
* Evaluate(const char* expressionString
,
55 ValueNodeManager
* manager
,
56 TeamTypeInformation
* info
);
59 class InternalVariableID
;
64 Operand
_ParseProduct();
65 Operand
_ParseUnary();
66 Operand
_ParseIdentifier(ValueNode
* parentNode
= NULL
);
69 void _EatToken(int32 type
);
71 Operand
_ParseType(Type
* baseType
);
72 // the passed in Type object
73 // is expected to be the initial
74 // base type that was recognized by
75 // e.g. ParseIdentifier. This function then
76 // takes care of handling any modifiers
77 // that go with it, and returns a
78 // corresponding final type.
80 void _RequestValueIfNeeded(
81 const CLanguage::Token
& token
,
82 ValueNodeChild
* child
);
84 void _GetNodeChildForPrimitive(
85 const CLanguage::Token
& token
,
86 const BVariant
& value
,
87 ValueNodeChild
*& _output
) const;
90 CLanguage::Tokenizer
* fTokenizer
;
91 TeamTypeInformation
* fTypeInfo
;
92 ValueNodeManager
* fNodeManager
;
95 #endif // C_LANGUAGE_EXPRESSION_EVALUATOR_H