lutaml / expressir

Ruby parser for the ISO EXPRESS language
3 stars 3 forks source link

Parse the EXPRESS language #2

Closed ronaldtse closed 4 years ago

ronaldtse commented 4 years ago

Here's an example of Annotated EXPRESS: https://github.com/metanorma/annotated-express/blob/master/data/resources/aic_curve_swept_solid/aic_curve_swept_solid.exp

We want to parse it into a model like this using Parslet: https://github.com/metanorma/annotated-express/blob/master/data/resources/aic_curve_swept_solid/aic_curve_swept_solid.xml

e.g.

module Express
  class Schema
    attr_acessor :name
  end

  class Interface
    attr_acessor :type # use, schema, name
  end

  class Entity
    attr_accessor :supertypes, :name
  end

  class Where
    attr_accessor :expression, :label
  end

  class RemarkTag
    attr_accessor: content
  end
end

The EXPRESS syntax is briefly described here: http://www.geocities.ws/schulerrw/express/EXPRESS_data_modeling.pdf

It is fully described in ISO 10303-11, which I will find.

ronaldtse commented 4 years ago

The express model is already available in Ruby at https://github.com/lutaml/reeper/blob/master/lib/reeper/express_parser.rb . This parser currently only parses EXPRESS XML (the original .exp that has been converted into .xml), not the original EXPRESS code (.exp)

The goal is to write a Parslet to be able to parse .exp.

ronaldtse commented 4 years ago

The EXPRESS reference manual is available at https://github.com/metanorma/iso-10303/tree/master/reference-docs/pdfs

ronaldtse commented 4 years ago

This is now handled by @zakjan .

ronaldtse commented 4 years ago

Completed in #10