Interface ResolutionResult<A extends ResolvableEntity>
-
public interface ResolutionResult<A extends ResolvableEntity>
This class represents a resolution result of some (possibly composite) name inside some context Usage of special interface instead of plainList<ModelicaDeclaration>
allows returning some additional information such as "layers" of resolved symbol (for example, these 10 symbols are obviously hidden, but these two are equally relevant, thus introducing name clash). Moreover, more diagnostic information can be introduced in the future without changing lots of source code.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<A>
getBestCandidates()
Returns declarations that are supposed to be taken by the Modelica compiler (normally, exactly one match).List<A>
getHiddenCandidates()
Returns declarations that are definitely hidden by some others.boolean
hasHiddenResults()
Whether the symbol resolver found any symbol suspiciously hidden by other ones.boolean
isClashed()
Whether the symbol resolver found multiple equally relevant resolution candidates.boolean
isUnresolved()
Whether any resolution candidate exists.boolean
wasTimedOut()
During resolution, loops may occur.
-
-
-
Method Detail
-
getBestCandidates
List<A> getBestCandidates()
Returns declarations that are supposed to be taken by the Modelica compiler (normally, exactly one match).- Returns:
- A declaration(s) to be used. Every result not consisting of exactly one declaration signifies a possible error-severity issue in the source to be analysed.
-
getHiddenCandidates
List<A> getHiddenCandidates()
Returns declarations that are definitely hidden by some others. Non empty returned collection may signify either warning-grade issue in the source to be analysed or just some peculiarities of the particular Modelica code design, it depends.- Returns:
- A collections of definitely hidden resolution candidates
-
isUnresolved
boolean isUnresolved()
Whether any resolution candidate exists.- Returns:
getBestCandidates().size != 0
-
isClashed
boolean isClashed()
Whether the symbol resolver found multiple equally relevant resolution candidates.- Returns:
getBestCandidates().size > 1
-
hasHiddenResults
boolean hasHiddenResults()
Whether the symbol resolver found any symbol suspiciously hidden by other ones.- Returns:
getHiddenCandidates().size != 0
-
wasTimedOut
boolean wasTimedOut()
During resolution, loops may occur. This leads to timing out the resolution and (possibly) partial results. This method may return `true` even if other ones return some non-empty result. It merely signifies that the results may depend on particular limit on the number of resolution steps.- Returns:
- Whether resolution was timed out
-
-