Permalink
Browse files

Upstream.

  • Loading branch information...
Alexey Marinichev
Alexey Marinichev committed Sep 4, 2010
0 parents commit 9921cabddcf23fa4d9c63a1307786201cc00373f
Showing with 73,084 additions and 0 deletions.
  1. +31 −0 .indent.pro
  2. +1 −0 .pc/.version
  3. +2 −0 .pc/applied-patches
  4. +217 −0 .pc/make-match-loop.patch/make.c
  5. +237 −0 .pc/php-ignore-keywords-in-comments.patch/php.c
  6. +340 −0 COPYING
  7. +386 −0 EXTENDING.html
  8. +371 −0 FAQ
  9. +215 −0 INSTALL
  10. +73 −0 INSTALL.oth
  11. +88 −0 MAINTAINERS
  12. +222 −0 Makefile.in
  13. +871 −0 NEWS
  14. +73 −0 README
  15. +42 −0 ant.c
  16. +505 −0 argproc.c
  17. +274 −0 args.c
  18. +63 −0 args.h
  19. +387 −0 asm.c
  20. +328 −0 asp.c
  21. +81 −0 awk.c
  22. +203 −0 basic.c
  23. +321 −0 beta.c
  24. +2,932 −0 c.c
  25. +50 −0 cobol.c
  26. +277 −0 config.h.in
  27. +7,704 −0 configure
  28. +532 −0 configure.ac
  29. +1,186 −0 ctags.1
  30. +28 −0 ctags.h
  31. +2,087 −0 ctags.html
  32. +40 −0 ctags.spec
  33. +312 −0 debian/changelog
  34. +1 −0 debian/compat
  35. +25 −0 debian/control
  36. +16 −0 debian/copyright
  37. +2 −0 debian/dirs
  38. +1 −0 debian/docs
  39. +21 −0 debian/patches/make-match-loop.patch
  40. +46 −0 debian/patches/php-ignore-keywords-in-comments.patch
  41. +2 −0 debian/patches/series
  42. +23 −0 debian/postinst
  43. +17 −0 debian/prerm
  44. +22 −0 debian/rules
  45. +1 −0 debian/source/format
  46. +2 −0 debian/watch
  47. +113 −0 debug.c
  48. +70 −0 debug.h
  49. +68 −0 descrip.mms
  50. +42 −0 dosbatch.c
  51. +24 −0 e_amiga.h
  52. +47 −0 e_djgpp.h
  53. +143 −0 e_mac.h
  54. +76 −0 e_msoft.h
  55. +37 −0 e_os2.h
  56. +34 −0 e_qdos.h
  57. +58 −0 e_riscos.h
  58. +31 −0 e_vms.h
  59. +1,352 −0 eiffel.c
  60. +847 −0 entry.c
  61. +103 −0 entry.h
  62. +189 −0 erlang.c
  63. +2,243 −0 flex.c
  64. +2,197 −0 fortran.c
  65. +127 −0 general.h
  66. +669 −0 get.c
  67. +50 −0 get.h
  68. +47 −0 gnu_regex/.svn/all-wcprops
  69. +112 −0 gnu_regex/.svn/entries
  70. +5 −0 gnu_regex/.svn/text-base/README.txt.svn-base
  71. +3,818 −0 gnu_regex/.svn/text-base/regcomp.c.svn-base
  72. +74 −0 gnu_regex/.svn/text-base/regex.c.svn-base
  73. +575 −0 gnu_regex/.svn/text-base/regex.h.svn-base
  74. +1,713 −0 gnu_regex/.svn/text-base/regex_internal.c.svn-base
  75. +773 −0 gnu_regex/.svn/text-base/regex_internal.h.svn-base
  76. +4,338 −0 gnu_regex/.svn/text-base/regexec.c.svn-base
  77. +5 −0 gnu_regex/README.txt
  78. +3,818 −0 gnu_regex/regcomp.c
  79. +74 −0 gnu_regex/regex.c
  80. +575 −0 gnu_regex/regex.h
  81. +1,713 −0 gnu_regex/regex_internal.c
  82. +773 −0 gnu_regex/regex_internal.h
  83. +4,338 −0 gnu_regex/regexec.c
  84. +49 −0 html.c
  85. +1,572 −0 jscript.c
  86. +258 −0 keyword.c
  87. +34 −0 keyword.h
  88. +139 −0 lisp.c
  89. +704 −0 lregex.c
  90. +133 −0 lua.c
  91. +273 −0 mac.c
  92. +21 −0 magic.diff
  93. +579 −0 main.c
  94. +32 −0 main.h
  95. +476 −0 maintainer.mak
  96. +217 −0 make.c
  97. +44 −0 matlab.c
  98. +46 −0 mk_bc3.mak
  99. +49 −0 mk_bc5.mak
  100. +18 −0 mk_djg.mak
  101. +65 −0 mk_manx.mak
  102. +31 −0 mk_mingw.mak
  103. +130 −0 mk_mpw.mak
  104. +40 −0 mk_mvc.mak
  105. +104 −0 mk_os2.mak
  106. +100 −0 mk_qdos.mak
  107. +63 −0 mk_sas.mak
  108. +40 −0 mkinstalldirs
  109. +1,842 −0 ocaml.c
  110. +1,829 −0 options.c
  111. +154 −0 options.h
  112. +677 −0 parse.c
  113. +129 −0 parse.h
  114. +63 −0 parsers.h
  115. +267 −0 pascal.c
  116. +382 −0 perl.c
  117. +237 −0 php.c
  118. +771 −0 python.c
  119. +106 −0 qdos.c
  120. +564 −0 read.c
  121. +116 −0 read.h
  122. +959 −0 readtags.c
  123. +252 −0 readtags.h
  124. +39 −0 rexx.c
  125. +891 −0 routines.c
  126. +134 −0 routines.h
  127. +408 −0 ruby.c
  128. +111 −0 scheme.c
  129. +115 −0 sh.c
  130. +41 −0 slang.c
  131. +212 −0 sml.c
  132. +230 −0 sort.c
  133. +32 −0 sort.h
  134. +122 −0 source.mak
  135. +2,112 −0 sql.c
  136. +281 −0 strlist.c
  137. +54 −0 strlist.h
  138. +116 −0 tcl.c
  139. +524 −0 tex.c
  140. +340 −0 verilog.c
  141. +835 −0 vhdl.c
  142. +636 −0 vim.c
  143. +232 −0 vstring.c
  144. +85 −0 vstring.h
  145. +40 −0 yacc.c
@@ -0,0 +1,31 @@
+--blank-before-sizeof
+--blank-lines-after-procedures
+--brace-indent0
+--braces-after-if-line
+--braces-on-struct-decl-line
+--break-after-boolean-operator
+--case-brace-indentation0
+--case-indentation0
+--comment-indentation0
+--continuation-indentation4
+--cuddle-do-while
+--declaration-comment-column0
+--declaration-indentation0
+--dont-break-function-decl-args
+--dont-break-procedure-type
+--dont-line-up-parentheses
+--honour-newlines
+--indent-level4
+--line-length80
+--paren-indentation4
+--preprocessor-indentation1
+--no-blank-lines-after-commas
+--space-after-cast
+--space-after-for
+--space-after-if
+--space-after-procedure-calls
+--space-after-while
+--space-special-semicolon
+--start-left-side-of-comments
+--struct-brace-indentation4
+--tab-size4
@@ -0,0 +1 @@
+2
@@ -0,0 +1,2 @@
+make-match-loop.patch
+php-ignore-keywords-in-comments.patch
@@ -0,0 +1,217 @@
+/*
+* $Id: make.c 681 2008-10-12 22:43:00Z dhiebert $
+*
+* Copyright (c) 2000-2005, Darren Hiebert
+*
+* This source code is released for free distribution under the terms of the
+* GNU General Public License.
+*
+* This module contains functions for generating tags for makefiles.
+*/
+
+/*
+* INCLUDE FILES
+*/
+#include "general.h" /* must always come first */
+
+#include <string.h>
+#include <ctype.h>
+
+#include "options.h"
+#include "parse.h"
+#include "read.h"
+#include "vstring.h"
+
+/*
+* DATA DEFINITIONS
+*/
+typedef enum {
+ K_MACRO
+} shKind;
+
+static kindOption MakeKinds [] = {
+ { TRUE, 'm', "macro", "macros"}
+};
+
+/*
+* FUNCTION DEFINITIONS
+*/
+
+static int nextChar (void)
+{
+ int c = fileGetc ();
+ if (c == '\\')
+ {
+ c = fileGetc ();
+ if (c == '\n')
+ c = fileGetc ();
+ }
+ return c;
+}
+
+static void skipLine (void)
+{
+ int c;
+ do
+ c = nextChar ();
+ while (c != EOF && c != '\n');
+ if (c == '\n')
+ fileUngetc (c);
+}
+
+static int skipToNonWhite (void)
+{
+ int c;
+ do
+ c = nextChar ();
+ while (c != '\n' && isspace (c));
+ return c;
+}
+
+static boolean isIdentifier (int c)
+{
+ return (boolean)(c != '\0' && (isalnum (c) || strchr (".-_", c) != NULL));
+}
+
+static void readIdentifier (const int first, vString *const id)
+{
+ int c = first;
+ vStringClear (id);
+ while (isIdentifier (c))
+ {
+ vStringPut (id, c);
+ c = nextChar ();
+ }
+ fileUngetc (c);
+ vStringTerminate (id);
+}
+
+static void skipToMatch (const char *const pair)
+{
+ const int begin = pair [0], end = pair [1];
+ const unsigned long inputLineNumber = getInputLineNumber ();
+ int matchLevel = 1;
+ int c = '\0';
+
+ while (matchLevel > 0)
+ {
+ c = nextChar ();
+ if (c == begin)
+ ++matchLevel;
+ else if (c == end)
+ --matchLevel;
+ else if (c == '\n')
+ break;
+ }
+ if (c == EOF)
+ verbose ("%s: failed to find match for '%c' at line %lu\n",
+ getInputFileName (), begin, inputLineNumber);
+}
+
+static void findMakeTags (void)
+{
+ vString *name = vStringNew ();
+ boolean newline = TRUE;
+ boolean in_define = FALSE;
+ boolean in_rule = FALSE;
+ boolean variable_possible = TRUE;
+ int c;
+
+ while ((c = nextChar ()) != EOF)
+ {
+ if (newline)
+ {
+ if (in_rule)
+ {
+ if (c == '\t')
+ {
+ skipLine (); /* skip rule */
+ continue;
+ }
+ else
+ in_rule = FALSE;
+ }
+ variable_possible = (boolean)(!in_rule);
+ newline = FALSE;
+ }
+ if (c == '\n')
+ newline = TRUE;
+ else if (isspace (c))
+ continue;
+ else if (c == '#')
+ skipLine ();
+ else if (c == '(')
+ skipToMatch ("()");
+ else if (c == '{')
+ skipToMatch ("{}");
+ else if (c == ':')
+ {
+ variable_possible = TRUE;
+ in_rule = TRUE;
+ }
+ else if (variable_possible && isIdentifier (c))
+ {
+ readIdentifier (c, name);
+ if (strcmp (vStringValue (name), "endef") == 0)
+ in_define = FALSE;
+ else if (in_define)
+ skipLine ();
+ else if (strcmp (vStringValue (name), "define") == 0 &&
+ isIdentifier (c))
+ {
+ in_define = TRUE;
+ c = skipToNonWhite ();
+ readIdentifier (c, name);
+ makeSimpleTag (name, MakeKinds, K_MACRO);
+ skipLine ();
+ }
+ else {
+ if (strcmp(vStringValue (name), "export") == 0 &&
+ isIdentifier (c))
+ {
+ c = skipToNonWhite ();
+ readIdentifier (c, name);
+ }
+ c = skipToNonWhite ();
+ if (strchr (":?+", c) != NULL)
+ {
+ boolean append = (boolean)(c == '+');
+ if (c == ':')
+ in_rule = TRUE;
+ c = nextChar ();
+ if (c != '=')
+ fileUngetc (c);
+ else if (append)
+ {
+ skipLine ();
+ continue;
+ }
+ }
+ if (c == '=')
+ {
+ makeSimpleTag (name, MakeKinds, K_MACRO);
+ in_rule = FALSE;
+ skipLine ();
+ }
+ }
+ }
+ else
+ variable_possible = FALSE;
+ }
+ vStringDelete (name);
+}
+
+extern parserDefinition* MakefileParser (void)
+{
+ static const char *const patterns [] = { "[Mm]akefile", "GNUmakefile", NULL };
+ static const char *const extensions [] = { "mak", "mk", NULL };
+ parserDefinition* const def = parserNew ("Make");
+ def->kinds = MakeKinds;
+ def->kindCount = KIND_COUNT (MakeKinds);
+ def->patterns = patterns;
+ def->extensions = extensions;
+ def->parser = findMakeTags;
+ return def;
+}
+
+/* vi:set tabstop=4 shiftwidth=4: */
Oops, something went wrong.

0 comments on commit 9921cab

Please sign in to comment.