Skip to main content

Executable Class Model Parser

Parses an .xcm executable class model file into an abstract syntax tree for downstream Blueprint modules

Parses an *.xcm file (Executable Class Model) to yield an abstract syntax tree using python named tuples

Why you need this

You need to process an *.xcm file in preparation for populating a database or some other purpose

Installation

Create or use a python 3.11+ environment. Then

% pip install xcm-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 xcm-parser.parser import ClassModelParser

You can then specify a path as shown:

result = ClassModelParser.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...

% xcm elevator.xcm

The .xcm extension is not necessary, but the file must contain xcm text. See this repository's wiki for more about the xcm language. The grammar is defined in the class_model.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:

% xcm elevator.xcm -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 xcm-parser.log in a diagnostics directory within your working directory

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xcm_parser-0.3.7.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xcm_parser-0.3.7-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file xcm_parser-0.3.7.tar.gz.

File metadata

  • Download URL: xcm_parser-0.3.7.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for xcm_parser-0.3.7.tar.gz
Algorithm Hash digest
SHA256 e4244831f9646b574d27a327bf698cc1e741cb25da807cd9ab45d3d6fe57236a
MD5 71c789fa25c27c23ed6247ec5b49bf1f
BLAKE2b-256 c8b0dfa8b5d5022ac3bfded7f408774ccb4426d10365c34d2b7b75b98cfef75d

See more details on using hashes here.

File details

Details for the file xcm_parser-0.3.7-py3-none-any.whl.

File metadata

  • Download URL: xcm_parser-0.3.7-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for xcm_parser-0.3.7-py3-none-any.whl
Algorithm Hash digest
SHA256 88fcdb64da9c6a025e54326aa307078542c1458ae714792b63f45b5eb280cf76
MD5 86c140885f084a5f0435c3d8fd5f257b
BLAKE2b-256 8d049e1c028160c511e45da427e25888d6f2f840e5ac808237e6be016c7bc60f

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.8

2 files

This release

0.3.7 This release

2 files

0.3.6

2 files

0.3.5

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.9

2 files

0.2.8

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page