This repository contains parsers for various EPICS-related domain-specific languages.
Currently, it contains parsers for:
- EPICS' database (
.db
and.dbd
) files - EPICS'
.cmd
files - EPICS'
.sub
files - EPICS' macro substitution syntax
- StreamDevice's protocol files
- Seq's SNL files
You can use these parsers to validate the syntax of your files. This may be
useful for example to validate .db
files during the compilation of an IOC.
The quickest way to do this is by installing the tree-sitter
command-line
tool.
Then, clone this repository somewhere, and add it to the global tree-sitter
config by running tree-sitter init-config
and adding the path under
"parser-directories"
in ~/.config/tree-sitter/config.json
. (Source)
Important
The path to add in "parser-directories"
is the parent path
of where you cloned this repository.
For example,
if you have cloned this repository under /path/to/tree-sitter-epics
,
you need to set:
{
"parser-directories": ["/path/to"]
}
You can now use tree-sitter parse /path/to/file.db
to validate an EPICS
database file.
Each of these parsers comes with bindings in various languages. Here are the links to the documentation of tree-sitter for those various languages: