User forums > General (but related to Code::Blocks)
How to add another programming language to C::B? Preparsers?
cb_mensch:
C::B has built-in support for C, C++ and Fortran I wonder what steps are necessary to add another language (despite of the compiler configuration part which is "open").
Can anybody please leave a link on documentation how to do this or some detailed steps?
A related question: How to work with pre-parsers? If I understood the docs correctly a first step is to add an entry for the file extension in Settings->Compiler->Other settings. How to go on if the resulting file is neither .c nor .cpp?
Thank you for the response,
cb_mensch
BlueHazzard:
can you elaborate more, what the new language needs?
For the lexer (code coloring) http://wiki.codeblocks.org/index.php/Creating_a_custom_lexer_for_Code::Blocks_editor
For code completion you need to write a plugin... See the code for the python plugin or for the clang code completion or the native code completion...
For compiler integration (if you need a compilation step, you do not give any information on that...) http://wiki.codeblocks.org/index.php/Installing_a_supported_compiler#Misc._Custom_Compilers
For creating a template for the scripting wizard: http://wiki.codeblocks.org/index.php/Scripting_Code::Blocks
your question does not provide any information to give you some hard answers... Ask exact questions, get exact answers...
cb_mensch:
Thank you, this is actual enough to start the work :-)
gafling:
@BlueHazzard
One language that I would like to be able to integrate into C::B is Cobol. Before you scoff you should know that the newer dialects of Cobol (like GnuCobol) resolve the source code down to 'c'. Therefore it would be helpful to be able to build projects that combine both languages and can manage the each type of source code.
The GNUCobol would need to be able to edit source code, call a pre-compiler which will translate the Cobol to 'c', and then call the 'c' compiler of choice to finish up. C::B appears to be able to do all that except for the actual source code editing part.
Your post suggests the places where Cobol support would need to be added. Actually I would find it surprising that this has not been addressed by someone, but maybe not. In any case any additional suggestions are welcome.
Thank you for your time.
BlueHazzard:
--- Quote from: gafling on February 19, 2017, 02:06:13 pm ---Actually I would find it surprising that this has not been addressed by someone, but maybe not
--- End quote ---
Never heard of any cobol integration in codeblocks.
--- Quote from: gafling on February 19, 2017, 02:06:13 pm ---In any case any additional suggestions are welcome.
--- End quote ---
Good luck and have fun! I am happy to answer any specific question!
FYI: The editor of codeblocks bases on scite, so if you find a lexer for cobol there you can easily integrate it in cb. It seems that there are some efforts but this post is 15 years old...
http://git.net/ml/editors.scite.general/2003-12/msg00127.html
[EDIT:] It seems that codeblocks has an lexer for cobol! https://sourceforge.net/p/codeblocks/code/HEAD/tree/trunk/src/sdk/wxscintilla/src/scintilla/lexers/LexCOBOL.cxx
Navigation
[0] Message Index
[#] Next page
Go to full version