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:#?}");
Re-exports§
pub use version::SupportedVersion;
Modules§
- Utilities for traversing a syntax tree while collecting elements of interest (i.e., “diving” for elements).
- Module for the WDL grammar functions.
- Module for the lexer implementation.
- Module for the parser implementation.
- Representation for version definitions.
Structs§
- Represents a diagnostic to display to the user.
- Represents a label that annotates the source code.
- Represents a span of source.
- Represents an untyped concrete syntax tree.
- Represents the Workflow Definition Language (WDL).
Enums§
- Represents the severity of a diagnostic.
- Represents the kind of syntax element (node or token) in a WDL concrete syntax tree (CST).
Statics§
- Every
SyntaxKind
variant.
Traits§
- An extension trait for
SyntaxToken
s. - A trait implemented on types that convert to spans.
Functions§
- Constructs a concrete syntax tree from a list of parser events.
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.