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

Examples of org.eclipse.cdt.core.dom.ast.cpp.ICPPASTDeclarator


    // Parameters
    if (methodDeclaration.isConstructor() && (enclosingType != null)) {
      // 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()) {
View Full Code Here


    // If the type is nested, simulate Java inner class access visibility by creating a
    // reference to the outer type on the constructor and store it in the object
    if (enclosingType != null) {
      final ICPPASTDeclSpecifier parentReferenceDeclSpecifier = f.newTypedefNameSpecifier(new NameInfo(enclosingType.getName()).getName());
      final IASTSimpleDeclaration parentReference = f.newSimpleDeclaration(parentReferenceDeclSpecifier);
      final ICPPASTDeclarator parentReferenceDeclarator = f.newDeclarator(f.newName("__parent".toCharArray()));
      parentReference.addDeclarator(parentReferenceDeclarator);
      parentReferenceDeclarator.addPointerOperator(f.newPointer());
      final ModifiersInfo modifiersInfo = new ModifiersInfo(false, false, true, false, false, false, false);
      fields.add(new FieldDeclarationInfo(parentReference, modifiersInfo));
    }
  }
View Full Code Here

    return f.newBinaryExpression(operatorInfo.getOperator(), leftOperand.getExpression(), rightOperand.getExpression());
  }

  private IASTExpression convertClassInstanceCreation(final ClassInstanceCreation classInstanceCreation) {
    final TypeInfo typeInfo = new TypeInfo(classInstanceCreation.getType(), compilationUnitInfo);
    final ICPPASTDeclarator declarator = f.newDeclarator(f.newName());

    final List<IASTInitializerClause> initializerClauses = new ArrayList<IASTInitializerClause>();
    for (final Object argumentObject : classInstanceCreation.arguments()) {
      final ExpressionInfo argument = new ExpressionInfo((Expression) argumentObject, typeDeclaration, compilationUnitInfo);
      initializerClauses.add(argument.getExpression());
View Full Code Here

    final ICPPASTSimpleDeclSpecifier declSpecifier = f.newSimpleDeclSpecifier();
    declSpecifier.setStorageClass(IASTDeclSpecifier.sc_auto);
    final IASTSimpleDeclaration declaration = f.newSimpleDeclaration(declSpecifier);

    final SingleVariableDeclarationInfo parameter = new SingleVariableDeclarationInfo(enhancedForStatement.getParameter(), compilationUnitInfo);
    final ICPPASTDeclarator declarator = parameter.getDeclarator();
    for (int i = 0; i < declarator.getPointerOperators().length; i++) {
      declarator.getPointerOperators()[i] = null;
    }
    declaration.addDeclarator(declarator);

    rangeBased.setDeclaration(declaration);
View Full Code Here

    }
    name = f.newName(parameterizedTypeName.toCharArray());
    final ICPPASTTemplateId templateId = f.newTemplateId(name);
    for (final Object parameterTypeObject : parameterizedType.typeArguments()) {
      final TypeInfo parameterTypeInfo = new TypeInfo((Type) parameterTypeObject, compilationUnitInfo);
      final ICPPASTDeclarator parameterDeclarator = f.newDeclarator(f.newName());
      if (parameterTypeInfo.isSimple()) {
        parameterDeclarator.addPointerOperator(f.newPointer());
      }
      final IASTTypeId typeId = f.newTypeId(parameterTypeInfo.getDeclSpecifier(), parameterDeclarator);
      templateId.addTemplateArgument(typeId);
    }
    return f.newTypedefNameSpecifier(templateId);
View Full Code Here

TOP

Related Classes of org.eclipse.cdt.core.dom.ast.cpp.ICPPASTDeclarator

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.