mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-27 05:52:11 +00:00
X#
This commit is contained in:
parent
209fa30b00
commit
4d69dcde01
2 changed files with 10 additions and 25 deletions
|
|
@ -97,10 +97,10 @@ namespace Cosmos.Compiler.XSharp {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void AddPatterns() {
|
protected void AddPatterns() {
|
||||||
AddPattern(new TokenType[] { TokenType.LiteralAsm },
|
AddPattern("! Move EAX, 0",
|
||||||
"new LiteralAssemblerCode(\"{0}\");"
|
"new LiteralAssemblerCode(\"{0}\");"
|
||||||
);
|
);
|
||||||
AddPattern(new TokenType[] { TokenType.Comment },
|
AddPattern("# Comment",
|
||||||
"new Comment(\"{0}\");"
|
"new Comment(\"{0}\");"
|
||||||
);
|
);
|
||||||
AddPattern("Label:" ,
|
AddPattern("Label:" ,
|
||||||
|
|
@ -205,20 +205,11 @@ namespace Cosmos.Compiler.XSharp {
|
||||||
mPatterns.Add(new TokenPattern(aPattern), aCode);
|
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) {
|
protected void AddPattern(string aPattern, string aCode) {
|
||||||
AddPattern(aPattern, delegate(TokenList aTokens, ref List<string> rCode) {
|
AddPattern(aPattern, delegate(TokenList aTokens, ref List<string> rCode) {
|
||||||
rCode.Add(aCode);
|
rCode.Add(aCode);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void AddPattern(TokenType[] aPattern, string aCode) {
|
|
||||||
AddPattern(aPattern, delegate(TokenList aTokens, ref List<string> rCode) {
|
|
||||||
rCode.Add(aCode);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,16 +3,10 @@ using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace XSharpCompilerTester
|
namespace XSharpCompilerTester {
|
||||||
{
|
static class Program {
|
||||||
static class Program
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The main entry point for the application.
|
|
||||||
/// </summary>
|
|
||||||
[STAThread]
|
[STAThread]
|
||||||
static void Main()
|
static void Main() {
|
||||||
{
|
|
||||||
Application.EnableVisualStyles();
|
Application.EnableVisualStyles();
|
||||||
Application.SetCompatibleTextRenderingDefault(false);
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
Application.Run(new MainForm());
|
Application.Run(new MainForm());
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue