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

reduce_action

public class reduce_action extends parse_action
This class represents a reduce action within the parse table. The action simply stores the production that it reduces with and responds to queries about its type.
version
last updated: 11/25/95
author
Scott Hudson

Fields Summary
protected production
_reduce_with
The production we reduce with.
Constructors Summary
public reduce_action(production prod)
Simple constructor.

param
prod the production this action reduces with.

      /* sanity check */
      if (prod == null)
	throw new internal_error(
	  "Attempt to create a reduce_action with a null production");

      _reduce_with = prod;
    
Methods Summary
public booleanequals(com.sun.java_cup.internal.reduce_action other)
Equality test.

      return other != null && other.reduce_with() == reduce_with();
    
public booleanequals(java.lang.Object other)
Generic equality test.

      if (other instanceof reduce_action)
	return equals((reduce_action)other);
      else
       return false;
    
public inthashCode()
Compute a hash code.

      /* use the hash code of the production we are reducing with */
      return reduce_with().hashCode();
    
public intkind()
Quick access to type of action.

return REDUCE;
public productionreduce_with()
The production we reduce with.

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

      return "REDUCE(with prod " + reduce_with().index() + ")";