diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTranslationUnit.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTranslationUnit.java index 4d1b0a093eb..e96bd84df13 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTranslationUnit.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTranslationUnit.java @@ -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 IASTPreprocessorMacroDefinition[] + * Get the macro definitions encountered in parsing this translation unit. The result will not contain + * definitions for built-in macros. + *

+ * 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 IASTPreprocessorMacroDefinition[] */ public IASTPreprocessorMacroDefinition[] getBuiltinMacroDefinitions(); /** - * Get the #include directives encountered in parsing this translation unit. - * @return IASTPreprocessorIncludeStatement[] + * Get the include directives encountered in parsing this translation unit. This will also contain directives + * used for handling the gcc-options -imacros and -include. + *

+ * 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 IASTPreprocessorStatement[] + * 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. + *

+ * 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(); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IMacroBinding.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IMacroBinding.java index 38050ee9f4c..07107db4303 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IMacroBinding.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IMacroBinding.java @@ -10,6 +10,22 @@ *******************************************************************************/ package org.eclipse.cdt.core.dom.ast; +/** + * Models bindings for macro names. + * + *

This interface is not intended to be implemented by clients.

+ */ public interface IMacroBinding extends IBinding { + /** + * Returns the expansion of this macro definition. + * @since 5.0 + */ + char[] getExpansion(); + + /** + * Returns true if this is a function-style macro. + * @since 5.0 + */ + boolean isFunctionStyle(); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/CompletionInPreprocessorException.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/CompletionInPreprocessorException.java new file mode 100644 index 00000000000..a8283c6df2c --- /dev/null +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/CompletionInPreprocessorException.java @@ -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: + *

character-literal, string-literal, comment, preprocessing directive, macro-expansion. + * @since 5.0 + */ +public class CompletionInPreprocessorException extends Exception { + +}