mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-27 02:43:07 +00:00
38 lines
781 B
Java
38 lines
781 B
Java
class UnaryNode extends ExpressionNode {
|
|
|
|
UnaryNode(String aOp, ExpressionNode aChild)
|
|
{
|
|
child = aChild;
|
|
op = aOp;
|
|
}
|
|
|
|
String print(String indent)
|
|
{
|
|
StringBuffer result = new StringBuffer(indent);
|
|
result.append("UnaryNode ");
|
|
result.append(op);
|
|
result.append("\n");
|
|
indent += " ";
|
|
if (child == null) {
|
|
result.append(indent);
|
|
result.append("null\n");
|
|
}
|
|
else
|
|
result.append(child.print(indent));
|
|
return result.toString();
|
|
}
|
|
|
|
String getOperator()
|
|
{
|
|
return op;
|
|
}
|
|
|
|
ExpressionNode getChild()
|
|
{
|
|
return child;
|
|
}
|
|
|
|
protected ExpressionNode child;
|
|
protected String op;
|
|
|
|
} |