Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "Name" = 'DConfig grammar'
- "Author" = 'SiegeLord'
- "Version" = '0.1'
- "About" = 'Grammar for the DConfig configuration file format'
- "Start Symbol" = <Entries>
- ! -------------------------------------------------
- ! Character Sets
- ! -------------------------------------------------
- {UniAlpha} = {Letter} ! And a whole lot of other Unicode characters
- {IdentifierStart} = {UniAlpha} + [_]
- {IdentifierBody} = {UniAlpha} + {Number} + [_]
- {Valid} = {All Valid}
- {String1 Chars} = {Valid} - ["\]
- {String2 Chars} = {Valid} - [`\]
- ! -------------------------------------------------
- ! Terminals
- ! -------------------------------------------------
- Identifier = {IdentifierStart}{IdentifierBody}*
- StringLiteral1 = '"' ( {String1 Chars} | '\' {Printable} )* '"'
- StringLiteral2 = '`' ( {String2 Chars} | '\' {Valid} )* '`'
- Semicolon = ';'
- LeftBrace = '{'
- RightBrace = '}'
- ! -------------------------------------------------
- ! Comments
- ! -------------------------------------------------
- Comment Line = '//'
- Comment Start = '/*'
- Comment End = '*/'
- ! -------------------------------------------------
- ! Rules
- ! -------------------------------------------------
- <Entries> ::= <Entry> <Entries>
- |
- <Entry> ::= Identifier <Contents>
- <Contents> ::= <Value> <Aggregate>
- | <Aggregate>
- <Aggregate> ::= <Entry>
- | <Block>
- | Semicolon
- <Value> ::= StringLiteral1 | StringLiteral2
- <Block> ::= LeftBrace <Entries> RightBrace
Add Comment
Please, Sign In to add comment