Esempio n. 1
0
        public Variable(Type type)
        {
            Type = type;

            Index = -1;
            Name = string.Empty;
        }
Esempio n. 2
0
        public static Type Find(Type c, List<Package> importedPackages)
        {
            if (c == null) return null;
            if (c.Primitive) return c;

            var array = c as Array;
            if (array != null)
            {
                return new Array(Find(array.ArrayType, importedPackages));
            }
            if (c is PlaceholderType)
            {
                var result = Find(c.Name, importedPackages);

                return result;
            }

            return c;
        }
        private OpCodeValue CompileRelation(ByteCodeGenerator generator, Type type)
        {
            switch (TypeCodeHelper.Truncate(type))
            {
                case ItemTypeCode.Int:
                    return CompileInt(generator);
                case ItemTypeCode.Long:
                    CompileLong(generator);
                    break;
                case ItemTypeCode.Float:
                    CompileFloat(generator);
                    break;
                case ItemTypeCode.Double:
                    CompileDouble(generator);
                    break;
                default:
                    throw new NotImplementedException();
            }

            if (node is RelationNode.LessThanEqNode)
            {
                return OpCodeValue.ifle;
            }
            if (node is RelationNode.GreaterThanEqNode)
            {
                return OpCodeValue.ifge;
            }
            if (node is RelationNode.LessThanNode)
            {
                return OpCodeValue.iflt;
            }
            if (node is RelationNode.GreaterThanNode)
            {
                return OpCodeValue.ifgt;
            }

            throw new NotImplementedException();
        }
Esempio n. 4
0
 public IndexedItem(ByteCodeGenerator generator, Type type)
     : base(generator, type)
 {
 }
Esempio n. 5
0
 public static void Add(Type c, List<Package> importedPackages)
 {
     CachedClasses.Add(GetCacheKey(c.Name, ProcessImports(importedPackages)), c);
 }
Esempio n. 6
0
 public bool IsAssignableTo(Type c)
 {
     throw new NotImplementedException();
 }
Esempio n. 7
0
 public bool CanAssign(Type c)
 {
     throw new NotImplementedException();
 }
Esempio n. 8
0
 internal Variable(short index, string name, Type type)
 {
     Index = index;
     Name = name;
     Type = type;
 }