Expand description
XtrkCAD layout file parser in Rust, using a lalrpop parser.
Ported from the Bison++/C++ parser that is part of the Model Railroad System
The parser is invoked as part of the new() class function of the Layout struct. This function takes a layout filename as its only parameter. It opens the file and procedes to parse the file and the parser’s action code populates the Layout struct with the contents of the file. The new() returns the fully populated struct, which can then be accessed via various accessor methods to retrieve information about the layout, including tracks, structures, scenery features, and control features.
Modules§
Structs§
- Aspect
- Signal aspect
- Aspect
List - Signal aspect list
- BZLSegments
- BZLSegments list.
- BZRLine
- BZRLine struct
- BZRLine
Body - A BZRLineBody Struct
- BZSegments
- BZSegments list struct
- Bezier
- Bezier curve track struct
- Bezier
Body - A Bezier Body
- Block
- A Block
- Car
- Car struct
- CarAux
- CarAux – car on layout information
- Control
- A control
- Cornu
- Cornu curve track struct
- Cornu
Body - A Cornu body
- Cornu
Body Element - A CornuBodyElement
- Curve
- Curve track struct
- Drawing
- Drawing struct
- FBlock
- A FBlock liist
- FBlock
Element - A FBlock element
- File
Location - File location structure. The file’s location is a column on a line
- Integer
List - A list of integers (u32)
- Joint
- Joint track struct
- Layer
- Layer struct
- Layout
- Layout structure. Contains a parsed layout file.
- Lexer
- Lexer structure Reads characters from the layout file and returns Tokens to the Parser. Handles all of the low-level character level processing
- Note
- Note struct
- Sensor
- A sensor
- Signal
- A signal
- Straight
- Straight track struct
- Structure
- Structure struct
- Structure
Body - A list of Structure Body Elements
- Switch
Motor - A switch motor control
- Text
Item - A text item
- Track
Body - A track body (conventual track)
- Turnout
- Turnout track struct
- Turnout
Body - A turnout body
- Turntable
- Turntable track struct
Enums§
- BZSegment
- BZSegment elements
- Bezier
Body Element - Bezier Body elements
- Float
OrString - A Float (f64) or String
- Layout
Error - Layout error codes
- Lexical
Error - Lexer errors
- Scale
- Standard scales
- ScanEOL
- Manage special case of parsing Title lines.
- Structure
Body Element - A Structure Body Element
- Tok
- Lexer tokens
- Track
Body Element - A track body element (track ends)
- Track
Body SubElement - A track body sub element
- Turnout
Body Element - TurnoutBodyElements
Type Aliases§
- Spanned
- Lexer result type