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