Discussion List Archives

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

Another suggestion for the BNF

  • Subject: Another suggestion for the BNF
  • From: James Hester <jrh@xxxxxxxxxxxx>
  • Date: Mon, 1 Jul 2002 05:00:17 +0100 (BST)
Hello again,

Ralf and I have detected what appears to be another problem with the
BNF, this time in regard to embedded quotes.   Consider the following
bit of text:

_site.id _site.details

Now consider the BNF definitions:
<data_value_2>  ::= <S_quote> <S_quote_string> <S_quote> 

<S_quote_string> ::= { <S_quote> <non_blank_char> | <not_a_S_quote>} *

a S_quote_string is thus

<S_quote> { <S_quote> <non_blank_char> | <not_a_S_quote> } * <S_quote>

Now, the problem is that, because <non_blank_char> includes a <S_quote>
(as it must for double single quotes inside the string), a double final
S_quote as in the above example is matched by the
<S_quote><non_blank_char> sequence, leaving nothing for the final
<S_quote> and meaning that the two data items above are parsed as a
single data item.

One idea for a fix:

<S_quote_string> ::=
  { <S_quote> <non_blank_char> | <not_a_S_quote>} * <S_quote> *

making the specification for the whole S_squote delimited text 
<S_quote> { <S_quote> <non_blank_char> | <not_a_S_quote>} * <S_quote>+

James Hester.
James Hester, ANBF                             KEK
e-mail: jrh@anbf2.kek.jp                       Oho 1-1
Phone: +81 298 64 7959                         Tsukuba, Ibaraki 305
  Fax: +81 298 64 7967                         Japan

Reply to: [list | sender only]
International Union of Crystallography

Scientific Union Member of the International Science Council (admitted 1947). Member of CODATA, the ISC Committee on Data. Partner with UNESCO, the United Nations Educational, Scientific and Cultural Organization in the International Year of Crystallography 2014.

International Science Council Scientific Freedom Policy

The IUCr observes the basic policy of non-discrimination and affirms the right and freedom of scientists to associate in international scientific activity without regard to such factors as ethnic origin, religion, citizenship, language, political stance, gender, sex or age, in accordance with the Statutes of the International Council for Science.