|
Eclipse CDT 7.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IASTTranslationUnit
The translation unit represents a compilable unit of source. All existing implementations of IASTTranslationUnit are not thread safe. Even 'get' methods may cause changes to the underlying object.
Nested Class Summary | |
---|---|
static interface |
IASTTranslationUnit.IDependencyTree
|
Nested classes/interfaces inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode |
---|
IASTNode.CopyStyle |
Field Summary | |
---|---|
static ASTNodeProperty |
EXPANSION_NAME
Deprecated. names for macro expansions are nested inside of IASTPreprocessorMacroExpansion . |
static ASTNodeProperty |
MACRO_EXPANSION
|
static ASTNodeProperty |
OWNED_DECLARATION
OWNED_DECLARATION represents the relationship between an IASTTranslationUnit
and its nested IASTDeclaration 's. |
static ASTNodeProperty |
PREPROCESSOR_STATEMENT
PREPROCESSOR_STATEMENT represents the relationship between
an IASTTranslationUnit and its nested IASTPreprocessorStatement . |
static ASTNodeProperty |
SCANNER_PROBLEM
SCANNER_PROBLEM represents the relationship between an IASTTranslationUnit
and its nested IASTProblem . |
Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode |
---|
EMPTY_NODE_ARRAY |
Method Summary | |
---|---|
void |
addDeclaration(IASTDeclaration declaration)
Adds declaration to translation unit. |
IASTTranslationUnit |
copy()
Returns a copy of the AST, however the ILocationResolver and the preprocessor nodes are not copied. |
IASTTranslationUnit |
copy(IASTNode.CopyStyle style)
Returns a copy of the AST, however the ILocationResolver and the preprocessor nodes are not copied. |
IASTFileLocation |
flattenLocationsToFile(IASTNodeLocation[] nodeLocations)
Flattens the node locations provided into a single file location. |
void |
freeze()
Causes this node and all the nodes rooted at this node to become immutable. |
IASTPreprocessorStatement[] |
getAllPreprocessorStatements()
Returns all preprocessor statements. |
org.eclipse.cdt.core.index.IIndexFileSet |
getASTFileSet()
Returns the set of files in the index that are superseded by this AST, or null
if not available. |
INodeFactory |
getASTNodeFactory()
Returns the node factory that was used to build the AST. |
IASTPreprocessorMacroDefinition[] |
getBuiltinMacroDefinitions()
Returns built-in macro definitions used when parsing this translation unit. |
IASTComment[] |
getComments()
In case the AST was created in a way that supports comment parsing, all comments of the translation unit are returned. |
java.lang.String |
getContainingFilename(int offset)
|
IASTDeclaration[] |
getDeclarations()
A translation unit contains an ordered sequence of declarations. |
org.eclipse.cdt.core.dom.IName[] |
getDeclarations(IBinding binding)
Returns the list of declarations in this translation unit for the given binding. |
IASTName[] |
getDeclarationsInAST(IBinding binding)
Returns the list of declarations in this translation unit for the given binding. |
org.eclipse.cdt.core.dom.IName[] |
getDefinitions(IBinding binding)
Returns the array of definitions in this translation unit for the given binding. |
IASTName[] |
getDefinitionsInAST(IBinding binding)
Returns the array of definitions in this translation unit for the given binding. |
IASTTranslationUnit.IDependencyTree |
getDependencyTree()
Returns the dependency tree for the translation unit. |
java.lang.String |
getFilePath()
Returns the location of the root file of this translation unit. |
IASTPreprocessorIncludeStatement[] |
getIncludeDirectives()
Returns the include directives encountered in parsing this translation unit. |
org.eclipse.cdt.core.index.IIndex |
getIndex()
Returns the Index associated with this translation unit. |
org.eclipse.cdt.core.index.IIndexFileSet |
getIndexFileSet()
Returns the set of files that have been skipped because they have been part of the index prior to creating this AST, or null if not available. |
org.eclipse.cdt.core.dom.ILinkage |
getLinkage()
Returns the linkage this AST was parsed in. |
IASTPreprocessorMacroDefinition[] |
getMacroDefinitions()
Returns the macro definitions encountered in parsing this translation unit. |
IASTPreprocessorMacroExpansion[] |
getMacroExpansions()
Returns an array with all macro expansions of this translation unit. |
IASTNodeSelector |
getNodeSelector(java.lang.String filePath)
Returns an IASTNodeSelector object for finding nodes by file offsets. |
ITranslationUnit |
getOriginatingTranslationUnit()
Returns the ITranslationUnit this AST originated from, or null if the AST
does not correspond to an ITranslationUnit. |
org.eclipse.cdt.core.parser.ParserLanguage |
getParserLanguage()
Deprecated. don't use it. |
IASTProblem[] |
getPreprocessorProblems()
Returns all preprocessor and scanner problems. |
int |
getPreprocessorProblemsCount()
Fast access to the count of preprocessor problems to support statistics. |
IASTName[] |
getReferences(IBinding binding)
Returns the list of references in this translation unit to the given binding. |
IScope |
getScope()
This returns the global scope for the translation unit. |
boolean |
hasNodesOmitted()
Returns true if the parser has skipped any nodes while creating the AST. |
boolean |
isBasedOnIncompleteIndex()
Returns true if the index was not fully initialized when the code of the translation
unit was parsed. |
boolean |
isHeaderUnit()
Returns whether this AST represents a header file. |
IASTNode |
selectNodeForLocation(java.lang.String path,
int offset,
int length)
Deprecated. use getNodeSelector(String) , instead. |
void |
setHasNodesOmitted(boolean nodesOmitted)
Sets whether the parser has skipped any nodes while creating the AST for the translation unit. |
void |
setIndex(org.eclipse.cdt.core.index.IIndex index)
Sets the Index to be used for this translation unit. |
void |
setIsHeaderUnit(boolean headerUnit)
Sets whether this AST represents a header file. |
void |
setPragmaOnceSemantics(boolean value)
|
void |
setSignificantMacros(org.eclipse.cdt.core.parser.ISignificantMacros sigMacros)
|
Methods inherited from interface org.eclipse.cdt.core.dom.ast.IASTDeclarationListOwner |
---|
getDeclarations |
Methods inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode |
---|
accept, contains, getChildren, getContainingFilename, getFileLocation, getLeadingSyntax, getNodeLocations, getOriginalNode, getParent, getPropertyInParent, getRawSignature, getSyntax, getTrailingSyntax, getTranslationUnit, isActive, isFrozen, isPartOfTranslationUnitFile, setParent, setPropertyInParent |
Methods inherited from interface org.eclipse.cdt.core.dom.ast.IFileNomination |
---|
getSignificantMacros, hasPragmaOnceSemantics |
Field Detail |
---|
static final ASTNodeProperty OWNED_DECLARATION
OWNED_DECLARATION
represents the relationship between an IASTTranslationUnit
and its nested IASTDeclaration
's.
static final ASTNodeProperty SCANNER_PROBLEM
SCANNER_PROBLEM
represents the relationship between an IASTTranslationUnit
and its nested IASTProblem
.
static final ASTNodeProperty PREPROCESSOR_STATEMENT
PREPROCESSOR_STATEMENT
represents the relationship between
an IASTTranslationUnit
and its nested IASTPreprocessorStatement
.
static final ASTNodeProperty MACRO_EXPANSION
@Deprecated static final ASTNodeProperty EXPANSION_NAME
IASTPreprocessorMacroExpansion
.Method Detail |
---|
IASTDeclaration[] getDeclarations()
void addDeclaration(IASTDeclaration declaration)
addDeclaration
in interface IASTDeclarationListOwner
declaration
- IASTDeclaration
IScope getScope()
org.eclipse.cdt.core.dom.IName[] getDeclarations(IBinding binding)
binding
-
IASTName[] getDeclarationsInAST(IBinding binding)
binding
-
org.eclipse.cdt.core.dom.IName[] getDefinitions(IBinding binding)
binding
-
IASTName[] getDefinitionsInAST(IBinding binding)
binding
-
IASTName[] getReferences(IBinding binding)
binding
-
IASTNodeSelector getNodeSelector(java.lang.String filePath)
filePath
- file of interest, as returned by IASTFileLocation.getFileName()
,
or null
to specify the root source of the translation-unit.
@Deprecated IASTNode selectNodeForLocation(java.lang.String path, int offset, int length)
getNodeSelector(String)
, instead.
IASTPreprocessorMacroDefinition[] getMacroDefinitions()
In case the information for a header-file is pulled in from the index, macro definitions contained therein are not returned.
IASTPreprocessorMacroDefinition[] getBuiltinMacroDefinitions()
IASTPreprocessorIncludeStatement[] getIncludeDirectives()
In case the information for a header-file is pulled in from the index, include directives contained therein are not returned.
IASTPreprocessorStatement[] getAllPreprocessorStatements()
IASTPreprocessorMacroExpansion[] getMacroExpansions()
IASTProblem[] getPreprocessorProblems()
IASTProblem[]
int getPreprocessorProblemsCount()
java.lang.String getFilePath()
getFileLocation().getFileName()
IASTFileLocation.getFileName()
IASTFileLocation flattenLocationsToFile(IASTNodeLocation[] nodeLocations)
nodeLocations
- IASTNodeLocation
s to flatten
IASTTranslationUnit.IDependencyTree getDependencyTree()
In case the information for a header-file is pulled in from the index, dependencies contained therein are not part of the dependency tree.
java.lang.String getContainingFilename(int offset)
offset
- @Deprecated org.eclipse.cdt.core.parser.ParserLanguage getParserLanguage()
org.eclipse.cdt.core.index.IIndex getIndex()
org.eclipse.cdt.core.index.IIndexFileSet getIndexFileSet()
null
if not available.
Applies only, if AST was created with an index and the option to skip headers found in
the index.
org.eclipse.cdt.core.index.IIndexFileSet getASTFileSet()
null
if not available. Applies only, if AST was created with an index.
IASTComment[] getComments()
IASTComment[]
org.eclipse.cdt.core.dom.ILinkage getLinkage()
boolean isHeaderUnit()
INodeFactory getASTNodeFactory()
void setIndex(org.eclipse.cdt.core.index.IIndex index)
void setIsHeaderUnit(boolean headerUnit)
void freeze()
IASTTranslationUnit copy()
copy
in interface IASTNode
IASTNode.copy()
IASTTranslationUnit copy(IASTNode.CopyStyle style)
copy
in interface IASTNode
style
- IASTNode.CopyStyle
create a copy with or without locations. Please see
IASTNode.CopyStyle
for restrictions on copies with Locations.IASTNode.copy()
ITranslationUnit getOriginatingTranslationUnit()
null
if the AST
does not correspond to an ITranslationUnit.
boolean isBasedOnIncompleteIndex()
true
if the index was not fully initialized when the code of the translation
unit was parsed.
void setSignificantMacros(org.eclipse.cdt.core.parser.ISignificantMacros sigMacros)
void setPragmaOnceSemantics(boolean value)
boolean hasNodesOmitted()
true
if the parser has skipped any nodes while creating the AST.
void setHasNodesOmitted(boolean nodesOmitted)
|
Eclipse CDT 7.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |