/* Copyright 2010,2011 Kevin Glynn (kevin.glynn@twigletsoftware.com) */ using System; using System.Collections.Generic; using System.Text; using System.Text.RegularExpressions; using System.IO; using System.Xml; using Antlr.Runtime.Tree; using Antlr.Runtime; using System.Xml.Serialization; using System.Security.Cryptography; using System.Security.Cryptography.Xml; using Antlr.StringTemplate; using NDesk.Options; using AntlrCSharp; using Twiglet.CS2J.Translator.Utils; using Twiglet.CS2J.Translator.Transform; using Twiglet.CS2J.Translator.TypeRep; using CS2JConstants = Twiglet.CS2J.Translator.Utils.Constants; using Twiglet.CS2J.Translator.Extract; using Nini.Config; namespace Twiglet.CS2J.Translator { class CS2J { private const string VERSION = "2013.0.1"; private static DirectoryHT AppEnv { get; set; } private static CS2JSettings cfg = new CS2JSettings(); private static StringTemplateGroup templates = null; private static bool doEarlyExit = false; private static XmlTextWriter enumXmlWriter = null; public delegate void FileProcessor(string fName); private static Dictionary partialTypes = new Dictionary(); private static void showVersion() { Console.Out.WriteLine(Path.GetFileNameWithoutExtension(System.Environment.GetCommandLineArgs()[0]) + ": " + VERSION); } private static void showUsage() { Console.Out.WriteLine("Usage: " + Path.GetFileNameWithoutExtension(System.Environment.GetCommandLineArgs()[0])); Console.Out.WriteLine(" [-help] (this usage message)"); Console.Out.WriteLine(" [-v] (be [somewhat more] verbose, repeat for more verbosity)"); Console.Out.WriteLine(" [-config ] (read settings from , overriden from command line"); Console.Out.WriteLine(" [-D ] (define C# preprocessor , option can be repeated)"); Console.Out.WriteLine(" [-show-tokens] (the lexer prints the tokenized input to the console)"); Console.Out.WriteLine(" [-show-csharp] [-show-javasyntax] [-show-java] (show parse tree at various stages of the translation)"); Console.Out.WriteLine(" [-dump-xmls] [-out-xml-dir ] (dump the translation repository as xml files)"); Console.Out.WriteLine(" [-net-templates-dir +] (can be multiple directories, separated by semi-colons)"); Console.Out.WriteLine(" [-ex-net-templates-dir +] (can be multiple directories/files, separated by semi-colons)"); Console.Out.WriteLine(" [-alt-translations