/home/doxygen/libascend/compiler/forvars.h

Go to the documentation of this file.
00001 /*
00002  *  FOR Loop Index Variable Table
00003  *  by Tom Epperly
00004  *  Created: 1/14/89
00005  *  Version: $Revision: 1.8 $
00006  *  Version control file: $RCSfile: forvars.h,v $
00007  *  Date last modified: $Date: 1998/02/05 16:36:08 $
00008  *  Last modified by: $Author: ballan $
00009  *
00010  *  This file is part of the Ascend Language Interpreter.
00011  *
00012  *  Copyright (C) 1990, 1993, 1994 Thomas Guthrie Epperly
00013  *
00014  *  The Ascend Language Interpreter is free software; you can redistribute
00015  *  it and/or modify it under the terms of the GNU General Public License as
00016  *  published by the Free Software Foundation; either version 2 of the
00017  *  License, or (at your option) any later version.
00018  *
00019  *  The Ascend Language Interpreter is distributed in hope that it will be
00020  *  useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
00021  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00022  *  General Public License for more details.
00023  *
00024  *  You should have received a copy of the GNU General Public License
00025  *  along with the program; if not, write to the Free Software Foundation,
00026  *  Inc., 675 Mass Ave, Cambridge, MA 02139 USA.  Check the file named
00027  *  COPYING.
00028  */
00029 
00039 #ifndef ASC_FORVARS_H
00040 #define ASC_FORVARS_H
00041 
00046 enum for_kind {
00047   f_untyped,
00048   f_integer,
00049   f_symbol,
00050   f_set
00051 };
00052 
00053 union for_union_t{
00054   long ivalue;
00055   symchar *sym_ptr;
00056   struct set_t *sptr;
00057 };
00058 
00059 struct for_var_t {
00060   symchar *name;    
00061   enum for_kind t;  
00062   union for_union_t value;
00063 };
00064 
00065 #define for_table_t gl_list_t
00066 
00067 extern struct for_table_t *CreateForTable(void);
00073 extern void DestroyForTable(struct for_table_t *ft);
00080 extern void WriteForTable(FILE *out, struct for_table_t *ft);
00088 extern unsigned long ActiveForLoops(CONST struct for_table_t *ft);
00095 extern void AddLoopVariable(struct for_table_t *ft,struct for_var_t *var);
00104 extern struct for_var_t *LoopIndex(CONST struct for_table_t *ft,
00105                                    unsigned long num);
00115 extern struct for_var_t *FindForVar(CONST struct for_table_t *ft, 
00116                                     symchar *name);
00125 extern void RemoveForVariable(struct for_table_t *ft);
00133 /*
00134  *  Routines to create, query, modify and destroy for_var_t's.
00135  */
00136 
00137 extern struct for_var_t *CreateForVar(symchar *name);
00146 extern void SetForVarType(struct for_var_t *ft, enum for_kind t);
00154 extern void SetForInteger(struct for_var_t *fv, long ivalue);
00162 extern void SetForSymbol(struct for_var_t *fv, symchar *sym_ptr);
00170 extern void SetForSet(struct for_var_t *fv, struct set_t *sptr);
00178 extern enum for_kind GetForKind(CONST struct for_var_t *fv);
00185 extern symchar *GetForName(CONST struct for_var_t *fv);
00192 extern long GetForInteger(CONST struct for_var_t *fv);
00199 extern symchar *GetForSymbol(CONST struct for_var_t *fv);
00206 extern CONST struct set_t *GetForSet(CONST struct for_var_t *fv);
00213 extern void DestroyForVar(struct for_var_t *fv);
00221 extern int ClearForVarRecycle(void);
00230 /* @} */
00231 
00232 #endif /* ASC_FORVARS_H */
00233 

Generated on Thu Jul 17 04:00:10 2008 for libascend by  doxygen 1.5.1