public static Lisp LoadFile(string path) { StreamReader sr = new StreamReader(path); string txt = sr.ReadToEnd(); Sexp parser = new Sexp(txt); return(parser.Read()); }
public Form1() { InitializeComponent(); string secdComp = File.ReadAllText("../../../Compilers/compiler7.secd"); // Read the compiler object Sexp sx = new Sexp(secdComp); compiler = sx.Read(); vm = new VM(); }
private void Compile(object sender, EventArgs e) { vm.Clear(); vm.SetProgram(compiler); Sexp src = new Sexp(txtSource.Text); Lisp ssrc = src.Read(); vm.SetInput(new Cons(ssrc, null)); Run(); txtObject.Text = vm.Printed() + vm.STop; }
public void SetAll(string s, string e, string c, string d) { Sexp xp; xp = new Sexp(s); S = xp.Read(); xp = new Sexp(e); E = xp.Read(); xp = new Sexp(c); C = xp.Read(); xp = new Sexp(d); D = xp.Read(); }
private void RunLisp(object sender, EventArgs e) { vm.Clear(); Sexp sx = new Sexp(txtObject.Text); Lisp prog = sx.Read(); vm.SetProgram(prog); string argstr = txtArgs.Text.Trim(); if (argstr != "") { Sexp args = new Sexp(argstr); vm.SetInput(args.Read()); } else { vm.SetInput(null); } Run(); txtResult.Text = vm.Printed() + vm.STop; }