blob: 7bb84faef4121ca5febfe8a67fba5e0e42c4c26a [file] [log] [blame]
#include "AstNode.h"
AstNode::AstNode(QString function, QList<AstNode> args)
{
_type = FUNC;
_stringVal = function;
_listVal = args;
}
QList<AstNode> AstNode::funcArgs()
{
return _listVal;
}
bool AstNode::isFunc() const
{
return _type == FUNC;
}
AstNode::operator QString() const
{
if (isFunc())
{
QStringList args;
for (const AstNode &node : _listVal)
{
args.append(static_cast<QString>(node));
}
return "<" + _stringVal + " " + args.join(" ") + ">";
}
return TokenBase<AstNode>::operator QString();
}