MCPcopy Create free account
hub / github.com/beefytech/Beef / Init

Method Init

IDEHelper/Compiler/BfParser.cpp:565–605  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

563}
564
565void BfParser::Init(uint64 cacheHash)
566{
567 BF_ASSERT(mParserData == NULL);
568
569 mParserData = new BfParserData();
570 mSourceData = mParserData;
571 mParserData->mFileName = mFileName;
572 mParserData->InitFileData();
573 if (mDataId != -1)
574 mParserData->mDataId = mDataId;
575 else
576 mDataId = mParserData->mDataId;
577 mParserData->mAstAllocManager = &gBfParserCache->mAstAllocManager;
578 mParserData->mSrc = mSrc;
579 mParserData->mSrcLength = mSrcLength;
580
581 if (cacheHash != 0)
582 {
583 BfLogSysM("Creating cached parserData %p for %p %s\n", mParserData, this, mFileName.c_str());
584
585 mParserData->mHash = cacheHash;
586 mParserData->mRefCount = 0; // 0 means we want to EVENTUALLY write it to the cache
587 mSrcAllocSize = -1;
588 }
589 else
590 {
591 BfLogSysM("Creating unique parserData %p for %p %s\n", mParserData, this, mFileName.c_str());
592
593 mParserData->mUniqueParser = this;
594 }
595
596 mJumpTableSize = ((mSrcLength + 1) + PARSER_JUMPTABLE_DIVIDE - 1) / PARSER_JUMPTABLE_DIVIDE;
597 mJumpTable = new BfLineStartEntry[mJumpTableSize];
598 memset(mJumpTable, 0, mJumpTableSize * sizeof(BfLineStartEntry));
599
600 mParserData->mJumpTable = mJumpTable;
601 mParserData->mJumpTableSize = mJumpTableSize;
602
603 mAlloc = &mParserData->mAlloc;
604 mAlloc->mSourceData = mSourceData;
605}
606
607void BfParser::NewLine()
608{

Callers 7

AddErrorNodeMethod · 0.45
ParseInlineBlockMethod · 0.45
HandlePreprocessorMethod · 0.45
NextTokenMethod · 0.45
ParseBlockMethod · 0.45
CreateNodeMethod · 0.45
ParseMethod · 0.45

Calls 2

InitFileDataMethod · 0.80
c_strMethod · 0.45

Tested by

no test coverage detected