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: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: XML
From: Vasco Alexandre Da Silva Costa <vasc@xxxxxxxxxxxxxx>
Date: Fri, 7 Dec 2001 14:47:30 +0000 (WET)

On Fri, 7 Dec 2001, Andrew Sutton wrote:

> 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...
> >
> > What's arcane on flex/bison? :)
> 
> see: ACM Crossroads: Why Bison is Becoming Extinct 
> http://www.acm.org/crossroads/xrds7-5/bison.html

I guess i'll read that as soon as i reach a place with a browser :-)

> > 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.

I've used them in Solaris and they are useable in Windows too. flex and
bison have compatibility modes that diminish those problems.
I dunno if flex isn't being maintained but that is probably because it
hasn't much room for improvement. It may not be GNU but RMS himself
contributed to it. And bison is GNU indeed.

IIRC RMS used flex and bison to make gcc. I assume gcc still uses flex and
bison so i guess they must work at least in the platforms gcc does.

You can generate a parser in C code using those tools. No need for the
flex lib.

> > > 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).

Agreed. However i think that if we use any scripting language it must be
compilable as an option so standard scripts can be made faster. Unless the
language is used in very limited things.

---
Vasco Alexandre da Silva Costa @ Instituto Superior Tecnico, Lisboa



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