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 14:33:28 +0100 (BST)

> But in fact you need also to check that the hash isn't a legitimate
> character within a text string, e.g.  'this is a # legal data value'
> I offer as a challenge to anyone who is interested the problem of
> supplying a regexp that will definitely match a comment on a line.

Considering that you must also account for:

_illustrative_example
;
 This # symbol does not introduce a comment. 
;

I don't see how you can reliably identify comments with any regexp.
To do the job right it would appear that a lexical analyzer, e.g.
lex or flex, is in order.  Alternatively, such parsing could always
be written in any language and built into a special-purpose tool.


John Bollinger
Indiana University
Molecular Structure Center

jobollin@indiana.edu

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.