1 2 package com.sun.java_cup.internal; 3 4 11 public class shift_action extends parse_action { 12 13 14 15 16 17 20 public shift_action(lalr_state shft_to) throws internal_error 21 { 22 23 if (shft_to == null) 24 throw new internal_error( 25 "Attempt to create a shift_action to a null state"); 26 27 _shift_to = shft_to; 28 } 29 30 31 32 33 34 35 protected lalr_state _shift_to; 36 37 38 public lalr_state shift_to() {return _shift_to;} 39 40 41 42 43 44 45 public int kind() {return SHIFT;} 46 47 48 49 50 public boolean equals(shift_action other) 51 { 52 return other != null && other.shift_to() == shift_to(); 53 } 54 55 56 57 58 public boolean equals(Object other) 59 { 60 if (other instanceof shift_action) 61 return equals((shift_action)other); 62 else 63 return false; 64 } 65 66 67 68 69 public int hashCode() 70 { 71 72 return shift_to().hashCode(); 73 } 74 75 76 77 78 public String toString() {return "SHIFT(to state " + shift_to().index() + ")";} 79 80 81 82 } 83 | Popular Tags |