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

Method Parse

IDEHelper/Compiler/BfParser.cpp:3819–3871  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3817}
3818
3819void BfParser::Parse(BfPassInstance* passInstance)
3820{
3821 BP_ZONE_F("BfParser::Parse %s", mFileName.c_str());
3822
3823 mSyntaxToken = BfSyntaxToken_None;
3824 mPassInstance = passInstance;
3825
3826 int startIdx = mSrcIdx;
3827
3828 if (mUsingCache)
3829 {
3830 mRootNode = mParserData->mRootNode;
3831 mSidechannelRootNode = mParserData->mSidechannelRootNode;
3832 mErrorRootNode = mParserData->mErrorRootNode;
3833 return;
3834 }
3835
3836 mRootNode = mAlloc->Alloc<BfRootNode>();
3837 mRootNode->Init(this);
3838 mParserData->mRootNode = mRootNode;
3839
3840 mSidechannelRootNode = mAlloc->Alloc<BfRootNode>();
3841 mSidechannelRootNode->Init(this);
3842 mParserData->mSidechannelRootNode = mSidechannelRootNode;
3843
3844 mErrorRootNode = mAlloc->Alloc<BfRootNode>();
3845 mErrorRootNode->Init(this);
3846 mParserData->mErrorRootNode = mErrorRootNode;
3847
3848 ParseBlock(mRootNode, 0);
3849
3850 if (mPreprocessorNodeStack.size() > 0)
3851 {
3852 mPassInstance->Warn(0, "No matching #endif found", mPreprocessorNodeStack.back().first);
3853 }
3854
3855 if (mJumpTable != NULL)
3856 {
3857 for (int i = (startIdx / PARSER_JUMPTABLE_DIVIDE) + 1; i < mJumpTableSize; i++)
3858 if (mJumpTable[i].mCharIdx == 0)
3859 mJumpTable[i] = mJumpTable[i - 1];
3860 }
3861
3862 if (mPassInstance->HasFailed())
3863 mParsingFailed = true;
3864
3865 if ((mPassInstance->HasMessages()) || (mParsingFailed))
3866 {
3867 mParserData->mFailed = true; // Don't reuse cache if there were errors or warnings
3868 }
3869
3870 mPassInstance = NULL;
3871}
3872
3873int BfParser::GetCharIdAtIndex(int findIndex)
3874{

Callers 14

InitMethod · 0.45
EvaluateMethod · 0.45
EvaluateToAddressMethod · 0.45
CEEmitParseMethod · 0.45
GetTypeMethod · 0.45
GetReflectTypeMethod · 0.45
BfParser_ParseFunction · 0.45
InitMethod · 0.45
EvaluateMethod · 0.45

Calls 7

HasFailedMethod · 0.80
HasMessagesMethod · 0.80
c_strMethod · 0.45
InitMethod · 0.45
sizeMethod · 0.45
WarnMethod · 0.45
backMethod · 0.45

Tested by

no test coverage detected