Debugger: Add basic support for types in expressions.

SourceLanguage/CLanguageFamily/ExpressionEvaluationJob:
- Add TeamTypeInformation parameter to EvaluateExpression() hook. Adjust
  implementing subclasses and callers accordingly.

CLanguageExpressionEvaluator:
- Add class InternalVariableID for representing intermediate variables
  generated while parsing an expression.
- When parsing an identifier, if we were passed in a type information object,
  then first attempt to resolve the name as a type. If not matched, then fall
  through to attempting to match it to a value node as before.
- When parsing an atom, check if it resulted in a type. If it did, and there
  still remains more of the expression to parse, then parse the result to see
  what value/variable to try to apply the typecast to. If the result is a
  primitive, generate an appropriate internal variable + value node child for
  it, otherwise use the target variable's child. Then, attempt to typecast it
  as requested.
- Simplify _EatToken().
- If the final result of an expression is a type, configure the result object
  accordingly.

As a result of all the above, an expression can now resolve to a type, allowing
the evaluator to take over the duties of parsing the desired type for a typecast
request in the variables view, and in addition, expressions themselves can now
contain typecasts, which opens up quite a few new possibilities.
This commit is contained in:
Rene Gollent
2014-12-11 22:17:33 -05:00
parent 9d6cd8b210
commit af76b51633
7 changed files with 281 additions and 53 deletions
@@ -30,8 +30,8 @@ SourceLanguage::ParseTypeExpression(const BString& expression,
status_t
SourceLanguage::EvaluateExpression(const BString& expression,
ValueNodeManager* manager, ExpressionResult*& _resultValue,
ValueNode*& _neededNode)
ValueNodeManager* manager, TeamTypeInformation* info,
ExpressionResult*& _resultValue, ValueNode*& _neededNode)
{
return B_NOT_SUPPORTED;
}