AutoCAD DXF parser skeleton, DXF-to-POV (C,C++,win)

Description

MinGW compiled executables with sources [windows 32+64-bit]).

The project is under the GPL3 license and is available as a dxftopov.zip file. lsm file.

Download Now
dxftopov.zip (version 0.1.5, 12/9/2008)


project status

This project is unfinished. If someone starts coding in it, it it will probably progress beyond my ability to maintain it (but at least it will be done). I have some 1993-era test files. I hope you have more recent test files.

What I have done here so far includes:

This project is based on what information I could get for free: the Autocad DXF Reference for Autocad 2009. Please note that this is *not* a formal specification document and certainly doesn't read like one. (I could really use a DXF spec if I could get it if anyone can help me). Critical information for software development is missing from the reference, information is left dangling with no instruction on what to do with it, and a number of descriptions are vague. The lexical analyzer works on real autocad files dated 1993 - sorry it's all I have. I have tried it on >100 nearly-similar files that I was able to scrounge from an old windows 3.1 Virtual Reality program, and it reads all the way until the end and finishes properly with 0 END. Because Virtual Reality is a commercial program, the DXF sample files are not licensed for me to distribute with the zip file. The parser fails on all of the test files and I don't know why. All I can get so far from the parser is a pass/fail response. I don't seem to be able to get at the error tokens.

The DXF Reference doesn't appear to contain rigorous sequencing information. All I know from reading it is that any code can follow from any code with a few exceptions.

PARSING: I have no clue how to get from a Autocad syntax tree in memory to POV output. walking that tree is going to be a real pain. So at this point, the parser will be pretty much half-done if I can get that far. I haven't written a compiler in years. Currently the best I can do is create a deque of tokens that can be walked (and cleared). because of the way yytext works, I am unable to get the tokens I want when the semantic analysis is done. yytext gives you all the text from the last token in a desired sequence to the end of file. what would be best for me is if it started at the beginning of the sequence - then I could extract what I want. I am speaking of the C version of the code, which is in win\c\ and only compiles under gcc/djgpp (Borland C++ 5.5[.1] doesn't like it).

The C++ code includes a working hand-coded C++ lexer (lexical_analyzer), however, I have not fully interfaced it to bison yet. it handles binary files (with the exception of booleans, which I could not get proper specs on).

CONVERSION: I do not know exactly what objects I can convert directly to POV-RAY in 3D, except:
Since I know nothing about Autocad, I could use some help here if someone has the knowledge.