1 package com.sun.java_cup.internal; 2 3 13 public abstract class production_part { 14 15 16 17 18 19 20 public production_part(String lab) 21 { 22 _label = lab; 23 } 24 25 26 27 28 29 32 protected String _label; 33 34 37 public String label() {return _label;} 38 39 40 41 42 43 46 public abstract boolean is_action(); 47 48 49 50 51 public boolean equals(production_part other) 52 { 53 if (other == null) return false; 54 55 56 if (label() != null) 57 return label().equals(other.label()); 58 else 59 return other.label() == null; 60 } 61 62 63 64 65 public boolean equals(Object other) 66 { 67 if (!(other instanceof production_part)) 68 return false; 69 else 70 return equals((production_part)other); 71 } 72 73 74 75 76 public int hashCode() 77 { 78 return label()==null ? 0 : label().hashCode(); 79 } 80 81 82 83 84 public String toString() 85 { 86 if (label() != null) 87 return label() + ":"; 88 else 89 return " "; 90 } 91 92 93 94 } 95 | Popular Tags |