At 15:53 04/06/2004 +0200, Miguel wrote:

I mailed Miguel offline with a copy of my CIF parser...

> I can see this CIF thing really isn't a standard. Bummer.

<snip/>



Here are Jmol problems I have encountered so far that are preventing the
file from being read.

1. The file contains >20 lines of comments at the beginning. The current
code only looks at the first 4 lines of the file to try to determine the
file type. This is my problem, should be considered a Jmol bug, and will
be fixed.

I agree with this interpretation. Note that there is no formal terminating marker - you rely on EOF. This means that truncated files may appear valid


It is also allowable to have several data_ blocks in a file. These may contain different molecules or they might contain non-molecular information (e.g. names and addresses). There is no required template for a CIF although certain journals will require them.

2. These CIF files have no blank lines between loop_ data blocks. This is
the first CIF file that I have seen like this (although I have seen very
few). The current parser was dependent upon the presence of those blank
lines (because I assumed they were part of the spec.)

No. It relies on generic whitespace. The only place (I think) where lines matter is the text block:
;
line 1
line 2
;


Here the semicolons must start in column 1. semicolons within line1 or line2 are treated as normal


[editorial]
In my opinion those blank lines *should* have been a part of the spec.
Without some type of data block terminator it becomes more difficult and
*much* more bug-prone to produce a reliable parser. I suspect that is a
contributing factor to why cif does not seem very popular. And I strongly
suspect that is why others introduce these blank lines ... to try to avoid
parser bugs.
[/editorial]

My experience is that non-conformant CIFs are not infrequent. This means that most parsers are not completely compliant - otherwise they would throw. In which case data may get corrupted. Missing '...' round multiword strings are not uncommon errors. Note that my parser is intended to be completely compliant though I wrote it from the textual spec and not the BNF (I think)



> But this
> source is an important one, as it is the main crystallographic database
> for the entire small-molecule world.

I hope to get it fixed within a few hours.

Please mail privately if you have problems. I can't promise to be on line

P.


Miguel




------------------------------------------------------- This SF.Net email is sponsored by the new InstallShield X. From Windows to Linux, servers to mobile, InstallShield X is the one installation-authoring solution that does it all. Learn more and evaluate today! http://www.installshield.com/Dev2Dev/0504 _______________________________________________ Jmol-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jmol-developers

Peter Murray-Rust Unilever Centre for Molecular Informatics Chemistry Department, Cambridge University Lensfield Road, CAMBRIDGE, CB2 1EW, UK Tel: +44-1223-763069



-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
Jmol-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to