A side-transform replaces a selected AST object with a Binary Operation node that retains the object as its left or right operand. A right-transform extends an expression to the right: the existing object becomes the left operand and the new right operand remains unset. section 12.4 section 12.5
In a projectional editor, side-transforms let domain experts begin with a Number such as “1,” then convert it into a binary operation instead of planning the complete expression first. This reduces editing actions and supports character-by-character expression building. section 12.4 section 12.5
A practical right-transform implementation follows these steps:
- Replace the selected AST object through the parent property's replaceWith function. section 12.4
Turning “1” into “1 + ?”
When the user activates the right-transform on a Number AST object, replace it with newAstObject("Binary Operation", { "left operand": astObject }). The user can then select “+” and fill the remaining operand.
