📄 tree.c
字号:
tTree pqualification;tTree pindex;#endif{ register tTree yyt = yyALLOCt (sizeof (ysubscription)); Tree_InitHead (yyt, ksubscription) yyt->subscription.pos = ppos; begintTree(yyt->subscription.env) yyt->subscription.qualification = pqualification; yyt->subscription.index = pindex; return yyt;}tTree menvs#if defined __STDC__ | defined __cplusplus(void)#else()#endif{ register tTree yyt = yyALLOCt (sizeof (yenvs)); Tree_InitHead (yyt, kenvs) return yyt;}tTree menv#if defined __STDC__ | defined __cplusplus(tTree pobjects, tTree penv, tTree pobject)#else(pobjects, penv, pobject)tTree pobjects;tTree penv;tTree pobject;#endif{ register tTree yyt = yyALLOCt (sizeof (yenv)); Tree_InitHead (yyt, kenv) yyt->env.objects = pobjects; yyt->env.env = penv; yyt->env.object = pobject; begintHashTable(yyt->env.HashTable) beginint(yyt->env.HashSize) return yyt;}tTree menv2#if defined __STDC__ | defined __cplusplus(tTree penv1, tTree penv2)#else(penv1, penv2)tTree penv1;tTree penv2;#endif{ register tTree yyt = yyALLOCt (sizeof (yenv2)); Tree_InitHead (yyt, kenv2) yyt->env2.env1 = penv1; yyt->env2.env2 = penv2; return yyt;}tTree mnoenv#if defined __STDC__ | defined __cplusplus(void)#else()#endif{ register tTree yyt = yyALLOCt (sizeof (ynoenv)); Tree_InitHead (yyt, knoenv) return yyt;}tTree mobjects#if defined __STDC__ | defined __cplusplus(void)#else()#endif{ register tTree yyt = yyALLOCt (sizeof (yobjects)); Tree_InitHead (yyt, kobjects) return yyt;}tTree mobject#if defined __STDC__ | defined __cplusplus(tTree pobject, tIdent pident, tTree pnext)#else(pobject, pident, pnext)tTree pobject;tIdent pident;tTree pnext;#endif{ register tTree yyt = yyALLOCt (sizeof (yobject)); Tree_InitHead (yyt, kobject) yyt->object.object = pobject; yyt->object.ident = pident; yyt->object.next = pnext; return yyt;}tTree mnoobject#if defined __STDC__ | defined __cplusplus(void)#else()#endif{ register tTree yyt = yyALLOCt (sizeof (ynoobject)); Tree_InitHead (yyt, knoobject) return yyt;}static FILE * yyf;static void yyMark#if defined __STDC__ | defined __cplusplus (register tTree yyt)#else (yyt) register tTree yyt;#endif{ for (;;) { if (yyt == NoTree || ++ yyt->yyHead.yyMark > 1) return; switch (yyt->Kind) {case kprogram:yyt = yyt->program.stmts; break;case kstmt_c:yyt = yyt->stmt_c.next; break;case kstmt:yyMark (yyt->stmt.words);yyt = yyt->stmt.next; break;case kproc_c:yyMark (yyt->proc_c.qualification);yyMark (yyt->proc_c.param_names);yyMark (yyt->proc_c.parameter);yyMark (yyt->proc_c.block);yyt = yyt->proc_c.next; break;case kproc:yyMark (yyt->proc.qualification);yyMark (yyt->proc.param_names);yyMark (yyt->proc.parameter);yyMark (yyt->proc.block);yyt = yyt->proc.next; break;case kmethod:yyMark (yyt->method.qualification);yyMark (yyt->method.param_names);yyMark (yyt->method.parameter);yyMark (yyt->method.block);yyt = yyt->method.next; break;case kbody:yyMark (yyt->body.qualification);yyMark (yyt->body.param_names);yyMark (yyt->body.parameter);yyMark (yyt->body.block);yyt = yyt->body.next; break;case kconfigbody:yyMark (yyt->configbody.qualification);yyMark (yyt->configbody.param_names);yyMark (yyt->configbody.parameter);yyMark (yyt->configbody.block);yyt = yyt->configbody.next; break;case kconstructor:yyMark (yyt->constructor.qualification);yyMark (yyt->constructor.param_names);yyMark (yyt->constructor.parameter);yyMark (yyt->constructor.block);yyMark (yyt->constructor.init);yyt = yyt->constructor.next; break;case kdestructor:yyMark (yyt->destructor.qualification);yyMark (yyt->destructor.param_names);yyMark (yyt->destructor.parameter);yyMark (yyt->destructor.block);yyt = yyt->destructor.next; break;case knamespace_c:yyMark (yyt->namespace_c.qualification);yyMark (yyt->namespace_c.block);yyt = yyt->namespace_c.next; break;case knamespace:yyMark (yyt->namespace.qualification);yyMark (yyt->namespace.block);yyt = yyt->namespace.next; break;case kclass:yyMark (yyt->class.qualification);yyMark (yyt->class.block);yyt = yyt->class.next; break;case kitcl_class:yyMark (yyt->itcl_class.qualification);yyMark (yyt->itcl_class.block);yyt = yyt->itcl_class.next; break;case kword_c:yyt = yyt->word_c.next; break;case kone_word:yyt = yyt->one_word.next; break;case kobj_word:yyt = yyt->obj_word.next; break;case kqual_word:yyMark (yyt->qual_word.qualification);yyt = yyt->qual_word.next; break;case kqual_words:yyMark (yyt->qual_words.qualifications);yyt = yyt->qual_words.next; break;case kone_qualification:yyMark (yyt->one_qualification.qualification);yyt = yyt->one_qualification.next; break;case ktext:yyt = yyt->text.next; break;case kcharacter:yyt = yyt->character.next; break;case kident:yyt = yyt->ident.next; break;case kblock:yyMark (yyt->block.stmts);yyt = yyt->block.next; break;case kcontent:yyMark (yyt->content.qualification);yyt = yyt->content.next; break;case kblock_content:yyMark (yyt->block_content.stmts);yyt = yyt->block_content.next; break;case klocal_text:yyt = yyt->local_text.texts; break;case kglobal_text:yyt = yyt->global_text.texts; break;case kqualification:yyt = yyt->qualification.qualification; break;case kcomplex_qual:yyMark (yyt->complex_qual.qualification);yyt = yyt->complex_qual.texts; break;case ksubscription:yyMark (yyt->subscription.qualification);yyt = yyt->subscription.index; break;case kenv:yyMark (yyt->env.objects);yyt = yyt->env.env; break;case kenv2:yyMark (yyt->env2.env1);yyt = yyt->env2.env2; break;case kobject:yyt = yyt->object.next; break; default: return; } }}static void yyWriteTree ARGS ((tTree yyt));static void yyWriteNl ARGS ((void)) { (void) putc ('\n', yyf); }static void yyWriteSelector#if defined __STDC__ | defined __cplusplus (char * yys)#else (yys) char * yys;#endif{ register int yyi = 16 - strlen (yys); (void) fputs (yys, yyf); while (yyi -- > 0) (void) putc (' ', yyf); (void) fputs (" = ", yyf);}static void yyWriteHex#if defined __STDC__ | defined __cplusplus (unsigned char * yyx, int yysize)#else (yyx, yysize) unsigned char * yyx; int yysize;#endif{ register int yyi; for (yyi = 0; yyi < yysize; yyi ++) (void) fprintf (yyf, "%02x ", yyx [yyi]); }static void yyWriteAdr#if defined __STDC__ | defined __cplusplus (tTree yyt)#else (yyt) tTree yyt;#endif{ if (yyt == NoTree) (void) fputs ("NoTree", yyf); else (void) fprintf (yyf, "%08lx *", (unsigned long) yyt); yyWriteNl ();}static void yWriteNodeprogram#if defined __STDC__ | defined __cplusplus (tTree yyt)#else (yyt) tTree yyt;#endif{ yyWriteSelector ("stmts"); yyWriteAdr (yyt->program.stmts);}static void yWriteNodestmts#if defined __STDC__ | defined __cplusplus (tTree yyt)#else (yyt) tTree yyt;#endif{ yyWriteSelector ("env"); writetTree (yyt->stmts.env) yyWriteNl ();}static void yWriteNodenostmt#if defined __STDC__ | defined __cplusplus (tTree yyt)#else (yyt) tTree yyt;#endif{ yWriteNodestmts (yyt);}static void yWriteNodestmt_c#if defined __STDC__ | defined __cplusplus (tTree yyt)#else (yyt) tTree yyt;#endif{ yWriteNodestmts (yyt); yyWriteSelector ("next"); yyWriteAdr (yyt->stmt_c.next);}static void yWriteNodestmt#if defined __STDC__ | defined __cplusplus (tTree yyt)#else (yyt) tTree yyt;#endif{ yWriteNodestmt_c (yyt); yyWriteSelector ("words"); yyWriteAdr (yyt->stmt.words);}static void yWriteNodeproc_c#if defined __STDC__ | defined __cplusplus (tTree yyt)#else (yyt) tTree yyt;#endif{ yWriteNodestmt_c (yyt); yyWriteSelector ("qualification"); yyWriteAdr (yyt->proc_c.qualification); yyWriteSelector ("param_names"); yyWriteAdr (yyt->proc_c.param_names); yyWriteSelector ("parameter"); yyWriteAdr (yyt->proc_c.parameter); yyWriteSelector ("block"); yyWriteAdr (yyt->proc_c.block); yyWriteSelector ("epos"); writetPosition (yyt->proc_c.epos) yyWriteNl (); yyWriteSelector ("attribute"); writeint (yyt->proc_c.attribute) yyWriteNl ();}static void yWriteNodeproc#if defined __STDC__ | defined __cplusplus (tTree yyt)#else (yyt) tTree yyt;#endif{ yWriteNodeproc_c (yyt);}static void yWriteNodemethod#if defined __STDC__ | defined __cplusplus (tTree yyt)#else (yyt) tTree yyt;#endif{ yWriteNodeproc_c (yyt);}static void yWriteNodebody#if defined __STDC__ | defined __cplusplus (tTree yyt)#else (yyt) tTree yyt;#endif{ yWriteNodeproc_c (yyt);}static void yWriteNodeconfigbody#if defined __STDC__ | defined __cplusplus (tTree yyt)#else (yyt) tTree yyt;#endif{ yWriteNodeproc_c (yyt);}static void yWriteNodeconstructor#if defined __STDC__ | defined __cplusplus (tTree yyt)#else (yyt) tTree yyt;#endif{ yWriteNodeproc_c (yyt); yyWriteSelector ("init"); yyWriteAdr (yyt->constructor.init);}static void yWriteNodedestructor#if defined __STDC__ | defined __cplusplus (tTree yyt)#else (yyt) tTree yyt;#endif{ yWriteNodeproc_c (yyt);}static void yWriteNodenamespace_c#if defined __STDC__ | defined __cplusplus (tTree yyt)#else (yyt) tTree yyt;#endif{ yWriteNodestmt_c (yyt); yyWriteSelector ("qualification"); yyWriteAdr (yyt->namespace_c.qualification); yyWriteSelector ("block"); yyWriteAdr (yyt->namespace_c.block); yyWriteSelector ("epos"); writetPosition (yyt->namespace_c.epos) yyWriteNl (); yyWriteSelector ("attribute"); writeint (yyt->namespace_c.attribute) yyWriteNl ();}static void yWriteNodenamespace#if defined __STDC__ | defined __cplusplus (tTree yyt)#else (yyt) tTree yyt;#endif{ yWriteNodenamespace_c (yyt);}static void yWriteNodeclass#if defined __STDC__ | defined __cplusplus (tTree yyt)#else (yyt) tTree yyt;#endif{ yWriteNodenamespace_c (yyt);}static void yWriteNodeitcl_class#if defined __STDC__ | defined __cplusplus (tTree yyt)#else (yyt) tTree yyt;#endif{ yWriteNodenamespace_c (yyt);}static void yWriteNodewords#if defined __STDC__ | defined __cplusplus (tTree yyt)#else (yyt) tTree yyt;#endif{ yyWriteSelector ("env"); writetTree (yyt->words.env) yyWriteNl ();}static void yWriteNodenoword#if defined __STDC__ | defined __cplusplus (tTree yyt)#else (yyt) tTree yyt;#endif{ yWriteNodewords (yyt);}static void yWriteNodeword_c#if defined __STDC__ | defined __cplusplus (tTree yyt)#else (yyt) tTree yyt;#endif{ yWriteNodewords (yyt); yyWriteSelector ("next"); yyWriteAdr (yyt->word_c.next);}static void yWriteNodeone_word#if defined __STDC__ | defined __cplusplus (tTree yyt)#else (yyt) tTree yyt;#endif{ yWriteNodeword_c (yyt); yyWriteSelector ("ident"); writetIdent (yyt->one_word.ident) yyWriteNl (); yyWriteSelector ("pos"); writetPosition (yyt->one_word.pos) yyWriteNl ();}static void yWriteNodeobj_word#if defined __STDC__ | defined __cplusplus (tTree yyt)#else (yyt) tTree yyt;#endif{ yWriteNodeword_c (yyt); yyWriteSelector ("ident"); writetIdent (yyt->obj_word.ident) yyWriteNl (); yyWriteSelector ("pos"); writetPosition (yyt->obj_word.pos) yyWriteNl (); yyWriteSelector ("object"); writetTree (yyt->obj_word.object) yyWriteNl ();}static void yWriteNodequal_word#if defined __STDC__ | defined __cplusplus (tTree yyt)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -