Esempio n. 1
0
        public override FieldInfo Compile(LoadClasses load, Scop scop, Tree tree)
        {
            var method = new MethodInfo {
                Return        = load.ByteCodeMapper.Finder.GetClass(load.ByteCodeMapper.CurrentScop.Root, tree[0].Content),
                Parent        = scop,
                IsConstructor = true,
            };

            scop.Scops.Add(method);
            if (method.Return == null || !method.Return.Finalized)
            {
                throw new BadImageFormatException();
            }
            method.Name = tree[0].Content;
            load.ByteCodeMapper.OpenScop(method);
            var param = tree[1].Children;

            foreach (var pr in param)
            {
                pr.GeneratedBy.Compile(load, method, pr);
                method.AddParam((FieldInfo)pr.Membre);
            }
            return(tree[2].GeneratedBy.Compile(load, method, tree[2]));
        }