コード例 #1
0
 public long getMinVal() {
   if (type instanceof SignedBitFieldType) {
     BitFieldType bitField = (BitFieldType) type;
     return -(1 << bitField.getLength() - 1);
   }
   if (type instanceof BitFieldType) {
     return 0;
   }
   if (type instanceof StdIntegerType) {
     StdIntegerType integerType = (StdIntegerType) type;
     return integerType.getLowerBound().longValue();
   }
   throw new RuntimeException("type of field '" + param.getName() + "' is not a simple type");
 }
コード例 #2
0
  public void buildParameterLists() {
    StringBuilder formal = new StringBuilder();
    StringBuilder actual = new StringBuilder();
    CompoundType compound = getCompoundType();
    for (Parameter param : compound.getParameters()) {
      String paramName = param.getName();
      TypeInterface paramType = TypeReference.getBaseType(param.getType());

      String typeName = TypeNameEmitter.getTypeName(paramType);
      formal.append(", ");
      formal.append(typeName);
      formal.append(" ");
      formal.append(paramName);

      actual.append(", ");
      actual.append(paramName);
    }
    formalParams = formal.toString();
    actualParams = actual.toString();
  }
コード例 #3
0
 public String getName() {
   return param.getName();
 }