home *** CD-ROM | disk | FTP | other *** search
- Submitted-by: guenther@stolaf.edu (Philip Guenther)
-
- I'm in the (slow) process of writing my own shell (yes, I know that
- this has become a cliche, but I'm doing it anyway, mostly to prove to
- myself that I really know C/UNIX (hah!)), and I'd like it to be POSIX
- compliant. Thus, the inch think print out of 1003.2 next to me. :-)
-
- However, after working with the grammer given in 3.10.2, and comparing
- it with other parts of the document, I have found a problem with the
- grammer as given: it contradicts the previous written specification.
- To be specific:
-
- According to 3.9.4.3 (case Conditional Construct), the last case item
- doesn't need a ';;'. Thus:
-
- case $foo in
- bar) echo baz;;
- *) echo baz
- esac
-
- is valid. However, the grammer of 3.10.2 denies this by requiring the
- double semi. As I see it, the relevant lines of the grammer should be
- changed to:
-
- case_clause: Case WORD In linebreak case_list DSEMI linebreak Esac
- | Case WORD In linebreak case_list Esac
- | Case WORD In linebreak Esac
- ;
-
- case_list: case_list DSEMI linebreak case_item
- | case_item
- ;
-
- case_item: pattern ')' linebreak
- | pattern ')' compound_list
- ... etc
-
- This unfortunately does possibly cloud what the units mean away from
- each other (a case_list doesn't include the final ';;'?), but it does
- fix this error in the grammer. In addition, it makes the extension to
- the case sytax of ';&' meaning fall through to next case_item easier
- to add.
-
- This leads finally to several questions: Can this amended in some way
- in future drafts? (Draft 11 is in my lap right now) Where does the
- final call come from when two parts of the standard are contradictory?
- Will there be POSIX Call For Interpretations ala ANSI C?
-
-
- Philip Guenther
- --
- guenther@stolaf.edu (Philip Guenther) St Olaf College, Northfield, MN 55057
- (setq sig-hook '(lambda () (dis-insert-disclaimer organization 'student)))
- "Life makes sense? LIFE MAKES SENSE!?!? Where do people get these ideas?"
-
-
- Volume-Number: Volume 30, Number 61
-
-