public PropertyVariable(ChelaModule module) : base(module) { this.flags = MemberFlags.Default; this.indices = null; this.parentScope = null; }
protected FunctionGroup(ChelaModule module) : base(module) { this.name = string.Empty; this.parentScope = null; this.functions = new SimpleSet<FunctionGroupName> (); }
public StructureInstance(Structure template, GenericInstance instance, ScopeMember factory, ChelaModule module) : base(module) { this.factory = factory; Initialize(template, instance); }
protected TypeGroup(ChelaModule module) : base(module) { this.name = string.Empty; this.fullName = null; this.parentScope = null; this.types = new SimpleSet<TypeGroupName> (); }
internal Namespace(ChelaModule module) : base(module) { this.parentScope = null; this.members = new Dictionary<string, ScopeMember> (); this.name = string.Empty; this.globalInitialization = null; this.staticConstructor = null; }
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 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; }
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 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 new 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); }
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; }
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 ExceptionContext(Function parentFunction) { // Store parent-child relation. this.parentContext = null; this.parentFunction = parentFunction; module = parentFunction.GetModule(); if(parentFunction.exceptionContext != null) throw new ModuleException("A function only can have one (toplevel) exception context."); parentFunction.exceptionContext = this; // Initialize more variables. this.children = new List<ExceptionContext> (); this.blocks = new List<BasicBlock> (); this.handlers = new List<Handler> (); this.cleanup = null; }
public FunctionInstance InstanceGeneric(GenericInstance genericInstance, ChelaModule instanceModule) { return new FunctionInstance(this, genericInstance, instanceModule); }
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); }
public ObjectDeclarator() { currentFunction = null; currentModule = null; }
public override AstNode Visit(ModuleNode node) { currentModule = node.GetModule(); currentScope = currentModule.GetGlobalNamespace(); currentContainer = currentScope; VisitList(node.GetChildren()); return node; }
internal void PrepareSerialization(ChelaModule module) { // Prepare the instructions. foreach(Instruction inst in instructions) inst.PrepareSerialization(module); }
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) { // Check if the function is a method. MemberFlags instanceFlags = (MemberFlags)header.memberFlags & MemberFlags.InstanceMask; bool method = instanceFlags != MemberFlags.Static && instanceFlags != MemberFlags.StaticConstructor; // Create the temporal function and register it. Function function = method ? new Method(module) : new Function(module); module.RegisterMember(function); // Read the name and flags. function.name = module.GetString(header.memberName); function.flags = (MemberFlags)header.memberFlags; // Skip the structure elements. reader.Skip(header.memberSize); }
public override IChelaType InstanceGeneric(GenericInstance instance, ChelaModule instanceModule) { // Instance the instance. GenericInstance newInstance = genericInstance.InstanceFrom(instance, instanceModule); // Instance the structure. return template.InstanceGeneric(newInstance, instanceModule); }
protected Class(ChelaModule module) : base(module) { }
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. PropertyVariable prop = new PropertyVariable(module); module.RegisterMember(prop); // Read the name and flags. prop.SetName(module.GetString(header.memberName)); prop.flags = (MemberFlags)header.memberFlags; // Skip the structure elements. reader.Skip(header.memberSize); }
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()); } }
private StructureInstance(ChelaModule module) : base(module) { }
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); }
/// <summary> /// Writes the attribute constant into the module file. /// </summary> /// <param name="writer"> /// A <see cref="ModuleWriter"/> /// </param> public void Write(ModuleWriter writer, ChelaModule module) { // Write the attribute class id. uint attributeClassId = module.RegisterMember(attributeClass); writer.Write(attributeClassId); // Write the attribute constructor id. uint attributeCtorId = module.RegisterMember(attributeCtor); writer.Write(attributeCtorId); // Write the arguments. byte numargs = (byte)ctorArguments.Count; writer.Write(numargs); for(int i = 0; i < numargs; ++i) { ConstantValue arg = ctorArguments[i]; arg.WriteQualified(module, writer); } // Write the properties. byte numprops = (byte)propertyValues.Count; writer.Write(numprops); for(int i = 0; i < numprops; ++i) { PropertyValue propVal = propertyValues[i]; uint propId = module.RegisterMember(propVal.Property); writer.Write(propId); propVal.Value.WriteQualified(module, writer); } }
public void SetModule(ChelaModule module) { this.module = module; }
public Scope(ChelaModule module) : base(module) { }