Package java_cup

Class symbol_part


  • public class symbol_part
    extends production_part
    This class represents a part of a production which is a symbol (terminal or non terminal). This simply maintains a reference to the symbol in question.
    See Also:
    production
    • Field Detail

      • _the_symbol

        protected symbol _the_symbol
        The symbol that this part is made up of.
    • Constructor Detail

      • symbol_part

        public symbol_part​(symbol sym,
                           java.lang.String lab)
                    throws internal_error
        Full constructor.
        Parameters:
        sym - the symbol that this part is made up of.
        lab - an optional label string for the part.
        Throws:
        internal_error
      • symbol_part

        public symbol_part​(symbol sym)
                    throws internal_error
        Constructor with no label.
        Parameters:
        sym - the symbol that this part is made up of.
        Throws:
        internal_error
    • Method Detail

      • the_symbol

        public symbol the_symbol()
        The symbol that this part is made up of.
      • is_action

        public boolean is_action()
        Respond that we are not an action part.
        Specified by:
        is_action in class production_part
      • equals

        public boolean equals​(symbol_part other)
        Equality comparison.
      • equals

        public boolean equals​(java.lang.Object other)
        Generic equality comparison.
        Overrides:
        equals in class production_part
      • toString

        public java.lang.String toString()
        Convert to a string.
        Overrides:
        toString in class production_part