|
Porytiles
|
Represents a parsed function call expression within a token stream. More...
#include <function_call_info.hpp>
Public Member Functions | |
| FunctionCallInfo (std::string function_name, std::vector< std::vector< Token > > arguments, std::size_t start_index) | |
| Constructs a FunctionCallInfo. | |
| const std::string & | function_name () const |
| Returns the function name. | |
| const std::vector< std::vector< Token > > & | arguments () const |
| Returns the arguments as token sequences. | |
| std::size_t | argument_count () const |
| Returns the number of arguments. | |
| const std::vector< Token > & | argument_at (std::size_t index) const |
| Returns the argument at the specified index. | |
| std::size_t | start_index () const |
| Returns the token index where this call begins. | |
| std::string | reconstruct_call_text () const |
| Reconstructs a human-readable call expression from this function call. | |
Represents a parsed function call expression within a token stream.
FunctionCallInfo captures the function name and arguments from a call expression like:
Arguments are stored as raw token vectors, allowing callers to perform pattern matching on each argument (e.g., extracting the integer from TILE_OFFSET_4BPP(X)).
Definition at line 24 of file function_call_info.hpp.
|
inline |
Constructs a FunctionCallInfo.
| function_name | The name of the called function |
| arguments | Vector of argument token sequences (one per argument) |
| start_index | The token index where this call begins in the source token stream |
Definition at line 33 of file function_call_info.hpp.
|
inline |
Returns the argument at the specified index.
| index | The argument index (0-based) |
Definition at line 79 of file function_call_info.hpp.
|
inline |
Returns the number of arguments.
Definition at line 67 of file function_call_info.hpp.
|
inline |
Returns the arguments as token sequences.
Each element in the vector represents one argument as a sequence of tokens. Arguments are separated by commas in the source, but the comma tokens are not included in the argument vectors.
Definition at line 57 of file function_call_info.hpp.
|
inline |
Returns the function name.
Definition at line 43 of file function_call_info.hpp.
|
inline |
Reconstructs a human-readable call expression from this function call.
Joins all argument tokens with commas to produce a string like: AppendTilesetAnimToBuffer(gTilesetAnims_General_Flower[i], TILE_OFFSET_4BPP(508), 4 * TILE_SIZE_4BPP)
Definition at line 103 of file function_call_info.hpp.
|
inline |
Returns the token index where this call begins.
Definition at line 89 of file function_call_info.hpp.