~ubuntu-branches/ubuntu/utopic/exuberant-ctags/utopic

« back to all changes in this revision

Viewing changes to cobol.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2004-03-30 11:56:40 UTC
  • Revision ID: james.westby@ubuntu.com-20040330115640-0u2eq56u65zf53il
Tags: upstream-5.5.4
ImportĀ upstreamĀ versionĀ 5.5.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
*   $Id: cobol.c,v 1.5 2003/04/01 04:55:27 darren Exp $
 
3
*
 
4
*   Copyright (c) 2000-2003, Darren Hiebert
 
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 COBOL language
 
10
*   files.
 
11
*/
 
12
 
 
13
/*
 
14
*   INCLUDE FILES
 
15
*/
 
16
#include "general.h"    /* must always come first */
 
17
#include "parse.h"
 
18
 
 
19
/*
 
20
*   FUNCTION DEFINITIONS
 
21
*/
 
22
 
 
23
static void installCobolRegex (const langType language)
 
24
{
 
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");
 
37
}
 
38
 
 
39
extern parserDefinition* CobolParser ()
 
40
{
 
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;
 
46
    def->regex      = TRUE;
 
47
    return def;
 
48
}
 
49
 
 
50
/* vi:set tabstop=8 shiftwidth=4: */