1 package org.jacorb.idl; 2 3 22 23 27 28 import java.io.PrintWriter ; 29 30 class ShiftExpr 31 extends IdlSymbol 32 { 33 34 public ShiftExpr shift_expr = null; 35 public AddExpr add_expr; 36 public String operator; 37 38 public ShiftExpr( int num ) 39 { 40 super( num ); 41 } 42 43 public void print( PrintWriter ps ) 44 { 45 if( shift_expr != null ) 46 { 47 shift_expr.print( ps ); 48 ps.print( operator ); 49 } 50 add_expr.print( ps ); 51 } 52 53 54 public void setDeclaration( ConstDecl declared_in ) 55 { 56 add_expr.setDeclaration( declared_in ); 57 } 58 59 public void setPackage( String s ) 60 { 61 s = parser.pack_replace( s ); 62 if( pack_name.length() > 0 ) 63 pack_name = s + "." + pack_name; 64 else 65 pack_name = s; 66 if( shift_expr != null ) 67 { 68 shift_expr.setPackage( s ); 69 } 70 add_expr.setPackage( s ); 71 } 72 73 public void parse() 74 { 75 if( shift_expr != null ) 76 { 77 shift_expr.parse(); 78 } 79 add_expr.parse(); 80 } 81 82 int pos_int_const() 83 { 84 return add_expr.pos_int_const(); 85 } 86 87 public String value() 88 { 89 String x = ""; 90 if( shift_expr != null ) 91 { 92 x = shift_expr.value() + operator; 93 } 94 return x + add_expr.value(); 95 } 96 97 public String toString() 98 { 99 String x = ""; 100 if( shift_expr != null ) 101 { 102 x = shift_expr + operator; 103 } 104 return x + add_expr; 105 } 106 107 public str_token get_token() 108 { 109 return add_expr.get_token(); 110 } 111 } 112 113 114 115 116 117 118 119 120 | Popular Tags |