I'm creating a DSL with a template-like editor, much like the rule systems in Alice. Users will be able to select relationships from a list as well as the objects to apply the relation to. These two lists should be filtered based on the acceptable types -- for instance, if the relationship is "greater than" then the available objects must be of a type that "greater than" is implemented for.
Similarly, if an object is selected that is not comparable with greater than, then that relation should not be in the list of potential relations. I think the heart of this problem is a type checker, but I'm not certain of the best way to incorporate that type of logic in my application. Is anyone aware of existing type checking libraries for DSLs?
I am specifically interested in open-source and cross-platform technologies. Java is probably the language we will end up using, but that is not fixed.
A Domain-Specific Language (DSL) is a computer language that's targeted to a particular kind of problem, rather than a general purpose language that's aimed at any kind of software problem. Domain-specific languages have been talked about, and used for almost as long as computing has been done.
SQL (used for database queries and data manipulation) HTML (web application development) CSS (used for styles on web pages)
DSLs implemented via an independent interpreter or compiler are known as External Domain Specific Languages. Well known examples include LaTeX or AWK.
You might look into Scintilla. It's the editing component used by Notepad++, among other tools. It has some support for doing autocompletion, although I haven't tried using it myself, so I'm not sure how well it works. It's open source, so if it doesn't meet your needs, you can extend it without too much hassle, I think.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With