You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Meta parsing is like having a language like regular expressions, but for whole text documents. The rules describes the syntax in a short and concise form.
When a document is read through meta parsing, it gets transformed into a list of commands describing a tree structure called "meta data". This structure consists of these commands:
start node (name)
end node (name)
bool (name, value)
f64 (name, value)
string (name, value)
Meta parsing happens in two steps:
Convert text document into meta data
Convert meta data into application data
When there is a syntax error in the text document, the meta parser reports this with a nice error message.
Dyon uses the Piston-Meta library for meta parsing.
List of included functions for meta parsing
fn load__meta_file(meta_file: str, file: str) -> res[[]]
fn load__meta_url(meta_file: str, url: str) -> res[[]]
fn syntax__in_string(name: str, text: str) -> res[any] { ... }
fn meta__syntax_in_string(syntax: any, name: str, text: str) -> res[[any]] { ... }
What is meta parsing?
Meta parsing is like having a language like regular expressions, but for whole text documents. The rules describes the syntax in a short and concise form.
When a document is read through meta parsing, it gets transformed into a list of commands describing a tree structure called "meta data". This structure consists of these commands:
Meta parsing happens in two steps:
When there is a syntax error in the text document, the meta parser reports this with a nice error message.
Example: JSON
This meta format validates JSON documents:
Why use meta parsing?
Meta parsing has the following benefits:
Dyon's syntax is using meta parsing!
Dyon uses meta parsing on its own syntax. Dyon's meta syntax.
You can use this to parse Dyon code, generate documentation, do some analysis etc.
The text was updated successfully, but these errors were encountered: