Email List: Xaustin-review-lX
[All Lists]

Defect in XCU awk Grammar

To: yyyyyyyyyyyyyyy@xxxxxxxxxxxxx
Subject: Defect in XCU awk Grammar
From: yyyyyy@xxxxxxxxxxx
Date: Fri, 10 Feb 2006 23:08:41 GMT
Resent-date: Sun, 12 Feb 2006 07:17:20 +0000
Resent-from: Andrew Josey <yyyyyy@xxxxxxxxxxxxxxxxx>
Resent-message-id: <1060212071720.ZM20553@xxxxxx>
Resent-to: yyyyyyyyyyyyyyy@xxxxxxxxxxxxx
        Defect report from : Paul Eggert , UCLA

(Please direct followup comments direct to yyyyyyyyyyyyyy@xxxxxxxxxxxxx)

@ page 176 line 6881 section awk Grammar objection {20060210b}

Problem:

Edition of Specification (Year): 2004

Defect code :  1. Error

Currently the POSIX specification for 'awk' requires support for
statements like this:

  print $x++--
  print $$0++--

This is because the grammar in the 'awk' Grammar section allows these
statements, and there is no ambiguity in the grammar here, so the
precedence and associativity rules are not needed and do not apply.

However, in practice, 'awk' implementations do not always support
expressions in which a subexpression's principal operator has a lower
precedence than the operator of the parent expression.  This is
because the usual LL(1) and LALR(1) parsing techniques often do not
allow such expressions.  For example, 'nawk', 'gawk', and 'mawk' all
reject the first usage, and 'gawk' rejects the second one.


Action:

Insert this text before XCU page 176 line 6881:

   Each expression in an 'awk' program shall conform to the precedence
   and associativity rules, even when this is not needed to resolve an
   ambiguity.  For example, because '$' has higher precedence than
   '++', the string '$x++--' is not a valid 'awk' expression even
   though it is unambiguously parsed by the grammar as '$(x++)--'.

<Prev in Thread] Current Thread [Next in Thread>
  • Defect in XCU awk Grammar, eggert <=