Esempio n. 1
0
        public void Output(string name)
        {
            var output = new Expr(name, ExprType.Output);

            _graph.AddVertex(output);
            _graph.AddEdge(new Edge <Expr>(this, output));
        }
Esempio n. 2
0
        public Expr(string name, ExprType type)
        {
            Name = name;
            Type = type;

            _graph = new Graph();
            _graph.AddVertex(this);
        }
Esempio n. 3
0
        private Graph ConcatGraphs(params Graph[] graphs)
        {
            var result = new Graph();

            for (int i = 0; i < graphs.Length; i++)
            {
                result.AddVertexRange(graphs[i].Vertices);
                result.AddEdgeRange(graphs[i].Edges);
            }
            result.AddVertex(this);

            foreach (var sink in graphs.SelectMany(x => x.Sinks()))
            {
                result.AddEdge(new Edge <Expr>(sink, this));
            }

            return(result);
        }