Cosmos/source2/Tests/XSharpCompilerTester/MainForm.cs
kudzu_cp f82db1f69d
2012-07-09 00:49:53 +00:00

45 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace XSharpCompilerTester {
public partial class MainForm : Form {
public MainForm() {
InitializeComponent();
// TODO convert to app path + relative
// D:\source\Cosmos\source2\Tests\XSharpCompilerTester\bin\Debug
// D:\source\Cosmos\source2\Users\Matthijs\MatthijsPlayground
}
protected void Test(string aFilename) {
string xInputString = File.ReadAllText(@"D:\source\Cosmos\source2\Compiler\Cosmos.Compiler.DebugStub\" + aFilename);
tboxInput.Text = xInputString;
using (var xInput = new StringReader(xInputString)) {
using (var xOutput = new StringWriter()) {
var xGenerator = new Cosmos.Compiler.XSharp.Generator();
xGenerator.Execute("DefaultNamespace", "InputFileName", xInput, xOutput);
textOutput.Text = xOutput.ToString();
}
}
}
protected void timerConvert_Tick(object sender, EventArgs e) {
timerConvert.Enabled = false;
Test("TracerEntry.xs");
Test("Serial.xs");
Test("Screen.xs");
Test("Init.xs");
Test("CmdMisc.xs");
Test("CmdAsmBreak.xs");
Test("Main.xs");
Test("CmdProcess.xs");
}
}
}