Codota Logo
Function.getBody
Code IndexAdd Codota to your IDE (free)

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

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: nativelibs4java/JNAerator

Block getInitMethodBody(DeclarationsHolder decls) {
  for (Declaration decl : decls.getDeclarations()) {
    if (decl instanceof Function) {
      return ((Function) decl).getBody();
    }
  }
  throw new RuntimeException("Init method not found in " + decls);
}
origin: com.nativelibs4java/jnaerator

Block getInitMethodBody(DeclarationsHolder decls) {
  for (Declaration decl : decls.getDeclarations()) {
    if (decl instanceof Function) {
      return ((Function) decl).getBody();
    }
  }
  throw new RuntimeException("Init method not found in " + decls);
}
origin: nativelibs4java/JNAerator

@Override
public boolean replaceChild(Element child, Element by) {
  if (child == getBody()) {
    setBody((Statement.Block)by);
    return true;
  }
  if (child == getName()) {
    setName((Identifier)by);
    return true;
  }
  if (replaceChild(args, Arg.class, this, child, by))
    return true;
  if (replaceChild(thrown, TypeRef.class, this, child, by))
    return true;
  if (replaceChild(initializers, FunctionCall.class, this, child, by))
    return true;
  
  return super.replaceChild(child, by);
}

origin: nativelibs4java/JNAerator

public void visitFunction(Function function) {
  visitDeclaration(function);
  visit(function.getArgs());
  visit(function.getThrown());
  visit(function.getInitializers());
  
  visit(function.getBody());
  visit(function.getName());
}
origin: nativelibs4java/JNAerator

if (isConstructor) {
  convertedBody = block(stat(methodCall("super", superConstructorArgs.toArray(new Expression[superConstructorArgs.size()]))));
} else if (result.config.convertBodies && function.getBody() != null) {
  try {
    Pair<Element, List<Declaration>> bodyAndExtraDeclarations = result.bridjer.convertToJava(function.getBody(), libraryClassName);
    convertedBody = (Block) bodyAndExtraDeclarations.getFirst();
    for (Declaration d : bodyAndExtraDeclarations.getSecond()) {
origin: com.nativelibs4java/jnaerator

if (isConstructor) {
  convertedBody = block(stat(methodCall("super", superConstructorArgs.toArray(new Expression[superConstructorArgs.size()]))));
} else if (result.config.convertBodies && function.getBody() != null) {
  try {
    Pair<Element, List<Declaration>> bodyAndExtraDeclarations = result.bridjer.convertToJava(function.getBody(), libraryClassName);
    convertedBody = (Block) bodyAndExtraDeclarations.getFirst();
    for (Declaration d : bodyAndExtraDeclarations.getSecond()) {
origin: nativelibs4java/JNAerator

  implode(modifiers, " ");
  space(!modifiers.isEmpty());
  append(e.getBody() == null ? ";" : e.getBody());
  break;
case CFunction:
  if (e.getBody() == null) {
    append(";");
  } else {
    append(" ", e.getBody());
origin: nativelibs4java/JNAerator

fieldsConstr.getBody().addStatement(stat(superCall));
    fieldsConstr.getBody().addStatement(throwIfArraySizeDifferent(uname));
  fieldsConstr.getBody().addStatement(stat(
      new Expression.AssignmentOp(memberRef(thisRef(), MemberRefStyle.Dot, ident(name)), AssignmentOperator.Equal, varRef(uname))));
origin: com.nativelibs4java/jnaerator

fieldsConstr.getBody().addStatement(stat(superCall));
    fieldsConstr.getBody().addStatement(throwIfArraySizeDifferent(uname));
  fieldsConstr.getBody().addStatement(stat(
      new Expression.AssignmentOp(memberRef(thisRef(), MemberRefStyle.Dot, ident(name)), AssignmentOperator.Equal, varRef(uname))));
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(), " ");
}
com.ochafik.lang.jnaerator.parserFunctiongetBody

Popular methods of Function

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

Popular in Java

  • Start an intent from android
  • runOnUiThread (Activity)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now