Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Grammar with significant indentation
Grammar with significant indentation [message #1705653] Tue, 18 August 2015 07:41 Go to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
Hi!

From what I can get to work, the new support for grammars with significant indentation (Python-like) is a bit simplistic compared to Python. By that I mean that each rule in a BEGIN...END block must be either on a single line or end with a BEGIN...END block. What is missing is Pythons sensitivity to brackets, making it possible to for example put a function's arguments on separate lines.

Am I missing some configuration, or is this a limitation for the current version? If the latter, is it planned to implement the unlimited version?

best regards,
Vlad
Re: Grammar with significant indentation [message #1705717 is a reply to message #1705653] Tue, 18 August 2015 13:50 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Vlad,

the default impl servers merely as a blueprint. You'd need to maintain a
stack of open brackets manually and adjust the logic in the splitting
token source.
There are no plans so far to implement that in a generic fashion.

Best,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Find help at http://xtext.itemis.com or xtext(@)itemis.com
Blog: zarnekow.blogspot.com
Twitter: @szarnekow
Google+: https://www.google.com/+SebastianZarnekow
Re: Grammar with significant indentation [message #1705719 is a reply to message #1705717] Tue, 18 August 2015 14:13 Go to previous message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
I see, thanks!

Actually what I really need at this moment is simpler: in an indented block, ignore any extra indentation. I suppose that the problem would be to reliably detect the end of the block, though. Do you think that this would be relatively easy for me to try to implement? if you can give me a hint, it would help me plan ahead without burying myself in the Xtext code Smile Thanks in advance!

best regards,
Vlad
Previous Topic:Problem in creating an Eclipse product for DSL
Next Topic:how to parse a xtext grammar
Goto Forum:
  


Current Time: Tue Mar 19 09:31:52 GMT 2024

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

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

Back to the top