| 1 |
/* |
| 2 |
* $Id$ |
| 3 |
* |
| 4 |
* Copyright (c) 2009, David Fishburn |
| 5 |
* |
| 6 |
* This source code is released for free distribution under the terms of the |
| 7 |
* GNU General Public License. |
| 8 |
* |
| 9 |
* This module contains functions for generating tags for DOS Batch language files. |
| 10 |
*/ |
| 11 |
|
| 12 |
/* |
| 13 |
* INCLUDE FILES |
| 14 |
*/ |
| 15 |
#include "general.h" /* must always come first */ |
| 16 |
|
| 17 |
#include <string.h> |
| 18 |
#include "parse.h" |
| 19 |
|
| 20 |
/* |
| 21 |
* FUNCTION DEFINITIONS |
| 22 |
*/ |
| 23 |
|
| 24 |
static void installDosBatchRegex (const langType language) |
| 25 |
{ |
| 26 |
addTagRegex (language, |
| 27 |
"^:([A-Za-z_0-9]+)", "\\1", "l,label,labels", NULL); |
| 28 |
addTagRegex (language, |
| 29 |
"set[ \t]+([A-Za-z_0-9]+)[ \t]*=", "\\1", "v,variable,variables", NULL); |
| 30 |
} |
| 31 |
|
| 32 |
extern parserDefinition* DosBatchParser () |
| 33 |
{ |
| 34 |
static const char *const extensions [] = { "bat", "cmd", NULL }; |
| 35 |
parserDefinition* const def = parserNew ("DosBatch"); |
| 36 |
def->extensions = extensions; |
| 37 |
def->initialize = installDosBatchRegex; |
| 38 |
def->regex = TRUE; |
| 39 |
return def; |
| 40 |
} |
| 41 |
|
| 42 |
/* vi:set tabstop=4 shiftwidth=4: */ |