This commit is contained in:
kudzu_cp 2012-06-16 02:22:39 +00:00
parent 209fa30b00
commit 4d69dcde01
2 changed files with 10 additions and 25 deletions

View file

@ -97,10 +97,10 @@ namespace Cosmos.Compiler.XSharp {
}
protected void AddPatterns() {
AddPattern(new TokenType[] { TokenType.LiteralAsm },
AddPattern("! Move EAX, 0",
"new LiteralAssemblerCode(\"{0}\");"
);
AddPattern(new TokenType[] { TokenType.Comment },
AddPattern("# Comment",
"new Comment(\"{0}\");"
);
AddPattern("Label:" ,
@ -205,20 +205,11 @@ namespace Cosmos.Compiler.XSharp {
mPatterns.Add(new TokenPattern(aPattern), aCode);
}
protected void AddPattern(TokenType[] aPattern, CodeFunc aCode) {
mPatterns.Add(new TokenPattern(aPattern), aCode);
}
protected void AddPattern(string aPattern, string aCode) {
AddPattern(aPattern, delegate(TokenList aTokens, ref List<string> rCode) {
rCode.Add(aCode);
});
}
protected void AddPattern(TokenType[] aPattern, string aCode) {
AddPattern(aPattern, delegate(TokenList aTokens, ref List<string> rCode) {
rCode.Add(aCode);
});
}
}
}

View file

@ -3,19 +3,13 @@ using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace XSharpCompilerTester
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
namespace XSharpCompilerTester {
static class Program {
[STAThread]
static void Main() {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
}
}