protected EventVariable(ChelaModule module) : base(module) { this.flags = MemberFlags.Default; this.parentScope = null; this.associatedField = null; }
internal Method(ChelaModule module) : base(module) { this.vslot = -1; this.ctorLeaf = false; this.ctorParent = null; this.explicitContract = null; }
public override ScopeMember InstanceMember(ScopeMember factory, GenericInstance instance) { // Instance the instance. ChelaModule module = factory.GetModule(); GenericInstance newInstance = genericInstance.InstanceFrom(instance, module); // Instance the structure. return(template.InstanceMember(factory, newInstance)); }
public DebugEmitter(ChelaModule module) { this.module = module; this.functions = new List <Function> (); this.structures = new List <Structure> (); this.fields = new List <FieldVariable> (); this.registeredStrings = new Dictionary <string, uint> (); this.stringTable = new List <string> (); }
public FieldVariable(ChelaModule module) : base(module) { this.flags = MemberFlags.Default; this.slot = -1; this.initializer = null; this.parentScope = null; this.position = null; }
public TypeNameMember(ChelaModule module) : base(module) { this.name = string.Empty; this.parentScope = null; this.typedefNode = null; this.actualType = null; this.isExpanding = false; this.flags = MemberFlags.Default; }
internal static new void PreloadMember(ChelaModule module, ModuleReader reader, MemberHeader header) { // Create the temporal structure instance. StructureInstance instance = new StructureInstance(module); module.RegisterMember(instance); // Skip the structure elements. reader.Skip(header.memberSize); }
internal override void PrepareSerialization() { base.PrepareSerialization(); // Register the template and the factory. ChelaModule module = GetModule(); module.RegisterMember(template); module.RegisterMember(factory); }
public void Write(ModuleWriter writer, ChelaModule module) { // Write the type count. writer.Write((byte)parameters.Length); // Write the types. for (int i = 0; i < parameters.Length; ++i) { writer.Write((uint)module.RegisterType(parameters[i])); } }
public AstNode(TokenPosition position) { this.position = position; this.prev = this; this.next = null; this.attributes = null; this.name = null; this.module = null; this.nodeType = null; this.coercionType = null; this.nodeValue = null; }
public GenericInstance InstanceFrom(GenericInstance instance, ChelaModule module) { IChelaType[] instancedTypes = new IChelaType[placeHolders.Length]; for (int i = 0; i < placeHolders.Length; ++i) { instancedTypes[i] = placeHolders[i].InstanceGeneric(instance, module); } GenericInstance res = new GenericInstance(this, instancedTypes); return(res); }
public void Write(ModuleWriter writer, ChelaModule module) { // Write the placeholder count. writer.Write((byte)placeHolders.Length); // Write the placeholders. for (int i = 0; i < placeHolders.Length; ++i) { PlaceHolderType placeHolder = placeHolders[i]; writer.Write((uint)module.RegisterType(placeHolder)); } }
public void Write(ChelaModule module, ModuleWriter writer) { // Write the number of instructions. writer.Write((ushort)rawInstructionSize); writer.Write((ushort)instructions.Count); writer.Write((byte)(isUnsafe ? 1 : 0)); // Write the instructions. foreach (Instruction inst in instructions) { inst.Write(module, writer); } }
internal static void PreloadMember(ChelaModule module, ModuleReader reader, MemberHeader header) { // Create the temporal namespace and register it. Namespace space = new Namespace(module); module.RegisterMember(space); // Read the name. space.name = module.GetString(header.memberName); // Skip the namespace elements. reader.Skip(header.memberSize); }
internal static new void PreloadMember(ChelaModule module, ModuleReader reader, MemberHeader header) { // Create the temporal interface and register it. Interface iface = new Interface(module); module.RegisterMember(iface); // Read the name. iface.name = module.GetString(header.memberName); iface.flags = (MemberFlags)header.memberFlags; // Skip the class elements. reader.Skip(header.memberSize); }
public ChelaCompiler(ModuleType moduleType) { // Create the module node. moduleNode = new ModuleNode(null, null); moduleNode.SetName("global"); // Create the module. ChelaModule module = new ChelaModule(); moduleNode.SetModule(module); module.SetName("unnamed"); module.SetModuleType(moduleType); }
internal static void PreloadMember(ChelaModule module, ModuleReader reader, MemberHeader header) { // Create the temporal event and register it. TypeGroup tgroup = new TypeGroup(module); module.RegisterMember(tgroup); // Read the name. tgroup.name = module.GetString(header.memberName); // Skip the structure elements. reader.Skip(header.memberSize); }
internal static void PreloadMember(ChelaModule module, ModuleReader reader, MemberHeader header) { // Create the temporal event and register it. EventVariable ev = new EventVariable(module); module.RegisterMember(ev); // Read the name and flags. ev.SetName(module.GetString(header.memberName)); ev.flags = (MemberFlags)header.memberFlags; // Skip the structure elements. reader.Skip(header.memberSize); }
internal new static void PreloadMember(ChelaModule module, ModuleReader reader, MemberHeader header) { // Create the temporal interface and register it. Interface iface = new Interface(module); module.RegisterMember(iface); // Read the name. iface.name = module.GetString(header.memberName); iface.flags = (MemberFlags)header.memberFlags; // Skip the class elements. reader.Skip(header.memberSize); }
internal static void PreloadMember(ChelaModule module, ModuleReader reader, MemberHeader header) { // Create the temporal type name and register it. TypeNameMember typeName = new TypeNameMember(module); module.RegisterMember(typeName); // Read the name and flags. typeName.name = module.GetString(header.memberName); typeName.flags = (MemberFlags)header.memberFlags; // Skip the structure elements. reader.Skip(header.memberSize); }
internal new static void PreloadMember(ChelaModule module, ModuleReader reader, MemberHeader header) { // Create the temporal structure and register it. Class clazz = new Class(module); module.RegisterMember(clazz); // Read the name. clazz.name = module.GetString(header.memberName); clazz.flags = (MemberFlags)header.memberFlags; // Skip the class elements. reader.Skip(header.memberSize); }
internal static void PreloadMember(ChelaModule module, ModuleReader reader, MemberHeader header) { // Create the temporal field and register it. FieldVariable field = new FieldVariable(module); module.RegisterMember(field); // Read the name and flags. field.SetName(module.GetString(header.memberName)); field.flags = (MemberFlags)header.memberFlags; // Skip the structure elements. reader.Skip(header.memberSize); }
internal override void Read(ModuleReader reader, MemberHeader header) { // Get the module. ChelaModule module = GetModule(); // Read the type. type = module.GetType(reader.ReadUInt()); // Read the add modifier. addModifier = (Function)module.GetMember(reader.ReadUInt()); // Read the remove modifier. removeModifier = (Function)module.GetMember(reader.ReadUInt()); }
internal override void PrepareSerialization() { //base.PrepareSerialization (); PrepareSerializationNoBase(); // Register the template. ChelaModule module = GetModule(); module.RegisterMember(template); module.RegisterMember(factory); // Register the types used. genericInstance.PrepareSerialization(module); }
public ExceptionContext(ExceptionContext parentContext) { // Store parent-child relation. this.parentContext = parentContext; this.parentFunction = parentContext.parentFunction; parentContext.children.Add(this); module = parentFunction.GetModule(); // Initialize more variables. this.children = new List <ExceptionContext> (); this.blocks = new List <BasicBlock> (); this.handlers = new List <Handler> (); this.cleanup = null; }
public PlaceHolderType(ChelaModule module, string name, bool valueType, List <Structure> bases) : base(module) { this.placeHolderId = module.CreatePlaceHolderId(); this.name = name; this.valueType = valueType; if (bases == null) { this.bases = new Structure[0]; } else { this.bases = bases.ToArray(); } }
public override AstNode Visit(ModuleNode node) { // Store the old module. ChelaModule oldModule = this.currentModule; currentModule = node.GetModule(); // Visit the children. PushScope(currentModule.GetGlobalNamespace()); VisitList(node.GetChildren()); PopScope(); // Restore the module. currentModule = oldModule; return(node); }
protected Function(ChelaModule module) : base(module) { this.name = string.Empty; this.flags = MemberFlags.Default; this.parentScope = null; this.basicBlocks = new List <BasicBlock> (); this.lexicalScopes = new List <LexicalScope>(); this.locals = new List <LocalVariable> (); this.position = null; this.exceptionContext = null; this.returnBlock = null; this.returningVar = null; this.returnValueVar = null; this.genericPrototype = GenericPrototype.Empty; this.arguments = null; }
public override IChelaType InstanceGeneric(GenericInstance args, ChelaModule instModule) { // Instance the return type. IChelaType returnType = this.returnType.InstanceGeneric(args, instModule); // Instance all of the parameters. List <IChelaType> parameters = new List <IChelaType>(); for (int i = 0; i < arguments.Length; ++i) { IChelaType arg = arguments[i]; parameters.Add(arg.InstanceGeneric(args, instModule)); } // Return a function type with the instanced types. return(Create(returnType, parameters, variableArguments)); }
public override void Write(ModuleWriter writer) { // Write the header. MemberHeader header = new MemberHeader(); header.memberType = (byte)MemberHeaderType.Property; header.memberName = GetModule().RegisterString(GetName()); header.memberFlags = (uint)GetFlags(); header.memberSize = (uint)(13 + 4 * GetIndexCount()); header.Write(writer); // Write the type. ChelaModule module = GetModule(); writer.Write((uint)module.RegisterType(GetVariableType())); // Write the indices. byte numIndices = (byte)GetIndexCount(); writer.Write(numIndices); for (int i = 0; i < numIndices; ++i) { writer.Write(module.RegisterType((IChelaType)indices[i])); } // Write the get accessor. if (getAccessor != null) { writer.Write((uint)getAccessor.GetSerialId()); } else { writer.Write((uint)0); } // Write the set accessor. if (setAccessor != null) { writer.Write((uint)setAccessor.GetSerialId()); } else { writer.Write((uint)0); } }
internal override void PrepareSerialization() { // Prepare myself. base.PrepareSerialization(); // Register the property type. ChelaModule module = GetModule(); module.RegisterType(GetVariableType()); // Register the indices type. int numindices = GetIndexCount(); for (int i = 0; i < numindices; ++i) { module.RegisterType((IChelaType)indices[i]); } }
public void PrepareSerialization(ChelaModule module) { // Register the attribute class. module.RegisterType(attributeClass); // Register the attribute ctor. if (attributeCtor != null) { module.RegisterMember(attributeCtor); } // Register the properties. foreach (PropertyValue prop in propertyValues) { module.RegisterMember(prop.Property); module.RegisterType(prop.Property.GetVariableType()); } }
public GenericInstance InstanceFrom(GenericInstance instance, ChelaModule instModule) { // Avoid instancing. if (instance == null) { return(this); } // Instance the arguments. IChelaType[] arguments = new IChelaType[parameters.Length]; for (int i = 0; i < parameters.Length; ++i) { arguments[i] = parameters[i].InstanceGeneric(instance, instModule); } // Create the new instance. return(new GenericInstance(prototype, arguments)); }
protected Interface(ChelaModule module) : base(module) { }
public FunctionInstance(Function template, GenericInstance genericInstance, ChelaModule instanceModule) : base(instanceModule) { Initialize(template, genericInstance); }
protected ChelaType(ChelaModule module) : base(module) { }
public virtual IChelaType InstanceGeneric(GenericInstance args, ChelaModule instModule) { return this; }
public void Write(ModuleWriter writer, ChelaModule module) { writer.Write(module.RegisterString(name)); }
public Variable(IChelaType type, ChelaModule module) : base(module) { this.type = type; this.name = string.Empty; }
protected Variable(ChelaModule module) : base(module) { this.type = null; this.name = string.Empty; }