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); public IASTNode selectNodeForLocation(String path, int offset, int length);
/** /**
* Get the macro definitions encountered in parsing this translation unit. * Get the macro definitions encountered in parsing this translation unit. The result will not contain
* * definitions for built-in macros.
* @return <code>IASTPreprocessorMacroDefinition[]</code> * <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(); 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. * This includes macros obtained from the index.
*
* @return <code>IASTPreprocessorMacroDefinition[]</code>
*/ */
public IASTPreprocessorMacroDefinition[] getBuiltinMacroDefinitions(); public IASTPreprocessorMacroDefinition[] getBuiltinMacroDefinitions();
/** /**
* Get the #include directives encountered in parsing this translation unit. * Get the include directives encountered in parsing this translation unit. This will also contain directives
* @return <code>IASTPreprocessorIncludeStatement[]</code> * 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(); public IASTPreprocessorIncludeStatement[] getIncludeDirectives();
/** /**
* Get all preprocessor statements. * Get all preprocessor statements.
* * In case the information for a header-file is pulled in from the index,
* @return <code>IASTPreprocessorStatement[]</code> * preprocessing statements contained therein are not returned.
*/ */
public IASTPreprocessorStatement[] getAllPreprocessorStatements(); 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(); public IDependencyTree getDependencyTree();

View file

@ -10,6 +10,22 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.dom.ast; 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 { 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 {
}