Commit 68361aa3 authored by moh_lo's avatar moh_lo

almost ok version

parent d471b20f
......@@ -21,6 +21,7 @@ Centre de Math
#define GALIB 1
#define EO 2
#define DREAM 3
#define GPU 4
#define UNIX 1
#define WINDOWS 2
#define UNKNOWN_OS 3
......
......@@ -32,7 +32,7 @@ class CSymbolTable;
protected:
CSymbolTable *pSymbolTable; // the symbol table
bool bSymbolInserted,bWithinEvaluator; // used to change evalutor type from double to float
bool bInitFunction,bDisplayFunction,bFunction, bNotFinishedYet, bWithinEO_Function;
bool bInitFunction,bDisplayFunction,bFunction, bNotFinishedYet, bWithinEO_Function, bWithinGPU_Function;
bool bDoubleQuotes,bWithinDisplayFunction,bWithinInitialiser,bWithinMutator,bWithinXover;
bool bWaitingForSemiColon,bFinishNB_GEN,bFinishMINIMISE,bFinishMINIMIZE,bGenerationFunction;
bool bCatchNextSemiColon,bWaitingToClosePopulation;
......@@ -46,10 +46,10 @@ public:
// constructor
{
bFunction=bWithinEvaluator=bDisplayFunction=bInitFunction=bNotFinishedYet=0;
bSymbolInserted=bDoubleQuotes=bWithinDisplayFunction=bWithinInitialiser=bWithinMutator=bWithinXover=0;
bWaitingForSemiColon=bFinishNB_GEN=bFinishMINIMISE=bFinishMINIMIZE=bGenerationFunction=0;
bCatchNextSemiColon,bWaitingToClosePopulation=0;
bFunction=bWithinEvaluator=bDisplayFunction=bInitFunction=bNotFinishedYet=0;
bSymbolInserted=bDoubleQuotes=bWithinDisplayFunction=bWithinInitialiser=bWithinMutator=bWithinXover=0;
bWaitingForSemiColon=bFinishNB_GEN=bFinishMINIMISE=bFinishMINIMIZE=bGenerationFunction=0;
bCatchNextSemiColon,bWaitingToClosePopulation=0;
}
// macros
......@@ -211,7 +211,18 @@ YYSTYPE& yylval = *(YYSTYPE*)yyparserptr->yylvalptr;
else fprintf(fpOutputFile," EZ_genome.%s[EASEA_Ndx]=this.%s[EASEA_Ndx];}\n",pSym->Object->sName, pSym->Object->sName);
}
}
else {
else if(TARGET==GPU){
if (pSym->Object->ObjectType==oObject)
fprintf(fpOutputFile," genome.%s=genome.%s;\n",pSym->Object->sName,pSym->Object->sName);
if (pSym->Object->ObjectType==oPointer)
fprintf(fpOutputFile," genome.%s=(genome.%s ? new %s(*(genome.%s)) : NULL);\n",pSym->Object->sName,pSym->Object->sName,pSym->Object->pType->sName,pSym->Object->sName);
if (pSym->Object->ObjectType==oArray){
fprintf(fpOutputFile," {for(int EASEA_Ndx=0; EASEA_Ndx<%d; EASEA_Ndx++)\n",pSym->Object->nSize/pSym->Object->pType->nSize);
fprintf(fpOutputFile," genome.%s[EASEA_Ndx]=genome.%s[EASEA_Ndx];}\n",pSym->Object->sName,pSym->Object->sName);
}
}
else
{
if (pSym->Object->ObjectType==oObject)
fprintf(fpOutputFile," %s=genome.%s;\n",pSym->Object->sName,pSym->Object->sName);
if (pSym->Object->ObjectType==oPointer)
......@@ -366,9 +377,17 @@ YYSTYPE& yylval = *(YYSTYPE*)yyparserptr->yylvalptr;
<TEMPLATE_ANALYSIS>"\\INSERT_EO_INITIALISER" {
yyreset();
bWithinEO_Function=1;
bWithinGPU_Function = false;
yyin = fpGenomeFile; // switch to .ez file and analyser
BEGIN COPY_EO_INITIALISER; // not implemented as a function !
}
<TEMPLATE_ANALYSIS>"\\INSERT_GPU_INITIALISER" { //we use EO_INITIAlIZER function to do this for GPU, but bWithinGPU_Function is set to true
yyreset();
bWithinEO_Function = false;
bWithinGPU_Function = true;
yyin = fpGenomeFile;
BEGIN COPY_EO_INITIALISER;
}
<TEMPLATE_ANALYSIS>"\\INSERT_INITIALISER" {
yyreset();
yyin = fpGenomeFile; // switch to .ez file and analyser
......@@ -626,6 +645,7 @@ YYSTYPE& yylval = *(YYSTYPE*)yyparserptr->yylvalptr;
}
<COPY_EO_INITIALISER>.|\n {}
<COPY_USER_DECLARATIONS>"\\User"[ \t\n]+"declarations"[ \t\n]*":" {
fprintf (fpOutputFile,"// User declarations\n");
BEGIN COPY;
......@@ -740,24 +760,33 @@ YYSTYPE& yylval = *(YYSTYPE*)yyparserptr->yylvalptr;
else fprintf(fpOutputFile,"false");} // local name
<COPY>"true" {if (TARGET==GALIB) fprintf(fpOutputFile,"gaTrue");
else fprintf(fpOutputFile,"true");} // local name
<COPY>[^a-zA-Z0-9_]"bool"[^a-zA-Z0-9_] {if (TARGET==DREAM) fprintf(fpOutputFile," boolean ");
<COPY>[^a-zA-Z0-9_]"bool"[^a-zA-Z0-9_] {
if (TARGET==DREAM) fprintf(fpOutputFile," boolean ");
else fprintf(fpOutputFile,yytext);}
<COPY>"tossCoin" {if (TARGET==GALIB) fprintf(fpOutputFile,"tossCoin");
<COPY>"tossCoin" {
if (TARGET==GALIB) fprintf(fpOutputFile,"tossCoin");
if (TARGET==EO) fprintf(fpOutputFile,"rng.flip");
if (TARGET==DREAM) fprintf(fpOutputFile,"Math.random()<");
else fprintf(fpOutputFile,yytext);
} // local random name
<COPY>"random" {if (TARGET==DREAM) fprintf(fpOutputFile,"%s.random",sPROJECT_NAME);
else fprintf(fpOutputFile,"random");}
<COPY>"Genome" {if (bWithinEO_Function) fprintf(fpOutputFile,"_genotype");
<COPY>"Genome" {
if (bWithinEO_Function) fprintf(fpOutputFile,"_genotype");
//else if(bWithinGPU_Function) fprintf(fpOutputFile,"(*this)"); //in cuda version, initialization takes place in CInvidual class
else fprintf(fpOutputFile,"Genome");} // local genome name
<COPY>"identicalGenome" {fprintf(fpOutputFile,"genome._evaluated");} // local name
<COPY>"#define"[ \t]* {fprintf(fpOutputFile,"%s",yytext); BEGIN MACRO_IDENTIFIER;}
<COPY>"GenomeClass" {if (TARGET==EO) fprintf(fpOutputFile,"Indi");
else fprintf(fpOutputFile,"%sGenome",sPROJECT_NAME);} // local name
<COPY>"\\end" {if (bFunction==1) {fprintf (fpOutputFile,"}\n"); bFunction=0;}
<COPY>"\\end" {
if (bFunction==1)
{fprintf (fpOutputFile,"}\n"); bFunction=0;}
bWithinEO_Function=0;
rewind(fpGenomeFile);
yyin = fpTemplateFile; BEGIN TEMPLATE_ANALYSIS;} // Back to the template file
yyin = fpTemplateFile;
BEGIN TEMPLATE_ANALYSIS;
} // Back to the template file
<COPY>.|\n {putc(yytext[0],fpOutputFile);}
// Looking for an identifier
......@@ -934,7 +963,8 @@ YYSTYPE& yylval = *(YYSTYPE*)yyparserptr->yylvalptr;
exit(1);
}} // local genome name
<COPY_USER_GENERATION>"MINIMIZE" |
<COPY_USER_GENERATION>"MINIMIZE"/[ \t\n]*"==" {if (bDoubleQuotes) fprintf(fpOutputFile,"MINIMIZE");
<COPY_USER_GENERATION>"MINIMIZE"/[ \t\n]*"==" {
if (bDoubleQuotes) fprintf(fpOutputFile,"MINIMIZE");
else switch (TARGET) {
case GALIB : fprintf(fpOutputFile,"g.minimaxi()"); break;
case EO : fprintf(stderr,"\n%s - Error line %d: The MINIMIZE variable cannot be accessed yet undeer EO.\n",sEZ_FILE_NAME,yylineno);
......@@ -1007,8 +1037,11 @@ YYSTYPE& yylval = *(YYSTYPE*)yyparserptr->yylvalptr;
<COPY_USER_GENERATION>"\\end" {rewind(fpGenomeFile);
yyin = fpTemplateFile;
BEGIN TEMPLATE_ANALYSIS;
fprintf(fpOutputFile,"}");} // Back to the template file
<COPY_USER_GENERATION>";" {if (bWaitingForSemiColon){
fprintf(fpOutputFile,"}");
} // Back to the template file
<COPY_USER_GENERATION>";" {
if (bWaitingForSemiColon){
bWaitingForSemiColon=0;
if (bFinishMINIMISE) {fprintf(fpOutputFile,");\n if (MINIMISE) g.minimize() else g.maximize();\n"); bFinishMINIMISE=0;}
if (bFinishMINIMIZE) {fprintf(fpOutputFile,");\n if (MINIMIZE) g.minimize() else g.maximize();\n"); bFinishMINIMISE=0;}
......@@ -1018,7 +1051,8 @@ YYSTYPE& yylval = *(YYSTYPE*)yyparserptr->yylvalptr;
else if (bFinishNB_GEN) {fprintf(fpOutputFile,"));"); bFinishNB_GEN=0;}
else fprintf(fpOutputFile,"));");
}
else fprintf(fpOutputFile,";");}
else fprintf(fpOutputFile,";");
}
<COPY_USER_GENERATION>.|\n {putc(yytext[0],fpOutputFile);}
......@@ -1035,10 +1069,13 @@ YYSTYPE& yylval = *(YYSTYPE*)yyparserptr->yylvalptr;
<COPY_USER_FUNCTION>"GenomeClass" {if (TARGET==EO) fprintf(fpOutputFile, "GenotypeT");
else fprintf(fpOutputFile,"Genome.");
}
<COPY_USER_FUNCTION>"Genome" {if (bWithinDisplayFunction) fprintf(fpOutputFile,"(*this)");
<COPY_USER_FUNCTION>"Genome" {
if (bWithinDisplayFunction && TARGET!=GPU) fprintf(fpOutputFile,"(*this)");
else if ((TARGET==EO)&&(bWithinInitialiser)) fprintf(fpOutputFile, "(*genome)");
else if ((TARGET==EO)&&(bWithinMutator)) fprintf(fpOutputFile, "_genotype");
else fprintf(fpOutputFile,"genome");} // local genome name
//else if (TARGET==GPU) fprintf(fpOutputFile,"(*this)");
else fprintf(fpOutputFile,"genome");
} // local genome name
<COPY_USER_FUNCTION>"\"" {(bDoubleQuotes ? bDoubleQuotes=0:bDoubleQuotes=1); fprintf(fpOutputFile,"\"");}
<COPY_USER_FUNCTION>"\\\"" {fprintf(fpOutputFile,"\\\"");}
......@@ -1048,6 +1085,7 @@ YYSTYPE& yylval = *(YYSTYPE*)yyparserptr->yylvalptr;
case GALIB: fprintf(fpOutputFile,"((%sGenome *)&(pPopulation->individual(",sPROJECT_NAME);
}
}
<COPY_USER_FUNCTION>"]" {if (!bWaitingToClosePopulation) fprintf(fpOutputFile,"]");
else {fprintf(fpOutputFile,")))"); bWaitingToClosePopulation=false;}}
......@@ -1079,15 +1117,20 @@ YYSTYPE& yylval = *(YYSTYPE*)yyparserptr->yylvalptr;
<COPY_USER_FUNCTION>"MUT_PROB"[ \t\n]*"=" {fprintf(stderr,"\n%s - Error line %d: The mutation probability can only be changed within the generation function.\n",sEZ_FILE_NAME,yylineno); exit (1);}
<COPY_USER_FUNCTION>"XOVER_PROB"[ \t\n]*"=" {fprintf(stderr,"\n%s - Error line %d: The crossover proability can only be changed within the generation function.\n",sEZ_FILE_NAME,yylineno); exit (1);}
<COPY_USER_FUNCTION>"REPL_PERC"[ \t\n]*"=" {fprintf(stderr,"\n%s - Error line %d: The replacement percentage can only be changed within the generation function.\n",sEZ_FILE_NAME,yylineno); exit (1);}
<COPY_USER_FUNCTION>"false" {if (TARGET==GALIB) fprintf(fpOutputFile,"gaFalse");
<COPY_USER_FUNCTION>"false" {
if (TARGET==GALIB) fprintf(fpOutputFile,"gaFalse");
else fprintf(fpOutputFile,"false");} // local name
<COPY_USER_FUNCTION>"true" {if (TARGET==GALIB) fprintf(fpOutputFile,"gaTrue");
else fprintf(fpOutputFile,"true");} // local name
<COPY_USER_FUNCTION>[^a-zA-Z0-9_]"bool"[^a-zA-Z0-9_] {if (TARGET==DREAM) fprintf(fpOutputFile," boolean ");
else fprintf(fpOutputFile,yytext);}
<COPY_USER_FUNCTION>"tossCoin" {if (TARGET==GALIB) fprintf(fpOutputFile,"tossCoin");
<COPY_USER_FUNCTION>"tossCoin" {
if (TARGET==GALIB) fprintf(fpOutputFile,"tossCoin");
if (TARGET==EO) fprintf(fpOutputFile,"rng.flip");
if (TARGET==DREAM) fprintf(fpOutputFile,"Math.random()<");} // local random name
if (TARGET==DREAM) fprintf(fpOutputFile,"Math.random()<");
else fprintf(fpOutputFile,"%s",yytext);
} // local random name
<COPY_USER_FUNCTION>"random" {if (TARGET==DREAM) fprintf(fpOutputFile,"%s.random",sPROJECT_NAME);
else fprintf(fpOutputFile,"random");}
<COPY_USER_FUNCTION>"child1" {if ((bWithinXover)&&(TARGET==GALIB)) fprintf(fpOutputFile, "(*pBro)");
......@@ -1103,24 +1146,29 @@ YYSTYPE& yylval = *(YYSTYPE*)yyparserptr->yylvalptr;
else fprintf(fpOutputFile,"parent2");
}
<COPY_USER_FUNCTION>"identicalGenome" {fprintf(fpOutputFile,"genome._evaluated");} // local name
<COPY_USER_FUNCTION>"return" {if (bWithinEvaluator) {
<COPY_USER_FUNCTION>"return" {
if (bWithinEvaluator) {
if (TARGET==GALIB) fprintf(fpOutputFile,"EZ_EVAL+=(double)(clock()-EZ_t1);\n return (float)");
if (TARGET==EO) {fprintf(fpOutputFile,"genome.fitness(");bCatchNextSemiColon=true;}// changes function type// changes function type
if (TARGET==DREAM) {fprintf(fpOutputFile,"infoHabitant.setFitness(new Double(");bCatchNextSemiColon=true;}// changes function type
if (TARGET==GPU) { fprintf(fpOutputFile,"return nFitness = ");}
bWithinEvaluator=0;
}
else if ((bWithinMutator)&&(TARGET!=GALIB)) {
fprintf(fpOutputFile,"return ");
bCatchNextSemiColon=true;
}
else fprintf(fpOutputFile,"return"); }
else fprintf(fpOutputFile,"return");
}
<COPY_USER_FUNCTION>";" {if (!bCatchNextSemiColon) fprintf(fpOutputFile,";");
else if ((TARGET!=GALIB)&&(bWithinMutator)){fprintf(fpOutputFile,">0?true:false;"); bWithinMutator=false;}
else if (TARGET==EO) fprintf(fpOutputFile,");");
else fprintf(fpOutputFile,"));");
bCatchNextSemiColon=false;
}
<COPY_USER_FUNCTION>"\\end" {rewind(fpGenomeFile);
<COPY_USER_FUNCTION>"\\end" {
rewind(fpGenomeFile);
yyin = fpTemplateFile;
BEGIN TEMPLATE_ANALYSIS;
bWithinInitialiser=bWithinXover=bWithinMutator=bWithinEvaluator=0;
......@@ -1266,6 +1314,7 @@ int CEASEALexer::create(CEASEAParser* pParser, CSymbolTable* pSymTable)
if (!mystricmp(sTemp,"eo")) TARGET=EO;
else if (!mystricmp(sTemp,"galib")) TARGET=GALIB;
else if (!mystricmp(sTemp,"dream")) TARGET=DREAM;
else if (!mystricmp(sTemp,"gpu")) TARGET=GPU;
else return 0;
}
......@@ -1292,6 +1341,14 @@ int CEASEALexer::create(CEASEAParser* pParser, CSymbolTable* pSymTable)
fprintf(stderr,"*** Please modify the EZ_PATH environment variable.\n");
exit(1);
} }
if (TARGET==GPU){
strcat(sTemp,"GPU.tpl");
if (!(yyin = fpTemplateFile = fopen(sTemp, "r"))){
fprintf(stderr,"\n*** Could not open %s.\n",sTemp);
fprintf(stderr,"*** Please modify the EZ_PATH environment variable.\n");
exit(1);
} }
if (TARGET==GALIB){
strcat(sTemp,"GALib.tpl");
if (!(yyin = fpTemplateFile = fopen(sTemp, "r"))){
......@@ -1315,6 +1372,16 @@ int CEASEALexer::create(CEASEAParser* pParser, CSymbolTable* pSymTable)
}
else strcpy(sEO_DIR,getenv("EO_DIR"));
}
if (TARGET==GPU){
if ((getenv("EO_DIR")==NULL)){
printf("\n\nHmmm, it looks like you are running EASEA millennium edition with EO for the\nfirst time.\n");
printf("Please, set the \"EO_DIR\" environment variable to the EO installation directory.\n");
exit(1);
}
else strcpy(sEO_DIR,getenv("EO_DIR"));
}
switch (OPERATING_SYSTEM) {
case UNIX : if (sEO_DIR[strlen(sEO_DIR)-1] != '/') strcat (sEO_DIR,"/"); break;
case WINDOWS : if (sEO_DIR[strlen(sEO_DIR)-1] != '\\') strcat (sEO_DIR,"\\"); break;
......
......@@ -457,7 +457,7 @@ StandardFunctionAnalysis
} }
END_OF_FUNCTION {
if (TARGET==DREAM) fprintf(fpOutputFile," }\n");
fprintf(fpOutputFile,"}");
if (TARGET!=GPU) fprintf(fpOutputFile,"}");
}
| USER_EVALUATOR {
if (bVERBOSE) printf("Inserting user genome evaluator (taken from .ez file).\n");
......@@ -475,14 +475,14 @@ StandardFunctionAnalysis
fprintf(fpOutputFile," EZ_NB_EVALUATIONS++;\n",sPROJECT_NAME);
} }
END_OF_FUNCTION {
if (TARGET!=EO) fprintf(fpOutputFile,"}\n");
if ((TARGET!=EO) && (TARGET!=GPU)) fprintf(fpOutputFile,"}\n");
}
;
RunParameters
: Parameter { DEBUG_YACC("parameter has been reduce\n");}
| RunParameters Parameter { DEBUG_YACC("parameter has been reduce\n");}
;
: Parameter {;}
| RunParameters Parameter {;}
;
Parameter
: NB_GEN NUMBER2
......@@ -1257,6 +1257,7 @@ int main(int argc, char *argv[]){
if (!mystricmp(psTemp,"eo")) TARGET=EO;
else if (!mystricmp(psTemp,"galib")) TARGET=GALIB;
else if (!mystricmp(psTemp,"dream")) TARGET=DREAM;
else if (!mystricmp(psTemp,"gpu")) TARGET=GPU;
else if (!mystricmp(psTemp,"v")) bVERBOSE=true;
else strcpy(sRAW_PROJECT_NAME,argv[nParamNb]);
}
......
/*_________________________________________________________
This file was automatically created by GUIDE v0.1c
User: collet
Date: Fri Apr 04 23:41:34 CEST 2003
File name: /home/collet/progs/onemax/onemax.ez
Target library: EO
Operating System: Linux
_________________________________________________________*/
\User declarations:
#define SIZE 16
float pMutPerGene=0.1;
inline void swap(bool& a, bool& b)
{bool c=a; a=b; b=c;}
\end
\User functions:
/* void swap(bool* a, bool* b){ */
/* bool tmp = *a; */
/* *a = *b; */
/* *b = tmp; */
/* } */
\end
\Initialisation function:
\end
\User classes:
GenomeClass {bool x[SIZE]; }
\end
\GenomeClass::display:
for( int i=0 ; i<SIZE;i++) cout << (Genome.x[i]? "1 ":"0 ");
\end
\GenomeClass::initialiser:
for (int i=0;i<SIZE;i++) Genome.x[i]=tossCoin(.5);
\end
\GenomeClass::crossover:
int CrossoverPosition=randomLoc(0,SIZE);
for(int i=0;i<CrossoverPosition+1;i++)
swap(child1->Genome.x[i],child2->Genome.x[i]);
\end
\GenomeClass::mutator:
int NbMut=0;
for (int i=0;i<SIZE;i++)
if (tossCoin(pMutPerGene)){
NbMut++;
Genome.x[i]=Genome.x[i]?0:1;
}
return NbMut;
\end
\GenomeClass::evaluator:
int Score=0;
for (int i=0; i<SIZE;i++)
Score+=(int)Genome.x[i];
return Score;
\end
\At each new generation:
\end
\Default run parameters:
// Variation operators:
Operators are called: Sequentially
Mutation probability: 0.4
Crossover probability: 0.8
// Evolution Engine:
Evaluator goal: Maximise
Number of generations: 5
Evolutionary engine: Generational
Population size: 10
Elite: 1
Fertility: 10
Genitors selector: Tournament 2
Selected genitors: 10
Offspring size: 10
Reduce parents: Tournament 2
Surviving parents: 0
Reduce offspring: Tournament 2
Surviving offspring: 10
Final reduce: Tournament 2
Elitism: Strong
// Island model:
Number of islands: 5
Emigration policy: Move
Migrants selector: Tournament 2
Migrants destination: Neighbours
Migration frequency: 0.2
Number of emigrants: 3
Immigration replacement: Tournament 2
Immigration policy: Add
\end
/*_________________________________________________________
This C:\WINDOWS\a_onemax\onemax.ez file was automatically created by GUIDE v0.1b
_________________________________________________________*/
\User declarations:
#define SIZE 100
float pMutPerGene=0.1;
......@@ -65,36 +59,23 @@ GenomeClass
\Default run parameters:
// Variation operators:
Operators are called: Sequentially
// Variation operators
Mutation probability: 0.3
Crossover probability: 0.8
// Evolution Engine:
Evaluator goal: Minimise
Evaluator goal: Minimise // or maximise
Number of generations: 2000
Evolutionary engine: Custom
Population size: 100
Elite: 10
Fertility: 80
Genitors selector: Tournament 2
Selected genitors: 100
Offspring size: 100
Population: 100
Elite: 1
Genitors: 80 // those who can be parents
Genitors selector: sequential
Parents selector: Tournament 2 // Selection of a parent to create a child
Offspring: 100
Reduce parents: Tournament 2
Surviving parents: 20
Reduce offspring: Tournament 2
Surviving offspring: 80
Final reduce: Tournament 2
Elitism: Strong
// Island model:
Number of islands: 5
Emigration policy: Move
Migrants selector: Tournament 2
Migrants destination: Neighbours
Migration frequency: 0.2
Number of emigrants: 3
Immigration replacement: Tournament 2
Immigration policy: Add
\end
EXEC = main.out
CPPFLAGS = -DUNIX_OS -Ialexyacc/include/ -DDEBUG
CPPC = g++
LDFLAGS =
$(EXEC):EaseaSym.o EaseaLex.o EaseaParse.o alexyacc/libalex.so
#$(EXEC):EaseaSym.o easealex.o EaseaParse.o alexyacc/libalex.so
$(CPPC) $(CPPFLAGS) $^ -o $@
$(CPPC) $(CPPFLAGS) $(LDFLAGS) $^ -o $@
%.o:%.cpp
$(CPPC) $(CPPFLAGS) -c -o $@ $<
EaseaParse.cpp:winreceive
EaseaLex.cpp:winreceive
#compile library for alex and ayacc unix version
alexyacc/libalex.so:alexyacc/*.cpp
cd alexyacc && make libalex.so
......@@ -39,6 +44,8 @@ winreceive: winreceive_l winreceive_y
winreceive_l:
cp $(TMP_DIR)/EaseaLex.cpp $(TMP_DIR)/EaseaLex.h ./
chmod -x EaseaLex.cpp EaseaLex.h
winreceive_y:
cp $(TMP_DIR)/EaseaParse.cpp $(TMP_DIR)/EaseaParse.h ./
chmod -x EaseaParse.cpp EaseaParse.h
\ No newline at end of file
This diff is collapsed.
#ifndef _EASEALEX_H
#define _EASEALEX_H
#include <clex.h>
#line 17 "C:\\repo\\src\\EaseaLex.l"
// forward references
class CEASEAParser;
class CSymbolTable;
#line 13 "C:\\repo\\src\\EaseaLex.h"
#define GENOME_ANALYSIS 2
#define TEMPLATE_ANALYSIS 4
#define MACRO_IDENTIFIER 6
#define MACRO_DEFINITION 8
#define COPY_USER_DECLARATIONS 10
#define COPY_INITIALISATION_FUNCTION 12
#define ANALYSE_USER_CLASSES 14
#define COPY_EO_INITIALISER 16
#define COPY 18
#define COPY_INITIALISER 20
#define COPY_CROSSOVER 22
#define COPY_MUTATOR 24
#define COPY_EVALUATOR 26
#define COPY_DISPLAY 28
#define COPY_USER_FUNCTION 30
#define COPY_USER_GENERATION 32
#define PARAMETERS_ANALYSIS 34
#define GET_PARAMETERS 36
#define COPY_USER_FUNCTIONS 38
#define COPY_GENERATION_FUNCTION 40
#define GET_METHODS 42
/////////////////////////////////////////////////////////////////////////////
// CEASEALexer
#ifndef YYDECLSPEC
#define YYDECLSPEC
#endif
class YYFAR YYDECLSPEC CEASEALexer : public yyflexer {
public:
CEASEALexer();
protected:
void yytables();
virtual int yyaction(int action);
public:
#line 31 "C:\\repo\\src\\EaseaLex.l"
protected:
CSymbolTable *pSymbolTable; // the symbol table
bool bSymbolInserted,bWithinEvaluator; // used to change evalutor type from double to float
bool bInitFunction,bDisplayFunction,bFunction, bNotFinishedYet, bWithinEO_Function;
bool bDoubleQuotes,bWithinDisplayFunction,bWithinInitialiser,bWithinMutator,bWithinXover;
bool bWaitingForSemiColon,bFinishNB_GEN,bFinishMINIMISE,bFinishMINIMIZE,bGenerationFunction;
bool bCatchNextSemiColon,bWaitingToClosePopulation, bMethodsInGenome;
CSymbol *pASymbol;
public:
int create(CEASEAParser* pParser, CSymbolTable* pSymbolTable);
int yywrap();
double myStrtod() const;
#line 67 "C:\\repo\\src\\EaseaLex.h"
};
#ifndef YYLEXNAME
#define YYLEXNAME CEASEALexer
#endif
#ifndef INITIAL
#define INITIAL 0
#endif
#endif
This diff is collapsed.
This diff is collapsed.
#ifndef _EASEAPARSE_H
#define _EASEAPARSE_H
#include <cyacc.h>
#line 58 "C:\\repo\\src\\EaseaParse.y"
// forward references
class CSymbol;
#line 12 "C:\\repo\\src\\EaseaParse.h"
#ifndef YYSTYPE
union tagYYSTYPE {
#line 64 "C:\\repo\\src\\EaseaParse.y"
CSymbol* pSymbol;
double dValue;
int ObjectQualifier;
int nValue;
char *szString;
#line 23 "C:\\repo\\src\\EaseaParse.h"
};
#define YYSTYPE union tagYYSTYPE
#endif
#define UMINUS 257
#define CLASSES 258
#define GENOME 259
#define USER_CTOR 260
#define USER_XOVER 261
#define USER_MUTATOR 262
#define USER_EVALUATOR 263
#define END_OF_FUNCTION 264
#define END_METHODS 265
#define IDENTIFIER 266
#define IDENTIFIER2 267
#define BOOL 268
#define INT 269
#define DOUBLE 270
#define FLOAT 271
#define CHAR 272
#define POINTER 273
#define NUMBER 274
#define NUMBER2 275
#define METHODS 276
#define STATIC 277
#define NB_GEN 278
#define NB_ISLANDS 279
#define PROP_SEQ 280
#define MUT_PROB 281
#define XOVER_PROB 282