root/libparser/parser.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * Copyright (c) 2009, 2010
   3  *      Tama Communications Corporation
   4  *
   5  * This file is part of GNU GLOBAL.
   6  *
   7  * This program is free software: you can redistribute it and/or modify
   8  * it under the terms of the GNU General Public License as published by
   9  * the Free Software Foundation, either version 3 of the License, or
  10  * (at your option) any later version.
  11  * 
  12  * This program is distributed in the hope that it will be useful,
  13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15  * GNU General Public License for more details.
  16  * 
  17  * You should have received a copy of the GNU General Public License
  18  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  19  */
  20 
  21 #ifndef _PARSER_H_
  22 #define _PARSER_H_
  23 
  24 /*
  25  * Built-in parser base on gctags
  26  */
  27 
  28 void parser_init(const char *, const char *);
  29 void parser_exit(void);
  30 
  31 /** @name tag type */
  32 /** @{ */
  33                         /** definition */
  34 #define PARSER_DEF              1
  35                         /** reference or other symbol */
  36 #define PARSER_REF_SYM          2
  37 /** @} */
  38 
  39 /** @name flags */
  40 /** @{ */
  41                         /** debug mode */
  42 #define PARSER_DEBUG            1
  43                         /** verbose mode */
  44 #define PARSER_VERBOSE          2
  45                         /** print warning message */
  46 #define PARSER_WARNING          4
  47                         /** force level 1 block end */
  48 #define PARSER_END_BLOCK        8
  49                         /** force level 1 block start */
  50 #define PARSER_BEGIN_BLOCK      16
  51 /** @} */
  52 
  53 typedef void (*PARSER_CALLBACK)(int, const char *, int, const char *, const char *, void *);
  54 
  55 void parse_file(const char *, int, PARSER_CALLBACK, void *);
  56 
  57 struct parser_param {
  58         int size;               /**< size of this structure */
  59         int flags;
  60         const char *file;
  61         PARSER_CALLBACK put;
  62         void *arg;
  63         int (*isnotfunction)(const char *);
  64         const char *langmap;
  65         void (*die)(const char *, ...);
  66         void (*warning)(const char *, ...);
  67         void (*message)(const char *, ...);
  68 };
  69 
  70 #endif

/* [previous][next][first][last][top][bottom][index][help] */