December 2009
Intermediate to advanced
380 pages
9h 2m
English
We use configuration files to set initial parameters and create initial data structures for applications. That means humans have to read and write those files. The problem is that XML is a generic data format, not a specialized DSL for initializing applications. Being good DSL-o-philes, we can do a lot better than XML for this niche.
What we want is a simple C-like notation that lets us build a list of objects with properties such as strings, ints, lists, and references to other configuration objects. Here’s a simple example:
| | Site jguru { |
| | port = 80; |
| | answers = "www.jguru.com"; |
| | aliases = ["jguru.com", "www.magelang.com"]; |
| | } |
To begin, we need Pattern 2, LL(1) Recursive-Descent Lexer and Pattern 3,
Read now
Unlock full access