public override CompiledFragment Compile(CompiledMethod method)
        {
            CompiledFragment cfrag = MethodName.Compile(method);

            if (!Types.IsTypeOf(cfrag.ActiveValue(), typeof(ISettable)))
            {
                Error("Unable to compile a method call - didn't recognise an invokable object.");
            }
            CompiledFragment[] parameters = CompilationServices.CompileParameters(Brackets, method);
            return(new MethodOperation(method, cfrag, parameters));
        }
Exemplo n.º 2
0
        public IfOperation(CompiledMethod method, BracketFragment condition, BracketFragment ifTrue, BracketFragment ifFalse) : base(method)
        {
            IfTrue  = ifTrue;
            IfFalse = ifFalse;

            Conditions = CompilationServices.CompileParameters(condition, method);

            if (Conditions == null || Conditions.Length == 0)
            {
                Error("An if was defined but with nothing to check (e.g. if(this is empty!){..} )");
            }
        }
Exemplo n.º 3
0
 public ConstructOperation(TypeFragment type, BracketFragment brackets, CompiledMethod method) : base(method)
 {
     if (type == null)
     {
         Error("A constructor is missing the type to construct. E.g. new myClass();");
     }
     ObjectType = type.FindType(method.Script);
     if (ObjectType == null)
     {
         Error("Couldn't find type '" + type + "'.");
     }
     // Compile the brackets - what types to they have?
     Parameters = CompilationServices.CompileParameters(brackets, method);
     SetConstructor();
 }
Exemplo n.º 4
0
 public override CompiledFragment Compile(CompiledMethod parent)
 {
     return(new ArrayOperation(parent, ArrayType.FindType(parent.Script), null, CompilationServices.CompileParameters(Defaults, parent)));
 }
Exemplo n.º 5
0
 public override CompiledFragment Compile(CompiledMethod parentBlock)
 {
     return(new IndexOperation(parentBlock, Variable.Compile(parentBlock), CompilationServices.CompileParameters(Brackets, parentBlock)));
 }
Exemplo n.º 6
0
 public ForOperation(CompiledMethod method, BracketFragment rules, BracketFragment body) : base(method)
 {
     Body       = body;
     Parameters = CompilationServices.CompileParameters(rules, method);
 }