Open delostilos opened 1 year ago
Maybe we can use https://langium.org to help create the DSL.
Langium looks really promising, but their documentation is still lacking in some respects. See https://github.com/langium/langium/issues/725.
There's also https://pest-parser.github.io/, which I have used before, but may be incompatible with VSCode?
The following parser grammar works there:
model = { (entity | relationship)* }
// built-in removal
WHITESPACE = _{ " " | "\t" | "\r" | "\n" }
digit = _{ '0'..'9' }
name = ${ ASCII_ALPHA_UPPER ~ (CASED_LETTER | digit | "_" )* }
role = ${ ASCII_ALPHA_LOWER ~ (CASED_LETTER | digit | "_" )* }
attribute = { "attribute" ~ name }
entity = { "entity " ~ name ~ (attribute)* }
relation = { (name ~ role) | (role ~ name) }
relationship = { "relationship " ~ (relation)+ }
For the following DSL:
entity Customer
attribute Name
attribute Surname
entity Product
attribute Name
entity Store
attribute Name
relationship Customer bought the Product in Store
If we have a DSL like proposed in #224 , then we can create a VS Code plugin that offers a hybrid editing possibility in text and in the GUI. Like is done in the bigER plugin https://modeling-languages.com/hybrid-textual-graphical-er-modeling-vscode/