Small update of German translation
[geany-mirror.git] / ctags / parsers / abc.c
blob00d22ebb4e1a06d54673b9017b45b20cfa463a6d
1 /*
2 * Copyright (c) 2009, Eric Forgeot
4 * Based on work by Jon Strait
6 * This source code is released for free distribution under the terms of the
7 * GNU General Public License version 2 or (at your opinion) any later version.
9 * This module contains functions for generating tags for Abc files
10 * (https://en.wikipedia.org/wiki/ABC_notation).
14 * INCLUDE FILES
16 #include "general.h" /* must always come first */
18 #include <ctype.h>
19 #include <string.h>
21 #include "parse.h"
22 #include "read.h"
23 #include "vstring.h"
24 #include "routines.h"
25 #include "entry.h"
28 * DATA DEFINITIONS
31 typedef enum {
32 K_SECTION,
33 } AbcKind;
35 static kindDefinition AbcKinds[] = {
36 { true, 's', "section", "sections" },
40 * FUNCTION DEFINITIONS
43 static void findAbcTags (void)
45 vString *name = vStringNew();
46 const unsigned char *line;
48 while ((line = readLineFromInputFile()) != NULL)
50 if (line[0] == 'T') {
51 vStringCatS(name, " / ");
52 vStringCatS(name, (const char *) line);
53 makeSimpleTag(name, K_SECTION);
55 else {
56 vStringClear (name);
57 if (! isspace(*line))
58 vStringCatS(name, (const char*) line);
61 vStringDelete (name);
64 extern parserDefinition* AbcParser (void)
66 static const char *const patterns [] = { "*.abc", NULL };
67 static const char *const extensions [] = { "abc", NULL };
68 parserDefinition* const def = parserNew ("Abc");
70 def->kindTable = AbcKinds;
71 def->kindCount = ARRAY_SIZE (AbcKinds);
72 def->patterns = patterns;
73 def->extensions = extensions;
74 def->parser = findAbcTags;
75 return def;