Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: laserbeak43 on December 21, 2007, 09:04:34 pm

Title: how to add a language to codeblocks for syntax highlighting?
Post by: laserbeak43 on December 21, 2007, 09:04:34 pm
hi, i would like to add a language and its assembler to codeblocks with syntax highlighting etc. how do i start adding a syntax highlighting "script"(is that the right term)?

the only thing i can find in the codeblocks IDE itself is a scheme or theme. but i can't add a particular language to the list.
Title: Re: how to add a language to codeblocks for syntax highlighting?
Post by: JGM on December 21, 2007, 10:18:10 pm
Always search in the wiki! :)

http://wiki.codeblocks.org/index.php?title=Creating_a_custom_lexer_for_Code::Blocks_editor
Title: Re: how to add a language to codeblocks for syntax highlighting?
Post by: laserbeak43 on December 21, 2007, 10:26:54 pm
Always search in the wiki! :)

http://wiki.codeblocks.org/index.php?title=Creating_a_custom_lexer_for_Code::Blocks_editor

oops :) will do next time :)
Title: Re: how to add a language to codeblocks for syntax highlighting?
Post by: laserbeak43 on December 21, 2007, 11:37:40 pm
Quote
index corresponds with the wxSCI_LEX_* constants, found in sdk/wxscintilla/include/wx/wxscintilla.h. In this example, if you look in sdk/wxscintilla/include/wx/wxscintilla.h, you'll see that index 3 matches wxSCI_LEX_CPP. That is the lexer id for C/C++ syntax highlighting.
If we were building a lexer configuration for let's say, XML (random choice) we would look up the constant wxSCI_LEX_XML which is defined to be number 5. So index=5. Simple.
I'm trying to create syntax highlighting for NESASM.
if i it weren't in the wxscintilla.h does this mean that i couldn't create an entry and i'd be screwed?
Title: Re: how to add a language to codeblocks for syntax highlighting?
Post by: byo on December 22, 2007, 12:40:52 am
Currently: yes.
It's possible to add other custom lexers but that would require minor changes in wxscintilla source (adding dllexport for some classes), so currently it can not be done.

I work on some solution that would allow generating lexer for any language through custom C::B plugin (I was to tired of wxSmith so needed to code something different ;) ) - that would give you ability to colourise the source just as you want by writing your own plugin, but for now it's just my personal experimental code so I don't know even if it will ever be included in the main sources (it requires some changes in sdk and wxScintilla).

Regards
   BYO
Title: Re: how to add a language to codeblocks for syntax highlighting?
Post by: EnterTheNameHere on December 22, 2007, 05:47:27 am
byo:
That would be a really great thing. Even killer feature combined with codecompletion( hmm, what about Code::Completion?((: )
I wish you good luck and have a lot of energy and verve to continue( sorry for my english )

Sorry for OT
Title: Re: how to add a language to codeblocks for syntax highlighting?
Post by: laserbeak43 on December 23, 2007, 05:10:17 am
yeah i hope that gets done :)
could i talk to the guys at scintilla about adding the language to lexxer?