dlang-community / SDLang-D

An SDLang (Simple Declarative Language) library for D
http://sdlang.org
Other
120 stars 21 forks source link

SDLang-D Build Status Build status

An SDLang (Simple Declarative Language) library for D, to read and write SDLang. Both a DOM and a Pull Parser are provided.

Officially supported compiler versions are shown in .travis.yml.

SDL is a data language like JSON, XML or YAML, except it's:

This is what SDL looks like (some of these examples, and more, are from the original SDL site:

// A couple basic values
first "Joe"
last "Coder"

// Supports values, named attributes, and various data types
numbers 12 53 2 635
names "Sally" "Frank N. Stein"
pets chihuahua="small" dalmation="hyper" mastiff="big"

mixed 34.7f "Tim" somedate=2010/08/14

// Supports child tags
folder "myFiles" color="yellow" protection=on {
    folder "my images" {
        file "myHouse.jpg" color=true date=2005/11/05
        file "myCar.jpg" color=false date=2002/01/05
    }
    folder "my documents" {
        document "resume.pdf"
    }
}

Tags are of this form:

[tag name] [values] [attributes] [children]

Attributes are simply values with names.

Tag and attribute names can optionally include a namespace prefix (ie, namespace:name). All parts are optional, the only exception being that an anonymous (ie, no name) tag must have at least one value.

Also:

For more details on the langauge, see the Language Guide.

Differences from original Java implementation

Documentation