xref: /Universal-ctags/parsers/cxx/cxx_subparser.h (revision 2dcc3ff00cae83075a98879485e3e1d4b5d0edb8)
1 #ifndef ctags_cxx_subparser_h_
2 #define ctags_cxx_subparser_h_
3 /*
4  *  Copyright (c) 2017, Red Hat, Inc.
5 *   Copyright (c) 2017, Masatake YAMATO
6 *
7 *   This source code is released for free distribution under the terms of the
8 *   GNU General Public License version 2 or (at your option) any later version.
9 *
10 *   This module contains functions for parsing and scanning C++ source files
11 */
12 
13 #include "general.h"
14 
15 #include "subparser.h"
16 
17 #include "cxx_token.h"
18 
19 
20 typedef struct sCxxSubparser cxxSubparser;
21 struct sCxxSubparser {
22 	subparser subparser;
23 
24 	void (* enterBlockNotify) (struct sCxxSubparser *pSubparser);
25 	void (* leaveBlockNotify) (struct sCxxSubparser *pSubparser);
26 
27 	/* Return true if the base parser should delete the token. */
28 	bool (* newIdentifierAsHeadOfMemberNotify) (struct sCxxSubparser *pSubparser,
29 											  CXXToken * pToken);
30 
31 	/* Return true if the subparser consumes the token and the base
32 	   parser should not call the other subparsers. */
33 	bool (* unknownIdentifierInClassNotify) (struct sCxxSubparser *pSubparser,
34 											 CXXToken * pToken);
35 
36 	/* Return true from parseAccessSpecifierNotify () if a subparser
37 	   has an interest in extra identifier in place where an access
38 	   specifier is written. The token holding the extra identifier
39 	   has passed via foundExtraIdentifierAsAccessSpecifier method. */
40 	bool (* parseAccessSpecifierNotify) (struct sCxxSubparser *pSubparser);
41 	void (* foundExtraIdentifierAsAccessSpecifier) (struct sCxxSubparser *pSubparser,
42 													CXXToken * pToken);
43 };
44 
45 #endif //!ctags_cxx_subparser_h_
46