2009-07-13 20:45:15 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
2014-10-26 16:16:50 -04:00
|
|
|
* Copyright 2014, Rene Gollent, rene@gollent.com.
|
2009-07-13 20:45:15 +00:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef C_LANGUAGE_FAMILY_H
|
|
|
|
#define C_LANGUAGE_FAMILY_H
|
|
|
|
|
|
|
|
|
|
|
|
#include "SourceLanguage.h"
|
|
|
|
|
|
|
|
|
|
|
|
class CLanguageFamily : public SourceLanguage {
|
|
|
|
public:
|
|
|
|
CLanguageFamily();
|
|
|
|
virtual ~CLanguageFamily();
|
|
|
|
|
|
|
|
virtual SyntaxHighlighter* GetSyntaxHighlighter() const;
|
2013-04-19 22:53:10 -04:00
|
|
|
|
|
|
|
virtual status_t ParseTypeExpression(const BString& expression,
|
|
|
|
TeamTypeInformation* lookup,
|
|
|
|
Type*& _resultType) const;
|
|
|
|
|
2014-10-26 16:16:50 -04:00
|
|
|
virtual status_t EvaluateExpression(const BString& expression,
|
Debugger: Rework expression parsing API.
ExpressionInfo:
- No longer stores an explicit result type (this is inferred from
evaluation of the expression itself now).
- Introduce class ExpressionResult for returning the result of an
expression computation. This can currently take the form of either
a primitive value, or a value node object.
- Adjust UserInterfaceListener and ExpressionInfo::Listener to take
the above changes into account, and correspondingly adjust all
callers/listeners.
CLanguageExpressionEvaluator:
- Introduce child class Operand. This subsumes the functionality that
was previously in the separate Number class, and can represent a
primitive value, a value node or a type. Also has functionality to
implicity handle type promotion/inferring when performing calculations
between operands.
- Adjust expression parser to operate in terms of Operands rather than
Numbers. This allows a number of improvements, most notably that an
expression can now return a value node as a result rather than only
a primitive number. This capability isn't yet fully used, but paves
the way for future uses such as an expression that evaluates to a data
member, a global variable, or an arbitrary pointer of a particular type.
- Various cleanups/simplifications that were possible as a result of the above
changes.
ExpressionEvaluationWindow/ExpressionPromptWindow:
- Remove type menu field, since the expression API no longer uses it.
Adding/removing expressions in the VariablesView is temporarily disabled,
pending some further rework there to properly handle the new result object.
2014-11-15 00:31:17 -05:00
|
|
|
ValueNodeManager* manager,
|
|
|
|
ExpressionResult*& _output,
|
|
|
|
ValueNode*& _neededNode);
|
2014-10-26 16:16:50 -04:00
|
|
|
|
2013-04-19 22:53:10 -04:00
|
|
|
protected:
|
|
|
|
virtual bool IsModifierValid(char modifier) const = 0;
|
2009-07-13 20:45:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // C_LANGUAGE_FAMILY_H
|