示例#1
0
        //------------------------------------------------------------
        // CNameManager.CreateInstance (static)
        //
        /// <summary></summary>
        /// <returns></returns>
        //------------------------------------------------------------
        internal static CNameManager CreateInstance()
        {
            CNameManager manager = new CNameManager();

            DebugUtil.Assert(manager != null);
            manager.Init();
            return(manager);
        }
示例#2
0
        //------------------------------------------------------------
        // CController.initialize
        //
        /// <summary>
        /// <para>Set creationFlags, compilerHost, NameManager.</para>
        /// </summary>
        /// <param name="flags"></param>
        /// <param name="cons"></param>
        /// <param name="manager"></param>
        //------------------------------------------------------------
        internal void Initialize(
            CompilerCreationFlags flags,
            ConsoleOutput cout,
            CNameManager manager)
        {
            DebugUtil.Assert(manager != null);

            this.consoleOutput = cout;
            this.creationFlags = flags;
            this.nameManager   = manager;
        }
示例#3
0
        internal bool SuppressErrors = false;   // m_fSuppressErrors

        //------------------------------------------------------------
        // CController.CreateInstance (static)
        //
        /// <summary></summary>
        /// <param name="flags"></param>
        /// <param name="host"></param>
        /// <param name="nameManager"></param>
        /// <returns></returns>
        //------------------------------------------------------------
        internal static CController CreateInstance(
            CompilerCreationFlags flags,
            ConsoleOutput cout,
            CNameManager nameManager)
        {
            // Create a name table if we weren't given one
            if (nameManager == null)
            {
                nameManager = CNameManager.CreateInstance();
            }

            // Create a compiler controller object.  It's the one that exposes ICSCompiler,
            // and manages objects whose lifespan extend beyond a single compilation.

            CController cntr = new CController();

            cntr.Initialize(flags, cout, nameManager);
            return(cntr);
        }
示例#4
0
        //------------------------------------------------------------
        // CommandLineCompiler.Compile
        //
        /// <summary>
        /// <para>Compile by arguments.</para>
        /// <para>In sscli, this method is the main entry point.</para>
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        //------------------------------------------------------------
        internal int Compile(string[] args)
        {
            CNameManager     nameManager = CNameManager.CreateInstance();
            CscConsoleOutput cout        = new CscConsoleOutput(new Uncs.SystemConsole());

            CompilerCreationFlags flags      = CompilerCreationFlags.TRACKCOMMENTS;
            CController           controller = CController.CreateInstance(flags, cout, nameManager);

            cout.SetController(controller);

            COptionManager optManger = controller.OptionManager;

            optManger.DefaultTarget = TargetType.Exe;

            optManger.SetCommandArguments(args);
            optManger.ProcessResponseFiles();
            optManger.ProcessPreSwitches();
            if (controller.HadError)
            {
                return(1);
            }

            if (!optManger.NoLogo)
            {
                cout.PrintBanner();
            }

            if (optManger.ShowHelp)
            {
                OptionInfoManager.PrintCSCHelp(cout);
            }
            else
            {
                optManger.ProcessOptions(Uncs.CommandID.CSC);
                if (!controller.HadError)
                {
                    controller.Compile(null);
                }
            }

            return(controller.HadError?1:0);
        }
示例#5
0
 //------------------------------------------------------------
 // CDictionary.SetNameTable
 //
 /// <summary>Do nothing.</summary>
 /// <param name="table"></param>
 /// <returns>Always return true.</returns>
 //------------------------------------------------------------
 internal bool SetNameTable(CNameManager table)
 {
     // dummy
     return(true);
 }