diff options
author | 2023-10-10 14:33:42 +0000 | |
---|---|---|
committer | 2023-10-10 14:33:42 +0000 | |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/edk2/BaseTools/Source/C/VfrCompile/Pccts/antlr/dumpcycles.c | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/edk2/BaseTools/Source/C/VfrCompile/Pccts/antlr/dumpcycles.c')
-rw-r--r-- | roms/edk2/BaseTools/Source/C/VfrCompile/Pccts/antlr/dumpcycles.c | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/roms/edk2/BaseTools/Source/C/VfrCompile/Pccts/antlr/dumpcycles.c b/roms/edk2/BaseTools/Source/C/VfrCompile/Pccts/antlr/dumpcycles.c new file mode 100644 index 000000000..8156159f7 --- /dev/null +++ b/roms/edk2/BaseTools/Source/C/VfrCompile/Pccts/antlr/dumpcycles.c @@ -0,0 +1,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);
+ }
+ }
+}
|