InlineCallInExpressionTreeDRAFT
For an expression involving a call, the expression tree inlines the expression tree of the computation in which the return value of that call was computed.
The expression tree of an expression involving a call inlines the call's computation of the returned value
The expression tree of an expression involving a call shows a node for the call, with children for each argument
CorrectionHere is what's right.
The expression tree represents a syntactic decomposition of an expression (a parse tree, or abstract syntax tree, of the expression). How a method computes its return value is not visible in an expression tree showing a call to that method.
For example:
public static int m() {
return 1 + 2;
}
//...
int result = m() + 4;
In the expression m() + 4
, the expression tree contains three nodes: ”+”, “m()” and “4”. Students with the misconception will draw a tree with five nodes: ”+”, ”+”, “1”, “2”, “4”.