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

action_part

public class action_part extends production_part
This class represents a part of a production which contains an action. These are eventually eliminated from productions and converted to trailing actions by factoring out with a production that derives the empty string (and ends with this action).
see
com.sun.java_cup.internal.production
version
last update: 11/25/95
author
Scott Hudson

Fields Summary
protected String
_code_string
String containing code for the action in question.
Constructors Summary
public action_part(String code_str)
Simple constructor.

param
code_str string containing the actual user code.

      super(/* never have a label on code */null);
      _code_string = code_str;
    
Methods Summary
public java.lang.Stringcode_string()
String containing code for the action in question.

return _code_string;
public booleanequals(com.sun.java_cup.internal.action_part other)
Equality comparison for properly typed object.

      /* compare the strings */
      return other != null && super.equals(other) && 
	     other.code_string().equals(code_string());
    
public booleanequals(java.lang.Object other)
Generic equality comparison.

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

      return super.hashCode() ^ 
	     (code_string()==null ? 0 : code_string().hashCode());
    
public booleanis_action()
Override to report this object as an action.

 return true; 
public voidset_code_string(java.lang.String new_str)
Set the code string.

_code_string = new_str;
public java.lang.StringtoString()
Convert to a string.

      return super.toString() + "{" + code_string() + "}";