Examples of FunctionDeclaration


Examples of com.google.test.metric.cpp.dom.FunctionDeclaration

    this.visibility = visibility;
  }

  @Override
  public void directDeclarator(String id) {
    parent.addChild(new FunctionDeclaration(id, visibility));
  }
View Full Code Here

Examples of com.google.test.metric.cpp.dom.FunctionDeclaration

    assertEquals("B", classB.getName());
  }

  public void testGlobalFunctionDeclaration() throws Exception {
    TranslationUnit unit = parse("void foo();");
    FunctionDeclaration functionFoo = unit.getChild(0);
    assertEquals("foo", functionFoo.getName());
  }
View Full Code Here

Examples of com.google.test.metric.cpp.dom.FunctionDeclaration

  public void testFunctionDeclarationInNamespace() throws Exception {
    TranslationUnit unit = parse("namespace A { void foo(); };");
    Namespace namespaceA = unit.getChild(0);
    assertEquals("A", namespaceA.getName());
    FunctionDeclaration functionFoo = namespaceA.getChild(0);
    assertEquals("foo", functionFoo.getName());
  }
View Full Code Here

Examples of com.google.test.metric.cpp.dom.FunctionDeclaration

  public void testMemberFunctionDeclaration() throws Exception {
    TranslationUnit unit = parse("class A { void foo(); };");
    ClassDeclaration classA = unit.getChild(0);
    assertEquals("A", classA.getName());
    FunctionDeclaration functionFoo = classA.getChild(0);
    assertEquals("foo", functionFoo.getName());
  }
View Full Code Here

Examples of com.google.test.metric.cpp.dom.FunctionDeclaration

  public void testPrivateAccessSpecifier() throws Exception {
    TranslationUnit unit = parse(
        "class A { private: void foo(); };");
    ClassDeclaration classA = unit.getChild(0);
    FunctionDeclaration functionFoo = classA.getChild(0);
    Visibility visibility = functionFoo.getVisibility();
    assertEquals(Visibility.PRIVATE, visibility);
  }
View Full Code Here

Examples of net.jangaroo.jooc.ast.FunctionDeclaration

  }

  @Override
  public FunctionDeclaration getMethodDeclaration() {
    if (definingNode instanceof FunctionDeclaration) {
      final FunctionDeclaration functionDeclaration = (FunctionDeclaration) definingNode;
      if (functionDeclaration.isClassMember()) {
        return functionDeclaration;
      }
    }
    return super.getMethodDeclaration();
  }
View Full Code Here

Examples of net.jangaroo.jooc.ast.FunctionDeclaration

        StringBuilder superCallCode = new StringBuilder();
        superCallCode.append("super(");
        if (functionDeclaration.getClassDeclaration() != null) {
          ClassDeclaration superType = functionDeclaration.getClassDeclaration().getSuperTypeDeclaration();
          if (superType != null) {
            FunctionDeclaration superConstructor = superType.getConstructor();
            if (superConstructor != null) {
              Parameters superParameters = superConstructor.getParams();
              boolean first = true;
              while (superParameters != null && superParameters.getHead().getOptInitializer() == null) {
                if (first) {
                  first = false;
                } else {
View Full Code Here

Examples of org.eclipse.php.internal.core.ast.nodes.FunctionDeclaration

   
    AST ast = fProgram.getAST();
    MethodDeclaration method = ast.newMethodDeclaration();
    Block extractedMethodBody = ast.newBlock();
       
    FunctionDeclaration functionDec = ast.newFunctionDeclaration(ast.newIdentifier(fMethodName), computeArguments(ast), extractedMethodBody, false);
    method.setModifier(fModifierAccessFlag);
    method.setFunction(functionDec);
   
    ASTRewrite rewriter = ASTRewrite.create(ast);
   
View Full Code Here

Examples of org.eclipse.php.internal.core.ast.nodes.FunctionDeclaration

      Program previewProgram = previewParser.createAST(null);
     
      previewProgram.recordModifications();
      AST previewAST = previewProgram.getAST();
     
      FunctionDeclaration function = previewAST.newFunctionDeclaration(previewAST.newIdentifier(fMethodName), computeArguments(previewAST), previewAST.newBlock(), false);
      MethodDeclaration method = previewAST.newMethodDeclaration(fModifierAccessFlag, function);
      previewProgram.statements().add(method);
     
      Document myDoc = new Document();
      previewProgram.rewrite(myDoc, null).apply(myDoc);
View Full Code Here

Examples of org.eclipse.php.internal.core.ast.nodes.FunctionDeclaration

  public void testFunctionDeclarationBinding() throws Exception {
    String str = "<?php function foo() { return new SoapClient(); } ?> ";
    Program program = createAndParse(str);

    FunctionDeclaration functionDeclaration = (FunctionDeclaration) program
        .statements().get(0);

    IFunctionBinding functionBinding = functionDeclaration
        .resolveFunctionBinding();

    Assert.assertNotNull(functionBinding);
    Assert.assertTrue(functionBinding.getName().equals("foo"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.