Generic DSL based on POJO [message #1172970] |
Wed, 06 November 2013 02:40  |
Eclipse User |
|
|
|
Hi All,
I have a requrement like this to be developed with XText
I have set of POJO classes like, (couldnt draw a diagram for this, hope this is clear enf)
<< A_POJO >> ------- Level 1
<< B_POJO extends A_POJO >> ------- Level 2
<< C_POJO extends A_POJO >> ------- Level 2
<< D_POJO extends C_POJO >> ------- Level 3
<< E_POJO extends C_POJO >> ------- Level 3
<< F_POJO extends C_POJO >> ------- Level 3
And then I will have this POJO classes in my class path of the eclipse where i developing this DSL. And my chalage is the developa grammer file looks like
<<B_POJO or child class of it>> name=ID {
[
<<C_POJO or child class of it>> name=ID {Attribute of <<C_POJO>>}
<<C_POJO or child class of it>> name=ID {Attribute of <<C_POJO>>}
<<C_POJO or child class of it>> name=ID {Attribute of <<C_POJO>>}
<<C_POJO or child class of it>> name=ID {Attribute of <<C_POJO>>}
<<C_POJO or child class of it>> name=ID {Attribute of <<C_POJO>>}
]
}
Sample
User xx {
[
vField userName {length=25}
vField firstName {length:50}
vField otherNames {length:100}
vField password {length:25}
vField email {length:100}
]
}
Any idea is really appriciated
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.15617 seconds