Macro

Transform input text into a different text before language processing using Templated Generation .

A language has a fixed set of forms and structure that it can process. At times, we see a way to add abstraction to a language by manipulating its input text with a purely textual transformation before that text is parsed by the compiler or interpreter for that language. Since we know the final form we'd like to see, it makes sense to describe the transformation by writing the desired output, with callouts for any parametrizable values.

A Macro allows you to define these transformations, either in a purely textual form or as a syntactic macro that understands the syntax of the underlying language.

For more details see chapter 15 of the DSL book

DSL Catalog