Ejemplo n.º 1
0
void
InliningRecursiveFibonacciMethod::defineStuff()
   {
   DefineLine(LINETOSTR(__LINE__));
   DefineFile(__FILE__);

   DefineName("fib");
   DefineParameter("n", Int32);
   DefineReturnType(Int32);

   DefineFunction((char *)"printString",
                  (char *)__FILE__,
                  (char *)PRINTSTRING_LINE,
                  (void *)&printString,
                  NoType,
                  1,
                  Int64);
   DefineFunction((char *)"printInt32",
                  (char *)__FILE__,
                  (char *)PRINTINT32_LINE,
                  (void *)&printInt32,
                  NoType,
                  1,
                  Int32);
   }
Ejemplo n.º 2
0
void GUI(void){	
  SetDefaultLineType(0);
  DefineGraphNxN_R("phi", &phi[0][0], &xdim, &ydim, NULL);
  DefineGraphNxN_R("psi", &psi[0][0], &xdim, &ydim, NULL);
  DefineGraphNxN_R("rho", &rho[0][0], &xdim, &ydim, NULL); 
  NewGraph();

  StartMenu("Ising Bilayer",1);

  SetActiveGraph(0);
  DefineGraph(contour2d_,"Visualize");

  //StartMenu("Controls",0);
  DefineInt("iterations", &iterations);
  DefineInt("repeat", &repeat);
  //DefineInt("stabilize", &stabilize);
  DefineDouble("phi_init", &r_zero[0]);
  DefineDouble("psi_init", &r_zero[1]);
  DefineDouble("Temperature", &T);
  DefineDouble("Lambda", &lambda);
  //EndMenu();

  StartMenu("Secondary Inputs",0);
  DefineInt("xdim", &xdim);
  DefineInt("ydim", &ydim);
  EndMenu();

  DefineFunction("reinitialize",&Init);

  DefineBool("Pause",&Pause);
  DefineBool("Single Step",&singlestep);
  DefineBool("Done",&done);	
  EndMenu();
}
Ejemplo n.º 3
0
DotProduct::DotProduct(TR::TypeDictionary *types)
   : MethodBuilder(types)

   {
   DefineLine(LINETOSTR(__LINE__));
   DefineFile(__FILE__);

   DefineName("dotproduct");

   pDouble = types->PointerTo(Double);

   DefineParameter("result", pDouble);
   DefineParameter("vector1", pDouble);
   DefineParameter("vector2", pDouble);
   DefineParameter("length", Int32);

   DefineReturnType(NoType);

   DefineFunction((char *)"printString", 
                  (char *)__FILE__,
                  (char *)PRINTSTRING_LINE,
                  (void *)&printString,
                  NoType,
                  1,
                  Int64);
   DefineFunction((char *)"printInt32", 
                  (char *)__FILE__,
                  (char *)PRINTINT32_LINE,
                  (void *)&printInt32,
                  NoType,
                  1,
                  Int32);
   DefineFunction((char *)"printDouble", 
                  (char *)__FILE__,
                  (char *)PRINTDOUBLE_LINE,
                  (void *)&printDouble,
                  NoType,
                  1,
                  Double);
   DefineFunction((char *)"printPointer", 
                  (char *)__FILE__,
                  (char *)PRINTPOINTER_LINE,
                  (void *)&printPointer,
                  NoType,
                  1,
                  Int64);
   }
Ejemplo n.º 4
0
void UserFunctions()
  {   
	  //extern void DxRecorderAlert();  
	  //DefineFunction("DxRecorderAlert",'v',PTIF DxRecorderAlert,"DxRecorderAlert"); 
	  //extern void MailAlert();  
	  //DefineFunction("MailAlert",'v',PTIF MailAlert,"MailAlert"); 
	  extern void IncrRiskFactorCnt();
	  DefineFunction("IncrRiskFactorCnt", 'v', PTIF IncrRiskFactorCnt,"IncrRiskFactorCnt");
	  extern void GetRiskFactorCnt();
	  DefineFunction("GetRiskFactorCnt", 'i', PTIF GetRiskFactorCnt,"GetRiskFactorCnt");
	  extern void InitRiskFactorCnt();
	  DefineFunction("InitRiskFactorCnt", 'v', PTIF InitRiskFactorCnt, "InitRiskFactorCnt");

	  extern void QueryResultsStruct();
	  extern void QueryResultsXML();
	  extern void PublishFact();
}
Ejemplo n.º 5
0
void GUI(){
  DefineGraphN_R("Density",density,&size,&densityreq);
  StartMenu("GUI",1);
    DefineDouble("T",&T);
    DefineDouble("omega",&omega);
    StartMenu("Restart",0);
      DefineMod("size",&size,SIZE+1);
      DefineDouble("Amplitude",&Amplitude);
      DefineFunction("Restart sin",&init);
      DefineFunction("Restart step",&init2);
    EndMenu();
    DefineGraph(curve2d_,"Density graph");
    DefineBool("Pause",&pause);
    DefineBool("Single step",&sstep);
    DefineInt("Repeat",&Repeat);    DefineBool("Done",&done);
  EndMenu();
}
Ejemplo n.º 6
0
void GUI(){
  DefineGraphNxN_R("rho",&rho[0][0],&Xdim,&Ydim,&rhoreq);
#ifdef DEBUG
  DefineGraphNxN_R("bb",&bb[0][0],&Xdim,&Ydim,&noreq);
  DefineGraphNxN_R("b1",&b1[0][0],&Xdim,&Ydim,&noreq);
  DefineGraphNxN_R("b3",&b3[0][0],&Xdim,&Ydim,&noreq);
  DefineGraphNxN_R("b5",&b5[0][0],&Xdim,&Ydim,&noreq);
  DefineGraphNxN_R("b6",&b6[0][0],&Xdim,&Ydim,&noreq);
#endif
  DefineGraphNxN_RxR("u",&u[0][0][0],&Xdim,&Ydim,&ureq);

  StartMenu("Lattice Boltzmann",1);
  DefineDouble("1/tau",&omega);
  DefineInt("Measurement freq.",&FrequencyMeasure);
  StartMenu("Reinitialize",0);
  DefineDouble("Amplitude",&Amp2);
  DefineDouble("Width",&Width);
  DefineFunction("reinitialize",&init);
  DefineFunction("Particle init",&initParticle);
  EndMenu();
  DefineDouble("Velocity amplitude",&Amp);
  StartMenu("Particle",0);
  DefineDouble("R",&R);
  DefineDouble("M",&M);
  DefineDouble("Ux",&Ux);
  DefineDouble("Uy",&Uy);
  DefineDouble("Cx",&Cx);
  DefineDouble("Cy",&Cy);
  DefineDouble("Mx",&Mx);
  DefineDouble("My",&My);
  EndMenu();
  DefineGraph(contour2d_,"Density&Vector plots");
  DefineInt("Repeat",&Repeat);
  DefineBool("Pause",&Pause);
  DefineBool("Single Step",&sstep);
  DefineBool("Done",&done);
  EndMenu();
}
Ejemplo n.º 7
0
int DefineTopLevelFunctions(struct Module *module, struct Ast *functionDefs) {
    unsigned int i;
    int result;
    if (!functionDefs) {
        return R_OK;
    }
    for (i = 0; i < functionDefs->NumChildren; ++i) {
        result = DefineFunction(module, functionDefs->Children[i]);
        if (R_OK != result) {
            break;
        }
    }
    return result;
}
Ejemplo n.º 8
0
/* DefineFunction2("DF2"",'i',PTIF DF2,"DF2","45iskuss"); */ 
int
DF2()
{
char c1, chr1[9] ,str1[99] ,str2[99] ,str3[99];
/*PTIF fncptr;  at the worst might have to give the return type &do a switch*/
int (*fncptr)();   /*might only be wrapping fnc that rtn ints anyway*/
    fncptr = PTIF get_ptr(3);
    if((int)fncptr < 999) printf("[fncptr=%d]",(int)fncptr); /*return(0);*/
    sprintf(str1,"%s",(char *)RtnLexeme(1));
    sprintf(chr1,"%s",(char *)RtnLexeme(2));
    sprintf(str2,"%s",(char *)RtnLexeme(4));
    c1= chr1[0];
    printf("[DefineFunction2 for:%s with type=%c]\n",str1,c1);
    if(RtnArgCount()>4)
    {
     sprintf(str3,"%s",(char *)RtnLexeme(5));
     DefineFunction2(str1,c1,PTIF fncptr,str2,str3); 
    }
    else DefineFunction(str1,c1,PTIF fncptr,str2); 
    return(1);
}
Ejemplo n.º 9
0
ThunkBuilder::ThunkBuilder(TR::TypeDictionary *types, const char *name, TR::IlType *returnType,
                           uint32_t numCalleeParams, TR::IlType **calleeParamTypes)
   : TR::MethodBuilder(types),
   _numCalleeParams(numCalleeParams),
   _calleeParamTypes(calleeParamTypes)
   {
   DefineLine(__FILE__);
   DefineFile(LINETOSTR(__LINE__));
   DefineName(name);
   DefineReturnType(returnType);
   DefineParameter("target", Address); // target
   DefineParameter("args", types->PointerTo(Word));     // array of arguments

   DefineFunction("thunkCallee",
                  __FILE__,
                  LINETOSTR(__LINE__),
                  0, // entry will be a computed value
                  returnType,
                  numCalleeParams,
                  calleeParamTypes);
   }
Ejemplo n.º 10
0
void ObjIeeeAscii::DefineType(int index, const char *buffer, int *pos)
{
    if (buffer[(*pos)++] != 'T')
        ThrowSyntax(buffer, eAll);
    int definer = ObjUtil::FromHex(buffer, pos);
    if (definer >= (int)ObjType::eVoid || index <= (int)ObjType::eReservedTop)
        ThrowSyntax(buffer, eAll);
    switch((ObjType::eType)definer)
    {
        case ObjType::ePointer:
            DefinePointer(index, buffer, pos);
            break;
        case ObjType::eBitField:
            DefineBitField(index, buffer, pos);
            break;
        case ObjType::eTypeDef:
            DefineTypeDef(index, buffer, pos);
            break;
        case ObjType::eArray:
        case ObjType::eVla:
            DefineArray((ObjType::eType)definer, index, buffer, pos);
            break;
        case ObjType::eFunction:
            DefineFunction(index, buffer, pos);
            break;
        case ObjType::eStruct:
        case ObjType::eUnion:
        case ObjType::eEnum:
        case ObjType::eField:
            DefineStruct((ObjType::eType)definer, index, buffer, pos);
            break;
        default:
            ThrowSyntax(buffer, eAll);
            break;
    }
}
Ejemplo n.º 11
0
	std::shared_ptr<ICommand> DefineFunction::Decode(std::shared_ptr<std::vector<char>> &data)
	{
		return std::make_shared<DefineFunction>(DefineFunction(m_funcId, m_classId, m_wstring, m_timestamp));
	}