com.ossuminc.riddl.passes.resolve

Members list

Type members

Classlikes

case class KindMap()

Mapping from implementation class to the instances of definitions.

Mapping from implementation class to the instances of definitions. This keeps track of the instances of each kind of com.ossuminc.riddl.language.AST.RiddlValue in a model. It is generated by the ResolutionPass.

Attributes

Companion
object
Source
KindMap.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object KindMap

Attributes

Companion
class
Source
KindMap.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
KindMap.type

The primary output of the ResolutionPass.

The primary output of the ResolutionPass. It provides a mapping from a reference to the referenced definition. This is useful for fast resolution during validation and other Passes because the resolution logic doesn't need to be exercised again.

Value parameters

messages

A message accumulator for collecting messages when member functions are invoked

Attributes

Companion
object
Source
ReferenceMap.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object ReferenceMap

Attributes

Companion
class
Source
ReferenceMap.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Attributes

Source
ResolutionPass.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait PassOutput
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Source
ResolutionPass.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Show all
Self type

The Reference Resolution Pass.

The Reference Resolution Pass. This pass traverses the entire model and resolves every reference it finds into the refmap in its output. See ReferenceMap for details. This resolution must be done before validation to make sure there are no cycles in the references. While it is at it, it also tracks which definition uses which other definition. See Usages for details. It also keeps a kindMap. See KindMap for details.

Reference Resolution is the process of turning a com.ossuminc.riddl.language.AST.PathIdentifier into the com.ossuminc.riddl.language.AST.Definition that is referenced by the com.ossuminc.riddl.language.AST.PathIdentifier. There are several ways to resolve a reference:

  1. If its already in the ReferenceMap then use that resolution

  2. A single identifier in the path is looked up in the symbol table and if it uniquely matches only one definition then that definition is the resolved definition.

  3. If there are multiple identifiers in the com.ossuminc.riddl.language.AST.PathIdentifier then we attempt to anchor the search using the first identifier. Anchoring is done by (a) checking to see if it is the "Root" node in which case that is the anchor, (b) checking to see if the first identifier is the name of one of the parent nodes from the location of the reference, and finally (c) looking up the first identifier in the symbol table and if it is unique then using that as the anchor. Once the anchor is determined, it is simply a matter of walking down tree of nodes from the anchor, one name at a time.

Value parameters

input

The input to the original pass.

outputs

THe outputs from preceding passes, which should only be the com.ossuminc.riddl.passes.symbols.SymbolsPass output.

Attributes

Companion
object
Source
ResolutionPass.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait UsageBase
class Pass
class Object
trait Matchable
class Any
Show all
trait UsageBase

Attributes

Source
UsageResolution.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait UsageResolution extends UsageBase

Validation State for Uses/UsedBy Tracking.

Validation State for Uses/UsedBy Tracking. During parsing, when usage is detected, call associateUsage. After parsing ends, call checkUnused. Collects entities, types and functions too

Attributes

Source
UsageResolution.scala
Supertypes
trait UsageBase
class Object
trait Matchable
class Any
Known subtypes

The data generated from the ResolutionPass that provides usage information about which definitions use others and vice versa.

The data generated from the ResolutionPass that provides usage information about which definitions use others and vice versa. The data collected

Value parameters

usedBy

A hashmap with a com.ossuminc.riddl.language.AST.Definition as the key and the list of com.ossuminc.riddl.language.AST.Definition used by it

uses

A hashmap with a com.ossuminc.riddl.language.AST.Definition as the key and the list of com.ossuminc.riddl.language.AST.Definitions it uses

Attributes

Companion
object
Source
Usages.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait UsageBase
class Object
trait Matchable
class Any
Show all
object Usages

Attributes

Companion
class
Source
Usages.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Usages.type