summaryrefslogtreecommitdiff
path: root/BCT/BytecodeTranslator/Program.cs
diff options
context:
space:
mode:
authorGravatar qadeer <unknown>2010-12-15 03:42:25 +0000
committerGravatar qadeer <unknown>2010-12-15 03:42:25 +0000
commitc4c4118ca5699d3c57c2a17f2a60b00f08ed38da (patch)
tree7bfca640d6799927b134de5c9a68168b59a409b8 /BCT/BytecodeTranslator/Program.cs
parent1a8898597379ff69b4bead656d6b100e41559c50 (diff)
Added a new option for splitting fields
Updated the regression input file
Diffstat (limited to 'BCT/BytecodeTranslator/Program.cs')
-rw-r--r--BCT/BytecodeTranslator/Program.cs56
1 files changed, 48 insertions, 8 deletions
diff --git a/BCT/BytecodeTranslator/Program.cs b/BCT/BytecodeTranslator/Program.cs
index 4b917f24..c1875b97 100644
--- a/BCT/BytecodeTranslator/Program.cs
+++ b/BCT/BytecodeTranslator/Program.cs
@@ -13,22 +13,62 @@ using System.Collections.Generic;
using Microsoft.Cci.Contracts;
using Microsoft.Cci.ILToCodeModel;
+using Bpl = Microsoft.Boogie;
+
namespace BytecodeTranslator {
+ public class CommandLineOptions
+ {
+ public static bool SplitFields = false;
+ }
+
public class BCT {
public static IMetadataHost Host;
- static int Main(string[] args) {
+ public static bool Parse(string[] args, out string assemblyName)
+ {
+ assemblyName = "";
+
+ foreach (string arg in args)
+ {
+ if (arg.StartsWith("/"))
+ {
+ if (arg == "/splitFields")
+ {
+ CommandLineOptions.SplitFields = true;
+ }
+ else
+ {
+ Console.WriteLine("Illegal option.");
+ return false;
+ }
+ }
+ else if (assemblyName == "")
+ {
+ assemblyName = arg;
+ }
+ else
+ {
+ Console.WriteLine("Must specify only one input assembly.");
+ return false;
+ }
+ }
+ if (assemblyName == "")
+ {
+ Console.WriteLine("Must specify an input assembly.");
+ return false;
+ }
+ return true;
+ }
+ static int Main(string[] args)
+ {
int result = 0;
-
- if (args.Length < 1) {
- Console.WriteLine("Must specify an input file.");
- return result;
- }
-
+ string assemblyName;
+ if (!Parse(args, out assemblyName))
+ return result;
try {
- result = DoRealWork(args[0]);
+ result = DoRealWork(assemblyName);
} catch (Exception e) { // swallow everything and just return an error code
Console.WriteLine("The byte-code translator failed with uncaught exception: {0}", e.Message);
Console.WriteLine("Stack trace: {0}", e.StackTrace);