Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Main.cs « ilasm « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a7fe5edb1337c64ce5782ebf9a76de01863a0d89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using System.IO;

using Mono.ILASM;


public class ILAsmTest {
	private ILAsmTest() {}


	public static int Main (string [] args) {

		if (args.Length != 1) {
			Console.WriteLine ("Usage : ilasm [filename]");
			return 1;
		}
		
		StreamReader reader = File.OpenText (args [0]);
		ILTokenizer scanner = new ILTokenizer (reader);

		bool testScanner = true;

		if (testScanner) {
			ILToken tok;
			while ((tok = scanner.NextToken) != ILToken.EOF) {
				Console.WriteLine (tok);
			}
		} else {
			ILParser parser = new ILParser (new CodeGen ());
			parser.yyparse (new ScannerAdapter (scanner), new yydebug.yyDebugSimple ());

			CodeGen cg = parser.CodeGen;
			int n = cg.ClassCount;
			cg.Emit ();
		}

		return 0;
	}
}