Ejemplo n.º 1
0
 public TotemContext(ScriptDomainManager manager, IDictionary<string, object> options)
     : base(manager)
 {
     // TODO: parse options
     // TODO: register event: manager.AssemblyLoaded
     engine = new TotemEngine(manager.GetLoadedAssemblyList(), manager.Globals);
 }
Ejemplo n.º 2
0
 public TotemScriptCode(
     TotemEngine engine,
     LightExpression<Func<TotemEngine, IDynamicMetaObjectProvider, object>> lambda,
     SourceUnit sourceUnit)
     : base(sourceUnit)
 {
     this.lambda = lambda;
     this.engine = engine;
 }
Ejemplo n.º 3
0
 public TotemConvertBinder(TotemEngine engine, Type type, bool @explicit)
     : base(type.IsValueType ? typeof(object) : type, @explicit)
 {
     this.realType = type;
     this.engine = engine;
     this.conversions = new List<KeyValuePair<Type, Convert>>();
     if (type == typeof(bool) && !@explicit)
         RegisterBoolImplicit();
     else if (type == typeof(bool))
         RegisterBoolExplicit();
 }
Ejemplo n.º 4
0
        public TotemUnaryOperationBinder(TotemEngine engine, ExpressionType op)
            : base(op)
        {
            this.unops = new Dictionary<Type, UnaryOperation>();
            this.engine = engine;

            switch (op)
            {
                case ExpressionType.Negate:
                    RegisterNegate();
                    break;

                case ExpressionType.Increment:
                    RegisterIncrement();
                    break;
            }
        }
        public TotemBinaryOperationBinder(TotemEngine engine, ExpressionType op)
            : base(op)
        {
            binops = new Dictionary<TypePair, BinaryOperation>();
            this.engine = engine;
            switch (op)
            {
                case ExpressionType.Add:
                    BindAdd();
                    break;

                case ExpressionType.Subtract:
                    BindSubtract();
                    break;

                case ExpressionType.Multiply:
                    BindMultiply();
                    break;

                case ExpressionType.Divide:
                    BindDivide();
                    break;

                case ExpressionType.Modulo:
                    BindModulo();
                    break;

                case ExpressionType.LessThan:
                    BindLessThan();
                    break;

                case ExpressionType.GreaterThan:
                    BindGreaterThan();
                    break;
            }
        }
Ejemplo n.º 6
0
 public TotemGetMemberBinder(TotemEngine engine, string name)
     : base(name, false)
 {
     this.engine = engine;
 }
Ejemplo n.º 7
0
 public TotemInvokeBinder(TotemEngine engine, CallInfo info)
     : base(info)
 {
 }
Ejemplo n.º 8
0
 public TotemGetIndexBinder(TotemEngine engine, CallInfo info)
     : base(info)
 {
     this.engine = engine;
 }
Ejemplo n.º 9
0
 private AstGenerator(AnalysisScope.TopLevel global)
 {
     this.global = global;
     this.engine = global.Engine;
     this.scope = this.function = new AnalysisScope.Function(global, "module", true);
 }