Commit 39b21c8d authored by kruger's avatar kruger

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;
......
This diff is collapsed.
......@@ -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.
File mode changed from 100644 to 100755
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