Don't create Xtend classes with the same name as data rules [message #1639194] |
Fri, 27 February 2015 09:06  |
Eclipse User |
|
|
|
I first got my DSL working, with no small amount of help from folks on this forum, about 18 months ago. Since that time I've spent only a small amount of time updating and maintaining the DSL, so naturally I've forgotten quite a bit about how it all works.
I have created a bunch of data rules, and since my main code generator Xtend was getting quite huge, I created a bunch of new Xtend classes that handled the various code generation tasks for those specific data rules.
Somewhere along the line I got confused and gave the class the same name as my data rule. Eclipse did not complain about this, so I didn't realize I'd made a mistake until my program started acting very bizarre. The class name checking for Xtend in Eclipse doesn't seem as thorough as when writing just in Java.
For example, I have a data type rule called:
SpinComboBox
in my Xtext grammar definition.
Down in code generation Xtend, I created a SpinComboBox.xtend and within this, a class SpinComboBox. BIG MISTAKE!
I also noticed that in Xtend, I can create a file such as spcbComboBox.xtend, and within it create a class zorpComboBox and it doesn't seem to matter. In Java I'm used to file names and class names wanting to be the same, but I'm not sure if this is just a convention to reduce confusion or actually required.
I don't have a question here... just some observations. Xtext and Xtend solved a really difficult problem I had in a really great way, but it was not easy getting there. Most problems I see raised on this forum are way past anything I ever did.
Cheers!
[Updated on: Fri, 27 February 2015 09:06] by Moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03458 seconds