Esempio n. 1
0
		public void Parse (Parser parser)
		{
			if (tree == null)
				tree = parser.Parse (tokens);
		}
Esempio n. 2
0
		public static object Execute (LogoContext context, ICollection runlist, params object[] template_args) {
			string[] runlist_strs = new string[runlist.Count];
			int i = 0;
			foreach (object o in runlist) {
				if (o is ICollection)
					runlist_strs[i] = Funcs.ListToString ((ICollection) o, 0, true);
				else
					runlist_strs[i] = o.ToString ();
				i++;
			}
			
			Interpreter interp = new Interpreter ((Interpreter) context.CallingEngine, context);
			interp.template_args = template_args;

			Parser parser = new Parser (interp.stores, null);
			parser.AllowQuestionMark = true;
			InstructionList tree = parser.Parse (runlist_strs);
			
			return interp.Execute (tree);
		}
Esempio n. 3
0
		private InstructionList Parse (string filename) {
			Parser parser = new Parser (funcs, lmt);
			FileStream stream = new FileStream (filename, FileMode.Open);
			return parser.Parse (new StreamReader (stream));
		}