public Class(string name, List<Method> methods, List<Variant> fields, Class cBase) { Module = null; Name = name; Methods = methods; Fields = fields; Base = cBase; }
public Class(Class classHandle) { Module = null; Name = classHandle.Name; Methods = classHandle.Methods; Fields = classHandle.Fields; Base = classHandle.Base; }
internal Class(string name, Class cBase) { Module = null; Methods = new List<Method>(); FieldsCompiler = new Dictionary<string, Variant>(); Fields = new List<Variant>(); Base = cBase; Name = name; }
private void WriteModule(Module module, BinaryWriter stream) { stream.Write(module.Name); stream.Write((ushort)module.Fields.Count); WriteMethod(module.Body, stream); stream.Write(module.Classes.Count); foreach (Class cClass in module.Classes) WriteClass(cClass, stream); stream.Write(module.Methods.Count); foreach (Method method in module.Methods) WriteMethod(method, stream); }
private Module ReadModule(BinaryReader stream) { string name = stream.ReadString(); Module module = new Module(name); ushort fieldCount = stream.ReadUInt16(); for (ushort i = 0; i < fieldCount; ++i) module.Fields.Add(new Variant()); module.Body = ReadMethod(stream); uint classCount = stream.ReadUInt32(); while(classCount-- != 0) module.Classes.Add(ReadClass(stream)); uint methodCount = stream.ReadUInt32(); while(methodCount-- != 0) module.Methods.Add(ReadMethod(stream)); return module; }
void AddModule(string name) { foreach (Module m in Modules) if (m.Name == name) Stream.Error("Module \"{0}\" already declared previously.", m.Name); Module module = new Module(name); moduleStack.Push(module); Modules.Add(module); }