public SLBinaryExpr(BinaryOp op, ISLExpr lhs, ISLExpr rhs)
 {
     Operation       = op;
     CustomOperation = null;
     Left            = Exceptions.ThrowOnNull(lhs, nameof(lhs));
     Right           = Exceptions.ThrowOnNull(rhs, nameof(rhs));
 }
Пример #2
0
 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));
 }
Пример #4
0
        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);
        }
Пример #5
0
 public SLLine(ISLExpr contents)
 {
     Contents = Exceptions.ThrowOnNull(contents, nameof(contents));
     if (!(contents is ISLLineable))
     {
         throw new ArgumentException("contents must be ILineable", nameof(contents));
     }
 }
Пример #6
0
 public SLSwitch(ISLExpr switchOn, IEnumerable <SLCase> cases)
 {
     Cases = new List <SLCase> ();
     if (cases != null)
     {
         Cases.AddRange(cases);
     }
     SwitchOn = switchOn;
 }
Пример #7
0
 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;
 }
Пример #8
0
 public SLLetMatch(SLIdentifier name, ISLExpr expr)
 {
     Name = Exceptions.ThrowOnNull(name, nameof(name));
     Expr = expr;
 }
Пример #9
0
 public SLBinding(SLIdentifier id, ISLExpr value, SLType typeAnnotation = null)
 {
     Name           = Exceptions.ThrowOnNull(id, nameof(id));
     Value          = value;
     TypeAnnotation = typeAnnotation;
 }
Пример #10
0
 public SLBinding(string id, ISLExpr value, SLType typeAnnotation = null)
     : this(new SLIdentifier(id), value, typeAnnotation)
 {
 }
Пример #11
0
 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)
 {
 }
Пример #12
0
 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)));
 }
Пример #13
0
 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)));
 }
Пример #14
0
 public static SLLine ReturnLine(ISLExpr expr)
 {
     return(new SLLine(new SLReturn(expr)));
 }
Пример #15
0
 public SLUnaryExpr(string op, ISLExpr expr, bool isPrefix)
 {
     Operation = Exceptions.ThrowOnNull(op, nameof(op));
     Expr      = Exceptions.ThrowOnNull(expr, nameof(expr));
     IsPrefix  = isPrefix;
 }
Пример #16
0
 public SLReturn(ISLExpr expr)
 {
     Value = expr;
 }
Пример #17
0
 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)
 {
 }