Discussion List Archives

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

Modification to BNF needed for <line_of_text>?

  • Subject: Modification to BNF needed for <line_of_text>?
  • From: James Hester <jrh@xxxxxxxxxxxx>
  • Date: Mon, 1 Jul 2002 03:42:02 +0100 (BST)

While cleaning up assorted errors in PyCifRW parsing, Ralf
Grosse-Kunstleve and I think we've found an oversight in the BNF
definition.  Consider the following bit of a CIF file:



and the BNF specification for the semicolon delimited data value:

<data_value_2> ::= ';'<SC_bounded_string>';'

<SC_bounded_string>  ::= <char>* <terminate> <line_of_text>* 
<line_of_text> ::= <not_a_semi_colon> <char>* <terminate>
<not_a_semi_colon>      ::= <ordinary_char> | '"' | '#' | '$' | '\''
|'_' | '[' | ']'| <blank>

so, as <not_a_semi_colon> doesn't include <terminate>, it follows that
all lines of text should have at least one non-terminating character in
them, thus excluding the above example.  This could be fixed by changing
the spec to

<line_of_text> ::= <not_a_semi_colon | terminate> <char>* <terminate>

or adding <terminate> to <not_a_semi_colon>

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 Council for Science (admitted 1947). Member of CODATA, the ICSU Committee on Data. Member of ICSTI, the International Council for Scientific and Technical Information. Partner with UNESCO, the United Nations Educational, Scientific and Cultural Organization in the International Year of Crystallography 2014.

ICSU 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.