sdl_dart 1.0.2

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.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  sdl_dart: ^1.0.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:sdl_dart/sdl_dart.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
40
Overall:
Weighted score of the above. [more]
38
Learn more about scoring.

We analyzed this package on Feb 12, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5

Maintenance issues and suggestions

Provide a file named CHANGELOG.md. (-20 points)

Changelog entries help developers follow the progress of your package. See the example generated by stagehand.

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (petitparser).

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and sdl_dart.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.3.0 <3.0.0
fixnum ^0.10.11 0.10.11
petitparser ^2.3.0 2.4.0 3.0.1
Transitive dependencies
meta 1.1.8
Dev dependencies
analyzer >=0.30.0 <0.37.0
grinder ^0.8.0
test ^1.6.3