mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
parse-cmd: fix typo and grammar.md appearance
This commit is contained in:
parent
fea514ea63
commit
1a22a39336
2 changed files with 10 additions and 1 deletions
|
|
@ -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
|
and then || and && which share the same priority (priorization therefore
|
||||||
occurs because of left associativity).
|
occurs because of left associativity).
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
LINE -> CMDS eol
|
LINE -> CMDS eol
|
||||||
CMDS -> CMDS LIST_OP PIPELINE
|
CMDS -> CMDS LIST_OP PIPELINE
|
||||||
CMDS -> PIPELINE
|
CMDS -> PIPELINE
|
||||||
|
|
@ -22,12 +24,17 @@ REDIR -> << word REDIR
|
||||||
REDIR -> ε
|
REDIR -> ε
|
||||||
LIST_OP -> &&
|
LIST_OP -> &&
|
||||||
LIST_OP -> ||
|
LIST_OP -> ||
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Grammar after removal of left recursivity
|
## Grammar after removal of left recursivity
|
||||||
|
|
||||||
The same priorities as the previous version except it is now LL(1) and
|
The same priorities as the previous version except it is now LL(1) and
|
||||||
therefore compatible with descending syntax analysisi (LL(1)).
|
therefore compatible with descending syntax analysisi (LL(1)).
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
LINE -> CMDS eol
|
LINE -> CMDS eol
|
||||||
CMDS -> PIPELINE OPT_CMDS
|
CMDS -> PIPELINE OPT_CMDS
|
||||||
OPT_CMDS -> LIST_OP PIPELINE OPT_CMDS
|
OPT_CMDS -> LIST_OP PIPELINE OPT_CMDS
|
||||||
|
|
@ -47,3 +54,5 @@ REDIR -> << word REDIR
|
||||||
REDIR -> ε
|
REDIR -> ε
|
||||||
LIST_OP -> &&
|
LIST_OP -> &&
|
||||||
LIST_OP -> ||
|
LIST_OP -> ||
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
#include "cmd_parsing.h"
|
#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)
|
void parse_error(t_minishell *app, t_worddesc *token)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue