Example #1
0
        static ITypeTable LoadBuiltinTypes()
        {
            var types = new TypeTable();

            for (int i = 1; i <= 32; i++)
            {
                types.Define("int" + i, new IntType(i, false));
                types.Define("uint" + i, new IntType(i, true));
            }
            for (int i = 16; i <= 32; i += 8)
            {
                types.Define("float" + i, new FloatType(i));
            }
            for (int i = 2; i <= 16; i++)
            {
                types.Define("vec" + i, new VecType(i));
            }

            types.Define("bool", new BoolType());
            types.Define("string", new StringType());
            types.Define("led", new LedType());

            types.Define("bit", types.Lookup("uint1"));
            types.Define("byte", types.Lookup("uint8"));
            types.Define("int", types.Lookup("int32"));
            types.Define("float", types.Lookup("float32"));
            return(types);
        }