Tabnine Logo
Function.getBody
Code IndexAdd Tabnine 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)

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

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • requestLocationUpdates (LocationManager)
  • setContentView (Activity)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • JTextField (javax.swing)
  • From CI to AI: The AI layer in your organization
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