From 46dff5870d091fc5c423e4b2006bba2593ccc811 Mon Sep 17 00:00:00 2001 From: Lukas Jiriste Date: Thu, 20 Jun 2024 10:48:40 +0200 Subject: [PATCH] Add comment about the parsing table structure Parsing table shoud not contain any non-ASCII whitespace as getting rid of multi-character whitespace is more challeging. I mention it as I have encountered this problem and it was somewhat difficult to find the cause. --- inc/ft_parse.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/inc/ft_parse.h b/inc/ft_parse.h index b06c05e..4de4635 100644 --- a/inc/ft_parse.h +++ b/inc/ft_parse.h @@ -6,7 +6,7 @@ /* By: ljiriste +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/05/27 21:21:54 by ljiriste #+# #+# */ -/* Updated: 2024/06/16 08:17:25 by ljiriste ### ########.fr */ +/* Updated: 2024/06/20 10:44:37 by ljiriste ### ########.fr */ /* */ /* ************************************************************************** */ @@ -52,16 +52,17 @@ typedef struct s_parser_state // State token[i] token[i+n] // j states[j].lookahead[i] states[0].goto[i] // -// The whitespace is not significant and ; should be used as separator. -// For ease of parsing the "end of input" token $ should be the last -// lookahead token. Additionally the states should be consecutive -// increasing integers starting at 0. -// // The first row contains all the n terminal tokens first // and after them all the non-terminal tokens. // Every other row contains the (unique) state number and the reduce/shift // rule for the appropriate token. // +// The whitespace is not significant and ; should be used as separator. +// For ease of parsing the "end of input" token $ should be the last +// lookahead token. Additionally the states should be consecutive +// increasing integers starting at 0. +// Do not use non-ASCII whitespace! +// // The rules table should have the form // // token[i_1] -> [ token[j_1] [ token[k_1] ... ]] -- 2.30.2