예제 #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);
            }
        }