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

Go to the source code of this file.
Functions | |
| void | Com_UnParseLastToken (void) |
| Put back the last token into the parser The next call of Com_Parse will return the same token again. | |
| 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. | |
| int | Com_CountTokensInBuffer (const char *buffer) |
| Counts the tokens in the given buffer that the Com_Parse function would extract. | |
| const char * | Com_Parse (const char *data_p[], char *target, size_t size, bool replaceWhitespaces) |
| Parse a token out of a string. | |
| 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. | |
Variables | |
| static char | com_token [4096] |
| static bool | isUnparsedToken |
| static Com_TokenType_t | type |
Shared parsing functions.
Definition in file parse.cpp.
| 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, | ||
| size_t | size, | ||
| bool | replaceWhitespaces ) |
Parse a token out of a string.
| data_p | Pointer to a string which is to be parsed |
| target | A place to put the parsed data. If 0, an internal buffer of 4096 is used. |
| size | The length of target buffer, if any |
| replaceWhitespaces | Replace "\\t" and "\\n" to "\t" and "\n" |
data_p is expected to be null-terminated Definition at line 107 of file parse.cpp.
References com_token, data, isUnparsedToken, len, TT_EOF, TT_QUOTED_WORD, TT_WORD, and type.
Referenced by AIR_ParseAircraft(), B_ParseBaseTemplate(), B_ParseBuildings(), CL_DownloadUMPMap(), CL_ParseMapParticle(), CL_ParseMessageID(), CL_ParseParticle(), CL_ParsePtlCmds(), CL_ParseRanks(), CL_ParseSequence(), CL_SpawnParseEntitystring(), CM_LoadMap(), Cmd_TokenizeString(), CMod_LoadEntityString(), Com_CountTokensInBuffer(), Com_EParse(), Com_GetBlock(), Com_MacroExpandString(), Com_NextToken(), Com_ParseActorModels(), Com_ParseActorNames(), Com_ParseActorSounds(), Com_ParseAircraftNames(), Com_ParseArmourOrResistance(), Com_ParseBlock(), Com_ParseBodyPart(), Com_ParseBodyTemplate(), Com_ParseCharacterTemplate(), Com_ParseDamageTypes(), Com_ParseEquipment(), Com_ParseFire(), Com_ParseFireDefinition(), Com_ParseGameTypes(), Com_ParseImplant(), Com_ParseItem(), Com_ParseItemEffect(), Com_ParseMapDefinition(), Com_ParseTeam(), Com_ParseTerrainDefinition(), Com_SkipBlock(), COMP_ParseComponents(), CP_ParseAlienTeam(), CP_ParseCampaign(), CP_ParseResearchableCampaignStates(), CP_ParseResearchedCampaignItems(), ED_CheckNumericType(), ED_GetIntVectorFromString(), ED_ParseEdict(), ED_ParseEntities(), ED_ParseType(), ED_ProcessRanges(), FS_NextScriptHeader(), G_SpawnEntities(), GAME_MP_ParseServerInfoMessage(), GAME_MP_QueryMasterServerThread(), GetToken(), INS_ParseInstallations(), MSO_ParseCategory(), MSO_ParseMessageSettings(), MSO_ParseOption(), ParseMapEntity(), ParseUMP(), R_LoadMaterials(), R_LoadObjModelFace(), R_LoadObjSkin(), R_ModBeginLoading(), R_ModLoadAnims(), R_ParseStage(), R_PreprocessShaderR(), RS_ParseTechnologies(), SV_ParseMapcycle(), SV_ParseUMP(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), UI_BuildRadarImageList(), UI_ParseExpression(), UI_ParseFont(), UI_ParseSprite(), UI_ParseUIModel(), UI_ParseValueExpression(), UI_ParseWindow(), UP_ParseChapter(), and WEB_ListCGameFilesCallback().
| 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().
|
static |
Definition at line 32 of file parse.cpp.
Referenced by Cmd_TokenizeString(), Com_GetToken(), and Com_Parse().
|
static |
Definition at line 33 of file parse.cpp.
Referenced by Com_Parse(), and Com_UnParseLastToken().
|
static |