1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! RLL (Relay Ladder Logic) text parser for Rockwell L5X files.
//!
//! Parses the text content of ladder logic rungs into a structured AST.
//!
//! # Example
//!
//! ```
//! use l5x::rll::{parse_rung, RungElement, Operand};
//!
//! let text = "XIC(Start)OTE(Motor);";
//! let result = parse_rung(text);
//! assert!(result.is_parsed());
//! ```
//!
//! # Error Reporting
//!
//! When parsing fails, detailed error context is available:
//!
//! ```
//! use l5x::rll::{parse_rung, ParseError, ErrorContext};
//!
//! let text = "XIC(Tag[incomplete;";
//! let result = parse_rung(text);
//!
//! if let Some(err) = result.error {
//! // Format error with source context
//! let formatted = err.format_with_context(text);
//! // Shows: error: unclosed bracket '[' at position 7
//! // 1 | XIC(Tag[incomplete;
//! // ^ here
//! }
//! ```
pub use *;
pub use *;
pub use *;
pub use parse_rung;