• Advertisement
Sign in to follow this  

Scintilla and external lexers

This topic is 2095 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does the Scintilla API exposes a method to "register" a new lexer class (for a new language) derived from the ILexer interface
without embedding it in a separate DLL or within the SciLexer.dll ?

Share this post


Link to post
Share on other sites
Advertisement
It doesn't matter where your lexer lives, you just give it the function pointers. You can easily write the lexer inside your own .EXE that hosts Scintilla, and just pass it the function pointer table that's set up to point to that code.

Share this post


Link to post
Share on other sites
Thanks Michael for the help. What do you mean by "that hosts Scintilla"? (hosted as a DLL or embedded inside the .EXE?) Edited by Eliad Moshe

Share this post


Link to post
Share on other sites
Either/or. Scintilla (IIRC) can be compiled into your EXE directly, or used as an external DLL loaded at runtime. Either approach lets you run the lexer from wherever you like. Again, it's just function pointers :-)

Share this post


Link to post
Share on other sites
I packed the lexer as a DLL and everything works great.

An advice for great good* :

0. Do not forget to use a DEF file alongside your DLL.
1. Read section #0 and skip to section #2.
2. Remember that you were warned twice to use a DEF file!

* Kaleidoscope style :-) Edited by Eliad Moshe

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement