Crate wdl_grammar

source ·
Expand description

Lexing and parsing for Workflow Description Language (WDL) documents.

This crate implements an infallible WDL parser based on the logos crate for lexing and the rowan crate for concrete syntax tree (CST) representation.

The parser outputs a list of parser events that can be used to construct the CST; the parser also keeps a list of Diagnostics emitted during the parse that relate to spans from the original source.

See SyntaxTree::parse for parsing WDL source; users may inspect the resulting CST to determine the version of the document that was parsed.

§Examples

An example of parsing WDL source into a CST and printing the tree:

use wdl_grammar::SyntaxTree;

let (tree, diagnostics) = SyntaxTree::parse("version 1.1");
assert!(diagnostics.is_empty());
println!("{tree:#?}");

Modules§

  • Module for the WDL grammar functions.
  • Module for the lexer implementation.
  • Module for the parser implementation.

Structs§

Enums§

  • Represents the severity of a diagnostic.
  • Represents the kind of syntax element (node or token) in a WDL concrete syntax tree (CST).

Traits§

  • A trait implemented on types that convert to spans.

Type Aliases§

  • Represents an element (node or token) in the concrete syntax tree.
  • Represents a node in the concrete syntax tree.
  • Represents node children in the concrete syntax tree.
  • Represents a token in the concrete syntax tree.