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)  

tm_parser.c File Reference
#include "tm_parser.h"
#include "tm_ctags.h"
#include <string.h>
Include dependency graph for tm_parser.c:

Go to the source code of this file.

Classes

struct  TMParserMapEntry
 
struct  TMSubparserMapEntry
 
struct  TMParserMap
 

Macros

#define map_CPP   map_C
 
#define map_FORTRAN   map_F77
 
#define map_FERITE   map_C
 
#define map_GLSL   map_C
 
#define map_ZEPHIR   map_PHP
 
#define MAP_ENTRY(lang)   [TM_PARSER_##lang] = {map_##lang, G_N_ELEMENTS(map_##lang)}
 
#define SUBPARSER_MAP_ENTRY(lang, sublang, map)   add_subparser(TM_PARSER_##lang, TM_PARSER_##sublang, map, G_N_ELEMENTS(map))
 

Functions

 G_STATIC_ASSERT (G_N_ELEMENTS(parser_map)==TM_PARSER_COUNT)
 
TMTagType tm_parser_get_tag_type (gchar kind, TMParserType lang)
 
gchar tm_parser_get_tag_kind (TMTagType type, TMParserType lang)
 
static void add_subparser (TMParserType lang, TMParserType sublang, TMSubparserMapEntry *map, guint map_size)
 
static void init_subparser_map (void)
 
TMTagType tm_parser_get_subparser_type (TMParserType lang, TMParserType sublang, TMTagType type)
 
void tm_parser_verify_type_mappings (void)
 
const gchar * tm_parser_context_separator (TMParserType lang)
 
gboolean tm_parser_has_full_context (TMParserType lang)
 
gboolean tm_parser_langs_compatible (TMParserType lang, TMParserType other)
 

Variables

static GHashTable * subparser_map = NULL
 
static TMParserMapEntry map_C []
 
static TMParserMapEntry map_JAVA []
 
static TMParserMapEntry map_MAKEFILE []
 
static TMParserMapEntry map_PASCAL []
 
static TMParserMapEntry map_PERL []
 
static TMParserMapEntry map_PHP []
 
static TMParserMapEntry map_PYTHON []
 
static TMParserMapEntry map_LATEX []
 
static TMParserMapEntry map_BIBTEX []
 
static TMParserMapEntry map_ASM []
 
static TMParserMapEntry map_CONF []
 
static TMParserMapEntry map_SQL []
 
static TMParserMapEntry map_DOCBOOK []
 
static TMParserMapEntry map_ERLANG []
 
static TMParserMapEntry map_CSS []
 
static TMParserMapEntry map_RUBY []
 
static TMParserMapEntry map_TCL []
 
static TMParserMapEntry map_SH []
 
static TMParserMapEntry map_D []
 
static TMParserMapEntry map_DIFF []
 
static TMParserMapEntry map_VHDL []
 
static TMParserMapEntry map_LUA []
 
static TMParserMapEntry map_JAVASCRIPT []
 
static TMParserMapEntry map_HASKELL []
 
static TMParserMapEntry map_CSHARP []
 
static TMParserMapEntry map_FREEBASIC []
 
static TMParserMapEntry map_HAXE []
 
static TMParserMapEntry map_REST []
 
static TMParserMapEntry map_HTML []
 
static TMSubparserMapEntry subparser_HTML_javascript_map []
 
static TMParserMapEntry map_F77 []
 
static TMParserMapEntry map_MATLAB []
 
static TMParserMapEntry map_VALA []
 
static TMParserMapEntry map_ACTIONSCRIPT []
 
static TMParserMapEntry map_NSIS []
 
static TMParserMapEntry map_MARKDOWN []
 
static TMParserMapEntry map_TXT2TAGS []
 
static TMParserMapEntry map_ABC []
 
static TMParserMapEntry map_VERILOG []
 
static TMParserMapEntry map_R []
 
static TMParserMapEntry map_COBOL []
 
static TMParserMapEntry map_OBJC []
 
static TMParserMapEntry map_ASCIIDOC []
 
static TMParserMapEntry map_ABAQUS []
 
static TMParserMapEntry map_RUST []
 
static TMParserMapEntry map_GO []
 
static TMParserMapEntry map_JSON []
 
static TMParserMapEntry map_POWERSHELL []
 
static TMParserMapEntry map_JULIA []
 
static TMParserMap parser_map []
 

Macro Definition Documentation

◆ map_CPP

#define map_CPP   map_C

Definition at line 65 of file tm_parser.c.

◆ MAP_ENTRY

#define MAP_ENTRY (   lang)    [TM_PARSER_##lang] = {map_##lang, G_N_ELEMENTS(map_##lang)}

Definition at line 551 of file tm_parser.c.

◆ map_FERITE

#define map_FERITE   map_C

Definition at line 362 of file tm_parser.c.

◆ map_FORTRAN

#define map_FORTRAN   map_F77

Definition at line 360 of file tm_parser.c.

◆ map_GLSL

#define map_GLSL   map_C

Definition at line 370 of file tm_parser.c.

◆ map_ZEPHIR

#define map_ZEPHIR   map_PHP

Definition at line 523 of file tm_parser.c.

◆ SUBPARSER_MAP_ENTRY

#define SUBPARSER_MAP_ENTRY (   lang,
  sublang,
  map 
)    add_subparser(TM_PARSER_##lang, TM_PARSER_##sublang, map, G_N_ELEMENTS(map))

Definition at line 665 of file tm_parser.c.

Function Documentation

◆ add_subparser()

static void add_subparser ( TMParserType  lang,
TMParserType  sublang,
TMSubparserMapEntry map,
guint  map_size 
)
static

Definition at line 645 of file tm_parser.c.

References subparser_map.

◆ G_STATIC_ASSERT()

G_STATIC_ASSERT ( G_N_ELEMENTS(parser_map = =TM_PARSER_COUNT)

◆ init_subparser_map()

static void init_subparser_map ( void  )
static

Definition at line 667 of file tm_parser.c.

References subparser_HTML_javascript_map, and SUBPARSER_MAP_ENTRY.

Referenced by tm_parser_get_subparser_type().

◆ tm_parser_context_separator()

const gchar * tm_parser_context_separator ( TMParserType  lang)

◆ tm_parser_get_subparser_type()

TMTagType tm_parser_get_subparser_type ( TMParserType  lang,
TMParserType  sublang,
TMTagType  type 
)

Definition at line 673 of file tm_parser.c.

References entry, init_subparser_map(), subparser_map, and tm_tag_undef_t.

Referenced by init_tag().

◆ tm_parser_get_tag_kind()

gchar tm_parser_get_tag_kind ( TMTagType  type,
TMParserType  lang 
)

Definition at line 629 of file tm_parser.c.

References TMParserMap::entries, entry, parser_map, and TMParserMap::size.

◆ tm_parser_get_tag_type()

TMTagType tm_parser_get_tag_type ( gchar  kind,
TMParserType  lang 
)

Definition at line 613 of file tm_parser.c.

References TMParserMap::entries, entry, parser_map, TMParserMap::size, and tm_tag_undef_t.

Referenced by init_tag(), and init_tag_from_file_ctags().

◆ tm_parser_has_full_context()

gboolean tm_parser_has_full_context ( TMParserType  lang)

Definition at line 794 of file tm_parser.c.

Referenced by update_parents_table().

◆ tm_parser_langs_compatible()

gboolean tm_parser_langs_compatible ( TMParserType  lang,
TMParserType  other 
)

◆ tm_parser_verify_type_mappings()

void tm_parser_verify_type_mappings ( void  )

Variable Documentation

◆ map_ABAQUS

TMParserMapEntry map_ABAQUS[]
static
Initial value:
= {
}
@ tm_tag_interface_t
Interface (Java only)
Definition: tm_parser.h:30
@ tm_tag_class_t
Class declaration.
Definition: tm_parser.h:25
@ tm_tag_member_t
Member variable of class/struct.
Definition: tm_parser.h:31

Definition at line 481 of file tm_parser.c.

◆ map_ABC

TMParserMapEntry map_ABC[]
static
Initial value:
= {
}
@ tm_tag_struct_t
Struct declaration.
Definition: tm_parser.h:36

Definition at line 421 of file tm_parser.c.

◆ map_ACTIONSCRIPT

TMParserMapEntry map_ACTIONSCRIPT[]
static
Initial value:
= {
}
@ tm_tag_function_t
Function definition.
Definition: tm_parser.h:29
@ tm_tag_package_t
Package (Java only)
Definition: tm_parser.h:34
@ tm_tag_method_t
Class method (Java only)
Definition: tm_parser.h:32
@ tm_tag_variable_t
Variable.
Definition: tm_parser.h:39
@ tm_tag_other_t
Other (non C/C++/Java tag)
Definition: tm_parser.h:44
@ tm_tag_externvar_t
Extern or forward declaration.
Definition: tm_parser.h:40
@ tm_tag_macro_t
Macro (without arguments)
Definition: tm_parser.h:41

Definition at line 389 of file tm_parser.c.

◆ map_ASCIIDOC

TMParserMapEntry map_ASCIIDOC[]
static
Initial value:
= {
}
@ tm_tag_undef_t
Unknown type.
Definition: tm_parser.h:24
@ tm_tag_namespace_t
Namespace declaration.
Definition: tm_parser.h:33

Definition at line 470 of file tm_parser.c.

◆ map_ASM

TMParserMapEntry map_ASM[]
static
Initial value:

Definition at line 145 of file tm_parser.c.

◆ map_BIBTEX

TMParserMapEntry map_BIBTEX[]
static
Initial value:

Definition at line 127 of file tm_parser.c.

◆ map_C

TMParserMapEntry map_C[]
static
Initial value:
= {
{'g', tm_tag_enum_t},
}
@ tm_tag_enumerator_t
Enumerator value.
Definition: tm_parser.h:27
@ tm_tag_union_t
Union.
Definition: tm_parser.h:38
@ tm_tag_prototype_t
Function prototype.
Definition: tm_parser.h:35
@ tm_tag_typedef_t
Typedef.
Definition: tm_parser.h:37
@ tm_tag_enum_t
Enum declaration.
Definition: tm_parser.h:26

Definition at line 48 of file tm_parser.c.

◆ map_COBOL

TMParserMapEntry map_COBOL[]
static
Initial value:

Definition at line 443 of file tm_parser.c.

◆ map_CONF

TMParserMapEntry map_CONF[]
static
Initial value:
= {
}

Definition at line 153 of file tm_parser.c.

◆ map_CSHARP

TMParserMapEntry map_CSHARP[]
static
Initial value:
= {
{'g', tm_tag_enum_t},
}
@ tm_tag_field_t
Field (Java only)
Definition: tm_parser.h:28

Definition at line 287 of file tm_parser.c.

◆ map_CSS

TMParserMapEntry map_CSS[]
static
Initial value:
= {
}

Definition at line 202 of file tm_parser.c.

◆ map_D

TMParserMapEntry map_D[]
static
Initial value:

Definition at line 226 of file tm_parser.c.

◆ map_DIFF

TMParserMapEntry map_DIFF[]
static
Initial value:
= {
}

Definition at line 242 of file tm_parser.c.

◆ map_DOCBOOK

TMParserMapEntry map_DOCBOOK[]
static
Initial value:

Definition at line 185 of file tm_parser.c.

◆ map_ERLANG

TMParserMapEntry map_ERLANG[]
static
Initial value:
= {
}

Definition at line 194 of file tm_parser.c.

◆ map_F77

TMParserMapEntry map_F77[]
static
Initial value:

Definition at line 341 of file tm_parser.c.

◆ map_FREEBASIC

TMParserMapEntry map_FREEBASIC[]
static
Initial value:

Definition at line 303 of file tm_parser.c.

◆ map_GO

TMParserMapEntry map_GO[]
static
Initial value:

Definition at line 502 of file tm_parser.c.

◆ map_HASKELL

TMParserMapEntry map_HASKELL[]
static
Initial value:

Definition at line 280 of file tm_parser.c.

◆ map_HAXE

TMParserMapEntry map_HAXE[]
static
Initial value:

Definition at line 313 of file tm_parser.c.

◆ map_HTML

TMParserMapEntry map_HTML[]
static
Initial value:

Definition at line 330 of file tm_parser.c.

◆ map_JAVA

TMParserMapEntry map_JAVA[]
static
Initial value:

Definition at line 67 of file tm_parser.c.

◆ map_JAVASCRIPT

TMParserMapEntry map_JAVASCRIPT[]
static
Initial value:

Definition at line 269 of file tm_parser.c.

◆ map_JSON

TMParserMapEntry map_JSON[]
static
Initial value:
= {
}

Definition at line 513 of file tm_parser.c.

◆ map_JULIA

TMParserMapEntry map_JULIA[]
static
Initial value:

Definition at line 531 of file tm_parser.c.

◆ map_LATEX

TMParserMapEntry map_LATEX[]
static
Initial value:

Definition at line 118 of file tm_parser.c.

◆ map_LUA

TMParserMapEntry map_LUA[]
static
Initial value:
= {
}

Definition at line 265 of file tm_parser.c.

◆ map_MAKEFILE

TMParserMapEntry map_MAKEFILE[]
static
Initial value:
= {
}

Definition at line 77 of file tm_parser.c.

◆ map_MARKDOWN

TMParserMapEntry map_MARKDOWN[]
static
Initial value:
= {
}

Definition at line 411 of file tm_parser.c.

◆ map_MATLAB

TMParserMapEntry map_MATLAB[]
static
Initial value:
= {
}

Definition at line 365 of file tm_parser.c.

◆ map_NSIS

TMParserMapEntry map_NSIS[]
static
Initial value:

Definition at line 404 of file tm_parser.c.

◆ map_OBJC

TMParserMapEntry map_OBJC[]
static
Initial value:

Definition at line 454 of file tm_parser.c.

◆ map_PASCAL

TMParserMapEntry map_PASCAL[]
static
Initial value:
= {
}

Definition at line 82 of file tm_parser.c.

◆ map_PERL

TMParserMapEntry map_PERL[]
static
Initial value:

Definition at line 87 of file tm_parser.c.

◆ map_PHP

TMParserMapEntry map_PHP[]
static
Initial value:

Definition at line 96 of file tm_parser.c.

◆ map_POWERSHELL

TMParserMapEntry map_POWERSHELL[]
static
Initial value:
= {
}

Definition at line 526 of file tm_parser.c.

◆ map_PYTHON

TMParserMapEntry map_PYTHON[]
static
Initial value:

Definition at line 107 of file tm_parser.c.

◆ map_R

TMParserMapEntry map_R[]
static
Initial value:
= {
}

Definition at line 437 of file tm_parser.c.

◆ map_REST

TMParserMapEntry map_REST[]
static
Initial value:

Definition at line 322 of file tm_parser.c.

◆ map_RUBY

TMParserMapEntry map_RUBY[]
static
Initial value:
= {
}

Definition at line 208 of file tm_parser.c.

◆ map_RUST

TMParserMapEntry map_RUST[]
static
Initial value:

Definition at line 487 of file tm_parser.c.

◆ map_SH

TMParserMapEntry map_SH[]
static
Initial value:
= {
}

Definition at line 222 of file tm_parser.c.

◆ map_SQL

TMParserMapEntry map_SQL[]
static
Initial value:

Definition at line 158 of file tm_parser.c.

◆ map_TCL

TMParserMapEntry map_TCL[]
static
Initial value:

Definition at line 215 of file tm_parser.c.

◆ map_TXT2TAGS

TMParserMapEntry map_TXT2TAGS[]
static
Initial value:
= {
}

Definition at line 416 of file tm_parser.c.

◆ map_VALA

TMParserMapEntry map_VALA[]
static
Initial value:

Definition at line 373 of file tm_parser.c.

◆ map_VERILOG

TMParserMapEntry map_VERILOG[]
static
Initial value:

Definition at line 426 of file tm_parser.c.

◆ map_VHDL

TMParserMapEntry map_VHDL[]
static
Initial value:

Definition at line 247 of file tm_parser.c.

◆ parser_map

TMParserMap parser_map[]
static

◆ subparser_HTML_javascript_map

TMSubparserMapEntry subparser_HTML_javascript_map[]
static
Initial value:

Definition at line 337 of file tm_parser.c.

Referenced by init_subparser_map().

◆ subparser_map

GHashTable* subparser_map = NULL
static

Definition at line 45 of file tm_parser.c.

Referenced by add_subparser(), and tm_parser_get_subparser_type().