/// <summary> /// Adds the additional options for the parsing process to the given OptionSet. /// </summary> /// <param name="optionSet">A given OptionSet to add the options to.</param> public void AddOptions(OptionSet optionSet) { optionSet.Add( "reg-alloc=", "Select the register allocator to use (default is linear) [{linear|stack}].", delegate(string name) { this.implementation = SelectImplementation(name); } ); // when the allocators are configurable with options: // linearRegisterAllocator.AddOptions(optionSet); // stackRegisterAllocator.AddOptions(optionSet); }
/// <summary> /// Initializes a new instance of the ArchitectureSelector class. /// </summary> public RegisterAllocatorSelector() { this.linearRegisterAllocator = new LinearRegisterAllocator(); this.stackRegisterAllocator = new SimpleRegisterAllocator(); this.implementation = this.linearRegisterAllocator; }