Am Samstag, 16. Juni 2007 06:31 schrieb hzluo:

> 2. I also dislike current tex2lyx structure. But I also
>    dislike the idea of python script. If let me make the
>    choice, I will choose flex, or flex+bison. Flex syntax
>    is extremely suitable for parsers, for both programming
>    and maintenance. I don't see any advantage of python
>    at this point. Certainly, flex in it's original state
>    is not suitable to be used to develop tex2lyx. We need
>    several distict features that are not supported by
>    original flex. But we can make our improved flex.
>    And it's not difficult at all. I believe we just need
>    to have a new template for the code generation. I have
>    used flex as this way, and I have a template that is
>    able to support true C++ lexer, abstract input/output,
>    etc. If needed, I can distribute my work to this community
>    and make some improvements to satisfy the tex2lyx needs.
>    And, another benefit of flex is speed. I assure it will
>    be much faster than current C++ code.

I have used flex in the past, and it is really a great tool for writing 
parsers. The problem is that you need a grammar for these tools, and it is 
impossible to construct one for TeX/LaTeX.
Believe me, the basic TeX parser in tex2lyx is quite good, and if you can 
use a tool like flex at all you will still need to add a lot of manual 
code.
Improving the speed of the existing code should be easy, speed issues have 
been almost ignored for now.

> 4. As of incorrect file format, my idea is, if "tex2lyx+lyx2lyx"
>    produces correct output, we can think it's OK.

IMO no. This approach has caused troubles with relyx in the past.

>    Because we always 
>    go "tex2lyx+lyx2lyx". If needed, we can call lyx2lyx in tex2lyx,
>    so that the final output of tex2lyx is absolutely valid.

That would be an interesting intermediate option, but it would need to be 
well documented at the places where future stuff is written to the file.

>    And in 
>    this way, the encoding problem is also solved.

The encoding problem is not solved, because tex2lyx implicitly assumes 
latin1 encoding in a few places and can only convert some files in other 
encodings.


Georg

Reply via email to