Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Simple example - generation problem(Simple example - generation problem)
Simple example - generation problem [message #1109524] Sun, 15 September 2013 15:01 Go to next message
Toni Siljamäki is currently offline Toni SiljamäkiFriend
Messages: 6
Registered: November 2012
Junior Member
Hi there.
Attached is an example for a very simple DSL.
The generated Example.ecore get exactly the way I want it,
but I get a generation error for the Unit rule.
The only workaround I have found is to add a dummy-keyword
in the Unit rule, but there is no such keyword in the DSL.
Does anyone know what the problem is ???
I have installed the latest XText update.
/Toni

SIMPLE DSL:

Model:
parts+=Part*
;

Part:
unit=Unit
;

Unit:
{Unit} elements += Element* // DOES NOT WORK !!!
// {Unit} 'dummy' elements += Element*
// {DoesNotComplainAboutThis} 'dummy' elements += Element*
;

Element:
Seqment1 |
Seqment2
;

Seqment1:
name=ID ';'
;

Seqment2:
name=ID ';;'
;


THE ERROR MESSAGES:

warning(200): ...Decision can match input such as "{EOF, RULE_ID}" using multiple alternatives: 1, 2

error(201): ...The following alternatives can never be matched: 2

warning(200): ...Decision can match input such as "RULE_ID" using multiple alternatives: 1, 2

Re: Simple example - generation problem [message #1109527 is a reply to message #1109524] Sun, 15 September 2013 15:09 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
Hi if you have 2 segments do you have one or two parts ?

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Simple example - generation problem [message #1110053 is a reply to message #1109527] Mon, 16 September 2013 09:49 Go to previous messageGo to next message
Toni Siljamäki is currently offline Toni SiljamäkiFriend
Messages: 6
Registered: November 2012
Junior Member
Hi Christian.
Two individual SegmentX which are not part of the same Unit sits in two separate Parts.
Part and below is an obfuscated real-world example - Example.ecore is correct.
Model is just an invented placeholder for parts, at this point.
/Toni
Re: Simple example - generation problem [message #1110107 is a reply to message #1110053] Mon, 16 September 2013 11:32 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
Hi I ask from grammar point of view. How shall the parser decide this

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Generating Graphical AST
Next Topic:Xtext editor for lightweight markup language
Goto Forum:
  


Current Time: Mon Sep 23 10:43:42 GMT 2024

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

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

Back to the top