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

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


  private IASTSimpleDeclaration convertWrapper(final VariableDeclarationWrapper wrapper) {
    final ModifiersInfo modifiers = new ModifiersInfo(wrapper.modifiers());
    final TypeInfo typeInfo = new TypeInfo(wrapper.getType(), compilationUnitInfo);

    final IASTDeclSpecifier declSpecifier = typeInfo.getDeclSpecifier();

    if (modifiers.isStatic && modifiers.isFinal) {
      declSpecifier.setStorageClass(IASTDeclSpecifier.sc_static);
      declSpecifier.setConst(true);
    }
    if (modifiers.isStatic) {
      declSpecifier.setStorageClass(IASTDeclSpecifier.sc_static);
    }

    return convertFragments(wrapper, declSpecifier);
  }
View Full Code Here


      scribe.printSemicolon();
    }
  }

  private void writeFunctionDefinition(final IASTFunctionDefinition funcDef) {
    final IASTDeclSpecifier declSpecifier = funcDef.getDeclSpecifier();
    if (declSpecifier != null) {
      declSpecifier.accept(visitor);
    }
    if (declSpecifier instanceof IASTSimpleDeclSpecifier) {
      final IASTSimpleDeclSpecifier simDeclSpec = (IASTSimpleDeclSpecifier) declSpecifier;
      if (simDeclSpec.getType() != IASTSimpleDeclSpecifier.t_unspecified) {
        visitor.setSpaceNeededBeforeName(true);
View Full Code Here

      }
    }
  }

  private void writeSimpleDeclaration(final IASTSimpleDeclaration simpDec) {
    final IASTDeclSpecifier declSpecifier = simpDec.getDeclSpecifier();
    final IASTDeclarator[] decls = simpDec.getDeclarators();

    declSpecifier.accept(visitor);
    boolean noSpace = false;
    if (declSpecifier instanceof IASTSimpleDeclSpecifier) {
      final IASTSimpleDeclSpecifier simpleDeclSpecifier = (IASTSimpleDeclSpecifier) declSpecifier;
      if (simpleDeclSpecifier.getType() == IASTSimpleDeclSpecifier.t_unspecified) {
        noSpace = true;
View Full Code Here

    this.fieldDeclaration = fieldDeclaration;
    this.compilationUnitInfo = compilationUnitInfo;
    modifiers = new ModifiersInfo(fieldDeclaration.modifiers());
    typeInfo = new TypeInfo(fieldDeclaration.getType(), compilationUnitInfo);

    final IASTDeclSpecifier declSpecifier = typeInfo.getDeclSpecifier();
    declaration = convertFragments(declSpecifier);

    if (modifiers.isStatic && modifiers.isFinal) {
      declSpecifier.setStorageClass(IASTDeclSpecifier.sc_static);
      declSpecifier.setConst(true);
    }
    if (modifiers.isStatic) {
      declSpecifier.setStorageClass(IASTDeclSpecifier.sc_static);
    }
  }
View Full Code Here

TOP

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

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.