Project Description
Python/JSON inspired markup language designed to be extremely terse and DRY.
i.e.
configuration
appSettings
add key=path value="C:\Temp\"
connectionStrings
add #userdb connectionString="Data Source=sqlsrv;Initial Catalog=userdb;User ID=userrw;Password=secret"
system.net
mailSettings
smtp from=user@theinter.net
network host=localhost
Which turns into this...
<configuration>
<appSettings>
<add key="path" value="C:\Temp\"/>
</appSettings>
<connectionStrings>
<add name="userdb" connectionString="Data Source=sqlsrv;Initial Catalog=userdb;User ID=userrw;Password=secret"/>
</connectionStrings>
<system.net>
<mailSettings>
<smtp from="user@theinter.net">
<network host="localhost"/>
</smtp>
</mailSettings>
</system.net>
</configuration>
Here's the syntax...
doc > element+
element > LITERAL attribute* NEWLINE
| LITERAL attribute* NEWLINE INDENT element+ OUTDENT
attribute > NAME-DECLARATION value
| LITERAL EQUALS value
value > LITERAL
| STRING
LITERAL: [^>=\"\s\$#]+
STRING: "([^"\\]|\\.)*"
EQUALS: =
NAME-DECLARATION: #
NEWLINE: \r\n|\r|\n
INDENT and OUTDENT are special tokens that are emitted whenever the indentation
level changes. When tokens are encountered in a column greater than the previous
line, an INDENT token is emitted. When tokens are in encountered in a column less
than the previous line, an OUTDENT token is emitted.