Пример #1
0
        public string Visit(Program node)
        {
            Types_Cool = IType.GetAllTypes(node);

            foreach (var key in Types_Cool.Keys)
            {
                IType         type  = Types_Cool[key];
                List <string> attrs = new List <string>();
                List <Tuple <string, string> > mtds = new List <Tuple <string, string> >();

                foreach (var attr in type.AllAttributes())
                {
                    attrs.Add(attr.Name);
                }

                foreach (var mtd in type.AllMethods())
                {
                    string mtd_name = mtd.Name + "_" + key;
                    mtds.Add(new Tuple <string, string>(mtd.Name, mtd_name));
                }

                Types[key] = new CIL_OneType(key, attrs, mtds);
            }

            foreach (var item in node.list)
            {
                item.Visit(this);
            }
            return("");
        }