Intuitive DSL for Java

Version 2.1.0 · examples/04-macros/README.md

Git clone
git clone https://www.dbalabs.ch/git/intuitive-dsl-java.git

README.md

04 - Macros

This module demonstrates how to use Macros to handle dynamic lists of values that are not known at compile time.

Concepts

  • ${macroName}: A placeholder in the grammar that references a dynamic registry.
  • MacroResolver: A functional interface used to supply valid choices to the engine during parsing.
  • Token Matching: Multi-word choices (like full backup) are matched using longest-token-count logic.
  • Normalization: Quoted values in macros (like 'COMPLEX.TASK') have their quotes stripped and internal apostrophes unescaped when bound.

How to run

From your IDE

Execute the main method in MacrosApp.java.

From the command line

mvn clean compile exec:java