]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/CCode/Source/Pccts/antlr/generic.h
Retiring the ANT/JAVA build and removing the older EDK II packages that required...
[mirror_edk2.git] / Tools / CCode / Source / Pccts / antlr / generic.h
diff --git a/Tools/CCode/Source/Pccts/antlr/generic.h b/Tools/CCode/Source/Pccts/antlr/generic.h
deleted file mode 100644 (file)
index 8d736d5..0000000
+++ /dev/null
@@ -1,286 +0,0 @@
-/*\r
- * generic.h -- generic include stuff for new PCCTS ANTLR.\r
- *\r
- * SOFTWARE RIGHTS\r
- *\r
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool\r
- * Set (PCCTS) -- PCCTS is in the public domain.  An individual or\r
- * company may do whatever they wish with source code distributed with\r
- * PCCTS or the code generated by PCCTS, including the incorporation of\r
- * PCCTS, or its output, into commerical software.\r
- *\r
- * We encourage users to develop software with PCCTS.  However, we do ask\r
- * that credit is given to us for developing PCCTS.  By "credit",\r
- * we mean that if you incorporate our source code into one of your\r
- * programs (commercial product, research project, or otherwise) that you\r
- * acknowledge this fact somewhere in the documentation, research report,\r
- * etc...  If you like PCCTS and have developed a nice tool with the\r
- * output, please mention that you developed it using PCCTS.  In\r
- * addition, we ask that this header remain intact in our source code.\r
- * As long as these guidelines are kept, we expect to continue enhancing\r
- * this system and expect to make other tools available as they are\r
- * completed.\r
- *\r
- * ANTLR 1.33\r
- * Terence Parr\r
- * Parr Research Corporation\r
- * with Purdue University and AHPCRC, University of Minnesota\r
- * 1989-2001\r
- */\r
-\r
-#define StrSame                        0\r
-\r
-#define DefaultParserName      "zzparser"\r
-\r
-/* MR9  JVincent@novell.com     Allow user to override default ZZLEXBUFSIZE  */\r
-/* MR11 thm                     Raise antlr's own default ZZLEXBUFSIZE to 8k */\r
-/* MR22 thm                     Raise antlr's own default ZZLEXBUFSIZE to 32k */\r
-\r
-#ifndef ZZLEXBUFSIZE\r
-#define ZZLEXBUFSIZE 32000\r
-#endif\r
-\r
-/* Tree/FIRST/FOLLOW defines -- valid only after all grammar has been read */\r
-#define ALT                    TokenNum+1\r
-#define SET                    TokenNum+2\r
-#define TREE_REF       TokenNum+3\r
-\r
-                                       /* E r r o r  M a c r o s */\r
-\r
-#define fatal(err)     fatalFL(err, __FILE__, __LINE__)\r
-#define fatal_internal(err)    fatal_intern(err, __FILE__, __LINE__)\r
-\r
-\r
-#define eMsg1(s,a)     eMsg3(s,a,NULL,NULL)\r
-#define eMsg2(s,a,b)   eMsg3(s,a,b,NULL)\r
-\r
-                               /* S a n i t y  C h e c k i n g */\r
-\r
-#ifndef require\r
-#define require(expr, err) {if ( !(expr) ) fatal_internal(err);}\r
-#endif\r
-\r
-                                       /* L i s t  N o d e s */\r
-\r
-typedef struct _ListNode {\r
-                       void *elem;                     /* pointer to any kind of element */\r
-                       struct _ListNode *next;\r
-               } ListNode;\r
-\r
-/* Define a Cycle node which is used to track lists of cycles for later\r
- * reconciliation by ResolveFoCycles().\r
- */\r
-typedef struct _c {\r
-                       int croot;                      /* cycle root */\r
-                       set cyclicDep;          /* cyclic dependents */\r
-                       unsigned deg;           /* degree of FOLLOW set of croot */\r
-               } Cycle;\r
-\r
-typedef struct _e {\r
-                       int tok;                        /* error class name == TokenStr[tok] */\r
-                       ListNode *elist;        /* linked list of elements in error set */\r
-                       set eset;\r
-                       int setdeg;                     /* how big is the set */\r
-                       int lexclass;           /* which lex class is it in? */\r
-               } ECnode;\r
-\r
-typedef struct _TCnode {\r
-                       int tok;                        /* token class name */\r
-                       ListNode *tlist;        /* linked list of elements in token set */\r
-                       set tset;\r
-                       int lexclass;           /* which lex class is it in? */\r
-                       unsigned char dumped; /* this def has been been dumped */\r
-                       unsigned char dumpedComplement; /* this def has been been dumped */\r
-                       unsigned setnum;        /* which set number is this guy? (if dumped) */\r
-                       unsigned setnumComplement;               /* MR23 */\r
-                       unsigned setnumErrSet;                   /* MR23 which set is this #tokclass error set (if dumped) */\r
-                       unsigned setnumErrSetComplement; /* MR23 */\r
-               } TCnode;\r
-\r
-typedef struct _ft {\r
-                       char *token;            /* id of token type to remap */\r
-                       int tnum;                       /* move token type to which token position */\r
-               } ForcedToken;\r
-\r
-typedef struct _ContextGuardPredicates {    /* MR13 */\r
-            Predicate *pred;                /* MR13 */\r
-        } ContextGuardPredicates;           /* MR13 */\r
-\r
-#define newListNode    (ListNode *) calloc(1, sizeof(ListNode));\r
-#define newCycle       (Cycle *) calloc(1, sizeof(Cycle));\r
-#define newECnode      (ECnode *) calloc(1, sizeof(ECnode));\r
-#define newTCnode      (TCnode *) calloc(1, sizeof(TCnode));\r
-\r
-\r
-                               /* H a s h  T a b l e  E n t r i e s */\r
-\r
-typedef struct _t {                            /* Token name or expression */\r
-                       char *str;\r
-                       struct _t *next;\r
-                       int token;                      /* token number */\r
-                       unsigned char classname;        /* is it a err/tok class name or token */\r
-                       TCnode *tclass;         /* ptr to token class */\r
-                       char *action;\r
-            char *akaString;\r
-               } TermEntry;\r
-\r
-typedef struct _r {                            /* Rule name and ptr to start of rule */\r
-                       char *str;\r
-                       struct _t *next;\r
-                       int rulenum;            /* RulePtr[rulenum]== ptr to RuleBlk junction */\r
-                       unsigned char noAST;/* gen AST construction code? (def==gen code) */\r
-                       char *egroup;           /* which error group (err reporting stuff) */\r
-#if 0\r
-                       /* MR27  This appears to never be used.  Delete this code later. */\r
-\r
-                       ListNode *el_labels;/* list of element labels ref in all of rule */\r
-#endif\r
-                       ListNode *ast_labels_in_actions; /* MR27 */\r
-            unsigned char has_rule_exception;\r
-            char dontComputeErrorSet;    /* MR14 - don't compute error set\r
-                                          special for rule in alpha part of\r
-                                          (alpha)? beta block */\r
-               } RuleEntry;\r
-\r
-typedef struct _f {                            /* cache Fi/Fo set */\r
-                       char *str;                      /* key == (rulename, computation, k) */\r
-                       struct _f *next;\r
-                       set fset;                       /* First/Follow of rule */\r
-                       set rk;                         /* set of k's remaining to be done after ruleref */\r
-                       int incomplete;         /* only w/FOLLOW sets.  Use only if complete */\r
-               } CacheEntry;\r
-\r
-typedef struct _LabelEntry {   /* element labels */\r
-                       char *str;\r
-                       struct _f *next;\r
-                       Node *elem;                     /* which element does it point to? */\r
-                       ExceptionGroup *ex_group;\r
-                                                               /* Is there an exception attached to label? */\r
-            ExceptionGroup *outerEG;                                 /* MR7 */\r
-                                /* next EG if ex_group doesn't catch it MR7 */\r
-            struct _LabelEntry  *pendingLink;                        /* MR7 */\r
-                                /* too lazy to use ListNode ?           MR7 */\r
-            int     curAltNum;                                       /* MR7 */\r
-               } LabelEntry;\r
-\r
-typedef struct _SignalEntry {\r
-                       char *str;\r
-                       struct _f *next;\r
-                       int signum;                     /* unique signal number */\r
-               } SignalEntry;\r
-\r
-typedef struct _PredEntry {                            /* MR11 predicate name and ptr to string */\r
-                       char              *str;\r
-            struct _PredEntry *next;\r
-            int               file;\r
-            int               line;\r
-            Predicate         *pred;\r
-            char              *predLiteral;\r
-               } PredEntry;\r
-\r
-typedef struct _PointerStack {      /* MR10 */\r
-        int     count;\r
-        int     size;\r
-        void    **data;\r
-        } PointerStack;\r
-\r
-#define newTermEntry(s)                (TermEntry *) newEntry(s, sizeof(TermEntry))\r
-#define newRuleEntry(s)                (RuleEntry *) newEntry(s, sizeof(RuleEntry))\r
-#define newCacheEntry(s)       (CacheEntry *) newEntry(s, sizeof(CacheEntry))\r
-#define newLabelEntry(s)       (LabelEntry *) newEntry(s, sizeof(LabelEntry))\r
-#define newSignalEntry(s)      (SignalEntry *) newEntry(s, sizeof(SignalEntry))\r
-#define newPredEntry(s)     (PredEntry *) newEntry(s,sizeof(PredEntry))\r
-\r
-typedef struct _UserAction {\r
-                       char *action;\r
-                       int file, line;\r
-               } UserAction;\r
-\r
-\r
-                                       /* L e x i c a l  C l a s s */\r
-\r
-/* to switch lex classes, switch ExprStr and Texpr (hash table) */\r
-typedef struct _lc {\r
-                       char *classnum, **exprs;\r
-                       Entry **htable;\r
-               } LClass;\r
-\r
-typedef struct _exprOrder {\r
-                       char *expr;\r
-                       int lclass;\r
-               } Expr;\r
-\r
-\r
-typedef Graph Attrib;\r
-\r
-                                               /* M a x i m u m s */\r
-\r
-/* MR20 Note G. Hobbelt These values are superceded by values in hash.h */\r
-\r
-#ifndef HashTableSize\r
-#define HashTableSize  253\r
-#endif\r
-#ifndef StrTableSize\r
-#define StrTableSize   15000   /* all tokens, nonterminals, rexprs stored here */\r
-#endif\r
-#define MaxLexClasses  50              /* how many automatons */\r
-/* TokenStart and EofToken are ignored if #tokdefs meta-op is used */\r
-#define TokenStart             2               /* MUST be in 1 + EofToken */\r
-#define EofToken               1               /* Always predefined to be 1 */\r
-\r
-#ifndef MaxNumFiles\r
-#define MaxNumFiles            99\r
-#endif\r
-\r
-/**** MR9 JVincent@novell.com  Move to pcctscfg.h */\r
-/**** #define MaxFileName              300     ****/ /* MR9  Move to pcctscfg.h */ /* largest file name size */\r
-\r
-#define MaxRuleName            100             /* largest rule name size */\r
-#define TSChunk                        100             /* how much to expand TokenStr/ExprStr each time */\r
-#define TIChunk                        TSChunk /* expand TokenInd by same as TokenStr to mirror them */\r
-#define FoStackSize            100             /* deepest FOLLOW recursion possible */\r
-\r
-#define MaxClassDeclStuff   256    /* MR10 */\r
-\r
-#define NumPredefinedSignals 3\r
-\r
-           /* S t a n d a r d  S i g n a l s */\r
-\r
-#define sigNoSignal                            0\r
-#define sigMismatchedToken             1\r
-#define sigNoViableAlt                 2\r
-#define sigNoSemViableAlt              3\r
-\r
-\r
-\r
-/* AST token types */\r
-#define ASTexclude             0\r
-#define ASTchild               1\r
-#define ASTroot                        2\r
-#define ASTinclude             3               /* include subtree made by rule ref */\r
-\r
-\r
-#define PredictionVariable                             "zzpr_expr"\r
-#define PredictionLexClassSuffix               "_zzpred"\r
-\r
-#define WildCardString                                 "WildCard"\r
-\r
-#if 0\r
-    /*  Removed in version 1.33MR19\r
-        Don't understand why this never caused problems before\r
-    */\r
-\r
-    /*********************************************************\r
-    #ifndef ANTLRm\r
-       #define ANTLRm(st, f, _m)       zzbufsize = ZZLEXBUFSIZE;\\r
-                                       zzmode(_m);                                     \\r
-                                       zzenterANTLR(f);                        \\r
-                                       st; ++zzasp;                            \\r
-                                       zzleaveANTLR(f);\r
-       #endif                                          \r
-    *********************************************************/\r
-#endif\r
-\r
-#include "proto.h"\r
-#include "pcctscfg.h"   /* MR14 */\r
-#include <string.h>\r