Exemplo n.º 1
0
	public static int Main (string[] args) {
		if (args.Length != 1) {
			Console.WriteLine ("Usage: test-parser.exe filename");
			return 1;
		}

		IMessageStoreCollection stores = new IMessageStoreCollection ();
		stores.Add (new CTSMessageTarget (typeof (Funcs)));
		LogoMessageTarget funcs = new LogoMessageTarget ();
		stores.Add (funcs);

		Parser parser = new Parser (stores, funcs);
		FileStream stream = new FileStream (args[0], FileMode.Open);
		InstructionList tree = parser.Parse (new StreamReader (stream));
		PrintTree (tree, 0);
		return 0;
	}
Exemplo n.º 2
0
		public Parser (IMessageStoreCollection stores, LogoMessageTarget funcs) {
			this.stores = stores;
			this.funcs = funcs;
		}
Exemplo n.º 3
0
		private void LoadFuncs () {
			funcs = new IMessageStoreCollection ();
			funcs.Add (new CTSMessageTarget (typeof (Funcs)));
			lmt = new LogoMessageTarget ();
			funcs.Add (lmt);
		}