• Stars
    star
    120
  • Rank 295,983 (Top 6 %)
  • Language
    D
  • License
    Other
  • Created over 11 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An SDLang (Simple Declarative Language) library for D

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:

  • Less verbose than JSON and XML.
  • Type-aware.
  • Easier to learn and read than YAML.

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:

  • Tags are separated by either newline or semicolon.
  • Whitespace and indentation is not significant (other than newlines).
  • The line-continuation operator is \ (backslash). This can be used to split a tag across multiple lines.
  • Line comments start with either #, // or --.
  • Block comments start with /* and end with the first occurrence of */ (ie, they do not nest).
  • Values always come before the attributes.
  • All the data types and syntax details are described in the Language Guide.
  • Note that, unlike C-based languages, opening curly braces must be on the same line, not the next line. Why?.

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

Differences from original Java implementation

  • License is zlib/libpng, not LGPL. (No source from the Java or Ruby implementations was used or looked at. The libraries were used to test compatibility, but the actual source code was not viewed.)
  • API is completely redesigned for D.
  • Anonymous tags are named "" (empty string) not "content".
  • Dates with unknown or invalid time zones use a special type indicating "unknown time zone" (DateTimeFracUnknownZone) instead of assuming GMT.

Documentation

More Repositories

1

awesome-d

A curated list of awesome D documents, frameworks, libraries and software. Inspired by awesome-python.
D
652
star
2

DCD

The D Completion Daemon is an auto-complete program for the D programming language
D
349
star
3

D-Scanner

Swiss-army knife for D source code
D
243
star
4

dfmt

Dfmt is a formatter for D source code
D
204
star
5

D-YAML

YAML parser and emitter for the D programming language
D
118
star
6

libdparse

Library for lexing and parsing D source code
D
115
star
7

containers

Containers backed by std.experimental.allocator
D
109
star
8

drepl

A REPL for D
D
76
star
9

d2sqlite3

A small wrapper around SQLite for the D programming language
C
74
star
10

mecca

Weka.IO's userland OS
D
64
star
11

setup-dlang

Github action for dlang compiler setup
TypeScript
45
star
12

dfix

Tool for automatically upgrading D source code
D
45
star
13

std_data_json

Phobos candidate JSON implementation.
D
25
star
14

dmarkdown

Markdown to HTML processor for D
D
24
star
15

d-mans

Collection of D-Man drawings from around the world
HTML
20
star
16

DGrammar

An attempt to completely and correctly document the grammar of the D programming language
HTML
20
star
17

harbored-mod

A documentation generator for D with support for both DDoc and Markdown.
D
18
star
18

dsymbol

Basic symbol lookup/resolution for libdparse (Deprecated, see link)
D
16
star
19

quic-d

Implementation of QUIC in D. See: https://github.com/dlang/projects/issues/84
Nix
14
star
20

experimental.xml

A replacement of Phobos std.xml
D
11
star
21

discussions

Get in touch with the DLang community
11
star
22

stdx-allocator

Extracted std.experimental.allocator for usage via DUB
D
9
star
23

d-money

Handling amounts of money safely and efficiently
D
9
star
24

artwork

Collection of D artwork from around the world
HTML
8
star
25

tinyendian

Lightweight endianness library for D
D
8
star
26

libddoc

D implementation of the DDoc macro system
D
7
star
27

toml

D
4
star
28

configy

An automatic YAML to struct configuration parser for dlang
D
3
star
29

d-apt

Debian APT repository for D tools
2
star
30

gitcompatibledubpackage

An example of a repositery usable both as a DUB package and a git submodule.
D
2
star
31

decimal

1
star