2019-07-19 22:59:32 +00:00
|
|
|
|
namespace Fuse
|
|
|
|
|
{
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
public class Test
|
|
|
|
|
{
|
|
|
|
|
public bool Valid => !string.IsNullOrEmpty(this.Description);
|
|
|
|
|
|
|
|
|
|
public string Description { get; private set; }
|
|
|
|
|
|
|
|
|
|
public RegisterState RegisterState { get; } = new RegisterState();
|
|
|
|
|
|
|
|
|
|
public List<MemoryDatum> MemoryData { get; } = new List<MemoryDatum>();
|
|
|
|
|
|
2019-07-20 18:17:08 +00:00
|
|
|
|
public void Parse(Lines lines)
|
2019-07-19 22:59:32 +00:00
|
|
|
|
{
|
2019-07-20 18:17:08 +00:00
|
|
|
|
while (!lines.EndOfFile && !this.Valid)
|
2019-07-19 22:59:32 +00:00
|
|
|
|
{
|
2019-07-20 18:17:08 +00:00
|
|
|
|
this.Description = lines.ReadLine();
|
2019-07-19 22:59:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!this.Valid)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-20 18:17:08 +00:00
|
|
|
|
this.RegisterState.Parse(lines);
|
2019-07-19 22:59:32 +00:00
|
|
|
|
|
|
|
|
|
var finished = false;
|
|
|
|
|
do
|
|
|
|
|
{
|
2019-07-20 18:17:08 +00:00
|
|
|
|
var line = lines.ReadLine();
|
2019-07-19 22:59:32 +00:00
|
|
|
|
finished = line == "-1";
|
|
|
|
|
if (!finished)
|
|
|
|
|
{
|
|
|
|
|
var datum = new MemoryDatum();
|
|
|
|
|
datum.Parse(line);
|
|
|
|
|
this.MemoryData.Add(datum);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
while (!finished);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|