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§
- dive
- Utilities for traversing a syntax tree while collecting elements of interest (i.e., “diving” for elements).
- grammar
- Module for the WDL grammar functions.
- lexer
- Module for the lexer implementation.
- parser
- Module for the parser implementation.
- version
- Representation for version definitions.
Structs§
- Diagnostic
- Represents a diagnostic to display to the user.
- Label
- Represents a label that annotates the source code.
- Span
- Represents a span of source.
- Syntax
Tree - Represents an untyped concrete syntax tree.
- Workflow
Description Language - Represents the Workflow Definition Language (WDL).
Enums§
- Severity
- Represents the severity of a diagnostic.
- Syntax
Kind - Represents the kind of syntax element (node or token) in a WDL concrete syntax tree (CST).
Statics§
- ALL_
SYNTAX_ KIND - Every
SyntaxKindvariant.
Traits§
- Syntax
Token Ext - An extension trait for
SyntaxTokens.
Functions§
- construct_
tree - Constructs a concrete syntax tree from a list of parser events.
Type Aliases§
- Syntax
Element - Represents an element (node or token) in the concrete syntax tree.
- Syntax
Node - Represents a node in the concrete syntax tree.
- Syntax
Node Children - Represents node children in the concrete syntax tree.
- Syntax
Token - Represents a token in the concrete syntax tree.