Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Python inspire language in Xtext?
icon2.gif  Python inspire language in Xtext? [message #921135] Sun, 23 September 2012 21:40 Go to next message
Richard Cookman is currently offline Richard CookmanFriend
Messages: 7
Registered: May 2011
Junior Member
I'm looking to start a language where the positioning of elements is important. I.e. the white space is important to signify the control flow in the language.

So far my experience with Xtext has been to have block start and end using keywords or symbols. Say BEGIN and END block or "{" "}" so i'm having difficulty imagining how it might work.

I assume I would make white space no longer hidden but after that i'm getting a bit lost.

Would it be possible and how would I go about doing something like this?
Re: Python inspire language in Xtext? [message #921246 is a reply to message #921135] Mon, 24 September 2012 00:36 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2501
Registered: July 2009
Senior Member
On 2012-23-09 23:40, Richard Cookman wrote:
> I'm looking to start a language where the positioning of elements is
> important. I.e. the white space is important to signify the control flow
> in the language.
>
> So far my experience with Xtext has been to have block start and end
> using keywords or symbols. Say BEGIN and END block or "{" "}" so i'm
> having difficulty imagining how it might work.
>
> I assume I would make white space no longer hidden but after that i'm
> getting a bit lost.
>
> Would it be possible and how would I go about doing something like this?

This is quite difficult - search the forum / this newgroup as there are
quite a few posts on this topic - try searching for "external lexer"

The trick to make this work is to make the lexer aware of indents and
issue different tokens that just "space", an hence you need an "external
lexer" (which is supported by Xtext, and not as difficult as it sounds).

regards
- henrik
Previous Topic:Customizing the outline
Next Topic:Xtend or Xtext causes deadlock while workbench loading
Goto Forum:
  


Current Time: Tue Dec 23 00:54:24 GMT 2014

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

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