Polka
A dot language parser for Rust; based on Parser Expression Grammar (PEG) using the excellent pest crate as the underpinning.
Usage (as a Rust Library)
- Add this to your
Cargo.toml
:
[]
= "0.6"
- Call the
parser
function by passing an inputString
extern crate polka;
use parse;
// Polka AST:
// Graph {
// strict: false,
// graph_type: Some(
// Digraph,
// ),
// id: None,
// statements: [
// EdgeStatement(
// EdgeStatement {
// edge: NodeId(
// NodeId {
// node_id: "a",
// port: None,
// },
// ),
// edge_rhs_list: [
// EdgeRhs {
// edge_op: Arrow,
// edge: NodeId(
// NodeId {
// node_id: "b",
// port: None,
// },
// ),
// },
// EdgeRhs {
// edge_op: Arrow,
// edge: NodeId(
// NodeId {
// node_id: "c",
// port: None,
// },
// ),
// },
// ],
// attributes: None,
// },
// ),
// ],
// }
Known Limitations:
- HTML ids are currently not supported.