⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tree.c

📁 这是一个Linux下的集成开发环境
💻 C
📖 第 1 页 / 共 5 页
字号:
/*Copyright (c) 2000, Red Hat, Inc.This file is part of Source-Navigator.Source-Navigator is free software; you can redistribute it and/ormodify it under the terms of the GNU General Public License as publishedby the Free Software Foundation; either version 2, or (at your option)any later version.Source-Navigator is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNUGeneral Public License for more details.You should have received a copy of the GNU General Public License alongwith Source-Navigator; see the file COPYING.  If not, write tothe Free Software Foundation, 59 Temple Place - Suite 330, Boston,MA 02111-1307, USA.*/#include "Tree.h"#ifdef __cplusplusextern "C" {#include "Reuse.h"#include "rSystem.h"#include "General.h"#include "rMemory.h"#include "DynArray.h"#include "Idents.h"#include "Position.h"}#else#include "Reuse.h"#include "rSystem.h"#include "General.h"#include "rMemory.h"#include "DynArray.h"#include "Idents.h"#include "Position.h"#endifchar Tree_module_does_not_match_evaluator_module_7188957;char generate_Tree_module_without_option_0;/* line 20 "tcl.ast" */tIdent   ibreak, icatch, icontinue, ifor, iforeach, iglobal, iif, ireturn, iwhile,   ibinary, iarray, iforeach, icatch, ifile, istat, ilstat, iappend, iset,   iincr, iscan, igets, iinfo, ivwait, iparray, iexists, itkinfo, idefault,   ilappend, iproc, iglobal, ivariable, inamespace, ieval, isource, iunset,   iargs, ibody, irename;tIdent last_keyword;#ifdef __cplusplus#ifndef yyALLOC#define yyALLOC(size1, size2) yyALLOCi (size1, size2)#endifinline tTree yyALLOCi (unsigned long yysize1, unsigned long yysize2){ return Tree_PoolFreePtr >= Tree_PoolStartPtr + yysize1 ?  (tTree) (Tree_PoolFreePtr -= yysize1) : Tree_Alloc (yysize2); }inline tTree yyALLOCk (unsigned long yysize){ return yyALLOC (yysize, yysize); }inline tTree yyALLOCt (unsigned long yysize){ return yyALLOC (yyAlignedSize (yysize), yysize); }#else#define yyALLOCk(size) yyALLOC (size, size)#define yyALLOCt(size) yyALLOC (yyAlignedSize (size), size)#ifndef yyALLOC#define yyALLOC(size1, size2) (Tree_PoolFreePtr -= (long) size1) >= \     Tree_PoolStartPtr ? (tTree) Tree_PoolFreePtr : Tree_Alloc (size2)#endif#endif#ifndef yyFREE#define yyFREE(ptr, size) #endif#ifdef getchar#undef getchar#endif#ifdef putchar#undef putchar#endif#include "yyTree.h"static void yyExit ARGS ((void)) { rExit (1); }void (* Tree_Exit) ARGS ((void)) = yyExit;tTree TreeRoot;unsigned long Tree_HeapUsed = 0;yytTree_BlockPtr Tree_BlockList	= (yytTree_BlockPtr) NoTree;char * Tree_PoolFreePtr = (char *) & Tree_BlockList;char * Tree_PoolStartPtr = (char *) & Tree_BlockList;const unsigned short Tree_NodeSize [50] = { 0, yyAlignedSize (sizeof (yprogram)), yyAlignedSize (sizeof (ystmts)), yyAlignedSize (sizeof (ynostmt)), yyAlignedSize (sizeof (ystmt_c)), yyAlignedSize (sizeof (ystmt)), yyAlignedSize (sizeof (yproc_c)), yyAlignedSize (sizeof (yproc)), yyAlignedSize (sizeof (ymethod)), yyAlignedSize (sizeof (ybody)), yyAlignedSize (sizeof (yconfigbody)), yyAlignedSize (sizeof (yconstructor)), yyAlignedSize (sizeof (ydestructor)), yyAlignedSize (sizeof (ynamespace_c)), yyAlignedSize (sizeof (ynamespace)), yyAlignedSize (sizeof (yclass)), yyAlignedSize (sizeof (yitcl_class)), yyAlignedSize (sizeof (ywords)), yyAlignedSize (sizeof (ynoword)), yyAlignedSize (sizeof (yword_c)), yyAlignedSize (sizeof (yone_word)), yyAlignedSize (sizeof (yobj_word)), yyAlignedSize (sizeof (yqual_word)), yyAlignedSize (sizeof (yqual_words)), yyAlignedSize (sizeof (yqualifications)), yyAlignedSize (sizeof (ynoqualification)), yyAlignedSize (sizeof (yone_qualification)), yyAlignedSize (sizeof (ytexts)), yyAlignedSize (sizeof (ynotext)), yyAlignedSize (sizeof (ytext)), yyAlignedSize (sizeof (ycharacter)), yyAlignedSize (sizeof (yident)), yyAlignedSize (sizeof (yblock)), yyAlignedSize (sizeof (ycontent)), yyAlignedSize (sizeof (yblock_content)), yyAlignedSize (sizeof (yqualification_c)), yyAlignedSize (sizeof (ylocal_ident)), yyAlignedSize (sizeof (yglobal_ident)), yyAlignedSize (sizeof (ylocal_text)), yyAlignedSize (sizeof (yglobal_text)), yyAlignedSize (sizeof (yqualification)), yyAlignedSize (sizeof (ycomplex_qual)), yyAlignedSize (sizeof (ysubscription)), yyAlignedSize (sizeof (yenvs)), yyAlignedSize (sizeof (yenv)), yyAlignedSize (sizeof (yenv2)), yyAlignedSize (sizeof (ynoenv)), yyAlignedSize (sizeof (yobjects)), yyAlignedSize (sizeof (yobject)), yyAlignedSize (sizeof (ynoobject)),};static const Tree_tKind yyTypeRange [50] = { 0, kprogram, kitcl_class, knostmt, kitcl_class, kstmt, kdestructor, kproc, kmethod, kbody, kconfigbody, kconstructor, kdestructor, kitcl_class, knamespace, kclass, kitcl_class, kqual_words, knoword, kqual_words, kone_word, kobj_word, kqual_word, kqual_words, kone_qualification, knoqualification, kone_qualification, kblock_content, knotext, kblock_content, kcharacter, kident, kblock, kcontent, kblock_content, ksubscription, klocal_ident, kglobal_ident, klocal_text, kglobal_text, kqualification, kcomplex_qual, ksubscription, knoenv, kenv, kenv2, knoenv, knoobject, kobject, knoobject,};const char * const Tree_NodeName [50] = { "NoTree", "program", "stmts", "nostmt", "stmt_c", "stmt", "proc_c", "proc", "method", "body", "configbody", "constructor", "destructor", "namespace_c", "namespace", "class", "itcl_class", "words", "noword", "word_c", "one_word", "obj_word", "qual_word", "qual_words", "qualifications", "noqualification", "one_qualification", "texts", "notext", "text", "character", "ident", "block", "content", "block_content", "qualification_c", "local_ident", "global_ident", "local_text", "global_text", "qualification", "complex_qual", "subscription", "envs", "env", "env2", "noenv", "objects", "object", "noobject",};tTree Tree_Alloc#if defined __STDC__ | defined __cplusplus (unsigned short yySize)#else (yySize) unsigned short yySize;#endif{ register yytTree_BlockPtr yyBlockPtr = Tree_BlockList; Tree_BlockList = (yytTree_BlockPtr) Alloc ((unsigned long) sizeof (yytTree_Block)); if ((tTree) Tree_BlockList == NoTree) {  (void) fprintf (stderr, "Tree: out of memory\n"); Tree_Exit (); } Tree_BlockList->yySuccessor = yyBlockPtr; Tree_PoolStartPtr = (char *) Tree_BlockList; Tree_HeapUsed += sizeof (yytTree_Block); return (tTree) (Tree_PoolFreePtr = Tree_PoolStartPtr +  (yyBlockSize - yyAlignedSize (yySize)));}tTree MakeTree#if defined __STDC__ | defined __cplusplus (Tree_tKind yyKind)#else (yyKind) Tree_tKind yyKind;#endif{ register tTree yyt = yyALLOCk (Tree_NodeSize [yyKind]); Tree_InitHead (yyt, yyKind) return yyt;}rbool Tree_IsType#if defined __STDC__ | defined __cplusplus (register tTree yyt, register Tree_tKind yyKind)#else (yyt, yyKind) register tTree yyt; register Tree_tKind yyKind;#endif{ return yyt != NoTree && yyKind <= yyt->Kind &&  yyt->Kind <= yyTypeRange [yyKind];}tTree mprogram#if defined __STDC__ | defined __cplusplus(tTree pstmts)#else(pstmts)tTree pstmts;#endif{ register tTree yyt = yyALLOCt (sizeof (yprogram)); Tree_InitHead (yyt, kprogram) yyt->program.stmts = pstmts; return yyt;}tTree mstmts#if defined __STDC__ | defined __cplusplus(void)#else()#endif{ register tTree yyt = yyALLOCt (sizeof (ystmts)); Tree_InitHead (yyt, kstmts) begintTree(yyt->stmts.env) return yyt;}tTree mnostmt#if defined __STDC__ | defined __cplusplus(void)#else()#endif{ register tTree yyt = yyALLOCt (sizeof (ynostmt)); Tree_InitHead (yyt, knostmt) begintTree(yyt->nostmt.env) return yyt;}tTree mstmt_c#if defined __STDC__ | defined __cplusplus(tTree pnext)#else(pnext)tTree pnext;#endif{ register tTree yyt = yyALLOCt (sizeof (ystmt_c)); Tree_InitHead (yyt, kstmt_c) begintTree(yyt->stmt_c.env) yyt->stmt_c.next = pnext; return yyt;}tTree mstmt#if defined __STDC__ | defined __cplusplus(tTree pnext, tTree pwords)#else(pnext, pwords)tTree pnext;tTree pwords;#endif{ register tTree yyt = yyALLOCt (sizeof (ystmt)); Tree_InitHead (yyt, kstmt) begintTree(yyt->stmt.env) yyt->stmt.next = pnext; yyt->stmt.words = pwords; return yyt;}tTree mproc_c#if defined __STDC__ | defined __cplusplus(tTree pnext, tTree pqualification, tTree pparam_names, tTree pparameter, tTree pblock, tPosition pepos, int pattribute)#else(pnext, pqualification, pparam_names, pparameter, pblock, pepos, pattribute)tTree pnext;tTree pqualification;tTree pparam_names;tTree pparameter;tTree pblock;tPosition pepos;int pattribute;#endif{ register tTree yyt = yyALLOCt (sizeof (yproc_c)); Tree_InitHead (yyt, kproc_c) begintTree(yyt->proc_c.env) yyt->proc_c.next = pnext; yyt->proc_c.qualification = pqualification; yyt->proc_c.param_names = pparam_names; yyt->proc_c.parameter = pparameter; yyt->proc_c.block = pblock; yyt->proc_c.epos = pepos; yyt->proc_c.attribute = pattribute; return yyt;}tTree mproc#if defined __STDC__ | defined __cplusplus(tTree pnext, tTree pqualification, tTree pparam_names, tTree pparameter, tTree pblock, tPosition pepos, int pattribute)#else(pnext, pqualification, pparam_names, pparameter, pblock, pepos, pattribute)tTree pnext;tTree pqualification;tTree pparam_names;tTree pparameter;tTree pblock;tPosition pepos;int pattribute;#endif{ register tTree yyt = yyALLOCt (sizeof (yproc)); Tree_InitHead (yyt, kproc) begintTree(yyt->proc.env) yyt->proc.next = pnext; yyt->proc.qualification = pqualification; yyt->proc.param_names = pparam_names; yyt->proc.parameter = pparameter; yyt->proc.block = pblock; yyt->proc.epos = pepos; yyt->proc.attribute = pattribute; return yyt;}tTree mmethod#if defined __STDC__ | defined __cplusplus(tTree pnext, tTree pqualification, tTree pparam_names, tTree pparameter, tTree pblock, tPosition pepos, int pattribute)#else(pnext, pqualification, pparam_names, pparameter, pblock, pepos, pattribute)tTree pnext;tTree pqualification;tTree pparam_names;tTree pparameter;tTree pblock;tPosition pepos;int pattribute;#endif{ register tTree yyt = yyALLOCt (sizeof (ymethod)); Tree_InitHead (yyt, kmethod) begintTree(yyt->method.env) yyt->method.next = pnext; yyt->method.qualification = pqualification; yyt->method.param_names = pparam_names; yyt->method.parameter = pparameter; yyt->method.block = pblock; yyt->method.epos = pepos; yyt->method.attribute = pattribute; return yyt;}tTree mbody#if defined __STDC__ | defined __cplusplus(tTree pnext, tTree pqualification, tTree pparam_names, tTree pparameter, tTree pblock, tPosition pepos, int pattribute)#else(pnext, pqualification, pparam_names, pparameter, pblock, pepos, pattribute)tTree pnext;tTree pqualification;tTree pparam_names;tTree pparameter;tTree pblock;tPosition pepos;int pattribute;#endif{ register tTree yyt = yyALLOCt (sizeof (ybody)); Tree_InitHead (yyt, kbody) begintTree(yyt->body.env) yyt->body.next = pnext; yyt->body.qualification = pqualification; yyt->body.param_names = pparam_names; yyt->body.parameter = pparameter; yyt->body.block = pblock; yyt->body.epos = pepos; yyt->body.attribute = pattribute; return yyt;}tTree mconfigbody#if defined __STDC__ | defined __cplusplus(tTree pnext, tTree pqualification, tTree pparam_names, tTree pparameter, tTree pblock, tPosition pepos, int pattribute)#else(pnext, pqualification, pparam_names, pparameter, pblock, pepos, pattribute)tTree pnext;tTree pqualification;tTree pparam_names;tTree pparameter;tTree pblock;tPosition pepos;int pattribute;#endif{ register tTree yyt = yyALLOCt (sizeof (yconfigbody)); Tree_InitHead (yyt, kconfigbody) begintTree(yyt->configbody.env) yyt->configbody.next = pnext; yyt->configbody.qualification = pqualification; yyt->configbody.param_names = pparam_names; yyt->configbody.parameter = pparameter; yyt->configbody.block = pblock; yyt->configbody.epos = pepos; yyt->configbody.attribute = pattribute; return yyt;}tTree mconstructor#if defined __STDC__ | defined __cplusplus(tTree pnext, tTree pqualification, tTree pparam_names, tTree pparameter, tTree pblock, tPosition pepos, int pattribute, tTree pinit)#else(pnext, pqualification, pparam_names, pparameter, pblock, pepos, pattribute, pinit)tTree pnext;tTree pqualification;tTree pparam_names;tTree pparameter;tTree pblock;tPosition pepos;int pattribute;tTree pinit;#endif{ register tTree yyt = yyALLOCt (sizeof (yconstructor)); Tree_InitHead (yyt, kconstructor) begintTree(yyt->constructor.env) yyt->constructor.next = pnext; yyt->constructor.qualification = pqualification; yyt->constructor.param_names = pparam_names; yyt->constructor.parameter = pparameter; yyt->constructor.block = pblock; yyt->constructor.epos = pepos; yyt->constructor.attribute = pattribute; yyt->constructor.init = pinit; return yyt;}tTree mdestructor#if defined __STDC__ | defined __cplusplus(tTree pnext, tTree pqualification, tTree pparam_names, tTree pparameter, tTree pblock, tPosition pepos, int pattribute)#else(pnext, pqualification, pparam_names, pparameter, pblock, pepos, pattribute)tTree pnext;tTree pqualification;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -