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

shift_action

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

Fields Summary
protected lalr_state
_shift_to
The state we shift to.
Constructors Summary
public shift_action(lalr_state shft_to)
Simple constructor.

param
shft_to the state that this action shifts to.

      /* sanity check */
      if (shft_to == null)
	throw new internal_error(
	  "Attempt to create a shift_action to a null state");

      _shift_to = shft_to;
    
Methods Summary
public booleanequals(com.sun.java_cup.internal.shift_action other)
Equality test.

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

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

      /* use the hash code of the state we are shifting to */
      return shift_to().hashCode();
    
public intkind()
Quick access to type of action.

return SHIFT;
public lalr_stateshift_to()
The state we shift to.

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

return "SHIFT(to state " + shift_to().index() + ")";