View Issue Details

IDProjectCategoryView StatusLast Update
00006481003.1(2008)/Issue 7Shell and Utilitiespublic2019-06-10 08:55
Reporterrhansen Assigned Toajosey  
PrioritynormalSeverityCommentTypeError
Status ClosedResolutionAccepted As Marked 
NameRichard Hansen
Organization
User Reference
Section2.3, 2.10.1
Page Number2300, 2325
Line Number72448, 73415
Interp Status---
Final Accepted TextSee 0000648:0001457.
Summary0000648: Special treatment of <newline> in tokenization rules is unnecessary
DescriptionAccording to the definition of "operator" in XBD 3.255 and 3.113, a <newline> is an operator. Thus, the special treatment of <newline> in sections 2.3 and 2.10.1 is unnecessary.

Section 2.3 contains the following token recognition rules (lines 72445-72448):

    6. If the current character is not quoted and can be used as the first character of a new operator, the current token (if any) shall be delimited. The current character shall be used as the beginning of the next (operator) token.
    7. If the current character is an unquoted <newline>, the current token shall be delimited.

In the above, an unquoted <newline> matches rule #6. Because lines 72411-72412 say that the first applicable rule is applied, rule #7 will never be applied and is thus unnecessary.

Section 2.10.1 contains the following token recognition rules (lines 73415-73416):

    1. A <newline> shall be returned as the token identifier NEWLINE.
    2. If the token is an operator, the token identifier for that operator shall result.

If rule #1 is deleted, rule number #2 will apply to unquoted <newlines>, returning the token identifier NEWLINE. Thus, rule #1 is unnecessary.
Desired ActionDelete 2.3 rule #7 (line 72448) and 2.10.1 rule #1 (line 73415).
Tagstc2-2008

Relationships

related to 0000736 Closed 1003.1(2013)/Issue7+TC1 grammatically accept zero or more Shell commands 

Activities

rhansen

2013-01-24 17:58

manager   bugnote:0001454

Last edited: 2013-01-24 18:02

Section 2.10.1 (Shell Grammar Rules) implies that newline, semicolon, ampersand, less than, greater than, pipe, left paren, and right paren are not operators in at least the context of section 2.10. This suggests that perhaps 2.3 rule #7 and 2.10.1 rule #1 are actually required.

I propose modifying the grammar in section 2.10 to make it clear that they are operators and that the section 2.10 definition of operator matches the XBD 3.255 definition of operator. Here are my new suggested changes:

  * in section 2.10:
    - change the comment:
          /* The following are the operators mentioned above */
      to:
          /* The following are operators */
    - move '%token NEWLINE' below the comment '/* The following are operators */'
    - add the following tokens with the other operator tokens:
         %token AMPERSAND /* '&' */
         %token LPAREN /* '(' */
         %token RPAREN /* ')' */
         %token SEMI /* ';' */
         %token PIPE /* '|' */
         %token LTHAN /* '<' */
         %token GTHAN /* '>' */
    - make the following replacements:
         '&' -> AMPERSAND
         '(' -> LPAREN
         ')' -> RPAREN
         ';' -> SEMI
         '|' -> PIPE
         '<' -> LTHAN
         '>' -> GTHAN
    - delete 2.10.1 rule #1
  * in section 2.3:
    - delete 2.3 rule #7

The new tokens are all uppercase to be consistent with the conventions described in XCU section 1.3 (Grammar Conventions).

rhansen

2013-02-07 16:09

manager   bugnote:0001457

Last edited: 2013-02-07 17:27

Geoff Clare suggested the following alternative change, which I prefer:

 * in section 2.10, change the comment:

      /* The following are the operators mentioned above */

   to:

      /* The following are the operators (see XBD 3.255) containing more
         than one character */

 * Delete 2.3 rule #7 (line 72448) and 2.10.1 rule #1 (line 73415).
 * renumber the lists in 2.3 and 2.10.1

Issue History

Date Modified Username Field Change
2013-01-18 20:44 rhansen New Issue
2013-01-18 20:44 rhansen Status New => Under Review
2013-01-18 20:44 rhansen Assigned To => ajosey
2013-01-18 20:44 rhansen Name => Richard Hansen
2013-01-18 20:44 rhansen Section => 2.3, 2.10.1
2013-01-18 20:44 rhansen Page Number => 2300, 2325
2013-01-18 20:44 rhansen Line Number => 72448, 73415
2013-01-24 17:58 rhansen Note Added: 0001454
2013-01-24 18:02 rhansen Note Edited: 0001454
2013-02-07 16:09 rhansen Note Added: 0001457
2013-02-07 17:27 rhansen Note Edited: 0001457
2013-02-07 17:29 Don Cragun Interp Status => ---
2013-02-07 17:29 Don Cragun Final Accepted Text => See 0000648:0001457.
2013-02-07 17:29 Don Cragun Status Under Review => Resolved
2013-02-07 17:29 Don Cragun Resolution Open => Accepted As Marked
2013-02-08 08:16 Don Cragun Tag Attached: tc2-2008
2013-08-29 16:21 nick Relationship added related to 0000736
2019-06-10 08:55 agadmin Status Resolved => Closed