1 /* 2 * Copyright (C) 2009 Dan Carpenter. 3 * 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. 8 * 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. 13 * 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 16 */ 17 18 #include "smatch.h" 19 #include "smatch_expression_stacks.h" 20 push_expression(struct expression_list ** estack,struct expression * expr)21void push_expression(struct expression_list **estack, struct expression *expr) 22 { 23 add_ptr_list(estack, expr); 24 } 25 pop_expression(struct expression_list ** estack)26struct expression *pop_expression(struct expression_list **estack) 27 { 28 struct expression *expr; 29 30 expr = last_ptr_list((struct ptr_list *)*estack); 31 delete_ptr_list_last((struct ptr_list **)estack); 32 return expr; 33 } 34 top_expression(struct expression_list * estack)35struct expression *top_expression(struct expression_list *estack) 36 { 37 struct expression *expr; 38 39 expr = last_ptr_list((struct ptr_list *)estack); 40 return expr; 41 } 42 free_expression_stack(struct expression_list ** estack)43void free_expression_stack(struct expression_list **estack) 44 { 45 __free_ptr_list((struct ptr_list **)estack); 46 } 47