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

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
com.sun.java_cup.internal.production
version
last updated: 11/25/95
author
Scott Hudson

Fields Summary
protected symbol
_the_symbol
The symbol that this part is made up of.
Constructors Summary
public symbol_part(symbol sym, String lab)
Full constructor.

param
sym the symbol that this part is made up of.
param
lab an optional label string for the part.

      super(lab);

      if (sym == null)
	throw new internal_error(
	  "Attempt to construct a symbol_part with a null symbol");
      _the_symbol = sym;
    
public symbol_part(symbol sym)
Constructor with no label.

param
sym the symbol that this part is made up of.

      this(sym,null);
    
Methods Summary
public booleanequals(com.sun.java_cup.internal.symbol_part other)
Equality comparison.

      return other != null && super.equals(other) && 
	     the_symbol().equals(other.the_symbol());
    
public booleanequals(java.lang.Object other)
Generic equality comparison.

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

      return super.hashCode() ^ 
	     (the_symbol()==null ? 0 : the_symbol().hashCode());
    
public booleanis_action()
Respond that we are not an action part.

 return false; 
public symbolthe_symbol()
The symbol that this part is made up of.

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

      if (the_symbol() != null)
	return super.toString() + the_symbol();
      else
	return super.toString() + "$$MISSING-SYMBOL$$";