Discussion List Archives

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

RE: parser validation tools

  • Subject: RE: parser validation tools
  • From: "Bollinger, John Clayton" <jobollin@xxxxxxxxxxx>
  • Date: Thu, 11 May 2000 16:05:18 +0100 (BST)

Richard Ball wrote:
> How about a single-source COMCIFS-approved tool, along the 
> lines of vcif,
> that'd rewrite (very quickly so you don't pay a big penalty 
> to use it) a
> pathalogical STAR/CIF file into a more easily parsed/used 
> style? It'd not do
> any dictionary checking or data validation, that'd be delegated to the
> downstream parser, it would just structure things better:
> 
>  - all datablocks would start on a newline with no whitespace
>  - strip comments or put them on their own lines
>  - each dataname of a loop starts a line with no embedded blank lines
>  - the ; marking the end of a text block is the only 
> character on the line
>  - only one dataname/dataitem pair per line
>  - others?

The common theme among all of those items seems to be that they are
aimed at easing parsing via _record-oriented_ file handling, ala
Fortran.  They are no special boon when using stream-oriented file
handling, ala C, Java, and others.  My solution to the problem of
Fortran not yet having stream I/O was to write some simple routines to
emulate it, which wasn't too hard.  One must also be able to pluck
tokens out of the resulting pseudo-stream, but that's downright easy.

The main usefulness of a CIF prettifier would be to make the CIF
more readable to _humans_ (which might itself justify the development
effort).  I don't necessarily see such a tool as a big advantage to
software developers -- especially to those not developing in Fortran.
Along these lines, however, what might be more useful to developers
is a CIF lexical analyzer, with appropriate Fortran, C (and perhaps
other) bindings.  That would obviate any need for the developer to
prettify a CIF before inputting it to his own program, and give him
a head start on his project at the same time.  Just where that idea
lies along the line between complete custom code and a full-blown
API like CIFtbx, I can't say.


Regards,

John Bollinger
Indiana University
Molecular Structure Center

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.