1 package org.jacorb.idl; 2 3 22 23 30 31 class PosIntConst 32 extends IdlSymbol 33 { 34 private int value = -1; 35 ConstExpr const_expr; 36 37 public PosIntConst( int num ) 38 { 39 super( num ); 40 } 41 42 void setExpression( ConstExpr const_expr ) 43 { 44 this.const_expr = const_expr; 45 } 46 47 public void parse() 48 { 49 const_expr.parse(); 50 } 51 52 public int value() 53 { 54 if( value == -1 ) 55 { 56 value = const_expr.pos_int_const(); 57 if( value <= 0 ) 58 throw new ParseException("Integer constant value must be greater 0.", 59 this.myPosition ); 60 } 61 return value; 62 } 63 64 65 public String toString() 66 { 67 return const_expr.toString(); 68 } 69 70 71 public void setPackage( String s ) 72 { 73 s = parser.pack_replace( s ); 74 if( pack_name.length() > 0 ) 75 pack_name = s + "." + pack_name; 76 else 77 pack_name = s; 78 const_expr.setPackage( s ); 79 } 80 } 81 82 83 84 85 86 87 88 89 90 91 | Popular Tags |