Scintilla and external lexers

Started by
3 comments, last by Eliad Moshe 11 years, 9 months ago
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 ?
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.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

Thanks Michael for the help. What do you mean by "that hosts Scintilla"? (hosted as a DLL or embedded inside the .EXE?)
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 :-)

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

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

This topic is closed to new replies.

Advertisement