I want to define a Domain Specific Language (DSL) that is structures / cascaded like this
ROOT
NAME "my dsl"
TODO
DESC "foo"
END
TODO
DESC "bar"
END
END
For my understanding it needs the following rules:
- ROOT and TODO objects has to start with their keyword and end with an END.
- ROOT must have a NAME attribute.
- TODO must have a DESC attribute
- TODO is 0..n times in ROOT
How can I express such ruleset in a BNF?