|
ACAV f0ba4b7c9529
Abstract Syntax Tree (AST) visualization tool for C, C++, and Objective-C
|
Index for source-to-AST node lookup. More...
#include <SourceLocationIndex.h>
Public Member Functions | |
| SourceLocationIndex (const SourceLocationIndex &)=delete | |
| SourceLocationIndex & | operator= (const SourceLocationIndex &)=delete |
| void | addNode (AstViewNode *node) |
| Add node to index. | |
| void | finalize () |
| Finalize all interval trees (call after all nodes added). | |
| std::vector< AstViewNode * > | getNodesAt (FileID fileId, unsigned line, unsigned column) const |
| Query nodes at specific source position. | |
| AstViewNode * | getFirstNodeContainedInRange (FileID fileId, unsigned beginLine, unsigned beginColumn, unsigned endLine, unsigned endColumn) const |
| Query first node fully contained within a range. | |
| std::size_t | getFileCount () const |
| Get number of files in index. | |
| std::size_t | getTotalIntervals () const |
| Get total number of intervals across all files. | |
| bool | hasFile (FileID fileId) const |
| Check whether the current TU AST contains any indexed nodes for a file. | |
Index for source-to-AST node lookup.
Maintains one IntervalTree per FileID. Built during AST extraction. Owned by AstContext, destroyed when TU is closed.
Definition at line 108 of file SourceLocationIndex.h.
| void acav::SourceLocationIndex::addNode | ( | AstViewNode * | node | ) |
Add node to index.
| node | AST node with valid source range |
Definition at line 145 of file SourceLocationIndex.cpp.
References acav::AstViewNode::getSourceRange(), and acav::FileManager::InvalidFileID.
| void acav::SourceLocationIndex::finalize | ( | ) |
Finalize all interval trees (call after all nodes added).
Definition at line 166 of file SourceLocationIndex.cpp.
|
inline |
Get number of files in index.
Definition at line 146 of file SourceLocationIndex.h.
| AstViewNode * acav::SourceLocationIndex::getFirstNodeContainedInRange | ( | FileID | fileId, |
| unsigned | beginLine, | ||
| unsigned | beginColumn, | ||
| unsigned | endLine, | ||
| unsigned | endColumn ) const |
Query first node fully contained within a range.
| fileId | File identifier |
| beginLine | Range start line (1-based) |
| beginColumn | Range start column (1-based) |
| endLine | Range end line (1-based) |
| endColumn | Range end column (1-based) |
Definition at line 184 of file SourceLocationIndex.cpp.
| std::vector< AstViewNode * > acav::SourceLocationIndex::getNodesAt | ( | FileID | fileId, |
| unsigned | line, | ||
| unsigned | column ) const |
Query nodes at specific source position.
| fileId | File identifier |
| line | Line number (1-based) |
| column | Column number (1-based) |
Definition at line 173 of file SourceLocationIndex.cpp.
| std::size_t acav::SourceLocationIndex::getTotalIntervals | ( | ) | const |
Get total number of intervals across all files.
Definition at line 196 of file SourceLocationIndex.cpp.
| bool acav::SourceLocationIndex::hasFile | ( | FileID | fileId | ) | const |
Check whether the current TU AST contains any indexed nodes for a file.
Definition at line 204 of file SourceLocationIndex.cpp.