Exemplo n.º 1
0
  public static String type(BcTypeNode bcType) {
    String typeName = bcType.getName();
    if (bcType instanceof BcVectorTypeNode) {
      BcVectorTypeNode vectorType = (BcVectorTypeNode) bcType;
      String genericName = BcCodeCpp.type(vectorType.getGeneric());
      return BcCodeCpp.VECTOR_TYPE_PREFIX + genericName;
    }

    return type(typeName);
  }
Exemplo n.º 2
0
 public static String construct(BcTypeNode type, Object initializer) {
   if (type instanceof BcVectorTypeNode) {
     BcVectorTypeNode vectorType = (BcVectorTypeNode) type;
     return NEWVECTOR
         + "("
         + VECTOR_TYPE_PREFIX
         + type(vectorType.getGeneric())
         + ", ("
         + initializer
         + "))";
   }
   return construct(type.getName(), initializer);
 }