parse-cmd: fix typo and grammar.md appearance

This commit is contained in:
Jerome 2025-04-06 14:25:52 +02:00
parent fea514ea63
commit 1a22a39336
2 changed files with 10 additions and 1 deletions

View file

@ -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 -> ||
}
```