Code::Blocks

Developer forums (C::B DEVELOPMENT STRICTLY!) => Contributions to C::B => Topic started by: PerryWerneck on November 22, 2005, 07:02:46 pm

Title: Sintax Highlit - How to add new languages?
Post by: PerryWerneck on November 22, 2005, 07:02:46 pm
 
   Hi Folks,

   Well, I'm not sure if it's the right forum to post this message but since I'm planning to add "REXX" support in codeblocks and, to start it I need some directions. How comples is to add a sintax highliting in codeblocks? I saw some files in the "lexers" folder but I'm not sure if it's necessary only change them probably there other changes, or not?
Title: Re: Sintax Highlit - How to add new languages?
Post by: rickg22 on November 22, 2005, 07:19:49 pm
Um... you need to edit the XML files. You need to read the scintilla lexers' sourcecode to see what codes are for what and stuff.
Title: Re: Sintax Highlit - How to add new languages?
Post by: PerryWerneck on November 22, 2005, 09:13:55 pm

   Hi,

   The first test is ok!! I was able to change the lexer adding the rexx commands and it's working. Still having some problems since rexx isn't case sensitive but I'll read the documentation.

   Thanks!!!
Title: Re: Sintax Highlit - How to add new languages?
Post by: MortenMacFly on November 22, 2005, 10:23:23 pm
Still having some problems since rexx isn't case sensitive but I'll read the documentation.
If you setup the index in the lexer file correctly (assuming that wxScintillx supports REXX natively) the editor should handle this correctly. See "wxscintilla.h" for what languages are supported and which index has to be used. FYI: There is a Fortran lexer which works similar because Fortran is also case in-sensitive.

Morten.
Title: Re: Sintax Highlit - How to add new languages?
Post by: mandrav on November 22, 2005, 11:07:28 pm
...and don't forget to share the lexer when you 're done ;)
Title: Re: Sintax Highlit - How to add new languages?
Post by: PerryWerneck on November 23, 2005, 12:24:44 pm
   That's the problem! Scintilla doesn't support rexx :(

   I sucessfully changed the c/c++ lexer and it's working fine if I use only lower case characters. It's still a work in progress but I can share it if there's some other person using rexx.

If you setup the index in the lexer file correctly (assuming that wxScintillx supports REXX natively) the editor should handle this correctly. See "wxscintilla.h" for what languages are supported and which index has to be used. FYI: There is a Fortran lexer which works similar because Fortran is also case in-sensitive.

...and don't forget to share the lexer when you 're done ;)