|
Re: Python inspire language in Xtext? [message #921246 is a reply to message #921135] |
Sun, 23 September 2012 20:36  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.04625 seconds