Changeset 34 for cpp/f8-to-f1


Ignore:
Timestamp:
10/31/09 01:45:08 (15 years ago)
Author:
Maciej Komosinski
Message:

very simple syntax coloring

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/f8-to-f1/geno_f8.cpp

    r33 r34  
    9797}
    9898
     99
     100char* Geno_f8::getSimplest() {
     101        const char* geno = "1\n---\nP0\nP0():X\n";
     102        char* retGeno = (char*)malloc(strlen(geno) + 1);
     103        strcpy(retGeno, geno);
     104        return retGeno;
     105}
     106
    99107int Geno_f8::checkValidity(const char * geno) {
    100108        SString ssgeno = SString(geno);
     
    164172        strcpy(validatedTmp, validated); //the rest is originalg = mutated;
    165173        geno = validatedTmp;
    166        
     174
    167175        return GENOPER_OK;
    168176}
     177
     178unsigned long Geno_f8::style(const char *g, int pos)
     179{
     180   char ch=g[pos];
     181   unsigned long style=GENSTYLE_CS(0,GENSTYLE_NONE); //default, should be changed below
     182   if (strchr("^[]X",ch))          style=GENSTYLE_RGBS(0,0,0,GENSTYLE_BOLD); else
     183   if (strchr(":",ch))             style=GENSTYLE_RGBS(220,0,0,GENSTYLE_BOLD); else
     184   if (strchr("|",ch))             style=GENSTYLE_RGBS(220,0,0,GENSTYLE_NONE);
     185   return style;
     186}
     187
    169188
    170189int Geno_f8::getProductionsCount(const SString &in) {
     
    13241343}
    13251344
    1326 unsigned long Geno_f8::style(const char *g, int pos) {
    1327         return GENSTYLE_RGBS(0, 0, 0, GENSTYLE_NONE);
    1328 }
    1329 
    1330 char* Geno_f8::getSimplest() {
    1331         const char* geno = "1\n---\nP0\nP0():X\n";
    1332         char* retGeno = (char*)malloc(strlen(geno) + 1);
    1333         strcpy(retGeno, geno);
    1334         return retGeno;
    1335 }
    13361345
    13371346bool Geno_f8::checkProdNameExist(vector<ProductionInfo> info, SString name) const {
Note: See TracChangeset for help on using the changeset viewer.