Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

Commit 39b21c8d authored by kruger's avatar kruger
Browse files

Nouvelle Version avec lib

parent f1f92700
......@@ -41,7 +41,7 @@ extern CSymbol *pCURRENT_CLASS, *pCURRENT_TYPE, *pGENOME, *pCLASSES[128];
extern int nClasses_nb;
extern FILE *fpOutputFile, *fpTemplateFile, *fpGenomeFile, *fpExplodedGenomeFile;
extern char sRAW_PROJECT_NAME[], sPROJECT_NAME[], sEO_DIR[], sEZ_PATH[1000], sEZ_FILE_NAME[];
extern char sRAW_PROJECT_NAME[], sPROJECT_NAME[], sEO_DIR[], sEZ_PATH[1000], sTPL_DIR[1000], sEZ_FILE_NAME[];
extern char sLOWER_CASE_PROJECT_NAME[];
extern char sREPLACEMENT[], sSELECTOR[], sSELECT_PRM[], sRED_PAR[], sRED_PAR_PRM[], sRED_FINAL[], sRED_FINAL_PRM[], sRED_OFF[], sRED_OFF_PRM[], sDISCARD[], sDISCARD_PRM[];
extern int nMINIMISE,nELITE;
......
%{
/****************************************************************************
/****************************************************************************
EaseaLex.l
Lexical analyser for the EASEA language (EAsy Specification for Evolutionary Algorithms)
......@@ -9,10 +9,17 @@ Ecole Polytechnique
Centre de Mathmatiques Appliques
91128 Palaiseau cedex
****************************************************************************/
#ifdef WIN32
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(lib, "libAlexYacc.lib")
#endif
#include "Easea.h"
#include "EaseaParse.h"
#ifdef WIN32
#include <direct.h>
#else
#include <unistd.h>
#endif
#include "debug.h"
size_t genomeSize;
......@@ -41,7 +48,7 @@ Centre de Math
strcat(selectorName,"Roulette(globalRandomGenerator)");
else{
DEBUG_PRT("%s is not yet implemented",sSELECTOR);
//DEBUG_PRT_PRT("%s is not yet implemented",sSELECTOR);
return NULL;
}
......@@ -135,6 +142,7 @@ exponent ([Ee][+-]?[0-9]+)
<TEMPLATE_ANALYSIS>"AESAE" {fprintf(fpOutputFile,"EASEA");}
<TEMPLATE_ANALYSIS>"EASEA" {fprintf(fpOutputFile,"%s",sPROJECT_NAME);}
<TEMPLATE_ANALYSIS>"\\EZ_PATH" {fprintf(fpOutputFile,"%s",sEZ_PATH);}
<TEMPLATE_ANALYSIS>"\\TPL_DIR" {fprintf(fpOutputFile,"%s",sTPL_DIR);}
<TEMPLATE_ANALYSIS>"\\EO_DIR" {fprintf(fpOutputFile,"%s",sEO_DIR);}
<TEMPLATE_ANALYSIS>"LC_EASEA" {fprintf(fpOutputFile,"%s",sLOWER_CASE_PROJECT_NAME);}
<TEMPLATE_ANALYSIS>"\\OPERATING_SYSTEM" {switch (OPERATING_SYSTEM) {
......@@ -164,7 +172,7 @@ exponent ([Ee][+-]?[0-9]+)
<TEMPLATE_ANALYSIS>"\\INSERT_BEGIN_GENERATION_FUNCTION" {
DEBUG_PRT("insert beg");
//DEBUG_PRT_PRT("insert beg");
if (bVERBOSE) printf ("Inserting at the begining of each generation function.\n");
yyreset();
yyin = fpGenomeFile;
......@@ -175,7 +183,7 @@ exponent ([Ee][+-]?[0-9]+)
<TEMPLATE_ANALYSIS>"\\INSERT_END_GENERATION_FUNCTION" {
DEBUG_PRT("insert end");
//DEBUG_PRT_PRT("insert end");
if (bVERBOSE) printf ("Inserting at the end of each generation function.\n");
yyreset();
yyin = fpGenomeFile;
......@@ -207,21 +215,21 @@ exponent ([Ee][+-]?[0-9]+)
pGENOME->pSymbolList->reset();
while (pSym=pGENOME->pSymbolList->walkToNextItem())
if ((pSym->Object->pType->ObjectType==oUserClass)&&(!pSym->Object->pType->bAlreadyPrinted)){
DEBUG_PRT("%p",pSym->Object->pType);
//DEBUG_PRT_PRT("%p",pSym->Object->pType);
pSym->Object->pType->printClasses(fpOutputFile);
}
if( TARGET == CUDA ){
DEBUG_PRT("User classes are :");
//DEBUG_PRT_PRT("User classes are :");
for( int i = nClasses_nb-1 ; i>=0 ; i-- ){
DEBUG_PRT(" %s, %p ,%d| ",pCLASSES[i]->sName,pCLASSES[i],pCLASSES[i]->bAlreadyPrinted);
//DEBUG_PRT_PRT(" %s, %p ,%d| ",pCLASSES[i]->sName,pCLASSES[i],pCLASSES[i]->bAlreadyPrinted);
if( !pCLASSES[i]->bAlreadyPrinted ){
fprintf(fpOutputFile,"// User class not refereced by the Genome");
pCLASSES[i]->printClasses(fpOutputFile);
}
}
DEBUG_PRT("\n");
//DEBUG_PRT_PRT("\n");
}
}
<TEMPLATE_ANALYSIS>"\\GENOME_CTOR" {
......@@ -247,10 +255,10 @@ exponent ([Ee][+-]?[0-9]+)
CListItem<CSymbol*> *pSym;
pGENOME->pSymbolList->reset();
while (pSym=pGENOME->pSymbolList->walkToNextItem()){
DEBUG_PRT("%s has size : %lu",pSym->Object->sName,pSym->Object->nSize);
//DEBUG_PRT_PRT("%s has size : %lu",pSym->Object->sName,pSym->Object->nSize);
size_of_genome+=pSym->Object->nSize;
}
DEBUG_PRT("Total genome size is %lu",size_of_genome);
//DEBUG_PRT_PRT("Total genome size is %lu",size_of_genome);
genomeSize = size_of_genome;
genomeSizeValidity=true;
}
......@@ -307,7 +315,7 @@ exponent ([Ee][+-]?[0-9]+)
if (bVERBOSE) printf ("Inserting default genome serializer.\n");
pGENOME->pSymbolList->reset();
while (pSym=pGENOME->pSymbolList->walkToNextItem()){
DEBUG_PRT("found new symbol %s",pSym->Object->sName);
//DEBUG_PRT_PRT("found new symbol %s",pSym->Object->sName);
fprintf(fpOutputFile," ar & %s;\n",pSym->Object->sName);
}
}
......@@ -652,19 +660,19 @@ exponent ([Ee][+-]?[0-9]+)
}
<TEMPLATE_ANALYSIS>"\\INSERT_USER_CLASSES_DEFINITIONS" {
DEBUG_PRT("Inserting user classe definitions");
//DEBUG_PRT_PRT("Inserting user classe definitions");
pGENOME->printUserClasses(fpOutputFile);
}
<TEMPLATE_ANALYSIS>"\\SELECTOR" {
if( TARGET==CUDA || TARGET==STD){
DEBUG_PRT("Selector is \"%s\" | Goal is %s",sSELECTOR,(nMINIMISE?"Minimize":"Maximize"));
//DEBUG_PRT_PRT("Selector is \"%s\" | Goal is %s",sSELECTOR,(nMINIMISE?"Minimize":"Maximize"));
char* selectorClass = selectorDetermination(nMINIMISE,sSELECTOR);
if( !selectorClass ){
fprintf(stderr,"Error %d : selection operator %s doesn't exist in CUDA/STD template\n",yylineno,sSELECTOR);
return -1;
}
DEBUG_PRT("Created class is %s",selectorClass);
//DEBUG_PRT_PRT("Created class is %s",selectorClass);
fprintf(fpOutputFile,"%s",selectorClass);
}
else fprintf(fpOutputFile,"%s",sSELECTOR);
......@@ -675,18 +683,18 @@ exponent ([Ee][+-]?[0-9]+)
<TEMPLATE_ANALYSIS>"\\OFF_SIZE" {fprintf(fpOutputFile,"%d",nOFF_SIZE);}
<TEMPLATE_ANALYSIS>"\\ELITE_SIZE" {
fprintf(fpOutputFile,"%d",nELITE);
//DEBUG_PRT("elitism is %d, elite size is %d",bELITISM, nELITE);
////DEBUG_PRT_PRT("elitism is %d, elite size is %d",bELITISM, nELITE);
}
<TEMPLATE_ANALYSIS>"\\RED_PAR" {
if( TARGET==CUDA || TARGET==STD){
DEBUG_PRT("Parent reduction is \"%s\" | Goal is %s",sSELECTOR,(nMINIMISE?"Minimize":"Maximize"));
//DEBUG_PRT_PRT("Parent reduction is \"%s\" | Goal is %s",sSELECTOR,(nMINIMISE?"Minimize":"Maximize"));
char* selectorClass = selectorDetermination(nMINIMISE,sSELECTOR);
if( !selectorClass ){
fprintf(stderr,"Error %d : selection operator %s doesn't exist in CUDA/STD template\n",yylineno,sSELECTOR);
return -1;
}
DEBUG_PRT("Created class is %s",selectorClass);
//DEBUG_PRT_PRT("Created class is %s",selectorClass);
fprintf(fpOutputFile,"%s",selectorClass);
}
else fprintf(fpOutputFile,"%s",sRED_PAR);
......@@ -699,13 +707,13 @@ exponent ([Ee][+-]?[0-9]+)
}
<TEMPLATE_ANALYSIS>"\\RED_OFF" {
if( TARGET==CUDA || TARGET==STD){
DEBUG_PRT("Offspring reduction is \"%s\" | Goal is %s",sSELECTOR,(nMINIMISE?"Minimize":"Maximize"));
//DEBUG_PRT_PRT("Offspring reduction is \"%s\" | Goal is %s",sSELECTOR,(nMINIMISE?"Minimize":"Maximize"));
char* selectorClass = selectorDetermination(nMINIMISE,sSELECTOR);
if( !selectorClass ){
fprintf(stderr,"Error %d : selection operator %s doesn't exist in CUDA/STD template\n",yylineno,sSELECTOR);
return -1;
}
DEBUG_PRT("Created class is %s",selectorClass);
//DEBUG_PRT_PRT("Created class is %s",selectorClass);
fprintf(fpOutputFile,"%s",selectorClass);
}
else fprintf(fpOutputFile,"%s",sRED_OFF);
......@@ -717,17 +725,21 @@ exponent ([Ee][+-]?[0-9]+)
fprintf(fpOutputFile,"%s",sRED_OFF_PRM);}
<TEMPLATE_ANALYSIS>"\\RED_FINAL" {
if( TARGET==CUDA || TARGET==STD){
DEBUG_PRT("Replacement selector is \"%s\" | Goal is %s",sRED_FINAL,(nMINIMISE?"Minimize":"Maximize"));
//DEBUG_PRT_PRT("Replacement selector is \"%s\" | Goal is %s",sRED_FINAL,(nMINIMISE?"Minimize":"Maximize"));
char* selectorClass = selectorDetermination(nMINIMISE,sRED_FINAL);
if( !selectorClass ){
fprintf(stderr,"Error %d : replacement operator %s doesn't exist in CUDA/TPL template\n",yylineno,sRED_FINAL);
return -1;
}
DEBUG_PRT("Created class is %s",selectorClass);
//DEBUG_PRT_PRT("Created class is %s",selectorClass);
fprintf(fpOutputFile,"%s",selectorClass);
}
else fprintf(fpOutputFile,"%s",sRED_FINAL);
}
<TEMPLATE_ANALYSIS>"\\CUDA_RULE_DIR" {
if(OPERATING_SYSTEM=WINDOWS)
fprintf(fpOutputFile,"%s\\",getenv("NVSDKCUDA_ROOT"));
}
<TEMPLATE_ANALYSIS>"\\RED_FINAL_PRM" {fprintf(fpOutputFile,"%s",sRED_FINAL_PRM);}
<TEMPLATE_ANALYSIS>"\\SURV_PAR_SIZE" {fprintf(fpOutputFile,"%d",nSURV_PAR_SIZE);}
<TEMPLATE_ANALYSIS>"\\SURV_OFF_SIZE" {fprintf(fpOutputFile,"%d",nSURV_OFF_SIZE);}
......@@ -931,6 +943,15 @@ exponent ([Ee][+-]?[0-9]+)
fpOutputFile=fopen(sFileName,"w");
}
<TEMPLATE_ANALYSIS>"\\START_VISUAL_TPL" {
char sFileName[1000];
fclose(fpOutputFile);
strcpy(sFileName, sRAW_PROJECT_NAME);
strcat(sFileName,".vcproj");
if (bVERBOSE) printf("Creating %s...\n",sFileName);
fpOutputFile=fopen(sFileName,"w");
}
<TEMPLATE_ANALYSIS>"\\START_CUDA_MAKEFILE_TPL" {
char sFileName[1000];
char sPathName[1000];
......@@ -949,8 +970,12 @@ exponent ([Ee][+-]?[0-9]+)
if( fileNameLength != -1 ){
// add "Makefile" at the end of path
//char* cdn = get_current_dir_name();
char cdn[4096];
char cdn[4096];
#ifdef WIN32
_getcwd(cdn,4096);
#else
getcwd(cdn,4096);
#endif
size_t cdnLength = strlen(cdn);
strcpy(sFullFileName,cdn);
strcat(sFullFileName,"/\0");
......@@ -959,17 +984,18 @@ exponent ([Ee][+-]?[0-9]+)
strncpy(sPathName,sRAW_PROJECT_NAME,fileNameLength);
strcpy(sPathName+fileNameLength,"/Makefile");
DEBUG_PRT("PathName is %s",sPathName);
DEBUG_PRT("FullFileName is %s",sFullFileName);
//DEBUG_PRT_PRT("PathName is %s",sPathName);
//DEBUG_PRT_PRT("FullFileName is %s",sFullFileName);
// create a symbolic link from Makefile to EASEA.mak
symlink(sFullFileName,sPathName);
}
else{
DEBUG_PRT("file name : %s",sFileName);
//DEBUG_PRT_PRT("file name : %s",sFileName);
if( symlink(sFileName,"Makefile") ) perror("Symlink creation error ");
}
if (bVERBOSE){
......@@ -981,7 +1007,7 @@ exponent ([Ee][+-]?[0-9]+)
fprintf(stderr,"Error in %s creation\n",sFileName);
exit(-1);
}
}
}
<TEMPLATE_ANALYSIS>"\\START_EVAL_TPL" {
......@@ -1147,7 +1173,7 @@ exponent ([Ee][+-]?[0-9]+)
break;
case STD:
case CUDA:
fprintf (fpOutputFile,"// Finalization function\nvoid EASEAFinalization(Population* population){");
fprintf (fpOutputFile,"// Finalization function\nvoid EASEAFinalization(CPopulation* population){");
break;
default:
fprintf (stderr," Error this template doesn't support finalization function ");
......@@ -1169,9 +1195,10 @@ exponent ([Ee][+-]?[0-9]+)
<COPY_END_GENERATION_FUNCTION>"\\At"[ \t\n]+"the"[ \t\n]+"end"[ \t\n]+"of"[ \t\n]+"each"[ \t\n]+"generation"[ \t\n]+"function"[ \t\n]*":" {
DEBUG_PRT("at each end");
//DEBUG_PRT_PRT("at each end");
if( (TARGET==CUDA || TARGET==STD) ){
fprintf (fpOutputFile,"// Function called at each new generation\nvoid EASEAEndGenerationFunction(EvolutionaryAlgorithm* evolutionaryAlgorithm){\n");
fprintf (fpOutputFile,"{\n");
//fprintf (fpOutputFile,"// Function called at each new generation\nvoid EASEAEndGenerationFunction(EvolutionaryAlgorithm* evolutionaryAlgorithm){\n");
bFunction=1;
bEndGenerationFunction = 1;
BEGIN COPY_USER_GENERATION;
......@@ -1192,9 +1219,9 @@ exponent ([Ee][+-]?[0-9]+)
<COPY_BEG_GENERATION_FUNCTION>"\\At"[ \t\n]+"the"[ \t\n]+"beginning"[ \t\n]+"of"[ \t\n]+"each"[ \t\n]+"generation"[ \t\n]+"function"[ \t\n]*":" {
DEBUG_PRT("at each beg");
//DEBUG_PRT_PRT("at each beg");
if( (TARGET==CUDA || TARGET==STD)){
fprintf (fpOutputFile,"// Function called at each new generation\nvoid EASEABeginningGenerationFunction(EvolutionaryAlgorithm* evolutionaryAlgorithm){\n");
fprintf (fpOutputFile,"{\n");
bFunction=1;
bBeginGeneration = 0;
bBeginGenerationFunction = 1;
......@@ -1217,7 +1244,7 @@ exponent ([Ee][+-]?[0-9]+)
<COPY_GENERATION_FUNCTION>"\\At"[ \t\n]+"each"[ \t\n]+"new"[ \t\n]+"generation"[ \t\n]*":" {
DEBUG_PRT("at each");
//DEBUG_PRT_PRT("at each");
if( TARGET==GALIB ){
fprintf (fpOutputFile,"// Function called at each new generation\n\nvoid EASEAGenerationFunction(GAGeneticAlgorithm & g){\n");
fprintf(fpOutputFile," const GAPopulation *pPopulation;\n",sPROJECT_NAME);
......@@ -1482,7 +1509,7 @@ exponent ([Ee][+-]?[0-9]+)
//****************************************
<COPY_DISPLAY>"\\GenomeClass::display"[ \t\n]*":" {
/* DEBUG_PRT("Display function is at %d line in %s.ez",yylineno,sRAW_PROJECT_NAME); */
/* //DEBUG_PRT_PRT("Display function is at %d line in %s.ez",yylineno,sRAW_PROJECT_NAME); */
/* fprintf(fpOutputFile,"\n#line %d \"%s.ez\"\n",yylineno,sRAW_PROJECT_NAME); */
bDisplayFunction=bWithinDisplayFunction=1;
BEGIN COPY_USER_FUNCTION;
......@@ -1497,7 +1524,7 @@ exponent ([Ee][+-]?[0-9]+)
<COPY_DISPLAY>.|\n {}
<COPY_MAKEFILE_OPTION>"\\User"[ \t\n]+[Mm]"akefile"[ \t\n]+"options"[ \t\n]*":" {
DEBUG_PRT("LDFLAGS is beg: %s",yytext);
//DEBUG_PRT_PRT("LDFLAGS is beg: %s",yytext);
bWithinMAKEFILEOPTION=1;
return MAKEFILE_OPTION;
}
......@@ -1509,7 +1536,7 @@ exponent ([Ee][+-]?[0-9]+)
//****************************************
<COPY_MAKEFILE_OPTION>"\\end" {
if( bWithinMAKEFILEOPTION ){
DEBUG_PRT("end of makefile options");
//DEBUG_PRT_PRT("end of makefile options");
yyin = fpTemplateFile;
bWithinMAKEFILEOPTION = 0;
BEGIN TEMPLATE_ANALYSIS;
......@@ -1528,7 +1555,7 @@ exponent ([Ee][+-]?[0-9]+)
}
<COPY_MAKEFILE_OPTION><<EOF>> {
DEBUG_PRT("No makefile options defined.");
//DEBUG_PRT_PRT("No makefile options defined.");
yyin = fpTemplateFile;
bWithinMAKEFILEOPTION = 0;
......@@ -1918,7 +1945,7 @@ exponent ([Ee][+-]?[0-9]+)
if (TARGET==DREAM) fprintf(fpOutputFile,"Math.random()<");} // local random name
<COPY_USER_FUNCTION>"random" {
if (TARGET==DREAM) fprintf(fpOutputFile,"%s.random",sPROJECT_NAME);
else if( TARGET==CUDA || TARGET==STD) fprintf(fpOutputFile,"rg->random");
else if( TARGET==CUDA || TARGET==STD) fprintf(fpOutputFile,"globalRandomGenerator->random");
else fprintf(fpOutputFile,"random");}
<COPY_USER_FUNCTION>"child1" {if ((bWithinXover)&&(TARGET==GALIB)) fprintf(fpOutputFile, "(*pBro)");
else fprintf(fpOutputFile,"child1");
......@@ -2092,10 +2119,10 @@ int CEASEALexer::create(CEASEAParser* pParser, CSymbolTable* pSymTable)
char sTemp[1000];
#if defined UNIX_OS
OPERATING_SYSTEM=UNIX;
#elif defined WINDOWS_OS
#elif defined WIN32 //WINDOWS_OS
OPERATING_SYSTEM=WINDOWS;
#else
OPERATING_SYSTEM=OTHER_SYSTEM;
//#else
// OPERATING_SYSTEM=OTHER_SYSTEM;
#endif
assert(pParser != NULL);
assert(pSymTable != NULL);
......@@ -2130,17 +2157,23 @@ int CEASEALexer::create(CEASEAParser* pParser, CSymbolTable* pSymTable)
//strcpy(sTemp,"e:\\lutton\\easea\\debug");pour tester sous windows
if ((sEZ_PATH==NULL)||(sEZ_PATH[0]==0)) {
if (getenv("EZ_PATH")==NULL){
strcpy(sEZ_PATH,"./tpl/");
//strcpy(sEZ_PATH,"./tpl/");
strcpy(sEZ_PATH,"./");
}else
strcpy(sEZ_PATH,getenv("EZ_PATH"));
}
strcpy(sTPL_DIR,sEZ_PATH);
strcat(sTPL_DIR,"tpl/");
switch (OPERATING_SYSTEM) {
case UNIX : if (sEZ_PATH[strlen(sEZ_PATH)-1] != '/') strcat (sEZ_PATH,"./"); break;
case WINDOWS : if (sEZ_PATH[strlen(sEZ_PATH)-1] != '\\') strcat (sEZ_PATH,"\\"); break;
case UNKNOWN_OS : fprintf(fpOutputFile,"UNKNOWN_OS"); break;
}
strcpy(sTemp,sEZ_PATH);
//strcpy(sTemp,sEZ_PATH);
strcpy(sTemp,sTPL_DIR);
if (TARGET==EO){
strcat(sTemp,"EO.tpl");
if (!(yyin = fpTemplateFile = fopen(sTemp, "r"))){
......
......@@ -25,6 +25,7 @@ char sLOWER_CASE_PROJECT_NAME[1000];
char sEZ_FILE_NAME[1000];
char sEO_DIR[1000];
char sEZ_PATH[1000];
char sTPL_DIR[1000];
int TARGET,TARGET_FLAVOR;
int OPERATING_SYSTEM;
int nWARNINGS=0;
......@@ -235,12 +236,12 @@ ClassDeclaration
pCURRENT_CLASS=SymbolTable.insert($1);
pCURRENT_CLASS->pSymbolList=new CLList<CSymbol *>();
$1->ObjectType=oUserClass;
DEBUG_PRT("Yacc Symbol declaration %s %d",$1->sName,$1->nSize);
//DEBUG_PRT("Yacc Symbol declaration %s %d",$1->sName,$1->nSize);
pCLASSES[nClasses_nb++] = $1;
}
'{' VariablesDeclarations '}' {
if (bVERBOSE) printf("Class %s declared for %d bytes.\n\n",$1->sName,$1->nSize);
DEBUG_PRT("Yacc variable declaration %s %d",$1->sName,$1->nSize);
//DEBUG_PRT("Yacc variable declaration %s %d",$1->sName,$1->nSize);
}
;
......@@ -387,7 +388,7 @@ BaseConstructorParameter
GenomeDeclarationSection
: GENOME {
//DEBUG_PRT("Yacc genome decl %s",$1.pSymbol->sName);
////DEBUG_PRT("Yacc genome decl %s",$1.pSymbol->sName);
if (bVERBOSE) printf ("\nGenome declaration analysis :\n\n");
pGENOME=new CSymbol("Genome");
pCURRENT_CLASS=SymbolTable.insert(pGENOME);
......@@ -499,7 +500,7 @@ StandardFunctionAnalysis
if (TARGET!=EO && TARGET!=CUDA && TARGET!=STD) fprintf(fpOutputFile,"}\n");
}
| MAKEFILE_OPTION END_OF_FUNCTION {
DEBUG_PRT("User makefile options have been reduced");
//DEBUG_PRT("User makefile options have been reduced");
}
| MAKEFILE_OPTION {}
;
......@@ -993,7 +994,7 @@ Parameter
if (!mystricmp(sRED_FINAL,"Tournament")||!mystricmp(sRED_FINAL,"StochTrn")) {
if ($3>=2) {
sprintf(sRED_FINAL,"DetTour");sprintf(sRED_FINAL_PRM,"(%d)",(int) $3);
DEBUG_PRT("tournament parameter is %s",sRED_FINAL_PRM);
//DEBUG_PRT("tournament parameter is %s",sRED_FINAL_PRM);
}
else if (($3>.5)&&($3<=1.0)) {sprintf(sRED_FINAL,"StochTour");sprintf(sRED_FINAL_PRM,"(%f)",(float) $3);}
else {fprintf(stderr,"\n%s - Error line %d: The parameter of the Tournament selector must be either >=2 or within ]0.5, 1].\n",sEZ_FILE_NAME,EASEALexer.yylineno); exit(1);}
......
#ifdef WIN32
#define _CRT_SECURE_NO_WARNINGS
#endif
/****************************************************************************
EaseaSym.cpp
Symbol table and other functions for the EASEA language (EAsy Specification for Evolutionary Algorithms)
......@@ -97,7 +100,7 @@ void CSymbol::print(FILE *fp){
bool isFlatClass = true;
pSymbolList->reset();
while (pSym=pSymbolList->walkToNextItem()){
DEBUG_PRT("analyse flat %s",pSym->Object->pType->sName);
//DEBUG_PRT("analyse flat %s",pSym->Object->pType->sName);
if( (pSym->Object->ObjectType == oPointer) ){ //|| (pSym->Object->pType->ObjectType == oObject) ){
isFlatClass = false;
break;
......@@ -105,7 +108,7 @@ void CSymbol::print(FILE *fp){
}
DEBUG_PRT("Does %s flat class : %s",sName,(isFlatClass?"yes":"no"));
//DEBUG_PRT("Does %s flat class : %s",sName,(isFlatClass?"yes":"no"));
pSymbolList->reset();
fprintf(fp," %s* cudaSendToGpu%s(){\n",sName,sName);
fprintf(fp," %s* ret=NULL;\n",sName);
......@@ -376,11 +379,11 @@ void CSymbol::printClasses(FILE *fp){
void CSymbol::printUC(FILE* fp){
DEBUG_PRT("print user classes definitions");
//DEBUG_PRT("print user classes definitions");
if (strcmp(sName,"Genome") && (TARGET==CUDA || TARGET==STD)){ // If we are printing a user class other than the genome
fprintf(fp,"\nclass %s;\n",sName); // class header
}
DEBUG_PRT("%s",sName);
//DEBUG_PRT("%s",sName);
}
......
File mode changed from 100644 to 100755
#ifdef WIN32
#define _CRT_SECURE_NO_WARNINGS
#endif
#include "Easea.h"
#include "EaseaLex.h"
#include "debug.h"
void pickupSTDSelector(char* sSELECTOR, char* sSELECT_PRM, char* sEZ_FILE_NAME, CEASEALexer* EASEALexer){
DEBUG_PRT("Picking up selector without argument %s",sSELECTOR);
//DEBUG_PRT("Picking up selector without argument %s",sSELECTOR);
if (!mystricmp(sSELECTOR,"RouletteWheel")){
if (nMINIMISE==1) {
fprintf(stderr,"\n%s - Error line %d: The RouletteWheel selection scheme cannot be\n selected when \"minimising the fitness\" is the evaluator goal.\n",
......@@ -38,7 +41,7 @@ void pickupSTDSelector(char* sSELECTOR, char* sSELECT_PRM, char* sEZ_FILE_NAME,
void pickupSTDSelectorArgument(char* sSELECTOR, char* sSELECTOR_PRM, char* sEZ_FILE_NAME, float thirdParam, CEASEALexer* EASEALexer){
DEBUG_PRT("Picking up selector with argument %s %d",sSELECTOR,(int) thirdParam);
//DEBUG_PRT("Picking up selector with argument %s %d",sSELECTOR,(int) thirdParam);
if (!mystricmp(sSELECTOR,"Tournament")||!mystricmp(sSELECTOR,"StochTrn")) {
if (thirdParam>=2) {sprintf(sSELECTOR,"DetTour");
sprintf(sSELECTOR_PRM,"(%d)",(int) thirdParam);}
......
File mode changed from 100644 to 100755
......@@ -13,7 +13,7 @@ Copyright (c) 1999-2001 Bumble-Bee Software Ltd.
#include <assert.h>
// defines
#include <yytdefs.h>
#include "yytdefs.h"
// user defines
#if defined(YYTUDEFS) || defined(YYUDEFS)
......@@ -232,6 +232,6 @@ extern "C" int YYNEAR YYDCDECL yydebugflush;
#endif
// defines
#include <yybdefs.h>
#include "yybdefs.h"
#endif
......@@ -14,7 +14,7 @@ Copyright (c) 1999-2001 Bumble-Bee Software Ltd.
#include <assert.h>
// defines
#include <yytdefs.h>
#include "yytdefs.h"
// user defines
#if defined(YYTUDEFS) || defined(YYUDEFS)
......@@ -370,6 +370,6 @@ extern "C" int YYNEAR YYDCDECL yydebugflush;
#endif
// defines
#include <yybdefs.h>
#include "yybdefs.h"
#endif
File mode changed from 100644 to 100755
......@@ -3,7 +3,8 @@
#define DEBUG_YACC(format, args...) fprintf (stdout,"***DBG_YACC*** %s-%d: "format"\n",__FILE__,__LINE__,##args)
#else
#ifndef WIN32
#define DEBUG_PRT(format, args...)
#define DEBUG_YACC(format, args...)
#endif
#endif
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -5,7 +5,7 @@ LDFLAGS =
$(EXEC):EaseaSym.o EaseaParse.o EaseaLex.o alexyacc/libalex.a EaseaYTools.o
$(EXEC):EaseaSym.o EaseaParse.o EaseaLex.o alexyacc/libalex.a EaseaYTools.o libeasea/libeasea.a
$(CPPC) $(CPPFLAGS) $(LDFLAGS) $^ -o $@
#
# Congratulations ! It looks like you compiled EASEA successfully.
......@@ -23,7 +23,7 @@ $(EXEC):EaseaSym.o EaseaParse.o EaseaLex.o alexyacc/libalex.a EaseaYTools.o
# export EZ_PATH=`pwd`/tpl/
# Or define EZ_PATH in your bashrc file (for bash users) :
# For example :
# export EZ_PATH=/path/to/easea/directory/tpl/
# export EZ_PATH=/path/to/easea/directory/
#
# Otherwise you can use easea from this directory by typing :
# For example :
......@@ -55,10 +55,14 @@ alexyacc/libalex.so:alexyacc/*.cpp
alexyacc/libalex.a:alexyacc/*.cpp
cd alexyacc && make libalex.a
#compile libeasea
libeasea/libeasea.a:libeasea/*.cpp
cd libeasea && make libeasea.a
clean:
rm -f *.o $(EXEC) $(EXEC)_bin
cd alexyacc && make clean
cd libeasea && make clean
install:$(EXEC)
sudo cp $< /usr/bin/dev-easea
......@@ -68,7 +72,7 @@ realclean: clean
EaseaParse.cpp: EaseaParse.y
wine /home/maitre/.wine/drive_c/Program\ Files/Parser\ Generator/BIN/ayacc.exe $< -Tcpp -d
wine /home/kruger/.wine/drive_c/Program\ Files/Parser\ Generator/BIN/ayacc.exe $< -Tcpp -d -l
EaseaLex.cpp: EaseaLex.l
wine /home/maitre/.wine/drive_c/Program\ Files/Parser\ Generator/BIN/ALex.exe $< -Tcpp -i
wine /home/kruger/.wine/drive_c/Program\ Files/Parser\ Generator/BIN/ALex.exe $< -Tcpp -i -l
File mode changed from 100644 to 100755
This diff is collapsed.
This diff is collapsed.
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment