Public API
Numbat
provides a class SourcetrailDB
created to be easily used by external projects to create Sourcetrail projects. It provides methods to:
- manage the database file;
- record symbols (according to their types);
- record references (links) between symbols;
- record a file and information related to the source code it contained.
numbat.SourcetrailDB
This class implement a wrapper to Sourcetrail internal database, it is able to create, edit and delete the underlying sqlite3 database used by Sourcetrail.
exists
classmethod
This method check if there is a Sourcetrail db with the given path. If the provided path does not end with the sourcetrail db correct suffix. It will be added.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
Path | str
|
The path to test |
required |
Returns:
Type | Description |
---|---|
bool
|
a bool |
open
classmethod
This method allow to open an existing sourcetrail database
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
Path | str
|
The path to the existing database |
required |
clear |
bool
|
If set to True the database is cleared (Optional) |
False
|
Returns:
Type | Description |
---|---|
SourcetrailDB
|
the SourcetrailDB object corresponding to the given DB |
create
classmethod
This method allow to create a sourcetrail database
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
Path | str
|
The path to the new database |
required |
Returns:
Type | Description |
---|---|
SourcetrailDB
|
the SourcetrailDB object corresponding to the given DB path |
commit
This method allow to commit changes made to a sourcetrail database. Any change made to the database using this API will be lost if not committed before closing the database.
Returns:
Type | Description |
---|---|
None
|
None |
close
This method allow to close a sourcetrail database. The database must be closed after use in order to liberate memory and resources allocated for it.
Returns:
Type | Description |
---|---|
None
|
None |
record_symbol_node
record_symbol_node(
name="",
prefix="",
postfix="",
delimiter=NameHierarchy.NAME_DELIMITER_CXX,
parent_id=None,
is_indexed=True,
)
Record a "SYMBOL" symbol into the DB
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the element to insert |
''
|
prefix |
str
|
The prefix of the element to insert |
''
|
postfix |
str
|
The postfix of the element to insert |
''
|
delimiter |
str
|
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used |
NAME_DELIMITER_CXX
|
parent_id |
int
|
The identifier of the class in which the method is defined. |
None
|
is_indexed |
bool
|
if the element is explicit or non-indexed |
True
|
Returns:
Type | Description |
---|---|
int | None
|
The identifier of the new class or None if it could not be inserted |
record_type_node
record_type_node(
name="",
prefix="",
postfix="",
delimiter=NameHierarchy.NAME_DELIMITER_CXX,
parent_id=None,
is_indexed=True,
)
Record a TYPE symbol into the DB
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the element to insert |
''
|
prefix |
str
|
The prefix of the element to insert |
''
|
postfix |
str
|
The postfix of the element to insert |
''
|
delimiter |
str
|
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used |
NAME_DELIMITER_CXX
|
parent_id |
int
|
The identifier of the class in which the method is defined. |
None
|
is_indexed |
bool
|
if the element is explicit or non-indexed |
True
|
Returns:
Type | Description |
---|---|
int | None
|
The identifier of the new class or None if it could not be inserted |
record_buitin_type_node
record_buitin_type_node(
name="",
prefix="",
postfix="",
delimiter=NameHierarchy.NAME_DELIMITER_CXX,
parent_id=None,
is_indexed=True,
)
Record a BUILTIN_TYPE symbol into the DB
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the element to insert |
''
|
prefix |
str
|
The prefix of the element to insert |
''
|
postfix |
str
|
The postfix of the element to insert |
''
|
delimiter |
str
|
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used |
NAME_DELIMITER_CXX
|
parent_id |
int
|
The identifier of the class in which the method is defined. |
None
|
is_indexed |
bool
|
if the element is explicit or non-indexed |
True
|
Returns:
Type | Description |
---|---|
int | None
|
The identifier of the new class or None if it could not be inserted |
record_module
record_module(
name="",
prefix="",
postfix="",
delimiter=NameHierarchy.NAME_DELIMITER_CXX,
parent_id=None,
is_indexed=True,
)
Record a MODULE symbol into the DB
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the element to insert |
''
|
prefix |
str
|
The prefix of the element to insert |
''
|
postfix |
str
|
The postfix of the element to insert |
''
|
delimiter |
str
|
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used |
NAME_DELIMITER_CXX
|
parent_id |
int
|
The identifier of the class in which the method is defined. |
None
|
is_indexed |
bool
|
if the element is explicit or non-indexed |
True
|
Returns:
Type | Description |
---|---|
int | None
|
The identifier of the new class or None if it could not be inserted |
record_namespace
record_namespace(
name="",
prefix="",
postfix="",
delimiter=NameHierarchy.NAME_DELIMITER_CXX,
parent_id=None,
is_indexed=True,
)
Record a NAMESPACE symbol into the DB
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the element to insert |
''
|
prefix |
str
|
The prefix of the element to insert |
''
|
postfix |
str
|
The postfix of the element to insert |
''
|
delimiter |
str
|
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used |
NAME_DELIMITER_CXX
|
parent_id |
int
|
The identifier of the class in which the method is defined. |
None
|
is_indexed |
bool
|
if the element is explicit or non-indexed |
True
|
Returns:
Type | Description |
---|---|
int | None
|
The identifier of the new class or None if it could not be inserted |
record_package
record_package(
name="",
prefix="",
postfix="",
delimiter=NameHierarchy.NAME_DELIMITER_CXX,
parent_id=None,
is_indexed=True,
)
Record a PACKAGE symbol into the DB
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the element to insert |
''
|
prefix |
str
|
The prefix of the element to insert |
''
|
postfix |
str
|
The postfix of the element to insert |
''
|
delimiter |
str
|
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used |
NAME_DELIMITER_CXX
|
parent_id |
int
|
The identifier of the class in which the method is defined. |
None
|
is_indexed |
bool
|
if the element is explicit or non-indexed |
True
|
Returns:
Type | Description |
---|---|
int | None
|
The identifier of the new class or None if it could not be inserted |
record_struct
record_struct(
name="",
prefix="",
postfix="",
delimiter=NameHierarchy.NAME_DELIMITER_CXX,
parent_id=None,
is_indexed=True,
)
Record a STRUCT symbol into the DB
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the element to insert |
''
|
prefix |
str
|
The prefix of the element to insert |
''
|
postfix |
str
|
The postfix of the element to insert |
''
|
delimiter |
str
|
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used |
NAME_DELIMITER_CXX
|
parent_id |
int
|
The identifier of the class in which the method is defined. |
None
|
is_indexed |
bool
|
if the element is explicit or non-indexed |
True
|
Returns:
Type | Description |
---|---|
int | None
|
The identifier of the new class or None if it could not be inserted |
record_class
record_class(
name="",
prefix="",
postfix="",
delimiter=NameHierarchy.NAME_DELIMITER_CXX,
parent_id=None,
is_indexed=True,
)
Record a CLASS symbol into the DB
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the element to insert |
''
|
prefix |
str
|
The prefix of the element to insert |
''
|
postfix |
str
|
The postfix of the element to insert |
''
|
delimiter |
str
|
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used |
NAME_DELIMITER_CXX
|
parent_id |
int
|
The identifier of the class in which the method is defined. |
None
|
is_indexed |
bool
|
if the element is explicit or non-indexed |
True
|
Returns:
Type | Description |
---|---|
int | None
|
The identifier of the new class or None if it could not be inserted |
record_interface
record_interface(
name="",
prefix="",
postfix="",
delimiter=NameHierarchy.NAME_DELIMITER_CXX,
parent_id=None,
is_indexed=True,
)
Record a INTERFACE symbol into the DB
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the element to insert |
''
|
prefix |
str
|
The prefix of the element to insert |
''
|
postfix |
str
|
The postfix of the element to insert |
''
|
delimiter |
str
|
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used |
NAME_DELIMITER_CXX
|
parent_id |
int
|
The identifier of the class in which the method is defined. |
None
|
is_indexed |
bool
|
if the element is explicit or non-indexed |
True
|
Returns:
Type | Description |
---|---|
int | None
|
The identifier of the new class or None if it could not be inserted |
record_annotation
record_annotation(
name="",
prefix="",
postfix="",
delimiter=NameHierarchy.NAME_DELIMITER_CXX,
parent_id=None,
is_indexed=True,
)
Record a ANNOTATION symbol into the DB
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the element to insert |
''
|
prefix |
str
|
The prefix of the element to insert |
''
|
postfix |
str
|
The postfix of the element to insert |
''
|
delimiter |
str
|
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used |
NAME_DELIMITER_CXX
|
parent_id |
int
|
The identifier of the class in which the method is defined. |
None
|
is_indexed |
bool
|
if the element is explicit or non-indexed |
True
|
Returns:
Type | Description |
---|---|
int | None
|
The identifier of the new class or None if it could not be inserted |
record_global_variable
record_global_variable(
name="",
prefix="",
postfix="",
delimiter=NameHierarchy.NAME_DELIMITER_CXX,
parent_id=None,
is_indexed=True,
)
Record a GLOBAL_VARIABLE symbol into the DB
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the element to insert |
''
|
prefix |
str
|
The prefix of the element to insert |
''
|
postfix |
str
|
The postfix of the element to insert |
''
|
delimiter |
str
|
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used |
NAME_DELIMITER_CXX
|
parent_id |
int
|
The identifier of the class in which the method is defined. |
None
|
is_indexed |
bool
|
if the element is explicit or non-indexed |
True
|
Returns:
Type | Description |
---|---|
int | None
|
The identifier of the new class or None if it could not be inserted |
record_field
record_field(
name="",
prefix="",
postfix="",
delimiter=NameHierarchy.NAME_DELIMITER_CXX,
parent_id=None,
is_indexed=True,
)
Record a FIELD symbol into the DB
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the element to insert |
''
|
prefix |
str
|
The prefix of the element to insert |
''
|
postfix |
str
|
The postfix of the element to insert |
''
|
delimiter |
str
|
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used |
NAME_DELIMITER_CXX
|
parent_id |
int
|
The identifier of the class in which the method is defined. |
None
|
is_indexed |
bool
|
if the element is explicit or non-indexed |
True
|
Returns:
Type | Description |
---|---|
int | None
|
The identifier of the new class or None if it could not be inserted |
record_function
record_function(
name="",
prefix="",
postfix="",
delimiter=NameHierarchy.NAME_DELIMITER_CXX,
parent_id=None,
is_indexed=True,
)
Record a FUNCTION symbol into the DB
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the element to insert |
''
|
prefix |
str
|
The prefix of the element to insert |
''
|
postfix |
str
|
The postfix of the element to insert |
''
|
delimiter |
str
|
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used |
NAME_DELIMITER_CXX
|
parent_id |
int
|
The identifier of the class in which the method is defined. |
None
|
is_indexed |
bool
|
if the element is explicit or non-indexed |
True
|
Returns:
Type | Description |
---|---|
int | None
|
The identifier of the new class or None if it could not be inserted |
record_method
record_method(
name="",
prefix="",
postfix="",
delimiter=NameHierarchy.NAME_DELIMITER_CXX,
parent_id=None,
is_indexed=True,
)
Record a METHOD symbol into the DB
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the element to insert |
''
|
prefix |
str
|
The prefix of the element to insert |
''
|
postfix |
str
|
The postfix of the element to insert |
''
|
delimiter |
str
|
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used |
NAME_DELIMITER_CXX
|
parent_id |
int
|
The identifier of the class in which the method is defined. |
None
|
is_indexed |
bool
|
if the element is explicit or non-indexed |
True
|
Returns:
Type | Description |
---|---|
int | None
|
The identifier of the new class or None if it could not be inserted |
record_enum
record_enum(
name="",
prefix="",
postfix="",
delimiter=NameHierarchy.NAME_DELIMITER_CXX,
parent_id=None,
is_indexed=True,
)
Record a ENUM symbol into the DB
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the element to insert |
''
|
prefix |
str
|
The prefix of the element to insert |
''
|
postfix |
str
|
The postfix of the element to insert |
''
|
delimiter |
str
|
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used |
NAME_DELIMITER_CXX
|
parent_id |
int
|
The identifier of the class in which the method is defined. |
None
|
is_indexed |
bool
|
if the element is explicit or non-indexed |
True
|
Returns:
Type | Description |
---|---|
int | None
|
The identifier of the new class or None if it could not be inserted |
record_enum_constant
record_enum_constant(
name="",
prefix="",
postfix="",
delimiter=NameHierarchy.NAME_DELIMITER_CXX,
parent_id=None,
is_indexed=True,
)
Record a ENUM_CONSTANT symbol into the DB
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the element to insert |
''
|
prefix |
str
|
The prefix of the element to insert |
''
|
postfix |
str
|
The postfix of the element to insert |
''
|
delimiter |
str
|
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used |
NAME_DELIMITER_CXX
|
parent_id |
int
|
The identifier of the class in which the method is defined. |
None
|
is_indexed |
bool
|
if the element is explicit or non-indexed |
True
|
Returns:
Type | Description |
---|---|
int | None
|
The identifier of the new class or None if it could not be inserted |
record_typedef_node
record_typedef_node(
name="",
prefix="",
postfix="",
delimiter=NameHierarchy.NAME_DELIMITER_CXX,
parent_id=None,
is_indexed=True,
)
Record a TYPEDEF symbol into the DB
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the element to insert |
''
|
prefix |
str
|
The prefix of the element to insert |
''
|
postfix |
str
|
The postfix of the element to insert |
''
|
delimiter |
str
|
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used |
NAME_DELIMITER_CXX
|
parent_id |
int
|
The identifier of the class in which the method is defined. |
None
|
is_indexed |
bool
|
if the element is explicit or non-indexed |
True
|
Returns:
Type | Description |
---|---|
int | None
|
The identifier of the new class or None if it could not be inserted |
record_type_parameter_node
record_type_parameter_node(
name="",
prefix="",
postfix="",
delimiter=NameHierarchy.NAME_DELIMITER_CXX,
parent_id=None,
is_indexed=True,
)
Record a TYPE_PARAMETER symbol into the DB
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the element to insert |
''
|
prefix |
str
|
The prefix of the element to insert |
''
|
postfix |
str
|
The postfix of the element to insert |
''
|
delimiter |
str
|
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used |
NAME_DELIMITER_CXX
|
parent_id |
int
|
The identifier of the class in which the method is defined. |
None
|
is_indexed |
bool
|
if the element is explicit or non-indexed |
True
|
Returns:
Type | Description |
---|---|
int | None
|
The identifier of the new class or None if it could not be inserted |
record_macro
record_macro(
name="",
prefix="",
postfix="",
delimiter=NameHierarchy.NAME_DELIMITER_CXX,
parent_id=None,
is_indexed=True,
)
Record a MACRO symbol into the DB
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the element to insert |
''
|
prefix |
str
|
The prefix of the element to insert |
''
|
postfix |
str
|
The postfix of the element to insert |
''
|
delimiter |
str
|
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used |
NAME_DELIMITER_CXX
|
parent_id |
int
|
The identifier of the class in which the method is defined. |
None
|
is_indexed |
bool
|
if the element is explicit or non-indexed |
True
|
Returns:
Type | Description |
---|---|
int | None
|
The identifier of the new class or None if it could not be inserted |
record_union
record_union(
name="",
prefix="",
postfix="",
delimiter=NameHierarchy.NAME_DELIMITER_CXX,
parent_id=None,
is_indexed=True,
)
Record a UNION symbol into the DB
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the element to insert |
''
|
prefix |
str
|
The prefix of the element to insert |
''
|
postfix |
str
|
The postfix of the element to insert |
''
|
delimiter |
str
|
The delimiter of the element, if the element has a parent, it will not be taken into account as the parent delimiter will be used |
NAME_DELIMITER_CXX
|
parent_id |
int
|
The identifier of the class in which the method is defined. |
None
|
is_indexed |
bool
|
if the element is explicit or non-indexed |
True
|
Returns:
Type | Description |
---|---|
int | None
|
The identifier of the new class or None if it could not be inserted |
record_ref_member
Add a member reference (aka an edge) between two elements
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source_id |
int
|
The source identifier |
required |
dest_id |
int
|
The destination identifier |
required |
Returns:
Type | Description |
---|---|
int
|
the reference id |
record_ref_type_usage
Add a TYPE_USAGE reference (aka an edge) between two elements
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source_id |
int
|
The source identifier |
required |
dest_id |
int
|
The destination identifier |
required |
Returns:
Type | Description |
---|---|
int
|
the reference id |
record_ref_usage
Add a USAGE reference (aka an edge) between two elements
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source_id |
int
|
The source identifier |
required |
dest_id |
int
|
The destination identifier |
required |
Returns:
Type | Description |
---|---|
int
|
the reference id |
record_ref_call
Add a CALL reference (aka an edge) between two elements
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source_id |
int
|
The source identifier |
required |
dest_id |
int
|
The destination identifier |
required |
Returns:
Type | Description |
---|---|
int
|
the reference id |
record_ref_inheritance
Add an INHERITANCE reference (aka an edge) between two elements
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source_id |
int
|
The source identifier |
required |
dest_id |
int
|
The destination identifier |
required |
Returns:
Type | Description |
---|---|
int
|
the reference id |
record_ref_override
Add an OVERRIDE reference (aka an edge) between two elements
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source_id |
int
|
The source identifier |
required |
dest_id |
int
|
The destination identifier |
required |
Returns:
Type | Description |
---|---|
int
|
the reference id |
record_ref_type_argument
Add a TYPE_ARGUMENT reference (aka an edge) between two elements
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source_id |
int
|
The source identifier |
required |
dest_id |
int
|
The destination identifier |
required |
Returns:
Type | Description |
---|---|
int
|
the reference id |
record_ref_template_specialization
Add a TEMPLATE_SPECIALIZATION reference (aka an edge) between two elements
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source_id |
int
|
The source identifier |
required |
dest_id |
int
|
The destination identifier |
required |
Returns:
Type | Description |
---|---|
int
|
the reference id |
record_ref_include
Add an INCLUDE reference (aka an edge) between two elements
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source_id |
int
|
The source identifier |
required |
dest_id |
int
|
The destination identifier |
required |
Returns:
Type | Description |
---|---|
int
|
the reference id |
record_ref_import
Add an import reference (aka an edge) between two elements
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source_id |
int
|
The source identifier (who imports) |
required |
dest_id |
int
|
The destination identifier (who is imported) |
required |
Returns:
Type | Description |
---|---|
int
|
the reference id |
record_ref_bundled_edges
Add a BUNDLED_EDGES reference (aka an edge) between two elements
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source_id |
int
|
The source identifier |
required |
dest_id |
int
|
The destination identifier |
required |
Returns:
Type | Description |
---|---|
int
|
the reference id |
record_ref_macro_usage
Add a MACRO_USAGE reference (aka an edge) between two elements
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source_id |
int
|
The source identifier |
required |
dest_id |
int
|
The destination identifier |
required |
Returns:
Type | Description |
---|---|
int
|
the reference id |
record_ref_annotation_usage
Add an ANNOTATION_USAGE reference (aka an edge) between two elements
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source_id |
int
|
The source identifier |
required |
dest_id |
int
|
The destination identifier |
required |
Returns:
Type | Description |
---|---|
int
|
the reference id |
record_reference_to_unsolved_symbol
record_reference_to_unsolved_symbol(
symbol_id,
reference_type,
file_id,
start_line,
start_column,
end_line,
end_column,
)
Record a reference to an unsolved symbol.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
symbol_id |
int
|
The identifier of the symbol |
required |
reference_type |
EdgeType
|
The type of reference |
required |
file_id |
int
|
The identifier of the source file in which the symbol is located |
required |
start_line |
int
|
The line at which the element starts. |
required |
start_column |
int
|
The column at which the element starts. |
required |
end_line |
int
|
The line at which the element ends. |
required |
end_column |
int
|
The line at which the element ends. |
required |
Returns:
Type | Description |
---|---|
int
|
The identifier of the new reference |
record_reference_is_ambiguous
Add an indication in the database to tell that the reference is ambiguous
Parameters:
Name | Type | Description | Default |
---|---|---|---|
reference_id |
int
|
the identifier of the reference |
required |
Returns:
Type | Description |
---|---|
None
|
None |
record_file
Record a source file in the database
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
Path
|
The path to the existing source file |
required |
indexed |
bool
|
A boolean that indicates if the source file was indexed by the parser |
True
|
Returns:
Type | Description |
---|---|
int
|
The identifier of the inserted file |
record_file_language
Set the language of an existing file inside the database
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id_ |
int
|
The identifier of the file |
required |
language |
str
|
A string that indicate the programming language of the file |
required |
Returns:
Type | Description |
---|---|
None
|
None |
record_symbol_location
Record a new source location of type TOKEN
Parameters:
Name | Type | Description | Default |
---|---|---|---|
symbol_id |
int
|
The identifier of the symbol |
required |
file_id |
int
|
The identifier of the source file in which the symbol is located |
required |
start_line |
int
|
The line at which the element starts. |
required |
start_column |
int
|
The column at which the element starts. |
required |
end_line |
int
|
The line at which the element ends. |
required |
end_column |
int
|
The line at which the element ends. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
record_symbol_scope_location
Record a new source location of type SCOPE
Parameters:
Name | Type | Description | Default |
---|---|---|---|
symbol_id |
int
|
The identifier of the symbol |
required |
file_id |
int
|
The identifier of the source file in which the symbol is located |
required |
start_line |
int
|
The line at which the element starts. |
required |
start_column |
int
|
The column at which the element starts. |
required |
end_line |
int
|
The line at which the element ends. |
required |
end_column |
int
|
The line at which the element ends. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
record_symbol_signature_location
record_symbol_signature_location(
symbol_id, file_id, start_line, start_column, end_line, end_column
)
Record a new source location of type SCOPE
Parameters:
Name | Type | Description | Default |
---|---|---|---|
symbol_id |
int
|
The identifier of the symbol |
required |
file_id |
int
|
The identifier of the source file in which the symbol is located |
required |
start_line |
int
|
The line at which the element starts. |
required |
start_column |
int
|
The column at which the element starts. |
required |
end_line |
int
|
The line at which the element ends. |
required |
end_column |
int
|
The line at which the element ends. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
record_reference_location
Record a new reference location of type TOKEN
Parameters:
Name | Type | Description | Default |
---|---|---|---|
reference_id |
int
|
The reference identifier |
required |
file_id |
int
|
The identifier of the source file in which the symbol is located |
required |
start_line |
int
|
The line at which the element starts. |
required |
start_column |
int
|
The column at which the element starts. |
required |
end_line |
int
|
The line at which the element ends. |
required |
end_column |
int
|
The line at which the element ends. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
record_qualifier_location
Record a new source location of type QUALIFIER
Parameters:
Name | Type | Description | Default |
---|---|---|---|
symbol_id |
int
|
The identifier of the symbol |
required |
file_id |
int
|
The identifier of the source file in which the symbol is located |
required |
start_line |
int
|
The line at which the element starts. |
required |
start_column |
int
|
The column at which the element starts. |
required |
end_line |
int
|
The line at which the element ends. |
required |
end_column |
int
|
The line at which the element ends. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
record_local_symbol
Record a new local symbol
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the new local symbol |
required |
Returns:
Type | Description |
---|---|
int
|
The identifier of the new local symbol |
record_local_symbol_location
Record a new source location of type LOCAL_SYMBOL
Parameters:
Name | Type | Description | Default |
---|---|---|---|
symbol_id |
int
|
The identifier of the symbol |
required |
file_id |
int
|
The identifier of the source file in which the symbol is located |
required |
start_line |
int
|
The line at which the element starts. |
required |
start_column |
int
|
The column at which the element starts. |
required |
end_line |
int
|
The line at which the element ends. |
required |
end_column |
int
|
The line at which the element ends. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
record_atomic_source_range
Record a new source location of type ATOMIC_RANGE
Parameters:
Name | Type | Description | Default |
---|---|---|---|
symbol_id |
int
|
The identifier of the symbol |
required |
file_id |
int
|
The identifier of the source file in which the symbol is located |
required |
start_line |
int
|
The line at which the element starts. |
required |
start_column |
int
|
The column at which the element starts. |
required |
end_line |
int
|
The line at which the element ends. |
required |
end_column |
int
|
The line at which the element ends. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
record_error
Record a new indexer error in the database
Parameters:
Name | Type | Description | Default |
---|---|---|---|
msg |
str
|
The description of the error |
required |
fatal |
bool
|
A boolean indicating if the error stop the execution of the parser |
required |
file_id |
int
|
The identifier of the source file being parsed |
required |
start_line |
int
|
The line at which the element starts. |
required |
start_column |
int
|
The column at which the element starts. |
required |
end_line |
int
|
The line at which the element ends. |
required |
end_column |
int
|
The line at which the element ends. |
required |
Returns:
Type | Description |
---|---|
None
|
None |