Class AssemblyResolution

    • Field Detail

      • description

        protected final java.lang.String description
      • children

        protected final com.google.common.collect.ImmutableList<? extends AssemblyResolution> children
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • computeHash

        protected abstract int computeHash()
      • resolved

        public static AssemblyResolvedConstructor resolved​(AssemblyPatternBlock ins,
                                                           AssemblyPatternBlock ctx,
                                                           java.lang.String description,
                                                           com.google.common.collect.ImmutableList<? extends AssemblyResolution> sel)
        Build the result of successfully resolving a SLEIGH constructor
        Parameters:
        ins - the instruction pattern block
        ctx - the context pattern block
        description - a description of the resolution
        sel - the children selected to resolve this constructor, or null
        Returns:
        the new resolution
      • instrOnly

        public static AssemblyResolvedConstructor instrOnly​(AssemblyPatternBlock ins,
                                                            java.lang.String description,
                                                            com.google.common.collect.ImmutableList<AssemblyResolution> children)
        Build an instruction-only successful resolution result
        Parameters:
        ins - the instruction pattern block
        description - a description of the resolution
        children - the children selected to resolve this constructor, or null
        Returns:
        the new resolution
        See Also:
        #resolved(AssemblyPatternBlock, AssemblyPatternBlock, String, List)
      • contextOnly

        public static AssemblyResolvedConstructor contextOnly​(AssemblyPatternBlock ctx,
                                                              java.lang.String description,
                                                              com.google.common.collect.ImmutableList<AssemblyResolution> children)
        Build a context-only successful resolution result
        Parameters:
        ctx - the context pattern block
        description - a description of the resolution
        children - the children selected to resolve this constructor, or null
        Returns:
        the new resolution
        See Also:
        #resolved(AssemblyPatternBlock, AssemblyPatternBlock, String, List)
      • fromPattern

        public static AssemblyResolvedConstructor fromPattern​(DisjointPattern pat,
                                                              int minLen,
                                                              java.lang.String description)
        Build a successful resolution result from a SLEIGH constructor's patterns
        Parameters:
        pat - the constructor's pattern
        description - a description of the resolution
        Returns:
        the new resolution
      • backfill

        public static AssemblyResolvedBackfill backfill​(PatternExpression exp,
                                                        MaskedLong goal,
                                                        java.util.Map<java.lang.Integer,​java.lang.Object> res,
                                                        int inslen,
                                                        java.lang.String description)
        Build a backfill record to attach to a successful resolution result
        Parameters:
        exp - the expression depending on a missing symbol
        goal - the desired value of the expression
        res - the resolution result for child constructors
        inslen - the length of instruction portion expected in the future solution
        description - a description of the backfill record
        Returns:
        the new record
      • nop

        public static AssemblyResolvedConstructor nop​(java.lang.String description,
                                                      com.google.common.collect.ImmutableList<? extends AssemblyResolution> sel)
        Obtain a new "blank" resolved SLEIGH constructor record
        Parameters:
        description - a description of the resolution
        sel - any children that will be involved in populating this record
        Returns:
        the new resolution
      • error

        public static AssemblyResolvedError error​(java.lang.String error,
                                                  java.lang.String description,
                                                  com.google.common.collect.ImmutableList<? extends AssemblyResolution> children)
        Build an error resolution record
        Parameters:
        error - a description of the error
        description - a description of what the resolver was doing when the error ocurred
        children - any children involved in generating the error
        Returns:
        the new resolution
      • error

        public static AssemblyResolution error​(java.lang.String error,
                                               AssemblyResolvedConstructor res)
        Build an error resolution record, based on an intermediate SLEIGH constructor record
        Parameters:
        error - a description of the error
        res - the constructor record that was being populated when the error ocurred
        Returns:
        the new error resolution
      • isError

        public abstract boolean isError()
        Check if this record describes an error
        Returns:
        true if the record is an error
      • isBackfill

        public abstract boolean isBackfill()
        Check if this record describes a backfill
        Returns:
        true if the record is a backfill
      • lineToString

        protected abstract java.lang.String lineToString()
        Display the resolution result in one line (omitting child details)
        Returns:
        the display description
      • childrenToString

        protected java.lang.String childrenToString​(java.lang.String indent)
        Get the child portion of toString() If a subclass has another, possible additional, notion of children that it would like to include in toString(), it must override this method.
        Parameters:
        indent - the current indentation
        Returns:
        the indented description for each child on its own line
        See Also:
        hasChildren()
      • toString

        public java.lang.String toString​(java.lang.String indent)
        Used only by parents: get a multi-line description of this record, indented
        Parameters:
        indent - the current indentation
        Returns:
        the indented description
      • toString

        public java.lang.String toString()
        Describe this record including indented children, grandchildren, etc., each on its own line
        Overrides:
        toString in class java.lang.Object
      • hasChildren

        public boolean hasChildren()
        Check if this record has children If a subclass has another, possibly additional, notion of children that it would like to include in toString(), it must override this method to return true when such children are present.
        Returns:
        true if this record has children
        See Also:
        childrenToString(String)