Sign in to follow this  
Eliad Moshe

Scintilla and external lexers

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this