The cursor abstraction unifies the different kinds of entities in a program --declaration, statements, expressions, references to declarations, etc.-- under a single "cursor" abstraction with a common set of operations. Common operation for a cursor include: getting the physical location in a source file where the cursor points, getting the name associated with a cursor, and retrieving cursors for any child nodes of a particular cursor.
Cursors can be produced in two specific ways. getTranslationUnitCursor produces a cursor for a translation unit, from which one can use
visitChildren to explore the rest of the translation unit. getCursor maps from a physical source location to the entity that resides at that
location, allowing one to map from the source code into the AST.
struct CXCursor {
enum CXCursorKind kind;
int xdata;
void const * data[3];
}
| Modifier and Type | Class and Description |
|---|---|
| public static class | CXCursor.
An array of |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | ALIGNOF
The struct alignment in bytes. |
| public static final int | DATA
The struct member offsets. |
| public static final int | KIND
The struct member offsets. |
| public static final int | SIZEOF
The struct size in bytes. |
| public static final int | XDATA
The struct member offsets. |
| Access | Constructor and Description |
|---|---|
| protected | |
| public | CXCursor(ByteBuffer container)
Creates a |
| Modifier and Type | Method and Description |
|---|---|
| public static CXCursor | |
| public static CXCursor. | calloc(int
the buffer capacity capacity)Returns a new |
| public static CXCursor | calloc(MemoryStack
the stack from which to allocate stack)Returns a new |
| public static CXCursor. | calloc(int
the buffer capacity capacity, MemoryStack the stack from which to allocate stack)Returns a new |
| public static CXCursor | |
| public static CXCursor | |
| public static CXCursor. | |
| public static CXCursor. | |
| protected CXCursor | create(long
the struct memory address address, ByteBuffer an optional container buffer, to be referenced strongly by the struct instance. container)Implements abstract org. the constructor, but returns the exact type of the Struct subclass.
|
| public static CXCursor | |
| public static CXCursor | |
| public static CXCursor. | create(int
the buffer capacity capacity)Returns a new |
| public static CXCursor. | create(long
the memory address address, int the buffer capacity capacity)Create a |
| public static CXCursor | |
| public static CXCursor. | |
| public PointerBuffer | |
| public long | |
| public int | |
| public static CXCursor | |
| public static CXCursor. | malloc(int
the buffer capacity capacity)Returns a new |
| public static CXCursor | malloc(MemoryStack
the stack from which to allocate stack)Returns a new |
| public static CXCursor. | malloc(int
the buffer capacity capacity, MemoryStack the stack from which to allocate stack)Returns a new |
| public static CXCursor | |
| public static CXCursor | |
| public static CXCursor. | |
| public static CXCursor. | |
| public static PointerBuffer | |
| public static long | |
| public static int | |
| public static int | |
| public int | |
| public int |
| ALIGNOF | back to summary |
|---|---|
| public static final int ALIGNOF The struct alignment in bytes. | |
| DATA | back to summary |
|---|---|
| public static final int DATA The struct member offsets. | |
| KIND | back to summary |
|---|---|
| public static final int KIND The struct member offsets. | |
| SIZEOF | back to summary |
|---|---|
| public static final int SIZEOF The struct size in bytes. | |
| XDATA | back to summary |
|---|---|
| public static final int XDATA The struct member offsets. | |
| CXCursor | back to summary |
|---|---|
| protected CXCursor(long address, ByteBuffer container) | |
| CXCursor | back to summary |
|---|---|
| public CXCursor(ByteBuffer container) Creates a The created instance holds a strong reference to the container object. | |
| calloc | back to summary |
|---|---|
| public static CXCursor calloc() Returns a new | |
| calloc | back to summary |
|---|---|
| public static CXCursor. Returns a new
| |
| calloc | back to summary |
|---|---|
| public static CXCursor calloc(MemoryStack stack) Returns a new
| |
| calloc | back to summary |
|---|---|
| public static CXCursor. Returns a new
| |
| callocStack | back to summary |
|---|---|
| public static CXCursor callocStack()
Deprecated
Deprecated for removal in 3.4.0. Use
| |
| callocStack | back to summary |
|---|---|
| public static CXCursor callocStack(MemoryStack stack)
Deprecated
Deprecated for removal in 3.4.0. Use
| |
| callocStack | back to summary |
|---|---|
| public static CXCursor. Deprecated
Deprecated for removal in 3.4.0. Use
| |
| callocStack | back to summary |
|---|---|
| public static CXCursor. Deprecated
Deprecated for removal in 3.4.0. Use
| |
| create | back to summary |
|---|---|
| protected CXCursor create(long address, ByteBuffer container) Implements abstract org. Doc from org. Similar to Effectively, every
| |
| create | back to summary |
|---|---|
| public static CXCursor create() Returns a new | |
| create | back to summary |
|---|---|
| public static CXCursor create(long address) Returns a new | |
| create | back to summary |
|---|---|
| public static CXCursor. Returns a new
| |
| create | back to summary |
|---|---|
| public static CXCursor. Create a
| |
| createSafe | back to summary |
|---|---|
| public static CXCursor createSafe(long address) Like
| |
| createSafe | back to summary |
|---|---|
| public static CXCursor. Like
| |
| data | back to summary |
|---|---|
public PointerBuffer data()
| |
| data | back to summary |
|---|---|
public long data(int index)
| |
| kind | back to summary |
|---|---|
public int kind()
| |
| malloc | back to summary |
|---|---|
| public static CXCursor malloc() Returns a new | |
| malloc | back to summary |
|---|---|
| public static CXCursor. Returns a new
| |
| malloc | back to summary |
|---|---|
| public static CXCursor malloc(MemoryStack stack) Returns a new
| |
| malloc | back to summary |
|---|---|
| public static CXCursor. Returns a new
| |
| mallocStack | back to summary |
|---|---|
| public static CXCursor mallocStack()
Deprecated
Deprecated for removal in 3.4.0. Use
| |
| mallocStack | back to summary |
|---|---|
| public static CXCursor mallocStack(MemoryStack stack)
Deprecated
Deprecated for removal in 3.4.0. Use
| |
| mallocStack | back to summary |
|---|---|
| public static CXCursor. Deprecated
Deprecated for removal in 3.4.0. Use
| |
| mallocStack | back to summary |
|---|---|
| public static CXCursor. Deprecated
Deprecated for removal in 3.4.0. Use
| |
| ndata | back to summary |
|---|---|
| public static PointerBuffer ndata(long struct) Unsafe version of | |
| ndata | back to summary |
|---|---|
| public static long ndata(long struct, int index) Unsafe version of | |
| nkind | back to summary |
|---|---|
| public static int nkind(long struct) Unsafe version of | |
| nxdata | back to summary |
|---|---|
| public static int nxdata(long struct) Unsafe version of | |
| sizeof | back to summary |
|---|---|
| public int sizeof() Implements abstract org. Doc from org. Returns
| |
| xdata | back to summary |
|---|---|
public int xdata()
| |
CXCursor structs.
| Modifier and Type | Field and Description |
|---|---|
| private static final CXCursor |
| Access | Constructor and Description |
|---|---|
| public | Buffer(ByteBuffer container)
Creates a new |
| public | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public PointerBuffer | |
| public long | |
| protected CXCursor | |
| public int | |
| protected CXCursor. | |
| public int |
| ELEMENT_FACTORY | back to summary |
|---|---|
| private static final CXCursor ELEMENT_FACTORY | |
| Buffer | back to summary |
|---|---|
| public Buffer(ByteBuffer container) Creates a new Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
by The created buffer instance holds a strong reference to the container object. | |
| Buffer | back to summary |
|---|---|
| public Buffer(long address, int cap) | |
| Buffer | back to summary |
|---|---|
| pack-priv Buffer(long address, ByteBuffer container, int mark, int pos, int lim, int cap) | |
| data | back to summary |
|---|---|
public PointerBuffer data()
| |
| data | back to summary |
|---|---|
public long data(int index)
| |
| getElementFactory | back to summary |
|---|---|
| protected CXCursor getElementFactory() Implements abstract org.
| |
| kind | back to summary |
|---|---|
public int kind()
| |
| self | back to summary |
|---|---|
| protected CXCursor. Implements abstract org.
| |
| xdata | back to summary |
|---|---|
public int xdata()
| |