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

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

		Parser parser = new Parser (stores, new LogoMessageTarget ());
		FileStream stream = new FileStream (args[0], FileMode.Open);
		InstructionList tree = parser.Parse (new StreamReader (stream));
		Interpreter interp = new Interpreter (stores);
		interp.Execute (tree);
		return 0;
	}
Beispiel #2
0
		public Interpreter (Interpreter interp, LogoContext context) {
			this.stores = interp.stores;
			this.context = context;
		}
Beispiel #3
0
		public Interpreter (IMessageStoreCollection stores) {
			this.stores = stores;
			context = new LogoContext (null);
		}
Beispiel #4
0
		public static Compiler Create (IMessageStoreCollection stores) {
			return new CSharpCompiler (stores);
		}
Beispiel #5
0
		protected Compiler (IMessageStoreCollection stores) {
			this.stores = stores;
			context = new LogoContext (null);
		}
Beispiel #6
0
		public Parser (IMessageStoreCollection stores, LogoMessageTarget funcs) {
			this.stores = stores;
			this.funcs = funcs;
		}
Beispiel #7
0
		public Parser () {
			stores = new IMessageStoreCollection ();
		}
Beispiel #8
0
		private void LoadFuncs () {
			funcs = new IMessageStoreCollection ();
			funcs.Add (new CTSMessageTarget (typeof (Funcs)));
			lmt = new LogoMessageTarget ();
			funcs.Add (lmt);
		}
Beispiel #9
0
		internal CSharpCompiler (IMessageStoreCollection stores) : base (stores) {
		}