Beispiel #1
0
std:: string ParameterDecl:: toString(ASTOutputEnum config) 
{ 
      LvarSymbolTable::Entry e = var->get_entry();
      std::string res =  "<parameter " + e.get_name()->toString(OUTPUT_NO_DEBUG); 
      if (parse != 0) 
         res = res + " parse=" +  parse->toString(ASTOutputEnum(config | DEBUG_NO_VAR));
      if (e.get_restr() != 0) 
         res = res + " type=" + e.get_restr()->toString(ASTOutputEnum(config | DEBUG_NO_VAR));
      if (init != 0)  
         res = res + " default=" + init->toString(ASTOutputEnum(config | DEBUG_NO_VAR));
      if (msg != 0) 
         res = res + " message=" + msg->toString(ASTOutputEnum(config | DEBUG_NO_VAR));
      res = res + "/>";
      return res; 
   }
Beispiel #2
0
 virtual void visitLocalVar(LocalVar* var) 
   {
      LvarSymbolTable::Entry e = var->get_entry();
      POETCode *restr = e.get_restr();
      if (restr == 0) {
         CollectInfoVisitor::visitLocalVar(var);
         return;
      }
      if (restr->get_enum() == SRC_CVAR) {
         CodeVar* cvar = static_cast<CodeVar*>(restr);
         POETCode* code = e.get_code();
         if (code!=0 && !match_AST(code, cvar,MATCH_AST_EQ)) {
            CodeVar* tmp = ASTFactory::inst()->new_codeRef(cvar->get_entry(), code); 
            tmp->visit(this); 
            return; 
         }
      }
      else if (restr->get_enum() == SRC_OP) {
          POETOperator* op = static_cast<POETOperator*>(restr);
          if (op->get_op() == POET_OP_LIST || op->get_op()==POET_OP_LIST1)  {
              POETCode* _listsep = listsep;
              CodeVar* _listelem = listelem;
              int save = align;
              align = start_pos;
              listsep = op->get_arg(1);
              listelem=dynamic_cast<CodeVar*>(op->get_arg(0));
              CollectInfoVisitor::visitLocalVar(var);
              align = save; listsep = _listsep; listelem = _listelem;
              return;
           }
      }
      CollectInfoVisitor::visitLocalVar(var);
   }
Beispiel #3
0
 virtual void visitLocalVar(LocalVar* v)
 {
    LvarSymbolTable::Entry e =v->get_entry();
    POETCode* code = e.get_code();
    if (code != v && code != 0)  code->visit(this); 
    else {
       POETCode* restr =  e.get_restr();
       if (restr != 0) restr->visit(this);
       else SYM_UNDEFINED(v->toString());
       e.set_code(res);
    }
 }