Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: aaros on March 10, 2014, 04:24:11 pm
-
Hi all,
I'm a bit new to programming and I'm currently working with AMPL. I really like C:B but I can't find any extension to highlight AMPL syntax. If I'm not mistaken it is because C:B only provides highlighting mode for languages supported by Scintilla, which does not provide AMPL editing.
I saw that AMPL modes have been written for VIm and Emacs. I know that they are not like C:B, but is there hope of having AMPL in C:B?
Thanks for your help
-
you can make it yourself: http://wiki.codeblocks.org/index.php?title=Creating_a_custom_lexer_for_Code::Blocks_editor
please provide a patch if you succeed
greetings
-
Yep, I've seen that ;)
By saying "I'm a bit new to programming", I was also implying "it will take ages for me to do it on my own". I'm more looking for people who also thought about this feature and then maybe we'll try work it out.
Thanks for the reply anyway
-
It actually should not be that hard to get a reasonable syntax highlight. From a look at the Wikipedia page, the language is similar-ish to bash, so if you copy lexer_bash.xml to (for example) lexer_ampl.xml, all you should need to change in the file, is the associated file extension (*.mod ...), and replace the listed keywords with the keywords AMPL uses (data in param set var ...).