liveBook · Manning

Left-transform

As explained in Building User-Friendly DSLs

A side-transform that replaces an AST object with a binary operation extending the expression toward the left.

A left-transform is a side-transform that extends a binary-operation AST toward the left by replacing an AST object with a larger binary operation. section 12.5

Side-transforms support character-by-character expression editing, reducing domain-expert actions and avoiding the need to plan an entire expression before creating it. section 12.5

Building an expression incrementally

The expression 1 + 2 illustrates incremental AST construction: an existing operand becomes part of a binary operation, leaving the other operand to be filled. section 12.4 section 12.5

How Building User-Friendly DSLs covers it

How deep it goes
Defines left- and right-extension of binary-operation ASTs and explains their editing rationale without detailing a left-transform implementation.
Examples
Illustrates incremental editing with the expression 1 + 2 and corresponding expression ASTs.
What you can do after
Apply it to construct and edit expressions with fewer actions and less advance planning.
How it connects
Connects left-transform to side-transform, abstract syntax tree, binary operation, operator precedence, and associativity.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building User-Friendly DSLs. The section links point to the parts of the book it draws on.