R++ based XML Generator.
Steven T. Hatton
hattons at globalsymmetry.com
Sat Sep 3 08:54:05 UTC 2005
On Saturday 03 September 2005 02:16, Steven T. Hatton wrote:
> I'm not sure if there's anything wrong with the current r++ AST, or if I
> just don't understand it. The approach shown above might be useful to
> someone if they do think the AST nodes should be zero-initialized. A
> factory approach might also work. Of course, they could always be
> initialized per instance when created.
On second thought, I now realize that's the problem. They ARE zero
initialized. The first token is `namespace'.
std::string XmlTree::_describeToken(size_t index, const std::string& name,
AST* node) {
return "\n"
+_functionCallString(node)
+"index:"+itos(index)+" "
+"token:"+name+" "
+describeToken(_tokenStream[index])+"\n";
}
<diagnostic>
XmlTree::visitUnqualifiedName(UnqualifiedName* node)index:0 token:tilde
kind:namespace,position:38,size:0,extra:none
</diagnostic>
Perhasp they could be set to std::numeric_limits<size_t>::max() if not used?
Or perhaps I should simply test to see if they are zero?
--
Regards,
Steven
More information about the KDevelop-devel
mailing list