Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Manually Maintained Metamodel
Manually Maintained Metamodel [message #878570] Tue, 29 May 2012 10:41 Go to next message
Eclipse UserFriend
hi,
a) could someone give me a hint where manually maintained metamodels are explained in xTexts documentation?

b) Are there examples using metamodel first, then textual DSL (eBNF)?

c) Does xText leverage the abstract syntax of the metamodel? And if, how?
Re: Manually Maintained Metamodel [message #878589 is a reply to message #878570] Tue, 29 May 2012 11:14 Go to previous message
Eclipse UserFriend
On 2012-29-05 16:41, Stefan Kuhn wrote:
> hi, a) could someone give me a hint where manually maintained metamodels
> are explained in xTexts documentation?
>
> b) Are there examples using metamodel first, then textual DSL (eBNF)?
>
> c) Does xText leverage the abstract syntax of the metamodel? And if, how?

There are two ways to start; you either have an existing model you want
to create a concrete textual representation for, or you are creating a
new language (i.e. textual representation of a model).

When creating a new language, it is typical to start with a model that
is generated from the grammar. This is convenient for smaller languages
and while exploring options in a more complex language. After a while,
you typically want to switch to a manually maintained model (you can
start by simply copying the generated model). You want to do this, as
you want to prevent small changes in your grammar to have a potentially
dramatic effect on your model and then breaking lots of code you written
against the model.

A manually maintained model is also required if you want to be able to
specify things not expressed in the grammar, or deal with EMF "settings"
that are not available.

Basically, what you have to know is that features and containment
references are directly assignable, and non containment references are
links.

The best way to learn is to use a toy language and look at what is
generated.

Hope that helps you.

How Xtext generates the meta model is covered in the documentation.

Regards
- henrik
Previous Topic:Can't get 5 minute tutorial to build
Next Topic:Xtext C grammar
Goto Forum:
  


Current Time: Sat Jul 05 15:09:24 EDT 2025

Powered by FUDForum. Page generated in 0.07536 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top