Exemplo n.º 1
0
void printtypelist(){
     int i;
     pput("Type List\n");
     for (i=0; i<numtypes; i++) {
	  printf("%3d : %3d : ",i,typelist[i]->body.type.seqno);
	  if (typelist[i]->body.type.name != NULL
	       && typelist[i]->body.type.definition != NULL) {
	       pprint(typelist[i]->body.type.name);
	       put(" : ");
	       pp(typelist[i]->body.type.definition);
	       }
	  else pp(typelist[i]);
	  }
     pput("\n");
     }
Exemplo n.º 2
0
void printstringlist(){
     node p;
     unsigned int h;
     pput("String Table\n");
     for (h=0; h<numberof(hash_buckets); h++) {
	  for (p = hash_buckets[h]; p != NULL; p = CDR(p)) {
	       node str = CAR(p);
	       assertpos(isstr(str),str);
	       pprint(str);
	       pput(" : ");
	       pprint(str->body.unique_string.symbol_list);
	       pput("\n");
	       }
	  }
     pput("\n");
     }
Exemplo n.º 3
0
static void psymbol(node s){
     assertpos(s->tag == symbol_tag,s);
     cprint(s->body.symbol.name);
     if (s->body.symbol.cprintvalue) {
	  put("\n      cprintvalue => ");
	  cprint(s->body.symbol.cprintvalue);
	  put("\n      ");
	  }
     if (s->body.symbol.Cname != NULL) {
	  put("\n      Cname => ");
	  put(s->body.symbol.Cname);
	  }
     put("\n      type => ");
     pprint(s->body.symbol.type);
     put("\n      value => ");
     if (s->body.symbol.value != NULL) {
	  node val = s->body.symbol.value;
	  if (istype(val) && val->body.type.name == s) {
	       pprint(val->body.type.definition);
	       }
	  else pprint(val);
	  }
     else {
       put("none");
       }
     put("\n      flags:");
     if (s->body.symbol.flags & macro_function_F) put(" macro-function");
     if (s->body.symbol.flags & macro_variable_F) put(" macro-variable");
     if (s->body.symbol.flags & readonly_F) put(" readonly");
     if (s->body.symbol.flags & symbol_F) put(" symbol");
     if (s->body.symbol.flags & keyword_F) put(" keyword");
     if (s->body.symbol.flags & constant_F) put(" constant");
     if (s->body.symbol.flags & defined_F) put(" initialized");
     if (s->body.symbol.flags & export_F) put(" export");
     if (s->body.symbol.flags & import_F) put(" import");
     if (s->body.symbol.flags & threadLocal_F) put(" thread");
     if (s->body.symbol.flags & const_F) put(" const");
     if (s->body.symbol.flags & global_F) put(" global");
     if (s->body.symbol.flags & literal_F) put(" literal");
     if (s->body.symbol.flags & visible_F) put(" visible");
     if ( !(s->body.symbol.flags & defined_F) && !(s->body.symbol.flags & import_F) ) put(" (never initialized)");
     if (s->body.symbol.args != NULL) {
	  put("\n      args => ");
	  cprintlist(s->body.symbol.args);
	  }
     if (s->body.symbol.body != NULL) {
	  put("\n      body => ");
	  pprint(s->body.symbol.body);
	  }
     if (s->body.symbol.export_list != NULL) {
	  put("\n      export_list => ");
	  cprintlist(s->body.symbol.export_list);
	  }
     pput("\n");
     }
Exemplo n.º 4
0
void printsymboltable(){
     node p;
     pput("Symbol Table\n");
     for (p = complete_symbol_list; p != NULL; p = CDR(p)) psymbol(CAR(p));
     pput("\n");
     }
Exemplo n.º 5
0
	int32 Interp::addCommand(Command* c)
	{
		c->setEnabled(true);
		return pput(c->getName(), (char *) c);
	}