ctags.rb 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. data/Gemfile +2 -0
  2. data/Rakefile +23 -0
  3. data/ctags.rb.gemspec +23 -0
  4. data/ext/.gitignore +3 -0
  5. data/ext/extconf.rb +15 -0
  6. data/ext/vendor/exuberant-ctags/.gitignore +6 -0
  7. data/ext/vendor/exuberant-ctags/.indent.pro +31 -0
  8. data/ext/vendor/exuberant-ctags/COPYING +340 -0
  9. data/ext/vendor/exuberant-ctags/EXTENDING.html +386 -0
  10. data/ext/vendor/exuberant-ctags/FAQ +371 -0
  11. data/ext/vendor/exuberant-ctags/INSTALL +215 -0
  12. data/ext/vendor/exuberant-ctags/INSTALL.oth +73 -0
  13. data/ext/vendor/exuberant-ctags/MAINTAINERS +88 -0
  14. data/ext/vendor/exuberant-ctags/Makefile.in +222 -0
  15. data/ext/vendor/exuberant-ctags/NEWS +871 -0
  16. data/ext/vendor/exuberant-ctags/README +73 -0
  17. data/ext/vendor/exuberant-ctags/ant.c +42 -0
  18. data/ext/vendor/exuberant-ctags/argproc.c +505 -0
  19. data/ext/vendor/exuberant-ctags/args.c +274 -0
  20. data/ext/vendor/exuberant-ctags/args.h +63 -0
  21. data/ext/vendor/exuberant-ctags/asm.c +387 -0
  22. data/ext/vendor/exuberant-ctags/asp.c +328 -0
  23. data/ext/vendor/exuberant-ctags/awk.c +81 -0
  24. data/ext/vendor/exuberant-ctags/basic.c +203 -0
  25. data/ext/vendor/exuberant-ctags/beta.c +321 -0
  26. data/ext/vendor/exuberant-ctags/c.c +2932 -0
  27. data/ext/vendor/exuberant-ctags/cobol.c +50 -0
  28. data/ext/vendor/exuberant-ctags/config.h.in +277 -0
  29. data/ext/vendor/exuberant-ctags/configure +7704 -0
  30. data/ext/vendor/exuberant-ctags/configure.ac +532 -0
  31. data/ext/vendor/exuberant-ctags/ctags.1 +1186 -0
  32. data/ext/vendor/exuberant-ctags/ctags.h +28 -0
  33. data/ext/vendor/exuberant-ctags/ctags.html +2087 -0
  34. data/ext/vendor/exuberant-ctags/ctags.spec +40 -0
  35. data/ext/vendor/exuberant-ctags/debug.c +113 -0
  36. data/ext/vendor/exuberant-ctags/debug.h +70 -0
  37. data/ext/vendor/exuberant-ctags/descrip.mms +68 -0
  38. data/ext/vendor/exuberant-ctags/dosbatch.c +42 -0
  39. data/ext/vendor/exuberant-ctags/e_amiga.h +24 -0
  40. data/ext/vendor/exuberant-ctags/e_djgpp.h +47 -0
  41. data/ext/vendor/exuberant-ctags/e_mac.h +143 -0
  42. data/ext/vendor/exuberant-ctags/e_msoft.h +76 -0
  43. data/ext/vendor/exuberant-ctags/e_os2.h +37 -0
  44. data/ext/vendor/exuberant-ctags/e_qdos.h +34 -0
  45. data/ext/vendor/exuberant-ctags/e_riscos.h +58 -0
  46. data/ext/vendor/exuberant-ctags/e_vms.h +31 -0
  47. data/ext/vendor/exuberant-ctags/eiffel.c +1352 -0
  48. data/ext/vendor/exuberant-ctags/entry.c +847 -0
  49. data/ext/vendor/exuberant-ctags/entry.h +103 -0
  50. data/ext/vendor/exuberant-ctags/erlang.c +189 -0
  51. data/ext/vendor/exuberant-ctags/flex.c +2243 -0
  52. data/ext/vendor/exuberant-ctags/fortran.c +2197 -0
  53. data/ext/vendor/exuberant-ctags/general.h +127 -0
  54. data/ext/vendor/exuberant-ctags/get.c +669 -0
  55. data/ext/vendor/exuberant-ctags/get.h +50 -0
  56. data/ext/vendor/exuberant-ctags/gnu_regex/.svn/all-wcprops +47 -0
  57. data/ext/vendor/exuberant-ctags/gnu_regex/.svn/entries +112 -0
  58. data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/README.txt.svn-base +5 -0
  59. data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regcomp.c.svn-base +3818 -0
  60. data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regex.c.svn-base +74 -0
  61. data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regex.h.svn-base +575 -0
  62. data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regex_internal.c.svn-base +1713 -0
  63. data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regex_internal.h.svn-base +773 -0
  64. data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regexec.c.svn-base +4338 -0
  65. data/ext/vendor/exuberant-ctags/gnu_regex/README.txt +5 -0
  66. data/ext/vendor/exuberant-ctags/gnu_regex/regcomp.c +3818 -0
  67. data/ext/vendor/exuberant-ctags/gnu_regex/regex.c +74 -0
  68. data/ext/vendor/exuberant-ctags/gnu_regex/regex.h +575 -0
  69. data/ext/vendor/exuberant-ctags/gnu_regex/regex_internal.c +1713 -0
  70. data/ext/vendor/exuberant-ctags/gnu_regex/regex_internal.h +773 -0
  71. data/ext/vendor/exuberant-ctags/gnu_regex/regexec.c +4338 -0
  72. data/ext/vendor/exuberant-ctags/html.c +49 -0
  73. data/ext/vendor/exuberant-ctags/jscript.c +1572 -0
  74. data/ext/vendor/exuberant-ctags/keyword.c +258 -0
  75. data/ext/vendor/exuberant-ctags/keyword.h +34 -0
  76. data/ext/vendor/exuberant-ctags/lisp.c +139 -0
  77. data/ext/vendor/exuberant-ctags/lregex.c +704 -0
  78. data/ext/vendor/exuberant-ctags/lua.c +133 -0
  79. data/ext/vendor/exuberant-ctags/mac.c +273 -0
  80. data/ext/vendor/exuberant-ctags/magic.diff +21 -0
  81. data/ext/vendor/exuberant-ctags/main.c +584 -0
  82. data/ext/vendor/exuberant-ctags/main.h +32 -0
  83. data/ext/vendor/exuberant-ctags/maintainer.mak +476 -0
  84. data/ext/vendor/exuberant-ctags/make.c +217 -0
  85. data/ext/vendor/exuberant-ctags/matlab.c +44 -0
  86. data/ext/vendor/exuberant-ctags/mk_bc3.mak +46 -0
  87. data/ext/vendor/exuberant-ctags/mk_bc5.mak +49 -0
  88. data/ext/vendor/exuberant-ctags/mk_djg.mak +18 -0
  89. data/ext/vendor/exuberant-ctags/mk_manx.mak +65 -0
  90. data/ext/vendor/exuberant-ctags/mk_mingw.mak +31 -0
  91. data/ext/vendor/exuberant-ctags/mk_mpw.mak +130 -0
  92. data/ext/vendor/exuberant-ctags/mk_mvc.mak +40 -0
  93. data/ext/vendor/exuberant-ctags/mk_os2.mak +104 -0
  94. data/ext/vendor/exuberant-ctags/mk_qdos.mak +100 -0
  95. data/ext/vendor/exuberant-ctags/mk_sas.mak +63 -0
  96. data/ext/vendor/exuberant-ctags/mkinstalldirs +40 -0
  97. data/ext/vendor/exuberant-ctags/ocaml.c +1842 -0
  98. data/ext/vendor/exuberant-ctags/options.c +1842 -0
  99. data/ext/vendor/exuberant-ctags/options.h +155 -0
  100. data/ext/vendor/exuberant-ctags/parse.c +677 -0
  101. data/ext/vendor/exuberant-ctags/parse.h +129 -0
  102. data/ext/vendor/exuberant-ctags/parsers.h +63 -0
  103. data/ext/vendor/exuberant-ctags/pascal.c +267 -0
  104. data/ext/vendor/exuberant-ctags/perl.c +382 -0
  105. data/ext/vendor/exuberant-ctags/php.c +237 -0
  106. data/ext/vendor/exuberant-ctags/python.c +771 -0
  107. data/ext/vendor/exuberant-ctags/qdos.c +106 -0
  108. data/ext/vendor/exuberant-ctags/read.c +569 -0
  109. data/ext/vendor/exuberant-ctags/read.h +116 -0
  110. data/ext/vendor/exuberant-ctags/readtags.c +959 -0
  111. data/ext/vendor/exuberant-ctags/readtags.h +252 -0
  112. data/ext/vendor/exuberant-ctags/rexx.c +39 -0
  113. data/ext/vendor/exuberant-ctags/routines.c +891 -0
  114. data/ext/vendor/exuberant-ctags/routines.h +134 -0
  115. data/ext/vendor/exuberant-ctags/ruby.c +408 -0
  116. data/ext/vendor/exuberant-ctags/scheme.c +111 -0
  117. data/ext/vendor/exuberant-ctags/sh.c +115 -0
  118. data/ext/vendor/exuberant-ctags/slang.c +41 -0
  119. data/ext/vendor/exuberant-ctags/sml.c +212 -0
  120. data/ext/vendor/exuberant-ctags/sort.c +230 -0
  121. data/ext/vendor/exuberant-ctags/sort.h +32 -0
  122. data/ext/vendor/exuberant-ctags/source.mak +122 -0
  123. data/ext/vendor/exuberant-ctags/sql.c +2112 -0
  124. data/ext/vendor/exuberant-ctags/strlist.c +281 -0
  125. data/ext/vendor/exuberant-ctags/strlist.h +54 -0
  126. data/ext/vendor/exuberant-ctags/tcl.c +116 -0
  127. data/ext/vendor/exuberant-ctags/tex.c +524 -0
  128. data/ext/vendor/exuberant-ctags/verilog.c +340 -0
  129. data/ext/vendor/exuberant-ctags/vhdl.c +835 -0
  130. data/ext/vendor/exuberant-ctags/vim.c +636 -0
  131. data/ext/vendor/exuberant-ctags/vstring.c +232 -0
  132. data/ext/vendor/exuberant-ctags/vstring.h +85 -0
  133. data/ext/vendor/exuberant-ctags/yacc.c +40 -0
  134. data/lib/ctags/exuberant.rb +45 -0
  135. data/lib/ctags/version.rb +3 -0
  136. data/lib/ctags.rb +6 -0
  137. data/test/test_ctags.rb +24 -0
  138. metadata +233 -0
@@ -0,0 +1,252 @@
1
+ /*
2
+ * $Id: readtags.h 443 2006-05-30 04:37:13Z darren $
3
+ *
4
+ * Copyright (c) 1996-2003, Darren Hiebert
5
+ *
6
+ * This source code is released for the public domain.
7
+ *
8
+ * This file defines the public interface for looking up tag entries in tag
9
+ * files.
10
+ *
11
+ * The functions defined in this interface are intended to provide tag file
12
+ * support to a software tool. The tag lookups provided are sufficiently fast
13
+ * enough to permit opening a sorted tag file, searching for a matching tag,
14
+ * then closing the tag file each time a tag is looked up (search times are
15
+ * on the order of hundreths of a second, even for huge tag files). This is
16
+ * the recommended use of this library for most tool applications. Adhering
17
+ * to this approach permits a user to regenerate a tag file at will without
18
+ * the tool needing to detect and resynchronize with changes to the tag file.
19
+ * Even for an unsorted 24MB tag file, tag searches take about one second.
20
+ */
21
+ #ifndef READTAGS_H
22
+ #define READTAGS_H
23
+
24
+ #ifdef __cplusplus
25
+ extern "C" {
26
+ #endif
27
+
28
+ /*
29
+ * MACROS
30
+ */
31
+
32
+ /* Options for tagsSetSortType() */
33
+ typedef enum {
34
+ TAG_UNSORTED, TAG_SORTED, TAG_FOLDSORTED
35
+ } sortType ;
36
+
37
+ /* Options for tagsFind() */
38
+ #define TAG_FULLMATCH 0x0
39
+ #define TAG_PARTIALMATCH 0x1
40
+
41
+ #define TAG_OBSERVECASE 0x0
42
+ #define TAG_IGNORECASE 0x2
43
+
44
+ /*
45
+ * DATA DECLARATIONS
46
+ */
47
+
48
+ typedef enum { TagFailure = 0, TagSuccess = 1 } tagResult;
49
+
50
+ struct sTagFile;
51
+
52
+ typedef struct sTagFile tagFile;
53
+
54
+ /* This structure contains information about the tag file. */
55
+ typedef struct {
56
+
57
+ struct {
58
+ /* was the tag file successfully opened? */
59
+ int opened;
60
+
61
+ /* errno value when 'opened' is false */
62
+ int error_number;
63
+ } status;
64
+
65
+ /* information about the structure of the tag file */
66
+ struct {
67
+ /* format of tag file (1 = original, 2 = extended) */
68
+ short format;
69
+
70
+ /* how is the tag file sorted? */
71
+ sortType sort;
72
+ } file;
73
+
74
+
75
+ /* information about the program which created this tag file */
76
+ struct {
77
+ /* name of author of generating program (may be null) */
78
+ const char *author;
79
+
80
+ /* name of program (may be null) */
81
+ const char *name;
82
+
83
+ /* URL of distribution (may be null) */
84
+ const char *url;
85
+
86
+ /* program version (may be null) */
87
+ const char *version;
88
+ } program;
89
+
90
+ } tagFileInfo;
91
+
92
+ /* This structure contains information about an extension field for a tag.
93
+ * These exist at the end of the tag in the form "key:value").
94
+ */
95
+ typedef struct {
96
+
97
+ /* the key of the extension field */
98
+ const char *key;
99
+
100
+ /* the value of the extension field (may be an empty string) */
101
+ const char *value;
102
+
103
+ } tagExtensionField;
104
+
105
+ /* This structure contains information about a specific tag. */
106
+ typedef struct {
107
+
108
+ /* name of tag */
109
+ const char *name;
110
+
111
+ /* path of source file containing definition of tag */
112
+ const char *file;
113
+
114
+ /* address for locating tag in source file */
115
+ struct {
116
+ /* pattern for locating source line
117
+ * (may be NULL if not present) */
118
+ const char *pattern;
119
+
120
+ /* line number in source file of tag definition
121
+ * (may be zero if not known) */
122
+ unsigned long lineNumber;
123
+ } address;
124
+
125
+ /* kind of tag (may by name, character, or NULL if not known) */
126
+ const char *kind;
127
+
128
+ /* is tag of file-limited scope? */
129
+ short fileScope;
130
+
131
+ /* miscellaneous extension fields */
132
+ struct {
133
+ /* number of entries in `list' */
134
+ unsigned short count;
135
+
136
+ /* list of key value pairs */
137
+ tagExtensionField *list;
138
+ } fields;
139
+
140
+ } tagEntry;
141
+
142
+
143
+ /*
144
+ * FUNCTION PROTOTYPES
145
+ */
146
+
147
+ /*
148
+ * This function must be called before calling other functions in this
149
+ * library. It is passed the path to the tag file to read and a (possibly
150
+ * null) pointer to a structure which, if not null, will be populated with
151
+ * information about the tag file. If successful, the function will return a
152
+ * handle which must be supplied to other calls to read information from the
153
+ * tag file, and info.status.opened will be set to true. If unsuccessful,
154
+ * info.status.opened will be set to false and info.status.error_number will
155
+ * be set to the errno value representing the system error preventing the tag
156
+ * file from being successfully opened.
157
+ */
158
+ extern tagFile *tagsOpen (const char *const filePath, tagFileInfo *const info);
159
+
160
+ /*
161
+ * This function allows the client to override the normal automatic detection
162
+ * of how a tag file is sorted. Permissible values for `type' are
163
+ * TAG_UNSORTED, TAG_SORTED, TAG_FOLDSORTED. Tag files in the new extended
164
+ * format contain a key indicating whether or not they are sorted. However,
165
+ * tag files in the original format do not contain such a key even when
166
+ * sorted, preventing this library from taking advantage of fast binary
167
+ * lookups. If the client knows that such an unmarked tag file is indeed
168
+ * sorted (or not), it can override the automatic detection. Note that
169
+ * incorrect lookup results will result if a tag file is marked as sorted when
170
+ * it actually is not. The function will return TagSuccess if called on an
171
+ * open tag file or TagFailure if not.
172
+ */
173
+ extern tagResult tagsSetSortType (tagFile *const file, const sortType type);
174
+
175
+ /*
176
+ * Reads the first tag in the file, if any. It is passed the handle to an
177
+ * opened tag file and a (possibly null) pointer to a structure which, if not
178
+ * null, will be populated with information about the first tag file entry.
179
+ * The function will return TagSuccess another tag entry is found, or
180
+ * TagFailure if not (i.e. it reached end of file).
181
+ */
182
+ extern tagResult tagsFirst (tagFile *const file, tagEntry *const entry);
183
+
184
+ /*
185
+ * Step to the next tag in the file, if any. It is passed the handle to an
186
+ * opened tag file and a (possibly null) pointer to a structure which, if not
187
+ * null, will be populated with information about the next tag file entry. The
188
+ * function will return TagSuccess another tag entry is found, or TagFailure
189
+ * if not (i.e. it reached end of file). It will always read the first tag in
190
+ * the file immediately after calling tagsOpen().
191
+ */
192
+ extern tagResult tagsNext (tagFile *const file, tagEntry *const entry);
193
+
194
+ /*
195
+ * Retrieve the value associated with the extension field for a specified key.
196
+ * It is passed a pointer to a structure already populated with values by a
197
+ * previous call to tagsNext(), tagsFind(), or tagsFindNext(), and a string
198
+ * containing the key of the desired extension field. If no such field of the
199
+ * specified key exists, the function will return null.
200
+ */
201
+ extern const char *tagsField (const tagEntry *const entry, const char *const key);
202
+
203
+ /*
204
+ * Find the first tag matching `name'. The structure pointed to by `entry'
205
+ * will be populated with information about the tag file entry. If a tag file
206
+ * is sorted using the C locale, a binary search algorithm is used to search
207
+ * the tag file, resulting in very fast tag lookups, even in huge tag files.
208
+ * Various options controlling the matches can be combined by bit-wise or-ing
209
+ * certain values together. The available values are:
210
+ *
211
+ * TAG_PARTIALMATCH
212
+ * Tags whose leading characters match `name' will qualify.
213
+ *
214
+ * TAG_FULLMATCH
215
+ * Only tags whose full lengths match `name' will qualify.
216
+ *
217
+ * TAG_IGNORECASE
218
+ * Matching will be performed in a case-insenstive manner. Note that
219
+ * this disables binary searches of the tag file.
220
+ *
221
+ * TAG_OBSERVECASE
222
+ * Matching will be performed in a case-senstive manner. Note that
223
+ * this enables binary searches of the tag file.
224
+ *
225
+ * The function will return TagSuccess if a tag matching the name is found, or
226
+ * TagFailure if not.
227
+ */
228
+ extern tagResult tagsFind (tagFile *const file, tagEntry *const entry, const char *const name, const int options);
229
+
230
+ /*
231
+ * Find the next tag matching the name and options supplied to the most recent
232
+ * call to tagsFind() for the same tag file. The structure pointed to by
233
+ * `entry' will be populated with information about the tag file entry. The
234
+ * function will return TagSuccess if another tag matching the name is found,
235
+ * or TagFailure if not.
236
+ */
237
+ extern tagResult tagsFindNext (tagFile *const file, tagEntry *const entry);
238
+
239
+ /*
240
+ * Call tagsTerminate() at completion of reading the tag file, which will
241
+ * close the file and free any internal memory allocated. The function will
242
+ * return TagFailure is no file is currently open, TagSuccess otherwise.
243
+ */
244
+ extern tagResult tagsClose (tagFile *const file);
245
+
246
+ #ifdef __cplusplus
247
+ };
248
+ #endif
249
+
250
+ #endif
251
+
252
+ /* vi:set tabstop=4 shiftwidth=4: */
@@ -0,0 +1,39 @@
1
+ /*
2
+ * $Id: rexx.c 443 2006-05-30 04:37:13Z darren $
3
+ *
4
+ * Copyright (c) 2001-2003, Darren Hiebert
5
+ *
6
+ * This source code is released for free distribution under the terms of the
7
+ * GNU General Public License.
8
+ *
9
+ * This module contains functions for generating tags for the REXX language
10
+ * (http://www.rexxla.org, http://www2.hursley.ibm.com/rexx).
11
+ */
12
+
13
+ /*
14
+ * INCLUDE FILES
15
+ */
16
+ #include "general.h" /* always include first */
17
+ #include "parse.h" /* always include */
18
+
19
+ /*
20
+ * FUNCTION DEFINITIONS
21
+ */
22
+
23
+ static void installRexxRegex (const langType language)
24
+ {
25
+ addTagRegex (language, "^([A-Za-z0-9@#$\\.!?_]+)[ \t]*:",
26
+ "\\1", "s,subroutine,subroutines", NULL);
27
+ }
28
+
29
+ extern parserDefinition* RexxParser (void)
30
+ {
31
+ static const char *const extensions [] = { "cmd", "rexx", "rx", NULL };
32
+ parserDefinition* const def = parserNew ("REXX");
33
+ def->extensions = extensions;
34
+ def->initialize = installRexxRegex;
35
+ def->regex = TRUE;
36
+ return def;
37
+ }
38
+
39
+ /* vi:set tabstop=4 shiftwidth=4: */