ecore_rs

Crates.ioecore_rs
lib.rsecore_rs
version0.1.0
sourcesrc
created_at2022-12-20 13:22:09.609378
updated_at2022-12-20 13:22:09.609378
descriptionA parser for the Eclipse Modeling Framework Ecore format.
homepage
repositoryhttps://github.com/OCamlPro/ecore.rs
max_upload_size
id742341
size560,187
(ocp-red-iron)

documentation

README

ecore.rs

A parser and internal representation for the Ecore format used by the Eclipse Modeling Framework (EMF).

TODO

  • investigate type parameters for classes

  • investigate type parameters for operations

  • builtin type constructors (Vec, Option, ...)?

Input (XML) format

A few examples are available in the rsc folder, both XML and JPG.

We currently support the following abstract layout

file =
    xml_version (package)*

package =
    "<ecore:Package" ... "name" "=" string ">"
        (annotation | package | classifier)*
    "</ecore:Package>"

# a class (concrete/abstract/enum/...)
classifier =
    "<eClassifiers"
        "xsi:type" "=" string
        "name" "=" string
        "abstract" "=" string
    ">"
        (annotation | operation | structural_feature)
    "</eClassifiers>

annotation =
    "<eAnnotations"
        "source" "=" string
    ">"
        ( "<details" "key" "=" string "value" "=" string ">" )*
    "</eAnnotations>"

# a method
operation =
    "<eOperations"
        "name" "=" string
        "eType" "=" string
    ">"
        (
            "<eParameters"
                "name" "=" string
                "lowerBound" "=" nat_string
                "upperBound" "=" int_string
                "eType" "=" string
            ">"
        )*
    "</eOperations>"

structural_feature =
    "<eStructuralFeatures"
        "xsi:type" "=" string
        "name" "=" string
        "eType" "=" string
    "/>"
Commit count: 1

cargo fmt