Public header file for the AST functions.
More...
Go to the source code of this file.
Public header file for the AST functions.
Definition in file ast.h.
◆ ast_callback
The prototype for AST translation callback functions.
- Parameters
-
spData | Pointer to the callback data passed to the callback function. |
- Returns
- One of:
- ID_AST_OK normal return
- ID_AST_SKIP skip traversal of the remaining branch below this node
Definition at line 91 of file ast.h.
◆ bAstValidate()
abool bAstValidate |
( |
void * |
vpCtx | ) |
|
Validate an AST context pointer.
- Parameters
-
vpCtx | Pointer to a possible AST context returned by vpAstCtor(). |
- Returns
- True if the pointer is valid, false otherwise.
Definition at line 104 of file ast.c.
◆ vAstClear()
void vAstClear |
( |
void * |
vpCtx | ) |
|
Clear the AST records for reuse of the AST object.
- Parameters
-
vpCtx | Pointer to an AST context returned from vpAstCtor(); Silently ignored if NULL. However, if non-NULL it must be a valid AST context pointer or the application will exit with BAD_CONTEXT. |
Definition at line 118 of file ast.c.
◆ vAstDtor()
void vAstDtor |
( |
void * |
vpCtx | ) |
|
Definition at line 81 of file ast.c.
◆ vAstInfo()
void vAstInfo |
( |
void * |
vpCtx, |
|
|
ast_info * |
spInfo |
|
) |
| |
Retrieve basic information about the AST object.
- Parameters
-
vpCtx | Pointer to a valid AST context returned by vpAstCtor(). If invalid, the application will silently exit with a BAD_CONTEXT exit code; |
spInfo | Pointer to the user's info struct to receive the information. |
Definition at line 137 of file ast.c.
◆ vAstSetRuleCallback()
void vAstSetRuleCallback |
( |
void * |
vpCtx, |
|
|
aint |
uiRuleIndex, |
|
|
ast_callback |
pfnCallback |
|
) |
| |
Define a callback function for a single rule on the AST.
NOTE: There is an important difference between the role of the call back functions during parsing and translation. See this note for a discussion of this important distinction.
- Parameters
-
vpCtx | Pointer to a valid AST context returned by vpAstCtor(). If invalid, the application will silently exit with a BAD_CONTEXT exit code; |
uiRuleIndex | The index of the rule to attach this callback function to. |
pfnCallback | Pointer to the callback function. Must match the ast_callback prototype. |
Definition at line 243 of file ast.c.
◆ vAstSetUdtCallback()
void vAstSetUdtCallback |
( |
void * |
vpCtx, |
|
|
aint |
uiUdtIndex, |
|
|
ast_callback |
pfnCallback |
|
) |
| |
Define a callback function for a single UDT on the AST.
NOTE: There is an important difference between the role of the call back functions during parsing and translation. See this note for a discussion of this important distinction.
- Parameters
-
vpCtx | Pointer to a valid AST context returned by vpAstCtor(). If invalid, the application will silently exit with a BAD_CONTEXT exit code; |
uiUdtIndex | The index of the UDT to attach this callback function to. |
pfnCallback | Pointer to the callback function. Must match the ast_callback prototype. |
Definition at line 266 of file ast.c.
◆ vAstTranslate()
void vAstTranslate |
( |
void * |
vpCtx, |
|
|
void * |
vpUserData |
|
) |
| |
Do a depth-first traversal of the AST with user-defined callback functions to translate the AST records.
NOTE: There is an important difference between the role of the call back functions during parsing and translation. See this note for a discussion of this important distinction.
- Parameters
-
vpCtx | Pointer to a valid AST context returned by vpAstCtor(). If invalid, the application will silently exit with a BAD_CONTEXT exit code; |
vpUserData | Pointer to optional user data. This pointer is passed to the user's callback functions for any purpose the application requires for the translation. May be NULL. |
Definition at line 165 of file ast.c.
◆ vpAstCtor()
void* vpAstCtor |
( |
void * |
vpParserCtx | ) |
|
The AST object constructor.
This object is a "sub-object" of the parser. The parser will keep a pointer to and use this object to generate the AST records. Note that there is no associated destructor. This object is destroyed by its parent parser object's destructor, vParserDtor().
- Parameters
-
vpParserCtx | Pointer to a valid parser context returned from vpParserCtor(); If invalid, the application will silently exit with a BAD_CONTEXT exit code; |
- Returns
- Returns a pointer to the object context. Throws an exception on any errors.
Definition at line 51 of file ast.c.
APG Version 7.0 is licensed under the
2-Clause BSD License,
an Open Source Initiative Approved License.