Chapter 15: Domain Control Structures
The code generation that was presented in the previous chapters covered basic conditional and loop control structures, but domain-specific languages often have unique or customized semantics that merit introducing novel control structures. Adding a new control structure is usually substantially more difficult than adding a new function or operator. However, when they are effective, the addition of domain control structures is a large part of what makes domain-specific languages worth developing instead of just writing class libraries.
This chapter covers the following main topics:
- Knowing when you need a new control structure
- Processing text using string scanning
- Rendering graphics regions
The first section will help you learn how to determine when a domain control structure is needed. The second and third sections will present two example domain control structures.
This chapter will give you a better idea of when and...