2002-10-21 Miguel de Icaza <miguel@ximian.com>
[mono.git] / mcs / ilasm / Main.cs
1 using System;\r
2 using System.IO;\r
3 \r
4 using Mono.ILASM;\r
5 \r
6 \r
7 public class ILAsmTest {\r
8         private ILAsmTest() {}\r
9 \r
10 \r
11         public static void Main (string [] args) {\r
12                 StreamReader reader = File.OpenText("test.il");\r
13                 ILTokenizer scanner = new ILTokenizer (reader);\r
14 \r
15                 bool testScanner = !true;\r
16 \r
17                 if (testScanner) {\r
18                         ILToken tok;\r
19                         while ((tok = scanner.NextToken) != ILToken.EOF) {\r
20                                 Console.WriteLine (tok);\r
21                         }\r
22                 } else {\r
23                         ILParser parser = new ILParser ();\r
24                         parser.yyparse (new ScannerAdapter (scanner), new yydebug.yyDebugSimple ());\r
25 \r
26                         CodeGen cg = parser.CodeGen;\r
27                         int n = cg.ClassCount;\r
28                         cg.Emit ();\r
29                 }\r
30         }\r
31 }\r