}
@Override
public void emitIf(IIfNode node)
{
IConditionalNode conditional = (IConditionalNode) node.getChild(0);
IContainerNode xnode = (IContainerNode) conditional
.getStatementContentsNode();
writeToken(ASEmitterTokens.IF);
//write(SPACE);
write(ASEmitterTokens.PAREN_OPEN);
getWalker().walk(conditional.getChild(0)); // conditional expression
write(ASEmitterTokens.PAREN_CLOSE);
if (!isImplicit(xnode))
write(ASEmitterTokens.SPACE);
getWalker().walk(conditional.getChild(1)); // BlockNode
IConditionalNode[] nodes = node.getElseIfNodes();
if (nodes.length > 0)
{
for (int i = 0; i < nodes.length; i++)
{
IConditionalNode enode = nodes[i];
IContainerNode snode = (IContainerNode) enode
.getStatementContentsNode();
final boolean isImplicit = isImplicit(snode);
if (isImplicit)
writeNewline();
else
write(ASEmitterTokens.SPACE);
writeToken(ASEmitterTokens.ELSE);
writeToken(ASEmitterTokens.IF);
write(ASEmitterTokens.PAREN_OPEN);
getWalker().walk(enode.getChild(0));
write(ASEmitterTokens.PAREN_CLOSE);
if (!isImplicit)
write(ASEmitterTokens.SPACE);
getWalker().walk(enode.getChild(1)); // ConditionalNode
}
}
ITerminalNode elseNode = node.getElseNode();
if (elseNode != null)