|
|
Re: XText Attribute Order [message #652600 is a reply to message #652594] |
Fri, 04 February 2011 16:32 |
|
On 02/04/2011 05:26 PM, Jesse wrote:
> Hi there,
>
> I'm working on a prototype DSL for Eclipse e4 UIElements. It's looking
> okay, but one thing that I can't seem to figure out is how to let users
> define attributes in any order.
>
> eg.
> Command returns commands::Command:
> {commands::Command}
> 'Command'
> elementId=EString
> '{'
> ('category' category=[commands::Category|EString])?
> ('commandName' commandName=EString)?
> ('contributorURI' contributorURI=EString)?
> ('description' description=EString)?
> ('parameters' '{' parameters+=CommandParameter (
> parameters+=CommandParameter)* '}')?
> ('tags' '{' tags+=EString ( tags+=EString)* '}')?
> '}';
>
>
> When trying out the DSL, attributes can only be defined in the order
> that is specified above (eg. if you want to define category, then it
> MUST be defined first). I'd like to be able to define them in any order.
> Is there a way to do this? It seemed to be causing a lot of confusion at
> first, so I sorted all attributes in alphabetical order as a
> "workaround", but that's not good enough.
> Any help would be much appreciated!
>
> Thanks.
>
> - Jesse
>
could "unordered groups" help you?
see http://www.eclipse.org/Xtext/documentation/1_0_1/xtext.html
cheers
Lorenzo
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
|
Re: XText Attribute Order [message #652613 is a reply to message #652594] |
Fri, 04 February 2011 17:23 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Jesse,
are you aware of https://github.com/meysholdt/e4dsl ?
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 04.02.11 17:26, schrieb Jesse:
> Hi there,
>
> I'm working on a prototype DSL for Eclipse e4 UIElements. It's looking
> okay, but one thing that I can't seem to figure out is how to let users
> define attributes in any order.
>
> eg.
> Command returns commands::Command:
> {commands::Command}
> 'Command'
> elementId=EString
> '{'
> ('category' category=[commands::Category|EString])?
> ('commandName' commandName=EString)?
> ('contributorURI' contributorURI=EString)?
> ('description' description=EString)?
> ('parameters' '{' parameters+=CommandParameter (
> parameters+=CommandParameter)* '}')?
> ('tags' '{' tags+=EString ( tags+=EString)* '}')?
> '}';
>
>
> When trying out the DSL, attributes can only be defined in the order
> that is specified above (eg. if you want to define category, then it
> MUST be defined first). I'd like to be able to define them in any order.
> Is there a way to do this? It seemed to be causing a lot of confusion at
> first, so I sorted all attributes in alphabetical order as a
> "workaround", but that's not good enough.
> Any help would be much appreciated!
>
> Thanks.
>
> - Jesse
>
|
|
|
Powered by
FUDForum. Page generated in 0.03567 seconds