MCPcopy Create free account
hub / github.com/ZDoom/Raze / ParseSingleFile

Function ParseSingleFile

source/common/scripting/frontend/zcc_parser.cpp:296–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294//**--------------------------------------------------------------------------
295
296static void ParseSingleFile(FScanner *pSC, const char *filename, int lump, void *parser, ZCCParseState &state)
297{
298 int tokentype;
299 //bool failed;
300 ZCCToken value;
301 FScanner lsc;
302
303 if (pSC == nullptr)
304 {
305 if (filename != nullptr)
306 {
307 lump = fileSystem.CheckNumForFullName(filename, true);
308 if (lump >= 0)
309 {
310 lsc.OpenLumpNum(lump);
311 }
312 else
313 {
314 Printf("Could not find script lump '%s'\n", filename);
315 return;
316 }
317 }
318 else lsc.OpenLumpNum(lump);
319
320 pSC = &lsc;
321 }
322 FScanner &sc = *pSC;
323 sc.SetParseVersion(state.ParseVersion);
324 state.sc = ≻
325
326 while (sc.GetToken())
327 {
328 value.Largest = 0;
329 value.SourceLoc = sc.GetMessageLine();
330 switch (sc.TokenType)
331 {
332 case TK_StringConst:
333 value.String = state.Strings.Alloc(sc.String, sc.StringLen);
334 tokentype = ZCC_STRCONST;
335 break;
336
337 case TK_NameConst:
338 value.Int = FName(sc.String).GetIndex();
339 tokentype = ZCC_NAMECONST;
340 break;
341
342 case TK_IntConst:
343 value.Int = sc.Number;
344 tokentype = ZCC_INTCONST;
345 break;
346
347 case TK_UIntConst:
348 value.Int = sc.Number;
349 tokentype = ZCC_UINTCONST;
350 break;
351
352 case TK_FloatConst:
353 value.Float = sc.Float;

Callers 1

ParseOneScriptFunction · 0.85

Calls 14

PrintfFunction · 0.85
FNameClass · 0.85
CheckNumForFullNameMethod · 0.80
SetParseVersionMethod · 0.80
GetTokenMethod · 0.80
GetMessageLineMethod · 0.80
MustGetAnyTokenMethod · 0.80
UnGetMethod · 0.80
ScriptMessageMethod · 0.80
TokenNameMethod · 0.80
AllocMethod · 0.45
GetIndexMethod · 0.45

Tested by

no test coverage detected