[SDL] XML Parser

Donny Viszneki donny.viszneki at gmail.com
Thu Apr 16 08:01:37 PDT 2009


On Thu, Apr 16, 2009 at 7:42 AM, Peter Ross <pross at xvid.org> wrote:
> On Wed, Apr 15, 2009 at 01:41:17PM +0100, Tim Angus wrote:
>> Peter Ross wrote:
>>> For give me for sounding naive, but why do we need XML 'parsers' anyway?
>>> What ever happened to using lex/flex and yacc/bison to parse content?
>>
>> Why write the same (XML) parser over and over, when you can just use a
>> ready made one? I'm all for using flex/bison for a new language, but
>> it's daft to reinvent the wheel for something that is already extremely
>> well specified, deployed and understood.
>
> The beauty of flex and bison is that *they* write the parser for you.

Your response, Peter, belies the obvious fact that in casual parlance,
you still write a parser using these tools. Yes, these tools help you
do the task, but consider it in context: cannot something called an
"XML parser" ostensibly be a tool to help parse XML as lex is a tool
to help parse a wider domain of inputs?

>> Ignoring this point completely there are also other benefits to using a
>> specific XML parsing library such as the footprint being smaller and
>> having much more targetted features. You'd struggle to get bison to
>> validate XML documents against a specific schema without a fair chunk of
>> work, for example.
>
> Scripts exist to automate the generation of flex and bison input files.
> These tools, however are not very mature.

Could you elaborate more on this?

-- 
http://codebad.com/



More information about the SDL mailing list