/[CvsGraph]/cvsgraph/rcsy.y
ViewVC logotype

Diff of /cvsgraph/rcsy.y

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.8, Wed Oct 20 19:31:10 2004 UTC revision 1.9, Wed Oct 20 22:03:36 2004 UTC
# Line 46  Line 46 
46  static revs_t *add_revs(revs_t *s, char *t);  static revs_t *add_revs(revs_t *s, char *t);
47  static dtext_t *new_dtext(char *n, char *l, char *t);  static dtext_t *new_dtext(char *n, char *l, char *t);
48  static dtexts_t *add_dtexts(dtexts_t *s, dtext_t *t);  static dtexts_t *add_dtexts(dtexts_t *s, dtext_t *t);
49  static delta_t *new_delta(char *rev, char *date, char *author, char *state, revs_t *branches, char *next);  static phrase_t *new_phrase(phrase_type_e pt, char *t);
50    static phrases_t *add_phrases(phrases_t *s, phrase_t *t);
51    static delta_t *new_delta(char *rev, char *date, char *author, char *state, revs_t *branches, char *next, phrases_t *phrases);
52  static deltas_t *add_deltas(deltas_t *s, delta_t *t);  static deltas_t *add_deltas(deltas_t *s, delta_t *t);
53  static rcsfile_t *new_rcsfile(char *head, char *branch, ids_t *access, tags_t *tags,  static rcsfile_t *new_rcsfile(char *head, char *branch, ids_t *access, tags_t *tags,
54                                  idrevs_t *locks, int strict, char *comment, char *expand);                                  idrevs_t *locks, int strict, char *comment, char *expand);
# Line 67  Line 69 
69          delta_t         *delta;          delta_t         *delta;
70          deltas_t        *deltas;          deltas_t        *deltas;
71          rcsfile_t       *rcsfile;          rcsfile_t       *rcsfile;
72            phrases_t       *phrases;
73            phrase_t        *phrase;
74  }  }
75    
76  %token tHEAD tBRANCH tACCESS tSYMBOLS tLOCKS tSTRICT tCOMMENT  %token tHEAD tBRANCH tACCESS tSYMBOLS tLOCKS tSTRICT tCOMMENT
77  %token tEXPAND tDATE tAUTHOR tSTATE tBRANCHES tNEXT  %token tEXPAND tDATE tAUTHOR tSTATE tBRANCHES tNEXT
78  %token tDESC tLOG tTEXT  %token tDESC tLOG tTEXT
79  %token tOWNER tGROUP tPERMISSIONS tSPECIAL tSYMLINK tHARDLINKS  %token tOWNER tGROUP tPERMISSIONS tSPECIAL tSYMLINK tHARDLINKS
80  %token tNAMESPACE tDEAD  %token tNAMESPACE tDEAD tMERGEPOINT
81  %token <str> tNEWPHRASE  %token <str> tNEWPHRASE
82  %token <str> tSTRING tREV tID tSYM  %token <str> tSTRING tREV tID tSYM
83    
# Line 91  Line 95 
95  %type <delta>   delta  %type <delta>   delta
96  %type <deltas>  deltas  %type <deltas>  deltas
97  %type <rcsfile> admin  %type <rcsfile> admin
98    %type <phrases> ophrases
99    %type <phrase>  phrase
100    
101  %%  %%
102  rcsfile : admin deltas desc {  rcsfile : admin deltas desc {
# Line 168  Line 174 
174            tSTATE  { set_id(); } oid ';'            tSTATE  { set_id(); } oid ';'
175            tBRANCHES orevs ';'            tBRANCHES orevs ';'
176            tNEXT orev ';'            tNEXT orev ';'
177            ophrases                      { $$ = new_delta($1, $3, $7, $11, $14, $17); }            ophrases                      { $$ = new_delta($1, $3, $7, $11, $14, $17, $19); }
178          ;          ;
179    
180  idorstr : tID                           { $$ = $1; }  idorstr : tID                           { $$ = $1; }
# Line 188  Line 194 
194            tTEXT { set_skipstr(); } tSTRING { $$ = new_dtext($1, $3, $7); }            tTEXT { set_skipstr(); } tSTRING { $$ = new_dtext($1, $3, $7); }
195          ;          ;
196    
197  ophrases: /* Empty */  ophrases: /* Empty */           { $$ = NULL; }
198          | ophrases phrase          | ophrases phrase       { $$ = add_phrases($1, $2); }
199          ;          ;
200    
201  phrase  : tNEWPHRASE { set_skip(); } ';'        {  phrase  : tNEWPHRASE { set_skip(); } ';'        {
202                  yywarning("Unrecognised `newphrase´ keyword '%s' skipped", $1);                  yywarning("Unrecognised `newphrase´ keyword '%s' skipped", $1);
203                  xfree($1);                  xfree($1);
204                    $$ = NULL;
205                  }                  }
206          | cvskw { set_skip(); } ';'     { yywarning("CVS extended keyword skipped"); }          | cvskw { set_skip(); } ';'     { $$ = NULL; yywarning("CVS extended keyword skipped"); }
207          | otherkw { set_skip(); } ';'   { yywarning("Other extended keyword"); }          | otherkw { set_skip(); } ';'   { $$ = NULL; yywarning("Other extended keyword"); }
208            | tMERGEPOINT tSTRING ';'       { $$ = new_phrase(PT_MERGEPOINT, $2); }
209          ;          ;
210    
211  cvskw   : tOWNER  cvskw   : tOWNER
# Line 434  Line 442 
442          return s;          return s;
443  }  }
444    
445  static delta_t *new_delta(char *rev, char *date, char *author, char *state, revs_t *branches, char *next)  static phrase_t *new_phrase(phrase_type_e pt, char *t)
446    {
447            phrase_t *d = xmalloc(sizeof(*d));
448            d->type = pt;
449            d->rev = make_rev(t, 1);
450            return d;
451    }
452    
453    static phrases_t *add_phrases(phrases_t *s, phrase_t *t)
454    {
455            if(!t)
456                    return s;
457            if(!s)
458                    s = xmalloc(sizeof(*s));
459            if(t)
460            {
461                    s->phrases = xrealloc(s->phrases, (s->nphrases + 1) * sizeof(s->phrases[0]));
462                    s->phrases[s->nphrases] = t;
463                    s->nphrases++;
464            }
465            return s;
466    }
467    
468    static phrase_t *find_mergepoint(phrases_t *p)
469    {
470            int i;
471    
472            if(!p)
473                    return NULL;
474    
475            for(i = 0; i < p->nphrases; i++)
476            {
477                    if(p->phrases[i]->type == PT_MERGEPOINT)
478                            return p->phrases[i];
479            }
480            return NULL;
481    }
482    
483    static delta_t *new_delta(char *rev, char *date, char *author, char *state, revs_t *branches, char *next, phrases_t *phrases)
484  {  {
485          delta_t *d = xmalloc(sizeof(*d));          delta_t *d = xmalloc(sizeof(*d));
486          d->rev = make_rev(rev, 1);          d->rev = make_rev(rev, 1);
# Line 443  Line 489 
489          d->state = state;          d->state = state;
490          d->branches = branches;          d->branches = branches;
491          d->next = make_rev(next, 1);          d->next = make_rev(next, 1);
492            d->phrases = phrases;
493            d->mergepoint = find_mergepoint(phrases);
494          return d;          return d;
495  }  }
496    

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.0 with CvsGraph 1.7.0