Adding a new Ctags Language Definition
Posted: Wed Apr 07, 2010 3:26 am
Zeus integrates with Exuberant Ctags which supports about 40 programming languages.
But even if your language is not on the list of supported langauges, it is very easy to add new language using a ctags configuration file.
For example consider the following ctags configuration file:
This file defines a new language definition for the Clipper language and maps the prg file extension to this map.
The two regular expressions define the function and procedure ctags items.
To make ctags use this configuration file just do the following:
Cheers Jussi
But even if your language is not on the list of supported langauges, it is very easy to add new language using a ctags configuration file.
For example consider the following ctags configuration file:
Code: Select all
--langdef=Clipper
--langmap=Clipper:.prg
--regex-clipper=/^FUNCTION[ \t]*([a-zA-Z0-9_]+)/\1/f,function/
--regex-clipper=/^PROCEDURE[ \t]*([a-zA-Z0-9_]+)/\1/p,procedure/
The two regular expressions define the function and procedure ctags items.
To make ctags use this configuration file just do the following:
- Save the configuration details above to the .ctags file.
- If the HOMEDRIVE and HOMEPATH environment variables are defined copy the .ctags file to this location.
- Otherwise define these new environmental variables as follows.
- Set the HOMEDRIVE environment variable to be c:
- Set the HOMEPATH environment variable to be C:\Users\<your userid>
- Put this .ctags file in that C:\Users\<your userid> location.
- Start a new version of Zeus so that it picks up this environment change.
Cheers Jussi