MVP-2.1 · SCL dialect in the PLC parser #275

Open
opened 2026-09-20 20:18:24 +00:00 by sharang · 0 comments
Owner

Goal

Siemens TIA is a pilot input, but today the PLC front end only reads raw .scl as generic Structured Text, so Siemens-specific syntax breaks the parse. Teach the existing lexer/parser/AST the SCL dialect so TIA Openness exports parse as first-class PLC code.

What to change

In pipeline/plc/{lexer,parser,ast}.rs:

  • #local temporaries, "DB".member qualified access and %I / %Q / %M addressing.
  • REGION blocks.
  • { … } attributes.
  • ORGANIZATION_BLOCK / DATA_BLOCK / TYPE, BEGIN, VAR_TEMP and VAR CONSTANT.
  • Accept .scl, .db and .udt files; record .awl (STL) as unsupported rather than failing.

Acceptance

  • The synthetic TIA SCL/DB/UDT fixtures (MVP-2.5) parse without error and produce an AST the existing rules can run over.
  • .awl input is recorded as unsupported on the scan run with the offending file named, and the run still completes.
  • No regression on the CODESYS ST golden baselines.
  • Unit tests per dialect feature in pipeline/plc/.
## Goal Siemens TIA is a pilot input, but today the PLC front end only reads raw `.scl` as generic Structured Text, so Siemens-specific syntax breaks the parse. Teach the existing lexer/parser/AST the SCL dialect so TIA Openness exports parse as first-class PLC code. ## What to change In `pipeline/plc/{lexer,parser,ast}.rs`: - `#local` temporaries, `"DB".member` qualified access and `%I` / `%Q` / `%M` addressing. - `REGION` blocks. - `{ … }` attributes. - `ORGANIZATION_BLOCK` / `DATA_BLOCK` / `TYPE`, `BEGIN`, `VAR_TEMP` and `VAR CONSTANT`. - Accept `.scl`, `.db` and `.udt` files; record `.awl` (STL) as **unsupported** rather than failing. ## Acceptance - [ ] The synthetic TIA SCL/DB/UDT fixtures (MVP-2.5) parse without error and produce an AST the existing rules can run over. - [ ] `.awl` input is recorded as `unsupported` on the scan run with the offending file named, and the run still completes. - [ ] No regression on the CODESYS ST golden baselines. - [ ] Unit tests per dialect feature in `pipeline/plc/`.
sharang added this to the Production MVP milestone 2026-09-20 20:18:24 +00:00
sharang added the enhancement label 2026-09-20 20:18:24 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: platform/pruefwerk#275