/*1* Expression Abstract Syntax Tree Functions2*3* Copyright 2002 Ove Kaaven4* Copyright 2006-2008 Robert Shearman5*6* This library is free software; you can redistribute it and/or7* modify it under the terms of the GNU Lesser General Public8* License as published by the Free Software Foundation; either9* version 2.1 of the License, or (at your option) any later version.10*11* This library is distributed in the hope that it will be useful,12* but WITHOUT ANY WARRANTY; without even the implied warranty of13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU14* Lesser General Public License for more details.15*16* You should have received a copy of the GNU Lesser General Public17* License along with this library; if not, write to the Free Software18* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA19*/2021struct expr_loc22{23const var_t *v;24const char *attr;25};2627extern expr_t *make_expr(enum expr_type type);28extern expr_t *make_exprl(enum expr_type type, const struct integer *integer);29extern expr_t *make_exprd(enum expr_type type, double val);30extern expr_t *make_exprs(enum expr_type type, char *val);31extern expr_t *make_exprt(enum expr_type type, var_t *var, expr_t *expr);32extern expr_t *make_expr1(enum expr_type type, expr_t *expr);33extern expr_t *make_expr2(enum expr_type type, expr_t *exp1, expr_t *exp2);34extern expr_t *make_expr3(enum expr_type type, expr_t *expr1, expr_t *expr2, expr_t *expr3);3536extern const type_t *expr_resolve_type(const struct expr_loc *expr_loc, const type_t *cont_type, const expr_t *expr);37extern int compare_expr(const expr_t *a, const expr_t *b);3839extern void write_expr(FILE *h, const expr_t *e, int brackets, int toplevel, const char *toplevel_prefix,40const type_t *cont_type, const char *local_var_prefix);414243