private void MakeCache() { EcmaState state = this.Constructor.State; List <string> args = new List <string>(); string[] p = this.P.Split(','); for (int i = 0; i < p.Length; i++) { args.Add(p[i].Trim()); } EcmaTokenizer tokenizer = new EcmaTokenizer(new StringReader(this.Body)); List <EcmaStatment> block = new List <EcmaStatment>(); while (tokenizer.Current().IsNot(TokenType.EOS)) { block.Add(state.GetProgroam(tokenizer)); } EcmaStatment statment = new EcmaStatment(EcmaStatmentType.Block); statment.Statments = block; this.Cached = new FunctionInstance(state, args.ToArray(), statment); }
public FunctionInstance(EcmaState state, string[] Args, EcmaStatment body) : this(state, Args.Length) { this.State = state; this.body = body; this.arg = Args; }