EPICS Database¶
Functions and classes for parsing from template/db files using tree-sitter-epics.
- class py_tree_sitter_epics.epicsdb.Database(*, documentation: str | None, records: list[Record])¶
Represents an EPICS database file.
Added in version 0.3.0.
- class py_tree_sitter_epics.epicsdb.DbParser¶
To handle tree-sitter parsing.
Deprecated since version 0.3.0: Use
parse_str()instead- build_records_list() list¶
From a tree-sitter node built a list of object ‘db’ class.
Deprecated since version 0.3.0: Use
parse_str()and theRecord.fieldsinstead.
- parse(text: str) None¶
Parse the text in argument to build the tree of the object.
Deprecated since version 0.3.0: Use
parse_str()instead
- exception py_tree_sitter_epics.epicsdb.DbParserError(message: str)¶
DbParser class exception.
Raised when parsing a
.dbfile thattree-sitter-epics-dbcouldn’t parse.
- class py_tree_sitter_epics.epicsdb.Link(*, record_name: str, type_link: str)¶
Represents a Record Link.
- static create_link(field: str) Link¶
Create a Link Class from a link field.
- Returns:
The Link, or
Noneon parse error.
Deprecated since version 0.3.0: Use
parse()instead.
- class py_tree_sitter_epics.epicsdb.Record(*, type: str, name: str, documentation: str | None, fields: dict[str, str], infos: dict[str, str])¶
Represents an EPICS record.
- property description: str | None¶
The documentation or description of the record.
Deprecated since version 0.3.0: Use
documentationinstead
- documentation: str | None¶
The documentation of the record.
The documentation is obtained from adjacent comments before the record, or the
DESCfield, if none defined. For example:# This is # the record documentation record(ai, "...") { # ... }
Or:
record(ai, "...") { field(DESC, "This is the record documentation") }
Added in version 0.3.0.
- py_tree_sitter_epics.epicsdb.parse_bytes(b: bytes) Database¶
Parse the given bytes in EPICS Database format.
Added in version 0.3.0.
- py_tree_sitter_epics.epicsdb.parse_file(file: str | os.PathLike) Database¶
Parse the given
.dbfile.Added in version 0.3.0.