示例#1
0
    EmitCodeGen(
        Blue.Public.IOptions opt)              // Options
    {
        // Set default target type. An option handler may change it on us.
        m_TargetType        = TargetType.Console;
        

        //
        // Register OptionHandlers.
        //
        opt.AddHandler("target", "t", new OptionHandler(this.Option_Target),
            "Target module format (windows, console, library)", 
            "Select what type of executable to produce\n"+
            "/target:library - produce a dll\n"+
            "/target:windows - produce a windows executable.\n"+
            "/target:console - (default) produce a console executable\n");
                                
        #if false
            Option_DebugInfo(""); // force debugging info in all cases
        #endif
        opt.AddHandler("debug", null, new OptionHandler(this.Option_DebugInfo), 
                "Generate .PDB symbols file for debugging", 
                "Generate a .pdb file for debugging purposes. Default is off.\n"+
                "ex:\n"+
                "/debug");
                                
        opt.AddHandler("main", "m", new OptionHandler(this.Option_SetMain), 
            "Specify class containing Main method", 
            "Explicitly specify which class has the Main method.\n"+
            "ex:\n"+
            "/main:MyClass");
            
        opt.AddHandler("out", null, new OptionHandler(this.Option_Out), 
            "Specify the output name to generate", 
            "ex:\n"+
            "/out:Dogfood.exe"
            );
    }