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: Tue, 16 May 2000 16:48:14 +0100 (BST)

Richard Ball wrote:
> Ideally what I would ask of the lexical analysis routine 
> would be for it to
> return an array of all the datanames in the CIF tagged with a 
> loop indicater
> (0 for non-looped, otherwise a number for which loop that 
> dataname was in), a
> second array for all the non-looped dataitems, a third array 
> containing all
> the looped dataitems (with an id for which loop they came 
> from so I know
> which datanames go with these dataitems). No other 
> processing, no other
> validation. Given those three arrays my existing routines 
> would handle all
> the other processing needed. Is that something your prototype 
> could do?

It could be made to do that without a great deal of difficulty.
I observe, however, that digesting a CIF in the way you describe
would make it very difficult for your program to pinpoint some
kinds of syntactic errors, e.g. a non-looped data tag without
an associated value.  You could easily tell that there was
an error, but not where it occurred.  If you still want something
like this then I can provide it (but see also below).

Partially as a test of various things lexly and yaccly, I bit the
bullet and went ahead to build a syntax-checking CIF pretty printer.
The pretty printing end of it produces output much along the lines
that Richard outlined earlier.  I will release the code to anyone
interested, with the understanding that it is still under development.
It does not validate against a dictionary, but it would be downright
easy to provide a hook for an appropriate routine to do that.


John Bollinger
Indiana University
Molecular Structure Center


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.