From: Robert L K. <rl...@al...> - 2000-03-05 04:09:30
|
I've taken a stab at writing an XML parser for printer definitions (not that I've written a formal DTD :-) ). The files printdef.{h,l,y} represent the header, flex, and bison inputs for this. It's not in the makefile yet, and it won't be in 3.1.1 (which hopefully I'll cut tomorrow'ish). To compile it: flex -i printdef.l bison -d printdef.y cc -o printdef printdef.tab.c lex.yy.c It generates C source. [2(rlk)||{!1256}<rlkppp>/mnt/sandbox/gimp-print/print] $ cat printer.sample <printer name="Epson Stylus Photo EX" driver="escp2-ex"> <paramfunc value=escp2_parameters> <imageableareafunc value=escp2_imageable_area> <printfunc value=escp2_print> <model value=9> </printer> [2(rlk)||{!1257}<rlkppp>/mnt/sandbox/gimp-print/print] $ ./printdef < printer.sample { { "Epson Stylus Photo EX", "escp2-ex", 9, escp2_parameters, default_media_size, escp2_imageable_area, escp2_print, 100, 1.000, 100, 100, 100, 100, 1.000, 1.000 }, } -- Robert Krawitz <rl...@al...> http://www.tiac.net/users/rlk/ Tall Clubs International -- http://www.tall.org/ or 1-888-IM-TALL-2 Member of the League for Programming Freedom -- mail lp...@uu... Project lead for The Gimp Print -- http://gimp-print.sourceforge.net "Linux doesn't dictate how I work, I dictate how Linux works." --Eric Crampton |