editors

changeset 46:1e7bc3b57fc8

fix namespace x for callback-regex
author ne1uno <ne1uno@users.sourceforge.net>
date Thu Dec 08 16:07:02 2011 -0400 (2011-12-08)
parents 1cab30e3ec7b
children 7daf041ebfd3 84db17e3509a 744591fc7374
files ctags/ReadMe-euphoria.txt ctags/ReadMe.txt ctags/callback-regex-euphoria.c ctags/ctags-sample ctags/ctags_euphoria_test.e
line diff
     1.1 --- a/ctags/ReadMe-euphoria.txt	Wed Dec 07 21:15:03 2011 -0400
     1.2 +++ b/ctags/ReadMe-euphoria.txt	Thu Dec 08 16:07:02 2011 -0400
     1.3 @@ -1,6 +1,8 @@
     1.4  ctags is a very old program to extract identifiers from source,
     1.5 +these tags can be used by code editors and support programs to
     1.6 +jump to the file containing the tag or help with completion.
     1.7 +
     1.8  Exuberant Ctags current release version	5.8 as of 2011
     1.9 -
    1.10  get ctags source or binary & source from 
    1.11  from http://ctags.sourceforge.net
    1.12  or from their svn repo or an archive of the repo trunk
    1.13 @@ -30,10 +32,10 @@
    1.14  to euphoria.c in the ctags source directory
    1.15  
    1.16  replace eiffel language in parsers.h 
    1.17 -and in source.mak 2 places with euphoria
    1.18 -alternatly you would have to use the commandline
    1.19 -to force euphoria or eiffel if you had both active
    1.20 -because both languages use .e file name extension
    1.21 +and in source.mak 2 places with "euphoria".
    1.22 +alternatively, you would have to use the commandline
    1.23 +to force Euphoria or Eiffel if you had both active,
    1.24 +because both languages use the .e file name extension.
    1.25  
    1.26  build ctags executable using one of the makefiles.
    1.27  on windows any of the minGW compilers works well.
     2.1 --- a/ctags/ReadMe.txt	Wed Dec 07 21:15:03 2011 -0400
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,83 +0,0 @@
     2.4 -get ctags source or binary & source from 
     2.5 -from http://ctags.sourceforge.net
     2.6 -or from their svn repo or an archive of the repo trunk
     2.7 -http://ctags.svn.sourceforge.net/viewvc/ctags/trunk/?view=tar
     2.8 -
     2.9 -
    2.10 -currently late 2011 you have to compile ctags to get euphoria language
    2.11 -
    2.12 -there are two regex parsers, simple and callback
    2.13 -copy one of the euphoria.c parsers 
    2.14 -to euphoria.c in the ctags source directory
    2.15 -
    2.16 -replace eiffel language in parsers.h 
    2.17 -and in source.mak 2 places with euphoria
    2.18 -
    2.19 -build ctags executable using one of the makefiles.
    2.20 -install or copy the executable to your path
    2.21 -or you can run from the build directory to test
    2.22 -ctags --languages
    2.23 -
    2.24 -ran 
    2.25 -path\ctags.exe -f ctags --recurse=yes --exclude="*.b*" --fields=+a+S+n -V * 
    2.26 -on ctags_euphoria_test.e and euphoria.e
    2.27 -to generate ctags-sample
    2.28 -
    2.29 -Note: 
    2.30 -	the memtype, memstruct, memunion keywords are from the 
    2.31 -	euphoria 4.1 struct branch and not yet official. the 
    2.32 -	extra parsing will have little to no impact for most projects.
    2.33 -	it would not be too complicated to remove those lines from
    2.34 -	euphoria.c if you find you need the extra speed advantage.
    2.35 -
    2.36 -by default the callback euphoria parser collects these kinds of items
    2.37 -
    2.38 -n namespace  both namespace x and include x as y
    2.39 -i ifdef, elsifdef, with/out define words
    2.40 -m memtype
    2.41 -s memstruct
    2.42 -u memunion
    2.43 -c constant
    2.44 -t type
    2.45 -p procedure
    2.46 -f function
    2.47 -
    2.48 -the simple parser collects these kinds only
    2.49 - and may miss some declarations the callback would catch
    2.50 -
    2.51 -m memtype
    2.52 -s memstruct
    2.53 -u memunion
    2.54 -c constant
    2.55 -t type
    2.56 -p procedure
    2.57 -f function
    2.58 -
    2.59 -to limit the kinds, use commandline something like
    2.60 - --euphoria-kinds=+p-c for only procedures no constants
    2.61 - not sure why you need -c if +p means only procedures though.
    2.62 -
    2.63 -these options might be changed by default in some ctag parsers
    2.64 -
    2.65 -neither parser currently can collect more than the first on the
    2.66 -same line as the constant, type, function or procedure declaration 
    2.67 - in a multiline lists of parameters or constants
    2.68 -
    2.69 -public constant x = 0,
    2.70 -  y = 1
    2.71 --- y is ignored by ctags
    2.72 -
    2.73 -function xyz(atom a,
    2.74 -			atom b)
    2.75 ---b is ignored by ctags 
    2.76 -
    2.77 -
    2.78 -neither euphoria parser really understands euphoria syntax, but, 
    2.79 -running ctags over bad syntax code may cause unpredictable results.
    2.80 -ctags itself is pretty robust and should be fine in any case.
    2.81 -
    2.82 -eui -STRICT -TEST prog is one way to check syntax
    2.83 -
    2.84 -
    2.85 -please report any bugs or add a feature request for improvements,
    2.86 -including sample code if applicable.
     3.1 --- a/ctags/callback-regex-euphoria.c	Wed Dec 07 21:15:03 2011 -0400
     3.2 +++ b/ctags/callback-regex-euphoria.c	Thu Dec 08 16:07:02 2011 -0400
     3.3 @@ -139,10 +139,8 @@
     3.4  	if (count > 1 )    /* should always be true per regex */
     3.5  	{
     3.6  		vString *const name = vStringNew ();
     3.7 -		//this will need work to distinguish namespace x from as x
     3.8 -		//namespace x should be count=4, 
     3.9 -		//y as x should be x=count=$
    3.10 -		// include y as x should be x=$
    3.11 +
    3.12 +		//namespace x or as x
    3.13  		vStringNCopyS (name, line + matches [count-1].start, matches [count-1].length);
    3.14  		makeSimpleTag (name, EuphoriaKinds, knamespace);
    3.15  	}
    3.16 @@ -221,7 +219,10 @@
    3.17  	//namespace x vrs include y as x
    3.18  	//could miss some hypothetical namespace called aswhatever?
    3.19  	addCallbackRegex (language,
    3.20 -			"^[ \t\n]*(public)*[ \t\n]*(include|namespace)+[ \t\n]+([a-zA-Z0-9\\/~#:\"._-]+)[ \t\n]*(as)*[ \t\n]*([a-zA-Z0-9_]*)",
    3.21 +			"^[ \t\n]*(global|public)*[ \t\n]*(include)+[ \t\n]+([a-zA-Z0-9\\/~#:\"._-]+)[ \t\n]+(as)+[ \t\n]+([a-zA-Z0-9_]*)",
    3.22 +				NULL, defNs);
    3.23 +	addCallbackRegex (language,
    3.24 +			"^[ \t\n]*(namespace)+[ \t\n]+([a-zA-Z0-9_]*)",
    3.25  				NULL, defNs);
    3.26  
    3.27  	addCallbackRegex (language,
    3.28 @@ -232,6 +233,11 @@
    3.29  			//add for/while/etc targets, is /s required after keyword?
    3.30  			"^[ \t\n]*(label|goto|continue|exit)+[ \t\n]+\"([^\"]+)",  //\"
    3.31  				NULL, defLabel);
    3.32 +
    3.33 +// 	addCallbackRegex (language,
    3.34 +// 			//except not|define
    3.35 +// 			"^[ \t\n]*(with|without)+[ \t\n]+(.+)",
    3.36 +// 				NULL, defIfDef);
    3.37  }
    3.38  
    3.39  /* Create parser definition stucture */
     4.1 --- a/ctags/ctags-sample	Wed Dec 07 21:15:03 2011 -0400
     4.2 +++ b/ctags/ctags-sample	Thu Dec 08 16:07:02 2011 -0400
     4.3 @@ -4,23 +4,25 @@
     4.4  !_TAG_PROGRAM_NAME	Exuberant Ctags	5.8//
     4.5  !_TAG_PROGRAM_URL	http://ctags.sourceforge.net	/official site/
     4.6  !_TAG_PROGRAM_VERSION	Development 5.8 ne1	//
     4.7 -_1of1memstruct	c:/c/LANG/Eu/GUI/euqt/lib/ctag/ctags_euphoria_test.e	/^memstruct _1of1memstruct$/;"	s	line:66
     4.8 -_1of1memtype	c:/c/LANG/Eu/GUI/euqt/lib/ctag/ctags_euphoria_test.e	/^memtype _0o21amemtype as _1of1memtype$/;"	m	line:56
     4.9 -_1of1memunion	c:/c/LANG/Eu/GUI/euqt/lib/ctag/ctags_euphoria_test.e	/^memunion _1of1memunion  --$/;"	u	line:60
    4.10 -_1of1procedure	c:/c/LANG/Eu/GUI/euqt/lib/ctag/ctags_euphoria_test.e	/^procedure _1of1procedure() end procedure$/;"	p	line:54
    4.11 -_1of2c	c:/c/LANG/Eu/GUI/euqt/lib/ctag/ctags_euphoria_test.e	/^constant _1of2c=0$/;"	c	line:20
    4.12 -_1of2function	c:/c/LANG/Eu/GUI/euqt/lib/ctag/ctags_euphoria_test.e	/^function _1of2function() return TRUE end function$/;"	f	line:47
    4.13 -_1of2label	c:/c/LANG/Eu/GUI/euqt/lib/ctag/ctags_euphoria_test.e	/^	goto "_1of2label"$/;"	l	line:72
    4.14 -_1of4word	c:/c/LANG/Eu/GUI/euqt/lib/ctag/ctags_euphoria_test.e	/^with define _1of4word$/;"	i	line:12
    4.15 -_1of5type	c:/c/LANG/Eu/GUI/euqt/lib/ctag/ctags_euphoria_test.e	/^type _1of5type(object w)$/;"	t	line:27
    4.16 -_2of2function	c:/c/LANG/Eu/GUI/euqt/lib/ctag/ctags_euphoria_test.e	/^function _2of2function($/;"	f	line:48
    4.17 -_2of2label	c:/c/LANG/Eu/GUI/euqt/lib/ctag/ctags_euphoria_test.e	/^label "_2of2label"$/;"	l	line:75
    4.18 -_2of3namespace	c:/c/LANG/Eu/GUI/euqt/lib/ctag/ctags_euphoria_test.e	/^include std\/types.e as _2of3namespace$/;"	n	line:9
    4.19 -_2of4word	c:/c/LANG/Eu/GUI/euqt/lib/ctag/ctags_euphoria_test.e	/^without define _2of4word$/;"	i	line:13
    4.20 -_2of5type	c:/c/LANG/Eu/GUI/euqt/lib/ctag/ctags_euphoria_test.e	/^public type _2of5type(object w)$/;"	t	line:31
    4.21 -_3of3namespace	c:/c/LANG/Eu/GUI/euqt/lib/ctag/ctags_euphoria_test.e	/^public include "std\\\\io.e" as _3of3namespace  --not a real string$/;"	n	line:10
    4.22 -_3of4word	c:/c/LANG/Eu/GUI/euqt/lib/ctag/ctags_euphoria_test.e	/^ifdef _3of4word then$/;"	i	line:15
    4.23 -_3of5type	c:/c/LANG/Eu/GUI/euqt/lib/ctag/ctags_euphoria_test.e	/^	export type _3of5type(sequence z) return TRUE end type$/;"	t	line:35
    4.24 -_4of4word	c:/c/LANG/Eu/GUI/euqt/lib/ctag/ctags_euphoria_test.e	/^elsifdef _4of4word then$/;"	i	line:16
    4.25 -_4of5type	c:/c/LANG/Eu/GUI/euqt/lib/ctag/ctags_euphoria_test.e	/^ global type _4of5type(integer y)return TRUE end type$/;"	t	line:36
    4.26 -_5of5type	c:/c/LANG/Eu/GUI/euqt/lib/ctag/ctags_euphoria_test.e	/^override type _5of5type($/;"	t	line:38
    4.27 +_1of1memstruct	/ctag/ctags_euphoria_test.e	/^memstruct _1of1memstruct$/;"	s	line:66
    4.28 +_1of1memtype	/ctag/ctags_euphoria_test.e	/^memtype _0o21amemtype as _1of1memtype$/;"	m	line:56
    4.29 +_1of1memunion	/ctag/ctags_euphoria_test.e	/^memunion _1of1memunion  --$/;"	u	line:60
    4.30 +_1of1procedure	/ctag/ctags_euphoria_test.e	/^procedure _1of1procedure() end procedure$/;"	p	line:54
    4.31 +_1of2c	/ctag/ctags_euphoria_test.e	/^constant _1of2c=0$/;"	c	line:20
    4.32 +_1of2function	/ctag/ctags_euphoria_test.e	/^function _1of2function() return TRUE end function$/;"	f	line:47
    4.33 +_1of2label	/ctag/ctags_euphoria_test.e	/^	goto "_1of2label"$/;"	l	line:73
    4.34 +_1of2label	/ctag/ctags_euphoria_test.e	/^label "_1of2label"$/;"	l	line:76
    4.35 +_1of3namespace	/ctag/ctags_euphoria_test.e	/^namespace _1of3namespace$/;"	n	line:5
    4.36 +_1of4word	/ctag/ctags_euphoria_test.e	/^with define _1of4word$/;"	i	line:12
    4.37 +_1of5type	/ctag/ctags_euphoria_test.e	/^type _1of5type(object w)$/;"	t	line:27
    4.38 +_2of2function	/ctag/ctags_euphoria_test.e	/^function _2of2function($/;"	f	line:48
    4.39 +_2of2label	/ctag/ctags_euphoria_test.e	/^label "_2of2label"$/;"	l	line:77
    4.40 +_2of3namespace	/ctag/ctags_euphoria_test.e	/^include std\/types.e as _2of3namespace$/;"	n	line:9
    4.41 +_2of4word	/ctag/ctags_euphoria_test.e	/^without define _2of4word$/;"	i	line:13
    4.42 +_2of5type	/ctag/ctags_euphoria_test.e	/^public type _2of5type(object w)$/;"	t	line:31
    4.43 +_3of3namespace	/ctag/ctags_euphoria_test.e	/^public include "std\\\\io.e" as _3of3namespace  --not a real string$/;"	n	line:10
    4.44 +_3of4word	/ctag/ctags_euphoria_test.e	/^ifdef _3of4word then$/;"	i	line:15
    4.45 +_3of5type	/ctag/ctags_euphoria_test.e	/^	export type _3of5type(sequence z) return TRUE end type$/;"	t	line:35
    4.46 +_4of4word	/ctag/ctags_euphoria_test.e	/^elsifdef _4of4word then$/;"	i	line:16
    4.47 +_4of5type	/ctag/ctags_euphoria_test.e	/^ global type _4of5type(integer y)return TRUE end type$/;"	t	line:36
    4.48 +_5of5type	/ctag/ctags_euphoria_test.e	/^override type _5of5type($/;"	t	line:38
     5.1 --- a/ctags/ctags_euphoria_test.e	Wed Dec 07 21:15:03 2011 -0400
     5.2 +++ b/ctags/ctags_euphoria_test.e	Thu Dec 08 16:07:02 2011 -0400
     5.3 @@ -69,8 +69,10 @@
     5.4  end memstruct
     5.5  
     5.6  while TRUE label "_0of2label" do 
     5.7 +	if 0 then continue "_0of2label" end if
     5.8  	goto "_1of2label"
     5.9  end while 
    5.10  
    5.11 +label "_1of2label"
    5.12  label "_2of2label"
    5.13  --

SCM Home | OpenEuphoria.org Home