Skip to content

epics-extensions/tree-sitter-epics

Repository files navigation

tree-sitter-epics

This repository contains parsers for various EPICS-related domain-specific languages.

Currently, it contains parsers for:

Using these parsers for syntax validation

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.

Using these parsers for more complex tools

Each of these parsers comes with bindings in various languages. Here are the links to the documentation of tree-sitter for those various languages: