Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Customizing the generated ANTLR Lexer file (Internal*__.g)
Customizing the generated ANTLR Lexer file (Internal*__.g) [message #654499] Wed, 16 February 2011 04:10 Go to next message
valtron2000 is currently offline valtron2000Friend
Messages: 3
Registered: February 2011
Junior Member
Basically, I need to generate my own lexer for my language project because of some things that can't be done otherwise (like heredocs and code interpolation).

Xtext generates a lexer file for ANTLR in parser.antlr.internal.Internal(name)__.g, but I haven't found a place where I can customize its creation.

I've looked at the example for creating an indentation-oriented language, but unfortunately what I'm trying to do can't be done by a simple CharStream transform. Also, the docs don't give details on modifying the ANTLR files. Any help is appreciated.

Thanks.
Re: Customizing the generated ANTLR Lexer file (Internal*__.g) [message #654622 is a reply to message #654499] Wed, 16 February 2011 13:25 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
I use an external lexer in the "Geppetto" project - you can take a look
at it on Github - the dsl project is found here:
https://github.com/cloudsmith/geppetto/tree/master/org.cloud smith.geppetto.pp.dsl

Regards
- henrik

On 2/16/11 5:10 AM, valtron2000@gmail.com wrote:
> Basically, I need to generate my own lexer for my language project
> because of some things that can't be done otherwise (like heredocs and
> code interpolation).
>
> Xtext generates a lexer file for ANTLR in
> parser.antlr.internal.Internal(name)__.g, but I haven't found a place
> where I can customize its creation.
>
> I've looked at the example for creating an indentation-oriented
> language, but unfortunately what I'm trying to do can't be done by a
> simple CharStream transform. Also, the docs don't give details on
> modifying the ANTLR files. Any help is appreciated.
> Thanks.
Re: Customizing the generated ANTLR Lexer file (Internal*__.g) [message #654700 is a reply to message #654622] Wed, 16 February 2011 18:30 Go to previous message
valtron2000 is currently offline valtron2000Friend
Messages: 3
Registered: February 2011
Junior Member
Thanks, that's exactly what I needed.
Previous Topic:Import statement handling of embedded variables
Next Topic:Minimal source to import in a mercurial repository
Goto Forum:
  


Current Time: Thu Apr 25 14:56:10 GMT 2024

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

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

Back to the top