Browse Source

Renamed Options to DriverOptions.

pull/1/head
triton 13 years ago
parent
commit
34eeb8e052
  1. 8
      src/Generator/Driver.cs
  2. 2
      src/Generator/Generators/CLI/CLIHeadersTemplate.cs
  3. 4
      src/Generator/Generators/CLI/CLIHelpers.cs
  4. 2
      src/Generator/Generators/CLI/CLISourcesTemplate.cs
  5. 6
      src/Generator/Generators/Generator.cs
  6. 2
      src/Generator/Generators/Template.cs
  7. 4
      src/Generator/Parser.cs
  8. 4
      src/Generator/Program.cs
  9. 2
      src/Generator/Transforms/Transform.cs

8
src/Generator/Driver.cs

@ -8,13 +8,13 @@ namespace Cxxi
{ {
public class Driver public class Driver
{ {
private readonly Options options; private readonly DriverOptions options;
private readonly ILibrary transform; private readonly ILibrary transform;
private readonly IDiagnosticConsumer diagnostics; private readonly IDiagnosticConsumer diagnostics;
private readonly TypeMapDatabase typeDatabase; private readonly TypeMapDatabase typeDatabase;
private Library library; private Library library;
public Driver(Options options, ILibrary transform) public Driver(DriverOptions options, ILibrary transform)
{ {
this.options = options; this.options = options;
this.transform = transform; this.transform = transform;
@ -75,9 +75,9 @@ namespace Cxxi
} }
} }
public class Options public class DriverOptions
{ {
public Options() public DriverOptions()
{ {
Defines = new List<string>(); Defines = new List<string>();
IncludeDirs = new List<string>(); IncludeDirs = new List<string>();

2
src/Generator/Generators/CLI/CLIHeadersTemplate.cs

@ -381,7 +381,7 @@ namespace Cxxi.Generators.CLI
public void GenerateDebug(Declaration decl) public void GenerateDebug(Declaration decl)
{ {
if (Options.OutputDebug && !String.IsNullOrWhiteSpace(decl.DebugText)) if (DriverOptions.OutputDebug && !String.IsNullOrWhiteSpace(decl.DebugText))
WriteLine("// DEBUG: " + decl.DebugText); WriteLine("// DEBUG: " + decl.DebugText);
} }

4
src/Generator/Generators/CLI/CLIHelpers.cs

@ -6,7 +6,7 @@ namespace Cxxi.Generators.CLI
{ {
public class CLIGenerator : ILanguageGenerator public class CLIGenerator : ILanguageGenerator
{ {
public Options Options { get; set; } public DriverOptions Options { get; set; }
public Library Library { get; set; } public Library Library { get; set; }
public ILibrary Transform { get; set; } public ILibrary Transform { get; set; }
public ITypeMapDatabase TypeMapDatabase { get; set; } public ITypeMapDatabase TypeMapDatabase { get; set; }
@ -26,7 +26,7 @@ namespace Cxxi.Generators.CLI
var template = new T var template = new T
{ {
Generator = Generator, Generator = Generator,
Options = Options, DriverOptions = Options,
Library = Library, Library = Library,
Transform = Transform, Transform = Transform,
Module = unit, Module = unit,

2
src/Generator/Generators/CLI/CLISourcesTemplate.cs

@ -353,7 +353,7 @@ namespace Cxxi.Generators.CLI
public void GenerateDebug(Declaration decl) public void GenerateDebug(Declaration decl)
{ {
if (Options.OutputDebug && !String.IsNullOrWhiteSpace(decl.DebugText)) if (DriverOptions.OutputDebug && !String.IsNullOrWhiteSpace(decl.DebugText))
WriteLine("// DEBUG: " + decl.DebugText); WriteLine("// DEBUG: " + decl.DebugText);
} }

6
src/Generator/Generators/Generator.cs

@ -12,7 +12,7 @@ namespace Cxxi.Generators
public interface ILanguageGenerator public interface ILanguageGenerator
{ {
Options Options { get; set; } DriverOptions Options { get; set; }
Library Library { get; set; } Library Library { get; set; }
ILibrary Transform { get; set; } ILibrary Transform { get; set; }
ITypeMapDatabase TypeMapDatabase { get; set; } ITypeMapDatabase TypeMapDatabase { get; set; }
@ -23,12 +23,12 @@ namespace Cxxi.Generators
public partial class Generator public partial class Generator
{ {
public Options Options; public DriverOptions Options;
public Library Library; public Library Library;
public ILibrary LibraryTransform; public ILibrary LibraryTransform;
public ITypeMapDatabase TypeMapDatabase; public ITypeMapDatabase TypeMapDatabase;
public Generator(Options options, Library library, ILibrary libraryTransform, public Generator(DriverOptions options, Library library, ILibrary libraryTransform,
ITypeMapDatabase typeMapDatabase) ITypeMapDatabase typeMapDatabase)
{ {
this.Options = options; this.Options = options;

2
src/Generator/Generators/Template.cs

@ -10,7 +10,7 @@ namespace Cxxi.Generators
private const uint MaxIndent = 80; private const uint MaxIndent = 80;
public Generator Generator { get; set; } public Generator Generator { get; set; }
public Options Options { get; set; } public DriverOptions DriverOptions { get; set; }
public Library Library { get; set; } public Library Library { get; set; }
public ILibrary Transform; public ILibrary Transform;
public TranslationUnit Module { get; set; } public TranslationUnit Module { get; set; }

4
src/Generator/Parser.cs

@ -6,9 +6,9 @@ namespace Cxxi
public class Parser public class Parser
{ {
public Library Library { get; private set; } public Library Library { get; private set; }
private readonly Options options; private readonly DriverOptions options;
public Parser(Options options) public Parser(DriverOptions options)
{ {
this.options = options; this.options = options;
Library = new Library(options.OutputNamespace, options.LibraryName); Library = new Library(options.OutputNamespace, options.LibraryName);

4
src/Generator/Program.cs

@ -41,7 +41,7 @@ namespace Cxxi
"); ");
} }
static bool ParseCommandLineOptions(String[] args, Options options) static bool ParseCommandLineOptions(String[] args, DriverOptions options)
{ {
var set = new OptionSet() var set = new OptionSet()
{ {
@ -117,7 +117,7 @@ namespace Cxxi
public static void Main(String[] args) public static void Main(String[] args)
{ {
var options = new Options(); var options = new DriverOptions();
if (!ParseCommandLineOptions(args, options)) if (!ParseCommandLineOptions(args, options))
return; return;

2
src/Generator/Transforms/Transform.cs

@ -6,7 +6,7 @@ namespace Cxxi.Passes
{ {
public class Transform public class Transform
{ {
public Options Options; public DriverOptions Options;
public PassBuilder Passes; public PassBuilder Passes;
public void TransformLibrary(Library library) public void TransformLibrary(Library library)

Loading…
Cancel
Save