private ILAsmTest() {}\r
\r
\r
- public static void Main (string [] args) {\r
- StreamReader reader = File.OpenText("test.il");\r
+ public static int Main (string [] args) {\r
+\r
+ if (args.Length != 1) {\r
+ Console.WriteLine ("Usage : ilasm [filename]");\r
+ return 1;\r
+ }\r
+ \r
+ StreamReader reader = File.OpenText (args [0]);\r
ILTokenizer scanner = new ILTokenizer (reader);\r
\r
- bool testScanner = !true;\r
+ bool testScanner = true;\r
\r
if (testScanner) {\r
ILToken tok;\r
Console.WriteLine (tok);\r
}\r
} else {\r
- ILParser parser = new ILParser ();\r
+ ILParser parser = new ILParser (new CodeGen ());\r
parser.yyparse (new ScannerAdapter (scanner), new yydebug.yyDebugSimple ());\r
\r
CodeGen cg = parser.CodeGen;\r
int n = cg.ClassCount;\r
cg.Emit ();\r
}\r
+\r
+ return 0;\r
}\r
}\r