public void Serialize(BinaryWriter writer, CSWCSerizlizer serizlizer)
        {
            /// <summary>
            /// 参数名
            /// </summary>
            //public string name;
            writer.Write(name);
            ///// <summary>
            ///// 参数类型
            ///// </summary>
            //public RunTimeDataType type;
            writer.Write(type);
            ///// <summary>
            ///// 默认值
            ///// </summary>
            //public RightValueBase defaultValue;
            serizlizer.SerializeObject(writer, defaultValue);
            ///// <summary>
            ///// 是否是参数数组
            ///// </summary>
            //public bool isPara;
            writer.Write(isPara);


            ///// <summary>
            ///// 是否通过栈来传递
            ///// </summary>
            //public bool isOnStack;
            writer.Write(isOnStack);
            //public LeftValueBase varorreg;
            serizlizer.SerializeObject(writer, varorreg);
        }
Пример #2
0
        public virtual void Serialize(BinaryWriter writer, CSWCSerizlizer serizlizer)
        {
            serizlizer.SerializeObject(writer, (ScopeBase)_parent);

            writer.Write(memberlist.Count);
            for (int i = 0; i < memberlist.Count; i++)
            {
                //((ISWCSerializable)memberlist[i]).Serialize(writer, serizlizer);
                serizlizer.SerializeObject(writer, (ISWCSerializable)memberlist[i]);
            }
        }
Пример #3
0
		public void Serialize(BinaryWriter writer, CSWCSerizlizer serizlizer)
		{
			//public List<FunctionParameter> parameters;
			writer.Write(parameters.Count);
			for (int i = 0; i < parameters.Count; i++)
			{
				serizlizer.SerializeObject(writer, parameters[i]);
			}

			//public RunTimeDataType returnType;
			writer.Write(returnType);
			//public int onStackParameters;
			writer.Write(onStackParameters);
		}
        public void Serialize(BinaryWriter writer, CSWCSerizlizer serizlizer)
        {
            //public readonly int functionid;
            writer.Write(functionid);
            //	public bool IsAnonymous;
            writer.Write(IsAnonymous);
            //public string name;
            writer.Write(name);
            //public bool isMethod;
            writer.Write(isMethod);
            //public bool isStatic;
            writer.Write(isStatic);
            //public bool isConstructor;
            writer.Write(isConstructor);

            //public int blockid;
            writer.Write(blockid);

            ///// <summary>
            ///// 是否本地函数
            ///// </summary>
            //public bool isNative;
            writer.Write(isNative);
            //public string native_name;
            if (native_name == null)
            {
                writer.Write(false);
            }
            else
            {
                writer.Write(true);
                writer.Write(native_name);
            }
            //public int native_index;
            writer.Write(native_index);
            ///// <summary>
            ///// 是否为yield返回
            ///// </summary>
            //public bool isYield;
            writer.Write(isYield);
            //public FunctionSignature signature;

            serizlizer.SerializeObject(writer, signature);
        }
Пример #5
0
 public override void Serialize(BinaryWriter writer, CSWCSerizlizer serizlizer)
 {
     writer.Write("FunctionScope");
     serizlizer.SerializeObject(writer, function);
     base.Serialize(writer, serizlizer);
 }
Пример #6
0
        public void Serialize(BinaryWriter writer, CSWCSerizlizer serizlizer)
        {
            ///// <summary>
            ///// 成员名
            ///// </summary>
            //public string name;
            writer.Write(name);

            serizlizer.SerializeObject(writer, refClass);

            //public readonly IMember bindField;
            serizlizer.SerializeObject(writer, bindField);


            //public bool isPublic;
            writer.Write(isPublic);
            //public bool isInternal;
            writer.Write(isInternal);
            //public bool isPrivate;
            writer.Write(isPrivate);
            //public bool isProtectd;
            writer.Write(isProtectd);

            ///// <summary>
            ///// 是否属性读取器
            ///// </summary>
            //public bool isGetter;
            writer.Write(isGetter);
            ///// <summary>
            ///// 是否属性设置器
            ///// </summary>
            //public bool isSetter;
            writer.Write(isSetter);

            ///// <summary>
            ///// 是否覆盖基类方法
            ///// </summary>
            //public bool isOverride;
            writer.Write(isOverride);

            //public bool isFinal;
            writer.Write(isFinal);

            ///// <summary>
            ///// 是否是静态成员
            ///// </summary>
            //public bool isStatic;
            writer.Write(isStatic);
            ///// <summary>
            ///// 是否是常量
            ///// </summary>
            //public bool isConst;
            writer.Write(isConst);
            ///// <summary>
            ///// 是否是构造函数
            ///// </summary>
            //public bool isConstructor;
            writer.Write(isConstructor);

            ///// <summary>
            ///// 成员字面值,比如1000,"aabc"等确定的字面值
            ///// </summary>
            //public RunTimeValueBase defaultValue;
            serizlizer.SerializeObject(writer, defaultValue);

            ///// <summary>
            ///// 从哪个类继承而来
            ///// </summary>
            //public Class inheritFrom;
            serizlizer.SerializeObject(writer, inheritFrom);

            ///// <summary>
            ///// 继承源
            ///// </summary>
            //public ClassMember inheritSrcMember;
            serizlizer.SerializeObject(writer, inheritSrcMember);

            //public ClassMember virtualLink;
            serizlizer.SerializeObject(writer, virtualLink);
            //public Class virtualLinkFromClass;
            //serizlizer.SerializeObject(writer, virtualLinkFromClass);

            //serizlizer.SerializeObject(writer, overridedMember);

            //private RunTimeDataType _type;
            writer.Write((int)_type);
        }
Пример #7
0
 public override void Serialize(BinaryWriter writer, CSWCSerizlizer serizlizer)
 {
     writer.Write("ObjectInstanceScope");
     serizlizer.SerializeObject(writer, _class);
     base.Serialize(writer, serizlizer);
 }
Пример #8
0
 public override void Serialize(BinaryWriter writer, CSWCSerizlizer serizlizer)
 {
     writer.Write(6);
     base.Serialize(writer, serizlizer);
     serizlizer.SerializeObject(writer, value);
 }
Пример #9
0
        public void Serialize(BinaryWriter writer, CSWCSerizlizer serizlizer)
        {
            //	/// <summary>
            //	/// 指明这是否是一个接口定义
            //	/// </summary>
            //public bool isInterface;
            writer.Write(isInterface);
            ///// <summary>
            ///// 指明这是否是一个包级函数
            ///// </summary>
            //public bool isPackageFunction;
            writer.Write(isPackageFunction);
            ///// <summary>
            ///// 是否文档类
            ///// </summary>
            //public bool isdocumentclass;
            writer.Write(isdocumentclass);
            ///// <summary>
            ///// 是否是需要非托管类
            ///// </summary>
            //public bool isUnmanaged;
            writer.Write(isUnmanaged);
            ///// <summary>
            ///// 链接到的系统对象是否是一个结构体
            ///// </summary>
            //public bool isStruct;
            writer.Write(isStruct);
            ///// <summary>
            ///// 结构体排序序号(从1开始排起)
            ///// </summary>
            //public int structIndex;
            writer.Write(structIndex);
            ///// <summary>
            ///// 是否链接到系统对象
            ///// </summary>
            //public bool isLink_System;
            writer.Write(isLink_System);


            writer.Write(isCrossExtend);

            //public readonly string md5key;
            writer.Write(md5key);
            //public readonly int classid;
            writer.Write(classid);

            //	/// <summary>
            //	/// 类定义代码所在blockid
            //	/// </summary>
            //public readonly int blockid;
            writer.Write(blockid);

            ///// <summary>
            ///// 系统对象创建器
            ///// </summary>
            //public ClassMember linkObjCreator;
            serizlizer.SerializeObject <ClassMember>(writer, linkObjCreator);

            serizlizer.SerializeObject <ClassMember>(writer, crossExtendAdapterCreator);

            ///// <summary>
            ///// 是否已编译成功
            ///// </summary>
            //public bool isbuildSuccess;
            writer.Write(isbuildSuccess);
            ///// <summary>
            ///// 是否不可实例化
            ///// </summary>
            //public bool no_constructor;
            writer.Write(no_constructor);

            ///// <summary>
            ///// 包外代码所在blockid;
            ///// </summary>
            //public int outscopeblockid;
            writer.Write(outscopeblockid);

            ///// <summary>
            ///// 类名
            ///// </summary>
            //public string name;
            writer.Write(name);
            //public string package;
            writer.Write(package);
            //public bool dynamic;
            writer.Write(dynamic);
            //public bool final;
            writer.Write(final);



            ///// <summary>
            ///// 是否公开。如果不是,则只能在相同包内访问
            ///// </summary>
            //public bool isPublic;
            writer.Write(isPublic);
            ///// <summary>
            ///// 包含此类的静态成员。
            ///// </summary>
            //public Class staticClass;
            serizlizer.SerializeObject(writer, staticClass);
            ///// <summary>
            ///// 如果是静态成员类,则指向类的定义
            ///// </summary>
            //public Class instanceClass;
            serizlizer.SerializeObject(writer, instanceClass);
            ///// <summary>
            ///// 是否包外类
            ///// </summary>
            //public bool ispackageout;
            writer.Write(ispackageout);
            ///// <summary>
            ///// 如果是包外类,则显示所从属的主类
            ///// </summary>
            //public Class mainClass;
            serizlizer.SerializeObject(writer, mainClass);
            ///// <summary>
            ///// 构造函数
            ///// </summary>
            //public ClassMember constructor;
            serizlizer.SerializeObject(writer, constructor);
            ///// <summary>
            ///// 构造函数id
            ///// </summary>
            //public int constructor_functionid;
            writer.Write(constructor_functionid);
            ///// <summary>
            ///// 隐式类型转换到原始类型函数
            ///// </summary>
            //public ClassMember implicit_to;
            serizlizer.SerializeObject(writer, implicit_to);
            //public RunTimeDataType implicit_to_type;
            writer.Write((int)implicit_to_type);
            //public int implicit_to_functionid;
            writer.Write((int)implicit_to_functionid);

            ///// <summary>
            ///// 隐式从原始类型转换过来
            ///// </summary>
            //public ClassMember implicit_from;
            serizlizer.SerializeObject(writer, implicit_from);
            //public int implicit_from_functionid;
            writer.Write(implicit_from_functionid);
            //public RunTimeDataType implicit_from_type;
            writer.Write((int)implicit_from_type);

            ///// <summary>
            ///// 显式类型转换
            ///// </summary>
            //public ClassMember explicit_from;
            serizlizer.SerializeObject(writer, explicit_from);
            //public int explicit_from_functionid;
            writer.Write(explicit_from_functionid);
            //public RunTimeDataType explicit_from_type;
            writer.Write((int)explicit_from_type);

            ///// <summary>
            ///// 索引器 取值
            ///// </summary>
            //public ClassMember get_this_item;
            serizlizer.SerializeObject(writer, get_this_item);

            ///// <summary>
            ///// 索引器 赋值
            ///// </summary>
            //public ClassMember set_this_item;
            serizlizer.SerializeObject(writer, set_this_item);

            ///// <summary>
            ///// 类成员定义
            ///// </summary>
            //public ClassMemberList classMembers;
            writer.Write(classMembers.Count);
            for (int i = 0; i < classMembers.Count; i++)
            {
                serizlizer.SerializeObject(writer, classMembers[i]);
            }

            ///// <summary>
            ///// 数据字段表
            ///// </summary>
            //public List<ClassMember> fields;
            writer.Write(fields.Count);
            for (int i = 0; i < fields.Count; i++)
            {
                serizlizer.SerializeObject(writer, fields[i]);
            }

            ///// <summary>
            ///// 父类的定义(如果有)
            ///// </summary>
            //public Class super;
            serizlizer.SerializeObject(writer, super);

            ///// <summary>
            ///// 实现的各种接口
            ///// 记录了接口的一个方法对应类的哪个成员实现
            ///// </summary>
            //public Dictionary<Class, int[]> implements;

            if (!isInterface)
            {
                writer.Write(implements.Count);
                foreach (var item in implements)
                {
                    serizlizer.SerializeObject(writer, item.Key);
                    writer.Write(item.Value.Length);
                    for (int i = 0; i < item.Value.Length; i++)
                    {
                        writer.Write(item.Value[i]);
                    }
                }
            }
            else
            {
                writer.Write(0);
            }
        }
Пример #10
0
 public override void Serialize(BinaryWriter writer, CSWCSerizlizer serizlizer)
 {
     writer.Write("OutPackageMemberScope");
     serizlizer.SerializeObject(writer, mainclass);
     base.Serialize(writer, serizlizer);
 }