News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

how to add a language to codeblocks for syntax highlighting?

Started by laserbeak43, December 21, 2007, 09:04:34 PM

Previous topic - Next topic

laserbeak43

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.



laserbeak43

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

byo

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

EnterTheNameHere

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

laserbeak43

yeah i hope that gets done :)
could i talk to the guys at scintilla about adding the language to lexxer?