コード例 #1
0
ファイル: ASMSequencer.cs プロジェクト: kztao/FlingOS
 /// <summary>
 /// Initialises a new ASM squencer with specified settings and handlers.
 /// </summary>
 /// <param name="aSettings">The settings to use.</param>
 /// <param name="anOutputError">The reference to the method to call to output an error message.</param>
 /// <param name="anOutputMessage">The reference to the method to call to output a standard message.</param>
 /// <param name="anOutputWarning">The reference to the method to call to output a warning message.</param>
 public ASMSequencer(Settings aSettings,
                     OutputErrorDelegate anOutputError,
                     OutputMessageDelegate anOutputMessage,
                     OutputWarningDelegate anOutputWarning)
 {
     TheSettings = aSettings;
     OutputError = anOutputError;
     OutputMessage = anOutputMessage;
     OutputWarning = anOutputWarning;
 }
コード例 #2
0
ファイル: ILCompiler.cs プロジェクト: kztao/FlingOS
 /// <summary>
 /// Initialises a new ILCompiler instance with the specified settings and empty output handlers.
 /// </summary>
 /// <param name="aSettings">The settings to use for the ILCompiler.</param>
 public ILCompiler(Settings aSettings)
     : this(aSettings, null, null, null)
 {
 }
コード例 #3
0
ファイル: ILCompiler.cs プロジェクト: kztao/FlingOS
        /// <summary>
        /// Initialises a new ILCompiler instance with the specified settings and output handlers.
        /// </summary>
        /// <param name="aSettings">The settings to use for the ILCompiler.</param>
        /// <param name="anOutputError">The reference to the method to call to output an error message.</param>
        /// <param name="anOutputMessage">The reference to the method to call to output a standard message.</param>
        /// <param name="anOutputWarning">The reference to the method to call to output a warning message.</param>
        public ILCompiler(Settings aSettings, 
                          OutputErrorDelegate anOutputError, 
                          OutputMessageDelegate anOutputMessage,
                          OutputWarningDelegate anOutputWarning)
        {
            TheSettings = aSettings;
            OutputError = anOutputError;
            OutputMessage = anOutputMessage;
            OutputWarning = anOutputWarning;

            if (OutputError == null)
            {
                //Prevents null reference exceptions
                OutputError = (Exception ex) =>
                {
                    //Empty placeholder function
                };
            }
            if (OutputMessage == null)
            {
                //Prevents null reference exceptions
                OutputMessage = (string message) =>
                {
                    //Empty placeholder function
                };
            }
            if (OutputWarning == null)
            {
                //Prevents null reference exceptions
                OutputWarning = (Exception ex) =>
                {
                    //Empty placeholder function
                };
            }
        }
コード例 #4
0
ファイル: ILReader.cs プロジェクト: kztao/FlingOS
        /// <summary>
        /// Initialises a new ILReader with the specified assembly manager and output handlers.
        /// </summary>
        /// <param name="aSettings">The settings to use.</param>
        /// <param name="anAssemblyManager">The assembly manager to use.</param>
        /// <param name="anOutputError">The reference to the method to call to output an error message.</param>
        /// <param name="anOutputMessage">The reference to the method to call to output a standard message.</param>
        /// <param name="anOutputWarning">The reference to the method to call to output a warning message.</param>
        /// <exception cref="System.Exception">
        /// Thrown if the IL op types fail to load.
        /// </exception>
        public ILReader(Settings aSettings,
                        AssemblyManager anAssemblyManager,
                        OutputErrorDelegate anOutputError,
                        OutputMessageDelegate anOutputMessage,
                        OutputWarningDelegate anOutputWarning)
        {
            TheSettings = aSettings;
            TheAssemblyManager = anAssemblyManager;
            OutputError = anOutputError;
            OutputMessage = anOutputMessage;
            OutputWarning = anOutputWarning;

            if (!LoadILOpTypes())
            {
                throw new Exception("Failed to load IL op types!");
            }
        }