Re: Data table text I/O package?



Dmitry A. Kazakov wrote:
On Mon, 20 Jun 2005 13:19:44 +0200, Georg Bauhaus wrote:


Dmitry A. Kazakov wrote:


  Get (Line, Pointer, Field_2); -- Get field and move Pointer
  ...
  etc

Quite trivial.

And quite adventurous in any but an internal context.

If you are parsing data from outside, you have to know the quality and structure of data (plus the pitfalls mentioned by Robert Duff.) As to quality, just one inadvertently typed space might be hazardous when it splits an atom in two... :)

(Think of a medium quality CSV file, and a number typed 3.1 5.
Oops!)

XML can help with this for example by identifying the bounds
of a data item, even if mistyped:
<Distance km='3.1 5'/>
This will be noticed by the XML parser if it knows about km's
type (NMTOKEN). You could as well squeeze the space out using
either Ada.Strings or XML related technology. But in any case
there can be no doubt that the string "3.1 5" is a mistyped
number.


Georg .




Relevant Pages

  • Re: Bitwise Mag editorial calls OOP Snake Oil
    ... > Dmitry A. Kazakov wrote: ... At any technological level there is an optimal quality. ...
    (comp.object)
  • Re: Ada Component Registry proposal
    ... the XML document was not something I would be comfortable posting, ... <!-- Version 0.2 Doctype Copyright 2003 by Robert I. Eachus, ... <!ELEMENT Description (#PCDATA)> ... Quality is scientific reality. ...
    (comp.lang.ada)
  • Re: Ada Component Registry proposal
    ... is the semantic equivalent of a collection of Ada types would ... Robert I. Eachus Wrote: ... the XML document was not something I would be comfortable posting, ... Quality is scientific reality. ...
    (comp.lang.ada)
  • Re: Code review comment: "Noone uses tokens anymore"
    ... The quality of your text format will hinge on the quality of your parsing. ... However, the suggestion to switch to XML ...
    (comp.programming)