00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include <lestes/common.hh>
00029 #include <lestes/ui/interp.hh>
00030 #include <lestes/ui/interp.g.hh>
00031 #include <lestes/ui/interp_actions.g.hh>
00032
00033 package(lestes);
00034 package(ui);
00035
00036 const char * code =
00037 " t nil ''t '(t) '(t . t)\n"
00038 " '(t t t nil a b c d e f) (set 'a 'b) a"
00039 " #'function #'car #'%fset"
00040 "\"aaa\""
00041 "((lambda l l) a t nil)"
00042 "(%fset 'list (lambda l l))"
00043 "(list a t t a)"
00044 "((lambda (a b) b) a t)"
00045 "((macro (a b) (list 'quote a)) baalzabub)"
00046 "(%fset 'defmacro"
00047 " (macro (n a . b)"
00048 " (list '%fset (list 'quote n)"
00049 " (list 'macro a . b))))"
00050 "(%fset 'defun"
00051 " (macro (n a . b)"
00052 " (list '%fset (list 'quote n)"
00053 " (list 'lambda a . b))))"
00054 "(defun atom (x) (not (consp x)))"
00055 "(defun not (x) (eq x nil))"
00056 "(%fset 'endp 'atom)"
00057 "(cond)"
00058 "(cond ((eq t nil) 'a)"
00059 " (t 'b))"
00060 "(defmacro if (a b c) (list 'cond (list a b) (list t c)))"
00061 ;
00062
00063 void yyparse();
00064
00065 int run()
00066 {
00067 l_interpreter::init();
00068 scan_string(code);
00069 yyparse();
00070 }
00071
00072 end_package(ui);
00073 end_package(lestes);
00074
00075 int main(int, char **)
00076 {
00077 return lestes::ui::run();
00078 }