| Using Xtext and Xtend [message #816120] |
Thu, 08 March 2012 07:54  |
terry tonery Messages: 34 Registered: February 2012 |
Member |
|
|
Hi,
I read Xtend User Guide and examine Xtend examples but I could not decide where to start. I defined my own DSL with Xtext. Now I want to complete a textual editor. With the help of defined Xtext a grammer a user can create an instance model. I want to put some constraints to this model. For example, there is an element with type type1. I want to constraint the user to create only two instance elementes of type1.
For example:
main: (type1|type2)*
type1: name=ID;
type2: name=ID;
instance model:
type1instance1;
type1instance2;
If the user creates one more type, the editor must give an error.
I want to do such constraints and I could not decide what must I do. Can I supply it with Xtend. If yes how? Is there any documentation except Xtend User Guide?
Thank you very much.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Re: Using Xtext and Xtend [message #849828 is a reply to message #849808] |
Thu, 19 April 2012 09:37   |
Michal S Messages: 73 Registered: July 2011 |
Member |
|
|
Are all following files: Main.java, MyDslFactory.java, MyDslPackage.java, Type1.java, Type2.java present in your src-gen folder (in org.xtext.example.mydsl7.myDsl package?)
If yes, the classes must be available in Validator.
If not, generation failed. There must be something wrong in your grammar or in workflow.
Michal
[Updated on: Thu, 19 April 2012 09:38] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02685 seconds