Re: Re: software design clarification

Stefan Seefeld <[email protected]> Wed, 02 May 2007 06:49:44 -0400
Newsgroups gmane.comp.documentation.synopsis
Message-ID <[email protected]>
Eric M. Hopper wrote:
> On Tue, 2007-05-01 at 13:39 -0400, Stefan Seefeld wrote:
>> It may not be that bad as a storage format (Markus was asking for an
>> in-memory representation he could apply XPath queries to). The only
>> immediate argument that comes to mind is its verbosity (as usual).
> 
> Oh.  Well, near as I can tell, you can apply XPath queries to nearly
> anything tree-like.  But, yes, XML is a horrible internal format.

Huh. You may apply something 'XPath-like' to anything 'tree-like'.
So what ? What does that tell ?
XPath is a very specific language for a well defined domain.

Symbol lookup in the context of C++ has its own syntax and semantics.

>> Parse trees don't have references, usually (or else they weren't
>> trees, but graphs). References need to be created externally when
>> interpreting a parse tree.
> 
> Hmm, so what happens when an identifier is referenced in one part of the
> parse tree that was declared in another?

Nothing. The 'reference' merely exists as an identifier being used that
is declared elsewhere. Whether that reference is valid, or which id
is really being referred to only semantic analysis (such as symbol
lookup) can tell.
C++ is particular in that a lot of that semantic analysis has to happen
at parse time, i.e. can't easily be deferred to latter stages.
However, that doesn't mean this information has to become part of the
parse tree. There are other representations that will be generated by
the parser.

Regards,
		Stefan

-- 

      ...ich hab' noch einen Koffer in Berlin...