Line oriented script parsing. More...
Data Structures | |
struct | script_s |
Typedefs | |
typedef struct script_s | script_t |
Functions | |
void | Script_Delete (script_t *script) |
Delete a script_t object. More... | |
qboolean | Script_GetToken (script_t *script, qboolean crossline) |
Get the next token. More... | |
script_t * | Script_New (void) |
Return a new script_t object. More... | |
void | Script_Start (script_t *script, const char *file, const char *data) |
Prepare a script_t object for parsing. More... | |
const char * | Script_Token (script_t *script) |
Return a pointer to the current token. More... | |
qboolean | Script_TokenAvailable (script_t *script, qboolean crossline) |
Check if a new token is available. More... | |
void | Script_UngetToken (script_t *script) |
Unget the current token. More... | |
Line oriented script parsing.
Multiple scripts being parsed at the same time is supported.
void Script_Delete | ( | script_t * | script | ) |
Delete a script_t object.
script | The script_t object to be deleted Does not free the memory passed to Script_Start(). |
Get the next token.
Generates an error and exits the program if no token is available and crossline is false.
script | The script_t object being parsed |
crossline | True to allow passing |
script_t* Script_New | ( | void | ) |
Return a new script_t object.
Prepare a script_t object for parsing.
The caller is responsible for freeing the memory associated with file and data when parsing is complete.
script | The script_t object being parsed |
file | Name of the file being parsed. used only for error reporting |
data | The script to be parsed |
Return a pointer to the current token.
script | The script_t object being parsed |
Check if a new token is available.
script | The script_t object being parsed |
crossline | True to allow passing |
void Script_UngetToken | ( | script_t * | script | ) |
Unget the current token.
Only one level of unget is supported.
script | The script_t object being parsed |