update: added passses mechanisme to tokenstream processing

This commit is contained in:
maix0 2024-10-02 19:19:35 +02:00
parent 83d1cc4c10
commit 1d317c0388
5 changed files with 156 additions and 11 deletions

View file

@ -0,0 +1,34 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* passes.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/02 18:43:41 by maiboyer #+# #+# */
/* Updated: 2024/10/02 19:13:19 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef PASSES_H
#define PASSES_H
#include "me/types.h"
#include "me/vec/vec_token.h"
#include "parser/token.h"
typedef t_error (*t_ts_pass)(t_vec_token input, t_vec_token *output);
struct s_ts_pass_def
{
t_ts_pass fn;
t_const_str name;
};
// list passes function here
// this is a example one, does absolutly nothing lol
t_error do_fuck_all(t_vec_token input, t_vec_token *output);
#endif /* PASSES_H */

View file

@ -6,7 +6,7 @@
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/26 17:59:23 by maiboyer #+# #+# */
/* Updated: 2024/09/30 19:47:53 by maiboyer ### ########.fr */
/* Updated: 2024/10/02 19:12:26 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
@ -55,13 +55,9 @@ t_token token_new(enum e_token type);
t_token token_new_none(void);
void token_free(t_token tok);
bool token_is_meta(t_token tok);
t_token token_clone(t_token *tok);
/* PARSING */
bool is_dollar(char c);
bool is_quote(char c);
bool is_space(char c);
t_error find_end_string(t_const_str raw, t_usize *start, t_token *output);
t_error start_analyse(t_const_str raw, t_vec_token *output);
t_error tokeniser(t_const_str raw);
#endif