コード例 #1
0
ファイル: Binder.cs プロジェクト: codyn-net/rawc
        private Cdn.Network LoadNetwork(string filename)
        {
            Cdn.Network n;

            try
            {
                n = new Cdn.Network(filename);
            }
            catch (GLib.GException e)
            {
                throw new Exception("Failed to load network: {0}", e.Message);
            }

            CompileError error = new CompileError();

            if (!n.Compile(null, error))
            {
                throw new Exception("Failed to compile network: {0}", error.FormattedString);
            }

            return(n);
        }
コード例 #2
0
ファイル: Generator.cs プロジェクト: codyn-net/rawc
        private void LoadNetwork()
        {
            if (Options.Instance.Validate)
            {
                Cdn.InstructionRand.UseStreams = true;
                Cdn.Function.RandAsArgument    = true;
            }

            try
            {
                d_network = new Cdn.Network(d_filename);
            }
            catch (GLib.GException e)
            {
                throw new Exception("Failed to load network: {0}", e.Message);
            }

            CompileError error = new CompileError();

            if (!d_network.Compile(null, error))
            {
                throw new Exception("Failed to compile network: {0}", error.FormattedString);
            }
        }