Changeset 151 for anr/gantt.l


Ignore:
Timestamp:
Feb 15, 2010, 8:16:20 AM (14 years ago)
Author:
coach
Message:

IA: added kind in delivrable tables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anr/gantt.l

    r147 r151  
    5959    int tn,stn,dn,vn;  // task, sub-task, number
    6060    char v;            // 0, 1, 2, ..., F
     61    char* kind;
    6162    char* title;
    6263    int   bm,em;       // mois de bebut et de fin
     
    214215
    215216%%
    216  int tn,stn,dn,v,bm,em; char* title;
     217 int tn,stn,dn,v,bm,em; char* title; char* kind;
    217218 double an[3];
    218219 char*  an_comment;
     
    236237        int status = sscanf(yytext+2,"%lf:%lf:%lf:%s",an+0,an+1,an+2,tmp);
    237238        if (status<3) {
    238             fprintf(stderr,"%s: is not resource definition, expected format \"N:N:N\" (near D%d%d%d-V%c)\n",
     239            fprintf(stderr,
     240                "%s: is not resource definition, expected format \"N:N:N\" (near D%d%d%d-V%c)\n",
    239241               yytext+2,tn,stn,dn,v);
    240242            an[0]=0; an[1]=0; an[2]=0; an_comment=0;
     
    258260            partner=0;
    259261        }
     262    }
     263KIND="{"[^}]+"}"  {
     264        yytext[yyleng-1]=0;
     265        kind= strdup(yytext+6);
     266        if ( strcmp(kind,"x")!=0 && strcmp(kind,"d")!=0 && strcmp(kind,"h")!=0 &&
     267             strcmp(kind,"d+x")!=0 )
     268          fprintf(stderr,"ERROR:D%d%d%d invalid KIND: %s\n",tn,stn,dn,kind);
     269    }
     270KIND="{}"  {
     271        yytext[yyleng-1]=0;
     272        kind= strdup(yytext+6);
    260273    }
    261274TITLE=.*\n {
     
    276289        p->bm = bm;
    277290        p->em = em;
     291        p->kind = kind;
    278292        gen_titleLines(p);
    279293
     
    281295        data_org.ls[tn][stn][dn][v] = p;
    282296//fprintf(stderr,"ADDED: %d %d %d %d\n",tn,stn,dn,v);
     297        tn=stn=dn=v=bm=em=0;
     298        title=kind=0;
     299        an[0]= an[1]=an[1]=0;
     300        an_comment=0;
     301        partner=0;
    283302    }
    284303[ \t\n] ;
     
    783802    }
    784803    fprintf(curr->os,"\\begin{tabular}[t]{|l|c|c|c|p{\\desclen}|}\\hline\n");
    785     fprintf(curr->os,"number & resp. & T0+ & kd & description\\\\\\hline\\hline\n");
     804    fprintf(curr->os,"number");
     805    fprintf(curr->os," & resp.");
     806    fprintf(curr->os," & \\makebox[2mm]{T0+}");
     807    fprintf(curr->os," & \\makebox[2mm]{kind}");
     808    fprintf(curr->os," & description\\\\\\hline\\hline\n");
    786809}
    787810
     
    809832            gen_label_full(label,l);
    810833            sprintf(resp,"\\S%s",partner_table[l->partner].key);
    811             sprintf(date,"%d",l->em);
    812             sprintf(kind,"%s","x");
     834            sprintf(date,"\\makebox[2mm][r]{%d}",l->em);
     835            sprintf(kind,"\\makebox[1mm]{%s}",l->kind);
    813836            if ( top->nbvers == 1 )
    814837                sprintf(desc,"%s \\\\\\hline\n",last->title);
     
    824847             fprintf(curr->os,"%-15s", label);
    825848             fprintf(curr->os," & %-10s", resp);
    826              fprintf(curr->os," & %-10s", date);
    827              fprintf(curr->os," & %-8s", kind);
     849             fprintf(curr->os," & %-30s", date);
     850             fprintf(curr->os," & %-30s", kind);
    828851             fprintf(curr->os," & %s", desc);
    829852             nblines -= 1;
Note: See TracChangeset for help on using the changeset viewer.