X-Git-Url: https://git.llucax.com/z.facultad/75.42/calculadora.git/blobdiff_plain/a8a23ec5e446b056284de0976cc1f3344ee8c6ad..8f5992a5811ef292022a3ca3ac293c231e2b065b:/parser_equation.c diff --git a/parser_equation.c b/parser_equation.c index a84925e..ebf3698 100644 --- a/parser_equation.c +++ b/parser_equation.c @@ -16,27 +16,14 @@ #include "bool.h" #include "equation.h" +#include "parser_common.h" #include "parseerror.h" #include "dllist.h" #include #include #include -bool is_space(char c) { - return (c == ' ') || (c == '\t'); -} - -bool is_number(char c) { - return ('0' <= c) && (c <= '9'); -} - -bool is_alpha(char c) { - return (c == '_') || (('a' <= c) && (c <= 'z')) || (('A' <= c) && (c <= 'Z')); -} - -bool is_alpha_num(c) { - return is_number(c) || is_alpha(c); -} +#include "memdebug_debugger.h" size_t DLList_equation_print(DLList* l, FILE* fp) { size_t cant = 0; @@ -47,6 +34,15 @@ size_t DLList_equation_print(DLList* l, FILE* fp) { return cant; } +void DLList_equation_delete(DLList* l) { + if (l) { + while (!DLList_empty(l)) { + Equation_delete((Equation*)DLList_pop(l)); + } + } + DLList_delete(l); +} + #define PARSE_ERROR(str) ParseError_set_pos_message(error, str, i + 1, c) bool parser_equation(const char* line, size_t len, DLList* equation_list,