Package java_cup

Class production_part

  • Direct Known Subclasses:
    action_part, symbol_part

    public abstract class production_part
    extends java.lang.Object
    This class represents one part (either a symbol or an action) of a production. In this base class it contains only an optional label string that the user can use to refer to the part within actions.

    This is an abstract class.

    Version:
    last updated: 11/25/95
    Author:
    Scott Hudson
    See Also:
    production
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String _label
      Optional label for referring to the part within an action (null for no label).
    • Constructor Summary

      Constructors 
      Constructor Description
      production_part​(java.lang.String lab)
      Simple constructor.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(production_part other)
      Equality comparison.
      boolean equals​(java.lang.Object other)
      Generic equality comparison.
      int hashCode()
      Produce a hash code.
      abstract boolean is_action()
      Indicate if this is an action (rather than a symbol).
      java.lang.String label()
      Optional label for referring to the part within an action (null for no label).
      java.lang.String toString()
      Convert to a string.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • _label

        protected java.lang.String _label
        Optional label for referring to the part within an action (null for no label).
    • Constructor Detail

      • production_part

        public production_part​(java.lang.String lab)
        Simple constructor.
    • Method Detail

      • label

        public java.lang.String label()
        Optional label for referring to the part within an action (null for no label).
      • is_action

        public abstract boolean is_action()
        Indicate if this is an action (rather than a symbol). Here in the base class, we don't this know yet, so its an abstract method.
      • equals

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

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

        public int hashCode()
        Produce a hash code.
        Overrides:
        hashCode in class java.lang.Object
      • toString

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