Jean-Marc Lasgouttes wrote: >>>>>> "Andre" == Andre Poenitz <[EMAIL PROTECTED]> writes: > >>> What would this 'intermediate' format be? > > Andre> Basically .lyx but with some 'could be either a layout or > some Andre> ERT' bits. > > Another solution would be to precompile layout files into a > dumbed-down version for tex2lyx, but I am not sure this is worth the > effort. > > Or splitting properly the parts of LyX that are also needed by > tex2lyx into some library.
I'm pretty sure we could split the parser of the layout file from the structure to which the data is applied by using boost::bind. Or indeed, if we ventured down the boost::spirit parser path, by using it's in-built bind called phoenix. Other than that, the remaining code is pretty trivial. -- Angus