Package org.eclipse.cdt.core.dom.ast

Examples of org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration


      // If the type is nested, simulate Java inner class access visibility by creating a
      // reference to the outer type on the constructor
      final ICPPASTDeclSpecifier parentReferenceDeclSpecifier = f.newTypedefNameSpecifier(new NameInfo(enclosingType.getName()).getName());
      final ICPPASTDeclarator parentReferenceDeclarator = f.newDeclarator(f.newName("__parent".toCharArray()));
      parentReferenceDeclarator.addPointerOperator(f.newPointer());
      final IASTParameterDeclaration parentReference = f.newParameterDeclaration(parentReferenceDeclSpecifier, parentReferenceDeclarator);
      functionDeclarator.addParameterDeclaration(parentReference);
    }

    for (final Object parameterObject : methodDeclaration.parameters()) {
      final SingleVariableDeclaration parameter = (SingleVariableDeclaration) parameterObject;
      final SingleVariableDeclarationInfo declarationInfo = new SingleVariableDeclarationInfo(parameter, compilationUnitInfo);
      final IASTParameterDeclaration parameterDeclaration = f.newParameterDeclaration(declarationInfo.getDeclSpecifier(), declarationInfo.getDeclarator());
      functionDeclarator.addParameterDeclaration(parameterDeclaration);
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration

Copyright © 2018 www.massapicom. 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.