views:

113

answers:

1

I have defined a small DSL that is mostly written in the form of different types of XML files in conjuction with some property files. This works very well but I wish to create an Eclipse Editor to make editing these files easier for beginners (I already have a working parser).

The main XML file can reference some items from the .properties files and vice-versa. THe main xml file can also reference other XML files. Certain options should only be available in the main xml file based on the contents of the .properties files and based on some osgi plugins that can be added to the DSL project (the syntax is dynamic depending on context). The structure of the language is fixed but the options available in each attribute or the choice of attributes themselves changes depending on metadata contained in plugin .jar files.

Questions:

Does XText support dynamic syntax (validation changes depending on external factors)?
Does XText support XML files / .properties files?

Thank you very much for your help in advance.

+1  A: 

Please read the Xtext documentation.

Does XText support dynamic syntax (validation changes depending on external factors)?

Xtext automatically validates the syntax using the grammar definition. Additionally, you can write arbitrary validations in Java or Check.

Does XText support XML files / .properties files?

If you define a grammar for them, of course. ;) Neither of them are too difficult.

thSoft
I delayed this development for a little while, but I still can't find any sample grammar for XML-type languages and have started and stopped several times without knowing how to define an xml grammar. I looked at the XText documentation but I can't figure out how to model something as complex as an xml type grammar with all of its optional parts whilst specifically only supporting my model of choice.If there were a XText grammar for Spring XML config files I guess that would be the closest comparison.If you could point me in the right direction it would be much appreciated.Thanks,Chris
Chris