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

📄 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 "StringM.h"#include "Idents.h"#include "Position.h"}#else#include "Reuse.h"#include "rSystem.h"#include "General.h"#include "rMemory.h"#include "DynArray.h"#include "StringM.h"#include "Idents.h"#include "Position.h"#endifchar Tree_module_does_not_match_evaluator_module_30586066;char generate_Tree_module_without_option_0;/* line 66 "java.ast" */#define writetoperator(a) (void) fputs (operators [a], yyf);static char * operators [] = { 0,   "and",   "and_and",   "assignment",   "complement",   "divide",   "equal",   "greater",   "greater_equal",   "less",   "less_equal",   "lshift",   "minus",   "modulo",   "negate",   "not",   "not_equal",   "or",   "or_or",   "plus",   "post_decr",   "post_incr",   "pre_decr",   "pre_incr",   "rshift",   "times",   "us_rshift",   "xor",};#define writettype(a) (void) fputs (types [a], yyf);char * types [] = { 0,   "boolean",   "byte",   "char",   "double",   "float",   "int",   "long",   "short",   "void",};#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 [99] = { 0, yyAlignedSize (sizeof (ycompilation_unit)), yyAlignedSize (sizeof (yimport_list)), yyAlignedSize (sizeof (ynoimport)), yyAlignedSize (sizeof (yimport)), yyAlignedSize (sizeof (yimport_asterisk)), yyAlignedSize (sizeof (yfield_list)), yyAlignedSize (sizeof (ynofield)), yyAlignedSize (sizeof (yfield)), yyAlignedSize (sizeof (yfunction)), yyAlignedSize (sizeof (ymethod)), yyAlignedSize (sizeof (yconstructor)), yyAlignedSize (sizeof (yvar_decl)), yyAlignedSize (sizeof (ystatic_initializer)), yyAlignedSize (sizeof (yinitializer)), yyAlignedSize (sizeof (ytype_decl)), yyAlignedSize (sizeof (yclass)), yyAlignedSize (sizeof (yinterface)), yyAlignedSize (sizeof (ydecl_list)), yyAlignedSize (sizeof (ynodecl)), yyAlignedSize (sizeof (ydecl)), yyAlignedSize (sizeof (yvariable)), yyAlignedSize (sizeof (yparameter)), yyAlignedSize (sizeof (ystatement_list)), yyAlignedSize (sizeof (ynostatement)), yyAlignedSize (sizeof (ystatement)), yyAlignedSize (sizeof (ystatement_c)), yyAlignedSize (sizeof (ycompound_stmt)), yyAlignedSize (sizeof (yexpression_stmt)), yyAlignedSize (sizeof (yvar_decl_stmt)), yyAlignedSize (sizeof (ytype_decl_stmt)), yyAlignedSize (sizeof (yif_stmt)), yyAlignedSize (sizeof (yif_else_stmt)), yyAlignedSize (sizeof (ywhile_stmt)), yyAlignedSize (sizeof (ydo_stmt)), yyAlignedSize (sizeof (ybreak_stmt)), yyAlignedSize (sizeof (ybreak_id_stmt)), yyAlignedSize (sizeof (ycontinue_stmt)), yyAlignedSize (sizeof (ycontinue_id_stmt)), yyAlignedSize (sizeof (yreturn_stmt)), yyAlignedSize (sizeof (yreturn_expr_stmt)), yyAlignedSize (sizeof (yfor_stmt)), yyAlignedSize (sizeof (ythrow_stmt)), yyAlignedSize (sizeof (ysynchronized_stmt)), yyAlignedSize (sizeof (ylabeled_stmt)), yyAlignedSize (sizeof (ytry_stmt)), yyAlignedSize (sizeof (yswitch_stmt)), yyAlignedSize (sizeof (ynull_stmt)), yyAlignedSize (sizeof (yswitch_list)), yyAlignedSize (sizeof (ynoswitch)), yyAlignedSize (sizeof (yswitch_)), yyAlignedSize (sizeof (ycatch_list)), yyAlignedSize (sizeof (ynocatch)), yyAlignedSize (sizeof (ycatch)), yyAlignedSize (sizeof (ytype_name_list)), yyAlignedSize (sizeof (ynotype_name)), yyAlignedSize (sizeof (ytype_name)), yyAlignedSize (sizeof (ytype)), yyAlignedSize (sizeof (ysimple_type)), yyAlignedSize (sizeof (ynamed_type)), yyAlignedSize (sizeof (yarray_type)), yyAlignedSize (sizeof (ynotype)), yyAlignedSize (sizeof (yexpression_list)), yyAlignedSize (sizeof (ynoexpression_l)), yyAlignedSize (sizeof (yexpression)), yyAlignedSize (sizeof (yexpression_c)), yyAlignedSize (sizeof (yqualified_symbol)), yyAlignedSize (sizeof (yqualification)), yyAlignedSize (sizeof (yident)), yyAlignedSize (sizeof (ynoexpression)), yyAlignedSize (sizeof (yunary)), yyAlignedSize (sizeof (ybinary)), yyAlignedSize (sizeof (yassign)), yyAlignedSize (sizeof (yaggregate)), yyAlignedSize (sizeof (ycall)), yyAlignedSize (sizeof (yselect)), yyAlignedSize (sizeof (yget_class_of_expr)), yyAlignedSize (sizeof (yget_class)), yyAlignedSize (sizeof (ysubscript)), yyAlignedSize (sizeof (ytype_compare)), yyAlignedSize (sizeof (ytype_cast)), yyAlignedSize (sizeof (ynew)), yyAlignedSize (sizeof (yanonymous)), yyAlignedSize (sizeof (yconditional)), yyAlignedSize (sizeof (ysuper)), yyAlignedSize (sizeof (ythis)), yyAlignedSize (sizeof (ynull)), yyAlignedSize (sizeof (yint_literal)), yyAlignedSize (sizeof (ylong_literal)), yyAlignedSize (sizeof (ybool_literal)), yyAlignedSize (sizeof (yfloat_literal)), yyAlignedSize (sizeof (ychar_literal)), yyAlignedSize (sizeof (ystring_literal)), yyAlignedSize (sizeof (yenvs)), yyAlignedSize (sizeof (yenv)), yyAlignedSize (sizeof (yenv2)), yyAlignedSize (sizeof (yobjects)), yyAlignedSize (sizeof (yobject)), yyAlignedSize (sizeof (ynoobject)),};static const Tree_tKind yyTypeRange [99] = { 0, kcompilation_unit, kimport_asterisk, knoimport, kimport_asterisk, kimport_asterisk, kinterface, knofield, kinterface, kconstructor, kmethod, kconstructor, kvar_decl, kstatic_initializer, kinitializer, kinterface, kclass, kinterface, kparameter, knodecl, kparameter, kvariable, kparameter, kstatement, knostatement, kstatement, knull_stmt, kcompound_stmt, kexpression_stmt, kvar_decl_stmt, ktype_decl_stmt, kif_else_stmt, kif_else_stmt, kwhile_stmt, kdo_stmt, kbreak_id_stmt, kbreak_id_stmt, kcontinue_id_stmt, kcontinue_id_stmt, kreturn_expr_stmt, kreturn_expr_stmt, kfor_stmt, kthrow_stmt, ksynchronized_stmt, klabeled_stmt, ktry_stmt, kswitch_stmt, knull_stmt, kswitch_, knoswitch, kswitch_, kcatch, knocatch, kcatch, ktype_name, knotype_name, ktype_name, knotype, ksimple_type, knamed_type, karray_type, knotype, kexpression, knoexpression_l, kexpression, kstring_literal, knoexpression, kqualification, kident, knoexpression, kunary, kbinary, kassign, kaggregate, kcall, kselect, kget_class_of_expr, kget_class, ksubscript, ktype_compare, ktype_cast, knew, kanonymous, kconditional, ksuper, kthis, knull, kint_literal, klong_literal, kbool_literal, kfloat_literal, kchar_literal, kstring_literal, kenv2, kenv, kenv2, knoobject, kobject, knoobject,};const char * const Tree_NodeName [99] = { "NoTree", "compilation_unit", "import_list", "noimport", "import", "import_asterisk", "field_list", "nofield", "field", "function", "method", "constructor", "var_decl", "static_initializer", "initializer", "type_decl", "class", "interface", "decl_list", "nodecl", "decl", "variable", "parameter", "statement_list", "nostatement", "statement", "statement_c", "compound_stmt", "expression_stmt", "var_decl_stmt", "type_decl_stmt", "if_stmt", "if_else_stmt", "while_stmt", "do_stmt", "break_stmt", "break_id_stmt", "continue_stmt", "continue_id_stmt", "return_stmt", "return_expr_stmt", "for_stmt", "throw_stmt", "synchronized_stmt", "labeled_stmt", "try_stmt", "switch_stmt", "null_stmt", "switch_list", "noswitch", "switch_", "catch_list", "nocatch", "catch", "type_name_list", "notype_name", "type_name", "type", "simple_type", "named_type", "array_type", "notype", "expression_list", "noexpression_l", "expression", "expression_c", "qualified_symbol", "qualification", "ident", "noexpression", "unary", "binary", "assign", "aggregate", "call", "select", "get_class_of_expr", "get_class", "subscript", "type_compare", "type_cast", "new", "anonymous", "conditional", "super", "this", "null", "int_literal", "long_literal", "bool_literal", "float_literal", "char_literal", "string_literal", "envs", "env", "env2", "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 mcompilation_unit#if defined __STDC__ | defined __cplusplus(tTree ppackage, tTree pimport_list, tTree pfield_list)#else(ppackage, pimport_list, pfield_list)tTree ppackage;tTree pimport_list;tTree pfield_list;#endif{ register tTree yyt = yyALLOCt (sizeof (ycompilation_unit)); Tree_InitHead (yyt, kcompilation_unit) yyt->compilation_unit.package = ppackage; yyt->compilation_unit.import_list = pimport_list; yyt->compilation_unit.field_list = pfield_list; return yyt;}tTree mimport_list#if defined __STDC__ | defined __cplusplus(void)#else()#endif{ register tTree yyt = yyALLOCt (sizeof (yimport_list)); Tree_InitHead (yyt, kimport_list) begintTree(yyt->import_list.env) return yyt;}tTree mnoimport#if defined __STDC__ | defined __cplusplus(void)#else()#endif{ register tTree yyt = yyALLOCt (sizeof (ynoimport)); Tree_InitHead (yyt, knoimport) begintTree(yyt->noimport.env) return yyt;}tTree mimport#if defined __STDC__ | defined __cplusplus(tTree pnext, tTree pqualified_symbol)#else(pnext, pqualified_symbol)tTree pnext;tTree pqualified_symbol;#endif{ register tTree yyt = yyALLOCt (sizeof (yimport)); Tree_InitHead (yyt, kimport) begintTree(yyt->import.env) yyt->import.next = pnext; yyt->import.qualified_symbol = pqualified_symbol; return yyt;}tTree mimport_asterisk#if defined __STDC__ | defined __cplusplus(tTree pnext, tTree pqualified_symbol)#else(pnext, pqualified_symbol)tTree pnext;tTree pqualified_symbol;#endif{ register tTree yyt = yyALLOCt (sizeof (yimport_asterisk)); Tree_InitHead (yyt, kimport_asterisk) begintTree(yyt->import_asterisk.env) yyt->import_asterisk.next = pnext; yyt->import_asterisk.qualified_symbol = pqualified_symbol; return yyt;}tTree mfield_list#if defined __STDC__ | defined __cplusplus(void)#else()#endif{ register tTree yyt = yyALLOCt (sizeof (yfield_list)); Tree_InitHead (yyt, kfield_list) begintTree(yyt->field_list.env) return yyt;}tTree mnofield#if defined __STDC__ | defined __cplusplus(void)#else()#endif{ register tTree yyt = yyALLOCt (sizeof (ynofield)); Tree_InitHead (yyt, knofield) begintTree(yyt->nofield.env) return yyt;}tTree mfield#if defined __STDC__ | defined __cplusplus(tTree pnext)

⌨️ 快捷键说明

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