提出了一种有效解析DXF文件的新方法,新颖之处在于包含了从特定领域建模过程获取的模型中自动生成代码思想。它基于开源的Boost Spirit解析器框架,举例阐释了本技术。结果表明,与通常的纯手工编码方法相比,其代码倾向于更加简洁、高效和优雅。本技术可广泛应用于其它CAD/CAM数据文件格式的解析处理。%In this paper, we present a new method to parse DXF files, which features the idea of auto code generation from the DSM models. It's based on the open-source Boost spirit parser framework. A coding sample has been used to demonstrate the proposed technique. Results show that compared with classical pure-manual coding techniques it will make program codes incline to more simple, efficient and elegant. Moreover, this technique can be applied extensively to parsing of many other CAD/CAM files.
展开▼