Exemplo n.º 1
0
        /// <summary>
        /// Generates the final snapshot text representation.
        /// </summary>
        /// <param name="output">The output.</param>
        public void GenerateFinalSnapshotText(OutputBase output)
        {
            output.Headline("Final snapshot content");
            output.EmptyLine();

            if (programPointGraph != null && programPointGraph.End != null && programPointGraph.End.OutSet != null)
            {
                output.CommentLine("Number of memory locations: " + programPointGraph.End.OutSnapshot.NumMemoryLocations());

                Snapshot snapshot = getSnapshot(programPointGraph.End);
                if (snapshot != null)
                {
                    output.CommentLine("Number of variables: " + snapshot.Structure.Readonly.ReadonlyGlobalContext.ReadonlyVariables.Count);
                    output.CommentLine("Number of control variables: " + snapshot.Structure.Readonly.ReadonlyGlobalContext.ReadonlyControllVariables.Count);
                    output.CommentLine("Number of temporary variables: " + snapshot.Structure.Readonly.ReadonlyGlobalContext.ReadonlyTemporaryVariables.Count);
                    output.CommentLine("Number of arrays: " + snapshot.Structure.Readonly.ArrayDescriptors.Count());
                    output.CommentLine("Number of objects: " + snapshot.Structure.Readonly.ObjectDescriptors.Count());

                    SnapshotTextGenerator generator = new SnapshotTextGenerator(output);
                    generator.GenerateSnapshotText(snapshot);
                }
                else
                {
                    output.EmptyLine();
                    output.ProgramPointInfo("", programPointGraph.End);
                }
            }
            else
            {
                output.Error("End point was not reached");
            }
        }