Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Recursive Grammar
Recursive Grammar [message #1043564] Wed, 17 April 2013 21:55 Go to next message
junior developer is currently offline junior developerFriend
Messages: 354
Registered: January 2013
Senior Member
Hi all ,
I can try nested task without any seperator.(for example dont use comma or curly bracket)My grammar is below.Solved ambiguity with => sembol.but I want to breaked output ( such as example output
A
B
C
D
E
My grammar output is in the Attachment. Tasks is nested everytime .How can I solved this problem ? I try some method but can not succesful.
Todo :
'task' name =ID
( root += Task* )?;
Task:
'task' name=ID
(=> tasks+= Task )*
;

Best Regards
Re: Recursive Grammar [message #1043787 is a reply to message #1043564] Thu, 18 April 2013 05:56 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
HI,

(1) first your grammar does not fit to the model.
(2) in your grammar a task can contain subtasks
(3) what shall be the the criterial to start a new todo?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Recursive Grammar [message #1043805 is a reply to message #1043787] Thu, 18 April 2013 06:35 Go to previous messageGo to next message
junior developer is currently offline junior developerFriend
Messages: 354
Registered: January 2013
Senior Member
Hi Christian,

My aim is to generate a language which accepts a program like:

 task t1
            task t2
                 task t3
            task t4
                 task t5
        task t6


Do you have any suggestion for the grammar of this language?

Best Regards
Re: Recursive Grammar [message #1043818 is a reply to message #1043805] Thu, 18 April 2013 06:54 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

there a some threads about indention based grammars. you may have a loot there but it will not be an out of the box solution


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Problem customizing the outline
Next Topic:JDT dependencies in Xtext 2.4?
Goto Forum:
  


Current Time: Thu Mar 28 20:13:31 GMT 2024

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

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

Back to the top