summaryrefslogtreecommitdiff
path: root/BaseTools/Source/C/VfrCompile/Pccts/antlr/dumpcycles.c
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2009-07-17 09:10:31 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2009-07-17 09:10:31 +0000
commit30fdf1140b8d1ce93f3821d986fa165552023440 (patch)
treec45c336a8955b1d03ea56d6c915a0e68a43b4ee9 /BaseTools/Source/C/VfrCompile/Pccts/antlr/dumpcycles.c
parent577e30cdb473e4af8e65fd6f75236691d0c8dfb3 (diff)
downloadedk2-platforms-30fdf1140b8d1ce93f3821d986fa165552023440.tar.xz
Check In tool source code based on Build tool project revision r1655.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8964 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/C/VfrCompile/Pccts/antlr/dumpcycles.c')
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/dumpcycles.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/dumpcycles.c b/BaseTools/Source/C/VfrCompile/Pccts/antlr/dumpcycles.c
new file mode 100644
index 0000000000..8156159f71
--- /dev/null
+++ b/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);
+ }
+ }
+}