2 comments
Comment actions Permalink

Seriously, thank you so much for this.

Also, I just finished your 'Language Implementation Patterns' book. Good stuff.

Just to put an issue on your radar:

I've run into the 'no gaps allowed' lexer issue (and successfully resolved it), but I've been recently running into an issue where editing the middle of a file seems to cause 'error shifting segments' (ala this: https://github.com/ceylon/ceylon-ide-intellij/issues/6). My lexers work fine outside of that, so I'm just pushing ahead (while still incredibly bothered by it), but I didn't see the resolution on your page so you may not have even run into it, if you do and find an answer, please please add it!

Thanks for your hard work!

0
Comment actions Permalink

glad to be of service.  The big thing about the lexers is that even erroneous characters have to be sent as bad tokens to intellij. Then I set them as "COMMENTS" so that it does not send them on to the parser. That was a crucial trick: you have to send bad tokens but the parser has to ignore them.   Here is a rule that I put in the and the grammar itself for the intellij plug-in:

ERRCHAR
 : . -> channel(HIDDEN)
 ;

0

Please sign in to leave a comment.