views:

565

answers:

3

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.

+2  A: 

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.

A: 

This might help on the intellisense side - CodeTextBox

benPearce