Methods Summary |
---|
public abstract boolean | dumpExternals(ClassInfo c, java.io.PrintStream outfile)
|
public abstract boolean | dumpHeader(ClassInfo c, java.io.PrintStream outfile)
|
public java.lang.String | filename(java.lang.String classname)
return Util.convertToClassName( classname );
|
protected boolean | generateConsts(java.lang.String classname, FieldInfo[] fields)
if ( fields == null ) return false;
boolean didWork = false;
for ( int i = 0; i < fields.length; i++ ){
FieldInfo f = fields[i];
if ( f.value == null ) continue; // not a constant.
String constName = classname+CDelim+f.name.string;
o.println("#undef "+constName );
ConstantObject v = f.value;
DoubleValueConstant dvc;
switch ( v.tag ){
case Const.CONSTANT_FLOAT:
float fval = Float.intBitsToFloat( ((SingleValueConstant)v).value );
o.println("#define "+constName+" "+fval+"f");
break;
case Const.CONSTANT_DOUBLE:
dvc = (DoubleValueConstant)v;
double dval = Double.longBitsToDouble((((long)(dvc.highVal))<<32) | ((long)dvc.lowVal&0xffffffffL));
o.println("#define "+constName+" "+dval+"D");
break;
case Const.CONSTANT_LONG:
dvc = (DoubleValueConstant)v;
long lval = (((long)(dvc.highVal))<<32) | ((long)dvc.lowVal&0xffffffffL);
o.println("#define "+constName+" "+lval+"LL");
break;
case Const.CONSTANT_INTEGER:
int ival = ((SingleValueConstant)v).value;
o.println("#define "+constName+" "+ival+"L");
break;
default:
}
didWork = true;
}
return didWork;
|
static java.lang.String | strsub(java.lang.String src, char substitute)
return src.replace( DIR_DELIM, substitute).replace(INNER_DELIM, substitute );
|