/home/doxygen/libascend/compiler/exprs.h

Go to the documentation of this file.
00001 /*  ASCEND modelling environment
00002     Copyright (C) 2006 Carnegie Mellon University
00003     Copyright (C) 1990, 1993, 1994 Thomas Guthrie Epperly
00004 
00005     This program is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation; either version 2, or (at your option)
00008     any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program; if not, write to the Free Software
00017     Foundation, Inc., 59 Temple Place - Suite 330,
00018     Boston, MA 02111-1307, USA.
00019 *//*
00030     by Tom Epperly
00031     Last in CVS: $Revision: 1.11 $ $Date: 1998/02/05 16:36:00 $ $Author: ballan $
00032 */
00033 
00034 #ifndef ASC_EXPRS_H
00035 #define ASC_EXPRS_H
00036 
00041 extern struct Expr *CreateVarExpr(struct Name *n);
00046 extern struct Expr *CreateDiffExpr(struct Name *n);
00052 extern void InitVarExpr(struct Expr *e, CONST struct Name *n);
00065 extern struct Expr *CreateOpExpr(enum Expr_enum t);
00070 extern struct Expr *CreateSatisfiedExpr(struct Name *n, 
00071                                         double tol, 
00072                                         CONST dim_type *dims);
00077 extern struct Expr *CreateFuncExpr(CONST struct Func *f);
00082 extern struct Expr *CreateIntExpr(long i);
00087 extern struct Expr *CreateRealExpr(double r, CONST dim_type *dims);
00092 extern struct Expr *CreateTrueExpr(void);
00097 extern struct Expr *CreateFalseExpr(void);
00102 extern struct Expr *CreateAnyExpr(void);
00107 extern struct Expr *CreateSetExpr(struct Set *set);
00112 extern struct Expr *CreateSymbolExpr(symchar *sym);
00117 extern struct Expr *CreateQStringExpr(CONST char *qstring);
00124 extern struct Expr *CreateBuiltin(enum Expr_enum t, struct Set *set);
00129 extern void LinkExprs(struct Expr *cur, struct Expr *next);
00134 extern unsigned long ExprListLength(CONST struct Expr *e);
00140 #ifdef NDEBUG
00141 #define NextExpr(e) ((e)->next)
00142 #else
00143 #define NextExpr(e) NextExprF(e)
00144 #endif
00145 
00151 extern struct Expr *NextExprF(CONST struct Expr *e);
00158 #ifdef NDEBUG
00159 #define ExprType(e) ((e)->t)
00160 #else
00161 #define ExprType(e) ExprTypeF(e)
00162 #endif
00163 
00169 extern enum Expr_enum ExprTypeF(CONST struct Expr *e);
00176 #ifdef NDEBUG
00177 #define ExprName(e) ((e)->v.nptr)
00178 #else
00179 #define ExprName(e) ExprNameF(e)
00180 #endif
00181 
00187 extern CONST struct Name *ExprNameF(CONST struct Expr *e);
00194 #ifdef NDEBUG
00195 #define ExprFunc(e) ((e)->v.fptr)
00196 #else
00197 #define ExprFunc(e) ExprFuncF(e)
00198 #endif
00199 
00205 extern CONST struct Func *ExprFuncF(CONST struct Expr *e);
00212 #ifdef NDEBUG
00213 #define ExprIValue(e) ((e)->v.ivalue)
00214 #else
00215 #define ExprIValue(e) ExprIValueF(e)
00216 #endif
00217 
00223 extern long ExprIValueF(CONST struct Expr *e);
00230 #ifdef NDEBUG
00231 #define ExprRValue(e) ((e)->v.r.rvalue)
00232 #else
00233 #define ExprRValue(e) ExprRValueF(e)
00234 #endif
00235 
00241 extern double ExprRValueF(CONST struct Expr *e);
00248 #ifdef NDEBUG
00249 #define ExprRDimensions(e) ((e)->v.r.dimensions)
00250 #else
00251 #define ExprRDimensions(e) ExprRDimensionsF(e)
00252 #endif
00253 
00259 extern CONST dim_type *ExprRDimensionsF(CONST struct Expr *e);
00266 #ifdef NDEBUG
00267 #define SatisfiedExprName(e) ((e)->v.se.sen)
00268 #else
00269 #define SatisfiedExprName(e) SatisfiedExprNameF(e)
00270 #endif
00271 
00277 extern CONST struct Name *SatisfiedExprNameF(CONST struct Expr *e);
00284 #ifdef NDEBUG
00285 #define SatisfiedExprRValue(e) ((e)->v.se.ser.rvalue)
00286 #else
00287 #define SatisfiedExprRValue(e) SatisfiedExprRValueF(e)
00288 #endif
00289 
00295 extern double SatisfiedExprRValueF(CONST struct Expr *e);
00302 #ifdef NDEBUG
00303 #define SatisfiedExprRDimensions(e) ((e)->v.se.ser.dimensions)
00304 #else
00305 #define SatisfiedExprRDimensions(e) SatisfiedExprRDimensionsF(e)
00306 #endif
00307 
00313 extern CONST dim_type *SatisfiedExprRDimensionsF(CONST struct Expr *e);
00320 #ifdef NDEBUG
00321 #define ExprBValue(e) ((e)->v.bvalue)
00322 #else
00323 #define ExprBValue(e) ExprBValueF(e)
00324 #endif
00325 
00332 extern int ExprBValueF(CONST struct Expr *e);
00339 #ifdef NDEBUG
00340 #define ExprSValue(e) ((e)->v.s)
00341 #else
00342 #define ExprSValue(e) ExprSValueF(e)
00343 #endif
00344 
00350 extern struct Set *ExprSValueF(CONST struct Expr *e);
00357 #ifdef NDEBUG
00358 #define ExprSymValue(e) ((e)->v.sym_ptr)
00359 #else
00360 #define ExprSymValue(e) ExprSymValueF(e)
00361 #endif
00362 
00368 extern symchar *ExprSymValueF(CONST struct Expr *e);
00375 #ifdef NDEBUG
00376 #define ExprQStrValue(e) ((e)->v.sym_ptr)
00377 #else
00378 #define ExprQStrValue(e) ExprQStrValueF(e)
00379 #endif
00380 
00388 extern CONST char *ExprQStrValueF(CONST struct Expr *e);
00397 #ifdef NDEBUG
00398 #define ExprBuiltinSet(e) ((e)->v.s)
00399 #else
00400 #define ExprBuiltinSet(e) ExprBuiltinSetF(e)
00401 #endif
00402 
00409 extern CONST struct Set *ExprBuiltinSetF(CONST struct Expr *e);
00417 extern struct Expr *CopyExprList(CONST struct Expr *e);
00422 extern void DestroyExprList(struct Expr *e);
00428 extern struct Expr *JoinExprLists(struct Expr *e1, struct Expr *e2);
00434 extern int ExprsEqual(CONST struct Expr *e1, CONST struct Expr *e2);
00439 extern int CompareExprs(CONST struct Expr *e1, CONST struct Expr *e2);
00450 extern void exprs_init_pool(void);
00455 extern void exprs_destroy_pool(void);
00460 extern void exprs_report_pool(void);
00465 /* @} */
00466 
00467 #endif /* ASC_EXPRS_H */
00468 

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