Expression as TreeRepresent operators and operands as tree nodes
This notional machine represents a source code expression in the form of a tree. This makes the structure of the expression explicit, and it allows visualizing the various steps of expression evaluation. It also allows annotating the various subexpressions with their types.
An expression tree is essentially an abstract syntax tree (AST), focused on just an expression.
Here is an example Java expression:
1 + 2 + "AAA" + 3 + 4
The corresponding expression tree shows not only the expression’s structure but also the types and values of all subexpressions:
70 Misconceptions Expressible in this Notional Machine
A notional machine focuses on a subset of the syntax and semantics of a programming language. The following misconceptions are related to the language features expressible in this notional machine.