A NOTE has been added to this issue. ====================================================================== http://austingroupbugs.net/view.php?id=1100 ====================================================================== Reported By: Mark_Galeck Assigned To: ====================================================================== Project: 1003.1(2016)/Issue7+TC2 Issue ID: 1100 Category: Shell and Utilities Type: Clarification Requested Severity: Editorial Priority: normal Status: New Name: Mark Galeck Organization: User Reference: Section: 2.10 Shell Grammar Page Number: 2375-2381 Line Number: 75873-76150 Interp Status: --- Final Accepted Text: ====================================================================== Date Submitted: 2016-10-27 12:40 UTC Last Modified: 2018-05-17 15:33 UTC ====================================================================== Summary: Rewrite of Section 2.10 Shell Grammar, of the Shell Standard, to fix previous reports, fix new issues, and improve presentation. ====================================================================== Relationships ID Summary ---------------------------------------------------------------------- has duplicate 0001098 do_group symbol cannot be accepted as w... has duplicate 0001088 "When more than one rule applies, ... has duplicate 0001091 Some "WORD tokens" do not hav... has duplicate 0001093 "or applies globally" is poin... related to 0001082 "delimited" is incorrect related to 0001083 "next" character is misleading related to 0001084 rule 3, 4, 5 do not say that a token is... related to 0001085 "token shall be from the current p... related to 0001086 Token "Recognition" is mislea... ======================================================================
---------------------------------------------------------------------- (0004037) eblake (manager) - 2018-05-17 15:33 http://austingroupbugs.net/view.php?id=1100#c4037 ---------------------------------------------------------------------- Here is a diff between the original formal grammar and the proposed new one: <blockquote> --- /tmp/grammar.1 2018-05-10 09:11:35.894306140 -0700 +++ /tmp/grammar.2 2018-05-10 09:12:23.347012514 -0700 @@ -96,21 +96,18 @@ term : term separator and_or | and_or ; -for_clause : For name do_group - | For name sequential_sep do_group - | For name linebreak in sequential_sep do_group - | For name linebreak in wordlist sequential_sep do_group - ; -name : NAME /* Apply rule 5 */ - ; -in : In /* Apply rule 6 */ +/* Apply rule 7:*/ +for_clause : For NAME do_group + | For NAME sequential_sep do_group + | For NAME linebreak In sequential_sep do_group + | For NAME linebreak In wordlist sequential_sep do_group ; wordlist : wordlist WORD | WORD ; -case_clause : Case WORD linebreak in linebreak case_list Esac - | Case WORD linebreak in linebreak case_list_ns Esac - | Case WORD linebreak in linebreak Esac +case_clause : Case WORD linebreak In linebreak case_list Esac + | Case WORD linebreak In linebreak case_list_ns Esac + | Case WORD linebreak In linebreak Esac ; case_list_ns : case_list case_item_ns | case_item_ns @@ -118,18 +115,22 @@ case_list : case_list case_item | case_item ; -case_item_ns : pattern ')' linebreak - | pattern ')' compound_list +case_item_ns : pattern_not_esac ')' linebreak + | pattern_not_esac ')' compound_list | '(' pattern ')' linebreak | '(' pattern ')' compound_list ; -case_item : pattern ')' linebreak DSEMI linebreak - | pattern ')' compound_list DSEMI linebreak +case_item : pattern_not_esac ')' linebreak DSEMI linebreak + | pattern_not_esac ')' compound_list DSEMI linebreak | '(' pattern ')' linebreak DSEMI linebreak | '(' pattern ')' compound_list DSEMI linebreak ; -pattern : WORD /* Apply rule 4 */ - | pattern '|' WORD /* Do not apply rule 4 */ +/* Apply rule 8:*/ +pattern_not_esac: WORD + | WORD '|' pattern + ; +pattern : WORD + | pattern '|' WORD ; if_clause : If compound_list Then compound_list else_part Fi | If compound_list Then compound_list Fi @@ -142,27 +143,24 @@ ; until_clause : Until compound_list do_group ; -function_definition : fname '(' ')' linebreak function_body - ; -function_body : compound_command /* Apply rule 9 */ - | compound_command redirect_list /* Apply rule 9 */ +/* Apply rule 6:*/ +function_definition : NAME '(' ')' linebreak function_body ; -fname : NAME /* Apply rule 8 */ +/* Apply rule 3:*/ +function_body : compound_command + | compound_command redirect_list ; brace_group : Lbrace compound_list Rbrace ; -do_group : Do compound_list Done /* Apply rule 6 */ +do_group : Do compound_list Done ; -simple_command : cmd_prefix cmd_word cmd_suffix - | cmd_prefix cmd_word +simple_command : cmd_prefix WORD cmd_suffix /* Apply rule 5b */ + | cmd_prefix WORD /* Apply rule 5b */ | cmd_prefix - | cmd_name cmd_suffix - | cmd_name - ; -cmd_name : WORD /* Apply rule 7a */ - ; -cmd_word : WORD /* Apply rule 7b */ + | WORD cmd_suffix /* Apply rule 5a */ + | WORD /* Apply rule 5a */ ; +/* Apply rule 5c:*/ cmd_prefix : io_redirect | cmd_prefix io_redirect | ASSIGNMENT_WORD @@ -189,12 +187,12 @@ | LESSGREAT filename | CLOBBER filename ; -filename : WORD /* Apply rule 2 */ +filename : WORD /* Apply rule 10*/ ; io_here : DLESS here_end | DLESSDASH here_end ; -here_end : WORD /* Apply rule 3 */ +here_end : WORD /* Apply rule 9 */ ; newline_list : NEWLINE | newline_list NEWLINE @@ -211,4 +209,3 @@ sequential_sep : ';' linebreak | newline_list ; - </blockquote> Issue History Date Modified Username Field Change ====================================================================== 2016-10-27 12:40 Mark_Galeck New Issue 2016-10-27 12:40 Mark_Galeck Name => Mark Galeck 2016-10-27 12:40 Mark_Galeck Section => 2.10 Shell Grammar 2016-10-27 12:40 Mark_Galeck Page Number => 2375-2381 2016-10-27 12:40 Mark_Galeck Line Number => 75873-76150 2016-10-27 12:57 Mark_Galeck Note Added: 0003470 2016-10-28 08:19 geoffclare Relationship added related to 0001082 2016-10-28 08:20 geoffclare Relationship added related to 0001083 2016-10-28 08:20 geoffclare Relationship added related to 0001084 2016-10-28 08:21 geoffclare Relationship added related to 0001085 2016-10-28 08:21 geoffclare Relationship added related to 0001086 2016-10-28 08:22 geoffclare Relationship added related to 0001098 2018-03-28 03:59 kre Note Added: 0003944 2018-04-12 15:38 eblake Relationship added has duplicate 0001088 2018-04-12 15:39 eblake Relationship added has duplicate 0001091 2018-04-12 15:39 eblake Relationship added has duplicate 0001093 2018-04-12 15:40 eblake Relationship replaced has duplicate 0001098 2018-05-11 20:10 shware_systems Note Added: 0004030 2018-05-11 21:39 kre Note Added: 0004031 2018-05-12 06:59 shware_systems Note Added: 0004032 2018-05-17 15:33 eblake Note Added: 0004037 ======================================================================