Update
This commit is contained in:
parent
5bec1546aa
commit
c7fb66c70d
15 changed files with 572 additions and 164 deletions
|
|
@ -33,10 +33,10 @@
|
|||
/*******************/
|
||||
|
||||
typedef struct s_parser t_parser;
|
||||
typedef struct t_parse_tree t_parse_tree;
|
||||
typedef struct t_query t_query;
|
||||
typedef struct t_query_cursor t_query_cursor;
|
||||
typedef struct t_lookahead_iterator t_lookahead_iterator;
|
||||
typedef struct s_parse_tree t_parse_tree;
|
||||
typedef struct s_query t_query;
|
||||
typedef struct s_query_cursor t_query_cursor;
|
||||
typedef struct s_lookahead_iterator t_lookahead_iterator;
|
||||
|
||||
typedef enum t_input_encoding
|
||||
{
|
||||
|
|
|
|||
36
parser/includes/reduce_action.h
Normal file
36
parser/includes/reduce_action.h
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* reduce_action.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/04/30 15:25:12 by maiboyer #+# #+# */
|
||||
/* Updated: 2024/04/30 15:25:38 by maiboyer ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef REDUCE_ACTION_H
|
||||
#define REDUCE_ACTION_H
|
||||
|
||||
#include "me/types.h"
|
||||
#include "me/vec/vec_reduce_action.h"
|
||||
#include "parser/api.h"
|
||||
#include "parser/types/types_reduce_action.h"
|
||||
|
||||
static inline void ts_reduce_action_set_add(t_vec_reduce_action *self,
|
||||
t_reduce_action new_action)
|
||||
{
|
||||
t_reduce_action action;
|
||||
|
||||
for (t_u32 i = 0; i < self->len; i++)
|
||||
{
|
||||
action = self->buffer[i];
|
||||
if (action.symbol == new_action.symbol &&
|
||||
action.count == new_action.count)
|
||||
return;
|
||||
}
|
||||
vec_reduce_action_push(self, new_action);
|
||||
}
|
||||
|
||||
#endif /* REDUCE_ACTION_H */
|
||||
27
parser/includes/types/types_reduce_action.h
Normal file
27
parser/includes/types/types_reduce_action.h
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* types_reduce_action.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/04/30 15:21:59 by maiboyer #+# #+# */
|
||||
/* Updated: 2024/04/30 15:22:18 by maiboyer ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef TYPES_REDUCE_ACTION_H
|
||||
#define TYPES_REDUCE_ACTION_H
|
||||
|
||||
#include "me/types.h"
|
||||
#include "parser/types/types_symbol.h"
|
||||
|
||||
typedef struct s_reduce_action
|
||||
{
|
||||
t_u32 count;
|
||||
t_symbol symbol;
|
||||
t_i32 dynamic_precedence;
|
||||
t_u16 production_id;
|
||||
} t_reduce_action;
|
||||
|
||||
#endif /* TYPES_REDUCE_ACTION_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue