]>
Commit | Line | Data |
---|---|---|
1 | /*\r | |
2 | * globals.c -- File containing all variables/tables visible to all files.\r | |
3 | *\r | |
4 | * SOFTWARE RIGHTS\r | |
5 | *\r | |
6 | * We reserve no LEGAL rights to the Purdue Compiler Construction Tool\r | |
7 | * Set (PCCTS) -- PCCTS is in the public domain. An individual or\r | |
8 | * company may do whatever they wish with source code distributed with\r | |
9 | * PCCTS or the code generated by PCCTS, including the incorporation of\r | |
10 | * PCCTS, or its output, into commerical software.\r | |
11 | *\r | |
12 | * We encourage users to develop software with PCCTS. However, we do ask\r | |
13 | * that credit is given to us for developing PCCTS. By "credit",\r | |
14 | * we mean that if you incorporate our source code into one of your\r | |
15 | * programs (commercial product, research project, or otherwise) that you\r | |
16 | * acknowledge this fact somewhere in the documentation, research report,\r | |
17 | * etc... If you like PCCTS and have developed a nice tool with the\r | |
18 | * output, please mention that you developed it using PCCTS. In\r | |
19 | * addition, we ask that this header remain intact in our source code.\r | |
20 | * As long as these guidelines are kept, we expect to continue enhancing\r | |
21 | * this system and expect to make other tools available as they are\r | |
22 | * completed.\r | |
23 | *\r | |
24 | * ANTLR 1.33\r | |
25 | * Terence Parr\r | |
26 | * Parr Research Corporation\r | |
27 | * with Purdue University and AHPCRC, University of Minnesota\r | |
28 | * 1989-2001\r | |
29 | */\r | |
30 | \r | |
31 | #include <stdio.h>\r | |
32 | \r | |
33 | #include "pcctscfg.h"\r | |
34 | \r | |
35 | #include "set.h"\r | |
36 | #include "syn.h"\r | |
37 | #include "hash.h"\r | |
38 | #include "generic.h"\r | |
39 | \r | |
40 | char Version[] = "1.33MR33" ; /* PCCTS version number */ /* MRXXX */\r | |
41 | char VersionDef[] = "13333"; /* same (except int equiv for preproc symbol) */ /* MRXXX */\r | |
42 | \r | |
43 | char LexStartSymbol[] = "START";/* Name of starting lexical class/automaton */\r | |
44 | char *RemapFileName = "remap.h";\r | |
45 | char *DlgFileName = "parser.dlg";\r | |
46 | char *DefFileName = "tokens.h";\r | |
47 | char *ErrFileName = "err.c";\r | |
48 | char *ModeFileName = "mode.h";\r | |
49 | char *StdMsgName = NULL;\r | |
50 | \r | |
51 | char *ParserName = DefaultParserName;\r | |
52 | \r | |
53 | /* list of PCCTS supplied support symbols; these are renamed when more than\r | |
54 | * one ANTLR-generated parsers are linked together to avoid name conflicts.\r | |
55 | * Can't use '##' ANSIC preprocessor concat operator with K&R and:\r | |
56 | * #define zzskip zzparser ## skip\r | |
57 | * will not work for ANSI/C++ as 'zzparserskip' is created w/o zzparser\r | |
58 | * being substituted--ack!!!\r | |
59 | */\r | |
60 | char *StandardSymbols[] = {\r | |
61 | /* ANTLR stuff */\r | |
62 | "zzStackOvfMsg",\r | |
63 | "zzasp",\r | |
64 | "zzaStack",\r | |
65 | "inf_tokens",\r | |
66 | "inf_text",\r | |
67 | "inf_text_buffer",\r | |
68 | "inf_text_buffer_ptr",\r | |
69 | "inf_text_buffer_size",\r | |
70 | "inf_labase",\r | |
71 | "inf_last",\r | |
72 | "inf_lap",\r | |
73 | "zztokenLA",\r | |
74 | "zztextLA",\r | |
75 | "zzlap",\r | |
76 | "zzlabase",\r | |
77 | "zztoktext",\r | |
78 | "zztoken",\r | |
79 | "zzdirty",\r | |
80 | "zzguessing",\r | |
81 | "zzguess_start",\r | |
82 | "zzresynch",\r | |
83 | "zzinf_tokens",\r | |
84 | "zzinf_text",\r | |
85 | "zzinf_text_buffer",\r | |
86 | "zzinf_labase",\r | |
87 | "zzinf_last",\r | |
88 | "zzfill_inf_look",\r | |
89 | "zzFAIL",\r | |
90 | "zzsave_antlr_state",\r | |
91 | "zzrestore_antlr_state",\r | |
92 | "zzsyn",\r | |
93 | "zzset_el",\r | |
94 | "zzset_deg",\r | |
95 | "zzedecode",\r | |
96 | "_zzsetmatch",\r | |
97 | "_zzmatch",\r | |
98 | "_inf_zzgettok",\r | |
99 | "zzconsumeUntil",\r | |
100 | "zzconsumeUntilToken",\r | |
101 | "_zzmatch_wsig",\r | |
102 | "_zzsetmatch_wsig",\r | |
103 | "_zzmatch_wdfltsig",\r | |
104 | "_zzsetmatch_wdfltsig",\r | |
105 | "zzdflthandlers",\r | |
106 | /* DLG stuff */\r | |
107 | "zzreal_line",\r | |
108 | "zzcharfull",\r | |
109 | "zzerr",\r | |
110 | "zzlextext",\r | |
111 | "zzbegexpr",\r | |
112 | "zzendexpr",\r | |
113 | "zzbufsize",\r | |
114 | "zzbegcol",\r | |
115 | "zzendcol",\r | |
116 | "zzline",\r | |
117 | "zzchar",\r | |
118 | "zzbufovf",\r | |
119 | "zzrdstream",\r | |
120 | "zzrdfunc",\r | |
121 | "zzrdstr",\r | |
122 | "zzclose_stream",\r | |
123 | "zzsave_dlg_state",\r | |
124 | "zzrestore_dlg_state",\r | |
125 | "zzmode",\r | |
126 | "zzskip",\r | |
127 | "zzmore",\r | |
128 | "zzreplchar",\r | |
129 | "zzreplstr",\r | |
130 | "zzgettok",\r | |
131 | "zzadvance",\r | |
132 | "zzerrstd",\r | |
133 | "zzerr_in",\r | |
134 | "zzconstr_attr",\r | |
135 | "zzempty_attr",\r | |
136 | "zzerraction",\r | |
137 | "zztokens", /* list of token regular expressions */\r | |
138 | "dfa",\r | |
139 | "accepts",\r | |
140 | "actions",\r | |
141 | "zzTraceOptionValue", /* MR10 */\r | |
142 | "zzTraceGuessOptionValue", /* MR10 */\r | |
143 | "zzTraceCurrentRuleName", /* MR10 */\r | |
144 | "zzTraceDepth", /* MR10 */\r | |
145 | "zzGuessSeq", /* MR10 */\r | |
146 | "zzSyntaxErrCount", /* MR11 */\r | |
147 | "zzLexErrCount", /* MR11 */\r | |
148 | "zzTraceGuessDone", /* MR13 - BJS */\r | |
149 | "zzTraceGuessFail", /* MR13 - BJS */\r | |
150 | "zzTraceGuessOption", /* MR13 - BJS */\r | |
151 | "zzTraceIn", /* MR13 - BJS */\r | |
152 | "zzTraceOption", /* MR13 - BJS */\r | |
153 | "zzTraceOut", /* MR13 - BJS */\r | |
154 | "zzTraceReset", /* MR13 - BJS */\r | |
155 | NULL /* must be present */\r | |
156 | };\r | |
157 | \r | |
158 | /* list of PCCTS supplied support functions; these are renamed when more than\r | |
159 | * one ANTLR-generated parsers are linked together to avoid name conflicts.\r | |
160 | */\r | |
161 | char *ASTSymbols[] = {\r | |
162 | "AST",\r | |
163 | "zzast_sp",\r | |
164 | "zzastStack",\r | |
165 | "zzlink",\r | |
166 | "zzastnew",\r | |
167 | "zzsubchild",\r | |
168 | "zzsubroot",\r | |
169 | "zzpre_ast",\r | |
170 | "zzfree_ast",\r | |
171 | "zztmake",\r | |
172 | "zzdup_ast",\r | |
173 | "zztfree",\r | |
174 | "zzdouble_link",\r | |
175 | NULL /* must be present */\r | |
176 | };\r | |
177 | \r | |
178 | /* Current ambiguity examination information */\r | |
179 | int CurAmbigAlt1, CurAmbigAlt2, CurAmbigline, CurAmbigfile;\r | |
180 | char *CurAmbigbtype;\r | |
181 | \r | |
182 | \r | |
183 | /* M e t h o d T a b l e s */\r | |
184 | /*\r | |
185 | * The following tables are used to fill syntax diagram nodes with the correct\r | |
186 | * function pointers for computing FIRST sets and printing themselves.\r | |
187 | */\r | |
188 | \r | |
189 | /* fpTraverse[node type] == pointer to function that calculates trees\r | |
190 | * representing the FIRST sets for that node (maintains spatial info).\r | |
191 | * We use 'struct _tree' not 'tree' due to a g++ 2.4.3 bug.\r | |
192 | */\r | |
193 | #ifdef __cplusplus\r | |
194 | struct _tree *(*fpTraverse[NumNodeTypes+1])(... /* Node *, int, set * */) = {\r | |
195 | NULL,\r | |
196 | (struct _tree *(*)(...)) tJunc,\r | |
197 | (struct _tree *(*)(...)) tRuleRef,\r | |
198 | (struct _tree *(*)(...)) tToken,\r | |
199 | (struct _tree *(*)(...)) tAction\r | |
200 | };\r | |
201 | #else\r | |
202 | Tree *(*fpTraverse[NumNodeTypes+1])() = {\r | |
203 | NULL,\r | |
204 | tJunc,\r | |
205 | tRuleRef,\r | |
206 | tToken,\r | |
207 | tAction\r | |
208 | };\r | |
209 | #endif\r | |
210 | \r | |
211 | /* fpReach[node type] == pointer to function that calculates FIRST set for\r | |
212 | * that node. (r stands for reach). We use 'struct _set' not 'set'\r | |
213 | * due to a g++ 2.4.3 bug.\r | |
214 | */\r | |
215 | #ifdef __cplusplus\r | |
216 | struct _set (*fpReach[NumNodeTypes+1])(... /* Node *, int, set * */) = {\r | |
217 | NULL,\r | |
218 | (struct _set (*)(...)) rJunc,\r | |
219 | (struct _set (*)(...)) rRuleRef,\r | |
220 | (struct _set (*)(...)) rToken,\r | |
221 | (struct _set (*)(...)) rAction\r | |
222 | };\r | |
223 | #else\r | |
224 | set (*fpReach[NumNodeTypes+1])() = {\r | |
225 | NULL,\r | |
226 | rJunc,\r | |
227 | rRuleRef,\r | |
228 | rToken,\r | |
229 | rAction\r | |
230 | };\r | |
231 | #endif\r | |
232 | \r | |
233 | /* fpPrint[node type] == pointer to function that knows how to print that node. */\r | |
234 | #ifdef __cplusplus\r | |
235 | void (*fpPrint[NumNodeTypes+1])(... /* Node * */) = {\r | |
236 | NULL,\r | |
237 | (void (*)(...)) pJunc,\r | |
238 | (void (*)(...)) pRuleRef,\r | |
239 | (void (*)(...)) pToken,\r | |
240 | (void (*)(...)) pAction\r | |
241 | };\r | |
242 | #else\r | |
243 | void (*fpPrint[NumNodeTypes+1])() = {\r | |
244 | NULL,\r | |
245 | pJunc,\r | |
246 | pRuleRef,\r | |
247 | pToken,\r | |
248 | pAction\r | |
249 | };\r | |
250 | #endif\r | |
251 | \r | |
252 | char *decodeJType[] = {\r | |
253 | "invalid",\r | |
254 | "aSubBlk",\r | |
255 | "aOptBlk",\r | |
256 | "aLoopBlk",\r | |
257 | "EndBlk",\r | |
258 | "RuleBlk",\r | |
259 | "Generic",\r | |
260 | "EndRule",\r | |
261 | "aPlusBlk",\r | |
262 | "aLoopBegin"\r | |
263 | };\r | |
264 | \r | |
265 | \r | |
266 | /* H a s h T a b l e s */\r | |
267 | \r | |
268 | Entry **Tname, /* Table of all token names (maps name to tok num)*/\r | |
269 | **Texpr, /* Table of all token expressions\r | |
270 | (maps expr to tok num) */\r | |
271 | **Rname, /* Table of all Rules (has ptr to start of rule) */\r | |
272 | **Fcache, /* Cache of First/Follow Computations */\r | |
273 | **Tcache; /* Tree cache; First/Follow for permute trees */\r | |
274 | Entry **Elabel; /* Table of all element label names */\r | |
275 | Entry **Sname; /* Signal names */\r | |
276 | Entry **Pname; /* symbolic predicate names MR11 */\r | |
277 | \r | |
278 | \r | |
279 | /* V a r i a b l e s */\r | |
280 | \r | |
281 | int Save_argc; /* MR10 */\r | |
282 | char **Save_argv; /* MR10 */\r | |
283 | int EpToken=0; /* Imaginary Epsilon token number */\r | |
284 | int WildCardToken=0;\r | |
285 | int CurFile= -1; /* Index into FileStr table */\r | |
286 | char *CurPredName=NULL; /* MR11 */\r | |
287 | char *CurRule=NULL; /* Pointer to current rule name */\r | |
288 | int CurRuleDebug=0; /* MR13 debug flag */\r | |
289 | RuleEntry *CurRuleNode=NULL;/* Pointer to current rule node in syntax tree */\r | |
290 | char *CurRetDef=NULL; /* Pointer to current return type definition */\r | |
291 | char *CurParmDef=NULL; /* Pointer to current parameter definition */\r | |
292 | Junction *CurRuleBlk=NULL; /* Pointer to current block node for enclosing block */\r | |
293 | ListNode *CurExGroups=NULL; /* Current list of exception groups for rule/alts */\r | |
294 | ListNode *CurElementLabels=NULL;\r | |
295 | ListNode *CurAstLabelsInActions=NULL; /* MR27 */\r | |
296 | \r | |
297 | /* MR10 used by <<>>? to set "label_used_in_semantic_pred" */\r | |
298 | /* MR10 this will force LT(i) assignment even in guess mode */\r | |
299 | \r | |
300 | ListNode *CurActionLabels=NULL; /* MR10 Element Labels appearing in last action */\r | |
301 | int numericActionLabel=0 ; /* MR10 << ... $1 ... >> or << ... $1 ... >>? */\r | |
302 | ListNode *NumericPredLabels=NULL; /* MR10 << ... $1 ... >>? ONLY */\r | |
303 | ListNode *ContextGuardPredicateList=NULL; /* MR13 for re-evaluating predicates\r | |
304 | after meta tokens are defined */\r | |
305 | \r | |
306 | int CurBlockID=0; /* Unique int for each block */\r | |
307 | int CurAltNum=0;\r | |
308 | Junction *CurAltStart = NULL; /* Junction node that starts the alt */\r | |
309 | Junction *OuterAltStart = NULL; /* For chaining exception groups MR7 */\r | |
310 | int NumRules=0; /* Rules are from 1 to n */\r | |
311 | FILE *output=NULL; /* current parser output file */\r | |
312 | FILE *input=NULL; /* current grammar input file */\r | |
313 | char *FileStr[MaxNumFiles];/* Ptr to array of file names on command-line */\r | |
314 | int NumFiles=0; /* current grammar file number */\r | |
315 | #ifdef __cplusplus\r | |
316 | void (**fpTrans)(...), /* array of ptrs to funcs that translate nodes */\r | |
317 | (**fpJTrans)(...); /* ... that translate junctions */\r | |
318 | #else\r | |
319 | void (**fpTrans)(), /* array of ptrs to funcs that translate nodes */\r | |
320 | (**fpJTrans)(); /* ... that translate junctions */\r | |
321 | #endif\r | |
322 | int **FoStack; /* Array of LL_k ptrs to stacks of rule numbers */\r | |
323 | int **FoTOS; /* FOLLOW stack top-of-stack pointers */\r | |
324 | Junction *SynDiag = NULL; /* Pointer to start of syntax diagram */\r | |
325 | int BlkLevel=1; /* Current block level. Set by antlr.g, used by\r | |
326 | * scanner to translate $i.j attributes */\r | |
327 | set reserved_positions; /* set of token positions reserved by '#token T=i' cmds */\r | |
328 | set all_tokens; /* set of all token types */\r | |
329 | set imag_tokens; /* set of all imaginary token types (EpToken, errclasses...) */\r | |
330 | set tokclasses; /* set of all token class token types */\r | |
331 | ListNode *ForcedTokens = 0; /* list of token_id/token_num pairs to remap */\r | |
332 | ListNode *MetaTokenNodes=NULL; /* list of meta token refs such as token classes etc... */\r | |
333 | int *TokenInd=NULL; /* an indirection level between token num and position\r | |
334 | * of that token def in TokenStr and ExprStr */\r | |
335 | int LastTokenCounted=0; /* ==TokenNum if no token renumbering (same as old TokenNum) */\r | |
336 | int TokenNum=TokenStart;\r | |
337 | char **TokenStr=NULL; /* map token # to token name */\r | |
338 | char **ExprStr=NULL; /* map token # to expr */\r | |
339 | Junction **RulePtr=NULL; /* map rule # to RuleBlk node of rule */\r | |
340 | ListNode *ExprOrder=NULL; /* list of exprs as they are found in grammar */\r | |
341 | ListNode *BeforeActions=NULL;/* list of grammar actions before rules */\r | |
342 | ListNode *AfterActions=NULL;/* list of grammar actions after rules */\r | |
343 | ListNode *LexActions=NULL; /* list of lexical actions */\r | |
344 | \r | |
345 | /* MR1 */\r | |
346 | /* MR1 11-Apr-97 Provide mechanism for inserting code into DLG class */\r | |
347 | /* MR1 via #lexmember <<....>> */\r | |
348 | /* MR1 via #lexprefix <<....>> */\r | |
349 | /* MR1 */\r | |
350 | \r | |
351 | ListNode *LexMemberActions=NULL;/* list of lexical header member decl MR1 */\r | |
352 | ListNode *LexPrefixActions=NULL;/* list of lexical header #include decl MR1 */\r | |
353 | ListNode **Cycles=NULL; /* list of cycles (for each k) found when\r | |
354 | doing FOLLOWs */\r | |
355 | ListNode *eclasses=NULL; /* list of error classes */\r | |
356 | ListNode *tclasses=NULL; /* list of token classes */\r | |
357 | LClass lclass[MaxLexClasses]; /* array of lex class definitions */\r | |
358 | int CurrentLexClass; /* index into lclass */\r | |
359 | int NumLexClasses=0; /* in range 1..MaxLexClasses (init 0) */\r | |
360 | \r | |
361 | char *HdrAction=NULL; /* action defined with #header */\r | |
362 | char *FirstAction=NULL; /* action defined with #first MR11 */\r | |
363 | FILE *ErrFile; /* sets and error recovery stuff */\r | |
364 | FILE *DefFile=NULL; /* list of tokens, return value structs, setwd defs */\r | |
365 | FILE *MRinfoFile=NULL; /* MR10 information file */\r | |
366 | int MRinfo=0; /* MR10 */\r | |
367 | int MRinfoSeq=0; /* MR10 */\r | |
368 | int InfoP=0; /* MR10 predicates */\r | |
369 | int InfoT=0; /* MR10 tnodes */\r | |
370 | int InfoF=0; /* MR10 first/follow sets */\r | |
371 | int InfoM=0; /* MR10 monitor progress */\r | |
372 | int InfoO=0; /* MR12 orphan rules */\r | |
373 | int TnodesInUse=0; /* MR10 */\r | |
374 | int TnodesPeak=0; /* MR10 */\r | |
375 | int TnodesAllocated=0; /* MR10 */\r | |
376 | int TnodesReportThreshold=0; /* MR11 */\r | |
377 | int PotentialSuppression=0; /* MR10 */\r | |
378 | int PotentialDummy=0; /* MR10 */\r | |
379 | int CannotContinue=FALSE;\r | |
380 | int OutputLL_k = 1; /* LL_k for parsing must be power of 2 */\r | |
381 | int action_file; /* used to track start of action */\r | |
382 | int action_line;\r | |
383 | int FoundGuessBlk=0; /* there is a (...)? block somewhere in grammar */\r | |
384 | int FoundException=0; /* there is an exception somewhere in grammar */\r | |
385 | /* MR6 Distinguish between @ operator and real exception */\r | |
386 | /* MR6 by keeping separate flags for @ operator and real exceptions */\r | |
387 | int FoundAtOperator=0; /* MR6 */\r | |
388 | int FoundExceptionGroup=0; /* MR6 */\r | |
389 | int pLevel=0; /* print Level */\r | |
390 | int pAlt1,pAlt2; /* print "==>" in front of these alts */\r | |
391 | \r | |
392 | /* C++ output stuff */\r | |
393 | FILE *Parser_h, /* where subclass of ANTLRParser goes */\r | |
394 | *Parser_c; /* where code for subclass of ANTLRParser goes */\r | |
395 | char Parser_h_Name[MaxFileName+1] = "";\r | |
396 | char Parser_c_Name[MaxFileName+1] = "";\r | |
397 | char MRinfoFile_Name[MaxFileName+1] = ""; /* MR10 */\r | |
398 | char *ClassDeclStuff=NULL; /* MR10 */\r | |
399 | char *BaseClassName=NULL; /* MR22 */\r | |
400 | /* list of actions inside the #class {...} defs */\r | |
401 | ListNode *class_before_actions=NULL;\r | |
402 | ListNode *class_after_actions=NULL;\r | |
403 | \r | |
404 | char CurrentClassName[MaxRuleName]="";\r | |
405 | int no_classes_found=1;\r | |
406 | char *UserTokenDefsFile;\r | |
407 | int UserDefdTokens=0; /* found #tokdefs? */\r | |
408 | char *OutputDirectory=TopDirectory;\r | |
409 | ExceptionGroup *DefaultExGroup = NULL;\r | |
410 | int NumSignals = NumPredefinedSignals;\r | |
411 | int ContextGuardTRAV=0;\r | |
412 | \r | |
413 | char *MR_AmbAidRule=NULL; /* MR11 */\r | |
414 | int MR_AmbAidLine=0; /* MR11 */\r | |
415 | int MR_AmbAidDepth=0; /* MR11 */\r | |
416 | int MR_AmbAidMultiple=0; /* MR11 */\r | |
417 | int MR_skipped_e3_report=0; /* MR11 */\r | |
418 | int MR_usingPredNames=0; /* MR11 */\r | |
419 | int MR_BadExprSets=0; /* MR13 */\r | |
420 | int MR_Inhibit_Tokens_h_Gen=0; /* MR13 */\r | |
421 | int NewAST=0; /* MR13 */\r | |
422 | int tmakeInParser=0; /* MR23 */\r | |
423 | int AlphaBetaTrace=0; /* MR14 */\r | |
424 | int MR_BlkErr=0; /* MR21 */\r | |
425 | int MR_AlphaBetaMessageCount=0; /* MR14 */\r | |
426 | int MR_AlphaBetaWarning=0; /* MR14 */\r | |
427 | int MR_ErrorSetComputationActive=0; /* MR14 */\r | |
428 | int MR_MaintainBackTrace=0; /* MR14 */\r | |
429 | set MR_CompromisedRules; /* MR14 */\r | |
430 | \r | |
431 | Junction *MR_RuleBlkWithHalt; /* MR10 */\r | |
432 | \r | |
433 | /* C m d - L i n e O p t i o n s */\r | |
434 | \r | |
435 | int LL_k=1; /* how many tokens of full lookahead */\r | |
436 | int CLL_k= -1; /* how many tokens of compressed lookahead */\r | |
437 | int PrintOut = FALSE; /* print out the grammar */\r | |
438 | int PrintAnnotate = FALSE;/* annotate printout with FIRST sets */\r | |
439 | int CodeGen=TRUE; /* Generate output code? */\r | |
440 | int LexGen=TRUE; /* Generate lexical files? (tokens.h, parser.dlg) */\r | |
441 | int GenAST=FALSE; /* Generate AST's? */\r | |
442 | int GenANSI=FALSE; /* Generate ANSI code where necessary */\r | |
443 | int GenExprSetsOpt=TRUE;/* use sets not (LA(1)==tok) expression lists */\r | |
444 | int GenCR=FALSE; /* Generate cross reference? */\r | |
445 | int GenLineInfo=FALSE; /* Generate # line "file" stuff? */\r | |
446 | int GenLineInfoMS=FALSE;/* Like -gl but replace "\" with "/" for MS C/C++ systems */\r | |
447 | int TraceGen=FALSE; /* Generate code to trace rule invocation */\r | |
448 | int elevel=1; /* error level for ambiguity messages */\r | |
449 | int GenEClasseForRules=0;/* don't generate eclass for each rule */\r | |
450 | int TreeResourceLimit= -1;/* don't limit tree resource */\r | |
451 | int DemandLookahead = 0;/* demand/delayed lookahead or not */\r | |
452 | char *RulePrefix = ""; /* prefix each generated rule with this */\r | |
453 | char *stdpccts = "stdpccts.h";/* where to generate std pccts include file */\r | |
454 | int GenStdPccts = 0; /* don't gen stdpccts.h? */\r | |
455 | int ParseWithPredicates = 1;\r | |
456 | int WarningLevel = 1;\r | |
457 | int UseStdout = 0; /* MR6 */\r | |
458 | int TabWidth = 2; /* MR6 */ /* MR27 */\r | |
459 | int HoistPredicateContext = 0;\r | |
460 | int MRhoisting = 0; /* MR9 */\r | |
461 | int MRhoistingk = 0; /* MR13 */\r | |
462 | int MR_debugGenRule=0; /* MR11 */\r | |
463 | \r | |
464 | int GenCC = 0; /* Generate C++ output */\r | |
465 | \r | |
466 | PointerStack MR_BackTraceStack={0,0,NULL}; /* MR10 */\r | |
467 | PointerStack MR_PredRuleRefStack={0,0,NULL}; /* MR10 */\r | |
468 | PointerStack MR_RuleBlkWithHaltStack={0,0,NULL}; /* MR10 */\r | |
469 | \r | |
470 | /* DontCopyTokens and Pragma_DupLabeledTokens were a bad idea. I've just\r | |
471 | turned them off rather than backpatching the code. Who knows? We\r | |
472 | may need them in the future.\r | |
473 | */\r | |
474 | int DontCopyTokens = 1; /* in C++, don't copy ANTLRToken passed to ANTLR */\r | |
475 | \r | |
476 | /* Remember if LT(i), LA(i), or LATEXT(i) used in an action which is not\r | |
477 | a predicate. If so, give a warning for novice users.\r | |
478 | */\r | |
479 | \r | |
480 | int LTinTokenAction = 0; /* MR23 */\r | |
481 | int PURIFY = 1; /* MR23 */\r | |
482 | \r | |
483 | int CurBlockID_array[MAX_BLK_LEVEL]; /* MR23 */\r | |
484 | int CurAltNum_array[MAX_BLK_LEVEL]; /* MR23 */\r |