Custom Parser for EXPRESS data modeling language
Asked Answered
C

3

2

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?

Containment answered 6/7, 2018 at 19:43 Comment(5)
You need to know its syntax. :) That's probably formally described in one of the standards documents. If you're lucky, you will have the appropriate one handy courtesy of your employer, since otherwise you'll have to beg, borrow or buy one from the ISO.Janetjaneta
@Janetjaneta The second link I shared mentions that "EXPRESS is defined in a derivative of Wirth Syntax Notation (WSN)."Containment
Yes, and the documents for EXPRESS are written in English. That's enough to get started, right? :) The second link you shared also mentions that the formal specification is found in ISO standard 10303-11:2014 which you can buy from the ISO for CHF 198. (It may be cheaper if you go to your national standards body. Or maybe not.)Janetjaneta
Assuming you're looking to parse IFC STEP files (which are defined using the EXPRESS syntax), why don't you look at some of the toolkits and libraries that already handle parsing and processing of the data files. E.g. Here are three for starters docs.xbim.net ifcopenshell.org or github.com/hypar-io/IFC-genIncest
Disclaimer: I'm involved with XBim - but my observation is there's a lot more to exchanging construction information than parsing EXPRESS files. I'd be looking to get a jump-start by building off something other organisations have built and proven rather than start from scratch...Incest
R
2

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).

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.

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.

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.

Rub answered 10/7, 2018 at 6:51 Comment(0)
D
0

Here you can find a parser for C++ implemented using Flex and Bison: oipExpress

Dumbhead answered 11/7, 2018 at 19:2 Comment(2)
iopExpress parser has some flaws. It does not function fully.Containment
When either IFC2x3_TC1.exp or IFC4.exp is provided to the parser, the parser gives an error. However, the later versions seem to work fine although I am not really sure how correct the representation is within the Schema and Entity classes.Containment
B
0

There is a parser based on in the EXPRESS2EMF project. It is not yet complete though. Currently it is still skipping constraints (aka where rules) and some EXPRESS language constructs that are not used in IFC specifications.

Bullhead answered 27/11, 2020 at 20:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.