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

Method CreateNode

IDEHelper/Compiler/BfParser.cpp:3784–3817  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3782}
3783
3784BfAstNode* BfParser::CreateNode()
3785{
3786 switch (mSyntaxToken)
3787 {
3788 case BfSyntaxToken_Token:
3789 {
3790 auto bfTokenNode = mAlloc->Alloc<BfTokenNode>();
3791 bfTokenNode->Init(this);
3792 bfTokenNode->SetToken(mToken);
3793 return bfTokenNode;
3794 }
3795 case BfSyntaxToken_Identifier:
3796 {
3797 //auto bfIdentifierNode = new BfIdentifierNode();
3798 auto bfIdentifierNode = mAlloc->Alloc<BfIdentifierNode>();
3799 bfIdentifierNode->Init(this);
3800 return bfIdentifierNode;
3801 }
3802 case BfSyntaxToken_Literal:
3803 {
3804 auto bfLiteralExpression = mAlloc->Alloc<BfLiteralExpression>();
3805 bfLiteralExpression->Init(this);
3806 bfLiteralExpression->mValue = mLiteral;
3807 mLiteral.mTypeCode = BfTypeCode_None;
3808 mLiteral.mWarnType = 0;
3809 return bfLiteralExpression;
3810 }
3811 case BfSyntaxToken_GeneratedNode:
3812 return mGeneratedNode;
3813 default: break;
3814 }
3815
3816 return NULL;
3817}
3818
3819void BfParser::Parse(BfPassInstance* passInstance)
3820{

Callers

nothing calls this directly

Calls 2

SetTokenMethod · 0.80
InitMethod · 0.45

Tested by

no test coverage detected