From: Lars H. <lhe...@us...> - 2004-05-26 14:59:30
|
Fr=E9d=E9ric Mantegazza writes: > Hello there, >=20 > I'm working in a french research institute, with a guy who is writing a= nice=20 > GUI for Gnuplot. This GUI is written in wxPython, and is oriented for=20 > people who want to analyse data, ie who want to make fit functions, plo= t=20 > datas and have them fitted. >=20 > This guy would like to be able to parse a gnuplot script. He started to= =20 > write a parser in python, but as gnuplot as a very large set of=20 > commands/options, it is not very easy. >=20 > My question is: do you think it could be possible to get the C parser u= sed=20 > in the source of gnuplot, run swig on it, add some little code around, = and=20 > get a usable parser ? I mean, is the C parser of gnuplot store the resu= lt=20 > of a command line in a structure which can be used easily ? =20 The gnuplot parser is essentially a full-custom job, and it's spread acr= oss several source files. E.g. every single .trm file has its own parser for terminal options, and in general every source module has its own parser = for the options it provides. A number of years ago, I started to move towards a table-driven parser, but got stuck somewhere along the line (the plot command is particularil= y nasty in this regard ...). What I would like to have is a lex/yacc based scanner/parser for gnuplot= . This would allow to put it into its own module, and let other apps use i= t. But I think no-one here has the skills to write one. |