xref: /Universal-ctags/parsers/m4.h (revision 3758eeebe5c7cd08aec829dec83df7a6c5b397b6)
1 /*
2 *   Copyright (c) 2016, Masatake YAMATO
3 *
4 *   This source code is released for free distribution under the terms of the
5 *   GNU General Public License version 2 or (at your option) any later version.
6 *
7 *   This module contains functions for generating tags for makefiles.
8 */
9 
10 #ifndef CTAGS_PARSER_M4_H
11 #define CTAGS_PARSER_M4_H
12 
13 /*
14 *   INCLUDE FILES
15 */
16 #include "general.h"  /* must always come first */
17 #include "types.h"
18 #include "subparser.h"
19 #include "vstring.h"
20 
21 typedef struct sM4Subparser m4Subparser;
22 struct sM4Subparser {
23 	subparser subparser;
24 
25 	bool (* probeLanguage) (m4Subparser *m4, const char* token);
26 
27 	/* return value: Cork index */
28 	int  (* newMacroNotify) (m4Subparser *m4, const char* token);
29 
30 	bool (* doesLineCommentStart)   (m4Subparser *m4, int c, const char *token);
31 	bool (* doesStringLiteralStart) (m4Subparser *m4, int c);
32 };
33 
34 /* Helpers functions */
35 extern bool readM4MacroArgument(vString *const arg);
36 extern void setM4Quotes(char openQuote, char closeQuote);
37 
38 #endif
39