Пример #1
0
String SimpleUnaryOperation::code() const
{
	if (!haveOperand() || !m_symbolCache)
		return String::null;
	if (isPostfix())
		return parenthesise(operand()->code() + id().code());
	else
		return parenthesise(id().code() + operand()->code());
}
Пример #2
0
String SubscriptOperation::code() const
{
	if (!haveLeft() || !haveRight())
		return "";
	return parenthesise(left()->code() + "[" + right()->code() + "]");
}
Пример #3
0
String SimpleBinaryOperation::code() const
{
	if (!haveLeft() || !haveRight() || !m_symbolCache)
		return String::null;
	return parenthesise(left()->code() + " " + id().code() + " " + right()->code());
}