0
votes

I am new to xtext. I need to implement the grammar for my below requirement.

Book{
   Author
   price
   ...
}

I have one class called Book and have fields like Author, price etc. I can create any number of book instances. I am creating package for Book in xtext grammar, as soon as I press control+space I am displaying all Book instances and can select required Book instance from dropdown.

now my requirement is when I select any Book instance the corresponding Author name and Price should be inserted with values automatically in xtext editor. I am storing data in xml.

Eg..

Book Book1{
Author : XXXX
Price  : 10$
...
}

can any one have a solution how to achieve this.

Thanks in Advance.

1
what have you tried so far? - SamHoque

1 Answers

0
votes

Sounds like what you are after is Template proposals.