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)); }
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!){..} )"); } }
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(); }
public override CompiledFragment Compile(CompiledMethod parent) { return(new ArrayOperation(parent, ArrayType.FindType(parent.Script), null, CompilationServices.CompileParameters(Defaults, parent))); }
public override CompiledFragment Compile(CompiledMethod parentBlock) { return(new IndexOperation(parentBlock, Variable.Compile(parentBlock), CompilationServices.CompileParameters(Brackets, parentBlock))); }
public ForOperation(CompiledMethod method, BracketFragment rules, BracketFragment body) : base(method) { Body = body; Parameters = CompilationServices.CompileParameters(rules, method); }