lestes::ui Namespace Reference


Typedefs

typedef ptr< l_object > lp
typedef ptr< l_atom > lap
typedef list< srp< l_atom
> >::iterator 
lait
typedef ptr< l_object > lp

Functions

ptr< l_object > car (ptr< l_object > x)
ptr< l_object > cdr (ptr< l_object > x)
ptr< l_object > cons (ptr< l_object > a, ptr< l_object > d)
ptr< l_cons > extra_cons (ptr< l_object > a, ptr< l_object > d)
lp consp (lp x)
bool endp (lp x)
lp last_eval (lp x)
lp list_eval (lp x)
lp print (lp a)
ptr< l_object > eval (ptr< l_object > x)
void scan_string (lstring str)
void yyparse ()
int run ()
int main (ptr< ::lestes::std::vector< lstring > > args)
int yylex ()
void yyerror (lstring)

Variables

const char * code


Typedef Documentation

typedef list< srp < l_atom > >::iterator lestes::ui::lait

Definition at line 227 of file interp.cc.

typedef ptr< l_atom > lestes::ui::lap

Definition at line 37 of file interp.cc.

typedef ptr< l_object > lestes::ui::lp

Definition at line 36 of file interp.hh.

typedef ptr< l_object > lestes::ui::lp

Definition at line 34 of file interp.cc.


Function Documentation

lp lestes::ui::car ( ptr< l_object >  x  ) 

Definition at line 39 of file interp.cc.

Referenced by last_eval(), and list_eval().

00040 {
00041         return car_evaluator::instance()->go(x);
00042 }

lp lestes::ui::cdr ( ptr< l_object >  x  ) 

Definition at line 44 of file interp.cc.

Referenced by last_eval(), and list_eval().

00045 {
00046         return cdr_evaluator::instance()->go(x);
00047 }

lp lestes::ui::cons ( ptr< l_object >  a,
ptr< l_object >  d 
)

Definition at line 49 of file interp.cc.

00050 {
00051         return l_cons::create(a, d);
00052 }

lp lestes::ui::consp ( lp  x  ) 

Definition at line 59 of file interp.cc.

Referenced by endp().

00060 {
00061         return consp_evaluator::instance()->go(x);
00062 }

bool lestes::ui::endp ( lp  x  ) 

Definition at line 64 of file interp.cc.

References consp().

Referenced by last_eval(), and list_eval().

00065 {
00066         return consp(x) == l_interpreter::nil_get();
00067 }

lp lestes::ui::eval ( ptr< l_object >  x  ) 

Definition at line 104 of file interp.cc.

Referenced by last_eval(), and list_eval().

00105 {
00106         return basic_evaluator::instance()->go(x);
00107 }

ptr< l_cons > lestes::ui::extra_cons ( ptr< l_object >  a,
ptr< l_object >  d 
)

Definition at line 54 of file interp.cc.

Referenced by list_eval().

00055 {
00056         return l_cons::create(a, d);
00057 }

lp lestes::ui::last_eval ( lp  x  ) 

Definition at line 69 of file interp.cc.

References car(), cdr(), endp(), and eval().

00070 {
00071         lp res;
00072         while (!endp(x)) {
00073                 res = eval(car(x));
00074                 x = cdr(x);
00075         }
00076         return res;
00077 }

lp lestes::ui::list_eval ( lp  x  ) 

Definition at line 79 of file interp.cc.

References car(), cdr(), endp(), eval(), extra_cons(), and run().

00080 {
00081         ptr < l_cons > res, run, tmp;
00082         if (endp(x))
00083                 return eval(x);
00084         run = res = extra_cons(l_interpreter::nil_get(), l_interpreter::nil_get());
00085         while (!endp(x)) {
00086                 run->car_set(eval(car(x)));
00087                 x = cdr(x);
00088                 if (!endp(x)) {
00089                         tmp = extra_cons(l_interpreter::nil_get(), l_interpreter::nil_get());
00090                         run->cdr_set(tmp);
00091                         run = tmp;
00092                 }
00093         }
00094         run->cdr_set(eval(x));
00095         return res;
00096 }

int lestes::ui::main ( ptr< ::lestes::std::vector< lstring > >  args  ) 

Definition at line 40 of file ui/main.cc.

00041 {
00042         vector<lstring>::iterator it = args->begin();
00043         vector<lstring>::iterator end = args->end();
00044         lstring progname = args->front();
00045         ++it;
00046 
00047         lstring as_filename = "";
00048         lstring ss_filename = "";
00049 
00050         for ( ; it != end ; ++it) {
00051                 if ((*it)[0] != '-') {
00052                         tokeniser::input_set(istream_wrapper::create(
00053                                 new ::std::ifstream(it->c_str()), true));
00054                         goto name_was_set;
00055                 }
00056                 if (*it == "--dump-flat-as") {
00057                 }
00058         }
00059 name_was_set:
00060         if (++it != end) {
00061                 ::std::cerr << progname << ": extraneous argument: ``" << *it << "''\n";
00062                 exit(1);
00063         }
00064         return 0;
00065 }

lp lestes::ui::print ( lp  a  ) 

Definition at line 98 of file interp.cc.

00099 {
00100         printer::instance()->go(a);
00101         return a;
00102 }

int lestes::ui::run ( void   ) 

Definition at line 65 of file interp.test.cc.

References code, scan_string(), and yyparse().

Referenced by lestes::std::mem::gc_test(), list_eval(), and main().

00066 {
00067         l_interpreter::init();
00068         scan_string(code);
00069         yyparse();
00070 }

void lestes::ui::scan_string ( lstring  str  ) 

Referenced by run().

void lestes::ui::yyerror ( lstring   ) 

Definition at line 38 of file specs.cc.

00039 {
00040 }

int lestes::ui::yylex (  ) 

Referenced by lestes::lang::cplus::syn::source_streamer::next(), and lestes::lang::cplus::syn::yylex().

void lestes::ui::yyparse (  ) 


Variable Documentation

const char* lestes::ui::code

Initial value:

" t nil ''t '(t) '(t . t)\n"
" '(t t t nil a b c d e f) (set 'a 'b) a"
" #'function #'car #'%fset"
"\"aaa\""
"((lambda l l) a t nil)"
"(%fset 'list (lambda l l))"
"(list a t t a)"
"((lambda (a b) b) a t)"
"((macro (a b) (list 'quote a)) baalzabub)"
"(%fset 'defmacro"
"       (macro (n a . b)"
"             (list '%fset (list 'quote n)"
"                   (list 'macro a . b))))"
"(%fset 'defun"
"       (macro (n a . b)"
"             (list '%fset (list 'quote n)"
"                   (list 'lambda a . b))))"
"(defun atom (x) (not (consp x)))"
"(defun not (x) (eq x nil))"
"(%fset 'endp 'atom)"
"(cond)"
"(cond ((eq t nil) 'a)"
"      (t 'b))"
"(defmacro if (a b c) (list 'cond (list a b) (list t c)))"

Definition at line 36 of file interp.test.cc.

Referenced by lestes::md::mem::global_variable_allocator::emit_asm_declarations_for_initialized(), lestes::md::mem::global_variable_allocator::emit_asm_declarations_for_uninitialized(), lestes::backend_v2::workers::simple_spillgen::process(), run(), lestes::backend_v2::intercode::visitor_ge_operand2asm::visit_ge_operand_mem(), and lestes::backend_v2::intercode::visitor_ge_operand2asm::visit_ge_operand_reg().


Generated on Mon Feb 12 18:26:03 2007 for lestes by doxygen 1.5.1-20070107