1 个不稳定版本
| 0.1.0 | 2022年12月20日 | 
|---|
#1699 in 解析器实现
270KB
 3.5K  SLoC
ecore.rs
Ecore格式(由Eclipse建模框架(EMF)使用)的解析器和内部表示。
待办事项
- 调查类的类型参数
- 调查操作的类型参数
- 内置类型构造函数(Vec,Option,...)?
输入(XML)格式
在 rsc 文件夹中有一些示例,包括XML和JPG。
我们目前支持以下抽象布局
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
    "/>"
依赖关系
~2.4–3.5MB
~60K SLoC