help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why yacc_EOF is used as a list_terminator for for_command?


From: Koichi Murase
Subject: Re: Why yacc_EOF is used as a list_terminator for for_command?
Date: Tue, 11 May 2021 02:23:26 +0900

2021年5月11日(火) 1:25 Peng Yu <pengyu.ut@gmail.com>:
> list_terminator is this. I can see why '\n' and ';' are included. But
> it doesn't make sense to me why yacc_EOF is needed here.
>
> list_terminator:'\n'
> | ';'
> | yacc_EOF
> ;

They are in effect in the following places.

pipeline_command: pipeline
        |       timespec list_terminator
        |       BANG list_terminator

> It may be useful to include yacc_EOF in other rules.

Do you have a better idea? Where would you include it? Is it worth
changing the current implementation which works without problems
currently? It's useless to change the code that actually doesn't
change any behavior. It may just introduce a new bug.

> But Is it correct to include it here?

How do you define "correct" and "incorrect"? There can be always many
different ways to represent a formal language. As far as they accept
the same set of strings, they are equally correct.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]