1 /*
2  *   $Id: slang.c 443 2006-05-30 04:37:13Z darren $
3  *
4  *   Copyright (c) 2000-2001, Francesc Rocher
5  *
6  *   Author: Francesc Rocher <f.rocher@computer.org>.
7  *
8  *   This source code is released for free distribution under the terms of the
9  *   GNU General Public License.
10  *
11  *   This module contains functions for generating tags for S-Lang files.
12  */
13 
14 /*
15  *   INCLUDE FILES
16  */
17 #include "general.h"  /* must always come first */
18 #include "parse.h"
19 
20 /*
21  *   FUNCTION DEFINITIONS
22  */
installSlangRegex(const langType language)23 static void installSlangRegex (const langType language)
24 {
25 	addTagRegex (language,
26 		"^.*define[ \t]+([A-Z_][A-Z0-9_]*)[^;]*$",
27 		"\\1", "f,function,functions", "i");
28 	addTagRegex (language,
29 		"^[ \t]*implements[ \t]+\\([ \t]*\"([^\"]*)\"[ \t]*\\)[ \t]*;",
30 		"\\1", "n,namespace,namespaces", NULL);
31 }
32 
SlangParser(void)33 extern parserDefinition* SlangParser (void)
34 {
35 	static const char *const extensions [] = { "sl", NULL };
36 	parserDefinition* const def = parserNew ("SLang");
37 	def->extensions = extensions;
38 	def->initialize = installSlangRegex;
39 	def->regex      = TRUE;
40 	return def;
41 }
42