1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 17:26:01 +02:00

Extends IMacroBinding and the CharArrayUtils, also adding java-doc for some of the API.

This commit is contained in:
Markus Schorn 2007-10-19 12:30:52 +00:00
parent e27f022a1f
commit 3381fad4e4
3 changed files with 54 additions and 12 deletions

View file

@ -132,30 +132,33 @@ public interface IASTTranslationUnit extends IASTNode {
public IASTNode selectNodeForLocation(String path, int offset, int length);
/**
* Get the macro definitions encountered in parsing this translation unit.
*
* @return <code>IASTPreprocessorMacroDefinition[]</code>
* Get the macro definitions encountered in parsing this translation unit. The result will not contain
* definitions for built-in macros.
* <p>
* In case the information for a header-file is pulled in from the index,
* macro definitions contained therein are not returned.
*/
public IASTPreprocessorMacroDefinition[] getMacroDefinitions();
/**
* Get builtin macro definitions used when parsing this translation unit.
* Get built-in macro definitions used when parsing this translation unit.
* This includes macros obtained from the index.
*
* @return <code>IASTPreprocessorMacroDefinition[]</code>
*/
public IASTPreprocessorMacroDefinition[] getBuiltinMacroDefinitions();
/**
* Get the #include directives encountered in parsing this translation unit.
* @return <code>IASTPreprocessorIncludeStatement[]</code>
* Get the include directives encountered in parsing this translation unit. This will also contain directives
* used for handling the gcc-options -imacros and -include.
* <p>
* In case the information for a header-file is pulled in from the index,
* include directives contained therein are not returned.
*/
public IASTPreprocessorIncludeStatement[] getIncludeDirectives();
/**
* Get all preprocessor statements.
*
* @return <code>IASTPreprocessorStatement[]</code>
* Get all preprocessor statements.
* In case the information for a header-file is pulled in from the index,
* preprocessing statements contained therein are not returned.
*/
public IASTPreprocessorStatement[] getAllPreprocessorStatements();
@ -205,7 +208,10 @@ public interface IASTTranslationUnit extends IASTNode {
}
/**
* @return
* Return the dependency tree for the translation unit.
* <p>
* In case the information for a header-file is pulled in from the index,
* dependencies contained therein are not part of the dependency tree.
*/
public IDependencyTree getDependencyTree();

View file

@ -10,6 +10,22 @@
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast;
/**
* Models bindings for macro names.
*
* <p> This interface is not intended to be implemented by clients. </p>
*/
public interface IMacroBinding extends IBinding {
/**
* Returns the expansion of this macro definition.
* @since 5.0
*/
char[] getExpansion();
/**
* Returns <code>true</code> if this is a function-style macro.
* @since 5.0
*/
boolean isFunctionStyle();
}

View file

@ -0,0 +1,20 @@
/*******************************************************************************
* Copyright (c) 2007 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Markus Schorn - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.parser;
/**
* The exception is thrown when a completion is requested within one of the following constructs:
* <p> character-literal, string-literal, comment, preprocessing directive, macro-expansion.
* @since 5.0
*/
public class CompletionInPreprocessorException extends Exception {
}