|
UFO: Alien Invasion
|
Shared parsing functions. More...

Go to the source code of this file.
Enumerations | |
| enum | Com_TokenType_t { TT_EOF = 0 , TT_BEGIN_BLOCK = '{' , TT_END_BLOCK = '}' , TT_COMMA = ',' , TT_BEGIN_LIST = '(' , TT_END_LIST = ')' , TT_CONTENT = 0xFF , TT_WORD , TT_QUOTED_WORD } |
Functions | |
| const char * | Com_GetToken (const char **data_p) |
| Get the current token value. | |
| Com_TokenType_t | Com_GetType (const char **data_p) |
| Get the current token type. | |
| Com_TokenType_t | Com_NextToken (const char **data_p) |
| Compute the next token. | |
| const char * | Com_Parse (const char **data_p, char *target=nullptr, size_t size=0, bool replaceWhitespaces=true) |
| int | Com_CountTokensInBuffer (const char *buffer) |
| Counts the tokens in the given buffer that the Com_Parse function would extract. | |
| void | Com_UnParseLastToken (void) |
| Put back the last token into the parser The next call of Com_Parse will return the same token again. | |
| void | Com_SkipBlock (const char **text) |
| Skips a block of {} in our script files. | |
| int | Com_GetBlock (const char **text, const char **start) |
| Get the start and end point of a block in the given text. | |
Shared parsing functions.
Definition in file parse.h.
| enum Com_TokenType_t |
| int Com_CountTokensInBuffer | ( | const char * | buffer | ) |
Counts the tokens in the given buffer that the Com_Parse function would extract.
| [in] | buffer | The buffer to count the tokens in |
Definition at line 80 of file parse.cpp.
References Com_Parse().
Referenced by R_ModLoadAnims().
| int Com_GetBlock | ( | const char ** | text, |
| const char ** | start ) |
Get the start and end point of a block in the given text.
| [in,out] | text | The text pointer to get the start and end for. The pointer is set to the end of the block in this function. |
| [out] | start | The pointer to the beginning of the block |
Definition at line 272 of file parse.cpp.
References Com_Parse(), and Com_SkipBlock().
Referenced by ParseUMP(), SV_ParseUMP(), and TEST_F().
| const char * Com_GetToken | ( | const char ** | data_p | ) |
Get the current token value.
Definition at line 51 of file parse.cpp.
References com_token.
Referenced by Com_ParseList().
| Com_TokenType_t Com_GetType | ( | const char ** | data_p | ) |
Get the current token type.
Definition at line 60 of file parse.cpp.
References type.
Referenced by TEST_F(), TEST_F(), TEST_F(), TEST_F(), UI_ParseNode(), UI_ParseProperty(), UI_ParseValueExpression(), and UI_ParseWindow().
| Com_TokenType_t Com_NextToken | ( | const char ** | data_p | ) |
Compute the next token.
Definition at line 69 of file parse.cpp.
References Com_Parse(), and type.
Referenced by Com_ParseList().
| const char * Com_Parse | ( | const char ** | data_p, |
| char * | target = nullptr, | ||
| size_t | size = 0, | ||
| bool | replaceWhitespaces = true ) |
| void Com_SkipBlock | ( | const char ** | text | ) |
Skips a block of {} in our script files.
| [in,out] | text | The text pointer to skip the block in. This pointer is set to the end of the block |
Definition at line 253 of file parse.cpp.
References Com_Parse().
Referenced by AIR_ParseAircraft(), CL_ParseMessageID(), Com_GetBlock(), Com_ParseGameTypes(), Com_ParseItemEffect(), Com_ParseTeam(), FS_NextScriptHeader(), and SV_ParseUMP().
Put back the last token into the parser The next call of Com_Parse will return the same token again.
Definition at line 42 of file parse.cpp.
References isUnparsedToken.
Referenced by CL_ParseSequence(), Com_ParseBlockToken(), TEST_F(), UI_ParseCallAction(), UI_ParseExpression(), and UI_ParseSetAction().