Interpreter prototype alpha
c++ interpreter for make believe language
 
Loading...
Searching...
No Matches

◆ getCorrectUnaryType()

std::shared_ptr< tokenNode > parser::getCorrectUnaryType ( std::shared_ptr< NumberNode > &  numbernode,
const std::shared_ptr< OperatorNode > &  operatornode,
const std::string &  operationtype,
const std::string &  nodetype 
)
private

creates a unary for a factor eg: -(<factor>) or +(<factor>)

Parameters
numbernodefactor to attach unary to (may be null if operatornode is not null) eg -(5)
operatornodeexpression to attach unary to (may be null if numbernode is not null) eg -(5 + 3)
operationtypeunary type whether - or +
nodetypenode type of the unary whether it is an expression or factor
Returns
std::shared_ptr<tokenNode>