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