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