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