Expand description
An abstract syntax tree for Workflow Description Language (WDL) documents.
The AST implementation is effectively a facade over the concrete syntax tree
(CST) implemented by SyntaxTree from wdl-grammar
.
An AST is cheap to construct and may be cheaply cloned at any level.
However, an AST (and the underlying CST) are immutable; updating the tree requires replacing a node in the tree to produce a new tree. The unaffected nodes of the replacement are reused from the old tree to the new tree.
§Examples
An example of parsing a WDL document into an AST and validating it:
use wdl_ast::Document;
let (document, diagnostics) = Document::parse(source);
if !diagnostics.is_empty() {
// Handle the failure to parse
}
Modules§
- lexer
- Module for the lexer implementation.
- v1
- AST representation for a 1.x WDL document.
- version
- Representation for version definitions.
Structs§
- Comment
- Represents a comment token in the AST.
- Diagnostic
- Represents a diagnostic to display to the user.
- Document
- Represents a single WDL document.
- Ident
- Represents an identifier token.
- Label
- Represents a label that annotates the source code.
- Span
- Represents a span of source.
- Syntax
Tree - Represents an untyped concrete syntax tree.
- Token
Text - Helper for hashing tokens by their text.
- Version
- Represents a version in the AST.
- Version
Statement - Represents a version statement in a WDL AST.
- Whitespace
- Represents a whitespace token in the AST.
- Workflow
Description Language - Represents the Workflow Definition Language (WDL).
Enums§
- Ast
- Represents the AST of a Document.
- Direction
- Element
- An abstract syntax tree element.
- Node
- An abstract syntax tree node.
- Severity
- Represents the severity of a diagnostic.
- Supported
Version - Represents a supported WDL version.
- Syntax
Kind - Represents the kind of syntax element (node or token) in a WDL concrete syntax tree (CST).
- Token
- An abstract syntax tree token.
Traits§
- AstNode
- A trait implemented by AST nodes.
- AstToken
- A trait implemented by AST tokens.
- NewRoot
- Implemented by nodes that can create a new root from a different tree node type.
- Syntax
Ext - An extension trait for
SyntaxNode
s,SyntaxToken
s, andSyntaxElement
s. - Syntax
Token Ext - An extension trait for
SyntaxToken
s. - Tree
Node - A trait that abstracts the underlying representation of a syntax tree node.
- Tree
Token - A trait that abstracts the underlying representation of a syntax token.
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
Token - Represents a token in the concrete syntax tree.