2 * Copyright (C) 2009 Dan Carpenter.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, see http://www.gnu.org/copyleft/gpl.txt
19 #include "smatch_expression_stacks.h"
21 void push_expression(struct expression_list
**estack
, struct expression
*expr
)
23 add_ptr_list(estack
, expr
);
26 struct expression
*pop_expression(struct expression_list
**estack
)
28 struct expression
*expr
;
30 expr
= last_ptr_list((struct ptr_list
*)*estack
);
31 delete_ptr_list_last((struct ptr_list
**)estack
);
35 struct expression
*top_expression(struct expression_list
*estack
)
37 struct expression
*expr
;
39 expr
= last_ptr_list((struct ptr_list
*)estack
);
43 void free_expression_stack(struct expression_list
**estack
)
45 __free_ptr_list((struct ptr_list
**)estack
);