Trait Visitor

Source
pub trait Visitor {
Show 31 methods // Required method fn reset(&mut self); // Provided methods fn document( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, doc: &AnalysisDocument, version: SupportedVersion, ) { ... } fn whitespace( &mut self, diagnostics: &mut Diagnostics, whitespace: &Whitespace, ) { ... } fn comment(&mut self, diagnostics: &mut Diagnostics, comment: &Comment) { ... } fn version_statement( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, stmt: &VersionStatement, ) { ... } fn import_statement( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, stmt: &ImportStatement, ) { ... } fn struct_definition( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, def: &StructDefinition, ) { ... } fn task_definition( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, task: &TaskDefinition, ) { ... } fn workflow_definition( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, workflow: &WorkflowDefinition, ) { ... } fn input_section( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, section: &InputSection, ) { ... } fn output_section( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, section: &OutputSection, ) { ... } fn command_section( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, section: &CommandSection, ) { ... } fn command_text( &mut self, diagnostics: &mut Diagnostics, text: &CommandText, ) { ... } fn requirements_section( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, section: &RequirementsSection, ) { ... } fn task_hints_section( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, section: &TaskHintsSection, ) { ... } fn workflow_hints_section( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, section: &WorkflowHintsSection, ) { ... } fn runtime_section( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, section: &RuntimeSection, ) { ... } fn runtime_item( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, item: &RuntimeItem, ) { ... } fn metadata_section( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, section: &MetadataSection, ) { ... } fn parameter_metadata_section( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, section: &ParameterMetadataSection, ) { ... } fn metadata_object( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, object: &MetadataObject, ) { ... } fn metadata_object_item( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, item: &MetadataObjectItem, ) { ... } fn metadata_array( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, item: &MetadataArray, ) { ... } fn unbound_decl( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, decl: &UnboundDecl, ) { ... } fn bound_decl( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, decl: &BoundDecl, ) { ... } fn expr( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, expr: &Expr, ) { ... } fn string_text(&mut self, diagnostics: &mut Diagnostics, text: &StringText) { ... } fn placeholder( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, placeholder: &Placeholder, ) { ... } fn conditional_statement( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, stmt: &ConditionalStatement, ) { ... } fn scatter_statement( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, stmt: &ScatterStatement, ) { ... } fn call_statement( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, stmt: &CallStatement, ) { ... }
}
Expand description

A trait used to implement an AST visitor.

Each encountered node will receive a corresponding method call that receives both a VisitReason::Enter call and a matching VisitReason::Exit call.

Required Methods§

Source

fn reset(&mut self)

Resets the visitor to its initial state.

A visitor must implement this with resetting any internal state so that a visitor may be reused between documents.

Provided Methods§

Source

fn document( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, doc: &AnalysisDocument, version: SupportedVersion, )

Visits the root document node.

Source

fn whitespace(&mut self, diagnostics: &mut Diagnostics, whitespace: &Whitespace)

Visits a whitespace token.

Source

fn comment(&mut self, diagnostics: &mut Diagnostics, comment: &Comment)

Visit a comment token.

Source

fn version_statement( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, stmt: &VersionStatement, )

Visits a top-level version statement node.

Source

fn import_statement( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, stmt: &ImportStatement, )

Visits a top-level import statement node.

Source

fn struct_definition( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, def: &StructDefinition, )

Visits a struct definition node.

Source

fn task_definition( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, task: &TaskDefinition, )

Visits a task definition node.

Source

fn workflow_definition( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, workflow: &WorkflowDefinition, )

Visits a workflow definition node.

Source

fn input_section( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, section: &InputSection, )

Visits an input section node.

Source

fn output_section( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, section: &OutputSection, )

Visits an output section node.

Source

fn command_section( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, section: &CommandSection, )

Visits a command section node.

Source

fn command_text(&mut self, diagnostics: &mut Diagnostics, text: &CommandText)

Visits a command text token in a command section node.

Source

fn requirements_section( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, section: &RequirementsSection, )

Visits a requirements section node.

Source

fn task_hints_section( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, section: &TaskHintsSection, )

Visits a task hints section node.

Source

fn workflow_hints_section( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, section: &WorkflowHintsSection, )

Visits a workflow hints section node.

Source

fn runtime_section( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, section: &RuntimeSection, )

Visits a runtime section node.

Source

fn runtime_item( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, item: &RuntimeItem, )

Visits a runtime item node.

Source

fn metadata_section( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, section: &MetadataSection, )

Visits a metadata section node.

Source

fn parameter_metadata_section( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, section: &ParameterMetadataSection, )

Visits a parameter metadata section node.

Source

fn metadata_object( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, object: &MetadataObject, )

Visits a metadata object in a metadata or parameter metadata section.

Source

fn metadata_object_item( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, item: &MetadataObjectItem, )

Visits a metadata object item in a metadata object.

Source

fn metadata_array( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, item: &MetadataArray, )

Visits a metadata array node in a metadata or parameter metadata section.

Source

fn unbound_decl( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, decl: &UnboundDecl, )

Visits an unbound declaration node.

Source

fn bound_decl( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, decl: &BoundDecl, )

Visits a bound declaration node.

Source

fn expr( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, expr: &Expr, )

Visits an expression node.

Source

fn string_text(&mut self, diagnostics: &mut Diagnostics, text: &StringText)

Visits a string text token in a literal string node.

Source

fn placeholder( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, placeholder: &Placeholder, )

Visits a placeholder node.

Source

fn conditional_statement( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, stmt: &ConditionalStatement, )

Visits a conditional statement node in a workflow.

Source

fn scatter_statement( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, stmt: &ScatterStatement, )

Visits a scatter statement node in a workflow.

Source

fn call_statement( &mut self, diagnostics: &mut Diagnostics, reason: VisitReason, stmt: &CallStatement, )

Visits a call statement node in a workflow.

Implementors§