Skip to content
Simple Declarative Language (SDL) for Dart
Dart
Branch: master
Clone or download
Latest commit da5ff6c Dec 19, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib improve analysis Dec 19, 2019
test tests Dec 19, 2019
tool quality and tests 🍮 Dec 18, 2019
.gitignore initial commit 💎 Dec 16, 2019
.travis.yml quality and tests 🍮 Dec 18, 2019
LICENSE initial commit 💎 Dec 16, 2019
README.md docs 📖 Dec 19, 2019
analysis_options.yaml improve analysis Dec 19, 2019
pubspec.yaml improve analysis Dec 19, 2019

README.md

SDLang-Dart Build Status

Simple Declarative Language (SDL) for Dart

SDLang is a simple and concise way to textually represent data. It has an XML-like structure – tags, values and attributes – which makes it a versatile choice for data serialization, configuration files, or declarative languages. Its syntax was inspired by the C family of languages (C/C++, C#, D, Java, …).

Details

sdl-dart is built with highly-efficient parser combinators - easy to read, very fluid, and LL(infinity).

How to use

import 'package:sdl_dart/sdl_dart.dart';

void main() {
    // ...

    final sdl = new SDLangParser();
    final result = sdl.parse(source);

    print(result.value);
}

Example

    // This is a node with a single string value
    title "Hello, World"

    // Multiple values are supported, too
    bookmarks 12 15 188 1234

    // Nodes can have attributes
    author "Peter Parker" email="peter@example.org" active=true

    // Nodes can be arbitrarily nested
    contents {
        section "First section" {
            paragraph "This is the first paragraph"
            paragraph "This is the second paragraph"
        }
    }

    // Anonymous nodes are supported
    "This text is the value of an anonymous node!"

    // This makes things like matrix definitions very convenient
    matrix {
        1 0 0
        0 1 0
        0 0 1
    }

Produces this metadata tree.

Not implemented

* 128 bit decimal
* utf8 support

License

Apache License 2.0.

You can’t perform that action at this time.