Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: XML
Home

[Freeciv-Dev] Re: XML

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Petr Baudis <pasky@xxxxxxxxxxx>, "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: XML
From: Andrew Sutton <ansutton@xxxxxxx>
Date: Fri, 7 Dec 2001 09:30:52 -0500

now i have to throw in my two cents...

On Friday 07 December 2001 06:44 am, Petr Baudis wrote:
> Dear diary, on Thu, Dec 06, 2001 at 11:37:01PM CET, I got a letter,
> where "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx> told me, that...
>
> > I've done a bit XML and XSLT (XML transformations) for my employer, and I
> > agree that it is extremely verbose for what it does, _but_ I also think
> > that freeciv would be much better off with XML than any arcane flex/bison
> > or homebrewed solution.
>
> What's arcane on flex/bison? :)

see: ACM Crossroads: Why Bison is Becoming Extinct 
http://www.acm.org/crossroads/xrds7-5/bison.html

> Learning? Well, I already made parsers for C-like formats and it should be
> relatively easy to reuse them in FreeCiv. I will give them if someone will
> want them, as I'm myself interested rather in AI for now.
>
> >                                                    It is also the most
> > multiplatform solution there is.
>
> Hmm, flex/bison is pretty portable :).

flex and bison actually have interoperability issues with lex/yacc that can 
make porting to non-GNU systems a little tougher. see the flex/bison man page 
and texinfo for incompatibilities... actually, on a side note flex isn't even 
GNU or being actively maintained. i don't know about bison.

> > Things you can do with the rulesets with XSLT off the top of my head:
> >  - automagically create documentation for modpacks
> >  - automagically create tech trees from modpacks
>
> Easy with scripts or wrappers for parser.

pretty much... all this automagical stuff is still going to mean using an 
alternate backend for something - either DOM or a parser.

> >  - edit them in Emacs and other XML editors with validation
>
> Well, you have a validation in the parser itself. And you can make
> syntax file which can easily act as validator (at least in vim, no clue
> about other editors like emacs).

you could build a mode for (x)emacs. i don't think it would be too hard, but 
i really wouldn't know since i've never done it before.

> >  - run syntax validation tools on any platform or through a web page
>
> Any point in that? :)

good question.

both cases have their weak points. xml isn't very expressive and it's not 
really mean to be. writing your own parser will provide a more specialized 
language but is going to be a pain in the ass - regardless of how easy it is 
or how much experience anybody has.

that's it... that's my two cents. end result: i'd use xml before i'd write my 
own language, but if i needed something a little more functional, i'd 
investigate embeddedable scripting languages (tcl, et. al).

andy


[Prev in Thread] Current Thread [Next in Thread]