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).
16 #include "general.h" /* must always come first */
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
)
51 vStringCatS(name
, " / ");
52 vStringCatS(name
, (const char *) line
);
53 makeSimpleTag(name
, K_SECTION
);
58 vStringCatS(name
, (const char*) line
);
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
;