congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Function.getValueType
Code IndexAdd Tabnine to your IDE (free)

How to use
getValueType
method
in
com.ochafik.lang.jnaerator.parser.Function

Best Java code snippets using com.ochafik.lang.jnaerator.parser.Function.getValueType (Showing top 20 results out of 315)

origin: nativelibs4java/JavaCL

  @Override
  public Boolean adapt(Function value) {
    List<Modifier> mods = value.getModifiers();
    if (ModifierType.__kernel.isContainedBy(mods))
      return true;
    if (value.getValueType() == null)
      return null;
    mods = value.getValueType().getModifiers();
    return ModifierType.__kernel.isContainedBy(mods);
  }
};
origin: nativelibs4java/JNAerator

@Override
public void addDeclaration(Declaration d) {
  implementations.addDeclaration(d);
  if (d instanceof Function) {
    Function f = (Function) d;
    List<Arg> args = f.getArgs();
    List<TypeRef> trs = new ArrayList<TypeRef>(2);
    trs.add(f.getValueType());
    if (!args.isEmpty()) {
      trs.add(args.get(0).getValueType());
    }
    for (TypeRef tr : trs) {
      if (tr instanceof SimpleTypeRef) {
        Identifier id = ((SimpleTypeRef) tr).getName();
        if (result.isFakePointer(id)) {
          result.addFunctionReifiableInFakePointer(id, declarations.getResolvedJavaIdentifier(), f);
        }
      }
    }
  }
}
origin: com.nativelibs4java/jnaerator

@Override
public void addDeclaration(Declaration d) {
  implementations.addDeclaration(d);
  if (d instanceof Function) {
    Function f = (Function) d;
    List<Arg> args = f.getArgs();
    List<TypeRef> trs = new ArrayList<TypeRef>(2);
    trs.add(f.getValueType());
    if (!args.isEmpty()) {
      trs.add(args.get(0).getValueType());
    }
    for (TypeRef tr : trs) {
      if (tr instanceof SimpleTypeRef) {
        Identifier id = ((SimpleTypeRef) tr).getName();
        if (result.isFakePointer(id)) {
          result.addFunctionReifiableInFakePointer(id, declarations.getResolvedJavaIdentifier(), f);
        }
      }
    }
  }
}
origin: nativelibs4java/JNAerator

    argNames = new ArrayList<String>(),
    argDefs = new ArrayList<String>();
String rt = getScalaType(f.getValueType());
for (Arg a : args) {
  String vt = getScalaType(a.getValueType());
origin: nativelibs4java/JNAerator

b.append(modifiers.contains(ModifierType.Static) ? "+" : "-");
b.append("(");
TypeRef t = getValueType();
if (t == null)
  b.append("id");
if (signatureType.hasReturnType && getValueType() != null) {
  TypeRef t = getValueType().clone();
  erase(t);
  t.stripDetails();
origin: com.nativelibs4java/jnaerator

    argNames = new ArrayList<String>(),
    argDefs = new ArrayList<String>();
String rt = getScalaType(f.getValueType());
for (Arg a : args) {
  String vt = getScalaType(a.getValueType());
origin: nativelibs4java/JNAerator

if (mods != null) {
  if (function.getValueType() == null) {
    function.setValueType(longShortModsToTypeRef(mods));
  } else {
    attachLongOrShortModifiersToPointedType(function.getValueType(), mods);
if (function.getValueType() != null) {
  moveModifiersOfType(ModifierKind.CallingConvention, function.getValueType(), function);
} else {
  Element parent = function.getParentElement();
origin: com.nativelibs4java/jnaerator

if (mods != null) {
  if (function.getValueType() == null) {
    function.setValueType(longShortModsToTypeRef(mods));
  } else {
    attachLongOrShortModifiersToPointedType(function.getValueType(), mods);
if (function.getValueType() != null) {
  moveModifiersOfType(ModifierKind.CallingConvention, function.getValueType(), function);
} else {
  Element parent = function.getParentElement();
origin: com.nativelibs4java/jnaerator

  public static TypeRef fixReturnType(Function function) {
    TypeRef returnType = function.getValueType();

    if (returnType == null) {
      returnType = RococoaUtils.ROCOCOA_ID_TYPEREF;
    }

    Struct declaringClass = function.findParentOfType(Struct.class);
    if (returnType.toString().equals("id")) {
      String pointedClassName;
      if (function.getName().toString().matches("^(alloc|(init|copy|mutableCopy)([A-Z].*)?)$") || RococoaUtils.methodNameMatchesObjcStaticConstructor(declaringClass, function.getName())) {
        pointedClassName = declaringClass.getTag().toString();
      } else /// Lets subclasses redefine method return type when parent method return type is ID
      {
        pointedClassName = "NSObject";
      }

      returnType = new TypeRef.Pointer(new TypeRef.SimpleTypeRef(pointedClassName), PointerStyle.Pointer);
    }
    return returnType;
  }
}
origin: nativelibs4java/JNAerator

  public static TypeRef fixReturnType(Function function) {
    TypeRef returnType = function.getValueType();

    if (returnType == null) {
      returnType = RococoaUtils.ROCOCOA_ID_TYPEREF;
    }

    Struct declaringClass = function.findParentOfType(Struct.class);
    if (returnType.toString().equals("id")) {
      String pointedClassName;
      if (function.getName().toString().matches("^(alloc|(init|copy|mutableCopy)([A-Z].*)?)$") || RococoaUtils.methodNameMatchesObjcStaticConstructor(declaringClass, function.getName())) {
        pointedClassName = declaringClass.getTag().toString();
      } else /// Lets subclasses redefine method return type when parent method return type is ID
      {
        pointedClassName = "NSObject";
      }

      returnType = new TypeRef.Pointer(new TypeRef.SimpleTypeRef(pointedClassName), PointerStyle.Pointer);
    }
    return returnType;
  }
}
origin: com.nativelibs4java/jnaerator

  private Function createProxyCopy(Function originalMethod, Function meth) {
    if (isMethodExcludedFromStaticForwarding(originalMethod)) {
      return null;
    }

    Function proxyCopy = meth.clone();
    proxyCopy.addModifiers(ModifierType.Public, ModifierType.Static);
    proxyCopy.reorganizeModifiers();

    Expression[] args = new Expression[meth.getArgs().size()];
    int i = 0;
    for (Arg arg : meth.getArgs()) {
      args[i++] = varRef(arg.getName());
    }

    Expression val = methodCall(methodCall(null, null, classInstanceGetterName), Expression.MemberRefStyle.Dot, meth.getName().toString(), args);
    proxyCopy.setBody(new Block(
        meth.getValueType() == null || "void".equals(meth.getValueType().toString()) ? stat(val) : new Statement.Return(val)));
    return proxyCopy;
  }
//    protected static _class_ _CLASS_ = org.rococoa.Rococoa.createClass("NSURL", _class_.class);
origin: nativelibs4java/JNAerator

  private Function createProxyCopy(Function originalMethod, Function meth) {
    if (isMethodExcludedFromStaticForwarding(originalMethod)) {
      return null;
    }

    Function proxyCopy = meth.clone();
    proxyCopy.addModifiers(ModifierType.Public, ModifierType.Static);
    proxyCopy.reorganizeModifiers();

    Expression[] args = new Expression[meth.getArgs().size()];
    int i = 0;
    for (Arg arg : meth.getArgs()) {
      args[i++] = varRef(arg.getName());
    }

    Expression val = methodCall(methodCall(null, null, classInstanceGetterName), Expression.MemberRefStyle.Dot, meth.getName().toString(), args);
    proxyCopy.setBody(new Block(
        meth.getValueType() == null || "void".equals(meth.getValueType().toString()) ? stat(val) : new Statement.Return(val)));
    return proxyCopy;
  }
//    protected static _class_ _CLASS_ = org.rococoa.Rococoa.createClass("NSURL", _class_.class);
origin: nativelibs4java/JNAerator

public MutableByDeclarator mutateType(MutableByDeclarator type) {
  if (type == null)
    return null;
  
  type = type.clone();
  if (type instanceof TypeRef)
    type = new TypeRef.ArrayRef((TypeRef)type, deepClone(getDimensions()));
  else if (type instanceof Function)
  {
    Function f = (Function)type;
    f.setValueType(new TypeRef.ArrayRef(f.getValueType(), deepClone(getDimensions())));
    type = f;
  }
  ((Element)type).importDetails(this, false);
  return target.mutateType(type);
}

origin: com.nativelibs4java/jnaerator

methodType = parseAndReconciliateMethods(type, type64);
if (tr == null) {
  tr = methodType.getValueType();
origin: nativelibs4java/JNAerator

methodType = parseAndReconciliateMethods(type, type64);
if (tr == null) {
  tr = methodType.getValueType();
origin: nativelibs4java/JNAerator

boolean returnsFakePointer = isFakePointerRef(result, fDirect.getValueType());
boolean needsDirect = !fakePointersLocations.isEmpty() || returnsFakePointer;
if (needsDirect) {
  if (returnsFakePointer) {
    finalCall = new Expression.New(fDirect.getValueType(), varRef(indirectRetVarName));
    toDirectFakePointer(result, fDirect);
boolean retVoid = "void".equals(String.valueOf(f.getValueType()));
if (retVoid) {
  f.setBody(block(stat(x)));
origin: com.nativelibs4java/jnaerator

boolean returnsFakePointer = isFakePointerRef(result, fDirect.getValueType());
boolean needsDirect = !fakePointersLocations.isEmpty() || returnsFakePointer;
if (needsDirect) {
  if (returnsFakePointer) {
    finalCall = new Expression.New(fDirect.getValueType(), varRef(indirectRetVarName));
    toDirectFakePointer(result, fDirect);
boolean retVoid = "void".equals(String.valueOf(f.getValueType()));
if (retVoid) {
  f.setBody(block(stat(x)));
origin: nativelibs4java/JNAerator

public void visitFunctionSignature(FunctionSignature e) {
  if (e.getFunction() == null) {
    return;
  }
  assert e.getFunction().getBody() == null;
  modifiersStringPrefix(e);
  append(e.getFunction().getValueType()).space(e.getFunction().getValueType() != null);
  if (e.getParentElement() instanceof TypeRef.Pointer) {
    append("(");
    modifiersStringPrefix(e.getFunction());
    switch (e.getType()) {
      case CFunction:
        append("*");
        break;
      case ObjCBlock:
        append("^");
        break;
    }
    append(e.getFunction().getName());
    append(")");
  } else {
    append(e.getFunction().getName());
  }
  append("(");
  implode(e.getFunction().getArgs(), ", ");
  append(")");
  append(e.getModifiers().isEmpty() ? "" : " ");
  implode(e.getModifiers(), " ");
}
origin: nativelibs4java/JNAerator

public void visitFunction(Function e) {
  TypeRef valueType = e.getValueType();
  Identifier name = e.getName();
  List<Modifier> modifiers = e.getModifiers();
origin: nativelibs4java/JNAerator

TypeRef javaType = convDecl.getValueType();
String pointerGetSetMethodSuffix = StringUtils.capitalize(javaType.toString());
com.ochafik.lang.jnaerator.parserFunctiongetValueType

Popular methods of Function

  • <init>
  • addArg
  • addModifiers
  • getModifiers
  • getName
  • setBody
  • getArgs
  • getAsmName
  • getBody
  • getType
  • importDetails
  • setArgs
  • importDetails,
  • setArgs,
  • setCommentBefore,
  • setName,
  • setType,
  • setValueType,
  • accept,
  • addAnnotation,
  • addThrown

Popular in Java

  • Making http requests using okhttp
  • runOnUiThread (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • startActivity (Activity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • JCheckBox (javax.swing)
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now