init parser

This commit is contained in:
hugogogo
2026-04-30 23:19:14 +02:00
parent 7a30dcc345
commit 512ba9b5f4
7 changed files with 70 additions and 13 deletions

View File

@@ -1,8 +1,4 @@
#include "computorv1.h"
#include "libft.h"
#include "lexer.h"
#include "errors.h"
#include <stdio.h> // tmp for float debug
void remove_spaces(char *s)
{
@@ -63,7 +59,11 @@ int main(int ac, char **av)
ft_putchar('\n'); // debug
token tokens[arg_len];
lexerize(input, tokens);
int token_count = lexerize(input, tokens);
ft_putstr("-> token_count : "); // debug
ft_putnbr(token_count); // debug
ft_putchar('\n'); // debug
// tmp debug output
ft_putchar('\n'); // debug
@@ -105,6 +105,15 @@ int main(int ac, char **av)
}
i++;
}
ft_putchar('\n'); // debug
// END tmp debug output
term terms[token_count / 2];
int term_count = parse(tokens, terms);
ft_putstr("-> term_count : "); // debug
ft_putnbr(term_count); // debug
ft_putchar('\n'); // debug
return (0);
}