]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkCompatibilityPkg/Other/Maintained/Tools/Pccts/sorcerer/lib/STreeParser.cpp
EdkCompatibilityPkg: Remove EdkCompatibilityPkg
[mirror_edk2.git] / EdkCompatibilityPkg / Other / Maintained / Tools / Pccts / sorcerer / lib / STreeParser.cpp
diff --git a/EdkCompatibilityPkg/Other/Maintained/Tools/Pccts/sorcerer/lib/STreeParser.cpp b/EdkCompatibilityPkg/Other/Maintained/Tools/Pccts/sorcerer/lib/STreeParser.cpp
deleted file mode 100644 (file)
index 0d50a33..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-#include <stdio.h>\r
-#include "STreeParser.h"\r
-\r
-void STreeParser::\r
-MATCH(SORASTBase *_t,int tok)\r
-{\r
-       if ( _t->type()!=tok )\r
-       {\r
-               if ( guessing ) _GUESS_FAIL;\r
-               else mismatched_token(tok, _t);\r
-       }\r
-}\r
-\r
-void STreeParser::\r
-MATCHRANGE(SORASTBase *_t,int tok,int tok2)\r
-{\r
-       if ( _t->type()<tok || _t->type()>tok2 )\r
-       {\r
-               if ( guessing ) _GUESS_FAIL;\r
-               else mismatched_range(tok, tok2, _t);\r
-       }\r
-}\r
-\r
-void STreeParser::\r
-WILDCARD(SORASTBase *_t)\r
-{\r
-       if ( _t==NULL )\r
-       {\r
-               if ( guessing ) _GUESS_FAIL;\r
-               else missing_wildcard();\r
-       }\r
-}\r
-\r
-void STreeParser::\r
-mismatched_range(int looking_for, int upper_token, SORASTBase *found)\r
-{\r
-       if ( found!=NULL ) {\r
-               fprintf(stderr,\r
-                               "parse error: expected token range %d..%d found token %d\n",\r
-                               looking_for, upper_token,\r
-                               found->type());\r
-       }\r
-       else {\r
-               fprintf(stderr,\r
-                               "parse error: expected token range %d..%d found NULL tree\n",\r
-                               looking_for, upper_token);\r
-       }\r
-}\r
-\r
-void STreeParser::\r
-missing_wildcard()\r
-{\r
-       fprintf(stderr, "parse error: expected any token/tree found found NULL tree\n");\r
-}\r
-\r
-void STreeParser::\r
-mismatched_token(int looking_for, SORASTBase *found)\r
-{\r
-       if ( found!=NULL ) {\r
-               fprintf(stderr,\r
-                               "parse error: expected token %d found token %d\n",\r
-                               looking_for,\r
-                               found->type());\r
-       }\r
-       else {\r
-               fprintf(stderr,\r
-                               "parse error: expected token %d found NULL tree\n",\r
-                               looking_for);\r
-       }\r
-}\r
-\r
-void STreeParser::\r
-no_viable_alt(char *rulename, SORASTBase *root)\r
-{\r
-       if ( root==NULL )\r
-               fprintf(stderr,\r
-                               "parse error: in rule %s, no viable alternative for NULL tree\n",\r
-                               rulename);\r
-       else\r
-               fprintf(stderr,\r
-                               "parse error: in rule %s, no viable alternative for tree\n",\r
-                               rulename);\r
-}\r
-\r
-void STreeParser::\r
-panic(char *err)\r
-{\r
-       fprintf(stderr, "panic: %s\n", err);\r
-       exit(-1);\r
-}\r
-\r
-void STreeParser::\r
-save_state(STreeParser *buf)\r
-{\r
-       buf->try_ok = this->try_ok;\r
-       buf->sjrv = this->sjrv;\r
-       buf->guessing = this->guessing;\r
-       buf->startofguess = this->startofguess;\r
-}\r
-\r
-void STreeParser::\r
-restore_state(STreeParser *buf)\r
-{\r
-       this->try_ok = buf->try_ok;\r
-       this->sjrv = buf->sjrv;\r
-       this->guessing = buf->guessing;\r
-       this->startofguess = buf->startofguess;\r
-}\r
-\r
-void STreeParser::\r
-_mkroot(SORASTBase **r, SORASTBase **s, SORASTBase **e, SORASTBase *t)\r
-{\r
-       *r = t;\r
-}\r
-\r
-void STreeParser::\r
-_mkchild(SORASTBase **r, SORASTBase **s, SORASTBase **e, SORASTBase *t)\r
-{\r
-#ifdef BEFORE_GARYS_FIX\r
-       /* if no sibling list, must attach to any existing root */\r
-       if ( *s==NULL )\r
-       {\r
-               *s = *e = t;\r
-               /* If r is NULL, then there was no root defined--must be sibling list */\r
-               if ( *r==NULL ) *r = *s;\r
-               else (*r)->setDown(t);\r
-       }\r
-       else { (*e)->setRight(t); *e = t; }\r
-#endif\r
-/*\r
-       should do nothing if asked to add a NULL argument.  NULL's come up\r
-       when a rule wants to return "nothing".\r
-*/\r
-       /* if no sibling list, must attach to any existing root */\r
-       if (*s == NULL)\r
-       {\r
-               *s = *e = t;\r
-               // If r is NULL then there was no root defined--must be sibling list\r
-               if (*r == NULL) *r = *s;\r
-               else (*r)->setDown(t);\r
-       }\r
-       else if (*e != NULL)\r
-       {\r
-               (*e)->setRight(t);\r
-               *e = t;\r
-       }\r
-       if (*e != NULL) {\r
-               while ((*e)->right() != NULL) *e = (SORASTBase *)(*e)->right();\r
-       }\r
-}\r
-\r