YES
- Your Extensible Script .
YES is a meta scriptlet standard whose elements and meaning are determined by YOU the programmer. They can be extended further with attributes which allow YOUR end-users to make their additions to YOUR elements.
The dart API provides two constructors: parsing by file or parsing by string.
These constructors require the callback function to be set via .onComplete(...)
.
Loading by file is asynchronous and must be waited on for completion
void main() async {
final p = YesParser.fromFile(File.fromUri(Uri.file("example.mesh")), onComplete: onComplete);
// Wait for parser to finish before ending program
await p.join();
}
void onComplete(List<ElementInfo> elements, List<ErrorInfo> errors) { ... }
Loading by string is synchronous and can be used immediately.
void main() {
final p = YesParser.fromFile("...", onComplete: onComplete);
}
void onComplete(List<ElementInfo> elements, List<ErrorInfo> errors) { ... }
See the example to learn how to access element types and their data from a mesh file format which uses the YES scriplet spec.
This project is licensed under the Common Development and Distribution License (CDDL).