com.ossuminc.riddl.passes.resolve
Members list
Type members
Classlikes
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
Attributes
- Companion
- class
- Source
- KindMap.scala
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass 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
Attributes
- Companion
- class
- Source
- ReferenceMap.scala
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
ReferenceMap.type
Attributes
- Source
- ResolutionPass.scala
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait PassOutputclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Source
- ResolutionPass.scala
- Supertypes
- Self type
-
ResolutionPass.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:
-
If its already in the ReferenceMap then use that resolution
-
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.
-
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 Serializabletrait Producttrait Equalstrait UsageResolutiontrait UsageBaseclass Passclass Objecttrait Matchableclass AnyShow all
Attributes
- Source
- UsageResolution.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
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
- Known subtypes
-
class ResolutionPass
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
Attributes
- Companion
- class
- Source
- Usages.scala
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
Usages.type