public static Control Create( Declaration Declaration, ControlBlockType BlockType, Func<List<Ast.Node>, Ast.Node, Ast.Node> TransformationFunction) { return new Control { DeclarationTerms = Declaration.Terms, TransformationFunction = TransformationFunction, BlockType = BlockType }; }
public static string GetKeyWord(this ControlBlockType type) { switch (type) { case ControlBlockType.If: return("if"); case ControlBlockType.ElseIf: return("else if"); case ControlBlockType.Else: return("else"); case ControlBlockType.While: return("while"); case ControlBlockType.For: return("for"); default: return(""); } }
public ControlBlock(ControlBlockType type, Expression expr, IEnumerable <ILineObject> body) : base(new MultipartWritable(new StringWritable(type.GetKeyWord() + " ("), expr, new StringWritable(")")), body) { }
public ControlBlock(ControlBlockType type, string expr, IEnumerable <ILineObject> body) : base(new StringWritable(type.GetKeyWord() + (expr == null ? "" : " (" + expr + ")")), body) { }
public ControlBlock(ControlBlockType type, IEnumerable <ILineObject> body) : base(new StringWritable(type.GetKeyWord()), body) { }