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