Update Russian translation (#3918)
[geany-mirror.git] / src / tagmanager / tm_parser.h
blob750492fb143133c1b7521a490d2446c20365d22f
1 /*
3 * Copyright (c) 2014 The Geany contributors
5 * This source code is released for free distribution under the terms of the
6 * GNU General Public License.
8 */
10 #ifndef TM_PARSER_H
11 #define TM_PARSER_H
13 #include <glib.h>
15 G_BEGIN_DECLS
17 /**
18 Types of tags. It is a bitmask so that multiple tag types can
19 be used simultaneously by 'OR'-ing them bitwise.
20 e.g. tm_tag_class_t | tm_tag_struct_t
22 typedef enum
24 tm_tag_undef_t = 0, /**< Unknown type */
25 tm_tag_class_t = 1, /**< Class declaration */
26 tm_tag_enum_t = 2, /**< Enum declaration */
27 tm_tag_enumerator_t = 4, /**< Enumerator value */
28 tm_tag_field_t = 8, /**< Field (Java only) */
29 tm_tag_function_t = 16, /**< Function definition */
30 tm_tag_interface_t = 32, /**< Interface (Java only) */
31 tm_tag_member_t = 64, /**< Member variable of class/struct */
32 tm_tag_method_t = 128, /**< Class method (Java only) */
33 tm_tag_namespace_t = 256, /**< Namespace declaration */
34 tm_tag_package_t = 512, /**< Package (Java only) */
35 tm_tag_prototype_t = 1024, /**< Function prototype */
36 tm_tag_struct_t = 2048, /**< Struct declaration */
37 tm_tag_typedef_t = 4096, /**< Typedef */
38 tm_tag_union_t = 8192, /**< Union */
39 tm_tag_variable_t = 16384, /**< Variable */
40 tm_tag_externvar_t = 32768, /**< Extern or forward declaration */
41 tm_tag_macro_t = 65536, /**< Macro (without arguments) */
42 tm_tag_macro_with_arg_t = 131072, /**< Parameterized macro */
43 tm_tag_local_var_t = 262144, /**< Local variable (inside function) */
44 tm_tag_other_t = 524288, /**< Other (non C/C++/Java tag) */
45 tm_tag_include_t = 1048576, /**< C/C++ included header file name */
46 tm_tag_max_t = 2097151 /**< Maximum value of TMTagType */
47 } TMTagType;
50 /** @gironly
51 * A integral type which can hold known parser type IDs
52 **/
53 typedef gint TMParserType;
56 /* keep in sync with icon names in symbols.c */
57 /**
58 * Identifiers of icons used by Geany in the symbol tree, in the autocompletion popup,
59 * and in the goto popup.
61 typedef enum
63 TM_ICON_CLASS,
64 TM_ICON_MACRO,
65 TM_ICON_MEMBER,
66 TM_ICON_METHOD,
67 TM_ICON_NAMESPACE,
68 TM_ICON_OTHER,
69 TM_ICON_STRUCT,
70 TM_ICON_VAR,
71 TM_ICON_NONE,
72 TM_N_ICONS = TM_ICON_NONE
73 } TMIcon;
76 #ifdef GEANY_PRIVATE
78 /* keep in sync with tm_parsers.h and parser_map in tm_parser.c */
79 enum
81 TM_PARSER_NONE = -2, /* keep in sync with ctags LANG_IGNORE */
82 TM_PARSER_C = 0,
83 TM_PARSER_CPP,
84 TM_PARSER_JAVA,
85 TM_PARSER_MAKEFILE,
86 TM_PARSER_PASCAL,
87 TM_PARSER_PERL,
88 TM_PARSER_PHP,
89 TM_PARSER_PYTHON,
90 TM_PARSER_LATEX,
91 TM_PARSER_ASM,
92 TM_PARSER_CONF,
93 TM_PARSER_SQL,
94 TM_PARSER_DOCBOOK,
95 TM_PARSER_ERLANG,
96 TM_PARSER_CSS,
97 TM_PARSER_RUBY,
98 TM_PARSER_TCL,
99 TM_PARSER_SH,
100 TM_PARSER_D,
101 TM_PARSER_FORTRAN,
102 TM_PARSER_GDSCRIPT,
103 TM_PARSER_DIFF,
104 TM_PARSER_VHDL,
105 TM_PARSER_LUA,
106 TM_PARSER_JAVASCRIPT,
107 TM_PARSER_HASKELL,
108 TM_PARSER_CSHARP,
109 TM_PARSER_FREEBASIC,
110 TM_PARSER_HAXE,
111 TM_PARSER_REST,
112 TM_PARSER_HTML,
113 TM_PARSER_ADA,
114 TM_PARSER_CUDA,
115 TM_PARSER_MATLAB,
116 TM_PARSER_VALA,
117 TM_PARSER_ACTIONSCRIPT,
118 TM_PARSER_NSIS,
119 TM_PARSER_MARKDOWN,
120 TM_PARSER_TXT2TAGS,
121 TM_PARSER_ABC,
122 TM_PARSER_VERILOG,
123 TM_PARSER_R,
124 TM_PARSER_COBOL,
125 TM_PARSER_OBJC,
126 TM_PARSER_ASCIIDOC,
127 TM_PARSER_ABAQUS,
128 TM_PARSER_RUST,
129 TM_PARSER_GO,
130 TM_PARSER_JSON,
131 TM_PARSER_ZEPHIR,
132 TM_PARSER_POWERSHELL,
133 TM_PARSER_JULIA,
134 TM_PARSER_BIBTEX,
135 TM_PARSER_CPREPROCESSOR,
136 TM_PARSER_TCLOO,
137 TM_PARSER_CLOJURE,
138 TM_PARSER_LISP,
139 TM_PARSER_TYPESCRIPT,
140 TM_PARSER_BATCH,
141 TM_PARSER_AUTOIT,
142 TM_PARSER_RAKU,
143 TM_PARSER_OCAML,
144 TM_PARSER_LDSCRIPT,
145 TM_PARSER_COUNT
149 void tm_parser_verify_type_mappings(void);
151 TMTagType tm_parser_get_tag_type(gchar kind, TMParserType lang);
153 gchar tm_parser_get_tag_kind(TMTagType type, TMParserType lang);
155 gint tm_parser_get_sidebar_group(TMParserType lang, TMTagType type);
157 const gchar *tm_parser_get_sidebar_info(TMParserType lang, gint group, guint *icon);
159 TMTagType tm_parser_get_subparser_type(TMParserType lang, TMParserType sublang, TMTagType type);
161 gint tm_parser_scope_autocomplete_suffix(TMParserType lang, const gchar *str);
163 const gchar *tm_parser_get_constructor_method(TMParserType lang);
165 gboolean tm_parser_is_anon_name(TMParserType lang, const gchar *name);
167 gchar *tm_parser_update_scope(TMParserType lang, gchar *scope);
169 gboolean tm_parser_enable_role(TMParserType lang, gchar kind);
171 gboolean tm_parser_enable_kind(TMParserType lang, gchar kind);
173 gchar *tm_parser_format_variable(TMParserType lang, const gchar *name, const gchar *type,
174 const gchar *scope);
176 gchar *tm_parser_format_function(TMParserType lang, const gchar *fname, const gchar *args,
177 const gchar *retval, const gchar *scope);
179 const gchar *tm_parser_scope_separator(TMParserType lang);
181 const gchar *tm_parser_scope_separator_printable(TMParserType lang);
183 gboolean tm_parser_has_full_scope(TMParserType lang);
185 gboolean tm_parser_langs_compatible(TMParserType lang, TMParserType other);
187 #endif /* GEANY_PRIVATE */
189 G_END_DECLS
191 #endif /* TM_PARSER_H */