sgml.g and tree structure for nested tags

Milian Wolff mail at milianw.de
Sun Aug 8 14:46:58 UTC 2010


hey Ruan,

I'm thinking about simplifying sgml.g by making it generate a list instead of 
a tree. I remember that you have asked us/me back then how to create the tree 
and put much work into it, but when I actually work with it now, I don't think 
a tree is really that good here.

Html/Xml is pretty easy after all, and the parser should just give us nodes 
with stuff like

- <!doctype
- <?xml ?>
- <opentag> (attributes, maybe empty)
- </closetag>
- CDATA
- TEXT

that's basically it. The rest should go into the ContextBuilder, i.d. open a 
context inside <opentag>, close it on </closetag>.

When doing so, we can also report proper errors when tags are incorrectly 
nested, or closed at the wrong point (or not at all).

Another point, which actually sparked my idea, is this:

<html>
<?php /* ... */ ?>
</html>

I personally would see this as HTML embedded in PHP (as the latter is the 
preprocessor). The current multilang approach hands "<html>\n" and "\n</html>" 
as two parts over to the XML language plugin, hence the AST cannot be built in 
the correct way currently. When it's simply generating a list of stuff and the 
context builder would cope with the rest as proposed above, it should work 
like a charm.

Bye
-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20100808/6e698a72/attachment.sig>


More information about the KDevelop-devel mailing list