public override void Assembly(Assembler asm) { asm.Begin(this); asm.AddToken("IF"); asm.AddSpace(); asm.Add(Condition); asm.AddSpace(); asm.AddToken("THEN"); asm.AddSpace(); asm.IncreaseIndentation(); asm.NewLine(); asm.Add(TrueStatement); asm.DecreaseIndentation(); if (FalseStatement.Count() != 0) { asm.NewLine(); asm.AddToken("ELSE"); asm.AddSpace(); asm.IncreaseIndentation(); asm.NewLine(); } // This is needed in order to process comments after FalseStatement. asm.Add(FalseStatement); if (FalseStatement.Count() != 0) { asm.DecreaseIndentation(); } asm.NewLine(); asm.AddToken("END IF"); asm.End(this); }
public override void Assembly(Assembler asm) { asm.Begin(this); asm.AddToken("WHILE"); asm.AddSpace(); asm.Add(Condition); asm.AddSpace(); asm.AddToken("DO"); asm.AddSpace(); asm.IncreaseIndentation(); asm.NewLine(); asm.Add(Statement); asm.DecreaseIndentation(); asm.NewLine(); asm.AddToken("END WHILE"); asm.End(this); }
public override void Assembly(Assembler asm) { asm.Begin(this); if (Statements != null) { foreach (Statement stmt in Statements) { asm.Add(stmt); if (stmt != Statements.Last()) { asm.NewLine(); } } } asm.End(this); }
public override void Assembly(Assembler asm) { asm.Begin(this); asm.AddToken("SELECT"); asm.AddSpace(); foreach (SelectVariableItem item in Items) { asm.Add(item.Expression); if (item != Items.Last()) { asm.AddToken(", "); } } asm.AddSpace(); asm.AddToken("INTO"); asm.AddSpace(); foreach (SelectVariableItem item in Items) { asm.Add(item.Variable); if (item != Items.Last()) { asm.AddToken(", "); } } asm.AddSpace(); if (FromClause != null) { asm.AddToken("FROM"); asm.AddSpace(); foreach (TableSource table in FromClause) { asm.Add(table); if (table != FromClause.Last()) { asm.AddToken(","); asm.AddSpace(); asm.NewLine(); } } } else { asm.AddToken("FROM DUMMY"); } asm.End(this); }