void ToStatement(ULStatementIf s) { AppendLine("if(" + s.arg + ")"); ToBody(s.trueBlock); AppendLine("else"); ToBody(s.falseBlock); }
void ExportStatement(IfStatementSyntax node) { var cond = ExportExp(node.Condition); var ifStatement = new ULStatementIf(); ifStatement.Parent = currentBlock; ifStatement.arg = cond.GetOutputName(0); if (node.Statement is BlockSyntax) { ifStatement.trueBlock = ExportStatement(node.Statement as BlockSyntax); } if (node.Else.Statement is BlockSyntax) { ifStatement.falseBlock = ExportStatement(node.Else.Statement as BlockSyntax); } currentBlock.statements.Add(ifStatement); }