capabilities · overview

Transpilation and semantic analysis

The 2ot compiler combines a lossless IEC 61131-3 syntax pipeline with semantic analysis, target-aware lowering and independently routed diagnostic and protocol surfaces.

Lossless CST fidelity

Standard PLC compilers can discard whitespace, formatting and comments as they parse. For a bi-directional source workflow that is not good enough. 2ot parses into a lossless Concrete Syntax Tree so source structure can survive analysis and target-aware transformations without treating formatting as disposable noise.

Target-aware normalization passes

The mutation pipeline applies localized rewriting, polyfilling and normalization across divergent IEC dialects. Passes are isolated so target quirks can be handled without turning the parser into a vendor-specific code path.

Normalization passes and their target effects
Pass / FolderTargetImpact
HoistInlineVarDeclarationsPassVariable hoistingExtracts inline VAR blocks into the preamble for stricter target formatting.
StripBeginMarkersPassSyntax pruningRemoves legacy BEGIN markers while preserving the surrounding source structure.
LowerUnsupportedRuntimeCallsPassCall substitutionMaps unsupported runtime calls to deterministic target strategies.
DomainCallRewriteFolderNative spellingRewrites domain functions to the spelling expected by the selected target provider.
NormalizeElseIfFolderConditional logicNormalizes conditional syntax when a target requires a different IEC spelling.
diagnostics

Fast compiler feedback

Use 2ot check --fast for the low-latency compiler loop, with vendor-aligned diagnostic mapping and structured enrichments for repair workflows.

→ Open
lsp

Language Server Protocol

Expose the same compiler-backed diagnostics, symbols and semantic language operations over the standard LSP surface.

→ Open
testing

Multi-vendor verification

Keep target behavior honest with shared suites, runtime-equivalence checks and vendor-specific execution paths.

→ Open

HIR, OOP lowering and semantic passes

2ot resolves scopes, types, call relationships and target semantics before lowering features such as inheritance, interfaces and unsupported runtime constructs into forms that the target environment can accept. The compiler can therefore reason about source meaning before it chooses the vendor-specific representation.

Transpilation is a first-class route

2ot transpile enters the compiler pipeline directly for CST/HIR/TIR analysis, lowering and target emission. The gateway keeps that compiler work separate from vendor automation so source transformation does not depend on an IDE process being available.