#eclipse #emf #ecore

ecore_rs

A parser for the Eclipse Modeling Framework Ecore format

1 unstable release

0.1.0 Dec 20, 2022

#1900 in Parser implementations

LGPL-3.0-or-later

270KB
3.5K SLoC

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
    "/>"

Dependencies

~2.4–3.5MB
~61K SLoC