File: dumpcycles.c

package info (click to toggle)
edk2 2022.11-6%2Bdeb12u2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 165,180 kB
  • sloc: ansic: 1,628,399; perl: 160,190; python: 135,478; asm: 49,448; cpp: 17,566; sh: 3,078; makefile: 2,986; pascal: 472; xml: 318; lisp: 35; sed: 5
file content (67 lines) | stat: -rw-r--r-- 1,507 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <stdio.h>
#include <ctype.h>

#include "set.h"
#include "syn.h"
#include "hash.h"
#include "generic.h"

void 
#ifdef __USE_PROTOS
dumpcycles(void)
#else
dumpcycles()
#endif
{
  Cycle         *c;
  CacheEntry    *f;
  ListNode      *p;
  int           i=0;
  int           k;
  int           degree;

  for (k=1; k <= CLL_k; k++) {
    if (Cycles[k] == NULL) continue;

    for (p = Cycles[k]->next; p!=NULL; p=p->next) {
  	  c = (Cycle *) p->elem;
      degree=set_deg(c->cyclicDep);
	  fprintf(stderr,"Cycle %d: (degree %d) %s -->\n", i++, degree, RulePtr[c->croot]->rname);
      fprintf(stderr,"    *self*\n");
      MR_dumpRuleSet(c->cyclicDep);
      fprintf(stderr,"\n");
	  f = (CacheEntry *)
			hash_get(Fcache,Fkey(RulePtr[c->croot]->rname,'o',k));
      if (f == NULL) {
        fprintf(stderr,"    *** FOLLOW(%s) must be in cache but isn't ***\n",
                                         RulePtr[c->croot]->rname);
      };
    };
  };
}

void 
#ifdef __USE_PROTOS
dumpfostack(int k) 
#else
dumpfostack(k) 
int k;
#endif
{
  int   i=0;
  int   *pi;

  fprintf(stderr,"\n");
  if (FoStack[k] == NULL) {
    fprintf(stderr,"FoStack[%d] is null\n",k);
  };
  if (FoTOS[k] == NULL) {
    fprintf(stderr,"FoTOS[%d] is null\n",k);
  }
  if (FoTOS[k] != NULL && FoStack[k] != NULL) {
    for (pi=FoStack[k]; pi <= FoTOS[k]; pi++) {
      i++;
      fprintf(stderr,"#%d  rule %d  %s\n",i,*pi,RulePtr[*pi]->rname);
    }
  }
}