yes_parser 1.0.5 copy "yes_parser: ^1.0.5" to clipboard
yes_parser: ^1.0.5 copied to clipboard

Dart implementation of the YES scriplet standard. YES is a meta scriptlet standard whose elements and meaning are customized by the programmer. This library parses files using the YES spec and deliver [...]

YES Script #

YES - Your Extensible Script .

Do you want a custom and simple file format but don't want to code the parser? YES is the answer! ✨

YES is a meta scriplet standard whose elements, keys, and evaluation are yours to decide. These scriplets are used for configuration files, animation documents, tiny scripting, and then some. YES has optional attribute support to tag elements and extend their behavior further.

Tip

Getting Started #

This API provides two static class methods:

  1. Parse by file.
  2. Parse by string.

Note

Loading by file is asynchronous.

void main() async {
  final YesParser parser = await YesParser.fromFile(
    File.fromUri(
      Uri.file("doc.mesh"),
    ),
  );

  // Successfully parsed elements are stored in [elementInfoList].
  // Errors are stored in [errorInfoList].
  onComplete(parser.elementInfoList, parser.errorInfoList);
}

void onComplete(List<ElementInfo> elements, List<ErrorInfo> errors) { ... }

Note

Loading by string is synchronous.

void main() {
  // docStr is a large document with each line separated by new-lines.
  final String docStr = "...";
  final YesParser parser = YesParser.fromString(docStr);
  onComplete(parser.elementInfoList, parser.errorInfoList);
}

void onComplete(List<ElementInfo> elements, List<ErrorInfo> errors) { ... }

Run the Example #

Enter the example directory and run from command line.

cd example
dart yes_parser_example.dart

This simple example shows how to step through each element and ignore unimportant errors for a 3D Mesh format similar to Wavefront's 3D .OBJ format.

License #

This project is licensed under the Common Development and Distribution License (CDDL).

2
likes
0
points
76
downloads

Publisher

unverified uploader

Weekly Downloads

Dart implementation of the YES scriplet standard. YES is a meta scriptlet standard whose elements and meaning are customized by the programmer. This library parses files using the YES spec and delivers the result as elements. Use the KeyVal args passed into each element to provide external functionality to their own software easily and quickly at no cost to readability or flexibility. It is a format for everyone.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on yes_parser