 |
Zeus Use this forum to ask for help, submit a bug report or make a suggestion.
|
| View previous topic :: View next topic |
| Author |
Message |
jussij Site Admin
Joined: 13 Aug 2004 Posts: 1938
|
Posted: Wed Apr 07, 2010 3:26 am Post subject: Adding a new Ctags Language Definition |
|
|
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:
| Code: | --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/ |
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: - Save the configuration details above to the .ctags file.
- If the HOMEDRIVE and HOMEPATH environment variables defined copy the .ctags file to this location.
- Otherwise put the file in the Zeus install folder: c:\program files\zeus\.ctags
- Set the HOMEDRIVE environment variable to be c:
- Set the HOMEPATH environment variable to be \program files\zeus\
Now when you add prg files to a zeus workspace these files will get tagged and the tags found will get displayed in the Classes tab of the Navigator Panel.
Cheers Jussi
Last edited by jussij on Tue Sep 20, 2011 1:00 am; edited 1 time in total |
|
| Back to top |
|
 |
wolivo
Joined: 16 Feb 2005 Posts: 5
|
Posted: Mon May 03, 2010 7:35 pm Post subject: |
|
|
| since i don't find a .ctags file anywhere on my hard drive, in this example would the .ctags file consist of only these 4 lines of code? |
|
| Back to top |
|
 |
jussij Site Admin
Joined: 13 Aug 2004 Posts: 1938
|
Posted: Tue May 04, 2010 12:53 am Post subject: |
|
|
| Quote: | | since i don't find a .ctags file anywhere on my hard drive, in this example would the .ctags file consist of only these 4 lines of code? |
That is correct. I am no expert in .ctags but I think the way it works is the 'Clipper' word ties these four lines together to define a language.
This allows the file to contain multiple language definitions.
Below is a list of how the ctags words are mapped to the Zeus types:
| Code: | class Tag_Class
function Tag_Function
method Tag_Method
macro Tag_Macro
procedure Tag_Procedure
variable Tag_Variable |
You can also change the names of the labels displayed in the Classes panel by using the Labels panel found in the Workspace, Options menu.
Cheers Jussi |
|
| Back to top |
|
 |
jussij Site Admin
Joined: 13 Aug 2004 Posts: 1938
|
Posted: Sun Sep 23, 2012 1:33 am Post subject: |
|
|
Here is a VB.Net ctags configuration:
| Code: | --langdef=vb
--langmap=vb:.vb
--regex-vb=/^[ \t]*(Public|Private)[ \t]+Sub[ \t]+([a-zA-Z0-9_]+)/\2/s,subroutine/i
--regex-vb=/^[ \t]*(Public|Private)[ \t]+Function[ \t]+([a-zA-Z0-9_]+)/\2/f,function/i
--regex-vb=/^[ \t]*(Public|Private)[ \t]+([a-zA-Z0-9_]+)[ \t]+As[ \t]+/\2/v,variable/i
--regex-vb=/^[ \t]*(Public|Private)[ \t]+Const[ \t]+([a-zA-Z0-9_]+)[ \t]+(As|=)[ \t]+/\2/c,const/i
--regex-vb=/^[ \t]*(Public|Private)[ \t]+Enum[ \t]+([a-zA-Z0-9_]+)/\2/e,enum/i
--regex-vb=/^[ \t]*(Public)[ \t]+Property[ \t]+(Get|Let|Set)[ \t]+([a-zA-Z0-9_]+)/\3/n,name/i
--regex-vb=/^[ \t]*([a-zA-Z_]+):/\1/l,label/i |
Cheers Jussi |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|