adalisp_genesis 1
adalisp_genesis 2 with Ada.Text_IO; use Ada.Text_IO;
adalisp_genesis 3
adalisp_genesis 4 with Parser; use Parser;
adalisp_genesis 5 with Evaler; use Evaler;
adalisp_genesis 6 with LispM; use LispM;
adalisp_genesis 7
adalisp_genesis 8 procedure Test_Repl is
adalisp_genesis 9 P : MemPtr;
adalisp_genesis 10 TID : TokenID;
adalisp_genesis 11 begin
adalisp_genesis 12
adalisp_genesis 13 Init_Builtin_Bindings;
adalisp_genesis 14
adalisp_genesis 15 loop
adalisp_genesis 16 Put("> ");
adalisp_genesis 17
adalisp_genesis 18
adalisp_genesis 19 Parse(P, TID);
adalisp_genesis 20
adalisp_genesis 21
adalisp_genesis 22 case TID is
adalisp_genesis 23 when Error_Token =>
adalisp_genesis 24 Put("Parse error.");
adalisp_genesis 25 exit;
adalisp_genesis 26 when ListE_Token =>
adalisp_genesis 27 Put("Unexpected end of list.");
adalisp_genesis 28 exit;
adalisp_genesis 29 when others =>
adalisp_genesis 30 Eval(P, 0, P);
adalisp_genesis 31 end case;
adalisp_genesis 32
adalisp_genesis 33
adalisp_genesis 34 Dump_Cell(P); Put_Line("");
adalisp_genesis 35 end loop;
adalisp_genesis 36 end Test_Repl;