Bon courage l'ami
This commit is contained in:
parent
3bde20ba23
commit
df5cc636b5
6 changed files with 127 additions and 79 deletions
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/04/14 19:17:54 by maiboyer #+# #+# */
|
/* Created: 2024/04/14 19:17:54 by maiboyer #+# #+# */
|
||||||
/* Updated: 2024/04/14 19:18:20 by maiboyer ### ########.fr */
|
/* Updated: 2024/04/28 18:56:16 by rparodi ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -22,6 +22,13 @@
|
||||||
# include "./inline.h"
|
# include "./inline.h"
|
||||||
# include "../../../parse_types.h"
|
# include "../../../parse_types.h"
|
||||||
|
|
||||||
|
bool lex_helper_s86(t_lexer *lexer, t_lexer_state *s);
|
||||||
|
bool lex_helper_s87(t_lexer *lexer, t_lexer_state *s);
|
||||||
|
bool lex_helper_s519(t_lexer *lexer, t_lexer_state *s);
|
||||||
|
bool lex_helper_s520(t_lexer *lexer, t_lexer_state *s);
|
||||||
|
bool lex_helper_s521(t_lexer *lexer, t_lexer_state *s);
|
||||||
|
bool lex_helper_s522(t_lexer *lexer, t_lexer_state *s);
|
||||||
|
|
||||||
bool lex_normal_s0(t_lexer *lexer, t_lexer_state *s);
|
bool lex_normal_s0(t_lexer *lexer, t_lexer_state *s);
|
||||||
bool lex_normal_s1(t_lexer *lexer, t_lexer_state *s);
|
bool lex_normal_s1(t_lexer *lexer, t_lexer_state *s);
|
||||||
bool lex_normal_s2(t_lexer *lexer, t_lexer_state *s);
|
bool lex_normal_s2(t_lexer *lexer, t_lexer_state *s);
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/04/14 19:17:54 by maiboyer #+# #+# */
|
/* Created: 2024/04/14 19:17:54 by maiboyer #+# #+# */
|
||||||
/* Updated: 2024/04/14 19:18:20 by maiboyer ### ########.fr */
|
/* Updated: 2024/04/28 18:42:09 by rparodi ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -55,16 +55,8 @@ bool lex_normal_s519(t_lexer *lexer, t_lexer_state *s)
|
||||||
return (lex_advance(655, lexer, s));
|
return (lex_advance(655, lexer, s));
|
||||||
if (s->lookahead == ';')
|
if (s->lookahead == ';')
|
||||||
return (lex_advance(555, lexer, s));
|
return (lex_advance(555, lexer, s));
|
||||||
if (s->lookahead == '<')
|
if (lex_helper_s519(lexer, s))
|
||||||
return (lex_advance(612, lexer, s));
|
return (true);
|
||||||
if (s->lookahead == '>')
|
|
||||||
return (lex_advance(618, lexer, s));
|
|
||||||
if (s->lookahead == '\\')
|
|
||||||
return (lex_skip(542, lexer, s));
|
|
||||||
if (s->lookahead == '`')
|
|
||||||
return (lex_advance(856, lexer, s));
|
|
||||||
if (s->lookahead == '|')
|
|
||||||
return (lex_advance(593, lexer, s));
|
|
||||||
if (((s->lookahead >= '[' && s->lookahead <= ']') || \
|
if (((s->lookahead >= '[' && s->lookahead <= ']') || \
|
||||||
(s->lookahead >= '{' && s->lookahead <= '}')))
|
(s->lookahead >= '{' && s->lookahead <= '}')))
|
||||||
return (lex_advance(786, lexer, s));
|
return (lex_advance(786, lexer, s));
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/04/14 19:17:54 by maiboyer #+# #+# */
|
/* Created: 2024/04/14 19:17:54 by maiboyer #+# #+# */
|
||||||
/* Updated: 2024/04/14 19:18:20 by maiboyer ### ########.fr */
|
/* Updated: 2024/04/28 18:52:19 by rparodi ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -26,16 +26,8 @@ bool lex_normal_s520(t_lexer *lexer, t_lexer_state *s)
|
||||||
return (lex_advance(655, lexer, s));
|
return (lex_advance(655, lexer, s));
|
||||||
if (s->lookahead == ';')
|
if (s->lookahead == ';')
|
||||||
return (lex_advance(555, lexer, s));
|
return (lex_advance(555, lexer, s));
|
||||||
if (s->lookahead == '<')
|
if (lex_helper_s520(lexer, s))
|
||||||
return (lex_advance(612, lexer, s));
|
return (true);
|
||||||
if (s->lookahead == '>')
|
|
||||||
return (lex_advance(618, lexer, s));
|
|
||||||
if (s->lookahead == '\\')
|
|
||||||
return (lex_skip(544, lexer, s));
|
|
||||||
if (s->lookahead == '`')
|
|
||||||
return (lex_advance(855, lexer, s));
|
|
||||||
if (s->lookahead == '|')
|
|
||||||
return (lex_advance(593, lexer, s));
|
|
||||||
if (((s->lookahead >= '[' && s->lookahead <= ']') || \
|
if (((s->lookahead >= '[' && s->lookahead <= ']') || \
|
||||||
(s->lookahead >= '{' && s->lookahead <= '}')))
|
(s->lookahead >= '{' && s->lookahead <= '}')))
|
||||||
return (lex_advance(786, lexer, s));
|
return (lex_advance(786, lexer, s));
|
||||||
|
|
@ -59,16 +51,8 @@ bool lex_normal_s521(t_lexer *lexer, t_lexer_state *s)
|
||||||
return (lex_advance(655, lexer, s));
|
return (lex_advance(655, lexer, s));
|
||||||
if (s->lookahead == ';')
|
if (s->lookahead == ';')
|
||||||
return (lex_advance(555, lexer, s));
|
return (lex_advance(555, lexer, s));
|
||||||
if (s->lookahead == '<')
|
if (lex_helper_s521(lexer, s))
|
||||||
return (lex_advance(613, lexer, s));
|
return (true);
|
||||||
if (s->lookahead == '>')
|
|
||||||
return (lex_advance(618, lexer, s));
|
|
||||||
if (s->lookahead == '\\')
|
|
||||||
return (lex_skip(541, lexer, s));
|
|
||||||
if (s->lookahead == '`')
|
|
||||||
return (lex_advance(856, lexer, s));
|
|
||||||
if (s->lookahead == '|')
|
|
||||||
return (lex_advance(593, lexer, s));
|
|
||||||
if (((s->lookahead >= '[' && s->lookahead <= ']') || \
|
if (((s->lookahead >= '[' && s->lookahead <= ']') || \
|
||||||
(s->lookahead >= '{' && s->lookahead <= '}')))
|
(s->lookahead >= '{' && s->lookahead <= '}')))
|
||||||
return (lex_advance(786, lexer, s));
|
return (lex_advance(786, lexer, s));
|
||||||
|
|
@ -92,16 +76,8 @@ bool lex_normal_s522(t_lexer *lexer, t_lexer_state *s)
|
||||||
return (lex_advance(655, lexer, s));
|
return (lex_advance(655, lexer, s));
|
||||||
if (s->lookahead == ';')
|
if (s->lookahead == ';')
|
||||||
return (lex_advance(555, lexer, s));
|
return (lex_advance(555, lexer, s));
|
||||||
if (s->lookahead == '<')
|
if (lex_helper_s522(lexer, s))
|
||||||
return (lex_advance(613, lexer, s));
|
return (true);
|
||||||
if (s->lookahead == '>')
|
|
||||||
return (lex_advance(618, lexer, s));
|
|
||||||
if (s->lookahead == '\\')
|
|
||||||
return (lex_skip(543, lexer, s));
|
|
||||||
if (s->lookahead == '`')
|
|
||||||
return (lex_advance(855, lexer, s));
|
|
||||||
if (s->lookahead == '|')
|
|
||||||
return (lex_advance(593, lexer, s));
|
|
||||||
if (((s->lookahead >= '[' && s->lookahead <= ']') || \
|
if (((s->lookahead >= '[' && s->lookahead <= ']') || \
|
||||||
(s->lookahead >= '{' && s->lookahead <= '}')))
|
(s->lookahead >= '{' && s->lookahead <= '}')))
|
||||||
return (lex_advance(786, lexer, s));
|
return (lex_advance(786, lexer, s));
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/04/14 19:17:54 by maiboyer #+# #+# */
|
/* Created: 2024/04/14 19:17:54 by maiboyer #+# #+# */
|
||||||
/* Updated: 2024/04/14 19:18:20 by maiboyer ### ########.fr */
|
/* Updated: 2024/04/28 18:59:20 by rparodi ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -47,16 +47,8 @@ bool lex_normal_s86(t_lexer *lexer, t_lexer_state *s)
|
||||||
return (lex_advance(554, lexer, s));
|
return (lex_advance(554, lexer, s));
|
||||||
if (s->lookahead == '<')
|
if (s->lookahead == '<')
|
||||||
return (lex_advance(612, lexer, s));
|
return (lex_advance(612, lexer, s));
|
||||||
if (s->lookahead == '>')
|
if (lex_helper_s86(lexer, s))
|
||||||
return (lex_advance(618, lexer, s));
|
return (true);
|
||||||
if (s->lookahead == '\\')
|
|
||||||
return (lex_skip(379, lexer, s));
|
|
||||||
if (s->lookahead == '`')
|
|
||||||
return (lex_advance(510, lexer, s));
|
|
||||||
if (s->lookahead == 'e')
|
|
||||||
return (lex_advance(514, lexer, s));
|
|
||||||
if (s->lookahead == '|')
|
|
||||||
return (lex_advance(593, lexer, s));
|
|
||||||
if (((s->lookahead >= '[' && s->lookahead <= ']') || \
|
if (((s->lookahead >= '[' && s->lookahead <= ']') || \
|
||||||
(s->lookahead >= '{' && s->lookahead <= '}')))
|
(s->lookahead >= '{' && s->lookahead <= '}')))
|
||||||
return (lex_advance(786, lexer, s));
|
return (lex_advance(786, lexer, s));
|
||||||
|
|
@ -78,16 +70,8 @@ bool lex_normal_s87(t_lexer *lexer, t_lexer_state *s)
|
||||||
return (lex_advance(554, lexer, s));
|
return (lex_advance(554, lexer, s));
|
||||||
if (s->lookahead == '<')
|
if (s->lookahead == '<')
|
||||||
return (lex_advance(613, lexer, s));
|
return (lex_advance(613, lexer, s));
|
||||||
if (s->lookahead == '>')
|
if (lex_helper_s87(lexer, s))
|
||||||
return (lex_advance(618, lexer, s));
|
return (true);
|
||||||
if (s->lookahead == '\\')
|
|
||||||
return (lex_skip(380, lexer, s));
|
|
||||||
if (s->lookahead == '`')
|
|
||||||
return (lex_advance(510, lexer, s));
|
|
||||||
if (s->lookahead == 'e')
|
|
||||||
return (lex_advance(514, lexer, s));
|
|
||||||
if (s->lookahead == '|')
|
|
||||||
return (lex_advance(593, lexer, s));
|
|
||||||
if (((s->lookahead >= '[' && s->lookahead <= ']') || \
|
if (((s->lookahead >= '[' && s->lookahead <= ']') || \
|
||||||
(s->lookahead >= '{' && s->lookahead <= '}')))
|
(s->lookahead >= '{' && s->lookahead <= '}')))
|
||||||
return (lex_advance(786, lexer, s));
|
return (lex_advance(786, lexer, s));
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/04/14 19:17:54 by maiboyer #+# #+# */
|
/* Created: 2024/04/14 19:17:54 by maiboyer #+# #+# */
|
||||||
/* Updated: 2024/04/14 19:18:20 by maiboyer ### ########.fr */
|
/* Updated: 2024/04/28 19:04:01 by rparodi ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -88,20 +88,6 @@ bool lex_normal_s483(t_lexer *lexer, t_lexer_state *s)
|
||||||
return (lex_advance(489, lexer, s));
|
return (lex_advance(489, lexer, s));
|
||||||
if (s->lookahead == '-')
|
if (s->lookahead == '-')
|
||||||
return (lex_advance(504, lexer, s));
|
return (lex_advance(504, lexer, s));
|
||||||
if (s->lookahead == '0')
|
|
||||||
return (lex_advance(808, lexer, s));
|
|
||||||
if (s->lookahead == '<')
|
|
||||||
return (lex_advance(613, lexer, s));
|
|
||||||
if (s->lookahead == '>')
|
|
||||||
return (lex_advance(618, lexer, s));
|
|
||||||
if (s->lookahead == '\\')
|
|
||||||
return (lex_skip(385, lexer, s));
|
|
||||||
if (s->lookahead == ']')
|
|
||||||
return (lex_advance(675, lexer, s));
|
|
||||||
if (s->lookahead == '`')
|
|
||||||
return (lex_advance(510, lexer, s));
|
|
||||||
if (s->lookahead == '|')
|
|
||||||
return (lex_advance(593, lexer, s));
|
|
||||||
if ((s->lookahead == '[' || (s->lookahead >= '{' && \
|
if ((s->lookahead == '[' || (s->lookahead >= '{' && \
|
||||||
s->lookahead <= '}')))
|
s->lookahead <= '}')))
|
||||||
return (lex_advance(786, lexer, s));
|
return (lex_advance(786, lexer, s));
|
||||||
|
|
|
||||||
103
shcat_c/parser/static/lex_funcs/lex_normal/state_helper.c
Normal file
103
shcat_c/parser/static/lex_funcs/lex_normal/state_helper.c
Normal file
|
|
@ -0,0 +1,103 @@
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* state_helper.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/04/28 18:39:26 by rparodi #+# #+# */
|
||||||
|
/* Updated: 2024/04/28 18:59:41 by rparodi ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include "./lex_normal_funcs.h"
|
||||||
|
|
||||||
|
bool lex_helper_s519(t_lexer *lexer, t_lexer_state *s)
|
||||||
|
{
|
||||||
|
if (s->lookahead == '<')
|
||||||
|
return (lex_advance(612, lexer, s));
|
||||||
|
if (s->lookahead == '>')
|
||||||
|
return (lex_advance(618, lexer, s));
|
||||||
|
if (s->lookahead == '\\')
|
||||||
|
return (lex_skip(542, lexer, s));
|
||||||
|
if (s->lookahead == '`')
|
||||||
|
return (lex_advance(856, lexer, s));
|
||||||
|
if (s->lookahead == '|')
|
||||||
|
return (lex_advance(593, lexer, s));
|
||||||
|
return (false);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool lex_helper_s520(t_lexer *lexer, t_lexer_state *s)
|
||||||
|
{
|
||||||
|
if (s->lookahead == '<')
|
||||||
|
return (lex_advance(612, lexer, s));
|
||||||
|
if (s->lookahead == '>')
|
||||||
|
return (lex_advance(618, lexer, s));
|
||||||
|
if (s->lookahead == '\\')
|
||||||
|
return (lex_skip(544, lexer, s));
|
||||||
|
if (s->lookahead == '`')
|
||||||
|
return (lex_advance(855, lexer, s));
|
||||||
|
if (s->lookahead == '|')
|
||||||
|
return (lex_advance(593, lexer, s));
|
||||||
|
return (false);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool lex_helper_s521(t_lexer *lexer, t_lexer_state *s)
|
||||||
|
{
|
||||||
|
if (s->lookahead == '<')
|
||||||
|
return (lex_advance(613, lexer, s));
|
||||||
|
if (s->lookahead == '>')
|
||||||
|
return (lex_advance(618, lexer, s));
|
||||||
|
if (s->lookahead == '\\')
|
||||||
|
return (lex_skip(541, lexer, s));
|
||||||
|
if (s->lookahead == '`')
|
||||||
|
return (lex_advance(856, lexer, s));
|
||||||
|
if (s->lookahead == '|')
|
||||||
|
return (lex_advance(593, lexer, s));
|
||||||
|
return (false);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool lex_helper_s522(t_lexer *lexer, t_lexer_state *s)
|
||||||
|
{
|
||||||
|
if (s->lookahead == '<')
|
||||||
|
return (lex_advance(613, lexer, s));
|
||||||
|
if (s->lookahead == '>')
|
||||||
|
return (lex_advance(618, lexer, s));
|
||||||
|
if (s->lookahead == '\\')
|
||||||
|
return (lex_skip(543, lexer, s));
|
||||||
|
if (s->lookahead == '`')
|
||||||
|
return (lex_advance(855, lexer, s));
|
||||||
|
if (s->lookahead == '|')
|
||||||
|
return (lex_advance(593, lexer, s));
|
||||||
|
return (false);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool lex_helper_s86(t_lexer *lexer, t_lexer_state *s)
|
||||||
|
{
|
||||||
|
if (s->lookahead == '>')
|
||||||
|
return (lex_advance(618, lexer, s));
|
||||||
|
if (s->lookahead == '\\')
|
||||||
|
return (lex_skip(379, lexer, s));
|
||||||
|
if (s->lookahead == '`')
|
||||||
|
return (lex_advance(510, lexer, s));
|
||||||
|
if (s->lookahead == 'e')
|
||||||
|
return (lex_advance(514, lexer, s));
|
||||||
|
if (s->lookahead == '|')
|
||||||
|
return (lex_advance(593, lexer, s));
|
||||||
|
return (false);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool lex_helper_s87(t_lexer *lexer, t_lexer_state *s)
|
||||||
|
{
|
||||||
|
if (s->lookahead == '>')
|
||||||
|
return (lex_advance(618, lexer, s));
|
||||||
|
if (s->lookahead == '\\')
|
||||||
|
return (lex_skip(380, lexer, s));
|
||||||
|
if (s->lookahead == '`')
|
||||||
|
return (lex_advance(510, lexer, s));
|
||||||
|
if (s->lookahead == 'e')
|
||||||
|
return (lex_advance(514, lexer, s));
|
||||||
|
if (s->lookahead == '|')
|
||||||
|
return (lex_advance(593, lexer, s));
|
||||||
|
return (false);
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue