|
|
|
@ -1,22 +1,31 @@
@@ -1,22 +1,31 @@
|
|
|
|
|
using Cxxi; |
|
|
|
|
using System; |
|
|
|
|
using System; |
|
|
|
|
using System.Globalization; |
|
|
|
|
using System.Text.RegularExpressions; |
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Used to massage the library types into something more .NET friendly.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public interface LibraryTransform |
|
|
|
|
namespace Cxxi |
|
|
|
|
{ |
|
|
|
|
public void Transform(Generator g); |
|
|
|
|
} |
|
|
|
|
/// <summary>
|
|
|
|
|
/// Used to massage the library types into something more .NET friendly.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public interface LibraryTransform |
|
|
|
|
{ |
|
|
|
|
/// <summary>
|
|
|
|
|
/// Do transformations that should happen before processing here.
|
|
|
|
|
/// </summary>
|
|
|
|
|
void Preprocess(Generator g); |
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Used to provide different types of code transformation on a module
|
|
|
|
|
/// declarations and types before the code generation process is started.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public abstract class ModuleTransform |
|
|
|
|
{ |
|
|
|
|
/// <summary>
|
|
|
|
|
/// Do transformations that should happen after processing here.
|
|
|
|
|
/// </summary>
|
|
|
|
|
void Postprocess(Generator g); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Used to provide different types of code transformation on a module
|
|
|
|
|
/// declarations and types before the code generation process is started.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public abstract class ModuleTransform |
|
|
|
|
{ |
|
|
|
|
/// <summary>
|
|
|
|
|
/// Processes a declaration.
|
|
|
|
|
/// </summary>
|
|
|
|
@ -32,13 +41,13 @@ public abstract class ModuleTransform
@@ -32,13 +41,13 @@ public abstract class ModuleTransform
|
|
|
|
|
{ |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Renames a declaration based on a regular expression pattern.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class RenameTransform : ModuleTransform |
|
|
|
|
{ |
|
|
|
|
/// <summary>
|
|
|
|
|
/// Renames a declaration based on a regular expression pattern.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class RenameTransform : ModuleTransform |
|
|
|
|
{ |
|
|
|
|
public string Pattern; |
|
|
|
|
public string Replacement; |
|
|
|
|
|
|
|
|
@ -70,10 +79,10 @@ public class RenameTransform : ModuleTransform
@@ -70,10 +79,10 @@ public class RenameTransform : ModuleTransform
|
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public partial class Generator |
|
|
|
|
{ |
|
|
|
|
public partial class Generator |
|
|
|
|
{ |
|
|
|
|
#region Transform Operations
|
|
|
|
|
|
|
|
|
|
public void RemovePrefix(string prefix) |
|
|
|
@ -259,4 +268,5 @@ public partial class Generator
@@ -259,4 +268,5 @@ public partial class Generator
|
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |