xref: /Universal-ctags/parsers/slang.c (revision 5654c1fbb564671996694cb1ab0e672b19377394)
1 /*
2  *   Copyright (c) 2000-2001, Francesc Rocher
3  *
4  *   Author: Francesc Rocher <f.rocher@computer.org>.
5  *
6  *   This source code is released for free distribution under the terms of the
7  *   GNU General Public License version 2 or (at your option) any later version.
8  *
9  *   This module contains functions for generating tags for S-Lang files.
10  */
11 
12 /*
13  *   INCLUDE FILES
14  */
15 #include "general.h"  /* must always come first */
16 #include "parse.h"
17 #include "routines.h"
18 
19 static tagRegexTable slangTagRegexTable [] = {
20 	{"^.*define[ \t]+([A-Z_][A-Z0-9_]*)[^;]*$", "\\1",
21 	 "f,function,functions", "i"},
22 	{"^[ \t]*implements[ \t]+\\([ \t]*\"([^\"]*)\"[ \t]*\\)[ \t]*;", "\\1",
23 	 "n,namespace,namespaces", NULL},
24 };
25 
26 /*
27  *   FUNCTION DEFINITIONS
28  */
29 
SlangParser(void)30 extern parserDefinition* SlangParser (void)
31 {
32 	static const char *const extensions [] = { "sl", NULL };
33 	parserDefinition* const def = parserNew ("SLang");
34 	def->extensions = extensions;
35 	def->tagRegexTable = slangTagRegexTable;
36 	def->tagRegexCount = ARRAY_SIZE (slangTagRegexTable);
37 	def->method     = METHOD_NOT_CRAFTED|METHOD_REGEX;
38 	return def;
39 }
40