public void Write(ICodeFragment fragment, IOutputCache output) { WhileTemplate template = (WhileTemplate)fragment; output.Add("while (") .Add(template.Condition) .Add(")") .StartBlock() .Add(template.Code) .EndBlock(); }
public void ObserveWhileStatement(VHDLCompilerInterface compiler, WhileStatement statement) { string Condition = VHDLOperandGenerator.GetOperand(statement.Condition, compiler); List <string> Statements = new List <string>(); foreach (var st in statement.Statements) { Statements.Add(GetSequentialCode(compiler, st)); } WhileTemplate template = new WhileTemplate(Condition, Statements); code = template.TransformText(); }
public static WhileTemplate WithCode(this WhileTemplate template, ICodeFragment code) { template.Code.AddLine(code); return(template); }