2
* $Id: cobol.c,v 1.5 2003/04/01 04:55:27 darren Exp $
4
* Copyright (c) 2000-2003, Darren Hiebert
6
* This source code is released for free distribution under the terms of the
7
* GNU General Public License.
9
* This module contains functions for generating tags for COBOL language
16
#include "general.h" /* must always come first */
20
* FUNCTION DEFINITIONS
23
static void installCobolRegex (const langType language)
25
addTagRegex (language, "^[ \t]*[0-9]+[ \t]+([A-Z0-9][A-Z0-9-]*)[ \t]+(BLANK|OCCURS|IS|JUST|PIC|REDEFINES|RENAMES|SIGN|SYNC|USAGE|VALUE)",
26
"\\1", "d,data,data items", "i");
27
addTagRegex (language, "^[ \t]*[FSR]D[ \t]+([A-Z0-9][A-Z0-9-]*)\\.",
28
"\\1", "f,file,file descriptions (FD, SD, RD)", "i");
29
addTagRegex (language, "^[ \t]*[0-9]+[ \t]+([A-Z0-9][A-Z0-9-]*)\\.",
30
"\\1", "g,group,group items", "i");
31
addTagRegex (language, "^[ \t]*([A-Z0-9][A-Z0-9-]*)\\.",
32
"\\1", "p,paragraph,paragraphs", "i");
33
addTagRegex (language, "^[ \t]*PROGRAM-ID\\.[ \t]+([A-Z0-9][A-Z0-9-]*)\\.",
34
"\\1", "P,program,program ids", "i");
35
addTagRegex (language, "^[ \t]*([A-Z0-9][A-Z0-9-]*)[ \t]+SECTION\\.",
36
"\\1", "s,section,sections", "i");
39
extern parserDefinition* CobolParser ()
41
static const char *const extensions [] = {
42
"cbl", "cob", "CBL", "COB", NULL };
43
parserDefinition* def = parserNew ("Cobol");
44
def->extensions = extensions;
45
def->initialize = installCobolRegex;
50
/* vi:set tabstop=8 shiftwidth=4: */