Class Decoder


  • public class Decoder
    extends TreeNode
    The root node of the instruction decoder subtree.
    • Field Detail

      • UNIT_SIZE_BITS

        public static final int UNIT_SIZE_BITS
        Size (in bits) of one unit which decoder can read at once
        See Also:
        Constant Field Values
    • Constructor Detail

      • Decoder

        public Decoder​(java.util.Set<java.lang.String> declaredRootRuleNames)
        Creates new decoder.
        Parameters:
        declaredRootRuleNames - explicitly define root rules of the decoder.
      • Decoder

        public Decoder​(java.lang.String... declaredRootRuleNames)
        Creates new decoder.
        Parameters:
        declaredRootRuleNames - explicitly define root rules of the decoder.
      • Decoder

        public Decoder()
        Creates new decoder. Root rule will be the first child
    • Method Detail

      • getRootRuleNames

        public java.util.Set<java.lang.String> getRootRuleNames()
        Returns the starting rules names.
        Returns:
        the root rules names
      • getRootRules

        public java.util.Set<Rule> getRootRules()
        Returns all starting rule variants. Note root rules must be explicitly set; having only declared root rule names is not enough.
        Returns:
        root rules
      • getRootRule

        public Rule getRootRule()
        Returns the first starting rule.
        Returns:
        the first root rule object
      • setRootRules

        public void setRootRules​(java.util.Set<Rule> rootRules)
        Set starting rules. Size of declared root rules and root rules objects must be the same.
        Parameters:
        rootRules - root rule objects
      • toString

        public java.lang.String toString()
        Returns a string representation of the object.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the string