Roenbaeck / anchor

Anchor Modeler is a database modeling tool for creating database models that handles temporalization using the sixth normal form.
http://www.anchormodeling.com
Other
90 stars 24 forks source link

Feature - should we create an Anchor model VS Code/Theia plugin? #225

Open delostilos opened 1 year ago

delostilos commented 1 year ago

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/

delostilos commented 1 year ago

Maybe we can use https://langium.org to help create the DSL.

Roenbaeck commented 1 year ago

Langium looks really promising, but their documentation is still lacking in some respects. See https://github.com/langium/langium/issues/725.

Roenbaeck commented 1 year ago

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