1 package com.sun.java_cup.internal; 2 3 13 public class lalr_transition { 14 15 16 17 18 19 24 public lalr_transition(symbol on_sym, lalr_state to_st, lalr_transition nxt) 25 throws internal_error 26 { 27 28 if (on_sym == null) 29 throw new internal_error("Attempt to create transition on null symbol"); 30 if (to_st == null) 31 throw new internal_error("Attempt to create transition to null state"); 32 33 34 _on_symbol = on_sym; 35 _to_state = to_st; 36 _next = nxt; 37 } 38 39 40 41 45 public lalr_transition(symbol on_sym, lalr_state to_st) throws internal_error 46 { 47 this(on_sym, to_st, null); 48 } 49 50 51 52 53 54 55 protected symbol _on_symbol; 56 57 58 public symbol on_symbol() {return _on_symbol;} 59 60 61 62 63 protected lalr_state _to_state; 64 65 66 public lalr_state to_state() {return _to_state;} 67 68 69 70 71 protected lalr_transition _next; 72 73 74 public lalr_transition next() {return _next;} 75 76 77 78 79 80 81 public String toString() 82 { 83 String result; 84 85 result = "transition on " + on_symbol().name() + " to state ["; 86 result += _to_state.index(); 87 result += "]"; 88 89 return result; 90 } 91 92 93 } 94 | Popular Tags |