MCPcopy Create free account
hub / github.com/carbonengine/trinity / NewBinaryExpression

Function NewBinaryExpression

shadercompiler/ParserUtils.cpp:1110–1123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1108}
1109
1110ASTNode* NewBinaryExpression( ParserState& state, int op, ASTNode* left, ASTNode* right )
1111{
1112 auto expr = state.NewNode( NT_EXPRESSION, ScannerToken::FromTokenType( op ) );
1113 expr->AddChild( left );
1114 expr->AddChild( right );
1115 Type type;
1116 if( !GetCommonType( left->GetType(), right->GetType(), type ) )
1117 {
1118 state.ShowMessage( EC_TYPE_MISMATCH );
1119 type.FromTokenType( OP_VOID );
1120 }
1121 expr->SetType( type );
1122 return expr;
1123}
1124
1125ASTNode* NewConditionalExpression( ParserState& state, ASTNode* condition, ASTNode* trueExpr, ASTNode* falseExpr )
1126{

Callers 4

GatherSystemFieldsFunction · 0.85
GatherSystemInputsFunction · 0.85
PatchShaderFunction · 0.85
PatchRtShaderFunction · 0.85

Calls 7

GetCommonTypeFunction · 0.85
NewNodeMethod · 0.80
AddChildMethod · 0.80
ShowMessageMethod · 0.80
GetTypeMethod · 0.45
FromTokenTypeMethod · 0.45
SetTypeMethod · 0.45

Tested by

no test coverage detected