tree-sitter-iec61131-3-st
A tree-sitter grammar for the IEC 61131-3 (3rd edition, 2013) Structured Text language. Standard-compliant first; vendor dialects (Beckhoff TwinCAT, Codesys, B&R, Siemens, Rockwell) live in separate dialect grammars that extend this base.
Highlights
- Full IEC 61131-3 ST coverage: POUs, all VAR blocks, every type, every operator with correct precedence, all statements, OOP, namespaces.
- Case-insensitive keywords; identifiers preserve case.
- Error-tolerant parser — useful trees on partial / broken input.
- Six editor query files (highlights / locals / tags / folds / indents / injections) using the standard tree-sitter capture vocabulary.
- Bindings for Node, Rust, Python, and Go.
- Designed for vendor-dialect extension via
grammar(base, {…})— see EXTENDING.
Install
Node
npm install tree-sitter tree-sitter-iec61131-3-st
Rust
tree-sitter-iec61131-3-st = "0.0"
Python
pip install tree-sitter tree-sitter-iec61131-3-st
Go
import iec61131_3_st "github.com/HeytalePazguato/tree-sitter-iec61131-3-st/bindings/go"