Flatland Model Layout Sheet Parser
Project description
Model Layout Parser
Parses an *.mls file (Model Layout Style) to yield an abstract syntax tree using python named tuples
Why you need this
You need to process an *.mls file to layout a model diagram
Installation
Create or use a python 3.13+ environment. Then
% pip install mls-parser
At this point you can invoke the parser via the command line or from your python script.
From your python script
You need this import statement at a minimum:
from mls-parser.parser import LayoutParser
You can then specify a path as shown:
result = LayoutParser.parse_file(file_input=path_to_file, debug=False)
In either case, result
will be a list of parsed class model elements. You may find the header of the visitor.py
file helpful in interpreting these results.
From the command line
This is not the intended usage scenario, but may be helpful for testing or exploration. Since the parser may generate some diagnostic info you may want to create a fresh working directory and cd into it first. From there...
% mls elevator.mls
The .xcm extension is not necessary, but the file must contain xcm text. See this repository's wiki for more about the mls language. The grammar is defined in the layout.peg file. (if the link breaks after I do some update to the code, just browse through the code looking for the class_model.peg file, and let me know so I can fix it)
You can also specify a debug option like this:
% mls elevator.mls -D
This will create a scrall-diagnostics folder in your current working directory and deposite a coupel of PDFs defining
the parse of both the class model grammar: class_model_tree.pdf
and your supplied text: class_model.pdf
.
You should also see a file named mls-parser.log
in a diagnostics directory within your working directory
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mls_parser-0.0.2.tar.gz
.
File metadata
- Download URL: mls_parser-0.0.2.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cea7bd57fe77c5aa20943a47fe8423465729885db8dcbba4fdb3a24d42adc4dc |
|
MD5 | 70fba3b1a682b3370294cd6b67b98337 |
|
BLAKE2b-256 | c169052bef6d983ae6f81ed98eeabf8105c1e36a447818aa874b596edf7143c4 |
File details
Details for the file mls_parser-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: mls_parser-0.0.2-py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71632e955d534bd803573b73d2439c29053b62874cf67d56bad715e49e85fd3e |
|
MD5 | b33b5742286e5771ee1f45ac1523d631 |
|
BLAKE2b-256 | 168d75ba916ded41655a78a8741857d4e8dff04d2d012e66c82de30f5798007a |