CollectingPass

com.ossuminc.riddl.passes.CollectingPass

A Pass subclass that processes the AST exactly the same as the depth first search that the Pass class uses. The only difference is that

Type parameters

ET

The element type of the collected values

Value parameters

input

The PassInput to process

outputs

The outputs from previous pass runs in case they are needed as input to this CollectingPass

Attributes

Source
Pass.scala
Graph
Supertypes
class Pass
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

The processing method called at each node, similar to Pass.process but modified to return a sequence of the collectable, ET.

The processing method called at each node, similar to Pass.process but modified to return a sequence of the collectable, ET.

Value parameters

definition

The definition from which an ET value is collected.

parents

The parents of the definition

Attributes

Returns

One of the collected values, an ET

Source
Pass.scala
override def result(root: Root): CollectingPassOutput[ET]

Generate the output of this Pass.

Generate the output of this Pass. This will only be called after all the calls to process have completed.

Value parameters

root

The new com.ossuminc.riddl.language.AST.Root of the model that the pass computed

Attributes

Returns

an instance of the output type

Definition Classes
Source
Pass.scala

Concrete methods

The method usually called for each definition that is to be processed but our implementation of traverse instead calls collect so a value can be returned.

The method usually called for each definition that is to be processed but our implementation of traverse instead calls collect so a value can be returned. This implementation is final because it is meant to be ignored.

Value parameters

definition

The definition to be processed

parents

The stack of definitions that are the parents of com.ossuminc.riddl.language.AST.Definition. This stack goes from immediate parent towards the root. The root is deepest in the stack.

Attributes

Definition Classes
Source
Pass.scala

Inherited methods

def close(): Unit

Close any resources used so this can be used with AutoCloseable or Using.Manager

Close any resources used so this can be used with AutoCloseable or Using.Manager

Attributes

Inherited from:
Pass
Source
Pass.scala

A signal that the processing is complete and no more calls to process will be made.

A signal that the processing is complete and no more calls to process will be made. This also gives the Pass subclass a chance to do post-processing as some computations can only be done after collecting data from the entire AST

Value parameters

root

The root of the parsed model just as a convenience for post-processing

Attributes

Inherited from:
Pass
Source
Pass.scala

Pre-process the root before actually traversing.

Pre-process the root before actually traversing. This is also a signal that the processing is about to start.

Value parameters

root

A com.ossuminc.riddl.language.AST.Root node which encapsulates the whole model. This is the state of the Root as of the last pass.

Attributes

Returns

Typically returns the same Root objects with changes in subsequent levels, but it entirely possibly to completely reorganize the hierarchy, including its root node.

Inherited from:
Pass
Source
Pass.scala

Inherited and Abstract methods

def name: String

THe name of the pass for inclusion in messages it produces.

THe name of the pass for inclusion in messages it produces. This must be implemented by the subclass

Attributes

Returns

A string value giving the name of this pass

Inherited from:
Pass
Source
Pass.scala

Concrete fields

protected val collectedValues: ArrayBuffer[ET]

Attributes

Source
Pass.scala

Inherited fields

val in: PassInput

Attributes

Inherited from:
Pass
Source
Pass.scala

Attributes

Inherited from:
Pass
Source
Pass.scala