geany  1.38
About: Geany is a text editor (using GTK2) with basic features of an integrated development environment (syntax highlighting, code folding, symbol name auto-completion, ...). F: office T: editor programming GTK+ IDE
  Fossies Dox: geany-1.38.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

parse_p.h
Go to the documentation of this file.
1/*
2* Copyright (c) 1998-2003, Darren Hiebert
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* Private definitions for parsing support.
8*/
9#ifndef CTAGS_MAIN_PARSE_PRIVATE_H
10#define CTAGS_MAIN_PARSE_PRIVATE_H
11
12/*
13* INCLUDE FILES
14*/
15#include "general.h" /* must always come first */
16#include "kind.h"
17#include "lregex_p.h"
18#include "parse.h"
19#include "parsers_p.h" /* contains list of parsers */
20#include "strlist.h"
21#ifdef EXTERNAL_PARSER_LIST_FILE
22#include EXTERNAL_PARSER_LIST_FILE
23#endif
24
25/*
26* MACROS
27*/
28#define LANG_FALLBACK (1)
29
30/*
31* DATA DECLARATIONS
32*/
33typedef enum {
34 LMAP_PATTERN = 1 << 0,
39
40/*
41* FUNCTION PROTOTYPES
42*/
43
44/* Each parsers' definition function is called. The routine is expected to
45 * return a structure allocated using parserNew(). This structure must,
46 * at minimum, set the `parser' field.
47 */
48#ifdef EXTERNAL_PARSER_LIST
50#else /* ! EXTERNAL_PARSER_LIST */
52#ifdef HAVE_LIBXML
54#endif
55#ifdef HAVE_LIBYAML
57#endif
58#ifdef HAVE_PACKCC
60#endif
61#endif /* EXTERNAL_PARSER_LIST */
62
63extern bool doesLanguageAllowNullTag (const langType language);
64extern bool doesLanguageRequestAutomaticFQTag (const langType language);
65
66extern langType getNamedLanguageFull (const char *const name, size_t len, bool noPretending);
67
68extern kindDefinition* getLanguageKind(const langType language, int kindIndex);
69extern kindDefinition* getLanguageKindForName (const langType language, const char *kindName);
70extern roleDefinition* getLanguageRole(const langType language, int kindIndex, int roleIndex);
71extern roleDefinition* getLanguageRoleForName (const langType language, int kindIndex,
72 const char *roleName);
73
74
75extern int defineLanguageKind (const langType language, kindDefinition *def,
76 freeKindDefFunc freeKindDef);
77
78extern unsigned int countLanguageKinds (const langType language);
79extern unsigned int countLanguageRoles (const langType language, int kindIndex);
80
81extern bool isLanguageKindRefOnly (const langType language, int kindIndex);
82
83extern bool isLanguageVisible (const langType language);
84
85
86extern void installLanguageMapDefault (const langType language);
87extern void installLanguageMapDefaults (void);
88extern void clearLanguageMap (const langType language);
89extern bool removeLanguageExtensionMap (const langType language, const char *const extension);
90extern void addLanguageExtensionMap (const langType language, const char* extension,
91 bool exclusiveInAllLanguages);
92extern bool removeLanguagePatternMap (const langType language, const char *const pattern);
93extern void addLanguagePatternMap (const langType language, const char* ptrn,
94 bool exclusiveInAllLanguages);
95
96extern void installLanguageAliasesDefault (const langType language);
97extern void installLanguageAliasesDefaults (void);
98extern void clearLanguageAliases (const langType language);
99extern void addLanguageAlias (const langType language, const char* alias);
100
101extern void printLanguageMaps (const langType language, langmapType type,
102 bool withListHeader, bool machinable, FILE *fp);
103extern void enableLanguages (const bool state);
104extern void enableLanguage (const langType language, const bool state);
105extern void initializeParsing (void);
106
107extern unsigned int countParsers (void);
108extern void freeParserResources (void);
109extern void enableDefaultFileKind (bool state);
110extern void printLanguageKinds (const langType language, bool allKindFields,
111 bool withListHeader, bool machinable, FILE *fp);
112extern void printLanguageRoles (const langType language, const char* letters,
113 bool withListHeader, bool machinable, FILE *fp);
114extern void printLanguageAliases (const langType language,
115 bool withListHeader, bool machinable, FILE *fp);
116extern void printLanguageList (void);
117extern void printLanguageParameters (const langType language,
118 bool withListHeader, bool machinable, FILE *fp);
119extern void printLanguageSubparsers (const langType language,
120 bool withListHeader, bool machinable, FILE *fp);
121extern void printLangdefFlags (bool withListHeader, bool machinable, FILE *fp);
122extern void printKinddefFlags (bool withListHeader, bool machinable, FILE *fp);
123extern bool doesParserRequireMemoryStream (const langType language);
124extern bool parseFile (const char *const fileName);
125extern bool parseFileWithMio (const char *const fileName, MIO *mio, void *clientData);
126extern bool parseRawBuffer(const char *fileName, unsigned char *buffer,
127 size_t bufferSize, const langType language, void *clientData);
128
129extern bool runParserInNarrowedInputStream (const langType language,
130 unsigned long startLine, long startCharOffset,
131 unsigned long endLine, long endCharOffset,
132 unsigned long sourceLineOffset,
133 int promise);
134
135#ifdef HAVE_ICONV
136extern void freeEncodingResources (void);
137#endif
138
139/* Regex interface */
140extern bool processLanguageRegexOption (langType language, enum regexParserType regptype, const char *const parameter);
141extern void notifyLanguageRegexInputStart (langType language);
142extern void notifyLanguageRegexInputEnd (langType language);
143
144extern void matchLanguageRegex (const langType language, const vString* const line);
145extern void freeRegexResources (void);
146extern bool checkRegex (void);
147extern void useRegexMethod (const langType language);
148extern void printRegexFlags (bool withListHeader, bool machinable, FILE *fp);
149extern void printMultilineRegexFlags (bool withListHeader, bool machinable, FILE *fp);
150extern void printMultitableRegexFlags (bool withListHeader, bool machinable, FILE *fp);
151extern bool hasLanguageScopeActionInRegex (const langType language);
152
153/* Multiline Regex Interface */
154extern bool hasLanguageMultilineRegexPatterns (const langType language);
155extern void matchLanguageMultilineRegex (const langType language, const vString* const allLines);
156extern void matchLanguageMultitableRegex (const langType language, const vString* const allLines);
157
158extern void processLanguageMultitableExtendingOption (langType language, const char *const parameter);
159
160extern unsigned int getXpathFileSpecCount (const langType language);
161extern xpathFileSpec* getXpathFileSpec (const langType language, unsigned int nth);
162
163const tagXpathTableTable *getXpathTableTable (const langType language, unsigned int nth);
164
165extern bool makeKindSeparatorsPseudoTags (const langType language,
166 const ptagDesc *pdesc);
167extern bool makeKindDescriptionsPseudoTags (const langType language,
168 const ptagDesc *pdesc);
169extern bool makeFieldDescriptionsPseudoTags (const langType language,
170 const ptagDesc *pdesc);
171extern bool makeExtraDescriptionsPseudoTags (const langType language,
172 const ptagDesc *pdesc);
173
174extern void printLanguageMultitableStatistics (langType language);
175extern void printParserStatisticsIfUsed (langType lang);
176
177#endif /* CTAGS_MAIN_PARSE_PRIVATE_H */
const gchar * name
Definition: document.c:3219
vString * line
Definition: geany_cobol.c:133
void(* freeKindDefFunc)(kindDefinition *)
Definition: kind_p.h:24
regexParserType
Definition: lregex_p.h:28
parserDefinition *() parserDefinitionFunc(void)
Definition: parse.h:125
void printMultitableRegexFlags(bool withListHeader, bool machinable, FILE *fp)
Definition: lregex.c:2216
void printLanguageAliases(const langType language, bool withListHeader, bool machinable, FILE *fp)
Definition: parse.c:3501
langType getNamedLanguageFull(const char *const name, size_t len, bool noPretending)
Definition: parse.c:373
void installLanguageAliasesDefaults(void)
Definition: parse.c:1626
void printLanguageMultitableStatistics(langType language)
Definition: parse.c:4930
void processLanguageMultitableExtendingOption(langType language, const char *const parameter)
Definition: parse.c:4203
unsigned int countParsers(void)
Definition: parse.c:177
kindDefinition * getLanguageKind(const langType language, int kindIndex)
Definition: parse.c:317
void printLanguageMaps(const langType language, langmapType type, bool withListHeader, bool machinable, FILE *fp)
Definition: parse.c:3426
void freeRegexResources(void)
Definition: lregex.c:2233
bool removeLanguageExtensionMap(const langType language, const char *const extension)
Definition: parse.c:1705
bool hasLanguageScopeActionInRegex(const langType language)
Definition: parse.c:4261
void installLanguageMapDefault(const langType language)
Definition: parse.c:1560
void initializeParsing(void)
Definition: parse.c:1907
bool makeFieldDescriptionsPseudoTags(const langType language, const ptagDesc *pdesc)
Definition: parse.c:4599
bool doesLanguageRequestAutomaticFQTag(const langType language)
Definition: parse.c:252
void printLangdefFlags(bool withListHeader, bool machinable, FILE *fp)
Definition: parse.c:4906
void matchLanguageRegex(const langType language, const vString *const line)
Definition: parse.c:4272
void printLanguageSubparsers(const langType language, bool withListHeader, bool machinable, FILE *fp)
Definition: parse.c:4872
void enableLanguages(const bool state)
Definition: parse.c:1761
void printLanguageRoles(const langType language, const char *letters, bool withListHeader, bool machinable, FILE *fp)
Definition: parse.c:3145
void enableLanguage(const langType language, const bool state)
Definition: parse.c:1742
bool makeKindDescriptionsPseudoTags(const langType language, const ptagDesc *pdesc)
Definition: parse.c:4544
bool checkRegex(void)
Definition: lregex.c:2768
bool isLanguageVisible(const langType language)
Definition: parse.c:226
void printLanguageParameters(const langType language, bool withListHeader, bool machinable, FILE *fp)
Definition: parse.c:3243
void printRegexFlags(bool withListHeader, bool machinable, FILE *fp)
Definition: lregex.c:2185
unsigned int getXpathFileSpecCount(const langType language)
Definition: parse.c:4423
void printKinddefFlags(bool withListHeader, bool machinable, FILE *fp)
Definition: parse.c:4918
void notifyLanguageRegexInputStart(langType language)
Definition: parse.c:3732
bool parseFile(const char *const fileName)
Definition: parse.c:4076
bool doesLanguageAllowNullTag(const langType language)
Definition: parse.c:246
void printLanguageKinds(const langType language, bool allKindFields, bool withListHeader, bool machinable, FILE *fp)
Definition: parse.c:3195
bool hasLanguageMultilineRegexPatterns(const langType language)
Definition: parse.c:4249
roleDefinition * getLanguageRole(const langType language, int kindIndex, int roleIndex)
Definition: parse.c:362
void useRegexMethod(const langType language)
Definition: parse.c:4311
bool makeKindSeparatorsPseudoTags(const langType language, const ptagDesc *pdesc)
Definition: parse.c:4444
roleDefinition * getLanguageRoleForName(const langType language, int kindIndex, const char *roleName)
Definition: parse.c:367
bool isLanguageKindRefOnly(const langType language, int kindIndex)
Definition: parse.c:2235
void addLanguageAlias(const langType language, const char *alias)
Definition: parse.c:1731
void printLanguageList(void)
Definition: parse.c:3548
void addLanguageExtensionMap(const langType language, const char *extension, bool exclusiveInAllLanguages)
Definition: parse.c:1720
void enableDefaultFileKind(bool state)
Definition: parse.c:2023
bool parseRawBuffer(const char *fileName, unsigned char *buffer, size_t bufferSize, const langType language, void *clientData)
Definition: parse.c:4158
bool removeLanguagePatternMap(const langType language, const char *const pattern)
Definition: parse.c:1665
void printMultilineRegexFlags(bool withListHeader, bool machinable, FILE *fp)
Definition: lregex.c:2201
void clearLanguageMap(const langType language)
Definition: parse.c:1636
void matchLanguageMultitableRegex(const langType language, const vString *const allLines)
Definition: parse.c:4197
bool doesParserRequireMemoryStream(const langType language)
Definition: parse.c:4043
bool runParserInNarrowedInputStream(const langType language, unsigned long startLine, long startCharOffset, unsigned long endLine, long endCharOffset, unsigned long sourceLineOffset, int promise)
Definition: parse.c:3889
void matchLanguageMultilineRegex(const langType language, const vString *const allLines)
Definition: parse.c:4191
bool makeExtraDescriptionsPseudoTags(const langType language, const ptagDesc *pdesc)
Definition: parse.c:4637
void addLanguagePatternMap(const langType language, const char *ptrn, bool exclusiveInAllLanguages)
Definition: parse.c:1680
void printParserStatisticsIfUsed(langType lang)
Definition: parse.c:3798
const tagXpathTableTable * getXpathTableTable(const langType language, unsigned int nth)
Definition: parse.c:4412
void installLanguageAliasesDefault(const langType language)
Definition: parse.c:1602
xpathFileSpec * getXpathFileSpec(const langType language, unsigned int nth)
Definition: parse.c:4433
langmapType
Definition: parse_p.h:33
@ LMAP_EXTENSION
Definition: parse_p.h:35
@ LMAP_ALL
Definition: parse_p.h:36
@ LMAP_PATTERN
Definition: parse_p.h:34
@ LMAP_TABLE_OUTPUT
Definition: parse_p.h:37
bool parseFileWithMio(const char *const fileName, MIO *mio, void *clientData)
Definition: parse.c:4108
void notifyLanguageRegexInputEnd(langType language)
Definition: parse.c:3737
void clearLanguageAliases(const langType language)
Definition: parse.c:1643
void freeParserResources(void)
Definition: parse.c:1954
void installLanguageMapDefaults(void)
Definition: parse.c:1592
bool processLanguageRegexOption(langType language, enum regexParserType regptype, const char *const parameter)
Definition: parse.c:4286
unsigned int countLanguageRoles(const langType language, int kindIndex)
Definition: parse.c:312
kindDefinition * getLanguageKindForName(const langType language, const char *kindName)
Definition: parse.c:349
unsigned int countLanguageKinds(const langType language)
Definition: parse.c:307
int defineLanguageKind(const langType language, kindDefinition *def, freeKindDefFunc freeKindDef)
Definition: parse.c:301
#define PEG_PARSER_LIST
Definition: parsers_p.h:41
#define PARSER_LIST
Definition: parsers_p.h:45
#define XML_PARSER_LIST
Definition: parsers_p.h:26
#define YAML_PARSER_LIST
Definition: parsers_p.h:34
MIO:
Definition: mio.c:136
#define EXTERNAL_PARSER_LIST
Definition: tm_parsers.h:16
int langType
Definition: types.h:13