Import Antlr Lexer grammar in Xtext [message #650028] |
Fri, 21 January 2011 13:57 |
Alexander Floh Messages: 2 Registered: January 2011 |
Junior Member |
|
|
Hi,
first, to give you a bit of context, here's what I want to achieve:
I have an existing DSL, which has indentation based blocks. I've seen ideas floating around here to handle this with a extended character stream, which sacrifices two characters as Indent/Dedent symbols. However, I don't like that solution very much, in my opinion this is a concern which should be handled by the lexer (creating virtual tokens for indent and dedent).
So the actual question: is it possible to have Xtext import another antlr-lexer-grammar into the generated one? I've read mentions of customizing the generation step, can you give me some pointers what I would need to adapt for that?
Thanks in advance,
Alex
|
|
|
|
Re: Import Antlr Lexer grammar in Xtext [message #650840 is a reply to message #650028] |
Wed, 26 January 2011 18:45 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Alex,
please digg into the ExternalAntlrLexerFragment and it usage in mwe2.
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 21.01.11 14:57, schrieb Alexander Floh:
> Hi,
>
> first, to give you a bit of context, here's what I want to achieve:
> I have an existing DSL, which has indentation based blocks. I've seen
> ideas floating around here to handle this with a extended character
> stream, which sacrifices two characters as Indent/Dedent symbols.
> However, I don't like that solution very much, in my opinion this is a
> concern which should be handled by the lexer (creating virtual tokens
> for indent and dedent).
>
> So the actual question: is it possible to have Xtext import another
> antlr-lexer-grammar into the generated one? I've read mentions of
> customizing the generation step, can you give me some pointers what I
> would need to adapt for that?
>
> Thanks in advance,
> Alex
|
|
|
|
Powered by
FUDForum. Page generated in 0.03323 seconds