Example #1
0
    public AssemblyBytes(Stream s)
    {
        node = s.ReadClass(ref FileFormat);

        // Widen any nodes to the width of their children
        node.CallBack(n =>
        {
            if (n.Children.Any())
            {
                n.Start = Math.Min(n.Start, n.Children.Min(c => c.Start));
                n.End = Math.Max(n.End, n.Children.Max(c => c.End));
            }
        });

        // Order child nodes by index, expected for Heaps and sections
        node.CallBack(n =>
        {
            n.Children = n.Children.OrderBy(c => c.Start).ToList();
        });

        FindOverLength(s, node);

        node.CallBack(n => n.UseDelayedValueNode());

        node.AssignPath();
        node.CallBack(CodeNode.AssignLink);
    }