Re:XML: Contrary to popular belief, it doesn't always kill b...
by _delirium on Saturday February 19, 2011 @08:18PM
(#2240580)
The fact that you can't parse it with standard parsing tools doesn't seem like a win on the parseability front either. Not its biggest problem, but nothing in this use-case made it necessary to define a syntax that tools like lex/yacc can't parse. The core problem is that matching up start/end tags can't be done in a context-free language unless there are a finite number of tags (it's isomorphic to the problem of checking for palindromes). You'd need a parser-generator that lets you do backreferences (which makes it not context-free), so you could write a definition along the lines of:
Either that, or a hand-rolled parser, which is in practice what XML parsers are.
[ Parent
| on HN ]
There are no comments on this comment yet.