/* $Id: constant.h,v 1.10 2001/06/11 11:36:53 sbeyer Exp $ $Log: constant.h,v $ Revision 1.10 2001/06/11 11:36:53 sbeyer * added nat function support Revision 1.9 2001/01/15 15:11:09 sbeyer cosmetic changes (like const qualifier) Revision 1.8 2001/01/09 16:27:31 sbeyer *** empty log message *** */ #include "backend.h" #ifndef constant_h #define constant_h #ifdef __cplusplus extern "C" { #endif // gibt 1 zurueck, falls knot eine Konstante ist, ansonsten 0 int is_constant(const struct knoten *const knot); // gibt den Wert einer Konstanten zurück int get_constant_value(const struct knoten *const knot); // gibt 1 zurueck, falls knot von der Form expr->....->TRUE bzw. expr->....->FALSE IST; ansonsten 0 int is_bool_constant(const struct knoten *const knot); int get_bool_constant_value(const struct knoten *const knot); // berechnet einfache expressions, dir nur aus Bool-Konstanten bestehen; z.B. : TRUE or FALSE wir zu TRUE ausgewertet struct knoten * berechne_bool_expression(struct knoten *knot); // berechnet einfache expressions, die nur aus Konstanten bestehen; z.B. : 5*4 wird zu 20 ausgewertet struct knoten * berechne_const_expression(struct knoten *knot); // fasst Konstanten in Expressions zusammen struct knoten *vereinfache_expression(struct knoten *knot); // fasst Konstante Expressions in einem ganzen Teilbaum zusammen struct knoten *vereinfache_teilbaum(struct knoten *knot); // Berechnet den Wert einer Expression, falls dieser sich berechnen laesst und gibt ansonsten eine Fehlermeldung // aus und -1 zurueck int expression_ausrechnen(struct knoten *expr_knoten); // one function is NOT C, but C++ (needs access to function list,...) // so its body is in synthesize_core.cpp int compute_nat_function(const struct knoten* root, const char *name, int *is_nat_function); #ifdef __cplusplus } #endif #endif // constant_h