EXPRESS 数据建模语言的自定义解析器 [英] Custom Parser for EXPRESS data modeling language

查看:106
本文介绍了EXPRESS 数据建模语言的自定义解析器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要为 EXPRESS 编写一个自定义解析器 - 提到它是一种数据建模语言,用于为 CAD 软件定义和传递构造信息.以下是一些资源:

I need to write a custom parser for EXPRESS - which is mentioned to be a data modeling language that is used to define and pass construction information around for CAD software. Here are couple resources:

https://en.wikipedia.org/wiki/EXPRESS_(data_modeling_language)https://www.loc.gov/preservation/digital/formats/fdd/fdd000449.shtml

好吧,我需要为这种数据建模语言"设计一个自定义解析器.但是,我不知道在开始实现一个像样的解析器之前需要注意哪些细节.在决定如何解析和以有意义的方式表示之前,我应该以何种方式分析这种基于文本的格式?

Well, I need to come up with a custom parser for this "data modeling language" . However, I have no idea what specifics I need to pay attention to before I can start implementing a decent parser. In what ways should I analyze this text-based format before deciding how to parse it and represent it in a meaningful way?

关于这种数据建模语言"及其语法,我需要特别了解什么,以便我能够提出合理的解析器?

What do I specifically need to know about this "data modeling language" and its syntax so that I can come up with a reasonable parser?

推荐答案

在 Backus-Naur-Form 中有对 EXPRESS 语言的描述 在 github 上.有一些工具可以在 BNF 中获取描述并从中生成解析器(例如 bisonboost::spirit).

There are descriptions of the EXPRESS language in Backus-Naur-Form on github. There are tools that take a description in BNF and generate a parser from it (for example bison or boost::spirit).

这些将为您提供该语言的工作文本解析器.下一步是为解析的文本赋予意义.EXPRESS 通常描述一个类层次结构和某些约束,因此您需要使用从解析器获得的标记对其进行建模.

These will give you a working text parser for the language. The next step is to give the parsed text a meaning. EXPRESS usually describes a class hierarchy and certain constraints, so you will need to model that with the tokens you get from the parser.

您可能想查看现有的实现,例如 stepcode.他们有一个 EXPRESS 解析器,它接受 EXPRESS 模式并生成一个 STEP 解析器,它可以加载由 EXPRESS 模式描述的文件.

You might want to take a look at existing implementations, for example stepcode. They have an EXPRESS parser which takes the EXPRESS schema and generates a STEP parser which can load files described by the EXPRESS schema.

您应该知道 EXPRESS 和 STEP 是非常强大和广泛的工具,因此您应该考虑使用/修改现有的实现,而不是滚动自己的实现.

You should know that EXPRESS and STEP are very powerful and extensive tools, so you should consider using/modifying existing implementations instead of rolling your own.

这篇关于EXPRESS 数据建模语言的自定义解析器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆