From 1a22a39336e0ed56d3ed3e25720fbe09f04f7c3b Mon Sep 17 00:00:00 2001 From: Jerome Date: Sun, 6 Apr 2025 14:25:52 +0200 Subject: [PATCH] parse-cmd: fix typo and grammar.md appearance --- grammar.md | 9 +++++++++ src/parser/cmd_parsing.c | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/grammar.md b/grammar.md index 2ccae67..f9bae57 100644 --- a/grammar.md +++ b/grammar.md @@ -5,6 +5,8 @@ and priority of operators to wit () is of highest priority followed by | and then || and && which share the same priority (priorization therefore occurs because of left associativity). +``` +{ LINE -> CMDS eol CMDS -> CMDS LIST_OP PIPELINE CMDS -> PIPELINE @@ -22,12 +24,17 @@ REDIR -> << word REDIR REDIR -> ε LIST_OP -> && LIST_OP -> || +} +``` + ## Grammar after removal of left recursivity The same priorities as the previous version except it is now LL(1) and therefore compatible with descending syntax analysisi (LL(1)). +``` +{ LINE -> CMDS eol CMDS -> PIPELINE OPT_CMDS OPT_CMDS -> LIST_OP PIPELINE OPT_CMDS @@ -47,3 +54,5 @@ REDIR -> << word REDIR REDIR -> ε LIST_OP -> && LIST_OP -> || +} +``` diff --git a/src/parser/cmd_parsing.c b/src/parser/cmd_parsing.c index b9827de..2df1872 100644 --- a/src/parser/cmd_parsing.c +++ b/src/parser/cmd_parsing.c @@ -13,7 +13,7 @@ #include "cmd_parsing.h" /* -** NOTE: Tjis file will temporarily include way more fucntions than allowed. +** NOTE: This file will temporarily include way more fucntions than allowed. */ void parse_error(t_minishell *app, t_worddesc *token)