iec_checker

Static analysis for IEC 61131-3 programs. Currently supports Structured Text, PLCOpen XML and SEL XML input formats.

The Structured Text dialect accepted by the parser is compatible with the matiec transpiler.

Libraries

The codebase is split into four public libraries. Each library has a single top-level module that re-exports its public API.

IECCheckerCoreiec_checker.core

Core data structures shared by every other component: the AST (IECCheckerCore.Syntax), control-flow graph (IECCheckerCore.Cfg), warning representation (IECCheckerCore.Warn), JSON dump format (IECCheckerCore.Dump), PLCOpen XML reader (IECCheckerCore.Plcopen) and SEL XML reader (IECCheckerCore.Sel).

IECCheckerParseriec_checker.parser

The lexer, Menhir grammar and source-location tracking. Turns Structured Text text into the AST defined in IECCheckerCore.Syntax.

IECCheckerAnalysisiec_checker.analysis

Generic semantic analyses that the rule library builds on top of: declaration analysis (IECCheckerAnalysis.Declaration_analysis), use-define chains (IECCheckerAnalysis.Use_define), unused-variable detection (IECCheckerAnalysis.Unused_variable) and cyclomatic-complexity scoring (IECCheckerAnalysis.Cyclomatic_complexity).

IECCheckerLibiec_checker.lib

The actual checks. Implements the PLCOpen Software Construction Guidelines (modules Plcopen_cp1Plcopen_cp28, Plcopen_l10, Plcopen_l17, Plcopen_n3). IECCheckerLib.CheckerLib is the entry point invoked by the iec_checker binary.

Entry points

Version 0.5.0 — generated from commit 088e564 (2026-04-09) on 2026-04-09 08:54:26 UTC