Re: DXF parser in lex/yacc?

Reini Urban <>
18 Feb 1998 23:07:35 -0500

          From comp.compilers

Related articles
DXF parser in lex/yacc? (Andrew Ellerton) (1998-02-15)
Re: DXF parser in lex/yacc? (Reini Urban) (1998-02-18)
| List of all articles for this month |

From: Reini Urban <>
Newsgroups: comp.cad.autocad,comp.compilers
Date: 18 Feb 1998 23:07:35 -0500
References: 98-02-074
Keywords: parse, syntax

Andrew Ellerton <> wrote:
>I've poked around news group archives, lists of freely available
>parsers/compiler tools and the Autocad site - if there is a lex/yacc parser
>for DXF available, I can't find it.

The DXF syntax is trivial. You may write your own yacc if you really
need it in 6 lines but I doubt. yacc is overkill for DXF.

I suggest writing your parser by hand:
There are always pairs of two lines, the first is a number, the second a
value according the number.
The whole mess is split up in 4 sections:
    header, tables, blocks and entities
with some subsections.

I successfully wrote a parser in perl in 3 minutes which deletes all
the handles, for Forth there is DXFIX.DXT in your support dir, and in
the handbook are basic examples.
Really simple.
-- Reini Urban
AutoCAD stuff at

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.