miho / VMF-Text

Powerful Grammar-based Language Modeling Framework
Apache License 2.0
10 stars 0 forks source link

Allow Rule/Model Rerwriting #1

Open miho opened 6 years ago

miho commented 6 years ago

Currently, VMF models are directly derived from the grammar. Usually this is a good thing. But sometimes it is preferable to simplify the API and flatten the generated model. While some aspects, such as inheritance, can already be modified, many aspects are currently not modifiable. In addition to type-maps rof lexer rules like

TypeMap() {
    HEX_FLOAT_LITERAL    -> java.lang.Double via (
        'java.lang.Double.parseDouble(entry.getText())',
        'java.lang.Double.toHexString(entry)'
    )
}

we should probably allow parser rule maps.