monotone-devel
[Top][All Lists]
Advanced

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

Re: [Monotone-devel] basic_io inventory


From: Christian Ohler
Subject: Re: [Monotone-devel] basic_io inventory
Date: Sun, 29 Apr 2007 11:22:10 +0200

Thomas Moschny, 2007-04-29:

On Saturday 28 April 2007, Stephen Leake wrote:
Is there some documentation on these requirements for basic_io
parsers? I found basic_io.hh and luaext_parse_basic_io.cc; not many
comments :). I searched the wiki for "basic_io" and "basic io"; I
found BasicIoFormalization, which doesn't say much, but hints at
"formal docs" somewhere.

It does point to an IRC session, which says that stanzas are not
actually meaningful. Which is a scary concept; it implies that in the
'automate inventory' output, the 'path' and 'old_node' lines are
_not_ related to each other. Which is of course nonsense!

It is not, because all existing commands emit their output in a fixed order; so the beginning and end of each stanza, and even different types of stanzas can be detected without relying on some amount of whitespace between them, and a stable parser should not (need to) do so.

I don't think this is the only valid way of looking at basic_io. Stanzas are separated by an empty line; what's wrong with (or "not stable" about) relying on that? You're suggesting to discard this information that is already available at the syntactical level just to reconstruct it later at a semantical level.


Parsing basic_io typically consists of two steps: First, breaking down the input stream into tokens (key tokens followed by zero or more value tokens), thereby striping all white space and dequoting string values. Second, reading the token stream in an application-dependend manner (see above). In this second step, you should have an idea of the meaning and the possible orderings of the key tokens.

Which basic_io parsers work this way (returning a stream of key/value tokens (that does not contain stanza delimiters) instead of a stream of stanzas)?

xmtn currently depends on stanzas being separated by an empty line as well as on the order of lines within each stanza.

Christian.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]