FileDocCategorySizeDatePackage
production_part.javaAPI DocJava SE 5 API2696Fri Aug 26 14:54:54 BST 2005com.sun.java_cup.internal

production_part

public abstract class production_part extends 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.

see
com.sun.java_cup.internal.production
version
last updated: 11/25/95
author
Scott Hudson

Fields Summary
protected String
_label
Optional label for referring to the part within an action (null for no label).
Constructors Summary
public production_part(String lab)
Simple constructor.

      _label = lab;
    
Methods Summary
public booleanequals(com.sun.java_cup.internal.production_part other)
Equality comparison.

      if (other == null) return false;

      /* compare the labels */
      if (label() != null)
	return label().equals(other.label());
      else
	return other.label() == null;
    
public booleanequals(java.lang.Object other)
Generic equality comparison.

      if (!(other instanceof production_part))
        return false;
      else
	return equals((production_part)other);
    
public inthashCode()
Produce a hash code.

      return label()==null ? 0 : label().hashCode();
    
public abstract booleanis_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.

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

return _label;
public java.lang.StringtoString()
Convert to a string.

      if (label() != null)
	return label() + ":";
      else
	return " ";