File: yacc.c

package info (click to toggle)
exuberant-ctags 1%3A5.9~svn20110310-12
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,544 kB
  • sloc: ansic: 35,516; makefile: 134; sh: 36
file content (40 lines) | stat: -rw-r--r-- 917 bytes parent folder | download | duplicates (20)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
*   $Id: yacc.c 443 2006-05-30 04:37:13Z darren $
*
*   Copyright (c) 2001-2002, Nick Hibma <n_hibma@van-laarhoven.org>
*
*   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 YACC language files.
*/

/*
*   INCLUDE FILES
*/
#include "general.h"  /* must always come first */

#include <string.h>
#include "parse.h"

/*
*   FUNCTION DEFINITIONS
*/

static void installYaccRegex (const langType language)
{
	addTagRegex (language,
		"^([A-Za-z][A-Za-z_0-9]+)[ \t]*:", "\\1", "l,label,labels", NULL);
}

extern parserDefinition* YaccParser ()
{
	static const char *const extensions [] = { "y", NULL };
	parserDefinition* const def = parserNew ("YACC");
	def->extensions = extensions;
	def->initialize = installYaccRegex;
	def->regex      = TRUE;
	return def;
}

/* vi:set tabstop=4 shiftwidth=4: */