public SLBinaryExpr(BinaryOp op, ISLExpr lhs, ISLExpr rhs) { Operation = op; CustomOperation = null; Left = Exceptions.ThrowOnNull(lhs, nameof(lhs)); Right = Exceptions.ThrowOnNull(rhs, nameof(rhs)); }
public SLBinding(SLSubscriptExpr sub, ISLExpr value) { Name = null; Subscript = Exceptions.ThrowOnNull(sub, nameof(sub)); Value = value; TypeAnnotation = null; }
public SLBinaryExpr(string op, ISLExpr lhs, ISLExpr rhs) { CustomOperation = Exceptions.ThrowOnNull(op, nameof(op)); Operation = BinaryOp.None; Left = Exceptions.ThrowOnNull(lhs, nameof(lhs)); Right = Exceptions.ThrowOnNull(rhs, nameof(rhs)); }
void BindToValue(bool isLet, SLType type, ISLExpr value, Visibility vis) { SLLine line = isLet ? SLDeclaration.LetLine("foo", type, value, vis) : SLDeclaration.VarLine("foo", type, value, vis); string code = CodeWriter.WriteToString(line); Compiler.CompileStringUsing(null, XCodeCompiler.SwiftcCustom, code, null); }
public SLLine(ISLExpr contents) { Contents = Exceptions.ThrowOnNull(contents, nameof(contents)); if (!(contents is ISLLineable)) { throw new ArgumentException("contents must be ILineable", nameof(contents)); } }
public SLSwitch(ISLExpr switchOn, IEnumerable <SLCase> cases) { Cases = new List <SLCase> (); if (cases != null) { Cases.AddRange(cases); } SwitchOn = switchOn; }
public SLLine(ISLExpr contents, bool addSemicolon = true) { Contents = Exceptions.ThrowOnNull(contents, nameof(contents)); if (!(contents is ISLLineable) && addSemicolon) { throw new ArgumentException("contents must be ISLineable and require a semicolon", nameof(contents)); } AddSemicolon = addSemicolon; }
public SLLetMatch(SLIdentifier name, ISLExpr expr) { Name = Exceptions.ThrowOnNull(name, nameof(name)); Expr = expr; }
public SLBinding(SLIdentifier id, ISLExpr value, SLType typeAnnotation = null) { Name = Exceptions.ThrowOnNull(id, nameof(id)); Value = value; TypeAnnotation = typeAnnotation; }
public SLBinding(string id, ISLExpr value, SLType typeAnnotation = null) : this(new SLIdentifier(id), value, typeAnnotation) { }
public SLDeclaration(bool isLet, SLIdentifier name, SLType typeAnnotation = null, ISLExpr value = null, Visibility vis = Visibility.Private, bool isStatic = false) : this(isLet, new SLBinding(name, value, typeAnnotation), vis, isStatic) { }
public static SLLine VarLine(string name, SLType typeAnnotation, ISLExpr value = null, Visibility vis = Visibility.Private, bool isStatic = false) { return(new SLLine(new SLDeclaration(false, name, typeAnnotation, value, vis, isStatic))); }
public static SLLine LetLine(SLIdentifier name, SLType typeAnnotation, ISLExpr value = null, Visibility vis = Visibility.Private, bool isStatic = false) { return(new SLLine(new SLDeclaration(true, name, typeAnnotation, value, vis, isStatic))); }
public static SLLine ReturnLine(ISLExpr expr) { return(new SLLine(new SLReturn(expr))); }
public SLUnaryExpr(string op, ISLExpr expr, bool isPrefix) { Operation = Exceptions.ThrowOnNull(op, nameof(op)); Expr = Exceptions.ThrowOnNull(expr, nameof(expr)); IsPrefix = isPrefix; }
public SLReturn(ISLExpr expr) { Value = expr; }
public SLDeclaration(bool isLet, string name, SLType typeAnnotation = null, ISLExpr value = null, Visibility vis = Visibility.Private, bool isStatic = false) : this(isLet, new SLIdentifier(Exceptions.ThrowOnNull(name, nameof(name))), typeAnnotation, value, vis, isStatic) { }